diff --git a/src/gui/qt/gamelobbydialog/gamelobbydialogimpl.cpp b/src/gui/qt/gamelobbydialog/gamelobbydialogimpl.cpp index 2ce70464..804eabaa 100644 --- a/src/gui/qt/gamelobbydialog/gamelobbydialogimpl.cpp +++ b/src/gui/qt/gamelobbydialog/gamelobbydialogimpl.cpp @@ -224,15 +224,13 @@ void gameLobbyDialogImpl::createGame() label_StartCash->setText(QString("%L1").arg(gameData.startMoney)); QTreeWidgetItem *header = treeWidget_connectedPlayers->headerItem(); - header->setText(0, tr("Connected players - Max. %1").arg(gameData.maxNumberOfPlayers)); + header->setText(0, tr("Connected players - max. %1").arg(gameData.maxNumberOfPlayers)); header->setData(0, Qt::UserRole, gameData.maxNumberOfPlayers); updateDialogBlinds(gameData); label_TimeoutForPlayerAction->setText(QString::number(gameData.playerActionTimeoutSec)); - - mySession->clientCreateGame(gameData, currentGameName.toUtf8().constData(), myCreateInternetGameDialog->lineEdit_Password->text().toUtf8().constData()); } @@ -374,9 +372,9 @@ void gameLobbyDialogImpl::gameSelected(const QModelIndex &index, const QModelInd PlayerIdList::const_iterator end = info.players.end(); while (i != end) { - PlayerRights tmpRights = info.adminPlayerId == *i ? PLAYER_RIGHTS_ADMIN : PLAYER_RIGHTS_NORMAL; + bool admin = info.adminPlayerId == *i; PlayerInfo playerInfo(mySession->getClientPlayerInfo(*i)); - addConnectedPlayer(*i, QString::fromUtf8(playerInfo.playerName.c_str()), tmpRights); + addConnectedPlayer(*i, QString::fromUtf8(playerInfo.playerName.c_str()), admin); ++i; } @@ -567,10 +565,10 @@ void gameLobbyDialogImpl::gameAddPlayer(unsigned gameId, unsigned playerId) if(selection->selectedRows().at(0).data(Qt::UserRole).toUInt() == gameId) { assert(mySession); GameInfo info(mySession->getClientGameInfo(gameId)); - PlayerRights tmpRights = info.adminPlayerId == playerId ? PLAYER_RIGHTS_ADMIN : PLAYER_RIGHTS_NORMAL; + bool admin = info.adminPlayerId == playerId; PlayerInfo playerInfo(mySession->getClientPlayerInfo(playerId)); - addConnectedPlayer(playerId, QString::fromUtf8(playerInfo.playerName.c_str()), tmpRights); + addConnectedPlayer(playerId, QString::fromUtf8(playerInfo.playerName.c_str()), admin); } } } @@ -903,6 +901,7 @@ void gameLobbyDialogImpl::refreshConnectedPlayerAvatars() { } void gameLobbyDialogImpl::joinedGameDialogUpdate() { + groupBox_GameInfo->setEnabled(true); groupBox_GameInfo->setTitle(currentGameName); treeWidget_connectedPlayers->clear(); diff --git a/src/gui/qt/startwindow/startwindowimpl.cpp b/src/gui/qt/startwindow/startwindowimpl.cpp index 27dfc2fd..65954be7 100644 --- a/src/gui/qt/startwindow/startwindowimpl.cpp +++ b/src/gui/qt/startwindow/startwindowimpl.cpp @@ -121,8 +121,8 @@ startWindowImpl::startWindowImpl(ConfigFile *c) connect(this, SIGNAL(signalNetClientLoginShow()), this, SLOT(callInternetGameLoginDialog())); - connect(this, SIGNAL(signalNetClientSelfJoined(unsigned, QString, int)), myStartNetworkGameDialog, SLOT(joinedNetworkGame(unsigned, QString, int))); - connect(this, SIGNAL(signalNetClientPlayerJoined(unsigned, QString, int)), myStartNetworkGameDialog, SLOT(addConnectedPlayer(unsigned, QString, int))); + connect(this, SIGNAL(signalNetClientSelfJoined(unsigned, QString, bool)), myStartNetworkGameDialog, SLOT(joinedNetworkGame(unsigned, QString, bool))); + connect(this, SIGNAL(signalNetClientPlayerJoined(unsigned, QString, bool)), myStartNetworkGameDialog, SLOT(addConnectedPlayer(unsigned, QString, bool))); connect(this, SIGNAL(signalNetClientPlayerChanged(unsigned, QString)), myStartNetworkGameDialog, SLOT(updatePlayer(unsigned, QString))); connect(this, SIGNAL(signalNetClientPlayerLeft(unsigned, QString)), myStartNetworkGameDialog, SLOT(removePlayer(unsigned, QString))); connect(this, SIGNAL(signalNetClientNewGameAdmin(unsigned, QString)), myStartNetworkGameDialog, SLOT(newGameAdmin(unsigned, QString))); diff --git a/src/gui/qt/startwindow/startwindowimpl.h b/src/gui/qt/startwindow/startwindowimpl.h index e763fe36..a4ad1aaa 100644 --- a/src/gui/qt/startwindow/startwindowimpl.h +++ b/src/gui/qt/startwindow/startwindowimpl.h @@ -73,8 +73,8 @@ signals: void signalNetClientShowTimeoutDialog(int, unsigned); void signalNetClientRemovedFromGame(int notificationId); void signalNetServerError(int errorID, int osErrorID); - void signalNetClientSelfJoined(unsigned playerId, QString playerName, int rights); - void signalNetClientPlayerJoined(unsigned playerId, QString playerName, int rights); + void signalNetClientSelfJoined(unsigned playerId, QString playerName, bool isGameAdmin); + void signalNetClientPlayerJoined(unsigned playerId, QString playerName, bool isGameAdmin); void signalNetClientPlayerChanged(unsigned playerId, QString newPlayerName); void signalNetClientPlayerLeft(unsigned playerId, QString playerName); void signalNetClientNewGameAdmin(unsigned playerId, QString playerName);