[gitg] Set title accordingly to the repository opened



commit ff2c1d80acf894a3842683fb4f406132621ec568
Author: Ignacio Casal Quinteiro <icq gnome org>
Date:   Fri Mar 1 08:23:19 2013 +0100

    Set title accordingly to the repository opened

 gitg/gitg-window.vala |   16 +++++++++-------
 1 files changed, 9 insertions(+), 7 deletions(-)
---
diff --git a/gitg/gitg-window.vala b/gitg/gitg-window.vala
index 9a5c887..2b8e535 100644
--- a/gitg/gitg-window.vala
+++ b/gitg/gitg-window.vala
@@ -77,12 +77,21 @@ public class Window : Gtk.ApplicationWindow, GitgExt.Application, Initable, Gtk.
        {
                if (d_repository != null)
                {
+                       // set title
+                       File? workdir = (d_repository != null) ? d_repository.get_workdir() : null;
+                       if (workdir != null)
+                       {
+                               title = "(%s) - gitg".printf(workdir.get_parse_name());
+                       }
+
                        d_main_stack.set_visible_child(d_paned_views);
                        d_commit_view_switcher.show();
                        d_button_dash.show();
                }
                else
                {
+                       title = "gitg";
+
                        d_main_stack.set_visible_child(d_dash_view);
                        d_commit_view_switcher.hide();
                        d_button_dash.hide();
@@ -238,13 +247,6 @@ public class Window : Gtk.ApplicationWindow, GitgExt.Application, Initable, Gtk.
 
                d_panels.activated.connect(on_panel_activated);
 
-               // FIXME: this should happen when updating the repository
-               File? workdir = (d_repository != null) ? d_repository.get_workdir() : null;
-               if (workdir != null)
-               {
-                       d_header_bar.title = workdir.get_basename();
-               }
-
                // Setup window geometry saving
                Gdk.WindowState window_state = (Gdk.WindowState)d_state_settings.get_int("state");
                if (Gdk.WindowState.MAXIMIZED in window_state) {


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