set currentGameName as windowTitle for NetworkStartGameDialog
This commit is contained in:
@@ -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
|
||||||
|
|||||||
@@ -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 ) {
|
||||||
|
|||||||
Reference in New Issue
Block a user