[gnome-chess/chess-telepathy-networking-support-664946-rebase: 50/64] [glchess] Make game_end_cb() use only game and it's associated data



commit 7b861bab468ee23309529bb9d029bc8d9114649f
Author: Chandni Verma <chandniverma2112 gmail com>
Date:   Fri Sep 21 02:08:22 2012 +0530

    [glchess] Make game_end_cb() use only game and it's associated data

 src/gnome-chess-application.vala |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/src/gnome-chess-application.vala b/src/gnome-chess-application.vala
index 99cabbb..6e21f01 100644
--- a/src/gnome-chess-application.vala
+++ b/src/gnome-chess-application.vala
@@ -458,6 +458,10 @@ public class Application : Gtk.Application
                 warning ("Chess game has SetUp tag but no FEN tag");
         }
         game = new ChessGame (fen, moves);
+        game.set_data<PGNGame> ("pgn-game", pgn_game);
+        game.set_data<Gtk.InfoBar> ("info-bar", info_bar);
+        game.set_data<Gtk.Label> ("info-title-label", info_title_label);
+        game.set_data<Gtk.Label> ("info-label", info_label);
 
         if (pgn_game.time_control != null)
         {
@@ -912,6 +916,11 @@ public class Application : Gtk.Application
 
     protected void game_end_cb (ChessGame game)
     {
+        PGNGame pgn_game = game.get_data<PGNGame> ("pgn-game");
+        Gtk.InfoBar info_bar = game.get_data<Gtk.InfoBar> ("info-bar");
+        Gtk.Label info_title_label = game.get_data<Gtk.Label> ("info-title-bar");
+        Gtk.Label info_label = game.get_data<Gtk.Label> ("info-label");
+
         string title = "";
         switch (game.result)
         {



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