[patch] to lose the game while playing game with robot

2 views
Skip to first unread message

yalong

unread,
May 22, 2009, 10:42:23 PM5/22/09
to gmche...@googlegroups.com
hi,

check below.. any suggestion? :)

thanks, Yalong

Index: src/MainWindow.cc
===================================================================
--- src/MainWindow.cc    (版本 147)
+++ src/MainWindow.cc    (工作副本)
@@ -677,6 +677,30 @@
 
 void MainWindow::on_lose_game()
 {
+    if(board->is_filght_to_robot()){
+        Gtk::MessageDialog dialog(*this, _("end game"), false,
+                                  Gtk::MESSAGE_QUESTION,
+                                  Gtk::BUTTONS_OK_CANCEL);
+        Glib::ustring msg =_("Will you end this game?");
+        dialog.set_secondary_text(msg);
+        int result = dialog.run();
+        switch (result) {
+            case (Gtk::RESPONSE_OK): {
+                m_refTreeModel->clear();
+                board->free_game();
+                change_status();
+                            break;
+                    }
 
+            case (Gtk::RESPONSE_CANCEL): {
+                            break;
+                    }
+
+            default: {
+                            break;
+                    }
+        }
+        return;
+    }
 }
 

lerosua

unread,
May 23, 2009, 7:31:47 AM5/23/09
to gmche...@googlegroups.com
补丁加入,svn 版本154

2009/5/23 yalong <agin...@gmail.com>:

--
Only a nation of educated people could remain free. (Thomas Jefferson,
American president)

Reply all
Reply to author
Forward
0 new messages