QTfrontend/hwform.cpp
changeset 425 a7e1dabc8fb7
parent 418 595a868918be
child 448 e968e19a464c
equal deleted inserted replaced
424:4598c21bb421 425:a7e1dabc8fb7
   285 	connect(hwnet, SIGNAL(mapChanged(const QString &)), ui.pageNetGame->pGameCFG, SLOT(setMap(const QString &)));
   285 	connect(hwnet, SIGNAL(mapChanged(const QString &)), ui.pageNetGame->pGameCFG, SLOT(setMap(const QString &)));
   286 	connect(hwnet, SIGNAL(themeChanged(const QString &)), ui.pageNetGame->pGameCFG, SLOT(setTheme(const QString &)));
   286 	connect(hwnet, SIGNAL(themeChanged(const QString &)), ui.pageNetGame->pGameCFG, SLOT(setTheme(const QString &)));
   287 	connect(hwnet, SIGNAL(initHealthChanged(quint32)), ui.pageNetGame->pGameCFG, SLOT(setInitHealth(quint32)));
   287 	connect(hwnet, SIGNAL(initHealthChanged(quint32)), ui.pageNetGame->pGameCFG, SLOT(setInitHealth(quint32)));
   288 	connect(hwnet, SIGNAL(turnTimeChanged(quint32)), ui.pageNetGame->pGameCFG, SLOT(setTurnTime(quint32)));
   288 	connect(hwnet, SIGNAL(turnTimeChanged(quint32)), ui.pageNetGame->pGameCFG, SLOT(setTurnTime(quint32)));
   289 	connect(hwnet, SIGNAL(fortsModeChanged(bool)), ui.pageNetGame->pGameCFG, SLOT(setFortsMode(bool)));
   289 	connect(hwnet, SIGNAL(fortsModeChanged(bool)), ui.pageNetGame->pGameCFG, SLOT(setFortsMode(bool)));
   290 	connect(hwnet, SIGNAL(hhnumChanged(const HWTeam&)), 
   290 	connect(hwnet, SIGNAL(hhnumChanged(const HWTeam&)),
   291 		ui.pageNetGame->pNetTeamsWidget, SLOT(changeHHNum(const HWTeam&)));
   291 		ui.pageNetGame->pNetTeamsWidget, SLOT(changeHHNum(const HWTeam&)));
   292 	connect(hwnet, SIGNAL(teamColorChanged(const HWTeam&)), 
   292 	connect(hwnet, SIGNAL(teamColorChanged(const HWTeam&)),
   293 		ui.pageNetGame->pNetTeamsWidget, SLOT(changeTeamColor(const HWTeam&)));
   293 		ui.pageNetGame->pNetTeamsWidget, SLOT(changeTeamColor(const HWTeam&)));
   294 
   294 
   295 	hwnet->Connect(hostName, port, nick);
   295 	hwnet->Connect(hostName, port, nick);
   296 	config->SaveOptions();
   296 	config->SaveOptions();
   297 }
   297 }
   328 {
   328 {
   329   if(pnetserver) return; // we have server - let it care of all things
   329   if(pnetserver) return; // we have server - let it care of all things
   330   if (hwnet) {
   330   if (hwnet) {
   331     hwnet->deleteLater();
   331     hwnet->deleteLater();
   332     hwnet=0;
   332     hwnet=0;
   333     QMessageBox::warning(this, QMessageBox::tr("Network"), 
   333     QMessageBox::warning(this, QMessageBox::tr("Network"),
   334 			 QMessageBox::tr("Connection to server is lost"));
   334 			 QMessageBox::tr("Connection to server is lost"));
   335   }
   335   }
   336   GoBack();
   336   GoBack();
   337 }
   337 }
   338 
   338 
   420 void HWForm::CreateGame(GameCFGWidget * gamecfg, TeamSelWidget* pTeamSelWidget)
   420 void HWForm::CreateGame(GameCFGWidget * gamecfg, TeamSelWidget* pTeamSelWidget)
   421 {
   421 {
   422 	game = new HWGame(config, gamecfg, pTeamSelWidget);
   422 	game = new HWGame(config, gamecfg, pTeamSelWidget);
   423 	connect(game, SIGNAL(GameStateChanged(GameState)), this, SLOT(GameStateChanged(GameState)));
   423 	connect(game, SIGNAL(GameStateChanged(GameState)), this, SLOT(GameStateChanged(GameState)));
   424 	connect(game, SIGNAL(GameStats(char, const QString &)), this, SLOT(GameStats(char, const QString &)));
   424 	connect(game, SIGNAL(GameStats(char, const QString &)), this, SLOT(GameStats(char, const QString &)));
   425 }
   425 	connect(game, SIGNAL(ErrorMessage(const QString &)), this, SLOT(ShowErrorMessage(const QString &)), Qt::QueuedConnection);
       
   426 }
       
   427 
       
   428 void HWForm::ShowErrorMessage(const QString & msg)
       
   429 {
       
   430 	QMessageBox::warning(this,
       
   431 			"Hedgewars",
       
   432 			msg);
       
   433 }