QTfrontend/hwform.cpp
changeset 1404 2b6b6809c2e4
parent 1395 46fd70de89e2
child 1405 ee4b28a1861d
equal deleted inserted replaced
1403:b8c921ed0f13 1404:2b6b6809c2e4
   100 	
   100 	
   101 	connect(ui.pageNetServer->BtnBack,	SIGNAL(clicked()),	this, SLOT(GoBack()));
   101 	connect(ui.pageNetServer->BtnBack,	SIGNAL(clicked()),	this, SLOT(GoBack()));
   102 	connect(ui.pageNetServer->BtnStart,	SIGNAL(clicked()),	this, SLOT(NetStartServer()));
   102 	connect(ui.pageNetServer->BtnStart,	SIGNAL(clicked()),	this, SLOT(NetStartServer()));
   103 
   103 
   104 	connect(ui.pageNetGame->BtnBack,	SIGNAL(clicked()),	this, SLOT(GoBack()));
   104 	connect(ui.pageNetGame->BtnBack,	SIGNAL(clicked()),	this, SLOT(GoBack()));
   105 	connect(ui.pageNetGame->BtnGo, SIGNAL(clicked()), this, SLOT(NetStartGame()));
       
   106 	connect(ui.pageNetGame->pNetTeamsWidget, SIGNAL(setEnabledGameStart(bool)),
   105 	connect(ui.pageNetGame->pNetTeamsWidget, SIGNAL(setEnabledGameStart(bool)),
   107 		ui.pageNetGame->BtnGo, SLOT(setEnabled(bool)));
   106 		ui.pageNetGame->BtnGo, SLOT(setEnabled(bool)));
   108 	connect(ui.pageNetGame->pNetTeamsWidget, SIGNAL(SetupClicked()), this, SLOT(IntermediateSetup()));
   107 	connect(ui.pageNetGame->pNetTeamsWidget, SIGNAL(SetupClicked()), this, SLOT(IntermediateSetup()));
   109 
   108 
   110 	connect(ui.pageRoomsList->BtnBack, SIGNAL(clicked()), this, SLOT(GoBack()));
   109 	connect(ui.pageRoomsList->BtnBack, SIGNAL(clicked()), this, SLOT(GoBack()));
   449 		hwnet, SLOT(kickPlayer(const QString&)));
   448 		hwnet, SLOT(kickPlayer(const QString&)));
   450 	connect(hwnet, SIGNAL(nickAdded(const QString&)),
   449 	connect(hwnet, SIGNAL(nickAdded(const QString&)),
   451 		ui.pageNetGame->pChatWidget, SLOT(nickAdded(const QString&)));
   450 		ui.pageNetGame->pChatWidget, SLOT(nickAdded(const QString&)));
   452 	connect(hwnet, SIGNAL(nickRemoved(const QString&)),
   451 	connect(hwnet, SIGNAL(nickRemoved(const QString&)),
   453 		ui.pageNetGame->pChatWidget, SLOT(nickRemoved(const QString&)));
   452 		ui.pageNetGame->pChatWidget, SLOT(nickRemoved(const QString&)));
       
   453 	connect(ui.pageNetGame->BtnGo, SIGNAL(clicked()), hwnet, SLOT(ToggleReady()));
   454 
   454 
   455 	connect(ui.pageNetGame->pNetTeamsWidget, SIGNAL(hhogsNumChanged(const HWTeam&)),
   455 	connect(ui.pageNetGame->pNetTeamsWidget, SIGNAL(hhogsNumChanged(const HWTeam&)),
   456 		hwnet, SLOT(onHedgehogsNumChanged(const HWTeam&)));
   456 		hwnet, SLOT(onHedgehogsNumChanged(const HWTeam&)));
   457 	connect(ui.pageNetGame->pNetTeamsWidget, SIGNAL(teamColorChanged(const HWTeam&)),
   457 	connect(ui.pageNetGame->pNetTeamsWidget, SIGNAL(teamColorChanged(const HWTeam&)),
   458 		hwnet, SLOT(onTeamColorChanged(const HWTeam&)));
   458 		hwnet, SLOT(onTeamColorChanged(const HWTeam&)));
   558 void HWForm::NetGameEnter()
   558 void HWForm::NetGameEnter()
   559 {
   559 {
   560 	GoToPage(ID_PAGE_NETGAME);
   560 	GoToPage(ID_PAGE_NETGAME);
   561 }
   561 }
   562 
   562 
   563 void HWForm::NetStartGame()
       
   564 {
       
   565 	ui.pageNetGame->BtnGo->setText(QPushButton::tr("Waiting"));
       
   566 	ui.pageNetGame->BtnGo->setEnabled(false);
       
   567 	hwnet->Ready();
       
   568 }
       
   569 
       
   570 void HWForm::AddNetTeam(const HWTeam& team)
   563 void HWForm::AddNetTeam(const HWTeam& team)
   571 {
   564 {
   572   ui.pageNetGame->pNetTeamsWidget->addTeam(team);
   565   ui.pageNetGame->pNetTeamsWidget->addTeam(team);
   573 }
   566 }
   574 
   567 
   608 				GoBack();
   601 				GoBack();
   609 				Music(ui.pageOptions->CBEnableMusic->isChecked());
   602 				Music(ui.pageOptions->CBEnableMusic->isChecked());
   610 				if (hwnet) hwnet->gameFinished();
   603 				if (hwnet) hwnet->gameFinished();
   611 			}
   604 			}
   612 		};
   605 		};
   613 	}
       
   614 
       
   615 	if (hwnet)
       
   616 	{
       
   617 		ui.pageNetGame->BtnGo->setText(QPushButton::tr("Go!"));
       
   618 		ui.pageNetGame->BtnGo->setEnabled(true);
       
   619 	}
   606 	}
   620 }
   607 }
   621 
   608 
   622 void HWForm::AddStatText(const QString & msg)
   609 void HWForm::AddStatText(const QString & msg)
   623 {
   610 {