servermessages via id implemented

This commit is contained in:
doitux
2011-01-10 21:40:48 +00:00
parent a2df4b2655
commit 6028ae57b7
8 changed files with 35 additions and 3 deletions
+3 -3
View File
@@ -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());
}
+1
View File
@@ -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); }
+2
View File
@@ -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);
+2
View File
@@ -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();