diff --git a/docs/infomessage-id-desc.txt b/docs/infomessage-id-desc.txt new file mode 100644 index 00000000..6cb09731 --- /dev/null +++ b/docs/infomessage-id-desc.txt @@ -0,0 +1,2 @@ +1: leave lobby during online game: Question(Do you really wanna leave?) +2: join invite only game: Info(You can invite people with right click ...) diff --git a/pokerth_game.pro b/pokerth_game.pro index 13e0b90a..6c9aaaff 100644 --- a/pokerth_game.pro +++ b/pokerth_game.pro @@ -9,7 +9,6 @@ CONFIG += qt \ rtti \ stl \ warn_on - include(src/third_party/qtsingleapplication/qtsingleapplication.pri) # ####Uncomment this for RELEASE on Linux/Unix/BSD (only for static Qt) @@ -95,7 +94,7 @@ DEPENDPATH += . \ src/gui/qt/serverlistdialog \ src/gui/qt/styles \ src/gui/qt/changehumanplayernamedialog \ - src/gui/qt/internetgamelogindialog \ + src/gui/qt/internetgamelogindialog \ src/gui/qt/changecompleteblindsdialog \ src/gui/qt/mymessagedialog \ src/gui/qt/gamelobbydialog \ @@ -299,23 +298,21 @@ win32 { ../curl/include \ ../zlib LIBPATH += ../boost/stage/lib \ - ../GnuTLS/lib \ - ../gsasl/lib \ - ../curl/lib \ - ../SDL/lib \ - ../SDL_mixer/lib \ - ../zlib + ../GnuTLS/lib \ + ../gsasl/lib \ + ../curl/lib \ + ../SDL/lib \ + ../SDL_mixer/lib \ + ../zlib LIBS += -lpokerth_lib \ - -lpokerth_db \ + -lpokerth_db \ -lpokerth_protocol - debug:LIBPATH += Debug/lib - release:LIBPATH += Release/lib - win32-msvc2008 { - LIBS += -llibgnutls-openssl-26 \ - -llibgcrypt-11 \ - -llibgsasl-7 \ - -llibcurl - } + debug:LIBPATH += Debug/lib + release:LIBPATH += Release/lib + win32-msvc2008:LIBS += -llibgnutls-openssl-26 \ + -llibgcrypt-11 \ + -llibgsasl-7 \ + -llibcurl win32-g++ { LIBS += -lgnutls-openssl \ -lgnutls \ @@ -402,18 +399,18 @@ unix:!mac { UNAME = $$system(uname -s) BSD = $$find(UNAME, "BSD") kFreeBSD = $$find(UNAME, "kFreeBSD") - LIBS += -lpokerth_lib \ - -lpokerth_db \ + LIBS += -lpokerth_lib \ + -lpokerth_db \ -lpokerth_protocol LIBS += $$BOOST_LIBS LIBS += -lSDL_mixer \ -lcurl \ - -lgsasl + -lgsasl !isEmpty( BSD ) && isEmpty( kFreeBSD ):LIBS += -lcrypto else:LIBS += -lgnutls-openssl \ -lgcrypt TARGETDEPS += ./lib/libpokerth_lib.a \ - ./lib/libpokerth_db.a \ + ./lib/libpokerth_db.a \ ./lib/libpokerth_protocol.a # #### My release static libs @@ -443,8 +440,8 @@ mac { # QMAKE_MAC_SDK=/Developer/SDKs/MacOSX10.4u.sdk/ LIBPATH += lib LIBS += -lpokerth_lib \ - -lpokerth_db \ - -lpokerth_protocol + -lpokerth_db \ + -lpokerth_protocol # QT dynamic linked framework (see also mac_post_make.sh) LIBS += -framework \ @@ -465,13 +462,13 @@ mac { LIBS += /usr/local/lib/libboost_regex.a LIBS += /usr/local/lib/libboost_system.a LIBS += /usr/local/lib/libboost_iostreams.a - LIBS += /usr/local/lib/libgsasl.a + LIBS += /usr/local/lib/libgsasl.a # libraries installed on every mac LIBS += -lcrypto \ -lssl \ -lz \ - -lcurl \ + -lcurl \ -framework \ Carbon @@ -482,3 +479,4 @@ mac { INCLUDEPATH += /Library/Frameworks/SDL.framework/Headers INCLUDEPATH += /Library/Frameworks/SDL_mixer.framework/Headers } +OTHER_FILES += docs/infomessage-id-desc.txt diff --git a/src/gui/qt/gamelobbydialog/gamelobbydialogimpl.cpp b/src/gui/qt/gamelobbydialog/gamelobbydialogimpl.cpp index 9f04892a..104a7124 100644 --- a/src/gui/qt/gamelobbydialog/gamelobbydialogimpl.cpp +++ b/src/gui/qt/gamelobbydialog/gamelobbydialogimpl.cpp @@ -18,9 +18,10 @@ #include "configfile.h" #include "gamedata.h" #include +#include "mymessagedialogimpl.h" gameLobbyDialogImpl::gameLobbyDialogImpl(startWindowImpl *parent, ConfigFile *c) - : QDialog(parent), myW(NULL), myStartWindow(parent), myConfig(c), currentGameName(""), myPlayerId(0), myCurrentGameId(0), isGameAdministrator(false), inGame(false), guestMode(false), blinkingButtonAnimationState(true), myChat(NULL), keyUpCounter(0) + : QDialog(parent), myW(NULL), myStartWindow(parent), myConfig(c), currentGameName(""), myPlayerId(0), myCurrentGameId(0), isGameAdministrator(false), inGame(false), guestMode(false), blinkingButtonAnimationState(true), myChat(NULL), keyUpCounter(0), infoMsgToShowId(0) { #ifdef __APPLE__ @@ -46,7 +47,9 @@ gameLobbyDialogImpl::gameLobbyDialogImpl(startWindowImpl *parent, ConfigFile *c) waitStartGameMsgBoxTimer->setSingleShot(TRUE); blinkingButtonAnimationTimer = new QTimer(this); blinkingButtonAnimationTimer->setInterval(1000); - + showInfoMsgBoxTimer = new QTimer(this); + showInfoMsgBoxTimer->setSingleShot(TRUE); + //fetch button colors for blinking groupBox_GameInfo->setEnabled(true); pushButton_StartGame->setEnabled(true); @@ -98,6 +101,7 @@ gameLobbyDialogImpl::gameLobbyDialogImpl(startWindowImpl *parent, ConfigFile *c) connect( lineEdit_ChatInput, SIGNAL( textEdited (QString) ), myChat, SLOT( setChatTextEdited() ) ); connect( waitStartGameMsgBoxTimer, SIGNAL(timeout()), this, SLOT( showWaitStartGameMsgBox() )); connect( blinkingButtonAnimationTimer, SIGNAL(timeout()), this, SLOT( blinkingStartButtonAnimation() )); + connect( showInfoMsgBoxTimer, SIGNAL(timeout()), this, SLOT( showInfoMsgBox() )); connect( comboBox_gameListFilter, SIGNAL(currentIndexChanged(int)), this, SLOT(changeGameListFilter(int))); connect( treeWidget_NickList, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT( showNickListContextMenu(QPoint) ) ); connect( nickListInviteAction, SIGNAL(triggered()), this, SLOT( invitePlayerToCurrentGame() )); @@ -746,13 +750,20 @@ void gameLobbyDialogImpl::blinkingStartButtonAnimation() { void gameLobbyDialogImpl::joinedNetworkGame(unsigned playerId, QString playerName, bool isGameAdmin) { - // Update dialog - inGame = true; - joinedGameDialogUpdate(); + // Update dialog + inGame = true; + joinedGameDialogUpdate(); - myPlayerId = playerId; - isGameAdministrator = isGameAdmin; - addConnectedPlayer(playerId, playerName, isGameAdmin); + myPlayerId = playerId; + isGameAdministrator = isGameAdmin; + addConnectedPlayer(playerId, playerName, isGameAdmin); + + //show msgBox about invite only game + assert(mySession); + if(mySession->getClientGameInfo(mySession->getClientCurrentGameId()).data.gameType == GAME_TYPE_INVITE_ONLY) { + infoMsgToShowId = 2; + showInfoMsgBoxTimer->start(1000); + } } @@ -1314,3 +1325,16 @@ void gameLobbyDialogImpl::invitePlayerToCurrentGame() { qDebug() << "invitePlayer"; } + +void gameLobbyDialogImpl::showInfoMsgBox() +{ + switch(infoMsgToShowId) { + case 2: { + myMessageDialogImpl dialog(myConfig, this); + dialog.exec(2, tr("You've entered a game with invite-only type.\nYou can invite other players with right-click on their nick in the left available players list."), tr("PokerTH - Info Message"), QPixmap(":/gfx/ktip.png"), QDialogButtonBox::Ok); + } + break; + default:; + break; + } +} diff --git a/src/gui/qt/gamelobbydialog/gamelobbydialogimpl.h b/src/gui/qt/gamelobbydialog/gamelobbydialogimpl.h index 3d492f5c..643d0ec0 100644 --- a/src/gui/qt/gamelobbydialog/gamelobbydialogimpl.h +++ b/src/gui/qt/gamelobbydialog/gamelobbydialogimpl.h @@ -104,6 +104,7 @@ public slots: void guestUserMode(); void showNickListContextMenu(QPoint); void invitePlayerToCurrentGame(); + void showInfoMsgBox(); private: @@ -123,6 +124,7 @@ private: QMessageBox *waitStartGameMsgBox; QTimer *waitStartGameMsgBoxTimer; QTimer *blinkingButtonAnimationTimer; + QTimer *showInfoMsgBoxTimer; bool blinkingButtonAnimationState; QColor defaultStartButtonColor; QColor defaultStartButtonTextColor; @@ -135,6 +137,7 @@ private: MyGameListSortFilterProxyModel *myGameListSortFilterProxyModel; QMenu *nickListContextMenu; QAction *nickListInviteAction; + int infoMsgToShowId; protected: diff --git a/src/gui/qt/gametable/gametableimpl.cpp b/src/gui/qt/gametable/gametableimpl.cpp index 11b06df9..eac8574a 100755 --- a/src/gui/qt/gametable/gametableimpl.cpp +++ b/src/gui/qt/gametable/gametableimpl.cpp @@ -3075,7 +3075,7 @@ void gameTableImpl::leaveCurrentNetworkGame() { myStartWindow->getSession()->sendLeaveCurrentGame(); } else { - if (dialog.exec(1, tr("Attention! Do you really want to leave the current game\nand go back to the lobby?"), "PokerTH - Internet Game Message", QPixmap(":/gfx/logoChip3D.png")) == QDialog::Accepted ) { + if (dialog.exec(1, tr("Attention! Do you really want to leave the current game\nand go back to the lobby?"), tr("PokerTH - Internet Game Message"), QPixmap(":/gfx/logoChip3D.png"), QDialogButtonBox::Ok) == QDialog::Accepted ) { assert(myStartWindow->getSession()); myStartWindow->getSession()->sendLeaveCurrentGame(); } diff --git a/src/gui/qt/mymessagedialog/mymessagedialogimpl.cpp b/src/gui/qt/mymessagedialog/mymessagedialogimpl.cpp index 31eeca13..aac1b089 100644 --- a/src/gui/qt/mymessagedialog/mymessagedialogimpl.cpp +++ b/src/gui/qt/mymessagedialog/mymessagedialogimpl.cpp @@ -39,7 +39,7 @@ myMessageDialogImpl::myMessageDialogImpl(ConfigFile *c, QWidget *parent) setupUi(this); } -int myMessageDialogImpl::exec(int messageId, QString msg, QString title, QPixmap pix) +int myMessageDialogImpl::exec(int messageId, QString msg, QString title, QPixmap pix, QDialogButtonBox::StandardButtons buttons) { bool show = false; bool found = false; @@ -71,6 +71,7 @@ int myMessageDialogImpl::exec(int messageId, QString msg, QString title, QPixmap setWindowTitle(title); label_icon->setPixmap(pix.scaled(50,50,Qt::KeepAspectRatio,Qt::SmoothTransformation)); label->setText(msg); + buttonBox->setStandardButtons(buttons); return QDialog::exec(); } @@ -92,7 +93,6 @@ void myMessageDialogImpl::reject() void myMessageDialogImpl::writeConfig() { - qDebug() << "jo1"; if(checkBox->isChecked()) { list::iterator it1; @@ -101,7 +101,6 @@ void myMessageDialogImpl::writeConfig() QString tmpString = QString::fromUtf8(it1->c_str()); if(QString("%1").arg(currentMsgId) == tmpString.split(",").at(1)) { - qDebug() << "jo2" << QString("0,%1").arg(currentMsgId).toUtf8().constData(); (*it1) = QString("0,%1").arg(currentMsgId).toUtf8().constData(); break; } diff --git a/src/gui/qt/mymessagedialog/mymessagedialogimpl.h b/src/gui/qt/mymessagedialog/mymessagedialogimpl.h index f1ec575e..49c93897 100644 --- a/src/gui/qt/mymessagedialog/mymessagedialogimpl.h +++ b/src/gui/qt/mymessagedialog/mymessagedialogimpl.h @@ -33,7 +33,7 @@ public: public slots: bool checkIfMesssageWillBeDisplayed(int id); - int exec(int messageId, QString msg, QString title, QPixmap pix); + int exec(int messageId, QString msg, QString title, QPixmap pix, QDialogButtonBox::StandardButtons buttons); void accept(); void reject(); void writeConfig(); diff --git a/src/gui/qt/resources/ktip.png b/src/gui/qt/resources/ktip.png new file mode 100644 index 00000000..8c004b76 Binary files /dev/null and b/src/gui/qt/resources/ktip.png differ diff --git a/src/gui/qt/resources/pokerth.qrc b/src/gui/qt/resources/pokerth.qrc index 9b579829..366a5d51 100644 --- a/src/gui/qt/resources/pokerth.qrc +++ b/src/gui/qt/resources/pokerth.qrc @@ -41,6 +41,7 @@ transform-rotate.png player_play.png logoChip3D.png + ktip.png cflags/ad.png