[gitg] Update title when repository is being reloaded



commit c16ff55ab786b7cc2e3e577ed13b772233f6dd19
Author: Jesse van den Kieboom <jessevdk gmail com>
Date:   Sun Dec 14 18:24:57 2014 +0100

    Update title when repository is being reloaded

 gitg/gitg-window.vala |   29 ++++++++++++++++++++---------
 1 files changed, 20 insertions(+), 9 deletions(-)
---
diff --git a/gitg/gitg-window.vala b/gitg/gitg-window.vala
index 12852f3..67766a9 100644
--- a/gitg/gitg-window.vala
+++ b/gitg/gitg-window.vala
@@ -345,7 +345,7 @@ public class Window : Gtk.ApplicationWindow, GitgExt.Application, Initable
                return window;
        }
 
-       private void repository_changed()
+       private void update_title()
        {
                if (d_repository != null)
                {
@@ -366,7 +366,6 @@ public class Window : Gtk.ApplicationWindow, GitgExt.Application, Initable
                                name = @"$(d_repository.name) ($parent_path)";
 
                                title = @"$name - gitg";
-                               d_infobar.hide();
                        }
                        else
                        {
@@ -384,9 +383,25 @@ public class Window : Gtk.ApplicationWindow, GitgExt.Application, Initable
                        }
                        catch {}
 
-                       d_mode = Mode.ACTIVITY;
-
                        d_header_bar.set_subtitle(Markup.escape_text(head_name));
+               }
+               else
+               {
+                       title = "gitg";
+
+                       d_header_bar.set_title(_("Projects"));
+                       d_header_bar.set_subtitle(null);
+               }
+       }
+
+       private void repository_changed()
+       {
+               update_title();
+               d_infobar.hide();
+
+               if (d_repository != null)
+               {
+                       d_mode = Mode.ACTIVITY;
 
                        d_main_stack.transition_type = Gtk.StackTransitionType.SLIDE_LEFT;
                        d_main_stack.set_visible_child(d_stack_activities);
@@ -397,13 +412,8 @@ public class Window : Gtk.ApplicationWindow, GitgExt.Application, Initable
                }
                else
                {
-                       title = "gitg";
-
                        d_mode = Mode.DASH;
 
-                       d_header_bar.set_title(_("Projects"));
-                       d_header_bar.set_subtitle(null);
-
                        d_main_stack.transition_type = Gtk.StackTransitionType.SLIDE_RIGHT;
                        d_main_stack.set_visible_child(d_dash_scrolled_window);
                        d_activities_switcher.hide();
@@ -476,6 +486,7 @@ public class Window : Gtk.ApplicationWindow, GitgExt.Application, Initable
                                                           null);
 
                        notify_property("repository");
+                       update_title();
                }
                catch {}
        }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]