servermessages via id implemented
This commit is contained in:
@@ -146,6 +146,7 @@ void ServerGuiWrapper::SignalNetClientGameStart(boost::shared_ptr<Game> game) {
|
||||
void ServerGuiWrapper::SignalNetClientGameChatMsg(const string &playerName, const string &msg) { if (myClientcb) myClientcb->SignalNetClientGameChatMsg(playerName, msg); }
|
||||
void ServerGuiWrapper::SignalNetClientLobbyChatMsg(const string &playerName, const string &msg) { if (myClientcb) myClientcb->SignalNetClientLobbyChatMsg(playerName, msg); }
|
||||
void ServerGuiWrapper::SignalNetClientMsgBox(const string &msg) { if (myClientcb) myClientcb->SignalNetClientMsgBox(msg); }
|
||||
void ServerGuiWrapper::SignalNetClientMsgBox(unsigned msgId) { if (myClientcb) myClientcb->SignalNetClientMsgBox(msgId); }
|
||||
void ServerGuiWrapper::SignalNetClientWaitDialog() { if (myClientcb) myClientcb->SignalNetClientWaitDialog(); }
|
||||
void ServerGuiWrapper::SignalNetClientWarningAutoFoldInRankingGame(unsigned remainingAutoFolds) { if (myClientcb) myClientcb->SignalNetClientWarningAutoFoldInRankingGame(remainingAutoFolds); }
|
||||
|
||||
|
||||
@@ -148,6 +148,7 @@ public:
|
||||
void SignalIrcPlayerLeft(const std::string &nickName);
|
||||
void SignalIrcChatMsg(const std::string &nickName, const std::string &msg);
|
||||
void SignalNetClientMsgBox(const std::string &msg);
|
||||
void SignalNetClientMsgBox(unsigned msgId);
|
||||
void SignalIrcError(int errorCode);
|
||||
void SignalIrcServerError(int errorCode);
|
||||
void SignalLobbyPlayerJoined(unsigned playerId, const std::string &nickName);
|
||||
|
||||
@@ -216,9 +216,9 @@ void MyAvatarLabel::reportBadAvatar() {
|
||||
|
||||
QString nick = QString::fromUtf8((*it_c)->getMyName().c_str());
|
||||
int ret = QMessageBox::question(this, tr("PokerTH - Question"),
|
||||
tr("Are you sure you want to report the avatar of \"%1\" as inappropriate?").arg(nick),
|
||||
QMessageBox::Yes | QMessageBox::No);
|
||||
if(ret) {
|
||||
tr("Are you sure you want to report the avatar of \"%1\" as inappropriate?").arg(nick), QMessageBox::Yes | QMessageBox::No);
|
||||
|
||||
if(ret == QMessageBox::Yes) {
|
||||
QFileInfo fi(avatar);
|
||||
myW->getSession()->reportBadAvatar((*it_c)->getMyUniqueID(), fi.baseName().toStdString());
|
||||
}
|
||||
|
||||
@@ -173,6 +173,7 @@ void GuiWrapper::SignalNetClientWarningAutoFoldInRankingGame(unsigned remainingA
|
||||
void GuiWrapper::SignalNetClientGameChatMsg(const string &playerName, const string &msg) { myStartWindow->signalNetClientGameChatMsg(QString::fromUtf8(playerName.c_str()), QString::fromUtf8(msg.c_str())); }
|
||||
void GuiWrapper::SignalNetClientLobbyChatMsg(const string &playerName, const string &msg) { myStartWindow->signalNetClientLobbyChatMsg(QString::fromUtf8(playerName.c_str()), QString::fromUtf8(msg.c_str())); }
|
||||
void GuiWrapper::SignalNetClientMsgBox(const string &msg) { myStartWindow->signalNetClientMsgBox(QString::fromUtf8(msg.c_str())); }
|
||||
void GuiWrapper::SignalNetClientMsgBox(unsigned msgId) { myStartWindow->signalNetClientMsgBox(msgId); }
|
||||
|
||||
void GuiWrapper::SignalNetServerSuccess(int /*actionID*/) { }
|
||||
void GuiWrapper::SignalNetServerError(int errorID, int osErrorID) { myStartWindow->signalNetServerError(errorID, osErrorID); }
|
||||
|
||||
@@ -132,6 +132,8 @@ public:
|
||||
void SignalNetClientGameChatMsg(const std::string &playerName, const std::string &msg);
|
||||
void SignalNetClientLobbyChatMsg(const std::string &playerName, const std::string &msg);
|
||||
void SignalNetClientMsgBox(const std::string &msg);
|
||||
void SignalNetClientMsgBox(unsigned msgId);
|
||||
|
||||
void SignalNetClientWaitDialog();
|
||||
void SignalNetClientWarningAutoFoldInRankingGame(unsigned remainingAutoFolds);
|
||||
|
||||
|
||||
@@ -147,6 +147,7 @@ startWindowImpl::startWindowImpl(ConfigFile *c)
|
||||
connect(this, SIGNAL(signalNetClientLobbyChatMsg(QString, QString)), myStartNetworkGameDialog->getMyChat(), SLOT(receiveMessage(QString, QString)));
|
||||
connect(this, SIGNAL(signalNetClientLobbyChatMsg(QString, QString)), myGameLobbyDialog->getMyChat(), SLOT(receiveMessage(QString, QString)));
|
||||
connect(this, SIGNAL(signalNetClientMsgBox(QString)), this, SLOT(networkMessage(QString)));
|
||||
connect(this, SIGNAL(signalNetClientMsgBox(unsigned)), this, SLOT(networkMessage(unsigned)));
|
||||
connect(this, SIGNAL(signalNetClientShowTimeoutDialog(int, unsigned)), this, SLOT(showTimeoutDialog(int, unsigned)));
|
||||
|
||||
connect(this, SIGNAL(signalLobbyPlayerJoined(unsigned, QString)), myGameLobbyDialog, SLOT(playerJoinedLobby(unsigned, QString)));
|
||||
@@ -944,6 +945,29 @@ void startWindowImpl::networkMessage(QString msg)
|
||||
msgBox.exec();
|
||||
}
|
||||
|
||||
void startWindowImpl::networkMessage(unsigned msgId)
|
||||
{
|
||||
QString msgText;
|
||||
|
||||
switch(msgId) {
|
||||
|
||||
case 1: { msgText = tr("The avatar report was accepted by the server. Thank you."); }
|
||||
break;
|
||||
case 2: { msgText = tr("This avatar was already reported by another player."); }
|
||||
break;
|
||||
case 3: { msgText = tr("An error occurred while reporting the avatar."); }
|
||||
break;
|
||||
default:;
|
||||
break;
|
||||
}
|
||||
|
||||
QMessageBox msgBox(QMessageBox::Information, tr("Server Message"),
|
||||
msgText, QMessageBox::Close, this);
|
||||
// msgBox.setTextFormat(Qt::RichText);
|
||||
msgBox.exec();
|
||||
}
|
||||
|
||||
|
||||
void startWindowImpl::networkStart(boost::shared_ptr<Game> game)
|
||||
{
|
||||
mySession->startClientGame(game);
|
||||
|
||||
@@ -91,6 +91,7 @@ signals:
|
||||
void signalNetClientGameChatMsg(QString nickName, QString msg);
|
||||
void signalNetClientLobbyChatMsg(QString nickName, QString msg);
|
||||
void signalNetClientMsgBox(QString msg);
|
||||
void signalNetClientMsgBox(unsigned msgId);
|
||||
|
||||
void signalLobbyPlayerJoined(unsigned playerId, QString nickName);
|
||||
void signalLobbyPlayerKicked(QString nickName, QString byWhom, QString reason);
|
||||
@@ -122,6 +123,7 @@ public slots:
|
||||
void networkError(int, int);
|
||||
void networkNotification(int);
|
||||
void networkMessage(QString);
|
||||
void networkMessage(unsigned);
|
||||
|
||||
void networkStart(boost::shared_ptr<Game> game);
|
||||
QStringList getPlayerNicksList();
|
||||
|
||||
Reference in New Issue
Block a user