QTfrontend/hwform.cpp
changeset 1845 1d4a5280887d
parent 1840 4747f0232b88
child 1846 24d0074d4eed
equal deleted inserted replaced
1844:81abed9d4c11 1845:1d4a5280887d
   139 	connect(ui.pageSelectWeapon->pWeapons,	SIGNAL(weaponsDeleted()),
   139 	connect(ui.pageSelectWeapon->pWeapons,	SIGNAL(weaponsDeleted()),
   140 		this, SLOT(UpdateWeapons())); // executed second
   140 		this, SLOT(UpdateWeapons())); // executed second
   141 	connect(ui.pageSelectWeapon->pWeapons,	SIGNAL(weaponsDeleted()),
   141 	connect(ui.pageSelectWeapon->pWeapons,	SIGNAL(weaponsDeleted()),
   142 		this, SLOT(GoBack())); // executed third
   142 		this, SLOT(GoBack())); // executed third
   143 
   143 
   144 	GoToPage(ID_PAGE_MAIN);
   144 	PagesStack.push(ID_PAGE_MAIN);
       
   145 	GoBack();
   145 }
   146 }
   146 
   147 
   147 void HWForm::onFrontendFullscreen(bool value)
   148 void HWForm::onFrontendFullscreen(bool value)
   148 {
   149 {
   149   if (value)
   150   if (value)
   321 	quint8 id = PagesStack.isEmpty() ? ID_PAGE_MAIN : PagesStack.pop();
   322 	quint8 id = PagesStack.isEmpty() ? ID_PAGE_MAIN : PagesStack.pop();
   322 	quint8 curid = ui.Pages->currentIndex();
   323 	quint8 curid = ui.Pages->currentIndex();
   323 	ui.Pages->setCurrentIndex(id);
   324 	ui.Pages->setCurrentIndex(id);
   324 	OnPageShown(id, curid);
   325 	OnPageShown(id, curid);
   325 	
   326 	
       
   327 	if (id == ID_PAGE_CONNECTING)
       
   328 		GoBack();
   326 	if (id == ID_PAGE_NETSERVER)
   329 	if (id == ID_PAGE_NETSERVER)
   327 		GoBack();
   330 		GoBack();
   328 	if ((!hwnet) && (id == ID_PAGE_ROOMSLIST))
   331 	if ((!hwnet) && (id == ID_PAGE_ROOMSLIST))
   329 		GoBack();
   332 		GoBack();
   330 	
   333 	
   464 	
   467 	
   465 	ui.pageRoomsList->chatWidget->clear();
   468 	ui.pageRoomsList->chatWidget->clear();
   466 	
   469 	
   467 	hwnet = new HWNewNet(config, ui.pageNetGame->pGameCFG, ui.pageNetGame->pNetTeamsWidget);
   470 	hwnet = new HWNewNet(config, ui.pageNetGame->pGameCFG, ui.pageNetGame->pNetTeamsWidget);
   468 
   471 
   469 	{
   472 	GoToPage(ID_PAGE_CONNECTING);
   470 		GoToPage(ID_PAGE_CONNECTING);
       
   471 		connect(hwnet, SIGNAL(Connected()), this, SLOT(GoBack()));
       
   472 		connect(hwnet, SIGNAL(Disconnected()), this, SLOT(GoBack()));
       
   473 	}
       
   474 
   473 
   475 	connect(hwnet, SIGNAL(showMessage(const QString &)), this, SLOT(ShowErrorMessage(const QString &)), Qt::QueuedConnection);
   474 	connect(hwnet, SIGNAL(showMessage(const QString &)), this, SLOT(ShowErrorMessage(const QString &)), Qt::QueuedConnection);
   476 
   475 
   477 	connect(hwnet, SIGNAL(AskForRunGame()), this, SLOT(CreateNetGame()));
   476 	connect(hwnet, SIGNAL(AskForRunGame()), this, SLOT(CreateNetGame()));
   478 	connect(hwnet, SIGNAL(Connected()), this, SLOT(NetConnected()));
   477 	connect(hwnet, SIGNAL(Connected()), this, SLOT(NetConnected()));
   649 		hwnet = 0;
   648 		hwnet = 0;
   650 		QMessageBox::warning(this, QMessageBox::tr("Network"),
   649 		QMessageBox::warning(this, QMessageBox::tr("Network"),
   651 				QMessageBox::tr("Connection to server is lost"));
   650 				QMessageBox::tr("Connection to server is lost"));
   652 	
   651 	
   653 	}
   652 	}
       
   653 qDebug() << "ForcedDisconnect" << ui.Pages->currentIndex();
   654 	if (ui.Pages->currentIndex() != ID_PAGE_NET) GoBack();
   654 	if (ui.Pages->currentIndex() != ID_PAGE_NET) GoBack();
   655 }
   655 }
   656 
   656 
   657 void HWForm::NetConnected()
   657 void HWForm::NetConnected()
   658 {
   658 {