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 \
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
@@ -18,9 +18,10 @@
#include "configfile.h"
#include "gamedata.h"
#include <net/socket_msg.h>
#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;
}
}
@@ -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:
+1 -1
View File
@@ -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();
}
@@ -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<std::string>::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;
}
@@ -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();
Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

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