[gnome-chess] Return view to the present when engine moves



commit 51b85d3887eecba917a8faa185c73e030e27a064
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 fe7aa2a..5549c3a 100644
--- a/src/gnome-chess.vala
+++ b/src/gnome-chess.vala
@@ -1009,6 +1009,9 @@ public class ChessApplication : 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);
@@ -1016,7 +1019,7 @@ public class ChessApplication : 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]