[gnome-chess/gnome-3-12] Do not enable pause action when browsing history



commit bd3cc760c797392aaae6a1a8fa4541ef4b606e88
Author: Michael Catanzaro <mcatanzaro gnome org>
Date:   Wed Jun 25 14:18:43 2014 -0500

    Do not enable pause action when browsing history
    
    If a game is already completed, moving around in history could cause the
    pause button to become sensitive.

 src/gnome-chess.vala |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/src/gnome-chess.vala b/src/gnome-chess.vala
index 4b05911..e481a3b 100644
--- a/src/gnome-chess.vala
+++ b/src/gnome-chess.vala
@@ -757,10 +757,13 @@ public class Application : Gtk.Application
 
     private void game_turn_cb (ChessGame game, ChessPlayer player)
     {
+        if (!game.is_started)
+            return;
+
         if (game.clock != null)
             enable_window_action (PAUSE_RESUME_ACTION_NAME);
         
-        if (game.is_started && opponent_engine != null && player == opponent)
+        if (opponent_engine != null && player == opponent)
             opponent_engine.move ();
     }
 


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