new connected player list in waitforservertostartgame
This commit is contained in:
@@ -93,7 +93,8 @@ void GuiWrapper::logNewGameHandMsg(int gameID, int handID) { myLog->logNewGameHa
|
|||||||
void GuiWrapper::SignalNetClientConnect(int actionID) { myW->SignalNetClientConnect(actionID); }
|
void GuiWrapper::SignalNetClientConnect(int actionID) { myW->SignalNetClientConnect(actionID); }
|
||||||
void GuiWrapper::SignalNetClientGameInfo(int actionID) { myW->SignalNetClientGameInfo(actionID); }
|
void GuiWrapper::SignalNetClientGameInfo(int actionID) { myW->SignalNetClientGameInfo(actionID); }
|
||||||
void GuiWrapper::SignalNetClientError(int errorID, int osErrorID) { myW->SignalNetClientError(errorID, osErrorID); }
|
void GuiWrapper::SignalNetClientError(int errorID, int osErrorID) { myW->SignalNetClientError(errorID, osErrorID); }
|
||||||
|
void GuiWrapper::SignalNetClientPlayerJoined(const string &playerName) { myW->SignalNetClientPlayerJoined(QString::fromUtf8(playerName.c_str())); }
|
||||||
|
void GuiWrapper::SignalNetClientPlayerLeft(const string &playerName) { myW->SignalNetClientPlayerLeft(QString::fromUtf8(playerName.c_str())); }
|
||||||
void GuiWrapper::SignalNetClientGameStart(const GameData &gameData) { myW->SignalNetClientGameStart(gameData.numberOfPlayers, gameData.startCash, gameData.smallBlind, gameData.handsBeforeRaise); }
|
void GuiWrapper::SignalNetClientGameStart(const GameData &gameData) { myW->SignalNetClientGameStart(gameData.numberOfPlayers, gameData.startCash, gameData.smallBlind, gameData.handsBeforeRaise); }
|
||||||
|
|
||||||
void GuiWrapper::SignalNetServerSuccess(int actionID) { }
|
void GuiWrapper::SignalNetServerSuccess(int actionID) { }
|
||||||
@@ -101,3 +102,4 @@ void GuiWrapper::SignalNetServerError(int errorID, int osErrorID) { }
|
|||||||
void GuiWrapper::SignalNetServerPlayerJoined(const string &playerName) { myW->SignalNetServerPlayerJoined(QString::fromUtf8(playerName.c_str())); }
|
void GuiWrapper::SignalNetServerPlayerJoined(const string &playerName) { myW->SignalNetServerPlayerJoined(QString::fromUtf8(playerName.c_str())); }
|
||||||
void GuiWrapper::SignalNetServerPlayerLeft(const string &playerName) { myW->SignalNetServerPlayerLeft(QString::fromUtf8(playerName.c_str())); }
|
void GuiWrapper::SignalNetServerPlayerLeft(const string &playerName) { myW->SignalNetServerPlayerLeft(QString::fromUtf8(playerName.c_str())); }
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -93,6 +93,8 @@ public:
|
|||||||
void SignalNetClientConnect(int actionID);
|
void SignalNetClientConnect(int actionID);
|
||||||
void SignalNetClientGameInfo(int actionID);
|
void SignalNetClientGameInfo(int actionID);
|
||||||
void SignalNetClientError(int errorID, int osErrorID);
|
void SignalNetClientError(int errorID, int osErrorID);
|
||||||
|
void SignalNetClientPlayerJoined(const std::string &playerName);
|
||||||
|
void SignalNetClientPlayerLeft(const std::string &playerName);
|
||||||
|
|
||||||
void SignalNetClientGameStart(const GameData &gameData);
|
void SignalNetClientGameStart(const GameData &gameData);
|
||||||
|
|
||||||
|
|||||||
@@ -552,6 +552,9 @@ mainWindowImpl::mainWindowImpl(QMainWindow *parent)
|
|||||||
//Nachrichten Thread-Save
|
//Nachrichten Thread-Save
|
||||||
connect(this, SIGNAL(SignalNetClientConnect(int)), myConnectToServerDialog, SLOT(refresh(int)));
|
connect(this, SIGNAL(SignalNetClientConnect(int)), myConnectToServerDialog, SLOT(refresh(int)));
|
||||||
connect(this, SIGNAL(SignalNetClientGameInfo(int)), myWaitingForServerGameDialog, SLOT(refresh(int)));
|
connect(this, SIGNAL(SignalNetClientGameInfo(int)), myWaitingForServerGameDialog, SLOT(refresh(int)));
|
||||||
|
connect(this, SIGNAL(SignalNetClientPlayerJoined(QString)), myWaitingForServerGameDialog, SLOT(addConnectedPlayer(QString)));
|
||||||
|
connect(this, SIGNAL(SignalNetClientPlayerLeft(QString)), myWaitingForServerGameDialog, SLOT(removePlayer(QString)));
|
||||||
|
|
||||||
// Errors are handled globally, not within one dialog.
|
// Errors are handled globally, not within one dialog.
|
||||||
connect(this, SIGNAL(SignalNetClientError(int, int)), this, SLOT(networkError(int, int)));
|
connect(this, SIGNAL(SignalNetClientError(int, int)), this, SLOT(networkError(int, int)));
|
||||||
connect(this, SIGNAL(SignalNetClientGameStart(int, int, int, int)), this, SLOT(networkStart(int, int, int, int)));
|
connect(this, SIGNAL(SignalNetClientGameStart(int, int, int, int)), this, SLOT(networkStart(int, int, int, int)));
|
||||||
|
|||||||
@@ -96,10 +96,13 @@ signals:
|
|||||||
void SignalNetClientConnect(int actionID);
|
void SignalNetClientConnect(int actionID);
|
||||||
void SignalNetClientGameInfo(int actionID);
|
void SignalNetClientGameInfo(int actionID);
|
||||||
void SignalNetClientError(int errorID, int osErrorID);
|
void SignalNetClientError(int errorID, int osErrorID);
|
||||||
|
void SignalNetClientPlayerJoined(QString playerName);
|
||||||
|
void SignalNetClientPlayerLeft(QString playerName);
|
||||||
void SignalNetClientGameStart(int numberOfPlayers, int startCash, int smallBlind, int handsBeforeRaise);
|
void SignalNetClientGameStart(int numberOfPlayers, int startCash, int smallBlind, int handsBeforeRaise);
|
||||||
void SignalNetServerPlayerJoined(QString playerName);
|
void SignalNetServerPlayerJoined(QString playerName);
|
||||||
void SignalNetServerPlayerLeft(QString playerName);
|
void SignalNetServerPlayerLeft(QString playerName);
|
||||||
|
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
|
|
||||||
void setGameSpeed(const int theValue) { guiGameSpeed = theValue; setSpeeds(); } // Achtung Faktor 10!!!
|
void setGameSpeed(const int theValue) { guiGameSpeed = theValue; setSpeeds(); } // Achtung Faktor 10!!!
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>279</width>
|
<width>279</width>
|
||||||
<height>81</height>
|
<height>257</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle" >
|
<property name="windowTitle" >
|
||||||
@@ -19,33 +19,26 @@
|
|||||||
<property name="spacing" >
|
<property name="spacing" >
|
||||||
<number>6</number>
|
<number>6</number>
|
||||||
</property>
|
</property>
|
||||||
<item row="1" column="2" >
|
<item row="0" column="0" colspan="3" >
|
||||||
<spacer>
|
<widget class="QTreeWidget" name="treeWidget" >
|
||||||
<property name="orientation" >
|
<column>
|
||||||
<enum>Qt::Horizontal</enum>
|
<property name="text" >
|
||||||
</property>
|
<string> Connected Player </string>
|
||||||
<property name="sizeHint" >
|
</property>
|
||||||
<size>
|
</column>
|
||||||
<width>40</width>
|
</widget>
|
||||||
<height>20</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="0" >
|
<item row="1" column="0" colspan="3" >
|
||||||
<spacer>
|
<widget class="QLabel" name="label" >
|
||||||
<property name="orientation" >
|
<property name="text" >
|
||||||
<enum>Qt::Horizontal</enum>
|
<string>Waiting for the server to start the game ...</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="sizeHint" >
|
<property name="alignment" >
|
||||||
<size>
|
<set>Qt::AlignCenter</set>
|
||||||
<width>40</width>
|
|
||||||
<height>20</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
</property>
|
||||||
</spacer>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="1" >
|
<item row="2" column="1" >
|
||||||
<widget class="QPushButton" name="pushButton_cancel" >
|
<widget class="QPushButton" name="pushButton_cancel" >
|
||||||
<property name="maximumSize" >
|
<property name="maximumSize" >
|
||||||
<size>
|
<size>
|
||||||
@@ -58,15 +51,31 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="0" column="0" colspan="3" >
|
<item row="2" column="0" >
|
||||||
<widget class="QLabel" name="label" >
|
<spacer>
|
||||||
<property name="text" >
|
<property name="orientation" >
|
||||||
<string>Waiting for the server to start the game ...</string>
|
<enum>Qt::Horizontal</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="alignment" >
|
<property name="sizeHint" >
|
||||||
<set>Qt::AlignCenter</set>
|
<size>
|
||||||
|
<width>40</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="2" >
|
||||||
|
<spacer>
|
||||||
|
<property name="orientation" >
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" >
|
||||||
|
<size>
|
||||||
|
<width>40</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
|
|||||||
@@ -45,3 +45,17 @@ void waitForServerToStartGameDialogImpl::keyPressEvent ( QKeyEvent * event ) {
|
|||||||
// if (event->key() == 16777220) { pushButton_connect->click(); } //ENTER
|
// if (event->key() == 16777220) { pushButton_connect->click(); } //ENTER
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void waitForServerToStartGameDialogImpl::addConnectedPlayer(QString playerName) {
|
||||||
|
|
||||||
|
QTreeWidgetItem *item = new QTreeWidgetItem(treeWidget,0);
|
||||||
|
item->setData(0, 0, playerName);
|
||||||
|
}
|
||||||
|
|
||||||
|
void waitForServerToStartGameDialogImpl::removePlayer(QString playerName) {
|
||||||
|
|
||||||
|
QList<QTreeWidgetItem *> list = treeWidget->findItems(playerName, Qt::MatchExactly, 0);
|
||||||
|
if(!list.empty()) {
|
||||||
|
treeWidget->takeTopLevelItem(treeWidget->indexOfTopLevelItem(list[0]));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -38,6 +38,8 @@ public slots:
|
|||||||
void refresh(int actionID);
|
void refresh(int actionID);
|
||||||
void cancel();
|
void cancel();
|
||||||
void keyPressEvent ( QKeyEvent * event );
|
void keyPressEvent ( QKeyEvent * event );
|
||||||
|
void addConnectedPlayer(QString playerName);
|
||||||
|
void removePlayer(QString playerName);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user