QTfrontend/hwform.cpp
changeset 471 e1eb64ba5e9c
parent 465 07eca0a2546c
child 475 1e46d45da242
equal deleted inserted replaced
470:86ca84d5da74 471:e1eb64ba5e9c
    85 	connect(ui.pageNet->pUdpClient->serversList,	SIGNAL(doubleClicked (const QModelIndex &)),	this, SLOT(NetConnectServer()));
    85 	connect(ui.pageNet->pUdpClient->serversList,	SIGNAL(doubleClicked (const QModelIndex &)),	this, SLOT(NetConnectServer()));
    86 
    86 
    87 	connect(ui.pageNetGame->BtnBack,	SIGNAL(clicked()),	this, SLOT(GoBack()));
    87 	connect(ui.pageNetGame->BtnBack,	SIGNAL(clicked()),	this, SLOT(GoBack()));
    88 	connect(ui.pageNetGame->BtnGo,	SIGNAL(clicked()),	this, SLOT(NetStartGame()));
    88 	connect(ui.pageNetGame->BtnGo,	SIGNAL(clicked()),	this, SLOT(NetStartGame()));
    89 
    89 
    90 	connect(ui.pageNetChat->BtnDisconnect, SIGNAL(clicked()), this, SLOT(NetDisconnect()));
       
    91 	connect(ui.pageNetChat->BtnJoin,	SIGNAL(clicked()),	this, SLOT(NetJoin()));
       
    92 	connect(ui.pageNetChat->BtnCreate,	SIGNAL(clicked()),	this, SLOT(NetCreate()));
       
    93 
       
    94 	connect(ui.pageInfo->BtnBack,	SIGNAL(clicked()),	this, SLOT(GoBack()));
    90 	connect(ui.pageInfo->BtnBack,	SIGNAL(clicked()),	this, SLOT(GoBack()));
    95 
    91 
    96 	connect(ui.pageGameStats->BtnBack,	SIGNAL(clicked()),	this, SLOT(GoBack()));
    92 	connect(ui.pageGameStats->BtnBack,	SIGNAL(clicked()),	this, SLOT(GoBack()));
    97 
    93 
    98 	connect(ui.pageMultiplayer->teamsSelect, SIGNAL(NewTeam()), this, SLOT(NewTeam()));
    94 	connect(ui.pageMultiplayer->teamsSelect, SIGNAL(NewTeam()), this, SLOT(NewTeam()));
   266 	connect(hwnet, SIGNAL(GameStateChanged(GameState)), this, SLOT(NetGameStateChanged(GameState)));
   262 	connect(hwnet, SIGNAL(GameStateChanged(GameState)), this, SLOT(NetGameStateChanged(GameState)));
   267 	connect(hwnet, SIGNAL(AddGame(const QString &)), this, SLOT(AddGame(const QString &)));
   263 	connect(hwnet, SIGNAL(AddGame(const QString &)), this, SLOT(AddGame(const QString &)));
   268 	connect(hwnet, SIGNAL(EnteredGame()), this, SLOT(NetGameEnter()));
   264 	connect(hwnet, SIGNAL(EnteredGame()), this, SLOT(NetGameEnter()));
   269 	connect(hwnet, SIGNAL(AddNetTeam(const HWTeam&)), this, SLOT(AddNetTeam(const HWTeam&)));
   265 	connect(hwnet, SIGNAL(AddNetTeam(const HWTeam&)), this, SLOT(AddNetTeam(const HWTeam&)));
   270 
   266 
   271 	connect(hwnet, SIGNAL(chatStringFromNet(const QStringList&)), 
   267 	connect(hwnet, SIGNAL(chatStringFromNet(const QStringList&)),
   272 		ui.pageNetGame->pChatWidget, SLOT(onChatStringFromNet(const QStringList&)));
   268 		ui.pageNetGame->pChatWidget, SLOT(onChatStringFromNet(const QStringList&)));
   273 	connect(ui.pageNetGame->pChatWidget, SIGNAL(chatLine(const QString&)),
   269 	connect(ui.pageNetGame->pChatWidget, SIGNAL(chatLine(const QString&)),
   274 		hwnet, SLOT(chatLineToNet(const QString&)));
   270 		hwnet, SLOT(chatLineToNet(const QString&)));
   275 	connect(hwnet, SIGNAL(nickAdded(const QString&)), 
   271 	connect(hwnet, SIGNAL(nickAdded(const QString&)),
   276 		ui.pageNetGame->pChatWidget, SLOT(nickAdded(const QString&)));
   272 		ui.pageNetGame->pChatWidget, SLOT(nickAdded(const QString&)));
   277 	connect(hwnet, SIGNAL(nickRemoved(const QString&)), 
   273 	connect(hwnet, SIGNAL(nickRemoved(const QString&)),
   278 		ui.pageNetGame->pChatWidget, SLOT(nickRemoved(const QString&)));
   274 		ui.pageNetGame->pChatWidget, SLOT(nickRemoved(const QString&)));
   279 
   275 
   280 	connect(ui.pageNetGame->pNetTeamsWidget, SIGNAL(hhogsNumChanged(const HWTeam&)),
   276 	connect(ui.pageNetGame->pNetTeamsWidget, SIGNAL(hhogsNumChanged(const HWTeam&)),
   281 		hwnet, SLOT(onHedgehogsNumChanged(const HWTeam&)));
   277 		hwnet, SLOT(onHedgehogsNumChanged(const HWTeam&)));
   282 	connect(ui.pageNetGame->pNetTeamsWidget, SIGNAL(teamColorChanged(const HWTeam&)),
   278 	connect(ui.pageNetGame->pNetTeamsWidget, SIGNAL(teamColorChanged(const HWTeam&)),
   346 			 QMessageBox::tr("Connection to server is lost"));
   342 			 QMessageBox::tr("Connection to server is lost"));
   347   }
   343   }
   348   GoBack();
   344   GoBack();
   349 }
   345 }
   350 
   346 
   351 void HWForm::AddGame(const QString & chan)
       
   352 {
       
   353 	ui.pageNetChat->ChannelsList->addItem(chan);
       
   354 }
       
   355 
       
   356 void HWForm::NetGameEnter()
   347 void HWForm::NetGameEnter()
   357 {
   348 {
   358 	GoToPage(ID_PAGE_NETCFG);
   349 	GoToPage(ID_PAGE_NETCFG);
   359 }
       
   360 
       
   361 void HWForm::NetJoin()
       
   362 {
       
   363 	hwnet->JoinGame("#hw");
       
   364 }
       
   365 
       
   366 void HWForm::NetCreate()
       
   367 {
       
   368 	hwnet->JoinGame("#hw");
       
   369 }
   350 }
   370 
   351 
   371 void HWForm::NetStartGame()
   352 void HWForm::NetStartGame()
   372 {
   353 {
   373   ui.pageNetGame->BtnGo->setText(QPushButton::tr("Waiting"));
   354   ui.pageNetGame->BtnGo->setText(QPushButton::tr("Waiting"));