# HG changeset patch # User unc0rr # Date 1231428891 0 # Node ID 305e13c5f327856dc44b6a1bb4b7b0bf4d653881 # Parent 65b5d3cd3e01adc5f475b634a9135dc1985d6591 Go page back when room is abandoned by its admin diff -r 65b5d3cd3e01 -r 305e13c5f327 QTfrontend/hwform.cpp --- 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"); +} diff -r 65b5d3cd3e01 -r 305e13c5f327 QTfrontend/hwform.h --- 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); diff -r 65b5d3cd3e01 -r 305e13c5f327 QTfrontend/newnetclient.cpp --- 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; }