QTfrontend/hwform.cpp
changeset 8901 505307b9735d
parent 8893 8f92e94d0b32
child 8918 512753ea4b1b
equal deleted inserted replaced
8899:7493dde4ef51 8901:505307b9735d
   284     pageSwitchMapper->setMapping(ui.pageRoomsList->BtnAdmin, ID_PAGE_ADMIN);
   284     pageSwitchMapper->setMapping(ui.pageRoomsList->BtnAdmin, ID_PAGE_ADMIN);
   285 
   285 
   286     connect(ui.pageInfo->BtnSnapshots, SIGNAL(clicked()), this, SLOT(OpenSnapshotFolder()));
   286     connect(ui.pageInfo->BtnSnapshots, SIGNAL(clicked()), this, SLOT(OpenSnapshotFolder()));
   287 
   287 
   288     connect(ui.pageGameStats, SIGNAL(saveDemoRequested()), this, SLOT(saveDemoWithCustomName()));
   288     connect(ui.pageGameStats, SIGNAL(saveDemoRequested()), this, SLOT(saveDemoWithCustomName()));
       
   289     connect(ui.pageGameStats, SIGNAL(restartGameRequested()), this, SLOT(restartGame()));
   289 
   290 
   290     connect(ui.pageSinglePlayer->BtnSimpleGamePage, SIGNAL(clicked()), this, SLOT(SimpleGame()));
   291     connect(ui.pageSinglePlayer->BtnSimpleGamePage, SIGNAL(clicked()), this, SLOT(SimpleGame()));
   291     connect(ui.pageSinglePlayer->BtnTrainPage, SIGNAL(clicked()), pageSwitchMapper, SLOT(map()));
   292     connect(ui.pageSinglePlayer->BtnTrainPage, SIGNAL(clicked()), pageSwitchMapper, SLOT(map()));
   292     pageSwitchMapper->setMapping(ui.pageSinglePlayer->BtnTrainPage, ID_PAGE_TRAINING);
   293     pageSwitchMapper->setMapping(ui.pageSinglePlayer->BtnTrainPage, ID_PAGE_TRAINING);
   293 
   294 
   669                  && lastid != ID_PAGE_INGAME
   670                  && lastid != ID_PAGE_INGAME
   670                  && lastid != ID_PAGE_SCHEME
   671                  && lastid != ID_PAGE_SCHEME
   671                  && lastid != ID_PAGE_SELECTWEAPON)
   672                  && lastid != ID_PAGE_SELECTWEAPON)
   672         {
   673         {
   673             curTeamSelWidget->resetPlayingTeams(teamsList);
   674             curTeamSelWidget->resetPlayingTeams(teamsList);
       
   675         }
       
   676     }
       
   677 
       
   678     if (id == ID_PAGE_GAMESTATS)
       
   679     {
       
   680         switch(lastGameType) {
       
   681         case gtLocal:
       
   682         case gtQLocal:
       
   683         case gtTraining:
       
   684         case gtCampaign:
       
   685             ui.pageGameStats->restartBtnVisible(true);
       
   686             break;
       
   687         default:
       
   688             ui.pageGameStats->restartBtnVisible(false);
       
   689             break;
   674         }
   690         }
   675     }
   691     }
   676 
   692 
   677     if (id == ID_PAGE_MAIN)
   693     if (id == ID_PAGE_MAIN)
   678     {
   694     {
  2012         }
  2028         }
  2013         while(!fileName.isEmpty() && !ok);
  2029         while(!fileName.isEmpty() && !ok);
  2014     }
  2030     }
  2015 }
  2031 }
  2016 
  2032 
       
  2033 void HWForm::restartGame()
       
  2034 {
       
  2035     // get rid off old game stats page
       
  2036     if(ui.Pages->currentIndex() == ID_PAGE_GAMESTATS)
       
  2037         GoBack();
       
  2038 
       
  2039     CreateGame(lastGameCfg, lastGameTeamSel, lastGameAmmo);
       
  2040 
       
  2041     switch(lastGameType) {
       
  2042     case gtTraining:
       
  2043         game->StartTraining(lastGameStartArgs.at(0).toString());
       
  2044         break;
       
  2045     case gtQLocal:
       
  2046         game->StartQuick();
       
  2047         break;
       
  2048     case gtCampaign:
       
  2049         game->StartCampaign(lastGameStartArgs.at(0).toString(), lastGameStartArgs.at(1).toString(), lastGameStartArgs.at(2).toString());
       
  2050         break;
       
  2051     case gtLocal:
       
  2052         game->StartLocal();
       
  2053         break;
       
  2054     default:
       
  2055         break;
       
  2056     }
       
  2057 }
  2017 
  2058 
  2018 void HWForm::ShowErrorMessage(const QString & msg)
  2059 void HWForm::ShowErrorMessage(const QString & msg)
  2019 {
  2060 {
  2020     MessageDialog::ShowErrorMessage(msg, this);
  2061     MessageDialog::ShowErrorMessage(msg, this);
  2021 }
  2062 }