kickplayer
This commit is contained in:
@@ -29,7 +29,8 @@ startNetworkGameDialogImpl::startNetworkGameDialogImpl(QWidget *parent)
|
||||
|
||||
connect( pushButton_cancel, SIGNAL( clicked() ), this, SLOT( cancel() ) );
|
||||
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) ) );
|
||||
}
|
||||
|
||||
void startNetworkGameDialogImpl::startGame() {
|
||||
@@ -59,6 +60,21 @@ void startNetworkGameDialogImpl::removePlayer(QString playerName) {
|
||||
checkPlayerQuantity();
|
||||
}
|
||||
|
||||
void startNetworkGameDialogImpl::playerSelected(QTreeWidgetItem*, int) {
|
||||
|
||||
pushButton_Kick->setEnabled(TRUE);
|
||||
}
|
||||
|
||||
void startNetworkGameDialogImpl::kickPlayer() {
|
||||
|
||||
QTreeWidgetItem *item = treeWidget->currentItem();
|
||||
QString playerName = item->text(0);
|
||||
// kickplayerFunktion(playerName.toStdString());
|
||||
|
||||
pushButton_Kick->setEnabled(FALSE);
|
||||
|
||||
}
|
||||
|
||||
void startNetworkGameDialogImpl::checkPlayerQuantity() {
|
||||
|
||||
if(treeWidget->topLevelItemCount() == maxPlayerNumber) pushButton_startGame->setEnabled(TRUE);
|
||||
|
||||
@@ -39,6 +39,8 @@ public slots:
|
||||
void cancel();
|
||||
void addConnectedPlayer(QString playerName);
|
||||
void removePlayer(QString playerName);
|
||||
void playerSelected(QTreeWidgetItem*, int);
|
||||
void kickPlayer();
|
||||
void checkPlayerQuantity();
|
||||
|
||||
void keyPressEvent ( QKeyEvent*);
|
||||
|
||||
Reference in New Issue
Block a user