[gnome-games] gnome-mahjongg: Enable pause when started due to hint



commit 44d0af26f5bd357d86894d3c043adb77c389beff
Author: Robert Ancell <robert ancell canonical com>
Date:   Mon Aug 20 14:21:59 2012 +1200

    gnome-mahjongg: Enable pause when started due to hint

 gnome-mahjongg/src/game.vala           |    2 +-
 gnome-mahjongg/src/gnome-mahjongg.vala |    6 ++++--
 2 files changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/gnome-mahjongg/src/game.vala b/gnome-mahjongg/src/game.vala
index 0c9c72e..ba54b7d 100644
--- a/gnome-mahjongg/src/game.vala
+++ b/gnome-mahjongg/src/game.vala
@@ -62,7 +62,7 @@ public class Game
 
     public bool started
     {
-        get { return move_number > 1; }
+        get { return clock != null; }
     }
 
     public double elapsed
diff --git a/gnome-mahjongg/src/gnome-mahjongg.vala b/gnome-mahjongg/src/gnome-mahjongg.vala
index e09b80b..d7ca51f 100644
--- a/gnome-mahjongg/src/gnome-mahjongg.vala
+++ b/gnome-mahjongg/src/gnome-mahjongg.vala
@@ -133,8 +133,8 @@ public class Mahjongg : Gtk.Application
 
     private void update_ui ()
     {
-        pause_action.sensitive = game_view.game.move_number > 1;
-        restart_action.sensitive = game_view.game.move_number > 1;
+        pause_action.sensitive = game_view.game.started;
+        restart_action.sensitive = game_view.game.started;
 
         if (game_view.game.paused)
         {
@@ -450,6 +450,8 @@ public class Mahjongg : Gtk.Application
             var match = matches.nth_data (n);
             game_view.game.set_hint (match.tile0, match.tile1);
         }
+
+        update_ui ();
     }
 
     private void about_cb ()



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