new rejoin possible dialog added
This commit is contained in:
@@ -132,6 +132,12 @@ void ServerGuiWrapper::SignalNetClientLoginShow()
|
||||
{
|
||||
if (myClientcb) myClientcb->SignalNetClientLoginShow();
|
||||
}
|
||||
|
||||
void ServerGuiWrapper::SignalNetClientRejoinPossible(const std::string &gameName)
|
||||
{
|
||||
if (myClientcb) myClientcb->SignalNetClientRejoinPossible(gameName);
|
||||
}
|
||||
|
||||
void ServerGuiWrapper::SignalNetClientPostRiverShowCards(unsigned playerId)
|
||||
{
|
||||
if (myClientcb) myClientcb->SignalNetClientPostRiverShowCards(playerId);
|
||||
|
||||
@@ -139,6 +139,7 @@ public:
|
||||
void SignalNetClientServerListShow();
|
||||
|
||||
void SignalNetClientLoginShow();
|
||||
void SignalNetClientRejoinPossible(const std::string &gameName);
|
||||
void SignalNetClientPostRiverShowCards(unsigned playerId);
|
||||
|
||||
void SignalNetServerSuccess(int actionID);
|
||||
|
||||
@@ -3784,9 +3784,9 @@ p, li { white-space: pre-wrap; }
|
||||
</widget>
|
||||
<widget class="QWidget" name="tab_editTip">
|
||||
<attribute name="title">
|
||||
<string>Players tip</string>
|
||||
<string>Player info</string>
|
||||
</attribute>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<layout class="QGridLayout" name="gridLayout4">
|
||||
<property name="verticalSpacing">
|
||||
<number>3</number>
|
||||
</property>
|
||||
|
||||
@@ -294,6 +294,10 @@ void GuiWrapper::SignalNetClientLoginShow()
|
||||
{
|
||||
myStartWindow->signalNetClientLoginShow();
|
||||
}
|
||||
void GuiWrapper::SignalNetClientRejoinPossible(const string &gameName)
|
||||
{
|
||||
myStartWindow->signalNetClientRejoinPossible(QString::fromUtf8(gameName.c_str()));
|
||||
}
|
||||
void GuiWrapper::SignalNetClientPostRiverShowCards(unsigned playerId)
|
||||
{
|
||||
myW->signalPostRiverShowCards(playerId);
|
||||
|
||||
@@ -119,6 +119,7 @@ public:
|
||||
void SignalNetClientServerListShow();
|
||||
void SignalNetClientServerListClear();
|
||||
void SignalNetClientLoginShow();
|
||||
void SignalNetClientRejoinPossible(const std::string &gameName);
|
||||
void SignalNetClientPostRiverShowCards(unsigned playerId);
|
||||
void SignalNetClientGameInfo(int actionID);
|
||||
void SignalNetClientError(int errorID, int osErrorID);
|
||||
|
||||
@@ -114,6 +114,7 @@ startWindowImpl::startWindowImpl(ConfigFile *c)
|
||||
connect(this, SIGNAL(signalNetClientServerListAdd(unsigned)), myServerListDialog, SLOT(addServerItem(unsigned)));
|
||||
|
||||
connect(this, SIGNAL(signalNetClientLoginShow()), this, SLOT(callInternetGameLoginDialog()));
|
||||
connect(this, SIGNAL(signalNetClientRejoinPossible(QString)), this, SLOT(callRejoinPossibleDialog(QString)));
|
||||
|
||||
connect(this, SIGNAL(signalNetClientSelfJoined(unsigned, QString, bool)), myStartNetworkGameDialog, SLOT(joinedNetworkGame(unsigned, QString, bool)));
|
||||
connect(this, SIGNAL(signalNetClientPlayerJoined(unsigned, QString, bool)), myStartNetworkGameDialog, SLOT(addConnectedPlayer(unsigned, QString, bool)));
|
||||
@@ -359,15 +360,36 @@ void startWindowImpl::callInternetGameLoginDialog()
|
||||
if(myInternetGameLoginDialog->result() == QDialog::Accepted) {
|
||||
//send login infos
|
||||
mySession->setLogin(
|
||||
myConfig->readConfigString("MyName"),
|
||||
myInternetGameLoginDialog->lineEdit_password->text().toUtf8().constData(),
|
||||
myInternetGameLoginDialog->checkBox_guest->isChecked());
|
||||
myConfig->readConfigString("MyName"),
|
||||
myInternetGameLoginDialog->lineEdit_password->text().toUtf8().constData(),
|
||||
myInternetGameLoginDialog->checkBox_guest->isChecked());
|
||||
} else {
|
||||
myConnectToServerDialog->reject();
|
||||
mySession->terminateNetworkClient();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void startWindowImpl::callRejoinPossibleDialog(QString gameName)
|
||||
{
|
||||
QMessageBox msgBox;
|
||||
msgBox.setIcon(QMessageBox::Question);
|
||||
msgBox.setWindowTitle("Rejoin possible!");
|
||||
msgBox.setText(QString("There is an existing session with the game: %1").arg(gameName));
|
||||
msgBox.setInformativeText("Do you want to rejoin this game?");
|
||||
msgBox.setStandardButtons(QMessageBox::Yes | QMessageBox::No);
|
||||
msgBox.setDefaultButton(QMessageBox::Yes);
|
||||
int ret = msgBox.exec();
|
||||
|
||||
switch (ret) {
|
||||
case QMessageBox::Yes:; //rejoin
|
||||
break;
|
||||
case QMessageBox::No:; //lobby
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void startWindowImpl::callCreateNetworkGameDialog()
|
||||
{
|
||||
|
||||
@@ -471,10 +493,10 @@ void startWindowImpl::callJoinNetworkGameDialog()
|
||||
myStartNetworkGameDialog->clearDialog();
|
||||
// Maybe use QUrl::toPunycode.
|
||||
mySession->startNetworkClient(
|
||||
myJoinNetworkGameDialog->lineEdit_ipAddress->text().toUtf8().constData(),
|
||||
myJoinNetworkGameDialog->spinBox_port->value(),
|
||||
myJoinNetworkGameDialog->checkBox_ipv6->isChecked(),
|
||||
myJoinNetworkGameDialog->checkBox_sctp->isChecked());
|
||||
myJoinNetworkGameDialog->lineEdit_ipAddress->text().toUtf8().constData(),
|
||||
myJoinNetworkGameDialog->spinBox_port->value(),
|
||||
myJoinNetworkGameDialog->checkBox_ipv6->isChecked(),
|
||||
myJoinNetworkGameDialog->checkBox_sctp->isChecked());
|
||||
|
||||
//Dialog mit Statusbalken
|
||||
myConnectToServerDialog->exec();
|
||||
@@ -1032,7 +1054,7 @@ void startWindowImpl::networkMessage(unsigned msgId)
|
||||
|
||||
QMessageBox msgBox(QMessageBox::Information, tr("Server Message"),
|
||||
msgText, QMessageBox::Close, this);
|
||||
// msgBox.setTextFormat(Qt::RichText);
|
||||
// msgBox.setTextFormat(Qt::RichText);
|
||||
msgBox.exec();
|
||||
}
|
||||
|
||||
@@ -1082,7 +1104,7 @@ bool startWindowImpl::eventFilter(QObject *obj, QEvent *event)
|
||||
{
|
||||
if (event->type() == QEvent::Close) {
|
||||
event->ignore();
|
||||
// mySession->getMyLog()->closeLogDbAtExit();
|
||||
// mySession->getMyLog()->closeLogDbAtExit();
|
||||
return QMainWindow::eventFilter(obj, event);
|
||||
} else {
|
||||
// pass the event on to the parent class
|
||||
|
||||
@@ -77,6 +77,7 @@ signals:
|
||||
void signalNetClientServerListClear();
|
||||
void signalNetClientServerListAdd(unsigned serverId);
|
||||
void signalNetClientLoginShow();
|
||||
void signalNetClientRejoinPossible(QString gameName);
|
||||
void signalNetClientGameInfo(int actionID);
|
||||
void signalNetClientError(int errorID, int osErrorID);
|
||||
void signalNetClientNotification(int notificationId);
|
||||
@@ -120,6 +121,7 @@ public slots:
|
||||
void callJoinNetworkGameDialog();
|
||||
void showLobbyDialog();
|
||||
void callInternetGameLoginDialog();
|
||||
void callRejoinPossibleDialog(QString);
|
||||
void joinGameLobby();
|
||||
void showClientDialog();
|
||||
void showNetworkStartDialog();
|
||||
|
||||
@@ -68,6 +68,7 @@ public:
|
||||
virtual void SignalNetClientServerListShow() = 0;
|
||||
|
||||
virtual void SignalNetClientLoginShow() = 0;
|
||||
virtual void SignalNetClientRejoinPossible(const std::string &gameName) = 0;
|
||||
virtual void SignalNetClientPostRiverShowCards(unsigned playerId) = 0;
|
||||
|
||||
virtual void SignalLobbyPlayerJoined(unsigned playerId, const std::string &nickName) = 0;
|
||||
|
||||
Reference in New Issue
Block a user