[gnome-chess] Use the current filename as the headerbar subtitle



commit 3f7cb7426800139b44c97fe6cd13d3e90853f5e8
Author: Michael Catanzaro <mcatanzaro gnome org>
Date:   Mon Jan 6 16:51:32 2014 -0600

    Use the current filename as the headerbar subtitle

 src/gnome-chess.vala |   14 +++++---------
 1 files changed, 5 insertions(+), 9 deletions(-)
---
diff --git a/src/gnome-chess.vala b/src/gnome-chess.vala
index eac6edc..a6e3e76 100644
--- a/src/gnome-chess.vala
+++ b/src/gnome-chess.vala
@@ -414,16 +414,10 @@ public class Application : Gtk.Application
 
     private void start_game ()
     {
-        if (in_history || game_file == null)
-        {
-            /* Title of the main window */
-            headerbar.set_title (_("Chess"));
-        }
+        if (!in_history && game_file != null)
+            headerbar.set_subtitle (Path.get_basename (game_file.get_path ()));
         else
-        {
-            var path = game_file.get_path ();
-            headerbar.set_title (Path.get_basename (path));
-        }
+            headerbar.set_subtitle (null);
 
         var model = (Gtk.ListStore) history_combo.model;
         model.clear ();
@@ -1859,6 +1853,7 @@ public class Application : Gtk.Application
             {
                 pgn_game.write (save_dialog.get_file ());
                 saved_filename = save_dialog.get_filename ();
+                headerbar.set_subtitle (Path.get_basename (saved_filename));
                 disable_window_action (SAVE_GAME_ACTION_NAME);
                 game_needs_saving = false;
             }
@@ -2016,6 +2011,7 @@ public class Application : Gtk.Application
     {
         in_history = false;
         game_file = null;
+        saved_filename = null;
 
         pgn_game = new PGNGame ();
         var now = new DateTime.now_local ();


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