kickplayer
This commit is contained in:
@@ -5,8 +5,8 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>280</width>
|
<width>287</width>
|
||||||
<height>236</height>
|
<height>259</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle" >
|
<property name="windowTitle" >
|
||||||
@@ -20,13 +20,66 @@
|
|||||||
<number>6</number>
|
<number>6</number>
|
||||||
</property>
|
</property>
|
||||||
<item row="1" column="0" >
|
<item row="1" column="0" >
|
||||||
<widget class="QLabel" name="label" >
|
<layout class="QHBoxLayout" >
|
||||||
<property name="text" >
|
<property name="margin" >
|
||||||
<string>Maximum number of players:</string>
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="spacing" >
|
||||||
|
<number>6</number>
|
||||||
|
</property>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="label" >
|
||||||
|
<property name="text" >
|
||||||
|
<string>Maximum number of players:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="label_maxPlayerNumber" >
|
||||||
|
<property name="text" >
|
||||||
|
<string>0</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<spacer>
|
||||||
|
<property name="orientation" >
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" >
|
||||||
|
<size>
|
||||||
|
<width>40</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="pushButton_Kick" >
|
||||||
|
<property name="text" >
|
||||||
|
<string>Kick</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="0" >
|
||||||
|
<widget class="Line" name="line" >
|
||||||
|
<property name="orientation" >
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="3" column="0" colspan="2" >
|
<item row="0" column="0" >
|
||||||
|
<widget class="QTreeWidget" name="treeWidget" >
|
||||||
|
<column>
|
||||||
|
<property name="text" >
|
||||||
|
<string> Connected Player </string>
|
||||||
|
</property>
|
||||||
|
</column>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="3" column="0" >
|
||||||
<layout class="QHBoxLayout" >
|
<layout class="QHBoxLayout" >
|
||||||
<property name="margin" >
|
<property name="margin" >
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
@@ -63,29 +116,6 @@
|
|||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item row="0" column="0" colspan="2" >
|
|
||||||
<widget class="QTreeWidget" name="treeWidget" >
|
|
||||||
<column>
|
|
||||||
<property name="text" >
|
|
||||||
<string> Connected Player </string>
|
|
||||||
</property>
|
|
||||||
</column>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="1" >
|
|
||||||
<widget class="QLabel" name="label_maxPlayerNumber" >
|
|
||||||
<property name="text" >
|
|
||||||
<string>0</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="2" column="0" colspan="2" >
|
|
||||||
<widget class="Line" name="line" >
|
|
||||||
<property name="orientation" >
|
|
||||||
<enum>Qt::Horizontal</enum>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<tabstops>
|
<tabstops>
|
||||||
|
|||||||
@@ -29,7 +29,8 @@ startNetworkGameDialogImpl::startNetworkGameDialogImpl(QWidget *parent)
|
|||||||
|
|
||||||
connect( pushButton_cancel, SIGNAL( clicked() ), this, SLOT( cancel() ) );
|
connect( pushButton_cancel, SIGNAL( clicked() ), this, SLOT( cancel() ) );
|
||||||
connect( pushButton_startGame, SIGNAL( clicked() ), this, SLOT( startGame() ) );
|
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() {
|
void startNetworkGameDialogImpl::startGame() {
|
||||||
@@ -59,6 +60,21 @@ void startNetworkGameDialogImpl::removePlayer(QString playerName) {
|
|||||||
checkPlayerQuantity();
|
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() {
|
void startNetworkGameDialogImpl::checkPlayerQuantity() {
|
||||||
|
|
||||||
if(treeWidget->topLevelItemCount() == maxPlayerNumber) pushButton_startGame->setEnabled(TRUE);
|
if(treeWidget->topLevelItemCount() == maxPlayerNumber) pushButton_startGame->setEnabled(TRUE);
|
||||||
|
|||||||
@@ -39,6 +39,8 @@ public slots:
|
|||||||
void cancel();
|
void cancel();
|
||||||
void addConnectedPlayer(QString playerName);
|
void addConnectedPlayer(QString playerName);
|
||||||
void removePlayer(QString playerName);
|
void removePlayer(QString playerName);
|
||||||
|
void playerSelected(QTreeWidgetItem*, int);
|
||||||
|
void kickPlayer();
|
||||||
void checkPlayerQuantity();
|
void checkPlayerQuantity();
|
||||||
|
|
||||||
void keyPressEvent ( QKeyEvent*);
|
void keyPressEvent ( QKeyEvent*);
|
||||||
|
|||||||
Reference in New Issue
Block a user