QTfrontend/hwform.cpp
changeset 448 e968e19a464c
parent 425 a7e1dabc8fb7
child 449 9f4063306e54
equal deleted inserted replaced
447:570224bb8b30 448:e968e19a464c
   259 }
   259 }
   260 
   260 
   261 void HWForm::_NetConnect(const QString & hostName, quint16 port, const QString & nick)
   261 void HWForm::_NetConnect(const QString & hostName, quint16 port, const QString & nick)
   262 {
   262 {
   263 	hwnet = new HWNewNet(config, ui.pageNetGame->pGameCFG, ui.pageNetGame->pNetTeamsWidget);
   263 	hwnet = new HWNewNet(config, ui.pageNetGame->pGameCFG, ui.pageNetGame->pNetTeamsWidget);
       
   264 	connect(hwnet, SIGNAL(GameStateChanged(GameState)), this, SLOT(NetGameStateChanged(GameState)));
   264 	connect(hwnet, SIGNAL(AddGame(const QString &)), this, SLOT(AddGame(const QString &)));
   265 	connect(hwnet, SIGNAL(AddGame(const QString &)), this, SLOT(AddGame(const QString &)));
   265 	connect(hwnet, SIGNAL(EnteredGame()), this, SLOT(NetGameEnter()));
   266 	connect(hwnet, SIGNAL(EnteredGame()), this, SLOT(NetGameEnter()));
   266 	connect(hwnet, SIGNAL(AddNetTeam(const HWTeam&)), this, SLOT(AddNetTeam(const HWTeam&)));
   267 	connect(hwnet, SIGNAL(AddNetTeam(const HWTeam&)), this, SLOT(AddNetTeam(const HWTeam&)));
   267 
   268 
   268 	connect(ui.pageNetGame->pNetTeamsWidget, SIGNAL(hhogsNumChanged(const HWTeam&)),
   269 	connect(ui.pageNetGame->pNetTeamsWidget, SIGNAL(hhogsNumChanged(const HWTeam&)),
   356 	hwnet->JoinGame("#hw");
   357 	hwnet->JoinGame("#hw");
   357 }
   358 }
   358 
   359 
   359 void HWForm::NetStartGame()
   360 void HWForm::NetStartGame()
   360 {
   361 {
   361 	hwnet->StartGame();
   362   ui.pageNetGame->BtnGo->setText(QPushButton::tr("Waiting"));
       
   363   ui.pageNetGame->BtnGo->setEnabled(false);
       
   364   hwnet->StartGame();
   362 }
   365 }
   363 
   366 
   364 void HWForm::AddNetTeam(const HWTeam& team)
   367 void HWForm::AddNetTeam(const HWTeam& team)
   365 {
   368 {
   366   ui.pageNetGame->pNetTeamsWidget->addTeam(team);
   369   ui.pageNetGame->pNetTeamsWidget->addTeam(team);
   369 void HWForm::StartMPGame()
   372 void HWForm::StartMPGame()
   370 {
   373 {
   371 	CreateGame(ui.pageMultiplayer->gameCFG, ui.pageMultiplayer->teamsSelect);
   374 	CreateGame(ui.pageMultiplayer->gameCFG, ui.pageMultiplayer->teamsSelect);
   372 
   375 
   373 	game->StartLocal();
   376 	game->StartLocal();
       
   377 }
       
   378 
       
   379 void HWForm::NetGameStateChanged(GameState __attribute__((unused)) gameState)
       
   380 {
       
   381   ui.pageNetGame->BtnGo->setText(QPushButton::tr("Go!"));
       
   382   ui.pageNetGame->BtnGo->setEnabled(true);
   374 }
   383 }
   375 
   384 
   376 void HWForm::GameStateChanged(GameState gameState)
   385 void HWForm::GameStateChanged(GameState gameState)
   377 {
   386 {
   378 	switch(gameState) {
   387 	switch(gameState) {