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
@@ -49,10 +49,6 @@ void gameLobbyDialogImpl::exec()
{
hideShowGameDescription(FALSE);
assert(mySession);
mySession->terminateIrcClient();
mySession->startIrcClient();
if(myConfig->readConfigInt("UseIRCLobbyChat")) {
groupBox_lobbyChat->show();
}
@@ -61,7 +57,6 @@ void gameLobbyDialogImpl::exec()
}
QDialog::exec();
mySession->terminateIrcClient();
}
+1 -1
View File
@@ -140,7 +140,7 @@ void GuiWrapper::SignalNetClientGameListPlayerLeft(unsigned gameId, unsigned pla
void GuiWrapper::SignalNetClientGameStart(boost::shared_ptr<Game> game) { myW->signalNetClientGameStart(game); }
void GuiWrapper::SignalNetClientChatMsg(const string &playerName, const string &msg) { myChat->signalChatMessage(QString::fromUtf8(playerName.c_str()), QString::fromUtf8(msg.c_str())); }
void GuiWrapper::SignalNetClientWaitDialog() { myW->signalShowNetworkStartDialog(); }
void GuiWrapper::SignalNetClientWaitDialog() { myW->signalShowClientDialog(); }
void GuiWrapper::SignalNetServerSuccess(int actionID) { }
void GuiWrapper::SignalNetServerError(int errorID, int osErrorID) { myW->signalNetServerError(errorID, osErrorID); }
+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; }
+3 -1
View File
@@ -76,7 +76,7 @@ public:
signals:
void signalInitGui(int speed);
void signalShowNetworkStartDialog();
void signalShowClientDialog();
void signalRefreshSet();
void signalRefreshCash();
@@ -154,7 +154,9 @@ public slots:
void initGui(int speed);
void showClientDialog();
void showNetworkStartDialog();
void showLobbyDialog();
//refresh-Funktionen
void refreshSet();