This commit is contained in:
@@ -99,4 +99,5 @@ void GuiWrapper::SignalNetClientGameStart(const GameData &gameData) { myW->Signa
|
||||
void GuiWrapper::SignalNetServerSuccess(int actionID) { }
|
||||
void GuiWrapper::SignalNetServerError(int errorID, int osErrorID) { }
|
||||
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())); }
|
||||
|
||||
|
||||
@@ -99,6 +99,7 @@ public:
|
||||
void SignalNetServerSuccess(int actionID);
|
||||
void SignalNetServerError(int errorID, int osErrorID);
|
||||
void SignalNetServerPlayerJoined(const std::string &playerName);
|
||||
void SignalNetServerPlayerLeft(const std::string &playerName);
|
||||
|
||||
private:
|
||||
|
||||
|
||||
@@ -557,6 +557,7 @@ mainWindowImpl::mainWindowImpl(QMainWindow *parent)
|
||||
connect(this, SIGNAL(SignalNetClientGameStart(int, int, int, int)), this, SLOT(networkStart(int, int, int, int)));
|
||||
|
||||
connect(this, SIGNAL(SignalNetServerPlayerJoined(QString)), myStartNetworkGameDialog, SLOT(addConnectedPlayer(QString)));
|
||||
connect(this, SIGNAL(SignalNetServerPlayerLeft(QString)), myStartNetworkGameDialog, SLOT(removePlayer(QString)));
|
||||
|
||||
|
||||
// textBrowser_Log->append(QString::number(this->pos().x(),10)+" "+QString::number(this->pos().y(),10));
|
||||
|
||||
@@ -98,6 +98,7 @@ signals:
|
||||
void SignalNetClientError(int errorID, int osErrorID);
|
||||
void SignalNetClientGameStart(int numberOfPlayers, int startCash, int smallBlind, int handsBeforeRaise);
|
||||
void SignalNetServerPlayerJoined(QString playerName);
|
||||
void SignalNetServerPlayerLeft(QString playerName);
|
||||
|
||||
public slots:
|
||||
|
||||
|
||||
@@ -47,6 +47,14 @@ void startNetworkGameDialogImpl::addConnectedPlayer(QString playerName) {
|
||||
item->setData(0, 0, playerName);
|
||||
}
|
||||
|
||||
void startNetworkGameDialogImpl::removePlayer(QString playerName) {
|
||||
|
||||
QList<QTreeWidgetItem *> list = treeWidget->findItems(playerName, Qt::MatchExactly, 0);
|
||||
if(!list.empty()) {
|
||||
treeWidget->takeTopLevelItem(treeWidget->indexOfTopLevelItem(list[0]));
|
||||
}
|
||||
}
|
||||
|
||||
void startNetworkGameDialogImpl::keyPressEvent ( QKeyEvent * event ) {
|
||||
|
||||
|
||||
|
||||
@@ -38,6 +38,7 @@ public slots:
|
||||
void startGame();
|
||||
void cancel();
|
||||
void addConnectedPlayer(QString playerName);
|
||||
void removePlayer(QString playerName);
|
||||
|
||||
void keyPressEvent ( QKeyEvent*);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user