[gnome-chess/gnome-3-12] Return view to the present when engine moves
- From: Michael Catanzaro <mcatanzaro src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-chess/gnome-3-12] Return view to the present when engine moves
- Date: Thu, 26 Jun 2014 21:20:30 +0000 (UTC)
commit 21b3b2dcd8d99fa24af3374f45d644e7970f6be5
Author: Michael Catanzaro <mcatanzaro gnome org>
Date: Wed Jun 25 21:10:35 2014 -0500
Return view to the present when engine moves
If we are looking back in history, force the view to return to the
present as soon as the engine moves.
src/gnome-chess.vala | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/src/gnome-chess.vala b/src/gnome-chess.vala
index 38727f7..27ec0a0 100644
--- a/src/gnome-chess.vala
+++ b/src/gnome-chess.vala
@@ -1010,6 +1010,9 @@ public class Application : Gtk.Application
if (move.number > pgn_game.moves.length ())
pgn_game.moves.append (move.get_san ());
+ /* Automatically return view to the present */
+ scene.move_number = -1;
+
var model = (Gtk.ListStore) history_combo.model;
Gtk.TreeIter iter;
model.append (out iter);
@@ -1017,7 +1020,7 @@ public class Application : Gtk.Application
set_move_text (iter, move);
/* Follow the latest move */
- if (move.number == game.n_moves && scene.move_number == -1)
+ if (move.number == game.n_moves)
history_combo.set_active_iter (iter);
enable_window_action (SAVE_GAME_ACTION_NAME);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]