[gnome-chess/gnome-3-12] Disable new game action before first move



commit 903cd99b7654682c2eed1afc9938fb4372455f9a
Author: Michael Catanzaro <mcatanzaro gnome org>
Date:   Wed Apr 9 08:34:30 2014 -0500

    Disable new game action before first move
    
    Otherwise, pressing this button does nothing
    
    Conflicts:
        src/gnome-chess.vala

 src/gnome-chess.vala |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/src/gnome-chess.vala b/src/gnome-chess.vala
index 3da08cb..f9bf268 100644
--- a/src/gnome-chess.vala
+++ b/src/gnome-chess.vala
@@ -946,6 +946,8 @@ public class Application : Gtk.Application
 
     private void game_move_cb (ChessGame game, ChessMove move)
     {
+        enable_window_action (NEW_GAME_ACTION_NAME);
+
         /* Need to save after each move */
         game_needs_saving = true;
 
@@ -1009,6 +1011,7 @@ public class Application : Gtk.Application
         else
         {
             game_needs_saving = false;
+            disable_window_action (NEW_GAME_ACTION_NAME);
             disable_window_action (SAVE_GAME_ACTION_NAME);
             disable_window_action (SAVE_GAME_AS_ACTION_NAME);
         }
@@ -2123,6 +2126,7 @@ public class Application : Gtk.Application
     {
         game_file = null;
 
+        disable_window_action (NEW_GAME_ACTION_NAME);
         disable_window_action (SAVE_GAME_AS_ACTION_NAME);
 
         pgn_game = new PGNGame ();
@@ -2164,6 +2168,8 @@ public class Application : Gtk.Application
 
     private void load_game (File file) throws Error
     {
+        enable_window_action (NEW_GAME_ACTION_NAME);
+
         var pgn = new PGN.from_file (file);
         pgn_game = pgn.games.nth_data (0);
 


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