[gnome-klotski] Disable new game before first move
- From: Michael Catanzaro <mcatanzaro src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-klotski] Disable new game before first move
- Date: Sat, 21 Jun 2014 20:45:39 +0000 (UTC)
commit 79c27a088a94ae806188178b0d04e0d190e66ac7
Author: Michael Catanzaro <mcatanzaro gnome org>
Date: Sat Jun 21 15:45:14 2014 -0500
Disable new game before first move
src/gnome-klotski.vala | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/src/gnome-klotski.vala b/src/gnome-klotski.vala
index cc83da2..5bc0cbd 100644
--- a/src/gnome-klotski.vala
+++ b/src/gnome-klotski.vala
@@ -40,6 +40,8 @@ public class Klotski : Gtk.Application
private SimpleAction next_level_action;
private SimpleAction prev_level_action;
+ private SimpleAction new_game_action;
+
private PuzzleView view;
private Gtk.HeaderBar headerbar;
@@ -455,6 +457,8 @@ public class Klotski : Gtk.Application
Gtk.Window.set_default_icon_name ("gnome-klotski");
add_action_entries (action_entries, this);
+ new_game_action = lookup_action ("new-game") as SimpleAction;
+ new_game_action.set_enabled (false);
next_level_action = lookup_action ("next-level") as SimpleAction;
next_level_action.set_enabled (current_level < level.length - 1);
prev_level_action = lookup_action ("prev-level") as SimpleAction;
@@ -808,12 +812,14 @@ public class Klotski : Gtk.Application
puzzle = new Puzzle (level[current_level].width, level[current_level].height,
level[current_level].data);
puzzle.moved.connect (puzzle_moved_cb);
view.puzzle = puzzle;
+ new_game_action.set_enabled (false);
update_menu_state ();
}
private void puzzle_moved_cb ()
{
update_moves_label ();
+ new_game_action.set_enabled (true);
}
private void update_moves_label ()
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]