[gnome-chess/chess-telepathy-networking-support-664946-rebase: 48/64] [glchess] Pass update_history_panel() game, scene and history_model



commit f25785e3b526174896678efdb1bcb6e04ebb1d8d
Author: Chandni Verma <chandniverma2112 gmail com>
Date:   Thu Sep 20 16:46:55 2012 +0530

    [glchess] Pass update_history_panel() game, scene and history_model
    
    This allows update_history_panel() to be used by glchess-channel-handler

 src/gnome-chess-application.vala |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)
---
diff --git a/src/gnome-chess-application.vala b/src/gnome-chess-application.vala
index 91514bf..baa223e 100644
--- a/src/gnome-chess-application.vala
+++ b/src/gnome-chess-application.vala
@@ -376,7 +376,7 @@ public class Application : Gtk.Application
         }
     }
 
-    protected void update_history_panel ()
+    protected void update_history_panel (ChessGame? game, ChessScene scene, Gtk.TreeModel history_model)
     {
         if (game == null)
             return;
@@ -398,8 +398,8 @@ public class Application : Gtk.Application
             if (state.last_move != null)
             {
                 Gtk.TreeIter iter;
-                if (history_combo.model.iter_nth_child (out iter, null, i))
-                    set_move_text (iter, state.last_move, scene, history_combo.model);
+                if ((history_model as Gtk.ListStore).iter_nth_child (out iter, null, i))
+                    set_move_text (iter, state.last_move, scene, history_model);
             }
             i--;
         }
@@ -409,7 +409,7 @@ public class Application : Gtk.Application
 
     protected void scene_changed_cb (ChessScene scene)
     {
-        update_history_panel ();
+        update_history_panel (game, scene, history_combo.model);
     }
 
     private void start_game ()
@@ -476,7 +476,7 @@ public class Application : Gtk.Application
         info_bar.hide ();
         save_menu.sensitive = false;
         save_as_menu.sensitive = false;
-        update_history_panel ();
+        update_history_panel (game, scene, history_combo.model);
         update_control_buttons ();
 
         // TODO: Could both be engines
@@ -855,7 +855,7 @@ public class Application : Gtk.Application
 
         save_menu.sensitive = true;
         save_as_menu.sensitive = true;
-        update_history_panel ();
+        update_history_panel (game, scene, history_combo.model);
         update_control_buttons ();
 
         if (opponent_engine != null)
@@ -886,7 +886,7 @@ public class Application : Gtk.Application
             view.queue_draw ();
         }
 
-        update_history_panel ();
+        update_history_panel (game, scene, history_combo.model);
         update_control_buttons ();
     }
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]