--- a/QTfrontend/hwform.cpp Thu Jan 08 15:32:26 2009 +0000
+++ b/QTfrontend/hwform.cpp Thu Jan 08 15:34:51 2009 +0000
@@ -443,6 +443,7 @@
connect(hwnet, SIGNAL(AskForRunGame()), this, SLOT(CreateNetGame()));
connect(hwnet, SIGNAL(Connected()), this, SLOT(NetConnected()));
connect(hwnet, SIGNAL(EnteredGame()), this, SLOT(NetGameEnter()));
+ connect(hwnet, SIGNAL(LeftRoom()), this, SLOT(NetLeftRoom()));
connect(hwnet, SIGNAL(AddNetTeam(const HWTeam&)), this, SLOT(AddNetTeam(const HWTeam&)));
connect(ui.pageNetGame->BtnBack, SIGNAL(clicked()), hwnet, SLOT(partRoom()));
@@ -807,3 +808,11 @@
{
ui.pageNetGame->BtnMaster->setVisible(false);
}
+
+void HWForm::NetLeftRoom()
+{
+ if (ui.Pages->currentIndex() == ID_PAGE_NETGAME)
+ GoBack();
+ else
+ qWarning("Left room while not in room");
+}
--- a/QTfrontend/hwform.h Thu Jan 08 15:32:26 2009 +0000
+++ b/QTfrontend/hwform.h Thu Jan 08 15:34:51 2009 +0000
@@ -89,6 +89,7 @@
void NetGameMaster();
void NetGameSlave();
void AsyncNetServerStart();
+ void NetLeftRoom();
private:
void _NetConnect(const QString & hostName, quint16 port, const QString & nick);
--- a/QTfrontend/newnetclient.cpp Thu Jan 08 15:32:26 2009 +0000
+++ b/QTfrontend/newnetclient.cpp Thu Jan 08 15:34:51 2009 +0000
@@ -211,17 +211,17 @@
if (lst[0] == "ERROR") {
if (lst.size() == 2)
- QMessageBox::information(0, 0, "Error: " + lst[1]);
+ emit showMessage("Error: " + lst[1]);
else
- QMessageBox::information(0, 0, "Unknown error");
+ emit showMessage("Unknown error");
return;
}
if (lst[0] == "WARNING") {
if (lst.size() == 2)
- QMessageBox::information(0, 0, "Warning: " + lst[1]);
+ emit showMessage("Warning: " + lst[1]);
else
- QMessageBox::information(0, 0, "Unknown warning");
+ emit showMessage("Unknown warning");
return;
}
@@ -334,6 +334,7 @@
if(lst[0]=="ROOMABANDONED") {
netClientState = 2;
+ emit showMessage(HWNewNet::tr("Room destroyed"));
emit LeftRoom();
return;
}