Information about the game is now shown in lobby, when selecting a game.
Some GUI modifications, GUI update is working properly now if the dialog is shown the second time (after clearing items). List of players for the game is still missing. With the new on-demand model for player id/player name, this is kind of hard to implement.
This commit is contained in:
@@ -31,6 +31,7 @@ startNetworkGameDialogImpl::startNetworkGameDialogImpl(QWidget *parent, ConfigFi
|
||||
connect( pushButton_startGame, SIGNAL( clicked() ), this, SLOT( startGame() ) );
|
||||
connect( pushButton_Kick, SIGNAL( clicked() ), this, SLOT( kickPlayer() ) );
|
||||
connect( treeWidget, SIGNAL( itemClicked ( QTreeWidgetItem*, int) ), this, SLOT( playerSelected(QTreeWidgetItem*, int) ) );
|
||||
connect( treeWidget, SIGNAL( clear () ), this, SLOT( clearPlayers() ) );
|
||||
|
||||
pushButton_Kick->setEnabled(false);
|
||||
pushButton_startGame->setEnabled(false);
|
||||
@@ -114,20 +115,25 @@ void startNetworkGameDialogImpl::kickPlayer() {
|
||||
mySession->kickPlayer(playerName.toUtf8().constData());
|
||||
}
|
||||
}
|
||||
pushButton_Kick->setEnabled(FALSE);
|
||||
pushButton_Kick->setEnabled(false);
|
||||
}
|
||||
|
||||
void startNetworkGameDialogImpl::checkPlayerQuantity() {
|
||||
|
||||
if (treeWidget->topLevelItemCount() >= 2 && isAdmin) {
|
||||
pushButton_startGame->setEnabled(TRUE);
|
||||
pushButton_startGame->setEnabled(true);
|
||||
}
|
||||
else {
|
||||
pushButton_startGame->setEnabled(FALSE);
|
||||
pushButton_startGame->setEnabled(false);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void startNetworkGameDialogImpl::clearPlayers()
|
||||
{
|
||||
pushButton_Kick->setEnabled(false);
|
||||
}
|
||||
|
||||
void startNetworkGameDialogImpl::setSession(Session *session)
|
||||
{
|
||||
mySession = session;
|
||||
|
||||
@@ -52,12 +52,13 @@ public slots:
|
||||
void playerSelected(QTreeWidgetItem*, int);
|
||||
void kickPlayer();
|
||||
void checkPlayerQuantity();
|
||||
void clearPlayers();
|
||||
|
||||
void keyPressEvent ( QKeyEvent*);
|
||||
|
||||
void setMaxPlayerNumber ( int theValue ) { maxPlayerNumber = theValue; label_maxPlayerNumber->setText(QString::number(theValue,10)); }
|
||||
int getMaxPlayerNumber() const { return maxPlayerNumber; }
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user