[gnome-chess/gnome-3-8] Sensibly set sensitivity of claim draw menu option (cherry picked from commit e9c2d4bfa9a4325ae45af7
- From: Michael Catanzaro <mcatanzaro src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-chess/gnome-3-8] Sensibly set sensitivity of claim draw menu option (cherry picked from commit e9c2d4bfa9a4325ae45af7
- Date: Wed, 22 May 2013 20:23:44 +0000 (UTC)
commit 0b7b04ff236a8277a0b76ffdbe20fea85494be62
Author: Michael Catanzaro <mike catanzaro gmail com>
Date: Tue May 21 19:40:04 2013 -0500
Sensibly set sensitivity of claim draw menu option
(cherry picked from commit e9c2d4bfa9a4325ae45af78835042a49734b117c)
src/gnome-chess.vala | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/src/gnome-chess.vala b/src/gnome-chess.vala
index a019b1d..be33fe7 100644
--- a/src/gnome-chess.vala
+++ b/src/gnome-chess.vala
@@ -21,6 +21,7 @@ public class Application : Gtk.Application
private Gtk.Widget undo_button;
private Gtk.Widget resign_menu;
private Gtk.Widget resign_button;
+ private Gtk.Widget claim_draw_menu;
private Gtk.Widget first_move_button;
private Gtk.Widget prev_move_button;
private Gtk.Widget next_move_button;
@@ -87,6 +88,7 @@ public class Application : Gtk.Application
undo_button = (Gtk.Widget) builder.get_object ("undo_move_button");
resign_menu = (Gtk.Widget) builder.get_object ("resign_item");
resign_button = (Gtk.Widget) builder.get_object ("resign_button");
+ claim_draw_menu = (Gtk.Widget) builder.get_object ("claim_draw_item");
first_move_button = (Gtk.Widget) builder.get_object ("first_move_button");
prev_move_button = (Gtk.Widget) builder.get_object ("prev_move_button");
next_move_button = (Gtk.Widget) builder.get_object ("next_move_button");
@@ -848,6 +850,7 @@ public class Application : Gtk.Application
{
var can_resign = game.n_moves > 0 && game.current_player != opponent;
resign_menu.sensitive = resign_button.sensitive = can_resign;
+ claim_draw_menu.sensitive = can_resign;
/* Can undo once the human player has made a move */
var can_undo = game.n_moves > 0;
@@ -861,6 +864,7 @@ public class Application : Gtk.Application
{
resign_menu.sensitive = resign_button.sensitive = false;
undo_menu.sensitive = undo_button.sensitive = false;
+ claim_draw_menu.sensitive = false;
if (opponent_engine != null)
opponent_engine.stop ();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]