eliot-dev
[Top][All Lists]
Advanced

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

[Eliot-dev] eliot/wxwin mainframe.cc [cppdic]


From: eliot-dev
Subject: [Eliot-dev] eliot/wxwin mainframe.cc [cppdic]
Date: Tue, 04 Dec 2007 19:32:12 +0000

CVSROOT:        /cvsroot/eliot
Module name:    eliot
Branch:         cppdic
Changes by:     Olivier Teulière <ipkiss>      07/12/04 19:32:12

Modified files:
        wxwin          : mainframe.cc 

Log message:
        WxWidgets interface: restart the game when the dictionary is changed. 
This avoids crashing.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/eliot/wxwin/mainframe.cc?cvsroot=eliot&only_with_tag=cppdic&r1=1.21.2.3&r2=1.21.2.4

Patches:
Index: mainframe.cc
===================================================================
RCS file: /cvsroot/eliot/eliot/wxwin/mainframe.cc,v
retrieving revision 1.21.2.3
retrieving revision 1.21.2.4
diff -u -b -r1.21.2.3 -r1.21.2.4
--- mainframe.cc        21 Nov 2007 16:25:45 -0000      1.21.2.3
+++ mainframe.cc        4 Dec 2007 19:32:11 -0000       1.21.2.4
@@ -171,17 +171,18 @@
     {
         Dictionary *dic = new Dictionary(dicpath.mb_str().data());
         m_dic = dic;
+        m_game = GameFactory::Instance()->createTraining(*m_dic);
+        if (m_game)
+        {
+            m_game->start();
+        }
     }
     catch (std::exception &e)
     {
         wxCommandEvent event;
+        // This will also start a new training game indirectly
         OnMenuConfGameDic(event);
     }
-    m_game = GameFactory::Instance()->createTraining(*m_dic);
-    if (m_game)
-    {
-        m_game->start();
-    }
 
     wxBoxSizer *listsizer = new wxBoxSizer(wxVERTICAL);
     rack = new wxTextCtrl(this, Rack_ID, wxU(""), wxPoint(-1, -1), wxSize(-1, 
-1), wxTE_PROCESS_ENTER);
@@ -606,6 +607,8 @@
             delete m_dic;
             m_dic = dic;
             config.setDicPath(dialog.GetPath(), 
::wxFileNameFromPath(dialog.GetPath()));
+            wxCommandEvent event;
+            OnMenuGameNew(event);
         }
         catch (std::exception &e)
         {
@@ -613,8 +616,6 @@
             dlg.ShowModal();
         }
     }
-    UpdateStatusBar();
-    UpdateFrames();
 }
 
 // ****************




reply via email to

[Prev in Thread] Current Thread [Next in Thread]