GUI: next steps for extended info msg box system, new info msg about intive-only game type handling

This commit is contained in:
doitux
2010-03-28 22:17:18 +00:00
parent 8c3984b910
commit 9f04fc149c
9 changed files with 65 additions and 38 deletions
+2
View File
@@ -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 ...)
+23 -25
View File
@@ -9,7 +9,6 @@ CONFIG += qt \
rtti \ rtti \
stl \ stl \
warn_on warn_on
include(src/third_party/qtsingleapplication/qtsingleapplication.pri) include(src/third_party/qtsingleapplication/qtsingleapplication.pri)
# ####Uncomment this for RELEASE on Linux/Unix/BSD (only for static Qt) # ####Uncomment this for RELEASE on Linux/Unix/BSD (only for static Qt)
@@ -95,7 +94,7 @@ DEPENDPATH += . \
src/gui/qt/serverlistdialog \ src/gui/qt/serverlistdialog \
src/gui/qt/styles \ src/gui/qt/styles \
src/gui/qt/changehumanplayernamedialog \ src/gui/qt/changehumanplayernamedialog \
src/gui/qt/internetgamelogindialog \ src/gui/qt/internetgamelogindialog \
src/gui/qt/changecompleteblindsdialog \ src/gui/qt/changecompleteblindsdialog \
src/gui/qt/mymessagedialog \ src/gui/qt/mymessagedialog \
src/gui/qt/gamelobbydialog \ src/gui/qt/gamelobbydialog \
@@ -299,23 +298,21 @@ win32 {
../curl/include \ ../curl/include \
../zlib ../zlib
LIBPATH += ../boost/stage/lib \ LIBPATH += ../boost/stage/lib \
../GnuTLS/lib \ ../GnuTLS/lib \
../gsasl/lib \ ../gsasl/lib \
../curl/lib \ ../curl/lib \
../SDL/lib \ ../SDL/lib \
../SDL_mixer/lib \ ../SDL_mixer/lib \
../zlib ../zlib
LIBS += -lpokerth_lib \ LIBS += -lpokerth_lib \
-lpokerth_db \ -lpokerth_db \
-lpokerth_protocol -lpokerth_protocol
debug:LIBPATH += Debug/lib debug:LIBPATH += Debug/lib
release:LIBPATH += Release/lib release:LIBPATH += Release/lib
win32-msvc2008 { win32-msvc2008:LIBS += -llibgnutls-openssl-26 \
LIBS += -llibgnutls-openssl-26 \ -llibgcrypt-11 \
-llibgcrypt-11 \ -llibgsasl-7 \
-llibgsasl-7 \ -llibcurl
-llibcurl
}
win32-g++ { win32-g++ {
LIBS += -lgnutls-openssl \ LIBS += -lgnutls-openssl \
-lgnutls \ -lgnutls \
@@ -402,18 +399,18 @@ unix:!mac {
UNAME = $$system(uname -s) UNAME = $$system(uname -s)
BSD = $$find(UNAME, "BSD") BSD = $$find(UNAME, "BSD")
kFreeBSD = $$find(UNAME, "kFreeBSD") kFreeBSD = $$find(UNAME, "kFreeBSD")
LIBS += -lpokerth_lib \ LIBS += -lpokerth_lib \
-lpokerth_db \ -lpokerth_db \
-lpokerth_protocol -lpokerth_protocol
LIBS += $$BOOST_LIBS LIBS += $$BOOST_LIBS
LIBS += -lSDL_mixer \ LIBS += -lSDL_mixer \
-lcurl \ -lcurl \
-lgsasl -lgsasl
!isEmpty( BSD ) && isEmpty( kFreeBSD ):LIBS += -lcrypto !isEmpty( BSD ) && isEmpty( kFreeBSD ):LIBS += -lcrypto
else:LIBS += -lgnutls-openssl \ else:LIBS += -lgnutls-openssl \
-lgcrypt -lgcrypt
TARGETDEPS += ./lib/libpokerth_lib.a \ TARGETDEPS += ./lib/libpokerth_lib.a \
./lib/libpokerth_db.a \ ./lib/libpokerth_db.a \
./lib/libpokerth_protocol.a ./lib/libpokerth_protocol.a
# #### My release static libs # #### My release static libs
@@ -443,8 +440,8 @@ mac {
# QMAKE_MAC_SDK=/Developer/SDKs/MacOSX10.4u.sdk/ # QMAKE_MAC_SDK=/Developer/SDKs/MacOSX10.4u.sdk/
LIBPATH += lib LIBPATH += lib
LIBS += -lpokerth_lib \ LIBS += -lpokerth_lib \
-lpokerth_db \ -lpokerth_db \
-lpokerth_protocol -lpokerth_protocol
# QT dynamic linked framework (see also mac_post_make.sh) # QT dynamic linked framework (see also mac_post_make.sh)
LIBS += -framework \ LIBS += -framework \
@@ -465,13 +462,13 @@ mac {
LIBS += /usr/local/lib/libboost_regex.a LIBS += /usr/local/lib/libboost_regex.a
LIBS += /usr/local/lib/libboost_system.a LIBS += /usr/local/lib/libboost_system.a
LIBS += /usr/local/lib/libboost_iostreams.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 # libraries installed on every mac
LIBS += -lcrypto \ LIBS += -lcrypto \
-lssl \ -lssl \
-lz \ -lz \
-lcurl \ -lcurl \
-framework \ -framework \
Carbon Carbon
@@ -482,3 +479,4 @@ mac {
INCLUDEPATH += /Library/Frameworks/SDL.framework/Headers INCLUDEPATH += /Library/Frameworks/SDL.framework/Headers
INCLUDEPATH += /Library/Frameworks/SDL_mixer.framework/Headers INCLUDEPATH += /Library/Frameworks/SDL_mixer.framework/Headers
} }
OTHER_FILES += docs/infomessage-id-desc.txt
@@ -18,9 +18,10 @@
#include "configfile.h" #include "configfile.h"
#include "gamedata.h" #include "gamedata.h"
#include <net/socket_msg.h> #include <net/socket_msg.h>
#include "mymessagedialogimpl.h"
gameLobbyDialogImpl::gameLobbyDialogImpl(startWindowImpl *parent, ConfigFile *c) 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__ #ifdef __APPLE__
@@ -46,6 +47,8 @@ gameLobbyDialogImpl::gameLobbyDialogImpl(startWindowImpl *parent, ConfigFile *c)
waitStartGameMsgBoxTimer->setSingleShot(TRUE); waitStartGameMsgBoxTimer->setSingleShot(TRUE);
blinkingButtonAnimationTimer = new QTimer(this); blinkingButtonAnimationTimer = new QTimer(this);
blinkingButtonAnimationTimer->setInterval(1000); blinkingButtonAnimationTimer->setInterval(1000);
showInfoMsgBoxTimer = new QTimer(this);
showInfoMsgBoxTimer->setSingleShot(TRUE);
//fetch button colors for blinking //fetch button colors for blinking
groupBox_GameInfo->setEnabled(true); groupBox_GameInfo->setEnabled(true);
@@ -98,6 +101,7 @@ gameLobbyDialogImpl::gameLobbyDialogImpl(startWindowImpl *parent, ConfigFile *c)
connect( lineEdit_ChatInput, SIGNAL( textEdited (QString) ), myChat, SLOT( setChatTextEdited() ) ); connect( lineEdit_ChatInput, SIGNAL( textEdited (QString) ), myChat, SLOT( setChatTextEdited() ) );
connect( waitStartGameMsgBoxTimer, SIGNAL(timeout()), this, SLOT( showWaitStartGameMsgBox() )); connect( waitStartGameMsgBoxTimer, SIGNAL(timeout()), this, SLOT( showWaitStartGameMsgBox() ));
connect( blinkingButtonAnimationTimer, SIGNAL(timeout()), this, SLOT( blinkingStartButtonAnimation() )); 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( comboBox_gameListFilter, SIGNAL(currentIndexChanged(int)), this, SLOT(changeGameListFilter(int)));
connect( treeWidget_NickList, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT( showNickListContextMenu(QPoint) ) ); connect( treeWidget_NickList, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT( showNickListContextMenu(QPoint) ) );
connect( nickListInviteAction, SIGNAL(triggered()), this, SLOT( invitePlayerToCurrentGame() )); connect( nickListInviteAction, SIGNAL(triggered()), this, SLOT( invitePlayerToCurrentGame() ));
@@ -746,13 +750,20 @@ void gameLobbyDialogImpl::blinkingStartButtonAnimation() {
void gameLobbyDialogImpl::joinedNetworkGame(unsigned playerId, QString playerName, bool isGameAdmin) { void gameLobbyDialogImpl::joinedNetworkGame(unsigned playerId, QString playerName, bool isGameAdmin) {
// Update dialog // Update dialog
inGame = true; inGame = true;
joinedGameDialogUpdate(); joinedGameDialogUpdate();
myPlayerId = playerId; myPlayerId = playerId;
isGameAdministrator = isGameAdmin; isGameAdministrator = isGameAdmin;
addConnectedPlayer(playerId, playerName, 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"; 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;
}
}
@@ -104,6 +104,7 @@ public slots:
void guestUserMode(); void guestUserMode();
void showNickListContextMenu(QPoint); void showNickListContextMenu(QPoint);
void invitePlayerToCurrentGame(); void invitePlayerToCurrentGame();
void showInfoMsgBox();
private: private:
@@ -123,6 +124,7 @@ private:
QMessageBox *waitStartGameMsgBox; QMessageBox *waitStartGameMsgBox;
QTimer *waitStartGameMsgBoxTimer; QTimer *waitStartGameMsgBoxTimer;
QTimer *blinkingButtonAnimationTimer; QTimer *blinkingButtonAnimationTimer;
QTimer *showInfoMsgBoxTimer;
bool blinkingButtonAnimationState; bool blinkingButtonAnimationState;
QColor defaultStartButtonColor; QColor defaultStartButtonColor;
QColor defaultStartButtonTextColor; QColor defaultStartButtonTextColor;
@@ -135,6 +137,7 @@ private:
MyGameListSortFilterProxyModel *myGameListSortFilterProxyModel; MyGameListSortFilterProxyModel *myGameListSortFilterProxyModel;
QMenu *nickListContextMenu; QMenu *nickListContextMenu;
QAction *nickListInviteAction; QAction *nickListInviteAction;
int infoMsgToShowId;
protected: protected:
+1 -1
View File
@@ -3075,7 +3075,7 @@ void gameTableImpl::leaveCurrentNetworkGame() {
myStartWindow->getSession()->sendLeaveCurrentGame(); myStartWindow->getSession()->sendLeaveCurrentGame();
} }
else { 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()); assert(myStartWindow->getSession());
myStartWindow->getSession()->sendLeaveCurrentGame(); myStartWindow->getSession()->sendLeaveCurrentGame();
} }
@@ -39,7 +39,7 @@ myMessageDialogImpl::myMessageDialogImpl(ConfigFile *c, QWidget *parent)
setupUi(this); 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 show = false;
bool found = false; bool found = false;
@@ -71,6 +71,7 @@ int myMessageDialogImpl::exec(int messageId, QString msg, QString title, QPixmap
setWindowTitle(title); setWindowTitle(title);
label_icon->setPixmap(pix.scaled(50,50,Qt::KeepAspectRatio,Qt::SmoothTransformation)); label_icon->setPixmap(pix.scaled(50,50,Qt::KeepAspectRatio,Qt::SmoothTransformation));
label->setText(msg); label->setText(msg);
buttonBox->setStandardButtons(buttons);
return QDialog::exec(); return QDialog::exec();
} }
@@ -92,7 +93,6 @@ void myMessageDialogImpl::reject()
void myMessageDialogImpl::writeConfig() void myMessageDialogImpl::writeConfig()
{ {
qDebug() << "jo1";
if(checkBox->isChecked()) { if(checkBox->isChecked()) {
list<std::string>::iterator it1; list<std::string>::iterator it1;
@@ -101,7 +101,6 @@ void myMessageDialogImpl::writeConfig()
QString tmpString = QString::fromUtf8(it1->c_str()); QString tmpString = QString::fromUtf8(it1->c_str());
if(QString("%1").arg(currentMsgId) == tmpString.split(",").at(1)) { 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(); (*it1) = QString("0,%1").arg(currentMsgId).toUtf8().constData();
break; break;
} }
@@ -33,7 +33,7 @@ public:
public slots: public slots:
bool checkIfMesssageWillBeDisplayed(int id); 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 accept();
void reject(); void reject();
void writeConfig(); void writeConfig();
Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

+1
View File
@@ -41,6 +41,7 @@
<file>transform-rotate.png</file> <file>transform-rotate.png</file>
<file>player_play.png</file> <file>player_play.png</file>
<file>logoChip3D.png</file> <file>logoChip3D.png</file>
<file>ktip.png</file>
</qresource> </qresource>
<qresource prefix="/cflags"> <qresource prefix="/cflags">
<file>cflags/ad.png</file> <file>cflags/ad.png</file>