Fix pages mess when password is refused
authorunc0rr
Thu, 26 Feb 2009 14:58:06 +0000
changeset 1845 1d4a5280887d
parent 1844 81abed9d4c11
child 1846 24d0074d4eed
Fix pages mess when password is refused
QTfrontend/hwform.cpp
--- a/QTfrontend/hwform.cpp	Thu Feb 26 06:39:20 2009 +0000
+++ b/QTfrontend/hwform.cpp	Thu Feb 26 14:58:06 2009 +0000
@@ -141,7 +141,8 @@
 	connect(ui.pageSelectWeapon->pWeapons,	SIGNAL(weaponsDeleted()),
 		this, SLOT(GoBack())); // executed third
 
-	GoToPage(ID_PAGE_MAIN);
+	PagesStack.push(ID_PAGE_MAIN);
+	GoBack();
 }
 
 void HWForm::onFrontendFullscreen(bool value)
@@ -323,6 +324,8 @@
 	ui.Pages->setCurrentIndex(id);
 	OnPageShown(id, curid);
 	
+	if (id == ID_PAGE_CONNECTING)
+		GoBack();
 	if (id == ID_PAGE_NETSERVER)
 		GoBack();
 	if ((!hwnet) && (id == ID_PAGE_ROOMSLIST))
@@ -466,11 +469,7 @@
 	
 	hwnet = new HWNewNet(config, ui.pageNetGame->pGameCFG, ui.pageNetGame->pNetTeamsWidget);
 
-	{
-		GoToPage(ID_PAGE_CONNECTING);
-		connect(hwnet, SIGNAL(Connected()), this, SLOT(GoBack()));
-		connect(hwnet, SIGNAL(Disconnected()), this, SLOT(GoBack()));
-	}
+	GoToPage(ID_PAGE_CONNECTING);
 
 	connect(hwnet, SIGNAL(showMessage(const QString &)), this, SLOT(ShowErrorMessage(const QString &)), Qt::QueuedConnection);
 
@@ -651,6 +650,7 @@
 				QMessageBox::tr("Connection to server is lost"));
 	
 	}
+qDebug() << "ForcedDisconnect" << ui.Pages->currentIndex();
 	if (ui.Pages->currentIndex() != ID_PAGE_NET) GoBack();
 }