set currentGameName as windowTitle for NetworkStartGameDialog

This commit is contained in:
doitux
2007-08-22 20:03:19 +00:00
parent d8550011bf
commit 66e8cfa61c
3 changed files with 12 additions and 2 deletions
@@ -15,7 +15,7 @@
#include "gamedata.h" #include "gamedata.h"
gameLobbyDialogImpl::gameLobbyDialogImpl(QWidget *parent, ConfigFile *c) gameLobbyDialogImpl::gameLobbyDialogImpl(QWidget *parent, ConfigFile *c)
: QDialog(parent), myConfig(c) : QDialog(parent), myConfig(c), currentGameName("")
{ {
setupUi(this); setupUi(this);
@@ -62,6 +62,8 @@ void gameLobbyDialogImpl::createGame()
mySession->clientCreateGame(gameData, myConfig->readConfigString("MyName") + "'s game", ""); mySession->clientCreateGame(gameData, myConfig->readConfigString("MyName") + "'s game", "");
currentGameName = QString::fromUtf8(myConfig->readConfigString("MyName").c_str()) + QString("'s game");
accept(); accept();
} }
} }
@@ -80,9 +82,11 @@ void gameLobbyDialogImpl::joinGame()
} }
} }
void gameLobbyDialogImpl::gameSelected(QTreeWidgetItem*, int) void gameLobbyDialogImpl::gameSelected(QTreeWidgetItem* item, int)
{ {
pushButton_JoinGame->setEnabled(true); pushButton_JoinGame->setEnabled(true);
currentGameName = item->text(0);
} }
void gameLobbyDialogImpl::addGame(QString gameName) void gameLobbyDialogImpl::addGame(QString gameName)
@@ -46,12 +46,17 @@ public slots:
void addGame(QString gameName); void addGame(QString gameName);
void removeGame(QString gameName); void removeGame(QString gameName);
void setCurrentGameName ( const QString& theValue ) { currentGameName = theValue; }
QString getCurrentGameName() const { return currentGameName; }
private: private:
ConfigFile *myConfig; ConfigFile *myConfig;
Session *mySession; Session *mySession;
createInternetGameDialogImpl *myCreateInternetGameDialog; createInternetGameDialogImpl *myCreateInternetGameDialog;
QString currentGameName;
}; };
#endif #endif
+1
View File
@@ -937,6 +937,7 @@ void mainWindowImpl::initGui(int speed)
void mainWindowImpl::showNetworkStartDialog() void mainWindowImpl::showNetworkStartDialog()
{ {
myStartNetworkGameDialog->setWindowTitle(myGameLobbyDialog->getCurrentGameName());
myStartNetworkGameDialog->exec(); myStartNetworkGameDialog->exec();
if (myStartNetworkGameDialog->result() == QDialog::Accepted ) { if (myStartNetworkGameDialog->result() == QDialog::Accepted ) {