Use pageSwitchMapper in some more places
authorunc0rr
Mon, 13 Dec 2010 20:54:18 +0300
changeset 4518 ce95df0398fb
parent 4517 0618b31023dc
child 4519 aee36896d46b
Use pageSwitchMapper in some more places
QTfrontend/hwform.cpp
QTfrontend/hwform.h
--- a/QTfrontend/hwform.cpp	Mon Dec 13 15:02:04 2010 +0100
+++ b/QTfrontend/hwform.cpp	Mon Dec 13 20:54:18 2010 +0300
@@ -121,7 +121,8 @@
     connect(ui.pageMain->BtnSetup, SIGNAL(clicked()), pageSwitchMapper, SLOT(map()));
     pageSwitchMapper->setMapping(ui.pageMain->BtnSetup, ID_PAGE_SETUP);
     
-    connect(ui.pageMain->BtnNet, SIGNAL(clicked()), this, SLOT(GoToNetType()));
+    connect(ui.pageMain->BtnNet, SIGNAL(clicked()), pageSwitchMapper, SLOT(map()));
+    pageSwitchMapper->setMapping(ui.pageMain->BtnNet, ID_PAGE_NETTYPE);
     connect(ui.pageMain->BtnInfo, SIGNAL(clicked()), pageSwitchMapper, SLOT(map()));
     pageSwitchMapper->setMapping(ui.pageMain->BtnInfo, ID_PAGE_INFO);
 
@@ -169,7 +170,9 @@
 
     connect(ui.pageNet->BtnBack, SIGNAL(clicked()), this, SLOT(GoBack()));
     connect(ui.pageNet->BtnSpecifyServer, SIGNAL(clicked()), this, SLOT(NetConnect()));
-    connect(ui.pageNet->BtnNetSvrStart, SIGNAL(clicked()), this, SLOT(GoToNetServer()));
+    connect(ui.pageNet->BtnNetSvrStart, SIGNAL(clicked()), pageSwitchMapper, SLOT(map()));
+    pageSwitchMapper->setMapping(ui.pageNet->BtnNetSvrStart, ID_PAGE_NETSERVER);
+
     connect(ui.pageNet, SIGNAL(connectClicked(const QString &, quint16)), this, SLOT(NetConnectServer(const QString &, quint16)));
 
     connect(ui.pageNetServer->BtnBack, SIGNAL(clicked()), this, SLOT(GoBack()));
@@ -187,7 +190,8 @@
     pageSwitchMapper->setMapping(ui.pageNetGame->pGameCFG, ID_PAGE_DRAWMAP);
 
     connect(ui.pageRoomsList->BtnBack, SIGNAL(clicked()), this, SLOT(GoBack()));
-    connect(ui.pageRoomsList->BtnAdmin, SIGNAL(clicked()), this, SLOT(GoToAdmin()));
+    connect(ui.pageRoomsList->BtnAdmin, SIGNAL(clicked()), pageSwitchMapper, SLOT(map()));
+    pageSwitchMapper->setMapping(ui.pageRoomsList->BtnAdmin, ID_PAGE_ADMIN);
 
     connect(ui.pageInfo->BtnBack, SIGNAL(clicked()), this, SLOT(GoBack()));
 
@@ -196,11 +200,13 @@
     connect(ui.pageSinglePlayer->BtnSimpleGamePage, SIGNAL(clicked()), this, SLOT(SimpleGame()));
     connect(ui.pageSinglePlayer->BtnTrainPage, SIGNAL(clicked()), pageSwitchMapper, SLOT(map()));
     pageSwitchMapper->setMapping(ui.pageSinglePlayer->BtnTrainPage, ID_PAGE_TRAINING);
-    
+
     connect(ui.pageSinglePlayer->BtnCampaignPage, SIGNAL(clicked()), pageSwitchMapper, SLOT(map()));
     pageSwitchMapper->setMapping(ui.pageSinglePlayer->BtnCampaignPage, ID_PAGE_CAMPAIGN);
 
-    connect(ui.pageSinglePlayer->BtnMultiplayer, SIGNAL(clicked()), this, SLOT(GoToMultiplayer()));
+    connect(ui.pageSinglePlayer->BtnMultiplayer, SIGNAL(clicked()), pageSwitchMapper, SLOT(map()));
+    pageSwitchMapper->setMapping(ui.pageSinglePlayer->BtnMultiplayer, ID_PAGE_MULTIPLAYER);
+
     connect(ui.pageSinglePlayer->BtnLoad, SIGNAL(clicked()), this, SLOT(GoToSaves()));
     connect(ui.pageSinglePlayer->BtnDemos, SIGNAL(clicked()), this, SLOT(GoToDemos()));
     connect(ui.pageSinglePlayer->BtnBack, SIGNAL(clicked()), this, SLOT(GoBack()));
@@ -382,11 +388,6 @@
     GoToPage(ID_PAGE_SELECTWEAPON);
 }
 
-void HWForm::GoToMultiplayer()
-{
-    GoToPage(ID_PAGE_MULTIPLAYER);
-}
-
 void HWForm::GoToSaves()
 {
     ui.pagePlayDemo->FillFromDir(PagePlayDemo::RT_Save);
@@ -408,16 +409,6 @@
     GoToPage(ID_PAGE_NET);
 }
 
-void HWForm::GoToNetType()
-{
-    GoToPage(ID_PAGE_NETTYPE);
-}
-
-void HWForm::GoToNetServer()
-{
-    GoToPage(ID_PAGE_NETSERVER);
-}
-
 void HWForm::GoToScheme(int index)
 {
     ui.pageScheme->selectScheme->setCurrentIndex(index);
@@ -436,11 +427,6 @@
     GoToPage(ID_PAGE_SCHEME);
 }
 
-void HWForm::GoToAdmin()
-{
-    GoToPage(ID_PAGE_ADMIN);
-}
-
 void HWForm::OnPageShown(quint8 id, quint8 lastid)
 {
 #ifdef USE_XFIRE
--- a/QTfrontend/hwform.h	Mon Dec 13 15:02:04 2010 +0100
+++ b/QTfrontend/hwform.h	Mon Dec 13 20:54:18 2010 +0300
@@ -60,19 +60,15 @@
     void updateXfire();
 
 private slots:
-    void GoToMultiplayer();
     void GoToSaves();
     void GoToDemos();
     void GoToNet();
-    void GoToNetType();
     void GoToSelectWeapon();
     void GoToSelectWeaponSet(int index);
     void GoToSelectNewWeapon();
-    void GoToNetServer();
     void GoToScheme(int index);
     void GoToEditScheme();
     void GoToNewScheme();
-    void GoToAdmin();
     void GoToPage(int id);
     void GoBack();
     void AssociateFiles();