Keep lobby open in the background during internet games. Show the lobby after the game finished. Re-open the game. Start and stop irc thread together with the client thread.

This commit is contained in:
lotodore
2007-10-08 20:14:44 +00:00
parent dc8f9e0c73
commit 310fadefdb
9 changed files with 77 additions and 59 deletions
+25 -12
View File
@@ -605,7 +605,7 @@ mainWindowImpl::mainWindowImpl(ConfigFile *c, QMainWindow *parent)
//Nachrichten Thread-Save
connect(this, SIGNAL(signalInitGui(int)), this, SLOT(initGui(int)));
connect(this, SIGNAL(signalShowNetworkStartDialog()), this, SLOT(showNetworkStartDialog()));
connect(this, SIGNAL(signalShowClientDialog()), this, SLOT(showClientDialog()));
connect(this, SIGNAL(signalRefreshSet()), this, SLOT(refreshSet()));
connect(this, SIGNAL(signalRefreshCash()), this, SLOT(refreshCash()));
@@ -984,17 +984,7 @@ void mainWindowImpl::joinGameLobby() {
}
else
{
myGameLobbyDialog->exec();
if (myGameLobbyDialog->result() == QDialog::Accepted)
{
//some gui modifications
networkGameModification();
}
else
{
mySession->terminateNetworkClient();
}
showLobbyDialog();
}
}
@@ -1149,6 +1139,14 @@ void mainWindowImpl::initGui(int speed)
}
}
void mainWindowImpl::showClientDialog()
{
if (mySession->GetGameType() == Session::GAME_TYPE_NETWORK)
showNetworkStartDialog();
else if (mySession->GetGameType() == Session::GAME_TYPE_INTERNET)
showLobbyDialog();
}
void mainWindowImpl::showNetworkStartDialog()
{
myStartNetworkGameDialog->exec();
@@ -1165,6 +1163,21 @@ void mainWindowImpl::showNetworkStartDialog()
}
}
void mainWindowImpl::showLobbyDialog()
{
myGameLobbyDialog->exec();
if (myGameLobbyDialog->result() == QDialog::Accepted)
{
//some gui modifications
networkGameModification();
}
else
{
mySession->terminateNetworkClient();
}
}
Session &mainWindowImpl::getSession() { assert(mySession.get()); return *mySession; }
void mainWindowImpl::setSession(boost::shared_ptr<Session> session) { mySession = session; }