[gnome-chess] Disable new game action before first move
- From: Michael Catanzaro <mcatanzaro src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-chess] Disable new game action before first move
- Date: Thu, 10 Apr 2014 00:31:17 +0000 (UTC)
commit 02acdd8b981116241cda5d0d765bc6b332e8c57d
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
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 ae4db16..44d263c 100644
--- a/src/gnome-chess.vala
+++ b/src/gnome-chess.vala
@@ -945,6 +945,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;
@@ -1008,6 +1010,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);
}
@@ -2159,6 +2162,7 @@ public class Application : Gtk.Application
game_file = null;
allow_claim_draw_dialog = true;
+ disable_window_action (NEW_GAME_ACTION_NAME);
disable_window_action (SAVE_GAME_AS_ACTION_NAME);
pgn_game = new PGNGame ();
@@ -2200,6 +2204,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]