set currentGameName as windowTitle for NetworkStartGameDialog
This commit is contained in:
@@ -15,7 +15,7 @@
|
||||
#include "gamedata.h"
|
||||
|
||||
gameLobbyDialogImpl::gameLobbyDialogImpl(QWidget *parent, ConfigFile *c)
|
||||
: QDialog(parent), myConfig(c)
|
||||
: QDialog(parent), myConfig(c), currentGameName("")
|
||||
{
|
||||
setupUi(this);
|
||||
|
||||
@@ -62,6 +62,8 @@ void gameLobbyDialogImpl::createGame()
|
||||
|
||||
mySession->clientCreateGame(gameData, myConfig->readConfigString("MyName") + "'s game", "");
|
||||
|
||||
currentGameName = QString::fromUtf8(myConfig->readConfigString("MyName").c_str()) + QString("'s game");
|
||||
|
||||
accept();
|
||||
}
|
||||
}
|
||||
@@ -80,9 +82,11 @@ void gameLobbyDialogImpl::joinGame()
|
||||
}
|
||||
}
|
||||
|
||||
void gameLobbyDialogImpl::gameSelected(QTreeWidgetItem*, int)
|
||||
void gameLobbyDialogImpl::gameSelected(QTreeWidgetItem* item, int)
|
||||
{
|
||||
pushButton_JoinGame->setEnabled(true);
|
||||
|
||||
currentGameName = item->text(0);
|
||||
}
|
||||
|
||||
void gameLobbyDialogImpl::addGame(QString gameName)
|
||||
|
||||
@@ -46,12 +46,17 @@ public slots:
|
||||
void addGame(QString gameName);
|
||||
void removeGame(QString gameName);
|
||||
|
||||
void setCurrentGameName ( const QString& theValue ) { currentGameName = theValue; }
|
||||
QString getCurrentGameName() const { return currentGameName; }
|
||||
|
||||
private:
|
||||
|
||||
ConfigFile *myConfig;
|
||||
Session *mySession;
|
||||
|
||||
createInternetGameDialogImpl *myCreateInternetGameDialog;
|
||||
|
||||
QString currentGameName;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -937,6 +937,7 @@ void mainWindowImpl::initGui(int speed)
|
||||
|
||||
void mainWindowImpl::showNetworkStartDialog()
|
||||
{
|
||||
myStartNetworkGameDialog->setWindowTitle(myGameLobbyDialog->getCurrentGameName());
|
||||
myStartNetworkGameDialog->exec();
|
||||
|
||||
if (myStartNetworkGameDialog->result() == QDialog::Accepted ) {
|
||||
|
||||
Reference in New Issue
Block a user