QTfrontend/hwform.cpp
changeset 13197 0bc5f618ca7c
parent 13086 8d569c7b36a2
child 13330 3f2ee2f9b51d
equal deleted inserted replaced
13196:f93658732448 13197:0bc5f618ca7c
    88 #include "netserverslist.h"
    88 #include "netserverslist.h"
    89 #include "netudpserver.h"
    89 #include "netudpserver.h"
    90 #include "chatwidget.h"
    90 #include "chatwidget.h"
    91 #include "input_ip.h"
    91 #include "input_ip.h"
    92 #include "input_password.h"
    92 #include "input_password.h"
    93 #include "ammoSchemeModel.h"
    93 #include "gameSchemeModel.h"
    94 #include "bgwidget.h"
    94 #include "bgwidget.h"
    95 #include "drawmapwidget.h"
    95 #include "drawmapwidget.h"
    96 #include "mouseoverfilter.h"
    96 #include "mouseoverfilter.h"
    97 #include "roomslistmodel.h"
    97 #include "roomslistmodel.h"
    98 #include "recorder.h"
    98 #include "recorder.h"
   345     connect(ui.pageMain->BtnNetLocal, SIGNAL(clicked()), this, SLOT(GoToNet()));
   345     connect(ui.pageMain->BtnNetLocal, SIGNAL(clicked()), this, SLOT(GoToNet()));
   346     connect(ui.pageMain->BtnNetOfficial, SIGNAL(clicked()), this, SLOT(NetConnectOfficialServer()));
   346     connect(ui.pageMain->BtnNetOfficial, SIGNAL(clicked()), this, SLOT(NetConnectOfficialServer()));
   347 
   347 
   348     connect(ui.pageVideos, SIGNAL(goBack()), config, SLOT(SaveVideosOptions()));
   348     connect(ui.pageVideos, SIGNAL(goBack()), config, SLOT(SaveVideosOptions()));
   349 
   349 
   350     ammoSchemeModel = new AmmoSchemeModel(this, cfgdir->absolutePath() + "/Schemes/Game");
   350     gameSchemeModel = new GameSchemeModel(this, cfgdir->absolutePath() + "/Schemes/Game");
   351     ui.pageScheme->setModel(ammoSchemeModel);
   351     ui.pageScheme->setModel(gameSchemeModel);
   352     ui.pageMultiplayer->gameCFG->GameSchemes->setModel(ammoSchemeModel);
   352     ui.pageMultiplayer->gameCFG->GameSchemes->setModel(gameSchemeModel);
   353     ui.pageOptions->SchemesName->setModel(ammoSchemeModel);
   353     ui.pageOptions->SchemesName->setModel(gameSchemeModel);
   354 
   354 
   355     wBackground = new BGWidget(this);
   355     wBackground = new BGWidget(this);
   356     wBackground->setFixedSize(this->width(), this->height());
   356     wBackground->setFixedSize(this->width(), this->height());
   357     wBackground->lower();
   357     wBackground->lower();
   358     wBackground->init();
   358     wBackground->init();
   917     if (curid == ID_PAGE_NETGAME && hwnet && hwnet->isInRoom()) hwnet->partRoom();
   917     if (curid == ID_PAGE_NETGAME && hwnet && hwnet->isInRoom()) hwnet->partRoom();
   918     // need to work on this, can cause invalid state for admin quit trying to prevent bad state message on kick
   918     // need to work on this, can cause invalid state for admin quit trying to prevent bad state message on kick
   919     //if (curid == ID_PAGE_NETGAME && (!game || game->gameState != gsStarted)) hwnet->partRoom();
   919     //if (curid == ID_PAGE_NETGAME && (!game || game->gameState != gsStarted)) hwnet->partRoom();
   920 
   920 
   921     if (curid == ID_PAGE_SCHEME)
   921     if (curid == ID_PAGE_SCHEME)
   922         ammoSchemeModel->Save();
   922         gameSchemeModel->Save();
   923 
   923 
   924 #if (QT_VERSION >= 0x040600)
   924 #if (QT_VERSION >= 0x040600)
   925     /**Start animation :**/
   925     /**Start animation :**/
   926     if (curid != 0 && !stopAnim)
   926     if (curid != 0 && !stopAnim)
   927     {
   927     {
  1077 }
  1077 }
  1078 
  1078 
  1079 void HWForm::DeleteScheme()
  1079 void HWForm::DeleteScheme()
  1080 {
  1080 {
  1081     ui.pageScheme->selectScheme->setCurrentIndex(ui.pageOptions->SchemesName->currentIndex());
  1081     ui.pageScheme->selectScheme->setCurrentIndex(ui.pageOptions->SchemesName->currentIndex());
  1082     if (ui.pageOptions->SchemesName->currentIndex() < ammoSchemeModel->numberOfDefaultSchemes)
  1082     if (ui.pageOptions->SchemesName->currentIndex() < gameSchemeModel->numberOfDefaultSchemes)
  1083     {
  1083     {
  1084         MessageDialog::ShowErrorMessage(QMessageBox::tr("Cannot delete default scheme '%1'!").arg(ui.pageOptions->SchemesName->currentText()), this);
  1084         MessageDialog::ShowErrorMessage(QMessageBox::tr("Cannot delete default scheme '%1'!").arg(ui.pageOptions->SchemesName->currentText()), this);
  1085     }
  1085     }
  1086     else
  1086     else
  1087     {
  1087     {
  1088         ui.pageScheme->deleteRow();
  1088         ui.pageScheme->deleteRow();
  1089         ammoSchemeModel->Save();
  1089         gameSchemeModel->Save();
  1090     }
  1090     }
  1091 }
  1091 }
  1092 
  1092 
  1093 void HWForm::DeleteWeaponSet()
  1093 void HWForm::DeleteWeaponSet()
  1094 {
  1094 {
  1897 {
  1897 {
  1898     ui.pageNetGame->setMasterMode(true);
  1898     ui.pageNetGame->setMasterMode(true);
  1899     ui.pageNetGame->restrictJoins->setChecked(false);
  1899     ui.pageNetGame->restrictJoins->setChecked(false);
  1900     ui.pageNetGame->restrictTeamAdds->setChecked(false);
  1900     ui.pageNetGame->restrictTeamAdds->setChecked(false);
  1901     ui.pageNetGame->restrictUnregistered->setChecked(false);
  1901     ui.pageNetGame->restrictUnregistered->setChecked(false);
  1902     ui.pageNetGame->pGameCFG->GameSchemes->setModel(ammoSchemeModel);
  1902     ui.pageNetGame->pGameCFG->GameSchemes->setModel(gameSchemeModel);
  1903     ui.pageNetGame->pGameCFG->setMaster(true);
  1903     ui.pageNetGame->pGameCFG->setMaster(true);
  1904     ui.pageNetGame->pNetTeamsWidget->setInteractivity(true);
  1904     ui.pageNetGame->pNetTeamsWidget->setInteractivity(true);
  1905 
  1905 
  1906     if (hwnet)
  1906     if (hwnet)
  1907     {
  1907     {
  1934     ui.pageNetGame->pGameCFG->setMaster(false);
  1934     ui.pageNetGame->pGameCFG->setMaster(false);
  1935     ui.pageNetGame->pNetTeamsWidget->setInteractivity(false);
  1935     ui.pageNetGame->pNetTeamsWidget->setInteractivity(false);
  1936 
  1936 
  1937     if (hwnet)
  1937     if (hwnet)
  1938     {
  1938     {
  1939         NetAmmoSchemeModel * netAmmo = new NetAmmoSchemeModel(hwnet);
  1939         NetGameSchemeModel * netAmmo = new NetGameSchemeModel(hwnet);
  1940         connect(hwnet, SIGNAL(netSchemeConfig(QStringList)), netAmmo, SLOT(setNetSchemeConfig(QStringList)));
  1940         connect(hwnet, SIGNAL(netSchemeConfig(QStringList)), netAmmo, SLOT(setNetSchemeConfig(QStringList)));
  1941 
  1941 
  1942         ui.pageNetGame->pGameCFG->GameSchemes->setModel(netAmmo);
  1942         ui.pageNetGame->pGameCFG->GameSchemes->setModel(netAmmo);
  1943 
  1943 
  1944         ui.pageNetGame->setRoomName(hwnet->getRoom());
  1944         ui.pageNetGame->setRoomName(hwnet->getRoom());