[gnome-chess] Do not enable pause action when browsing history
- From: Michael Catanzaro <mcatanzaro src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-chess] Do not enable pause action when browsing history
- Date: Wed, 25 Jun 2014 19:21:03 +0000 (UTC)
commit 2962c7ac95de59c89b4cc52d798174b540ab7150
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 | 16 ++++++++--------
1 files changed, 8 insertions(+), 8 deletions(-)
---
diff --git a/src/gnome-chess.vala b/src/gnome-chess.vala
index cc53606..fe7aa2a 100644
--- a/src/gnome-chess.vala
+++ b/src/gnome-chess.vala
@@ -778,16 +778,16 @@ public class ChessApplication : 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)
- {
- if (opponent_engine != null && player == opponent)
- opponent_engine.move ();
- else if (game.can_claim_draw () && allow_claim_draw_dialog)
- present_claim_draw_dialog ();
- }
+
+ if (opponent_engine != null && player == opponent)
+ opponent_engine.move ();
+ else if (game.can_claim_draw () && allow_claim_draw_dialog)
+ present_claim_draw_dialog ();
}
private void set_move_text (Gtk.TreeIter iter, ChessMove move)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]