diff --git a/src/chatcleaner/badwordcheck.cpp b/src/chatcleaner/badwordcheck.cpp index 0f7e4923..15f114f1 100644 --- a/src/chatcleaner/badwordcheck.cpp +++ b/src/chatcleaner/badwordcheck.cpp @@ -9,26 +9,26 @@ BadWordCheck::BadWordCheck() bool BadWordCheck::run(QString msg) { msg = msg.toLower(); - bool badMessage(false); + bool badMessage(false); QStringListIterator it(badWords); while (it.hasNext()) { - QString bw=it.next(); - if(msg.contains(bw)) { - badMessage=true; + QString bw=it.next(); + if(msg.contains(bw)) { + badMessage=true; - //exception check - QStringListIterator it2(badWordsException); - while (it2.hasNext()) { - QString bwe=it2.next(); - if(bwe.contains(bw) && msg.contains(bwe)) { - badMessage=false; - } - } - } + //exception check + QStringListIterator it2(badWordsException); + while (it2.hasNext()) { + QString bwe=it2.next(); + if(bwe.contains(bw) && msg.contains(bwe)) { + badMessage=false; + } + } + } } - if(badMessage) return true; - else return false; + if(badMessage) return true; + else return false; } diff --git a/src/chatcleaner/badwordcheck.h b/src/chatcleaner/badwordcheck.h index 6bdf986c..f26cf7b3 100644 --- a/src/chatcleaner/badwordcheck.h +++ b/src/chatcleaner/badwordcheck.h @@ -13,16 +13,16 @@ public: badWords = bw; } - void setBadWordsException(QStringList bwe) { - badWordsException = bwe; - } + void setBadWordsException(QStringList bwe) { + badWordsException = bwe; + } bool run(QString); private: QStringList badWords; - QStringList badWordsException; + QStringList badWordsException; }; #endif // BADWORDCHECK_H diff --git a/src/chatcleaner/cleanerconfig.cpp b/src/chatcleaner/cleanerconfig.cpp index 7d38559f..540fd2cd 100644 --- a/src/chatcleaner/cleanerconfig.cpp +++ b/src/chatcleaner/cleanerconfig.cpp @@ -43,7 +43,7 @@ using namespace std; CleanerConfig::CleanerConfig() { // !!!! Revisionsnummer der Configdefaults !!!!! - configRev = 9; + configRev = 9; // Pfad und Dateinamen setzen #ifdef _WIN32 @@ -158,9 +158,9 @@ CleanerConfig::CleanerConfig() badWordsList.push_back("whore"); configList.push_back(ConfigInfo("BadWordsList", CONFIG_TYPE_STRING_LIST, "BadWords", badWordsList)); - list badWordsExceptionList; - badWordsExceptionList.push_back("idiots end"); - configList.push_back(ConfigInfo("BadWordsException", CONFIG_TYPE_STRING_LIST, "BadWordsException", badWordsExceptionList)); + list badWordsExceptionList; + badWordsExceptionList.push_back("idiots end"); + configList.push_back(ConfigInfo("BadWordsException", CONFIG_TYPE_STRING_LIST, "BadWordsException", badWordsExceptionList)); list urlStringsList; diff --git a/src/chatcleaner/messagefilter.cpp b/src/chatcleaner/messagefilter.cpp index 0268a73b..be99cefe 100644 --- a/src/chatcleaner/messagefilter.cpp +++ b/src/chatcleaner/messagefilter.cpp @@ -178,20 +178,20 @@ void MessageFilter::refreshConfig() // special check settings //Bad Words std::list badWordsList = config->readConfigStringList("BadWordsList"); - std::list::iterator it0; + std::list::iterator it0; QStringList bwList; - for(it0= badWordsList.begin(); it0 != badWordsList.end(); ++it0) { - bwList << QString::fromUtf8(it0->c_str()); + for(it0= badWordsList.begin(); it0 != badWordsList.end(); ++it0) { + bwList << QString::fromUtf8(it0->c_str()); } myBadWordCheck->setBadWords(bwList); - std::list badWordsExceptionList = config->readConfigStringList("BadWordsList"); - std::list::iterator it1; - QStringList bweList; - for(it1= badWordsExceptionList.begin(); it1 != badWordsExceptionList.end(); ++it1) { - bweList << QString::fromUtf8(it1->c_str()); - } - myBadWordCheck->setBadWordsException(bweList); + std::list badWordsExceptionList = config->readConfigStringList("BadWordsList"); + std::list::iterator it1; + QStringList bweList; + for(it1= badWordsExceptionList.begin(); it1 != badWordsExceptionList.end(); ++it1) { + bweList << QString::fromUtf8(it1->c_str()); + } + myBadWordCheck->setBadWordsException(bweList); std::list urlStringsList = config->readConfigStringList("UrlStringsList"); std::list::iterator it2; diff --git a/src/config/configfile.cpp b/src/config/configfile.cpp index 6c8097e6..c093c422 100644 --- a/src/config/configfile.cpp +++ b/src/config/configfile.cpp @@ -50,7 +50,7 @@ ConfigFile::ConfigFile(char *argv0, bool readonly) : noWriteAccess(readonly) myConfigState = OK; // !!!! Revisionsnummer der Configdefaults !!!!! - configRev = 98; + configRev = 98; //standard defaults logOnOffDefault = "1"; @@ -131,7 +131,7 @@ ConfigFile::ConfigFile(char *argv0, bool readonly) : noWriteAccess(readonly) tempIntToString << configRev; configList.push_back(ConfigInfo("ConfigRevision", CONFIG_TYPE_INT, tempIntToString.str())); #ifdef ANDROID - configList.push_back(ConfigInfo("AppDataDir", CONFIG_TYPE_STRING, ":/android/android-data/")); + configList.push_back(ConfigInfo("AppDataDir", CONFIG_TYPE_STRING, ":/android/android-data/")); #else configList.push_back(ConfigInfo("AppDataDir", CONFIG_TYPE_STRING, myQtToolsInterface->getDataPathStdString(myArgv0))); #endif @@ -320,8 +320,8 @@ ConfigFile::ConfigFile(char *argv0, bool readonly) : noWriteAccess(readonly) if (tmpStr) tempAppDataPath = tmpStr; //if appdatapath changes directly update it here not in UpdateConfig() #ifdef ANDROID - if(tempAppDataPath != ":/android/android-data/") { - confAppDataPath->SetAttribute("value", ":/android/android-data/"); + if(tempAppDataPath != ":/android/android-data/") { + confAppDataPath->SetAttribute("value", ":/android/android-data/"); #else if(tempAppDataPath != myQtToolsInterface->getDataPathStdString(myArgv0)) { confAppDataPath->SetAttribute("value", myQtToolsInterface->stringToUtf8(myQtToolsInterface->getDataPathStdString(myArgv0))); @@ -555,19 +555,19 @@ void ConfigFile::updateConfig(ConfigState myConfigState) ///////// VERSION HACK SECTION /////////////////////// //this is the right place for special version depending config hacks: //0.9.1 - log interval needs to be set to 1 instead of 0 - if (configRev >= 95 && configRev <= 98) { // this means 0.9.1 or 0.9.2 or 1.0 + if (configRev >= 95 && configRev <= 98) { // this means 0.9.1 or 0.9.2 or 1.0 TiXmlElement * confElement2 = new TiXmlElement( "LogInterval" ); config->LinkEndChild( confElement2 ); confElement2->SetAttribute("value", 1); noUpdateElemtsList.push_back("LogInterval"); } - if (configRev == 98) { // this means 1.0 - TiXmlElement * confElement3 = new TiXmlElement( "CurrentCardDeckStyle" ); - config->LinkEndChild( confElement3 ); - confElement3->SetAttribute("value", ""); - noUpdateElemtsList.push_back("CurrentCardDeckStyle"); - } + if (configRev == 98) { // this means 1.0 + TiXmlElement * confElement3 = new TiXmlElement( "CurrentCardDeckStyle" ); + config->LinkEndChild( confElement3 ); + confElement3->SetAttribute("value", ""); + noUpdateElemtsList.push_back("CurrentCardDeckStyle"); + } ///////// VERSION HACK SECTION /////////////////////// TiXmlHandle oldDocHandle( &oldDoc ); diff --git a/src/gui/qt/aboutpokerth/aboutpokerthimpl.cpp b/src/gui/qt/aboutpokerth/aboutpokerthimpl.cpp index e436979a..b3aa78a1 100755 --- a/src/gui/qt/aboutpokerth/aboutpokerthimpl.cpp +++ b/src/gui/qt/aboutpokerth/aboutpokerthimpl.cpp @@ -21,8 +21,8 @@ #include #ifdef ANDROID - #include - #include +#include +#include #endif aboutPokerthImpl::aboutPokerthImpl(QWidget *parent, ConfigFile *c) @@ -39,11 +39,11 @@ aboutPokerthImpl::aboutPokerthImpl(QWidget *parent, ConfigFile *c) QPalette myPalette = textBrowser_licence->palette(); #ifdef GUI_800x480 #ifdef ANDROID - myPalette.setColor(QPalette::Base, QColor(255,255,255,255)); - myPalette.setColor(QPalette::Text, QColor(0,0,0,255)); + myPalette.setColor(QPalette::Base, QColor(255,255,255,255)); + myPalette.setColor(QPalette::Text, QColor(0,0,0,255)); #else - myPalette.setColor(QPalette::Base, QColor(0,0,0,255)); - myPalette.setColor(QPalette::Text, QColor(255,255,255,255)); + myPalette.setColor(QPalette::Base, QColor(0,0,0,255)); + myPalette.setColor(QPalette::Text, QColor(255,255,255,255)); #endif #else QColor myColor = myPalette.color(QPalette::Window); @@ -52,7 +52,7 @@ aboutPokerthImpl::aboutPokerthImpl(QWidget *parent, ConfigFile *c) textBrowser_licence->setPalette(myPalette); textBrowser_2->setPalette(myPalette); textBrowser_3->setPalette(myPalette); - textBrowser_4->setPalette(myPalette); + textBrowser_4->setPalette(myPalette); QFile gplFile(QDir::toNativeSeparators(myAppDataPath+"misc/agpl.html")); QString gplString; @@ -68,32 +68,31 @@ aboutPokerthImpl::aboutPokerthImpl(QWidget *parent, ConfigFile *c) label_logo->setPixmap(QPixmap(":/gfx/logoChip3D.png")); #ifdef GUI_800x480 - label_pokerthVersion->setStyleSheet("QLabel { font-size: 30px; font-weight: bold;}"); + label_pokerthVersion->setStyleSheet("QLabel { font-size: 30px; font-weight: bold;}"); #else label_pokerthVersion->setStyleSheet("QLabel { font-size: 16px; font-weight: bold;}"); #endif #ifdef ANDROID - JavaVM *currVM = (JavaVM *)QApplication::platformNativeInterface()->nativeResourceForWidget("JavaVM", 0); - JNIEnv* env; - int api = -2; - if (currVM->AttachCurrentThread(&env, NULL)<0) { - qCritical()<<"AttachCurrentThread failed"; - } - else { - jclass jclassApplicationClass = env->FindClass("android/os/Build$VERSION"); - if (jclassApplicationClass) { - api = env->GetStaticIntField(jclassApplicationClass, env->GetStaticFieldID(jclassApplicationClass,"SDK_INT", "I")); - } - currVM->DetachCurrentThread(); - } - label_pokerthVersion->setText(QString(tr("PokerTH %1 for Android (API%2)").arg(POKERTH_BETA_RELEASE_STRING).arg(api))); + JavaVM *currVM = (JavaVM *)QApplication::platformNativeInterface()->nativeResourceForWidget("JavaVM", 0); + JNIEnv* env; + int api = -2; + if (currVM->AttachCurrentThread(&env, NULL)<0) { + qCritical()<<"AttachCurrentThread failed"; + } else { + jclass jclassApplicationClass = env->FindClass("android/os/Build$VERSION"); + if (jclassApplicationClass) { + api = env->GetStaticIntField(jclassApplicationClass, env->GetStaticFieldID(jclassApplicationClass,"SDK_INT", "I")); + } + currVM->DetachCurrentThread(); + } + label_pokerthVersion->setText(QString(tr("PokerTH %1 for Android (API%2)").arg(POKERTH_BETA_RELEASE_STRING).arg(api))); #else - label_pokerthVersion->setText(QString(tr("PokerTH %1").arg(POKERTH_BETA_RELEASE_STRING))); + label_pokerthVersion->setText(QString(tr("PokerTH %1").arg(POKERTH_BETA_RELEASE_STRING))); #endif this->setWindowTitle(QString(tr("About PokerTH %1").arg(POKERTH_BETA_RELEASE_STRING))); - //add text to lables and textbrowsers + //add text to lables and textbrowsers QString thxToInfos; thxToInfos.append(tr("- Wikimedia Commons: for different popular avatar picture resources")+"
"); thxToInfos.append(tr("- Benedikt, Erhard, Felix, Florian, Linus, Lothar, Steffi, Caro: for people avatar pictures")+"
"); @@ -102,36 +101,36 @@ aboutPokerthImpl::aboutPokerthImpl(QWidget *parent, ConfigFile *c) thxToInfos.append(tr("- doc_dos: for self recorded chip sounds")+"
"); thxToInfos.append(tr("- thiger, dunkanx, BerndA, coldz, drull: for different patches")+"
"); thxToInfos.append(tr("- kraut: for internet-game-server hosting and administration")+"
"); - thxToInfos.append(tr("- danuxi: for startwindow background gfx and danuxi1 table background")+"
"); + thxToInfos.append(tr("- danuxi: for startwindow background gfx and danuxi1 table background")+"
"); thxToInfos.append(tr("- heyn: for moderating forum and organise bugtracker and feature requests")+"
"); thxToInfos.append(tr("- texas_outlaw: for new table sounds")+"
"); textBrowser_3->setHtml(thxToInfos); - QString infoText; - infoText.append(tr("- Poker engine for the popular Texas Hold'em Poker")+"\n"); - infoText.append(tr("- Singleplayer games with up to 9 computer-opponents")+"\n"); - infoText.append(tr("- Multiplayer network games")+"\n"); - infoText.append(tr("- Internet online games")+"\n"); - infoText.append(tr("- Changeable gui with online style gallery")+"\n"); - infoText.append(tr("- Online ranking website with result tables")+"\n"); - infoText.append("\n"); - QString thisYear = QDate::currentDate().toString("yyyy"); - infoText.append("(c)2006-"+thisYear+", Felix Hammer, Florian Thauer, Lothar May"); - label_infotext->setText(infoText); + QString infoText; + infoText.append(tr("- Poker engine for the popular Texas Hold'em Poker")+"\n"); + infoText.append(tr("- Singleplayer games with up to 9 computer-opponents")+"\n"); + infoText.append(tr("- Multiplayer network games")+"\n"); + infoText.append(tr("- Internet online games")+"\n"); + infoText.append(tr("- Changeable gui with online style gallery")+"\n"); + infoText.append(tr("- Online ranking website with result tables")+"\n"); + infoText.append("\n"); + QString thisYear = QDate::currentDate().toString("yyyy"); + infoText.append("(c)2006-"+thisYear+", Felix Hammer, Florian Thauer, Lothar May"); + label_infotext->setText(infoText); - QString projectText; - projectText.append(""+tr("Project page:")+"
"); - projectText.append("    http://www.pokerth.net
"); - projectText.append("IRC:
"); - projectText.append("    #pokerth (irc.freenode.net)
"); - projectText.append(""+tr("Authors:")+"
"); - projectText.append("    Felix Hammer (doitux@pokerth.net)
"); - projectText.append("        - "+tr("initial idea, basic architecture, gui implementation, gui graphics editing, linux package")+"
"); - projectText.append("    Florian Thauer (floty@pokerth.net)
"); - projectText.append("        - "+tr("initial idea, basic architecture, engine development")+"
"); - projectText.append("    Lothar May (lotodore@pokerth.net)
"); - projectText.append("        - "+tr("basic architecture, network development, windows package, MacOS package")+"
"); - projectText.append("    Oskar Lindqvist (tranberry@pokerth.net)
"); - projectText.append("        - "+tr("initial gui graphics design")+"
"); - textBrowser_2->setHtml(projectText); + QString projectText; + projectText.append(""+tr("Project page:")+"
"); + projectText.append("    http://www.pokerth.net
"); + projectText.append("IRC:
"); + projectText.append("    #pokerth (irc.freenode.net)
"); + projectText.append(""+tr("Authors:")+"
"); + projectText.append("    Felix Hammer (doitux@pokerth.net)
"); + projectText.append("        - "+tr("initial idea, basic architecture, gui implementation, gui graphics editing, linux package")+"
"); + projectText.append("    Florian Thauer (floty@pokerth.net)
"); + projectText.append("        - "+tr("initial idea, basic architecture, engine development")+"
"); + projectText.append("    Lothar May (lotodore@pokerth.net)
"); + projectText.append("        - "+tr("basic architecture, network development, windows package, MacOS package")+"
"); + projectText.append("    Oskar Lindqvist (tranberry@pokerth.net)
"); + projectText.append("        - "+tr("initial gui graphics design")+"
"); + textBrowser_2->setHtml(projectText); } diff --git a/src/gui/qt/changecompleteblindsdialog/changecompleteblindsdialogimpl.cpp b/src/gui/qt/changecompleteblindsdialog/changecompleteblindsdialogimpl.cpp index 4d8619e3..dc48768c 100644 --- a/src/gui/qt/changecompleteblindsdialog/changecompleteblindsdialogimpl.cpp +++ b/src/gui/qt/changecompleteblindsdialog/changecompleteblindsdialogimpl.cpp @@ -28,7 +28,7 @@ changeCompleteBlindsDialogImpl::changeCompleteBlindsDialogImpl(QWidget *parent, setWindowModality(Qt::ApplicationModal); setWindowFlags(Qt::WindowSystemMenuHint | Qt::CustomizeWindowHint | Qt::Dialog); #endif - setupUi(this); + setupUi(this); this->installEventFilter(this); connect( pushButton_add, SIGNAL( clicked() ), this, SLOT( addBlindValueToList() ) ); @@ -54,8 +54,8 @@ void changeCompleteBlindsDialogImpl::addBlindValueToList() if(listWidget_blinds->count() == 30) { MyMessageBox::warning(this, tr("Manual Blinds Order"), - tr("You cannot set more than 30 manual blinds."), - QMessageBox::Close); + tr("You cannot set more than 30 manual blinds."), + QMessageBox::Close); } else { listWidget_blinds->addItem(QString::number(spinBox_input->value(),10)); sortBlindsList(); @@ -119,12 +119,10 @@ bool changeCompleteBlindsDialogImpl::eventFilter(QObject *obj, QEvent *event) } event->ignore(); return false; - } - else if (event->type() == QEvent::KeyPress && keyEvent->key() == Qt::Key_Back) { + } else if (event->type() == QEvent::KeyPress && keyEvent->key() == Qt::Key_Back) { this->reject(); return true; - } - else { + } else { // pass the event on to the parent class return QDialog::eventFilter(obj, event); } diff --git a/src/gui/qt/changecompleteblindsdialog/changecompleteblindsdialogimpl.h b/src/gui/qt/changecompleteblindsdialog/changecompleteblindsdialogimpl.h index 7ceb1105..4349ee0d 100644 --- a/src/gui/qt/changecompleteblindsdialog/changecompleteblindsdialogimpl.h +++ b/src/gui/qt/changecompleteblindsdialog/changecompleteblindsdialogimpl.h @@ -35,7 +35,7 @@ class changeCompleteBlindsDialogImpl: public QDialog, public Ui::changeCompleteB public: changeCompleteBlindsDialogImpl(QWidget *parent = 0, ConfigFile *c = 0); - void exec(); + void exec(); bool eventFilter(QObject *obj, QEvent *event); public slots: diff --git a/src/gui/qt/changecontentdialog/changecontentdialogimpl.cpp b/src/gui/qt/changecontentdialog/changecontentdialogimpl.cpp index 00bd2310..868126d0 100644 --- a/src/gui/qt/changecontentdialog/changecontentdialogimpl.cpp +++ b/src/gui/qt/changecontentdialog/changecontentdialogimpl.cpp @@ -123,12 +123,10 @@ bool changeContentDialogImpl::eventFilter(QObject *obj, QEvent *event) } event->ignore(); return false; - } - else if (event->type() == QEvent::KeyPress && keyEvent->key() == Qt::Key_Back) { + } else if (event->type() == QEvent::KeyPress && keyEvent->key() == Qt::Key_Back) { this->reject(); return true; - } - else { + } else { // pass the event on to the parent class return QDialog::eventFilter(obj, event); } diff --git a/src/gui/qt/chattools/chattools.cpp b/src/gui/qt/chattools/chattools.cpp index d941ea3d..560a1372 100644 --- a/src/gui/qt/chattools/chattools.cpp +++ b/src/gui/qt/chattools/chattools.cpp @@ -30,7 +30,7 @@ using namespace std; ChatTools::ChatTools(QLineEdit* l, ConfigFile *c, ChatType ct, QTextBrowser *b, QStandardItemModel *m, gameLobbyDialogImpl *lo) : nickAutoCompletitionCounter(0), myLineEdit(l), myNickListModel(m), myNickStringList(NULL), myTextBrowser(b), myChatType(ct), myConfig(c), myNick(""), myLobby(lo) { myNick = QString::fromUtf8(myConfig->readConfigString("MyName").c_str()); - ignoreList = myConfig->readConfigStringList("PlayerIgnoreList"); + ignoreList = myConfig->readConfigStringList("PlayerIgnoreList"); } ChatTools::~ChatTools() @@ -83,7 +83,7 @@ void ChatTools::receiveMessage(QString playerName, QString message, bool pm) tempMsg = QString(""+message+""); //play beep sound only in INET-lobby-chat if(myLobby->isVisible() && myConfig->readConfigInt("PlayLobbyChatNotification")) { - myLobby->getMyW()->getMySoundEventHandler()->playSound("lobbychatnotify",0); + myLobby->getMyW()->getMySoundEventHandler()->playSound("lobbychatnotify",0); } } else if(message.contains(myNick, Qt::CaseInsensitive)) { @@ -93,7 +93,7 @@ void ChatTools::receiveMessage(QString playerName, QString message, bool pm) //play beep sound only in INET-lobby-chat // TODO dont play when message is from yourself if(myLobby->isVisible() && myConfig->readConfigInt("PlayLobbyChatNotification")) { - myLobby->getMyW()->getMySoundEventHandler()->playSound("lobbychatnotify",0); + myLobby->getMyW()->getMySoundEventHandler()->playSound("lobbychatnotify",0); } } break; @@ -154,14 +154,14 @@ void ChatTools::receiveMessage(QString playerName, QString message, bool pm) if(!nickFoundOnIgnoreList) { - tempMsg = checkForEmotes(tempMsg); + tempMsg = checkForEmotes(tempMsg); if(message.indexOf(QString("/me "))==0) { myTextBrowser->append(tempMsg.replace("/me ","*"+playerName+" ")+""); } else if(pm == true) { myTextBrowser->append(""+playerName+"(pm): " + tempMsg+""); } else { - myTextBrowser->append(playerName + ": " + tempMsg); + myTextBrowser->append(playerName + ": " + tempMsg); } } } @@ -315,39 +315,40 @@ unsigned ChatTools::parsePrivateMessageTarget(QString &chatText) return playerId; } -QString ChatTools::checkForEmotes(QString msg) { +QString ChatTools::checkForEmotes(QString msg) +{ - msg.replace("0:-)", ""); - msg.replace("X-(", ""); - msg.replace("B-)", ""); - msg.replace("8-)", ""); - msg.replace(":'(", ""); - msg.replace(">:-)", ""); - msg.replace(":-[", ""); - msg.replace(":-*", ""); - msg.replace(":-))", ""); - msg.replace(":))", ""); - msg.replace(":-|", ""); - msg.replace(":-P", ""); - msg.replace(":-p", ""); - msg.replace(":-(", ""); - msg.replace(":(", ""); - msg.replace(":-&", ""); - msg.replace(":-D", ""); - msg.replace(":D", ""); - msg.replace(":-!", ""); - msg.replace(":-0", ""); - msg.replace(":-O", ""); - msg.replace(":-o", ""); - msg.replace(":-/", ""); - msg.replace(":/", ""); - msg.replace(";-)", ""); - msg.replace(";)", ""); - msg.replace(":-S", ""); - msg.replace(":-s", ""); - msg.replace(":-)", ""); - msg.replace(":)", ""); + msg.replace("0:-)", ""); + msg.replace("X-(", ""); + msg.replace("B-)", ""); + msg.replace("8-)", ""); + msg.replace(":'(", ""); + msg.replace(">:-)", ""); + msg.replace(":-[", ""); + msg.replace(":-*", ""); + msg.replace(":-))", ""); + msg.replace(":))", ""); + msg.replace(":-|", ""); + msg.replace(":-P", ""); + msg.replace(":-p", ""); + msg.replace(":-(", ""); + msg.replace(":(", ""); + msg.replace(":-&", ""); + msg.replace(":-D", ""); + msg.replace(":D", ""); + msg.replace(":-!", ""); + msg.replace(":-0", ""); + msg.replace(":-O", ""); + msg.replace(":-o", ""); + msg.replace(":-/", ""); + msg.replace(":/", ""); + msg.replace(";-)", ""); + msg.replace(";)", ""); + msg.replace(":-S", ""); + msg.replace(":-s", ""); + msg.replace(":-)", ""); + msg.replace(":)", ""); - return msg; + return msg; } diff --git a/src/gui/qt/chattools/chattools.h b/src/gui/qt/chattools/chattools.h index dd23c096..cfafe29a 100644 --- a/src/gui/qt/chattools/chattools.h +++ b/src/gui/qt/chattools/chattools.h @@ -74,7 +74,7 @@ public slots: myStyle = theValue; } void refreshIgnoreList(); - QString checkForEmotes(QString); + QString checkForEmotes(QString); protected: diff --git a/src/gui/qt/createinternetgamedialog/createinternetgamedialogimpl.cpp b/src/gui/qt/createinternetgamedialog/createinternetgamedialogimpl.cpp index 5edbfaea..251e4540 100644 --- a/src/gui/qt/createinternetgamedialog/createinternetgamedialogimpl.cpp +++ b/src/gui/qt/createinternetgamedialog/createinternetgamedialogimpl.cpp @@ -260,12 +260,10 @@ bool createInternetGameDialogImpl::eventFilter(QObject *obj, QEvent *event) } event->ignore(); return false; - } - else if (event->type() == QEvent::KeyPress && keyEvent->key() == Qt::Key_Back) { + } else if (event->type() == QEvent::KeyPress && keyEvent->key() == Qt::Key_Back) { this->reject(); return true; - } - else { + } else { // pass the event on to the parent class return QDialog::eventFilter(obj, event); } diff --git a/src/gui/qt/createnetworkgamedialog/createnetworkgamedialogimpl.cpp b/src/gui/qt/createnetworkgamedialog/createnetworkgamedialogimpl.cpp index 19e9aae8..b48f589f 100644 --- a/src/gui/qt/createnetworkgamedialog/createnetworkgamedialogimpl.cpp +++ b/src/gui/qt/createnetworkgamedialog/createnetworkgamedialogimpl.cpp @@ -151,12 +151,10 @@ bool createNetworkGameDialogImpl::eventFilter(QObject *obj, QEvent *event) } event->ignore(); return false; - } - else if (event->type() == QEvent::KeyPress && keyEvent->key() == Qt::Key_Back) { + } else if (event->type() == QEvent::KeyPress && keyEvent->key() == Qt::Key_Back) { this->reject(); return true; - } - else { + } else { // pass the event on to the parent class return QDialog::eventFilter(obj, event); } diff --git a/src/gui/qt/gamelobbydialog/gamelobbydialogimpl.cpp b/src/gui/qt/gamelobbydialog/gamelobbydialogimpl.cpp index 14355220..da762ae3 100644 --- a/src/gui/qt/gamelobbydialog/gamelobbydialogimpl.cpp +++ b/src/gui/qt/gamelobbydialog/gamelobbydialogimpl.cpp @@ -33,2119 +33,2119 @@ using namespace std; gameLobbyDialogImpl::gameLobbyDialogImpl(startWindowImpl *parent, ConfigFile *c) - : QDialog(parent), myW(NULL), myStartWindow(parent), myConfig(c), currentGameName(""), myPlayerId(0), isGameAdministrator(false), inGame(false), guestMode(false), blinkingButtonAnimationState(true), myChat(NULL), keyUpCounter(0), infoMsgToShowId(0), currentInvitationGameId(0), inviteDialogIsCurrentlyShown(false), autoStartTimerCounter(0), lastNickListFilterState(0) + : QDialog(parent), myW(NULL), myStartWindow(parent), myConfig(c), currentGameName(""), myPlayerId(0), isGameAdministrator(false), inGame(false), guestMode(false), blinkingButtonAnimationState(true), myChat(NULL), keyUpCounter(0), infoMsgToShowId(0), currentInvitationGameId(0), inviteDialogIsCurrentlyShown(false), autoStartTimerCounter(0), lastNickListFilterState(0) { #ifdef __APPLE__ - setWindowModality(Qt::ApplicationModal); - setWindowFlags(Qt::WindowSystemMenuHint | Qt::CustomizeWindowHint | Qt::Dialog); + setWindowModality(Qt::ApplicationModal); + setWindowFlags(Qt::WindowSystemMenuHint | Qt::CustomizeWindowHint | Qt::Dialog); #elif _WIN32 - setWindowFlags(Qt::Dialog | Qt::WindowMinimizeButtonHint); + setWindowFlags(Qt::Dialog | Qt::WindowMinimizeButtonHint); #endif - setupUi(this); - myAppDataPath = QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str()); + setupUi(this); + myAppDataPath = QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str()); - //wait start game message - waitStartGameMsgBox = new MyMessageBox(this); - waitStartGameMsgBox->setText(tr("Starting game. Please wait ...")); + //wait start game message + waitStartGameMsgBox = new MyMessageBox(this); + waitStartGameMsgBox->setText(tr("Starting game. Please wait ...")); #ifndef ANDROID - waitStartGameMsgBox->setWindowModality(Qt::NonModal); + waitStartGameMsgBox->setWindowModality(Qt::NonModal); #endif #ifdef __APPLE__ - waitStartGameMsgBox->setWindowFlags(Qt::WindowSystemMenuHint | Qt::CustomizeWindowHint | Qt::Dialog); + waitStartGameMsgBox->setWindowFlags(Qt::WindowSystemMenuHint | Qt::CustomizeWindowHint | Qt::Dialog); #endif - waitStartGameMsgBox->setStandardButtons(QMessageBox::NoButton); + waitStartGameMsgBox->setStandardButtons(QMessageBox::NoButton); - //wait start game message for rejoin - waitRejoinStartGameMsgBox = new MyMessageBox(this); - waitRejoinStartGameMsgBox->setText(tr("Waiting for the start of the next hand to rejoin the game ...")); + //wait start game message for rejoin + waitRejoinStartGameMsgBox = new MyMessageBox(this); + waitRejoinStartGameMsgBox->setText(tr("Waiting for the start of the next hand to rejoin the game ...")); #ifndef ANDROID - waitRejoinStartGameMsgBox->setWindowModality(Qt::NonModal); + waitRejoinStartGameMsgBox->setWindowModality(Qt::NonModal); #endif #ifdef __APPLE__ - waitRejoinStartGameMsgBox->setWindowFlags(Qt::WindowSystemMenuHint | Qt::CustomizeWindowHint | Qt::Dialog); + waitRejoinStartGameMsgBox->setWindowFlags(Qt::WindowSystemMenuHint | Qt::CustomizeWindowHint | Qt::Dialog); #endif - waitRejoinStartGameMsgBox->setStandardButtons(QMessageBox::NoButton); + waitRejoinStartGameMsgBox->setStandardButtons(QMessageBox::NoButton); - inviteOnlyInfoMsgBox = new myMessageDialogImpl(myConfig, this); + inviteOnlyInfoMsgBox = new myMessageDialogImpl(myConfig, this); - //HTML stuff - QString pokerthDotNet("http://www.pokerth.net"); - QString clickToRanking(QString("%1").arg(tr("Click here to view the online rankings"))); - label_pokerthDotNet->setText(pokerthDotNet); - label_rankings->setText(clickToRanking); + //HTML stuff + QString pokerthDotNet("http://www.pokerth.net"); + QString clickToRanking(QString("%1").arg(tr("Click here to view the online rankings"))); + label_pokerthDotNet->setText(pokerthDotNet); + label_rankings->setText(clickToRanking); - waitStartGameMsgBoxTimer = new QTimer(this); - waitStartGameMsgBoxTimer->setSingleShot(TRUE); - blinkingButtonAnimationTimer = new QTimer(this); - blinkingButtonAnimationTimer->setInterval(1000); - autoStartTimer = new QTimer(this); - autoStartTimer->setInterval(1000); - showInfoMsgBoxTimer = new QTimer(this); - showInfoMsgBoxTimer->setSingleShot(TRUE); + waitStartGameMsgBoxTimer = new QTimer(this); + waitStartGameMsgBoxTimer->setSingleShot(TRUE); + blinkingButtonAnimationTimer = new QTimer(this); + blinkingButtonAnimationTimer->setInterval(1000); + autoStartTimer = new QTimer(this); + autoStartTimer->setInterval(1000); + showInfoMsgBoxTimer = new QTimer(this); + showInfoMsgBoxTimer->setSingleShot(TRUE); - //fetch button colors for blinking - groupBox_GameInfo->setEnabled(true); - pushButton_StartGame->setEnabled(true); - defaultStartButtonColor = pushButton_StartGame->palette().button().color(); - defaultStartButtonTextColor = pushButton_StartGame->palette().buttonText().color(); - pushButton_StartGame->setEnabled(false); - groupBox_GameInfo->setEnabled(false); - disabledStartButtonColor = pushButton_StartGame->palette().button().color(); - disabledStartButtonTextColor = pushButton_StartGame->palette().buttonText().color(); + //fetch button colors for blinking + groupBox_GameInfo->setEnabled(true); + pushButton_StartGame->setEnabled(true); + defaultStartButtonColor = pushButton_StartGame->palette().button().color(); + defaultStartButtonTextColor = pushButton_StartGame->palette().buttonText().color(); + pushButton_StartGame->setEnabled(false); + groupBox_GameInfo->setEnabled(false); + disabledStartButtonColor = pushButton_StartGame->palette().button().color(); + disabledStartButtonTextColor = pushButton_StartGame->palette().buttonText().color(); - //prepare overlay - autoStartTimerOverlay = new QLabel(scrollArea_gameInfos); - autoStartTimerOverlay->hide(); - autoStartTimerOverlay->setWordWrap(TRUE); - autoStartTimerOverlay->setMaximumWidth(190); - autoStartTimerOverlay->setMinimumWidth(190); - autoStartTimerOverlay->setTextFormat(Qt::RichText); - autoStartTimerOverlay->setAlignment(Qt::AlignCenter); - autoStartTimerOverlay->setAutoFillBackground(TRUE); - autoStartTimerOverlay->setFrameStyle(QFrame::StyledPanel); - QPalette p; - p.setColor(QPalette::Background, QColor(255, 255, 255, 210)); - autoStartTimerOverlay->setPalette(p); + //prepare overlay + autoStartTimerOverlay = new QLabel(scrollArea_gameInfos); + autoStartTimerOverlay->hide(); + autoStartTimerOverlay->setWordWrap(TRUE); + autoStartTimerOverlay->setMaximumWidth(190); + autoStartTimerOverlay->setMinimumWidth(190); + autoStartTimerOverlay->setTextFormat(Qt::RichText); + autoStartTimerOverlay->setAlignment(Qt::AlignCenter); + autoStartTimerOverlay->setAutoFillBackground(TRUE); + autoStartTimerOverlay->setFrameStyle(QFrame::StyledPanel); + QPalette p; + p.setColor(QPalette::Background, QColor(255, 255, 255, 210)); + autoStartTimerOverlay->setPalette(p); - myGameListModel = new QStandardItemModel(this); - myGameListSortFilterProxyModel = new MyGameListSortFilterProxyModel(this); - myGameListSortFilterProxyModel->setSourceModel(myGameListModel); - myGameListSortFilterProxyModel->setDynamicSortFilter(TRUE); - treeView_GameList->setModel(myGameListSortFilterProxyModel); + myGameListModel = new QStandardItemModel(this); + myGameListSortFilterProxyModel = new MyGameListSortFilterProxyModel(this); + myGameListSortFilterProxyModel->setSourceModel(myGameListModel); + myGameListSortFilterProxyModel->setDynamicSortFilter(TRUE); + treeView_GameList->setModel(myGameListSortFilterProxyModel); - myGameListSelectionModel = treeView_GameList->selectionModel(); + myGameListSelectionModel = treeView_GameList->selectionModel(); - QStringList headerList; - headerList << tr("Game") << tr("Players") << tr("State") << tr("T") << tr("P") << tr("Time"); - myGameListModel->setHorizontalHeaderLabels(headerList); + QStringList headerList; + headerList << tr("Game") << tr("Players") << tr("State") << tr("T") << tr("P") << tr("Time"); + myGameListModel->setHorizontalHeaderLabels(headerList); #ifdef GUI_800x480 - treeView_GameList->setColumnWidth(0,220); - treeView_GameList->setColumnWidth(1,55); - treeView_GameList->setColumnWidth(2,90); - treeView_GameList->setColumnWidth(3,20); - treeView_GameList->setColumnWidth(4,20); - treeView_GameList->setColumnWidth(5,20); + treeView_GameList->setColumnWidth(0,220); + treeView_GameList->setColumnWidth(1,55); + treeView_GameList->setColumnWidth(2,90); + treeView_GameList->setColumnWidth(3,20); + treeView_GameList->setColumnWidth(4,20); + treeView_GameList->setColumnWidth(5,20); - treeView_GameList->setStyleSheet("QTreeView {background-color: white; background-image: url(\""+myAppDataPath +"gfx/gui/misc/background_gamelist.png\"); background-attachment: fixed; background-position: top center ; background-repeat: no-repeat; color:rgb(0, 0, 0); font: 22px}"); - treeView_GameList->header()->setStyleSheet("QObject {font: bold 18px}"); + treeView_GameList->setStyleSheet("QTreeView {background-color: white; background-image: url(\""+myAppDataPath +"gfx/gui/misc/background_gamelist.png\"); background-attachment: fixed; background-position: top center ; background-repeat: no-repeat; color:rgb(0, 0, 0); font: 22px}"); + treeView_GameList->header()->setStyleSheet("QObject {font: bold 18px}"); - //make the scrollbars touchable for mobile guis - this->setStyleSheet("QScrollBar:vertical { border: 1px solid grey; background: #f0f0f0; width: 55px; margin: 1px -1px 0px 0px; } QScrollBar::handle:vertical { border-radius: 4px; border: 3px solid grey; background: LightGrey ; min-height: 60px; } QScrollBar::add-line:vertical { background: none; } QScrollBar::sub-line:vertical { background: none; } QScrollBar:up-arrow:vertical, QScrollBar::down-arrow:vertical { background: none; } QScrollBar::add-page:vertical, QScrollBar::sub-page:vertical { background: none; }"); + //make the scrollbars touchable for mobile guis + this->setStyleSheet("QScrollBar:vertical { border: 1px solid grey; background: #f0f0f0; width: 55px; margin: 1px -1px 0px 0px; } QScrollBar::handle:vertical { border-radius: 4px; border: 3px solid grey; background: LightGrey ; min-height: 60px; } QScrollBar::add-line:vertical { background: none; } QScrollBar::sub-line:vertical { background: none; } QScrollBar:up-arrow:vertical, QScrollBar::down-arrow:vertical { background: none; } QScrollBar::add-page:vertical, QScrollBar::sub-page:vertical { background: none; }"); - //remove game type in game description field to save space - label_gameType->hide(); - label_typeIcon->hide(); - label_typeText->hide(); + //remove game type in game description field to save space + label_gameType->hide(); + label_typeIcon->hide(); + label_typeText->hide(); - //set colors - QPalette p1; - p1.setColor(QPalette::WindowText, this->palette().color(QPalette::Link)); - label_StartCash->setPalette(p1); - label_blindsList->setPalette(p1); - label_blindsRaiseIntervall->setPalette(p1); - label_blindsRaiseMode->setPalette(p1); - label_GameTiming->setPalette(p1); - label_SmallBlind->setPalette(p1); + //set colors + QPalette p1; + p1.setColor(QPalette::WindowText, this->palette().color(QPalette::Link)); + label_StartCash->setPalette(p1); + label_blindsList->setPalette(p1); + label_blindsRaiseIntervall->setPalette(p1); + label_blindsRaiseMode->setPalette(p1); + label_GameTiming->setPalette(p1); + label_SmallBlind->setPalette(p1); #else - treeView_GameList->setColumnWidth(0,190); - treeView_GameList->setColumnWidth(1,55); - treeView_GameList->setColumnWidth(2,65); - treeView_GameList->setColumnWidth(3,25); - treeView_GameList->setColumnWidth(4,25); - treeView_GameList->setColumnWidth(5,30); + treeView_GameList->setColumnWidth(0,190); + treeView_GameList->setColumnWidth(1,55); + treeView_GameList->setColumnWidth(2,65); + treeView_GameList->setColumnWidth(3,25); + treeView_GameList->setColumnWidth(4,25); + treeView_GameList->setColumnWidth(5,30); - treeView_GameList->setStyleSheet("QTreeView {background-color: white; background-image: url(\""+myAppDataPath +"gfx/gui/misc/background_gamelist.png\"); background-attachment: fixed; background-position: top center ; background-repeat: no-repeat;}"); + treeView_GameList->setStyleSheet("QTreeView {background-color: white; background-image: url(\""+myAppDataPath +"gfx/gui/misc/background_gamelist.png\"); background-attachment: fixed; background-position: top center ; background-repeat: no-repeat;}"); #endif - treeView_GameList->setAutoFillBackground(TRUE); + treeView_GameList->setAutoFillBackground(TRUE); - myNickListModel = new QStandardItemModel(this); - myNickListSortFilterProxyModel = new MyNickListSortFilterProxyModel(this); - myNickListSortFilterProxyModel->setSourceModel(myNickListModel); - myNickListSortFilterProxyModel->setDynamicSortFilter(TRUE); - myNickListSortFilterProxyModel->setSortCaseSensitivity(Qt::CaseInsensitive); + myNickListModel = new QStandardItemModel(this); + myNickListSortFilterProxyModel = new MyNickListSortFilterProxyModel(this); + myNickListSortFilterProxyModel->setSourceModel(myNickListModel); + myNickListSortFilterProxyModel->setDynamicSortFilter(TRUE); + myNickListSortFilterProxyModel->setSortCaseSensitivity(Qt::CaseInsensitive); - treeView_NickList->setModel(myNickListSortFilterProxyModel); - myNickListSelectionModel = treeView_NickList->selectionModel(); + treeView_NickList->setModel(myNickListSortFilterProxyModel); + myNickListSelectionModel = treeView_NickList->selectionModel(); - QStringList headerList2; - headerList2 << tr("Available Players"); - myNickListModel->setHorizontalHeaderLabels(headerList2); - treeView_NickList->sortByColumn(0, Qt::AscendingOrder); + QStringList headerList2; + headerList2 << tr("Available Players"); + myNickListModel->setHorizontalHeaderLabels(headerList2); + treeView_NickList->sortByColumn(0, Qt::AscendingOrder); - myChat = new ChatTools(lineEdit_ChatInput, myConfig, INET_LOBBY_CHAT, textBrowser_ChatDisplay, myNickListModel, this); + myChat = new ChatTools(lineEdit_ChatInput, myConfig, INET_LOBBY_CHAT, textBrowser_ChatDisplay, myNickListModel, this); - nickListContextMenu = new QMenu(); - nickListInviteAction = new QAction(QIcon(":/gfx/list_add_user.png"), tr("Invite player"), nickListContextMenu); - nickListContextMenu->addAction(nickListInviteAction); - nickListIgnorePlayerAction = new QAction(QIcon(":/gfx/im-ban-user.png"), tr("Ignore player"), nickListContextMenu); - nickListContextMenu->addAction(nickListIgnorePlayerAction); - nickListPlayerInfoSubMenu = nickListContextMenu->addMenu(QIcon(":/gfx/dialog-information.png"), tr("Player infos ...")); - nickListPlayerInGameInfo = new QAction(nickListContextMenu); - nickListPlayerInfoSubMenu->addAction(nickListPlayerInGameInfo); - nickListOpenPlayerStats1 = new QAction(QIcon(":/gfx/view-statistics.png"), tr("Show player stats"), nickListContextMenu); - nickListContextMenu->addAction(nickListOpenPlayerStats1); + nickListContextMenu = new QMenu(); + nickListInviteAction = new QAction(QIcon(":/gfx/list_add_user.png"), tr("Invite player"), nickListContextMenu); + nickListContextMenu->addAction(nickListInviteAction); + nickListIgnorePlayerAction = new QAction(QIcon(":/gfx/im-ban-user.png"), tr("Ignore player"), nickListContextMenu); + nickListContextMenu->addAction(nickListIgnorePlayerAction); + nickListPlayerInfoSubMenu = nickListContextMenu->addMenu(QIcon(":/gfx/dialog-information.png"), tr("Player infos ...")); + nickListPlayerInGameInfo = new QAction(nickListContextMenu); + nickListPlayerInfoSubMenu->addAction(nickListPlayerInGameInfo); + nickListOpenPlayerStats1 = new QAction(QIcon(":/gfx/view-statistics.png"), tr("Show player stats"), nickListContextMenu); + nickListContextMenu->addAction(nickListOpenPlayerStats1); - connectedPlayersListPlayerInfoSubMenu = new QMenu(); - nickListOpenPlayerStats2 = new QAction(QIcon(":/gfx/view-statistics.png"), tr("Show player stats"), nickListContextMenu); - connectedPlayersListPlayerInfoSubMenu->addAction(nickListOpenPlayerStats2); + connectedPlayersListPlayerInfoSubMenu = new QMenu(); + nickListOpenPlayerStats2 = new QAction(QIcon(":/gfx/view-statistics.png"), tr("Show player stats"), nickListContextMenu); + connectedPlayersListPlayerInfoSubMenu->addAction(nickListOpenPlayerStats2); - gameListContextMenu = new QMenu(); - gameListReportBadGameNameAction = new QAction(QIcon(":/gfx/emblem-important.png"), tr("Report inappropriate game name"), gameListContextMenu); - gameListContextMenu->addAction(gameListReportBadGameNameAction); + gameListContextMenu = new QMenu(); + gameListReportBadGameNameAction = new QAction(QIcon(":/gfx/emblem-important.png"), tr("Report inappropriate game name"), gameListContextMenu); + gameListContextMenu->addAction(gameListReportBadGameNameAction); - connect( pushButton_CreateGame, SIGNAL( clicked() ), this, SLOT( createGame() ) ); - connect( pushButton_JoinGame, SIGNAL( clicked() ), this, SLOT( joinGame() ) ); - connect( pushButton_joinAnyGame, SIGNAL( clicked() ), this, SLOT( joinAnyGame() ) ); - connect( pushButton_StartGame, SIGNAL( clicked() ), this, SLOT( startGame() ) ); - connect( pushButton_Kick, SIGNAL( clicked() ), this, SLOT( kickPlayer() ) ); - connect( pushButton_Leave, SIGNAL( clicked() ), this, SLOT( leaveGame() ) ); - connect( myGameListSelectionModel, SIGNAL( currentChanged (const QModelIndex &, const QModelIndex &) ), this, SLOT( gameSelected(const QModelIndex &) ) ); - connect( treeView_GameList, SIGNAL( doubleClicked (const QModelIndex &) ), this, SLOT( joinGame() ) ); - connect( treeView_GameList->header(), SIGNAL( sortIndicatorChanged ( int , Qt::SortOrder )), this, SLOT( changeGameListSorting() ) ); - connect( treeWidget_connectedPlayers, SIGNAL( currentItemChanged ( QTreeWidgetItem*, QTreeWidgetItem*) ), this, SLOT( playerSelected(QTreeWidgetItem*, QTreeWidgetItem*) ) ); - connect( lineEdit_ChatInput, SIGNAL( returnPressed () ), myChat, SLOT( sendMessage() ) ); - connect( lineEdit_ChatInput, SIGNAL( textChanged (QString) ), myChat, SLOT( checkInputLength(QString) ) ); - connect( lineEdit_ChatInput, SIGNAL( textEdited (QString) ), myChat, SLOT( setChatTextEdited() ) ); - connect( waitStartGameMsgBoxTimer, SIGNAL(timeout()), this, SLOT( showWaitStartGameMsgBox() )); - connect( blinkingButtonAnimationTimer, SIGNAL(timeout()), this, SLOT( blinkingStartButtonAnimation() )); - connect( autoStartTimer, SIGNAL(timeout()), this, SLOT( updateAutoStartTimer() )); - connect( showInfoMsgBoxTimer, SIGNAL(timeout()), this, SLOT( showInfoMsgBox() )); - connect( comboBox_gameListFilter, SIGNAL(currentIndexChanged(int)), this, SLOT(changeGameListFilter(int))); - connect( comboBox_nickListFilter, SIGNAL(currentIndexChanged(int)), this, SLOT(changeNickListFilter(int))); - connect( treeView_NickList, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT( showNickListContextMenu(QPoint) ) ); - connect( treeWidget_connectedPlayers, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT( showConnectedPlayersContextMenu(QPoint) ) ); - connect( treeView_GameList, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT( showGameListContextMenu(QPoint) ) ); - connect( nickListInviteAction, SIGNAL(triggered()), this, SLOT( invitePlayerToCurrentGame() )); - connect( nickListIgnorePlayerAction, SIGNAL(triggered()), this, SLOT( putPlayerOnIgnoreList() )); - connect( nickListOpenPlayerStats1, SIGNAL(triggered()), this, SLOT( openPlayerStats1() )); - connect( nickListOpenPlayerStats2, SIGNAL(triggered()), this, SLOT( openPlayerStats2() )); - connect( lineEdit_searchForPlayers, SIGNAL(textChanged(QString)),this, SLOT(searchForPlayerRegExpChanged())); - connect( gameListReportBadGameNameAction, SIGNAL(triggered()), this, SLOT( reportBadGameName())); + connect( pushButton_CreateGame, SIGNAL( clicked() ), this, SLOT( createGame() ) ); + connect( pushButton_JoinGame, SIGNAL( clicked() ), this, SLOT( joinGame() ) ); + connect( pushButton_joinAnyGame, SIGNAL( clicked() ), this, SLOT( joinAnyGame() ) ); + connect( pushButton_StartGame, SIGNAL( clicked() ), this, SLOT( startGame() ) ); + connect( pushButton_Kick, SIGNAL( clicked() ), this, SLOT( kickPlayer() ) ); + connect( pushButton_Leave, SIGNAL( clicked() ), this, SLOT( leaveGame() ) ); + connect( myGameListSelectionModel, SIGNAL( currentChanged (const QModelIndex &, const QModelIndex &) ), this, SLOT( gameSelected(const QModelIndex &) ) ); + connect( treeView_GameList, SIGNAL( doubleClicked (const QModelIndex &) ), this, SLOT( joinGame() ) ); + connect( treeView_GameList->header(), SIGNAL( sortIndicatorChanged ( int , Qt::SortOrder )), this, SLOT( changeGameListSorting() ) ); + connect( treeWidget_connectedPlayers, SIGNAL( currentItemChanged ( QTreeWidgetItem*, QTreeWidgetItem*) ), this, SLOT( playerSelected(QTreeWidgetItem*, QTreeWidgetItem*) ) ); + connect( lineEdit_ChatInput, SIGNAL( returnPressed () ), myChat, SLOT( sendMessage() ) ); + connect( lineEdit_ChatInput, SIGNAL( textChanged (QString) ), myChat, SLOT( checkInputLength(QString) ) ); + connect( lineEdit_ChatInput, SIGNAL( textEdited (QString) ), myChat, SLOT( setChatTextEdited() ) ); + connect( waitStartGameMsgBoxTimer, SIGNAL(timeout()), this, SLOT( showWaitStartGameMsgBox() )); + connect( blinkingButtonAnimationTimer, SIGNAL(timeout()), this, SLOT( blinkingStartButtonAnimation() )); + connect( autoStartTimer, SIGNAL(timeout()), this, SLOT( updateAutoStartTimer() )); + connect( showInfoMsgBoxTimer, SIGNAL(timeout()), this, SLOT( showInfoMsgBox() )); + connect( comboBox_gameListFilter, SIGNAL(currentIndexChanged(int)), this, SLOT(changeGameListFilter(int))); + connect( comboBox_nickListFilter, SIGNAL(currentIndexChanged(int)), this, SLOT(changeNickListFilter(int))); + connect( treeView_NickList, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT( showNickListContextMenu(QPoint) ) ); + connect( treeWidget_connectedPlayers, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT( showConnectedPlayersContextMenu(QPoint) ) ); + connect( treeView_GameList, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT( showGameListContextMenu(QPoint) ) ); + connect( nickListInviteAction, SIGNAL(triggered()), this, SLOT( invitePlayerToCurrentGame() )); + connect( nickListIgnorePlayerAction, SIGNAL(triggered()), this, SLOT( putPlayerOnIgnoreList() )); + connect( nickListOpenPlayerStats1, SIGNAL(triggered()), this, SLOT( openPlayerStats1() )); + connect( nickListOpenPlayerStats2, SIGNAL(triggered()), this, SLOT( openPlayerStats2() )); + connect( lineEdit_searchForPlayers, SIGNAL(textChanged(QString)),this, SLOT(searchForPlayerRegExpChanged())); + connect( gameListReportBadGameNameAction, SIGNAL(triggered()), this, SLOT( reportBadGameName())); - lineEdit_searchForPlayers->installEventFilter(this); - lineEdit_ChatInput->installEventFilter(this); + lineEdit_searchForPlayers->installEventFilter(this); + lineEdit_ChatInput->installEventFilter(this); - clearDialog(); + clearDialog(); } void gameLobbyDialogImpl::exec() { - if(myConfig->readConfigInt("UseLobbyChat")) { - groupBox_lobbyChat->show(); - } else { - groupBox_lobbyChat->hide(); - } - readDialogSettings(); + if(myConfig->readConfigInt("UseLobbyChat")) { + groupBox_lobbyChat->show(); + } else { + groupBox_lobbyChat->hide(); + } + readDialogSettings(); - PlayerInfo playerInfo(mySession->getClientPlayerInfo(mySession->getClientUniquePlayerId())); - if(playerInfo.isGuest) { - guestUserMode(); - } else { - registeredUserMode(); - } + PlayerInfo playerInfo(mySession->getClientPlayerInfo(mySession->getClientUniquePlayerId())); + if(playerInfo.isGuest) { + guestUserMode(); + } else { + registeredUserMode(); + } #ifdef ANDROID - this->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding); + this->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding); #endif - QDialog::exec(); + QDialog::exec(); - waitStartGameMsgBoxTimer->stop(); - closeAllChildDialogs(); + waitStartGameMsgBoxTimer->stop(); + closeAllChildDialogs(); } gameLobbyDialogImpl::~gameLobbyDialogImpl() { - delete myChat; - myChat = NULL; + delete myChat; + myChat = NULL; - delete inviteOnlyInfoMsgBox; - inviteOnlyInfoMsgBox = NULL; + delete inviteOnlyInfoMsgBox; + inviteOnlyInfoMsgBox = NULL; } void gameLobbyDialogImpl::setSession(boost::shared_ptr session) { - mySession = session; - myChat->setSession(mySession); + mySession = session; + myChat->setSession(mySession); } void gameLobbyDialogImpl::createGame() { - assert(mySession); + assert(mySession); - myCreateInternetGameDialog = new createInternetGameDialogImpl(this, myConfig); - PlayerInfo playerInfo(mySession->getClientPlayerInfo(mySession->getClientUniquePlayerId())); - myCreateInternetGameDialog->exec(guestMode, QString::fromUtf8(playerInfo.playerName.c_str())); + myCreateInternetGameDialog = new createInternetGameDialogImpl(this, myConfig); + PlayerInfo playerInfo(mySession->getClientPlayerInfo(mySession->getClientUniquePlayerId())); + myCreateInternetGameDialog->exec(guestMode, QString::fromUtf8(playerInfo.playerName.c_str())); - if (myCreateInternetGameDialog->result() == QDialog::Accepted ) { + if (myCreateInternetGameDialog->result() == QDialog::Accepted ) { - GameData gameData; - // Set Game Data - gameData.maxNumberOfPlayers = myCreateInternetGameDialog->spinBox_quantityPlayers->value(); - gameData.startMoney = myCreateInternetGameDialog->spinBox_startCash->value(); - gameData.firstSmallBlind = myCreateInternetGameDialog->getChangeCompleteBlindsDialog()->spinBox_firstSmallBlind->value(); + GameData gameData; + // Set Game Data + gameData.maxNumberOfPlayers = myCreateInternetGameDialog->spinBox_quantityPlayers->value(); + gameData.startMoney = myCreateInternetGameDialog->spinBox_startCash->value(); + gameData.firstSmallBlind = myCreateInternetGameDialog->getChangeCompleteBlindsDialog()->spinBox_firstSmallBlind->value(); - if(myCreateInternetGameDialog->getChangeCompleteBlindsDialog()->radioButton_raiseBlindsAtHands->isChecked()) { - gameData.raiseIntervalMode = RAISE_ON_HANDNUMBER; - gameData.raiseSmallBlindEveryHandsValue = myCreateInternetGameDialog->getChangeCompleteBlindsDialog()->spinBox_raiseSmallBlindEveryHands->value(); - } else { - gameData.raiseIntervalMode = RAISE_ON_MINUTES; - gameData.raiseSmallBlindEveryMinutesValue = myCreateInternetGameDialog->getChangeCompleteBlindsDialog()->spinBox_raiseSmallBlindEveryMinutes->value(); - } + if(myCreateInternetGameDialog->getChangeCompleteBlindsDialog()->radioButton_raiseBlindsAtHands->isChecked()) { + gameData.raiseIntervalMode = RAISE_ON_HANDNUMBER; + gameData.raiseSmallBlindEveryHandsValue = myCreateInternetGameDialog->getChangeCompleteBlindsDialog()->spinBox_raiseSmallBlindEveryHands->value(); + } else { + gameData.raiseIntervalMode = RAISE_ON_MINUTES; + gameData.raiseSmallBlindEveryMinutesValue = myCreateInternetGameDialog->getChangeCompleteBlindsDialog()->spinBox_raiseSmallBlindEveryMinutes->value(); + } - if(myCreateInternetGameDialog->getChangeCompleteBlindsDialog()->radioButton_alwaysDoubleBlinds->isChecked()) { - gameData.raiseMode = DOUBLE_BLINDS; - } else { - gameData.raiseMode = MANUAL_BLINDS_ORDER; - std::list tempBlindList; - int i; - bool ok = TRUE; - for(i=0; igetChangeCompleteBlindsDialog()->listWidget_blinds->count(); i++) { - tempBlindList.push_back(myCreateInternetGameDialog->getChangeCompleteBlindsDialog()->listWidget_blinds->item(i)->text().toInt(&ok,10)); - } - gameData.manualBlindsList = tempBlindList; + if(myCreateInternetGameDialog->getChangeCompleteBlindsDialog()->radioButton_alwaysDoubleBlinds->isChecked()) { + gameData.raiseMode = DOUBLE_BLINDS; + } else { + gameData.raiseMode = MANUAL_BLINDS_ORDER; + std::list tempBlindList; + int i; + bool ok = TRUE; + for(i=0; igetChangeCompleteBlindsDialog()->listWidget_blinds->count(); i++) { + tempBlindList.push_back(myCreateInternetGameDialog->getChangeCompleteBlindsDialog()->listWidget_blinds->item(i)->text().toInt(&ok,10)); + } + gameData.manualBlindsList = tempBlindList; - if(myCreateInternetGameDialog->getChangeCompleteBlindsDialog()->radioButton_afterThisAlwaysDoubleBlinds->isChecked()) { - gameData.afterManualBlindsMode = AFTERMB_DOUBLE_BLINDS; - } else { - if(myCreateInternetGameDialog->getChangeCompleteBlindsDialog()->radioButton_afterThisAlwaysRaiseAbout->isChecked()) { - gameData.afterManualBlindsMode = AFTERMB_RAISE_ABOUT; - gameData.afterMBAlwaysRaiseValue = myCreateInternetGameDialog->getChangeCompleteBlindsDialog()->spinBox_afterThisAlwaysRaiseValue->value(); - } else { - gameData.afterManualBlindsMode = AFTERMB_STAY_AT_LAST_BLIND; - } - } - } + if(myCreateInternetGameDialog->getChangeCompleteBlindsDialog()->radioButton_afterThisAlwaysDoubleBlinds->isChecked()) { + gameData.afterManualBlindsMode = AFTERMB_DOUBLE_BLINDS; + } else { + if(myCreateInternetGameDialog->getChangeCompleteBlindsDialog()->radioButton_afterThisAlwaysRaiseAbout->isChecked()) { + gameData.afterManualBlindsMode = AFTERMB_RAISE_ABOUT; + gameData.afterMBAlwaysRaiseValue = myCreateInternetGameDialog->getChangeCompleteBlindsDialog()->spinBox_afterThisAlwaysRaiseValue->value(); + } else { + gameData.afterManualBlindsMode = AFTERMB_STAY_AT_LAST_BLIND; + } + } + } - gameData.guiSpeed = myConfig->readConfigInt("GameSpeed"); - gameData.delayBetweenHandsSec = myCreateInternetGameDialog->spinBox_netDelayBetweenHands->value(); - gameData.playerActionTimeoutSec = myCreateInternetGameDialog->spinBox_netTimeOutPlayerAction->value(); - gameData.gameType = GameType(myCreateInternetGameDialog->comboBox_gameType->itemData(myCreateInternetGameDialog->comboBox_gameType->currentIndex(), Qt::UserRole).toInt()); + gameData.guiSpeed = myConfig->readConfigInt("GameSpeed"); + gameData.delayBetweenHandsSec = myCreateInternetGameDialog->spinBox_netDelayBetweenHands->value(); + gameData.playerActionTimeoutSec = myCreateInternetGameDialog->spinBox_netTimeOutPlayerAction->value(); + gameData.gameType = GameType(myCreateInternetGameDialog->comboBox_gameType->itemData(myCreateInternetGameDialog->comboBox_gameType->currentIndex(), Qt::UserRole).toInt()); - currentGameName = myCreateInternetGameDialog->lineEdit_gameName->text().simplified(); + currentGameName = myCreateInternetGameDialog->lineEdit_gameName->text().simplified(); - switch (gameData.gameType) { - case GAME_TYPE_NORMAL: { - label_typeIcon->setPixmap(QPixmap(":/gfx/player_play.png")); - label_typeText->setText(tr("Standard")); - } - break; - case GAME_TYPE_REGISTERED_ONLY: { - label_typeIcon->setPixmap(QPixmap(":/gfx/registered.png")); - label_typeText->setText(tr("Registered players only")); - } - break; - case GAME_TYPE_INVITE_ONLY: { - label_typeIcon->setPixmap(QPixmap(":/gfx/list_add_user.png")); - label_typeText->setText(tr("Invited players only")); - } - break; - case GAME_TYPE_RANKING: { - label_typeIcon->setPixmap(QPixmap(":/gfx/cup.png")); - label_typeText->setText(tr("Ranking game")); - } - break; - } + switch (gameData.gameType) { + case GAME_TYPE_NORMAL: { + label_typeIcon->setPixmap(QPixmap(":/gfx/player_play.png")); + label_typeText->setText(tr("Standard")); + } + break; + case GAME_TYPE_REGISTERED_ONLY: { + label_typeIcon->setPixmap(QPixmap(":/gfx/registered.png")); + label_typeText->setText(tr("Registered players only")); + } + break; + case GAME_TYPE_INVITE_ONLY: { + label_typeIcon->setPixmap(QPixmap(":/gfx/list_add_user.png")); + label_typeText->setText(tr("Invited players only")); + } + break; + case GAME_TYPE_RANKING: { + label_typeIcon->setPixmap(QPixmap(":/gfx/cup.png")); + label_typeText->setText(tr("Ranking game")); + } + break; + } - showGameDescription(TRUE); + showGameDescription(TRUE); - label_SmallBlind->setText(QString("%L1").arg(gameData.firstSmallBlind)); - label_StartCash->setText(QString("%L1").arg(gameData.startMoney)); + label_SmallBlind->setText(QString("%L1").arg(gameData.firstSmallBlind)); + label_StartCash->setText(QString("%L1").arg(gameData.startMoney)); - QTreeWidgetItem *header = treeWidget_connectedPlayers->headerItem(); - header->setText(0, tr("Connected players - max. %1").arg(gameData.maxNumberOfPlayers)); - header->setData(0, Qt::UserRole, gameData.maxNumberOfPlayers); + QTreeWidgetItem *header = treeWidget_connectedPlayers->headerItem(); + header->setText(0, tr("Connected players - max. %1").arg(gameData.maxNumberOfPlayers)); + header->setData(0, Qt::UserRole, gameData.maxNumberOfPlayers); - updateDialogBlinds(gameData); + updateDialogBlinds(gameData); - label_GameTiming->setText(QString::number(gameData.playerActionTimeoutSec)+" "+tr("sec (action)")+"\n"+QString::number(gameData.delayBetweenHandsSec)+" "+tr("sec (hand delay)")); + label_GameTiming->setText(QString::number(gameData.playerActionTimeoutSec)+" "+tr("sec (action)")+"\n"+QString::number(gameData.delayBetweenHandsSec)+" "+tr("sec (hand delay)")); - mySession->clientCreateGame(gameData, currentGameName.toUtf8().constData(), myCreateInternetGameDialog->lineEdit_Password->text().toUtf8().constData()); + mySession->clientCreateGame(gameData, currentGameName.toUtf8().constData(), myCreateInternetGameDialog->lineEdit_Password->text().toUtf8().constData()); - } + } } void gameLobbyDialogImpl::joinGame() { - assert(mySession); - QItemSelectionModel *selection = treeView_GameList->selectionModel(); - if (!inGame && selection->hasSelection()) { - unsigned gameId = selection->selectedRows().first().data(Qt::UserRole).toUInt(); - GameInfo info(mySession->getClientGameInfo(gameId)); - bool ok = true; - QString password; - //if private ask for password - if (info.isPasswordProtected) { - password = QInputDialog::getText(this, tr("Joining a private Game"), - tr("You are about to join a private game. Please enter the password!"), QLineEdit::Password, (""), &ok); - } + assert(mySession); + QItemSelectionModel *selection = treeView_GameList->selectionModel(); + if (!inGame && selection->hasSelection()) { + unsigned gameId = selection->selectedRows().first().data(Qt::UserRole).toUInt(); + GameInfo info(mySession->getClientGameInfo(gameId)); + bool ok = true; + QString password; + //if private ask for password + if (info.isPasswordProtected) { + password = QInputDialog::getText(this, tr("Joining a private Game"), + tr("You are about to join a private game. Please enter the password!"), QLineEdit::Password, (""), &ok); + } - if (ok) - mySession->clientJoinGame(gameId, password.toUtf8().constData()); - } + if (ok) + mySession->clientJoinGame(gameId, password.toUtf8().constData()); + } } void gameLobbyDialogImpl::joinAnyGame() { - if(comboBox_gameListFilter->currentIndex() != 3 && comboBox_gameListFilter->currentIndex() != 0 && comboBox_gameListFilter->currentIndex() != 5) comboBox_gameListFilter->setCurrentIndex(0); + if(comboBox_gameListFilter->currentIndex() != 3 && comboBox_gameListFilter->currentIndex() != 0 && comboBox_gameListFilter->currentIndex() != 5) comboBox_gameListFilter->setCurrentIndex(0); - bool found = FALSE; + bool found = FALSE; - int it = 0; - int gameToJoinId = 0; - int mostConnectedPlayers = 0; + int it = 0; + int gameToJoinId = 0; + int mostConnectedPlayers = 0; - while (myGameListModel->item(it)) { + while (myGameListModel->item(it)) { - int players = myGameListModel->item(it, 1)->data(Qt::DisplayRole).toString().section("/",0,0).toInt(); - int maxPlayers = myGameListModel->item(it, 1)->data(Qt::DisplayRole).toString().section("/",1,1).toInt(); - if (myGameListModel->item(it, 2)->data(16) == "open" && myGameListModel->item(it, 4)->data(16) == "nonpriv" && players < maxPlayers) { - if(players > mostConnectedPlayers) { - mostConnectedPlayers = players; - gameToJoinId = it; - } - found = TRUE; - } - it++; - } + int players = myGameListModel->item(it, 1)->data(Qt::DisplayRole).toString().section("/",0,0).toInt(); + int maxPlayers = myGameListModel->item(it, 1)->data(Qt::DisplayRole).toString().section("/",1,1).toInt(); + if (myGameListModel->item(it, 2)->data(16) == "open" && myGameListModel->item(it, 4)->data(16) == "nonpriv" && players < maxPlayers) { + if(players > mostConnectedPlayers) { + mostConnectedPlayers = players; + gameToJoinId = it; + } + found = TRUE; + } + it++; + } - if(found) { - treeView_GameList->setCurrentIndex(myGameListSortFilterProxyModel->mapFromSource(myGameListModel->item(gameToJoinId)->index())); - joinGame(); - } + if(found) { + treeView_GameList->setCurrentIndex(myGameListSortFilterProxyModel->mapFromSource(myGameListModel->item(gameToJoinId)->index())); + joinGame(); + } } void gameLobbyDialogImpl::refresh(int actionID) { - if (actionID == MSG_NET_GAME_CLIENT_START) { - myGameListModel->clear(); - myGameListSelectionModel->clear(); - myGameListSelectionModel->clearSelection(); - myGameListSortFilterProxyModel->clear(); - myNickListModel->clear(); - myNickListSelectionModel->clear(); - myNickListSelectionModel->clearSelection();; + if (actionID == MSG_NET_GAME_CLIENT_START) { + myGameListModel->clear(); + myGameListSelectionModel->clear(); + myGameListSelectionModel->clearSelection(); + myGameListSortFilterProxyModel->clear(); + myNickListModel->clear(); + myNickListSelectionModel->clear(); + myNickListSelectionModel->clearSelection();; - QStringList headerList; - headerList << tr("Game") << tr("Players") << tr("State") << tr("T") << tr("P") << tr("Time");; - myGameListModel->setHorizontalHeaderLabels(headerList); + QStringList headerList; + headerList << tr("Game") << tr("Players") << tr("State") << tr("T") << tr("P") << tr("Time");; + myGameListModel->setHorizontalHeaderLabels(headerList); #ifdef GUI_800x480 - treeView_GameList->setColumnWidth(0,220); - treeView_GameList->setColumnWidth(1,65); - treeView_GameList->setColumnWidth(2,90); - treeView_GameList->setColumnWidth(3,30); - treeView_GameList->setColumnWidth(4,30); + treeView_GameList->setColumnWidth(0,220); + treeView_GameList->setColumnWidth(1,65); + treeView_GameList->setColumnWidth(2,90); + treeView_GameList->setColumnWidth(3,30); + treeView_GameList->setColumnWidth(4,30); #else - treeView_GameList->setColumnWidth(0,190); - treeView_GameList->setColumnWidth(1,55); - treeView_GameList->setColumnWidth(2,65); - treeView_GameList->setColumnWidth(3,25); - treeView_GameList->setColumnWidth(4,25); - treeView_GameList->setColumnWidth(5,30); + treeView_GameList->setColumnWidth(0,190); + treeView_GameList->setColumnWidth(1,55); + treeView_GameList->setColumnWidth(2,65); + treeView_GameList->setColumnWidth(3,25); + treeView_GameList->setColumnWidth(4,25); + treeView_GameList->setColumnWidth(5,30); #endif - QStringList headerList2; - headerList2 << tr("Available Players"); - myNickListModel->setHorizontalHeaderLabels(headerList2); + QStringList headerList2; + headerList2 << tr("Available Players"); + myNickListModel->setHorizontalHeaderLabels(headerList2); - //stop waitStartGameMsgBoxes - waitStartGameMsgBoxTimer->stop(); - closeAllChildDialogs(); - this->accept(); - myW->show(); - } else if(actionID == MSG_NET_GAME_CLIENT_SYNCSTART) { - waitStartGameMsgBoxTimer->start(2000); - } else if(actionID == MSG_NET_GAME_CLIENT_SYNCREJOIN) { - // if(this->isVisible()) { //TODO <-- does it work without isVisible??? - //break the autoStartTimer animation - autoStartTimer->stop(); - autoStartTimerOverlay->hide(); - //show msg dialog - waitRejoinStartGameMsgBox->show(); - waitRejoinStartGameMsgBox->raise(); - waitRejoinStartGameMsgBox->activateWindow(); - pushButton_Leave->setDisabled(true); - // } - } + //stop waitStartGameMsgBoxes + waitStartGameMsgBoxTimer->stop(); + closeAllChildDialogs(); + this->accept(); + myW->show(); + } else if(actionID == MSG_NET_GAME_CLIENT_SYNCSTART) { + waitStartGameMsgBoxTimer->start(2000); + } else if(actionID == MSG_NET_GAME_CLIENT_SYNCREJOIN) { + // if(this->isVisible()) { //TODO <-- does it work without isVisible??? + //break the autoStartTimer animation + autoStartTimer->stop(); + autoStartTimerOverlay->hide(); + //show msg dialog + waitRejoinStartGameMsgBox->show(); + waitRejoinStartGameMsgBox->raise(); + waitRejoinStartGameMsgBox->activateWindow(); + pushButton_Leave->setDisabled(true); + // } + } } void gameLobbyDialogImpl::removedFromGame(int /*reason*/) { - inGame = false; - isGameAdministrator = false; - leftGameDialogUpdate(); + inGame = false; + isGameAdministrator = false; + leftGameDialogUpdate(); } void gameLobbyDialogImpl::gameSelected(const QModelIndex &index) { - if (!inGame && index.isValid() ) { - pushButton_JoinGame->setEnabled(true); + if (!inGame && index.isValid() ) { + pushButton_JoinGame->setEnabled(true); - currentGameName = myGameListModel->item(myGameListSortFilterProxyModel->mapToSource(index).row(), 0)->text(); + currentGameName = myGameListModel->item(myGameListSortFilterProxyModel->mapToSource(index).row(), 0)->text(); - groupBox_GameInfo->setEnabled(true); - groupBox_GameInfo->setTitle(tr("Game Info") + " - " + currentGameName); + groupBox_GameInfo->setEnabled(true); + groupBox_GameInfo->setTitle(tr("Game Info") + " - " + currentGameName); - assert(mySession); - GameInfo info(mySession->getClientGameInfo(myGameListModel->item(myGameListSortFilterProxyModel->mapToSource(index).row(), 0)->data(Qt::UserRole).toUInt())); + assert(mySession); + GameInfo info(mySession->getClientGameInfo(myGameListModel->item(myGameListSortFilterProxyModel->mapToSource(index).row(), 0)->data(Qt::UserRole).toUInt())); - switch (info.data.gameType) { - case GAME_TYPE_NORMAL: { - label_typeIcon->setPixmap(QPixmap(":/gfx/player_play.png")); - label_typeText->setText(tr("Standard")); - } - break; - case GAME_TYPE_REGISTERED_ONLY: { - label_typeIcon->setPixmap(QPixmap(":/gfx/registered.png")); - label_typeText->setText(tr("Registered players only")); - } - break; - case GAME_TYPE_INVITE_ONLY: { - label_typeIcon->setPixmap(QPixmap(":/gfx/list_add_user.png")); - label_typeText->setText(tr("Invited players only")); - } - break; - case GAME_TYPE_RANKING: { - label_typeIcon->setPixmap(QPixmap(":/gfx/cup.png")); - label_typeText->setText(tr("Ranking game")); - } - break; - } + switch (info.data.gameType) { + case GAME_TYPE_NORMAL: { + label_typeIcon->setPixmap(QPixmap(":/gfx/player_play.png")); + label_typeText->setText(tr("Standard")); + } + break; + case GAME_TYPE_REGISTERED_ONLY: { + label_typeIcon->setPixmap(QPixmap(":/gfx/registered.png")); + label_typeText->setText(tr("Registered players only")); + } + break; + case GAME_TYPE_INVITE_ONLY: { + label_typeIcon->setPixmap(QPixmap(":/gfx/list_add_user.png")); + label_typeText->setText(tr("Invited players only")); + } + break; + case GAME_TYPE_RANKING: { + label_typeIcon->setPixmap(QPixmap(":/gfx/cup.png")); + label_typeText->setText(tr("Ranking game")); + } + break; + } - showGameDescription(TRUE); - label_SmallBlind->setText(QString("%L1").arg(info.data.firstSmallBlind)); - label_StartCash->setText(QString("%L1").arg(info.data.startMoney)); - // label_MaximumNumberOfPlayers->setText(QString::number(info.data.maxNumberOfPlayers));s - updateDialogBlinds(info.data); + showGameDescription(TRUE); + label_SmallBlind->setText(QString("%L1").arg(info.data.firstSmallBlind)); + label_StartCash->setText(QString("%L1").arg(info.data.startMoney)); + // label_MaximumNumberOfPlayers->setText(QString::number(info.data.maxNumberOfPlayers));s + updateDialogBlinds(info.data); - label_GameTiming->setText(QString::number(info.data.playerActionTimeoutSec)+" "+tr("sec (action)")+"\n"+QString::number(info.data.delayBetweenHandsSec)+" "+tr("sec (hand delay)")); + label_GameTiming->setText(QString::number(info.data.playerActionTimeoutSec)+" "+tr("sec (action)")+"\n"+QString::number(info.data.delayBetweenHandsSec)+" "+tr("sec (hand delay)")); - treeWidget_connectedPlayers->clear(); - PlayerIdList::const_iterator i = info.players.begin(); - PlayerIdList::const_iterator end = info.players.end(); - while (i != end) { - bool admin = info.adminPlayerId == *i; - PlayerInfo playerInfo(mySession->getClientPlayerInfo(*i)); - addConnectedPlayer(*i, QString::fromUtf8(playerInfo.playerName.c_str()), admin); - ++i; - } + treeWidget_connectedPlayers->clear(); + PlayerIdList::const_iterator i = info.players.begin(); + PlayerIdList::const_iterator end = info.players.end(); + while (i != end) { + bool admin = info.adminPlayerId == *i; + PlayerInfo playerInfo(mySession->getClientPlayerInfo(*i)); + addConnectedPlayer(*i, QString::fromUtf8(playerInfo.playerName.c_str()), admin); + ++i; + } - QTreeWidgetItem *header = treeWidget_connectedPlayers->headerItem(); - header->setText(0, tr("Connected players - Max. %1").arg(info.data.maxNumberOfPlayers)); - header->setData(0, Qt::UserRole, info.data.maxNumberOfPlayers); + QTreeWidgetItem *header = treeWidget_connectedPlayers->headerItem(); + header->setText(0, tr("Connected players - Max. %1").arg(info.data.maxNumberOfPlayers)); + header->setData(0, Qt::UserRole, info.data.maxNumberOfPlayers); #ifdef __APPLE__ - // Dirty workaround for a Qt redraw bug on Mac OS. - treeWidget_connectedPlayers->setFocus(); - treeView_GameList->setFocus(); + // Dirty workaround for a Qt redraw bug on Mac OS. + treeWidget_connectedPlayers->setFocus(); + treeView_GameList->setFocus(); #endif - } + } } void gameLobbyDialogImpl::updateGameItem(QList itemList, unsigned gameId) { - assert(mySession); - GameInfo info(mySession->getClientGameInfo(gameId)); + assert(mySession); + GameInfo info(mySession->getClientGameInfo(gameId)); - itemList.at(0)->setData(gameId, Qt::UserRole); - itemList.at(0)->setData(QString::fromUtf8(info.name.c_str()), Qt::DisplayRole); + itemList.at(0)->setData(gameId, Qt::UserRole); + itemList.at(0)->setData(QString::fromUtf8(info.name.c_str()), Qt::DisplayRole); - PlayerIdList::const_iterator i = info.players.begin(); - PlayerIdList::const_iterator end = info.players.end(); + PlayerIdList::const_iterator i = info.players.begin(); + PlayerIdList::const_iterator end = info.players.end(); - while (i != end) { - if(myPlayerId == *i) { - itemList.at(0)->setData( "MeInThisGame", 16); - itemList.at(0)->setBackground(QBrush(QColor(0, 255, 0, 127))); - itemList.at(1)->setBackground(QBrush(QColor(0, 255, 0, 127))); - itemList.at(2)->setBackground(QBrush(QColor(0, 255, 0, 127))); - itemList.at(3)->setBackground(QBrush(QColor(0, 255, 0, 127))); - itemList.at(4)->setBackground(QBrush(QColor(0, 255, 0, 127))); - itemList.at(5)->setBackground(QBrush(QColor(0, 255, 0, 127))); - break; - } else { - itemList.at(0)->setData( "", 16); - itemList.at(0)->setBackground(QBrush()); - itemList.at(1)->setBackground(QBrush()); - itemList.at(2)->setBackground(QBrush()); - itemList.at(3)->setBackground(QBrush()); - itemList.at(4)->setBackground(QBrush()); - itemList.at(5)->setBackground(QBrush()); - } - ++i; - } + while (i != end) { + if(myPlayerId == *i) { + itemList.at(0)->setData( "MeInThisGame", 16); + itemList.at(0)->setBackground(QBrush(QColor(0, 255, 0, 127))); + itemList.at(1)->setBackground(QBrush(QColor(0, 255, 0, 127))); + itemList.at(2)->setBackground(QBrush(QColor(0, 255, 0, 127))); + itemList.at(3)->setBackground(QBrush(QColor(0, 255, 0, 127))); + itemList.at(4)->setBackground(QBrush(QColor(0, 255, 0, 127))); + itemList.at(5)->setBackground(QBrush(QColor(0, 255, 0, 127))); + break; + } else { + itemList.at(0)->setData( "", 16); + itemList.at(0)->setBackground(QBrush()); + itemList.at(1)->setBackground(QBrush()); + itemList.at(2)->setBackground(QBrush()); + itemList.at(3)->setBackground(QBrush()); + itemList.at(4)->setBackground(QBrush()); + itemList.at(5)->setBackground(QBrush()); + } + ++i; + } - QString playerStr; - playerStr.sprintf("%u/%u", (unsigned)info.players.size(), (unsigned)info.data.maxNumberOfPlayers); - itemList.at(1)->setData(playerStr, Qt::DisplayRole); - if((unsigned)info.players.size() == (unsigned)info.data.maxNumberOfPlayers) { - itemList.at(1)->setData("totalfull", 16); - } else { - itemList.at(1)->setData("nonfull", 16); - }\ + QString playerStr; + playerStr.sprintf("%u/%u", (unsigned)info.players.size(), (unsigned)info.data.maxNumberOfPlayers); + itemList.at(1)->setData(playerStr, Qt::DisplayRole); + if((unsigned)info.players.size() == (unsigned)info.data.maxNumberOfPlayers) { + itemList.at(1)->setData("totalfull", 16); + } else { + itemList.at(1)->setData("nonfull", 16); + }\ - if (info.mode == GAME_MODE_STARTED) { - itemList.at(2)->setData(tr("running"), Qt::DisplayRole); - itemList.at(2)->setData("running", 16); - } else { - itemList.at(2)->setData(tr("open"), Qt::DisplayRole); - itemList.at(2)->setData("open", 16); - } + if (info.mode == GAME_MODE_STARTED) { + itemList.at(2)->setData(tr("running"), Qt::DisplayRole); + itemList.at(2)->setData("running", 16); + } else { + itemList.at(2)->setData(tr("open"), Qt::DisplayRole); + itemList.at(2)->setData("open", 16); + } - switch (info.data.gameType) { - case GAME_TYPE_NORMAL: { - itemList.at(3)->setIcon(QIcon(":/gfx/player_play.png")); - itemList.at(3)->setData("", Qt::DisplayRole); - itemList.at(3)->setData("standard", 16); - } - break; - case GAME_TYPE_REGISTERED_ONLY: { - itemList.at(3)->setIcon(QIcon(":/gfx/registered.png")); - itemList.at(3)->setData(" ", Qt::DisplayRole); - itemList.at(3)->setData("registered", 16); - } - break; - case GAME_TYPE_INVITE_ONLY: { - itemList.at(3)->setIcon(QIcon(":/gfx/list_add_user.png")); - itemList.at(3)->setData(" ", Qt::DisplayRole); - itemList.at(3)->setData("invited", 16); - } - break; - case GAME_TYPE_RANKING: { - itemList.at(3)->setIcon(QIcon(":/gfx/cup.png")); - itemList.at(3)->setData(" ", Qt::DisplayRole); - itemList.at(3)->setData("ranking", 16); - } - break; - } + switch (info.data.gameType) { + case GAME_TYPE_NORMAL: { + itemList.at(3)->setIcon(QIcon(":/gfx/player_play.png")); + itemList.at(3)->setData("", Qt::DisplayRole); + itemList.at(3)->setData("standard", 16); + } + break; + case GAME_TYPE_REGISTERED_ONLY: { + itemList.at(3)->setIcon(QIcon(":/gfx/registered.png")); + itemList.at(3)->setData(" ", Qt::DisplayRole); + itemList.at(3)->setData("registered", 16); + } + break; + case GAME_TYPE_INVITE_ONLY: { + itemList.at(3)->setIcon(QIcon(":/gfx/list_add_user.png")); + itemList.at(3)->setData(" ", Qt::DisplayRole); + itemList.at(3)->setData("invited", 16); + } + break; + case GAME_TYPE_RANKING: { + itemList.at(3)->setIcon(QIcon(":/gfx/cup.png")); + itemList.at(3)->setData(" ", Qt::DisplayRole); + itemList.at(3)->setData("ranking", 16); + } + break; + } - if (info.isPasswordProtected) { - itemList.at(4)->setIcon(QIcon(":/gfx/lock.png")); - itemList.at(4)->setData(" ", Qt::DisplayRole); - itemList.at(4)->setData("private", 16); - } else { - itemList.at(4)->setData("", Qt::DisplayRole); - itemList.at(4)->setData("nonpriv", 16); - } + if (info.isPasswordProtected) { + itemList.at(4)->setIcon(QIcon(":/gfx/lock.png")); + itemList.at(4)->setData(" ", Qt::DisplayRole); + itemList.at(4)->setData("private", 16); + } else { + itemList.at(4)->setData("", Qt::DisplayRole); + itemList.at(4)->setData("nonpriv", 16); + } - itemList.at(5)->setData(QString::number(info.data.playerActionTimeoutSec)+"s/"+QString::number(info.data.delayBetweenHandsSec)+"s", Qt::DisplayRole); - QString actionTimeOutString = QString::number(info.data.playerActionTimeoutSec); - if(info.data.playerActionTimeoutSec < 10) { - actionTimeOutString = "0"+actionTimeOutString; - } - itemList.at(5)->setData(actionTimeOutString, 16); + itemList.at(5)->setData(QString::number(info.data.playerActionTimeoutSec)+"s/"+QString::number(info.data.delayBetweenHandsSec)+"s", Qt::DisplayRole); + QString actionTimeOutString = QString::number(info.data.playerActionTimeoutSec); + if(info.data.playerActionTimeoutSec < 10) { + actionTimeOutString = "0"+actionTimeOutString; + } + itemList.at(5)->setData(actionTimeOutString, 16); - treeView_GameList->sortByColumn(myConfig->readConfigInt("DlgGameLobbyGameListSortingSection"), (Qt::SortOrder)myConfig->readConfigInt("DlgGameLobbyGameListSortingOrder") ); - refreshGameStats(); + treeView_GameList->sortByColumn(myConfig->readConfigInt("DlgGameLobbyGameListSortingSection"), (Qt::SortOrder)myConfig->readConfigInt("DlgGameLobbyGameListSortingOrder") ); + refreshGameStats(); } void gameLobbyDialogImpl::addGame(unsigned gameId) { - QList itemList; - QStandardItem *item1 = new QStandardItem(); - QStandardItem *item2 = new QStandardItem(); - QStandardItem *item3 = new QStandardItem(); - QStandardItem *item4 = new QStandardItem(); - QStandardItem *item5 = new QStandardItem(); - QStandardItem *item6 = new QStandardItem(); - itemList << item1 << item2 << item3 << item4 << item5 << item6; + QList itemList; + QStandardItem *item1 = new QStandardItem(); + QStandardItem *item2 = new QStandardItem(); + QStandardItem *item3 = new QStandardItem(); + QStandardItem *item4 = new QStandardItem(); + QStandardItem *item5 = new QStandardItem(); + QStandardItem *item6 = new QStandardItem(); + itemList << item1 << item2 << item3 << item4 << item5 << item6; - myGameListModel->appendRow(itemList); + myGameListModel->appendRow(itemList); - updateGameItem(itemList, gameId); + updateGameItem(itemList, gameId); } void gameLobbyDialogImpl::updateGameMode(unsigned gameId, int /*newMode*/) { - int it = 0; - while (myGameListModel->item(it)) { - if (myGameListModel->item(it, 0)->data(Qt::UserRole) == gameId) { - QList itemList; - itemList << myGameListModel->item(it, 0) << myGameListModel->item(it, 1) << myGameListModel->item(it, 2) << myGameListModel->item(it, 3) << myGameListModel->item(it, 4) << myGameListModel->item(it, 5); - updateGameItem(itemList, gameId); - break; - } - it++; - } + int it = 0; + while (myGameListModel->item(it)) { + if (myGameListModel->item(it, 0)->data(Qt::UserRole) == gameId) { + QList itemList; + itemList << myGameListModel->item(it, 0) << myGameListModel->item(it, 1) << myGameListModel->item(it, 2) << myGameListModel->item(it, 3) << myGameListModel->item(it, 4) << myGameListModel->item(it, 5); + updateGameItem(itemList, gameId); + break; + } + it++; + } } void gameLobbyDialogImpl::updateGameAdmin(unsigned /*gameId*/, unsigned adminPlayerId) { - newGameAdmin(adminPlayerId, ""); + newGameAdmin(adminPlayerId, ""); } void gameLobbyDialogImpl::removeGame(unsigned gameId) { - int it = 0; - while (myGameListModel->item(it)) { - if (myGameListModel->item(it, 0)->data(Qt::UserRole) == gameId) { - myGameListModel->removeRow(it); - break; - } - it++; - } + int it = 0; + while (myGameListModel->item(it)) { + if (myGameListModel->item(it, 0)->data(Qt::UserRole) == gameId) { + myGameListModel->removeRow(it); + break; + } + it++; + } - refreshGameStats(); + refreshGameStats(); } void gameLobbyDialogImpl::refreshGameStats() { - int runningGamesCounter = 0; - int openGamesCounter = 0; + int runningGamesCounter = 0; + int openGamesCounter = 0; - int it = 0; - while (myGameListModel->item(it)) { - if (myGameListModel->item(it, 2)->data(16) == "running") { - runningGamesCounter++; - } - if (myGameListModel->item(it, 2)->data(16) == "open") { - openGamesCounter++; - } - ++it; - } + int it = 0; + while (myGameListModel->item(it)) { + if (myGameListModel->item(it, 2)->data(16) == "running") { + runningGamesCounter++; + } + if (myGameListModel->item(it, 2)->data(16) == "open") { + openGamesCounter++; + } + ++it; + } - label_openGamesCounter->setText("| "+tr("running games: %1").arg(runningGamesCounter)); - label_runningGamesCounter->setText("| "+tr("open games: %1").arg(openGamesCounter)); + label_openGamesCounter->setText("| "+tr("running games: %1").arg(runningGamesCounter)); + label_runningGamesCounter->setText("| "+tr("open games: %1").arg(openGamesCounter)); - //refresh joinAnyGameButton state - joinAnyGameButtonRefresh(); + //refresh joinAnyGameButton state + joinAnyGameButtonRefresh(); } void gameLobbyDialogImpl::refreshPlayerStats() { - //ServerStats stats = mySession->getClientStats(); - label_connectedPlayersCounter->setText(tr("connected players: %1").arg(myNickListModel->rowCount())); + //ServerStats stats = mySession->getClientStats(); + label_connectedPlayersCounter->setText(tr("connected players: %1").arg(myNickListModel->rowCount())); } void gameLobbyDialogImpl::gameAddPlayer(unsigned gameId, unsigned playerId) { - if (!inGame) { - QItemSelectionModel *selection = treeView_GameList->selectionModel(); - if (selection->hasSelection()) { - if(selection->selectedRows().at(0).data(Qt::UserRole).toUInt() == gameId) { - assert(mySession); - GameInfo info(mySession->getClientGameInfo(gameId)); - bool admin = info.adminPlayerId == playerId; - PlayerInfo playerInfo(mySession->getClientPlayerInfo(playerId)); + if (!inGame) { + QItemSelectionModel *selection = treeView_GameList->selectionModel(); + if (selection->hasSelection()) { + if(selection->selectedRows().at(0).data(Qt::UserRole).toUInt() == gameId) { + assert(mySession); + GameInfo info(mySession->getClientGameInfo(gameId)); + bool admin = info.adminPlayerId == playerId; + PlayerInfo playerInfo(mySession->getClientPlayerInfo(playerId)); - addConnectedPlayer(playerId, QString::fromUtf8(playerInfo.playerName.c_str()), admin); - } - } - } + addConnectedPlayer(playerId, QString::fromUtf8(playerInfo.playerName.c_str()), admin); + } + } + } - int it = 0; - while (myGameListModel->item(it)) { - if (myGameListModel->item(it, 0)->data(Qt::UserRole) == gameId) { - QList itemList; - itemList << myGameListModel->item(it, 0) << myGameListModel->item(it, 1) << myGameListModel->item(it, 2) << myGameListModel->item(it, 3) << myGameListModel->item(it, 4) << myGameListModel->item(it, 5); + int it = 0; + while (myGameListModel->item(it)) { + if (myGameListModel->item(it, 0)->data(Qt::UserRole) == gameId) { + QList itemList; + itemList << myGameListModel->item(it, 0) << myGameListModel->item(it, 1) << myGameListModel->item(it, 2) << myGameListModel->item(it, 3) << myGameListModel->item(it, 4) << myGameListModel->item(it, 5); - updateGameItem(itemList, gameId); - break; - } - it++; - } + updateGameItem(itemList, gameId); + break; + } + it++; + } - //mark player as active - int it1 = 0; - while (myNickListModel->item(it1)) { - if (myNickListModel->item(it1, 0)->data(Qt::UserRole) == playerId) { - myNickListModel->item(it1, 0)->setData("active", 34); - break; - } - ++it1; - } + //mark player as active + int it1 = 0; + while (myNickListModel->item(it1)) { + if (myNickListModel->item(it1, 0)->data(Qt::UserRole) == playerId) { + myNickListModel->item(it1, 0)->setData("active", 34); + break; + } + ++it1; + } } void gameLobbyDialogImpl::gameRemovePlayer(unsigned gameId, unsigned playerId) { - if (!inGame) { - QItemSelectionModel *selection = treeView_GameList->selectionModel(); - if (selection->hasSelection()) { - if(selection->selectedRows().at(0).data(Qt::UserRole).toUInt() == gameId) { - assert(mySession); - PlayerInfo info(mySession->getClientPlayerInfo(playerId)); - removePlayer(playerId, QString::fromUtf8(info.playerName.c_str())); - } - } - } + if (!inGame) { + QItemSelectionModel *selection = treeView_GameList->selectionModel(); + if (selection->hasSelection()) { + if(selection->selectedRows().at(0).data(Qt::UserRole).toUInt() == gameId) { + assert(mySession); + PlayerInfo info(mySession->getClientPlayerInfo(playerId)); + removePlayer(playerId, QString::fromUtf8(info.playerName.c_str())); + } + } + } - int it = 0; - while (myGameListModel->item(it)) { - if (myGameListModel->item(it, 0)->data(Qt::UserRole) == gameId) { - QList itemList; - itemList << myGameListModel->item(it, 0) << myGameListModel->item(it, 1) << myGameListModel->item(it, 2) << myGameListModel->item(it, 3) << myGameListModel->item(it, 4) << myGameListModel->item(it, 5); + int it = 0; + while (myGameListModel->item(it)) { + if (myGameListModel->item(it, 0)->data(Qt::UserRole) == gameId) { + QList itemList; + itemList << myGameListModel->item(it, 0) << myGameListModel->item(it, 1) << myGameListModel->item(it, 2) << myGameListModel->item(it, 3) << myGameListModel->item(it, 4) << myGameListModel->item(it, 5); - updateGameItem(itemList, gameId); - break; - } - ++it; - } + updateGameItem(itemList, gameId); + break; + } + ++it; + } - //mark player as idle again - int it1 = 0; - while (myNickListModel->item(it1)) { - if (myNickListModel->item(it1, 0)->data(Qt::UserRole) == playerId) { - myNickListModel->item(it1, 0)->setData("idle", 34); - break; - } - ++it1; - } + //mark player as idle again + int it1 = 0; + while (myNickListModel->item(it1)) { + if (myNickListModel->item(it1, 0)->data(Qt::UserRole) == playerId) { + myNickListModel->item(it1, 0)->setData("idle", 34); + break; + } + ++it1; + } } void gameLobbyDialogImpl::updateStats(ServerStats /*stats*/) { - refreshPlayerStats(); + refreshPlayerStats(); } void gameLobbyDialogImpl::clearDialog() { - groupBox_GameInfo->setTitle(tr("Game Info")); - groupBox_GameInfo->setEnabled(false); - currentGameName = ""; + groupBox_GameInfo->setTitle(tr("Game Info")); + groupBox_GameInfo->setEnabled(false); + currentGameName = ""; - QTreeWidgetItem *header = treeWidget_connectedPlayers->headerItem(); - header->setText(0, tr("Connected players")); - header->setData(0, Qt::UserRole, 0); + QTreeWidgetItem *header = treeWidget_connectedPlayers->headerItem(); + header->setText(0, tr("Connected players")); + header->setData(0, Qt::UserRole, 0); - showGameDescription(FALSE); - label_typeIcon->setText(" "); - label_typeText->setText(" "); - label_SmallBlind->setText(""); - label_StartCash->setText(""); - label_blindsRaiseIntervall->setText(""); - label_blindsRaiseMode->setText(""); - label_blindsList->setText(""); - label_GameTiming->setText(""); + showGameDescription(FALSE); + label_typeIcon->setText(" "); + label_typeText->setText(" "); + label_SmallBlind->setText(""); + label_StartCash->setText(""); + label_blindsRaiseIntervall->setText(""); + label_blindsRaiseMode->setText(""); + label_blindsList->setText(""); + label_GameTiming->setText(""); - myGameListModel->clear(); - myGameListSelectionModel->clear(); - myGameListSelectionModel->clearSelection(); - myGameListSortFilterProxyModel->clear(); - treeView_GameList->show(); - treeWidget_connectedPlayers->clear(); + myGameListModel->clear(); + myGameListSelectionModel->clear(); + myGameListSelectionModel->clearSelection(); + myGameListSortFilterProxyModel->clear(); + treeView_GameList->show(); + treeWidget_connectedPlayers->clear(); - pushButton_Leave->hide(); - pushButton_Kick->hide(); - pushButton_Kick->setEnabled(false); - pushButton_StartGame->hide(); - checkBox_fillUpWithComputerOpponents->hide(); - pushButton_CreateGame->show(); - pushButton_JoinGame->show(); - pushButton_JoinGame->setEnabled(false); - pushButton_joinAnyGame->show(); - pushButton_joinAnyGame->setEnabled(false); + pushButton_Leave->hide(); + pushButton_Kick->hide(); + pushButton_Kick->setEnabled(false); + pushButton_StartGame->hide(); + checkBox_fillUpWithComputerOpponents->hide(); + pushButton_CreateGame->show(); + pushButton_JoinGame->show(); + pushButton_JoinGame->setEnabled(false); + pushButton_joinAnyGame->show(); + pushButton_joinAnyGame->setEnabled(false); - QStringList headerList; - headerList << tr("Game") << tr("Players") << tr("State") << tr("T") << tr("P") << tr("Time"); - myGameListModel->setHorizontalHeaderLabels(headerList); + QStringList headerList; + headerList << tr("Game") << tr("Players") << tr("State") << tr("T") << tr("P") << tr("Time"); + myGameListModel->setHorizontalHeaderLabels(headerList); #ifdef GUI_800x480 - treeView_GameList->setColumnWidth(0,220); - treeView_GameList->setColumnWidth(1,55); - treeView_GameList->setColumnWidth(2,90); - treeView_GameList->setColumnWidth(3,20); - treeView_GameList->setColumnWidth(4,20); - treeView_GameList->setColumnWidth(5,20); + treeView_GameList->setColumnWidth(0,220); + treeView_GameList->setColumnWidth(1,55); + treeView_GameList->setColumnWidth(2,90); + treeView_GameList->setColumnWidth(3,20); + treeView_GameList->setColumnWidth(4,20); + treeView_GameList->setColumnWidth(5,20); #else - treeView_GameList->setColumnWidth(0,190); - treeView_GameList->setColumnWidth(1,55); - treeView_GameList->setColumnWidth(2,65); - treeView_GameList->setColumnWidth(3,25); - treeView_GameList->setColumnWidth(4,25); - treeView_GameList->setColumnWidth(5,30); + treeView_GameList->setColumnWidth(0,190); + treeView_GameList->setColumnWidth(1,55); + treeView_GameList->setColumnWidth(2,65); + treeView_GameList->setColumnWidth(3,25); + treeView_GameList->setColumnWidth(4,25); + treeView_GameList->setColumnWidth(5,30); #endif - pushButton_CreateGame->clearFocus(); - lineEdit_ChatInput->setFocus(); - myChat->clearChat(); + pushButton_CreateGame->clearFocus(); + lineEdit_ChatInput->setFocus(); + myChat->clearChat(); - myNickListModel->clear(); - myNickListSelectionModel->clear(); - myNickListSelectionModel->clearSelection();; - QStringList headerList2; - headerList2 << tr("Available Players"); - myNickListModel->setHorizontalHeaderLabels(headerList2); - myNickListModel->sort(0, treeView_NickList->header()->sortIndicatorOrder()); + myNickListModel->clear(); + myNickListSelectionModel->clear(); + myNickListSelectionModel->clearSelection();; + QStringList headerList2; + headerList2 << tr("Available Players"); + myNickListModel->setHorizontalHeaderLabels(headerList2); + myNickListModel->sort(0, treeView_NickList->header()->sortIndicatorOrder()); - inGame = false; - isGameAdministrator = false; - myPlayerId = 0; + inGame = false; + isGameAdministrator = false; + myPlayerId = 0; - showGameDescription(FALSE); + showGameDescription(FALSE); - label_connectedPlayersCounter->setText(tr("connected players: %1").arg(0)); - label_openGamesCounter->setText("| "+tr("running games: %1").arg(0)); - label_runningGamesCounter->setText("| "+tr("open games: %1").arg(0)); + label_connectedPlayersCounter->setText(tr("connected players: %1").arg(0)); + label_openGamesCounter->setText("| "+tr("running games: %1").arg(0)); + label_runningGamesCounter->setText("| "+tr("open games: %1").arg(0)); - readDialogSettings(); + readDialogSettings(); } void gameLobbyDialogImpl::checkPlayerQuantity() { - assert(mySession); - GameInfo info(mySession->getClientGameInfo(mySession->getClientCurrentGameId())); + assert(mySession); + GameInfo info(mySession->getClientGameInfo(mySession->getClientCurrentGameId())); - if(isGameAdministrator && info.data.gameType != GAME_TYPE_RANKING) { + if(isGameAdministrator && info.data.gameType != GAME_TYPE_RANKING) { - pushButton_Kick->show(); - pushButton_StartGame->show(); - checkBox_fillUpWithComputerOpponents->show(); + pushButton_Kick->show(); + pushButton_StartGame->show(); + checkBox_fillUpWithComputerOpponents->show(); - if (treeWidget_connectedPlayers->topLevelItemCount() >= 2) { - pushButton_StartGame->setEnabled(true); + if (treeWidget_connectedPlayers->topLevelItemCount() >= 2) { + pushButton_StartGame->setEnabled(true); - if(treeWidget_connectedPlayers->topLevelItemCount() == treeWidget_connectedPlayers->headerItem()->data(0, Qt::UserRole).toInt()) { - blinkingButtonAnimationTimer->start(); - } else { - blinkingButtonAnimationTimer->stop(); - blinkingButtonAnimationState = false; - blinkingStartButtonAnimation(); - } - } else { - pushButton_StartGame->setEnabled(false); - blinkingButtonAnimationTimer->stop(); - blinkingButtonAnimationState = false; - blinkingStartButtonAnimation(); - } - } + if(treeWidget_connectedPlayers->topLevelItemCount() == treeWidget_connectedPlayers->headerItem()->data(0, Qt::UserRole).toInt()) { + blinkingButtonAnimationTimer->start(); + } else { + blinkingButtonAnimationTimer->stop(); + blinkingButtonAnimationState = false; + blinkingStartButtonAnimation(); + } + } else { + pushButton_StartGame->setEnabled(false); + blinkingButtonAnimationTimer->stop(); + blinkingButtonAnimationState = false; + blinkingStartButtonAnimation(); + } + } - //general actions - if(treeWidget_connectedPlayers->topLevelItemCount() < treeWidget_connectedPlayers->headerItem()->data(0, Qt::UserRole).toInt()) { - autoStartTimerOverlay->hide(); - autoStartTimer->stop(); - } + //general actions + if(treeWidget_connectedPlayers->topLevelItemCount() < treeWidget_connectedPlayers->headerItem()->data(0, Qt::UserRole).toInt()) { + autoStartTimerOverlay->hide(); + autoStartTimer->stop(); + } } void gameLobbyDialogImpl::blinkingStartButtonAnimation() { - if(blinkingButtonAnimationState) { - QPalette p = pushButton_StartGame->palette(); - p.setColor(QPalette::Button, QColor(Qt::red)); - p.setColor(QPalette::ButtonText, QColor(Qt::white)); - pushButton_StartGame->setPalette(p); - blinkingButtonAnimationState = false; - } else { - if(pushButton_StartGame->isEnabled()) { - QPalette p = pushButton_StartGame->palette(); - p.setColor(QPalette::Button, defaultStartButtonColor); - p.setColor(QPalette::ButtonText, defaultStartButtonTextColor); - pushButton_StartGame->setPalette(p); - blinkingButtonAnimationState = true; - } else { - QPalette p = pushButton_StartGame->palette(); - p.setColor(QPalette::Button, disabledStartButtonColor); - p.setColor(QPalette::ButtonText, disabledStartButtonTextColor); - pushButton_StartGame->setPalette(p); - blinkingButtonAnimationState = true; - } - } + if(blinkingButtonAnimationState) { + QPalette p = pushButton_StartGame->palette(); + p.setColor(QPalette::Button, QColor(Qt::red)); + p.setColor(QPalette::ButtonText, QColor(Qt::white)); + pushButton_StartGame->setPalette(p); + blinkingButtonAnimationState = false; + } else { + if(pushButton_StartGame->isEnabled()) { + QPalette p = pushButton_StartGame->palette(); + p.setColor(QPalette::Button, defaultStartButtonColor); + p.setColor(QPalette::ButtonText, defaultStartButtonTextColor); + pushButton_StartGame->setPalette(p); + blinkingButtonAnimationState = true; + } else { + QPalette p = pushButton_StartGame->palette(); + p.setColor(QPalette::Button, disabledStartButtonColor); + p.setColor(QPalette::ButtonText, disabledStartButtonTextColor); + pushButton_StartGame->setPalette(p); + blinkingButtonAnimationState = true; + } + } } 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); - } + //show msgBox about invite only game + assert(mySession); + if(mySession->getClientGameInfo(mySession->getClientCurrentGameId()).data.gameType == GAME_TYPE_INVITE_ONLY) { + infoMsgToShowId = 2; + showInfoMsgBoxTimer->start(1000); + } - // if(!myGameListSelectionModel->hasSelection() && mySession->getClientGameInfo(mySession->getClientCurrentGameId()).data.gameType == GAME_TYPE_INVITE_ONLY) { - // int it = 0; - // while (myGameListModel->item(it)) { - // if (myGameListModel->item(it, 0)->data(Qt::UserRole) == mySession->getClientCurrentGameId()) { - // gameSelected(treeView_GameList->model()->index(it,0), true); - // break; - // } - // it++; - // } - // } + // if(!myGameListSelectionModel->hasSelection() && mySession->getClientGameInfo(mySession->getClientCurrentGameId()).data.gameType == GAME_TYPE_INVITE_ONLY) { + // int it = 0; + // while (myGameListModel->item(it)) { + // if (myGameListModel->item(it, 0)->data(Qt::UserRole) == mySession->getClientCurrentGameId()) { + // gameSelected(treeView_GameList->model()->index(it,0), true); + // break; + // } + // it++; + // } + // } } void gameLobbyDialogImpl::addConnectedPlayer(unsigned playerId, QString playerName, bool isGameAdmin) { - QTreeWidgetItem *item = new QTreeWidgetItem(treeWidget_connectedPlayers, 0); - item->setData(0, Qt::UserRole, playerId); - item->setData(0, Qt::DisplayRole, playerName); + QTreeWidgetItem *item = new QTreeWidgetItem(treeWidget_connectedPlayers, 0); + item->setData(0, Qt::UserRole, playerId); + item->setData(0, Qt::DisplayRole, playerName); - if(isGameAdmin) item->setBackground(0, QBrush(QColor(0, 255, 0, 127))); + if(isGameAdmin) item->setBackground(0, QBrush(QColor(0, 255, 0, 127))); - if(this->isVisible() && inGame && myConfig->readConfigInt("PlayNetworkGameNotification")) { - if(treeWidget_connectedPlayers->topLevelItemCount() < treeWidget_connectedPlayers->headerItem()->data(0, Qt::UserRole).toInt()) { - myW->getMySoundEventHandler()->playSound("playerconnected", 0); - } else { - myW->getMySoundEventHandler()->playSound("onlinegameready", 0); - showAutoStartTimer(); - } - } + if(this->isVisible() && inGame && myConfig->readConfigInt("PlayNetworkGameNotification")) { + if(treeWidget_connectedPlayers->topLevelItemCount() < treeWidget_connectedPlayers->headerItem()->data(0, Qt::UserRole).toInt()) { + myW->getMySoundEventHandler()->playSound("playerconnected", 0); + } else { + myW->getMySoundEventHandler()->playSound("onlinegameready", 0); + showAutoStartTimer(); + } + } - checkPlayerQuantity(); + checkPlayerQuantity(); - if (inGame) - refreshConnectedPlayerAvatars(); + if (inGame) + refreshConnectedPlayerAvatars(); } void gameLobbyDialogImpl::updatePlayer(unsigned playerId, QString newPlayerName) { - //rename player in connected players list - QTreeWidgetItemIterator it(treeWidget_connectedPlayers); - while (*it) { - if ((*it)->data(0, Qt::UserRole) == playerId) { - (*it)->setData(0, Qt::DisplayRole, newPlayerName); - break; - } - ++it; - } + //rename player in connected players list + QTreeWidgetItemIterator it(treeWidget_connectedPlayers); + while (*it) { + if ((*it)->data(0, Qt::UserRole) == playerId) { + (*it)->setData(0, Qt::DisplayRole, newPlayerName); + break; + } + ++it; + } - if (inGame) - refreshConnectedPlayerAvatars(); + if (inGame) + refreshConnectedPlayerAvatars(); - //also rename player in nick-list - QString oldNick; - int it1 = 0; - while (myNickListModel->item(it1)) { - if (myNickListModel->item(it1, 0)->data(Qt::UserRole) == playerId) { - oldNick = myNickListModel->item(it1, 0)->text(); - myNickListModel->item(it1, 0)->setText(newPlayerName); + //also rename player in nick-list + QString oldNick; + int it1 = 0; + while (myNickListModel->item(it1)) { + if (myNickListModel->item(it1, 0)->data(Qt::UserRole) == playerId) { + oldNick = myNickListModel->item(it1, 0)->text(); + myNickListModel->item(it1, 0)->setText(newPlayerName); - PlayerInfo playerInfo(mySession->getClientPlayerInfo(playerId)); - QString countryString = QString::fromUtf8(playerInfo.countryCode.c_str()).toLower(); - myNickListModel->item(it1, 0)->setData(countryString, 33); - if(playerInfo.isGuest || countryString.isEmpty()) { - myNickListModel->item(it1, 0)->setIcon(QIcon(":/cflags/cflags/undefined.png")); - myNickListModel->item(it1, 0)->setToolTip(""); - } else { - myNickListModel->item(it1, 0)->setIcon(QIcon(QString(":/cflags/cflags/%1.png").arg(countryString))); - myNickListModel->item(it1, 0)->setToolTip(getFullCountryString(countryString.toUpper())); - } + PlayerInfo playerInfo(mySession->getClientPlayerInfo(playerId)); + QString countryString = QString::fromUtf8(playerInfo.countryCode.c_str()).toLower(); + myNickListModel->item(it1, 0)->setData(countryString, 33); + if(playerInfo.isGuest || countryString.isEmpty()) { + myNickListModel->item(it1, 0)->setIcon(QIcon(":/cflags/cflags/undefined.png")); + myNickListModel->item(it1, 0)->setToolTip(""); + } else { + myNickListModel->item(it1, 0)->setIcon(QIcon(QString(":/cflags/cflags/%1.png").arg(countryString))); + myNickListModel->item(it1, 0)->setToolTip(getFullCountryString(countryString.toUpper())); + } - unsigned gameIdOfPlayer = mySession->getGameIdOfPlayer(playerId); - if(gameIdOfPlayer) { - myNickListModel->item(it1, 0)->setData("active", 34); - } else { - myNickListModel->item(it1, 0)->setData("idle", 34); - } + unsigned gameIdOfPlayer = mySession->getGameIdOfPlayer(playerId); + if(gameIdOfPlayer) { + myNickListModel->item(it1, 0)->setData("active", 34); + } else { + myNickListModel->item(it1, 0)->setData("idle", 34); + } - break; - } + break; + } - ++it1; - } + ++it1; + } - if (myChat->getMyNick() == oldNick) { - myChat->setMyNick(newPlayerName); - } + if (myChat->getMyNick() == oldNick) { + myChat->setMyNick(newPlayerName); + } } void gameLobbyDialogImpl::removePlayer(unsigned playerId, QString) { - QTreeWidgetItemIterator it(treeWidget_connectedPlayers); - while (*it) { - if ((*it)->data(0, Qt::UserRole) == playerId) { - treeWidget_connectedPlayers->takeTopLevelItem(treeWidget_connectedPlayers->indexOfTopLevelItem(*it)); - break; - } - ++it; - } + QTreeWidgetItemIterator it(treeWidget_connectedPlayers); + while (*it) { + if ((*it)->data(0, Qt::UserRole) == playerId) { + treeWidget_connectedPlayers->takeTopLevelItem(treeWidget_connectedPlayers->indexOfTopLevelItem(*it)); + break; + } + ++it; + } - checkPlayerQuantity(); + checkPlayerQuantity(); } void gameLobbyDialogImpl::playerLeftLobby(unsigned playerId) { - int it1 = 0; - while (myNickListModel->item(it1)) { - if (myNickListModel->item(it1, 0)->data(Qt::UserRole) == playerId) { - myNickListModel->removeRow(it1);; - break; - } - ++it1; - } + int it1 = 0; + while (myNickListModel->item(it1)) { + if (myNickListModel->item(it1, 0)->data(Qt::UserRole) == playerId) { + myNickListModel->removeRow(it1);; + break; + } + ++it1; + } - refreshPlayerStats(); + refreshPlayerStats(); } void gameLobbyDialogImpl::playerJoinedLobby(unsigned playerId, QString /*playerName TODO remove*/) { - PlayerInfo playerInfo(mySession->getClientPlayerInfo(playerId)); - QString countryString = QString::fromUtf8(playerInfo.countryCode.c_str()).toLower(); + PlayerInfo playerInfo(mySession->getClientPlayerInfo(playerId)); + QString countryString = QString::fromUtf8(playerInfo.countryCode.c_str()).toLower(); - QStandardItem *item = new QStandardItem; - item->setText(QString::fromUtf8(playerInfo.playerName.c_str())); - item->setData(playerId, Qt::UserRole); - item->setData(countryString, 33); - if(playerInfo.isGuest || countryString.isEmpty()) { - item->setIcon(QIcon(":/cflags/cflags/undefined.png")); - } else { - item->setIcon(QIcon(QString(":/cflags/cflags/%1.png").arg(countryString))); - item->setToolTip(getFullCountryString(countryString.toUpper())); - } + QStandardItem *item = new QStandardItem; + item->setText(QString::fromUtf8(playerInfo.playerName.c_str())); + item->setData(playerId, Qt::UserRole); + item->setData(countryString, 33); + if(playerInfo.isGuest || countryString.isEmpty()) { + item->setIcon(QIcon(":/cflags/cflags/undefined.png")); + } else { + item->setIcon(QIcon(QString(":/cflags/cflags/%1.png").arg(countryString))); + item->setToolTip(getFullCountryString(countryString.toUpper())); + } - unsigned gameIdOfPlayer = mySession->getGameIdOfPlayer(playerId); - if(gameIdOfPlayer) { - item->setData("active", 34); - } else { - item->setData("idle", 34); - } + unsigned gameIdOfPlayer = mySession->getGameIdOfPlayer(playerId); + if(gameIdOfPlayer) { + item->setData("active", 34); + } else { + item->setData("idle", 34); + } - myNickListModel->appendRow(item); + myNickListModel->appendRow(item); - refreshPlayerStats(); + refreshPlayerStats(); } void gameLobbyDialogImpl::newGameAdmin(unsigned playerId, QString) { - QTreeWidgetItemIterator it(treeWidget_connectedPlayers); - while (*it) { - if ((*it)->data(0, Qt::UserRole) == playerId) { - (*it)->setBackground(0, QBrush(QColor(0, 255, 0, 127))); - } - ++it; - } + QTreeWidgetItemIterator it(treeWidget_connectedPlayers); + while (*it) { + if ((*it)->data(0, Qt::UserRole) == playerId) { + (*it)->setBackground(0, QBrush(QColor(0, 255, 0, 127))); + } + ++it; + } - if (inGame && myPlayerId == playerId) { - isGameAdministrator = true; - checkPlayerQuantity(); - } + if (inGame && myPlayerId == playerId) { + isGameAdministrator = true; + checkPlayerQuantity(); + } } void gameLobbyDialogImpl::refreshConnectedPlayerAvatars() { - QTreeWidgetItemIterator it(treeWidget_connectedPlayers); - while (*it) { + QTreeWidgetItemIterator it(treeWidget_connectedPlayers); + while (*it) { - std::string myAvatarFileName; - PlayerInfo playerInfo(mySession->getClientPlayerInfo((*it)->data(0, Qt::UserRole).toUInt())); + std::string myAvatarFileName; + PlayerInfo playerInfo(mySession->getClientPlayerInfo((*it)->data(0, Qt::UserRole).toUInt())); - if(mySession->getAvatarFile(playerInfo.avatar, myAvatarFileName)) { + if(mySession->getAvatarFile(playerInfo.avatar, myAvatarFileName)) { - QString myAvatarString(QString::fromUtf8(myAvatarFileName.c_str())); - QFile myAvatarFile(myAvatarString); - if(myAvatarFile.exists()) { + QString myAvatarString(QString::fromUtf8(myAvatarFileName.c_str())); + QFile myAvatarFile(myAvatarString); + if(myAvatarFile.exists()) { - QPixmap tempAvatar(myAvatarString); - QPixmap myAvatarPixmap(25,26); - myAvatarPixmap.fill(Qt::transparent); - QPainter p(&myAvatarPixmap); - p.drawPixmap (0,0,25,25, tempAvatar.scaled(25,25,Qt::KeepAspectRatio,Qt::SmoothTransformation)); + QPixmap tempAvatar(myAvatarString); + QPixmap myAvatarPixmap(25,26); + myAvatarPixmap.fill(Qt::transparent); + QPainter p(&myAvatarPixmap); + p.drawPixmap (0,0,25,25, tempAvatar.scaled(25,25,Qt::KeepAspectRatio,Qt::SmoothTransformation)); - (*it)->setIcon(0, QIcon(myAvatarPixmap)); - } - } - ++it; - } + (*it)->setIcon(0, QIcon(myAvatarPixmap)); + } + } + ++it; + } } void gameLobbyDialogImpl::joinedGameDialogUpdate() { - groupBox_GameInfo->setEnabled(true); - groupBox_GameInfo->setTitle(currentGameName); - treeWidget_connectedPlayers->clear(); - pushButton_CreateGame->hide(); - pushButton_JoinGame->hide(); - pushButton_joinAnyGame->hide(); - pushButton_Leave->show(); - pushButton_Leave->setEnabled(true); + groupBox_GameInfo->setEnabled(true); + groupBox_GameInfo->setTitle(currentGameName); + treeWidget_connectedPlayers->clear(); + pushButton_CreateGame->hide(); + pushButton_JoinGame->hide(); + pushButton_joinAnyGame->hide(); + pushButton_Leave->show(); + pushButton_Leave->setEnabled(true); - //this was added to show game infos even if no game was selected (e.g. invite only game) - assert(mySession); - GameInfo info(mySession->getClientGameInfo(mySession->getClientCurrentGameId())); + //this was added to show game infos even if no game was selected (e.g. invite only game) + assert(mySession); + GameInfo info(mySession->getClientGameInfo(mySession->getClientCurrentGameId())); - groupBox_GameInfo->setTitle(tr("Game Info") + " - " + QString::fromUtf8(info.name.c_str())); + groupBox_GameInfo->setTitle(tr("Game Info") + " - " + QString::fromUtf8(info.name.c_str())); - switch (info.data.gameType) { - case GAME_TYPE_NORMAL: { - label_typeIcon->setPixmap(QPixmap(":/gfx/player_play.png")); - label_typeText->setText(tr("Standard")); - } - break; - case GAME_TYPE_REGISTERED_ONLY: { - label_typeIcon->setPixmap(QPixmap(":/gfx/registered.png")); - label_typeText->setText(tr("Registered players only")); - } - break; - case GAME_TYPE_INVITE_ONLY: { - label_typeIcon->setPixmap(QPixmap(":/gfx/list_add_user.png")); - label_typeText->setText(tr("Invited players only")); - } - break; - case GAME_TYPE_RANKING: { - label_typeIcon->setPixmap(QPixmap(":/gfx/cup.png")); - label_typeText->setText(tr("Ranking game")); - } - break; - } + switch (info.data.gameType) { + case GAME_TYPE_NORMAL: { + label_typeIcon->setPixmap(QPixmap(":/gfx/player_play.png")); + label_typeText->setText(tr("Standard")); + } + break; + case GAME_TYPE_REGISTERED_ONLY: { + label_typeIcon->setPixmap(QPixmap(":/gfx/registered.png")); + label_typeText->setText(tr("Registered players only")); + } + break; + case GAME_TYPE_INVITE_ONLY: { + label_typeIcon->setPixmap(QPixmap(":/gfx/list_add_user.png")); + label_typeText->setText(tr("Invited players only")); + } + break; + case GAME_TYPE_RANKING: { + label_typeIcon->setPixmap(QPixmap(":/gfx/cup.png")); + label_typeText->setText(tr("Ranking game")); + } + break; + } - showGameDescription(TRUE); - label_SmallBlind->setText(QString("%L1").arg(info.data.firstSmallBlind)); - label_StartCash->setText(QString("%L1").arg(info.data.startMoney)); - updateDialogBlinds(info.data); - label_GameTiming->setText(QString::number(info.data.playerActionTimeoutSec)+" "+tr("sec (action)")+"\n"+QString::number(info.data.delayBetweenHandsSec)+" "+tr("sec (hand delay)")); + showGameDescription(TRUE); + label_SmallBlind->setText(QString("%L1").arg(info.data.firstSmallBlind)); + label_StartCash->setText(QString("%L1").arg(info.data.startMoney)); + updateDialogBlinds(info.data); + label_GameTiming->setText(QString::number(info.data.playerActionTimeoutSec)+" "+tr("sec (action)")+"\n"+QString::number(info.data.delayBetweenHandsSec)+" "+tr("sec (hand delay)")); - QTreeWidgetItem *header = treeWidget_connectedPlayers->headerItem(); - header->setText(0, tr("Connected players - Max. %1").arg(info.data.maxNumberOfPlayers)); - header->setData(0, Qt::UserRole, info.data.maxNumberOfPlayers); + QTreeWidgetItem *header = treeWidget_connectedPlayers->headerItem(); + header->setText(0, tr("Connected players - Max. %1").arg(info.data.maxNumberOfPlayers)); + header->setData(0, Qt::UserRole, info.data.maxNumberOfPlayers); } void gameLobbyDialogImpl::leftGameDialogUpdate() { - // un-select current game. - treeView_GameList->clearSelection(); + // un-select current game. + treeView_GameList->clearSelection(); - groupBox_GameInfo->setTitle(tr("Game Info")); - groupBox_GameInfo->setEnabled(false); - currentGameName = ""; + groupBox_GameInfo->setTitle(tr("Game Info")); + groupBox_GameInfo->setEnabled(false); + currentGameName = ""; - QTreeWidgetItem *header = treeWidget_connectedPlayers->headerItem(); - header->setText(0, tr("Connected players")); - header->setData(0, Qt::UserRole, 0); + QTreeWidgetItem *header = treeWidget_connectedPlayers->headerItem(); + header->setText(0, tr("Connected players")); + header->setData(0, Qt::UserRole, 0); - showGameDescription(FALSE); - label_typeIcon->setText(" "); - label_typeText->setText(" "); - label_SmallBlind->setText(""); - label_StartCash->setText(""); - label_blindsRaiseIntervall->setText(""); - label_blindsRaiseMode->setText(""); - label_blindsList->setText(""); - label_GameTiming->setText(""); + showGameDescription(FALSE); + label_typeIcon->setText(" "); + label_typeText->setText(" "); + label_SmallBlind->setText(""); + label_StartCash->setText(""); + label_blindsRaiseIntervall->setText(""); + label_blindsRaiseMode->setText(""); + label_blindsList->setText(""); + label_GameTiming->setText(""); - treeWidget_connectedPlayers->clear(); - pushButton_StartGame->hide(); - pushButton_Leave->hide(); - pushButton_Kick->hide(); - pushButton_Kick->setEnabled(false); - checkBox_fillUpWithComputerOpponents->hide(); - pushButton_CreateGame->show(); - pushButton_JoinGame->show(); - pushButton_JoinGame->setEnabled(false); - pushButton_joinAnyGame->show(); - joinAnyGameButtonRefresh(); + treeWidget_connectedPlayers->clear(); + pushButton_StartGame->hide(); + pushButton_Leave->hide(); + pushButton_Kick->hide(); + pushButton_Kick->setEnabled(false); + checkBox_fillUpWithComputerOpponents->hide(); + pushButton_CreateGame->show(); + pushButton_JoinGame->show(); + pushButton_JoinGame->setEnabled(false); + pushButton_joinAnyGame->show(); + joinAnyGameButtonRefresh(); - lineEdit_ChatInput->setFocus(); + lineEdit_ChatInput->setFocus(); } void gameLobbyDialogImpl::updateDialogBlinds(const GameData &gameData) { - if(gameData.raiseIntervalMode == RAISE_ON_HANDNUMBER) { - label_blindsRaiseIntervall->setText(QString::number(gameData.raiseSmallBlindEveryHandsValue)+" "+tr("hands")); - } else { - label_blindsRaiseIntervall->setText(QString::number(gameData.raiseSmallBlindEveryMinutesValue)+" "+tr("minutes")); - } - if(gameData.raiseMode == DOUBLE_BLINDS) { - label_blindsRaiseMode->setText(tr("double blinds")); - label_blindsList->hide(); - label_gameDesc6->hide(); - } else { - label_blindsRaiseMode->setText(tr("manual blinds order")); - label_blindsList->show(); - label_gameDesc6->show(); + if(gameData.raiseIntervalMode == RAISE_ON_HANDNUMBER) { + label_blindsRaiseIntervall->setText(QString::number(gameData.raiseSmallBlindEveryHandsValue)+" "+tr("hands")); + } else { + label_blindsRaiseIntervall->setText(QString::number(gameData.raiseSmallBlindEveryMinutesValue)+" "+tr("minutes")); + } + if(gameData.raiseMode == DOUBLE_BLINDS) { + label_blindsRaiseMode->setText(tr("double blinds")); + label_blindsList->hide(); + label_gameDesc6->hide(); + } else { + label_blindsRaiseMode->setText(tr("manual blinds order")); + label_blindsList->show(); + label_gameDesc6->show(); - QString blindsListString; - std::list::const_iterator it1; - for(it1= gameData.manualBlindsList.begin(); it1 != gameData.manualBlindsList.end(); ++it1) { - blindsListString.append(QString("%L1").arg(*it1)).append(", "); - } - blindsListString.remove(blindsListString.length()-2,2); - label_blindsList->setText(blindsListString); - } + QString blindsListString; + std::list::const_iterator it1; + for(it1= gameData.manualBlindsList.begin(); it1 != gameData.manualBlindsList.end(); ++it1) { + blindsListString.append(QString("%L1").arg(*it1)).append(", "); + } + blindsListString.remove(blindsListString.length()-2,2); + label_blindsList->setText(blindsListString); + } } void gameLobbyDialogImpl::playerSelected(QTreeWidgetItem* item, QTreeWidgetItem*) { - if (item) - pushButton_Kick->setEnabled(isGameAdministrator); + if (item) + pushButton_Kick->setEnabled(isGameAdministrator); } void gameLobbyDialogImpl::startGame() { - assert(mySession); - mySession->sendStartEvent(checkBox_fillUpWithComputerOpponents->isChecked()); + assert(mySession); + mySession->sendStartEvent(checkBox_fillUpWithComputerOpponents->isChecked()); } void gameLobbyDialogImpl::leaveGame() { - assert(mySession); - mySession->sendLeaveCurrentGame(); + assert(mySession); + mySession->sendLeaveCurrentGame(); - //stop autoStartTimerOverlay - autoStartTimerOverlay->hide(); - autoStartTimer->stop(); + //stop autoStartTimerOverlay + autoStartTimerOverlay->hide(); + autoStartTimer->stop(); - //stop waitStartGameMsgBoxes - waitStartGameMsgBoxTimer->stop(); - waitStartGameMsgBox->hide(); - waitRejoinStartGameMsgBox->hide(); + //stop waitStartGameMsgBoxes + waitStartGameMsgBoxTimer->stop(); + waitStartGameMsgBox->hide(); + waitRejoinStartGameMsgBox->hide(); } void gameLobbyDialogImpl::kickPlayer() { - QTreeWidgetItem *item = treeWidget_connectedPlayers->currentItem(); - if (item) { - QString playerName = item->text(0); - if(playerName == QString::fromUtf8(myConfig->readConfigString("MyName").c_str())) { - { - MyMessageBox::warning(this, tr("Server Error"), - tr("You should not kick yourself from this game!"), - QMessageBox::Close); - } - } else { - assert(mySession); - mySession->kickPlayer(item->data(0, Qt::UserRole).toUInt()); - } - } - pushButton_Kick->setEnabled(false); + QTreeWidgetItem *item = treeWidget_connectedPlayers->currentItem(); + if (item) { + QString playerName = item->text(0); + if(playerName == QString::fromUtf8(myConfig->readConfigString("MyName").c_str())) { + { + MyMessageBox::warning(this, tr("Server Error"), + tr("You should not kick yourself from this game!"), + QMessageBox::Close); + } + } else { + assert(mySession); + mySession->kickPlayer(item->data(0, Qt::UserRole).toUInt()); + } + } + pushButton_Kick->setEnabled(false); } void gameLobbyDialogImpl::keyPressEvent ( QKeyEvent * event ) { - // qDebug() << event->key() << "\n"; + // qDebug() << event->key() << "\n"; - if (event->key() == Qt::Key_Enter && lineEdit_ChatInput->hasFocus()) { - myChat->sendMessage(); - } + if (event->key() == Qt::Key_Enter && lineEdit_ChatInput->hasFocus()) { + myChat->sendMessage(); + } - if (event->key() == Qt::Key_Up && lineEdit_ChatInput->hasFocus()) { - if((keyUpCounter + 1) <= myChat->getChatLinesHistorySize()) { - keyUpCounter++; - } - // std::cout << "Up keyUpCounter: " << keyUpCounter << "\n"; - myChat->showChatHistoryIndex(keyUpCounter); - } else if(event->key() == Qt::Key_Down && lineEdit_ChatInput->hasFocus()) { - if((keyUpCounter - 1) >= 0) { - keyUpCounter--; - } - // std::cout << "Down keyUpCounter: " << keyUpCounter << "\n"; - myChat->showChatHistoryIndex(keyUpCounter); - } else { - keyUpCounter = 0; - } + if (event->key() == Qt::Key_Up && lineEdit_ChatInput->hasFocus()) { + if((keyUpCounter + 1) <= myChat->getChatLinesHistorySize()) { + keyUpCounter++; + } + // std::cout << "Up keyUpCounter: " << keyUpCounter << "\n"; + myChat->showChatHistoryIndex(keyUpCounter); + } else if(event->key() == Qt::Key_Down && lineEdit_ChatInput->hasFocus()) { + if((keyUpCounter - 1) >= 0) { + keyUpCounter--; + } + // std::cout << "Down keyUpCounter: " << keyUpCounter << "\n"; + myChat->showChatHistoryIndex(keyUpCounter); + } else { + keyUpCounter = 0; + } - // if (event->key() == Qt::Key_Tab) event->ignore(); else { /*blah*/ } + // if (event->key() == Qt::Key_Tab) event->ignore(); else { /*blah*/ } - // if (event->key() == Qt::Key_N) showInvitationDialog(); - // if (event->key() == Qt::Key_M) guestUserMode(); + // if (event->key() == Qt::Key_N) showInvitationDialog(); + // if (event->key() == Qt::Key_M) guestUserMode(); } bool gameLobbyDialogImpl::eventFilter(QObject *obj, QEvent *event) { - QKeyEvent *keyEvent = static_cast(event); - QFocusEvent *focusEvent = static_cast(event); + QKeyEvent *keyEvent = static_cast(event); + QFocusEvent *focusEvent = static_cast(event); - if (obj == lineEdit_ChatInput && lineEdit_ChatInput->text() != "" && event->type() == QEvent::KeyPress && keyEvent->key() == Qt::Key_Tab) { - myChat->nickAutoCompletition(); - return true; - } else if (obj == lineEdit_searchForPlayers && focusEvent->gotFocus() && lineEdit_searchForPlayers->text() == tr("search for player ...")) { - lineEdit_searchForPlayers->clear(); - return QDialog::eventFilter(obj, event); - } else { - // pass the event on to the parent class - return QDialog::eventFilter(obj, event); - } + if (obj == lineEdit_ChatInput && lineEdit_ChatInput->text() != "" && event->type() == QEvent::KeyPress && keyEvent->key() == Qt::Key_Tab) { + myChat->nickAutoCompletition(); + return true; + } else if (obj == lineEdit_searchForPlayers && focusEvent->gotFocus() && lineEdit_searchForPlayers->text() == tr("search for player ...")) { + lineEdit_searchForPlayers->clear(); + return QDialog::eventFilter(obj, event); + } else { + // pass the event on to the parent class + return QDialog::eventFilter(obj, event); + } } bool gameLobbyDialogImpl::event ( QEvent * event ) { - return QDialog::event(event); + return QDialog::event(event); } void gameLobbyDialogImpl::showGameDescription(bool show) { - if(show) { + if(show) { #ifndef GUI_800x480 - label_gameType->show(); + label_gameType->show(); #endif - label_gameDesc2->show(); - label_gameDesc3->show(); - label_gameDesc4->show(); - label_gameDesc5->show(); - label_gameDesc6->show(); - label_gameDesc7->show(); - } else { - label_gameType->hide(); - label_gameDesc2->hide(); - label_gameDesc3->hide(); - label_gameDesc4->hide(); - label_gameDesc5->hide(); - label_gameDesc6->hide(); - label_gameDesc7->hide(); - } + label_gameDesc2->show(); + label_gameDesc3->show(); + label_gameDesc4->show(); + label_gameDesc5->show(); + label_gameDesc6->show(); + label_gameDesc7->show(); + } else { + label_gameType->hide(); + label_gameDesc2->hide(); + label_gameDesc3->hide(); + label_gameDesc4->hide(); + label_gameDesc5->hide(); + label_gameDesc6->hide(); + label_gameDesc7->hide(); + } } void gameLobbyDialogImpl::showWaitStartGameMsgBox() { - if(this->isVisible()) { - waitStartGameMsgBox->show(); - waitStartGameMsgBox->raise(); - waitStartGameMsgBox->activateWindow(); - pushButton_Leave->setDisabled(true); - } + if(this->isVisible()) { + waitStartGameMsgBox->show(); + waitStartGameMsgBox->raise(); + waitStartGameMsgBox->activateWindow(); + pushButton_Leave->setDisabled(true); + } } void gameLobbyDialogImpl::hideWaitStartGameMsgBox() { - waitStartGameMsgBox->hide(); - waitRejoinStartGameMsgBox->hide(); + waitStartGameMsgBox->hide(); + waitRejoinStartGameMsgBox->hide(); } void gameLobbyDialogImpl::joinAnyGameButtonRefresh() { - int openNonPrivateNonFullGamesCounter = 0; + int openNonPrivateNonFullGamesCounter = 0; - int it = 0; - while (myGameListModel->item(it)) { + int it = 0; + while (myGameListModel->item(it)) { - int players = myGameListModel->item(it, 1)->data(Qt::DisplayRole).toString().section("/",0,0).toInt(); - int maxPlayers = myGameListModel->item(it, 1)->data(Qt::DisplayRole).toString().section("/",1,1).toInt(); - if (myGameListModel->item(it, 2)->data(16) == "open" && myGameListModel->item(it, 4)->data(16) == "nonpriv" && players < maxPlayers) { - openNonPrivateNonFullGamesCounter++; - } - ++it; - } + int players = myGameListModel->item(it, 1)->data(Qt::DisplayRole).toString().section("/",0,0).toInt(); + int maxPlayers = myGameListModel->item(it, 1)->data(Qt::DisplayRole).toString().section("/",1,1).toInt(); + if (myGameListModel->item(it, 2)->data(16) == "open" && myGameListModel->item(it, 4)->data(16) == "nonpriv" && players < maxPlayers) { + openNonPrivateNonFullGamesCounter++; + } + ++it; + } - if(openNonPrivateNonFullGamesCounter) pushButton_joinAnyGame->setEnabled(TRUE); - else pushButton_joinAnyGame->setEnabled(FALSE); + if(openNonPrivateNonFullGamesCounter) pushButton_joinAnyGame->setEnabled(TRUE); + else pushButton_joinAnyGame->setEnabled(FALSE); } void gameLobbyDialogImpl::reject() { - myStartWindow->show(); - QDialog::reject(); + myStartWindow->show(); + QDialog::reject(); } void gameLobbyDialogImpl::closeEvent(QCloseEvent *event) { - //stop waitStartGameMsgBoxes - waitStartGameMsgBoxTimer->stop(); - waitStartGameMsgBox->hide(); - waitRejoinStartGameMsgBox->hide(); - //enable leave button again - it was disabled during waitxyzMsgBoxes - pushButton_Leave->setEnabled(true); - event->accept(); + //stop waitStartGameMsgBoxes + waitStartGameMsgBoxTimer->stop(); + waitStartGameMsgBox->hide(); + waitRejoinStartGameMsgBox->hide(); + //enable leave button again - it was disabled during waitxyzMsgBoxes + pushButton_Leave->setEnabled(true); + event->accept(); } void gameLobbyDialogImpl::accept() { - //stop waitStartGameMsgBoxes - waitStartGameMsgBoxTimer->stop(); - closeAllChildDialogs(); - //enable leave button again - it was disabled during waitxyzMsgBoxes - pushButton_Leave->setEnabled(true); - QDialog::accept(); + //stop waitStartGameMsgBoxes + waitStartGameMsgBoxTimer->stop(); + closeAllChildDialogs(); + //enable leave button again - it was disabled during waitxyzMsgBoxes + pushButton_Leave->setEnabled(true); + QDialog::accept(); } void gameLobbyDialogImpl::writeDialogSettings(int saveMode) { - switch(saveMode) { - case 0: { - QHeaderView *header = treeView_GameList->header(); - myConfig->writeConfigInt("DlgGameLobbyGameListSortingSection", header->sortIndicatorSection()); - myConfig->writeConfigInt("DlgGameLobbyGameListSortingOrder", header->sortIndicatorOrder()); - } - break; - case 1: { - myConfig->writeConfigInt("DlgGameLobbyGameListFilterIndex", comboBox_gameListFilter->currentIndex()); - } - break; - case 2: { - myConfig->writeConfigInt("DlgGameLobbyNickListSortFilterIndex", comboBox_nickListFilter->currentIndex()); - } - break; - default: - ; - } + switch(saveMode) { + case 0: { + QHeaderView *header = treeView_GameList->header(); + myConfig->writeConfigInt("DlgGameLobbyGameListSortingSection", header->sortIndicatorSection()); + myConfig->writeConfigInt("DlgGameLobbyGameListSortingOrder", header->sortIndicatorOrder()); + } + break; + case 1: { + myConfig->writeConfigInt("DlgGameLobbyGameListFilterIndex", comboBox_gameListFilter->currentIndex()); + } + break; + case 2: { + myConfig->writeConfigInt("DlgGameLobbyNickListSortFilterIndex", comboBox_nickListFilter->currentIndex()); + } + break; + default: + ; + } - myConfig->writeBuffer(); + myConfig->writeBuffer(); } void gameLobbyDialogImpl::readDialogSettings() { - comboBox_gameListFilter->setCurrentIndex(myConfig->readConfigInt("DlgGameLobbyGameListFilterIndex")); - treeView_GameList->sortByColumn(myConfig->readConfigInt("DlgGameLobbyGameListSortingSection"), (Qt::SortOrder)myConfig->readConfigInt("DlgGameLobbyGameListSortingOrder") ); - comboBox_nickListFilter->setCurrentIndex(myConfig->readConfigInt("DlgGameLobbyNickListSortFilterIndex")); + comboBox_gameListFilter->setCurrentIndex(myConfig->readConfigInt("DlgGameLobbyGameListFilterIndex")); + treeView_GameList->sortByColumn(myConfig->readConfigInt("DlgGameLobbyGameListSortingSection"), (Qt::SortOrder)myConfig->readConfigInt("DlgGameLobbyGameListSortingOrder") ); + comboBox_nickListFilter->setCurrentIndex(myConfig->readConfigInt("DlgGameLobbyNickListSortFilterIndex")); } void gameLobbyDialogImpl::changeGameListFilter(int index) { - switch(index) { - case 0: { - myGameListSortFilterProxyModel->setColumn1RegExp(QRegExp()); - myGameListSortFilterProxyModel->setColumn2RegExp(QRegExp()); - myGameListSortFilterProxyModel->setColumn3RegExp(QRegExp()); - myGameListSortFilterProxyModel->setColumn4RegExp(QRegExp()); - myGameListSortFilterProxyModel->setColumn5RegExp(QRegExp()); - } - break; - case 1: { - myGameListSortFilterProxyModel->setColumn1RegExp(QRegExp()); - myGameListSortFilterProxyModel->setColumn2RegExp(QRegExp("open", Qt::CaseInsensitive, QRegExp::FixedString)); - myGameListSortFilterProxyModel->setColumn3RegExp(QRegExp()); - myGameListSortFilterProxyModel->setColumn4RegExp(QRegExp()); - myGameListSortFilterProxyModel->setColumn5RegExp(QRegExp()); - } - break; - case 2: { - myGameListSortFilterProxyModel->setColumn1RegExp(QRegExp("nonfull", Qt::CaseInsensitive, QRegExp::FixedString)); - myGameListSortFilterProxyModel->setColumn2RegExp(QRegExp("open", Qt::CaseInsensitive, QRegExp::FixedString)); - myGameListSortFilterProxyModel->setColumn3RegExp(QRegExp()); - myGameListSortFilterProxyModel->setColumn4RegExp(QRegExp()); - myGameListSortFilterProxyModel->setColumn5RegExp(QRegExp()); - } - break; - case 3: { - myGameListSortFilterProxyModel->setColumn1RegExp(QRegExp("nonfull", Qt::CaseInsensitive, QRegExp::FixedString)); - myGameListSortFilterProxyModel->setColumn2RegExp(QRegExp("open", Qt::CaseInsensitive, QRegExp::FixedString)); - myGameListSortFilterProxyModel->setColumn3RegExp(QRegExp()); - myGameListSortFilterProxyModel->setColumn4RegExp(QRegExp("nonpriv", Qt::CaseInsensitive, QRegExp::FixedString)); - myGameListSortFilterProxyModel->setColumn5RegExp(QRegExp()); - } - break; - case 4: { - myGameListSortFilterProxyModel->setColumn1RegExp(QRegExp("nonfull", Qt::CaseInsensitive, QRegExp::FixedString)); - myGameListSortFilterProxyModel->setColumn2RegExp(QRegExp("open", Qt::CaseInsensitive, QRegExp::FixedString)); - myGameListSortFilterProxyModel->setColumn3RegExp(QRegExp()); - myGameListSortFilterProxyModel->setColumn4RegExp(QRegExp("private", Qt::CaseInsensitive, QRegExp::FixedString)); - myGameListSortFilterProxyModel->setColumn5RegExp(QRegExp()); - } - break; - case 5: { - myGameListSortFilterProxyModel->setColumn1RegExp(QRegExp("nonfull", Qt::CaseInsensitive, QRegExp::FixedString)); - myGameListSortFilterProxyModel->setColumn2RegExp(QRegExp("open", Qt::CaseInsensitive, QRegExp::FixedString)); - myGameListSortFilterProxyModel->setColumn3RegExp(QRegExp("ranking", Qt::CaseInsensitive, QRegExp::FixedString)); - myGameListSortFilterProxyModel->setColumn4RegExp(QRegExp()); - myGameListSortFilterProxyModel->setColumn5RegExp(QRegExp()); - } - break; - default: - ; - } - myGameListSortFilterProxyModel->setFilterRegExp(QString()); - myGameListSortFilterProxyModel->setFilterKeyColumn(0); + switch(index) { + case 0: { + myGameListSortFilterProxyModel->setColumn1RegExp(QRegExp()); + myGameListSortFilterProxyModel->setColumn2RegExp(QRegExp()); + myGameListSortFilterProxyModel->setColumn3RegExp(QRegExp()); + myGameListSortFilterProxyModel->setColumn4RegExp(QRegExp()); + myGameListSortFilterProxyModel->setColumn5RegExp(QRegExp()); + } + break; + case 1: { + myGameListSortFilterProxyModel->setColumn1RegExp(QRegExp()); + myGameListSortFilterProxyModel->setColumn2RegExp(QRegExp("open", Qt::CaseInsensitive, QRegExp::FixedString)); + myGameListSortFilterProxyModel->setColumn3RegExp(QRegExp()); + myGameListSortFilterProxyModel->setColumn4RegExp(QRegExp()); + myGameListSortFilterProxyModel->setColumn5RegExp(QRegExp()); + } + break; + case 2: { + myGameListSortFilterProxyModel->setColumn1RegExp(QRegExp("nonfull", Qt::CaseInsensitive, QRegExp::FixedString)); + myGameListSortFilterProxyModel->setColumn2RegExp(QRegExp("open", Qt::CaseInsensitive, QRegExp::FixedString)); + myGameListSortFilterProxyModel->setColumn3RegExp(QRegExp()); + myGameListSortFilterProxyModel->setColumn4RegExp(QRegExp()); + myGameListSortFilterProxyModel->setColumn5RegExp(QRegExp()); + } + break; + case 3: { + myGameListSortFilterProxyModel->setColumn1RegExp(QRegExp("nonfull", Qt::CaseInsensitive, QRegExp::FixedString)); + myGameListSortFilterProxyModel->setColumn2RegExp(QRegExp("open", Qt::CaseInsensitive, QRegExp::FixedString)); + myGameListSortFilterProxyModel->setColumn3RegExp(QRegExp()); + myGameListSortFilterProxyModel->setColumn4RegExp(QRegExp("nonpriv", Qt::CaseInsensitive, QRegExp::FixedString)); + myGameListSortFilterProxyModel->setColumn5RegExp(QRegExp()); + } + break; + case 4: { + myGameListSortFilterProxyModel->setColumn1RegExp(QRegExp("nonfull", Qt::CaseInsensitive, QRegExp::FixedString)); + myGameListSortFilterProxyModel->setColumn2RegExp(QRegExp("open", Qt::CaseInsensitive, QRegExp::FixedString)); + myGameListSortFilterProxyModel->setColumn3RegExp(QRegExp()); + myGameListSortFilterProxyModel->setColumn4RegExp(QRegExp("private", Qt::CaseInsensitive, QRegExp::FixedString)); + myGameListSortFilterProxyModel->setColumn5RegExp(QRegExp()); + } + break; + case 5: { + myGameListSortFilterProxyModel->setColumn1RegExp(QRegExp("nonfull", Qt::CaseInsensitive, QRegExp::FixedString)); + myGameListSortFilterProxyModel->setColumn2RegExp(QRegExp("open", Qt::CaseInsensitive, QRegExp::FixedString)); + myGameListSortFilterProxyModel->setColumn3RegExp(QRegExp("ranking", Qt::CaseInsensitive, QRegExp::FixedString)); + myGameListSortFilterProxyModel->setColumn4RegExp(QRegExp()); + myGameListSortFilterProxyModel->setColumn5RegExp(QRegExp()); + } + break; + default: + ; + } + myGameListSortFilterProxyModel->setFilterRegExp(QString()); + myGameListSortFilterProxyModel->setFilterKeyColumn(0); - writeDialogSettings(1); + writeDialogSettings(1); #ifdef GUI_800x480 - if(index) treeView_GameList->setStyleSheet("QTreeView { border-radius: 4px; border: 2px solid blue; background-color: white; background-image: url(\""+myAppDataPath +"gfx/gui/misc/background_gamelist.png\"); background-attachment: fixed; background-position: top center ; background-repeat: no-repeat; color:rgb(0, 0, 0); font: 20px}"); - else treeView_GameList->setStyleSheet("QTreeView { background-color: white; background-image: url(\""+myAppDataPath +"gfx/gui/misc/background_gamelist.png\"); background-attachment: fixed; background-position: top center ; background-repeat: no-repeat; color:rgb(0, 0, 0); font: 20px}"); + if(index) treeView_GameList->setStyleSheet("QTreeView { border-radius: 4px; border: 2px solid blue; background-color: white; background-image: url(\""+myAppDataPath +"gfx/gui/misc/background_gamelist.png\"); background-attachment: fixed; background-position: top center ; background-repeat: no-repeat; color:rgb(0, 0, 0); font: 20px}"); + else treeView_GameList->setStyleSheet("QTreeView { background-color: white; background-image: url(\""+myAppDataPath +"gfx/gui/misc/background_gamelist.png\"); background-attachment: fixed; background-position: top center ; background-repeat: no-repeat; color:rgb(0, 0, 0); font: 20px}"); - treeView_GameList->header()->setStyleSheet("QObject {font: bold 18px}"); + treeView_GameList->header()->setStyleSheet("QObject {font: bold 18px}"); #else - if(index) treeView_GameList->setStyleSheet("QTreeView { border-radius: 4px; border: 2px solid blue; background-color: white; background-image: url(\""+myAppDataPath +"gfx/gui/misc/background_gamelist.png\"); background-attachment: fixed; background-position: top center ; background-repeat: no-repeat;}"); - else treeView_GameList->setStyleSheet("QTreeView { background-color: white; background-image: url(\""+myAppDataPath +"gfx/gui/misc/background_gamelist.png\"); background-attachment: fixed; background-position: top center ; background-repeat: no-repeat;}"); + if(index) treeView_GameList->setStyleSheet("QTreeView { border-radius: 4px; border: 2px solid blue; background-color: white; background-image: url(\""+myAppDataPath +"gfx/gui/misc/background_gamelist.png\"); background-attachment: fixed; background-position: top center ; background-repeat: no-repeat;}"); + else treeView_GameList->setStyleSheet("QTreeView { background-color: white; background-image: url(\""+myAppDataPath +"gfx/gui/misc/background_gamelist.png\"); background-attachment: fixed; background-position: top center ; background-repeat: no-repeat;}"); #endif } void gameLobbyDialogImpl::changeNickListFilter(int state) { - if(lastNickListFilterState == 0) { - myNickListSortFilterProxyModel->setLastFilterStateCountry(false); - myNickListSortFilterProxyModel->setLastFilterStateAlpha(true); - } else if(lastNickListFilterState == 1) { - myNickListSortFilterProxyModel->setLastFilterStateCountry(true); - myNickListSortFilterProxyModel->setLastFilterStateAlpha(false); - } + if(lastNickListFilterState == 0) { + myNickListSortFilterProxyModel->setLastFilterStateCountry(false); + myNickListSortFilterProxyModel->setLastFilterStateAlpha(true); + } else if(lastNickListFilterState == 1) { + myNickListSortFilterProxyModel->setLastFilterStateCountry(true); + myNickListSortFilterProxyModel->setLastFilterStateAlpha(false); + } - myNickListSortFilterProxyModel->setFilterState(state); - myNickListModel->sort(0, Qt::DescendingOrder); + myNickListSortFilterProxyModel->setFilterState(state); + myNickListModel->sort(0, Qt::DescendingOrder); - myNickListSortFilterProxyModel->setFilterRegExp(QString()); - myNickListSortFilterProxyModel->setFilterKeyColumn(0); + myNickListSortFilterProxyModel->setFilterRegExp(QString()); + myNickListSortFilterProxyModel->setFilterKeyColumn(0); - lastNickListFilterState = state; - writeDialogSettings(2); + lastNickListFilterState = state; + writeDialogSettings(2); } void gameLobbyDialogImpl::changeGameListSorting() { - writeDialogSettings(0); + writeDialogSettings(0); } void gameLobbyDialogImpl::registeredUserMode() { - lineEdit_ChatInput->clear(); - lineEdit_ChatInput->setEnabled(true); - guestMode = false; + lineEdit_ChatInput->clear(); + lineEdit_ChatInput->setEnabled(true); + guestMode = false; } void gameLobbyDialogImpl::guestUserMode() { - lineEdit_ChatInput->setText(tr("Chat is only available to registered players.")); - lineEdit_ChatInput->setDisabled(true); - guestMode = true; + lineEdit_ChatInput->setText(tr("Chat is only available to registered players.")); + lineEdit_ChatInput->setDisabled(true); + guestMode = true; } void gameLobbyDialogImpl::showNickListContextMenu(QPoint p) { - if(myNickListModel->rowCount() && myNickListSelectionModel->currentIndex().isValid()) { + if(myNickListModel->rowCount() && myNickListSelectionModel->currentIndex().isValid()) { - assert(mySession); - unsigned playerUid = myNickListSelectionModel->currentIndex().data(Qt::UserRole).toUInt(); + assert(mySession); + unsigned playerUid = myNickListSelectionModel->currentIndex().data(Qt::UserRole).toUInt(); - if(inGame && mySession->getClientGameInfo(mySession->getClientCurrentGameId()).data.gameType == GAME_TYPE_INVITE_ONLY && playerUid != mySession->getClientUniquePlayerId() && !mySession->getClientPlayerInfo(playerUid).isGuest) { + if(inGame && mySession->getClientGameInfo(mySession->getClientCurrentGameId()).data.gameType == GAME_TYPE_INVITE_ONLY && playerUid != mySession->getClientUniquePlayerId() && !mySession->getClientPlayerInfo(playerUid).isGuest) { - nickListInviteAction->setEnabled(true); - nickListInviteAction->setText(tr("Invite %1").arg(QString::fromUtf8(mySession->getClientPlayerInfo(playerUid).playerName.c_str()))); + nickListInviteAction->setEnabled(true); + nickListInviteAction->setText(tr("Invite %1").arg(QString::fromUtf8(mySession->getClientPlayerInfo(playerUid).playerName.c_str()))); - } else { - nickListInviteAction->setText(tr("Invite player ...")); - nickListInviteAction->setEnabled(false); - } + } else { + nickListInviteAction->setText(tr("Invite player ...")); + nickListInviteAction->setEnabled(false); + } - if(playerUid != mySession->getClientUniquePlayerId() && !mySession->getClientPlayerInfo(playerUid).isGuest) { + if(playerUid != mySession->getClientUniquePlayerId() && !mySession->getClientPlayerInfo(playerUid).isGuest) { - nickListIgnorePlayerAction->setEnabled(true); - nickListIgnorePlayerAction->setText(tr("Ignore %1").arg(QString::fromUtf8(mySession->getClientPlayerInfo(playerUid).playerName.c_str()))); - } else { + nickListIgnorePlayerAction->setEnabled(true); + nickListIgnorePlayerAction->setText(tr("Ignore %1").arg(QString::fromUtf8(mySession->getClientPlayerInfo(playerUid).playerName.c_str()))); + } else { - nickListIgnorePlayerAction->setEnabled(false); - nickListIgnorePlayerAction->setText(tr("Ignore player ...")); - } + nickListIgnorePlayerAction->setEnabled(false); + nickListIgnorePlayerAction->setText(tr("Ignore player ...")); + } - unsigned gameIdOfPlayer = mySession->getGameIdOfPlayer(playerUid); - QString playerInGameInfoString; - if(gameIdOfPlayer) { - playerInGameInfoString = tr("%1 is playing in \"%2\".").arg(QString::fromUtf8(mySession->getClientPlayerInfo(playerUid).playerName.c_str())).arg(QString::fromUtf8(mySession->getClientGameInfo(gameIdOfPlayer).name.c_str())); - } else { - playerInGameInfoString = tr("%1 is not playing at the moment.").arg(QString::fromUtf8(mySession->getClientPlayerInfo(playerUid).playerName.c_str())); - } - nickListPlayerInGameInfo->setText(playerInGameInfoString); + unsigned gameIdOfPlayer = mySession->getGameIdOfPlayer(playerUid); + QString playerInGameInfoString; + if(gameIdOfPlayer) { + playerInGameInfoString = tr("%1 is playing in \"%2\".").arg(QString::fromUtf8(mySession->getClientPlayerInfo(playerUid).playerName.c_str())).arg(QString::fromUtf8(mySession->getClientGameInfo(gameIdOfPlayer).name.c_str())); + } else { + playerInGameInfoString = tr("%1 is not playing at the moment.").arg(QString::fromUtf8(mySession->getClientPlayerInfo(playerUid).playerName.c_str())); + } + nickListPlayerInGameInfo->setText(playerInGameInfoString); - //popup a little more to the right to avaoid double click action - QPoint tempPoint = p; - tempPoint.setX(p.x()+5); - nickListContextMenu->popup(treeView_NickList->mapToGlobal(tempPoint)); - } + //popup a little more to the right to avaoid double click action + QPoint tempPoint = p; + tempPoint.setX(p.x()+5); + nickListContextMenu->popup(treeView_NickList->mapToGlobal(tempPoint)); + } } void gameLobbyDialogImpl::showGameListContextMenu(QPoint p) { - if(myGameListModel->rowCount() && myGameListSelectionModel->currentIndex().isValid()) { - //popup a little more to the right to avaoid double click action - QPoint tempPoint = p; - tempPoint.setX(p.x()+5); - gameListContextMenu->popup(treeView_GameList->mapToGlobal(tempPoint)); - } + if(myGameListModel->rowCount() && myGameListSelectionModel->currentIndex().isValid()) { + //popup a little more to the right to avaoid double click action + QPoint tempPoint = p; + tempPoint.setX(p.x()+5); + gameListContextMenu->popup(treeView_GameList->mapToGlobal(tempPoint)); + } } void gameLobbyDialogImpl::invitePlayerToCurrentGame() { - if(myNickListSelectionModel->currentIndex().isValid()) { - mySession->invitePlayerToCurrentGame(myNickListSelectionModel->currentIndex().data(Qt::UserRole).toUInt()); - } + if(myNickListSelectionModel->currentIndex().isValid()) { + mySession->invitePlayerToCurrentGame(myNickListSelectionModel->currentIndex().data(Qt::UserRole).toUInt()); + } } void gameLobbyDialogImpl::showInfoMsgBox() { - switch(infoMsgToShowId) { - case 2: { - inviteOnlyInfoMsgBox->setModal(false); - inviteOnlyInfoMsgBox->show(INFO_AFTER_JOIN_INVITE_GAME, tr("You have entered a game with type \"invite-only\".\nFeel free to invite other players by right-clicking on their nick in the available players list."), tr("PokerTH - Info Message"), QPixmap(":/gfx/ktip.png"), QDialogButtonBox::Ok, true); - } - break; - default: - ; - break; - } + switch(infoMsgToShowId) { + case 2: { + inviteOnlyInfoMsgBox->setModal(false); + inviteOnlyInfoMsgBox->show(INFO_AFTER_JOIN_INVITE_GAME, tr("You have entered a game with type \"invite-only\".\nFeel free to invite other players by right-clicking on their nick in the available players list."), tr("PokerTH - Info Message"), QPixmap(":/gfx/ktip.png"), QDialogButtonBox::Ok, true); + } + break; + default: + ; + break; + } } void gameLobbyDialogImpl::showInvitationDialog(unsigned gameId, unsigned playerIdFrom) { - if(inviteDialogIsCurrentlyShown || playerIsOnIgnoreList(playerIdFrom)) { + if(inviteDialogIsCurrentlyShown || playerIsOnIgnoreList(playerIdFrom)) { - mySession->rejectGameInvitation(gameId, DENY_GAME_INVITATION_BUSY); - } else { + mySession->rejectGameInvitation(gameId, DENY_GAME_INVITATION_BUSY); + } else { - inviteDialogIsCurrentlyShown = true; + inviteDialogIsCurrentlyShown = true; - myMessageDialogImpl dialog(myConfig, this); - if(dialog.exec(JOIN_INVITE_GAME_QUESTION, tr("You have been invited to the game %1 by %2.
Would you like to join this game?").arg(QString::fromUtf8(mySession->getClientGameInfo(gameId).name.c_str())).arg(QString::fromUtf8(mySession->getClientPlayerInfo(playerIdFrom).playerName.c_str())), tr("PokerTH - Info Message"), QPixmap(":/gfx/list_add_user_64.png"), QDialogButtonBox::Yes|QDialogButtonBox::No, false)) { + myMessageDialogImpl dialog(myConfig, this); + if(dialog.exec(JOIN_INVITE_GAME_QUESTION, tr("You have been invited to the game %1 by %2.
Would you like to join this game?").arg(QString::fromUtf8(mySession->getClientGameInfo(gameId).name.c_str())).arg(QString::fromUtf8(mySession->getClientPlayerInfo(playerIdFrom).playerName.c_str())), tr("PokerTH - Info Message"), QPixmap(":/gfx/list_add_user_64.png"), QDialogButtonBox::Yes|QDialogButtonBox::No, false)) { - mySession->acceptGameInvitation(gameId); - inviteDialogIsCurrentlyShown = false; - } else { - mySession->rejectGameInvitation(gameId, DENY_GAME_INVITATION_NO); - inviteDialogIsCurrentlyShown = false; - } - } + mySession->acceptGameInvitation(gameId); + inviteDialogIsCurrentlyShown = false; + } else { + mySession->rejectGameInvitation(gameId, DENY_GAME_INVITATION_NO); + inviteDialogIsCurrentlyShown = false; + } + } } void gameLobbyDialogImpl::chatInfoPlayerInvitation(unsigned gameId, unsigned playerIdWho, unsigned playerIdFrom) { - textBrowser_ChatDisplay->append(tr("%1 has been invited to %2 by %3.").arg(QString::fromUtf8(mySession->getClientPlayerInfo(playerIdWho).playerName.c_str())).arg(QString::fromUtf8(mySession->getClientGameInfo(gameId).name.c_str())).arg(QString::fromUtf8(mySession->getClientPlayerInfo(playerIdFrom).playerName.c_str()))); + textBrowser_ChatDisplay->append(tr("%1 has been invited to %2 by %3.").arg(QString::fromUtf8(mySession->getClientPlayerInfo(playerIdWho).playerName.c_str())).arg(QString::fromUtf8(mySession->getClientGameInfo(gameId).name.c_str())).arg(QString::fromUtf8(mySession->getClientPlayerInfo(playerIdFrom).playerName.c_str()))); } void gameLobbyDialogImpl::chatInfoPlayerRejectedInvitation(unsigned gameId, unsigned playerIdWho, DenyGameInvitationReason reason) { - QString string; - if(reason == DENY_GAME_INVITATION_NO) string = tr("%1 has rejected the invitation to %2."); + QString string; + if(reason == DENY_GAME_INVITATION_NO) string = tr("%1 has rejected the invitation to %2."); - if(reason == DENY_GAME_INVITATION_BUSY) string = tr("%1 cannot join %2 because he is busy."); + if(reason == DENY_GAME_INVITATION_BUSY) string = tr("%1 cannot join %2 because he is busy."); - textBrowser_ChatDisplay->append(string.arg(QString::fromUtf8(mySession->getClientPlayerInfo(playerIdWho).playerName.c_str())).arg(QString::fromUtf8(mySession->getClientGameInfo(gameId).name.c_str()))); + textBrowser_ChatDisplay->append(string.arg(QString::fromUtf8(mySession->getClientPlayerInfo(playerIdWho).playerName.c_str())).arg(QString::fromUtf8(mySession->getClientGameInfo(gameId).name.c_str()))); } bool gameLobbyDialogImpl::playerIsOnIgnoreList(unsigned playerId) { - list playerIgnoreList = myConfig->readConfigStringList("PlayerIgnoreList"); - list::iterator it1; - for(it1= playerIgnoreList.begin(); it1 != playerIgnoreList.end(); ++it1) { + list playerIgnoreList = myConfig->readConfigStringList("PlayerIgnoreList"); + list::iterator it1; + for(it1= playerIgnoreList.begin(); it1 != playerIgnoreList.end(); ++it1) { - if(QString::fromUtf8(mySession->getClientPlayerInfo(playerId).playerName.c_str()) == QString::fromUtf8(it1->c_str())) { - return true; - } - } - return false; + if(QString::fromUtf8(mySession->getClientPlayerInfo(playerId).playerName.c_str()) == QString::fromUtf8(it1->c_str())) { + return true; + } + } + return false; } void gameLobbyDialogImpl::putPlayerOnIgnoreList() { - if(myNickListSelectionModel->currentIndex().isValid()) { + if(myNickListSelectionModel->currentIndex().isValid()) { - unsigned playerId = myNickListSelectionModel->currentIndex().data(Qt::UserRole).toUInt(); + unsigned playerId = myNickListSelectionModel->currentIndex().data(Qt::UserRole).toUInt(); - if(!playerIsOnIgnoreList(playerId)) { + if(!playerIsOnIgnoreList(playerId)) { - myMessageDialogImpl dialog(myConfig, this); - if(dialog.exec(INGNORE_PLAYER_QUESTION, tr("You will no longer receive chat messages or game invitations from this user.
Do you really want to put player %1 on your ignore list?").arg(QString::fromUtf8(mySession->getClientPlayerInfo(playerId).playerName.c_str())), tr("PokerTH - Question"), QPixmap(":/gfx/im-ban-user_64.png"), QDialogButtonBox::Yes|QDialogButtonBox::No, false ) == QDialog::Accepted) { + myMessageDialogImpl dialog(myConfig, this); + if(dialog.exec(INGNORE_PLAYER_QUESTION, tr("You will no longer receive chat messages or game invitations from this user.
Do you really want to put player %1 on your ignore list?").arg(QString::fromUtf8(mySession->getClientPlayerInfo(playerId).playerName.c_str())), tr("PokerTH - Question"), QPixmap(":/gfx/im-ban-user_64.png"), QDialogButtonBox::Yes|QDialogButtonBox::No, false ) == QDialog::Accepted) { - list playerIgnoreList = myConfig->readConfigStringList("PlayerIgnoreList"); - playerIgnoreList.push_back(QString("%1").arg(QString::fromUtf8(mySession->getClientPlayerInfo(playerId).playerName.c_str())).toUtf8().constData()); - myConfig->writeConfigStringList("PlayerIgnoreList", playerIgnoreList); - myConfig->writeBuffer(); + list playerIgnoreList = myConfig->readConfigStringList("PlayerIgnoreList"); + playerIgnoreList.push_back(QString("%1").arg(QString::fromUtf8(mySession->getClientPlayerInfo(playerId).playerName.c_str())).toUtf8().constData()); + myConfig->writeConfigStringList("PlayerIgnoreList", playerIgnoreList); + myConfig->writeBuffer(); - myChat->refreshIgnoreList(); - } - } - } + myChat->refreshIgnoreList(); + } + } + } } void gameLobbyDialogImpl::searchForPlayerRegExpChanged() { - QRegExp regExp(lineEdit_searchForPlayers->text(), Qt::CaseInsensitive); - myNickListSortFilterProxyModel->setFilterRegExp(regExp); + QRegExp regExp(lineEdit_searchForPlayers->text(), Qt::CaseInsensitive); + myNickListSortFilterProxyModel->setFilterRegExp(regExp); } void gameLobbyDialogImpl::showAutoStartTimer() { - autoStartTimerOverlay->show(); - autoStartTimerOverlay->setGeometry(((scrollArea_gameInfos->geometry().width()-190)/2), ((scrollArea_gameInfos->geometry().height()-50)/2), 190, 50); + autoStartTimerOverlay->show(); + autoStartTimerOverlay->setGeometry(((scrollArea_gameInfos->geometry().width()-190)/2), ((scrollArea_gameInfos->geometry().height()-50)/2), 190, 50); - QString string(tr("The game will start in
%1 seconds.").arg(6)); - QString fontsize; + QString string(tr("The game will start in
%1 seconds.").arg(6)); + QString fontsize; #ifdef ANDROID - fontsize="16px"; + fontsize="16px"; #else - fontsize="10px"; + fontsize="10px"; #endif - autoStartTimerOverlay->setText(""+string+""); - autoStartTimerCounter = 6; - autoStartTimer->start(1000); + autoStartTimerOverlay->setText(""+string+""); + autoStartTimerCounter = 6; + autoStartTimer->start(1000); } void gameLobbyDialogImpl::updateAutoStartTimer() { - --autoStartTimerCounter; - if(autoStartTimerCounter) { - QString string(tr("The game will start in
%1 seconds.").arg(autoStartTimerCounter)); - QString fontsize; + --autoStartTimerCounter; + if(autoStartTimerCounter) { + QString string(tr("The game will start in
%1 seconds.").arg(autoStartTimerCounter)); + QString fontsize; #ifdef ANDROID - fontsize="16px"; + fontsize="16px"; #else - fontsize="10px"; + fontsize="10px"; #endif - autoStartTimerOverlay->setText(""+string+""); - } else { - autoStartTimer->stop(); - autoStartTimerOverlay->hide(); - } + autoStartTimerOverlay->setText(""+string+""); + } else { + autoStartTimer->stop(); + autoStartTimerOverlay->hide(); + } } void gameLobbyDialogImpl::openPlayerStats1() { - if(myNickListSelectionModel->currentIndex().isValid()) { + if(myNickListSelectionModel->currentIndex().isValid()) { - unsigned playerId = myNickListSelectionModel->currentIndex().data(Qt::UserRole).toUInt(); - if(!mySession->getClientPlayerInfo(playerId).isGuest) { - QUrl url("http://pokerth.net/redirect_user_profile.php?nick="+QUrl::toPercentEncoding(myNickListSelectionModel->currentIndex().data(Qt::DisplayRole).toString())); - QDesktopServices::openUrl(url); - } - } + unsigned playerId = myNickListSelectionModel->currentIndex().data(Qt::UserRole).toUInt(); + if(!mySession->getClientPlayerInfo(playerId).isGuest) { + QUrl url("http://pokerth.net/redirect_user_profile.php?nick="+QUrl::toPercentEncoding(myNickListSelectionModel->currentIndex().data(Qt::DisplayRole).toString())); + QDesktopServices::openUrl(url); + } + } } void gameLobbyDialogImpl::openPlayerStats2() { - if(treeWidget_connectedPlayers->currentItem()) { + if(treeWidget_connectedPlayers->currentItem()) { - unsigned playerId = treeWidget_connectedPlayers->currentItem()->data(0, Qt::UserRole).toUInt(); - if(!mySession->getClientPlayerInfo(playerId).isGuest) { - QUrl url("http://pokerth.net/redirect_user_profile.php?nick="+QUrl::toPercentEncoding(treeWidget_connectedPlayers->currentItem()->data(0, Qt::DisplayRole).toString())); - QDesktopServices::openUrl(url); - } - } + unsigned playerId = treeWidget_connectedPlayers->currentItem()->data(0, Qt::UserRole).toUInt(); + if(!mySession->getClientPlayerInfo(playerId).isGuest) { + QUrl url("http://pokerth.net/redirect_user_profile.php?nick="+QUrl::toPercentEncoding(treeWidget_connectedPlayers->currentItem()->data(0, Qt::DisplayRole).toString())); + QDesktopServices::openUrl(url); + } + } } void gameLobbyDialogImpl::showConnectedPlayersContextMenu(QPoint p) { - if(treeWidget_connectedPlayers->currentItem()) { + if(treeWidget_connectedPlayers->currentItem()) { - assert(mySession); - unsigned playerUid = treeWidget_connectedPlayers->currentItem()->data(0, Qt::UserRole).toUInt(); + assert(mySession); + unsigned playerUid = treeWidget_connectedPlayers->currentItem()->data(0, Qt::UserRole).toUInt(); - if(!mySession->getClientPlayerInfo(playerUid).isGuest) { + if(!mySession->getClientPlayerInfo(playerUid).isGuest) { - //popup a little more to the right to avaoid double click action - QPoint tempPoint = p; - tempPoint.setX(p.x()+5); - connectedPlayersListPlayerInfoSubMenu->popup(treeWidget_connectedPlayers->mapToGlobal(tempPoint)); - } - } + //popup a little more to the right to avaoid double click action + QPoint tempPoint = p; + tempPoint.setX(p.x()+5); + connectedPlayersListPlayerInfoSubMenu->popup(treeWidget_connectedPlayers->mapToGlobal(tempPoint)); + } + } } QString gameLobbyDialogImpl::getFullCountryString(QString cs) { - // Initialise map of country strings, if needed. - if (countryStringMap.empty()) { - countryStringMap.insert(CountryStringMap::value_type("AF", tr("Afghanistan"))); - countryStringMap.insert(CountryStringMap::value_type("AX", tr("ALand Islands"))); - countryStringMap.insert(CountryStringMap::value_type("AL", tr("Albania"))); - countryStringMap.insert(CountryStringMap::value_type("DZ", tr("Algeria"))); - countryStringMap.insert(CountryStringMap::value_type("AS", tr("American Samoa"))); - countryStringMap.insert(CountryStringMap::value_type("AD", tr("Andorra"))); - countryStringMap.insert(CountryStringMap::value_type("AO", tr("Angola"))); - countryStringMap.insert(CountryStringMap::value_type("AI", tr("Anguilla"))); - countryStringMap.insert(CountryStringMap::value_type("AQ", tr("Antarctica"))); - countryStringMap.insert(CountryStringMap::value_type("AG", tr("Antigua And Barbuda"))); - countryStringMap.insert(CountryStringMap::value_type("AR", tr("Argentina"))); - countryStringMap.insert(CountryStringMap::value_type("AM", tr("Armenia"))); - countryStringMap.insert(CountryStringMap::value_type("AW", tr("Aruba"))); - countryStringMap.insert(CountryStringMap::value_type("AU", tr("Australia"))); - countryStringMap.insert(CountryStringMap::value_type("AT", tr("Austria"))); - countryStringMap.insert(CountryStringMap::value_type("AZ", tr("Azerbaijan"))); - countryStringMap.insert(CountryStringMap::value_type("BS", tr("Bahamas"))); - countryStringMap.insert(CountryStringMap::value_type("BH", tr("Bahrain"))); - countryStringMap.insert(CountryStringMap::value_type("BD", tr("Bangladesh"))); - countryStringMap.insert(CountryStringMap::value_type("BB", tr("Barbados"))); - countryStringMap.insert(CountryStringMap::value_type("BY", tr("Belarus"))); - countryStringMap.insert(CountryStringMap::value_type("BE", tr("Belgium"))); - countryStringMap.insert(CountryStringMap::value_type("BZ", tr("Belize"))); - countryStringMap.insert(CountryStringMap::value_type("BJ", tr("Benin"))); - countryStringMap.insert(CountryStringMap::value_type("BM", tr("Bermuda"))); - countryStringMap.insert(CountryStringMap::value_type("BT", tr("Bhutan"))); - countryStringMap.insert(CountryStringMap::value_type("BO", tr("Bolivia"))); - countryStringMap.insert(CountryStringMap::value_type("BA", tr("Bosnia And Herzegovina"))); - countryStringMap.insert(CountryStringMap::value_type("BW", tr("Botswana"))); - countryStringMap.insert(CountryStringMap::value_type("BV", tr("Bouvet Island"))); - countryStringMap.insert(CountryStringMap::value_type("BR", tr("Brazil"))); - countryStringMap.insert(CountryStringMap::value_type("IO", tr("British Indian Ocean Territory"))); - countryStringMap.insert(CountryStringMap::value_type("BN", tr("Brunei Darussalam"))); - countryStringMap.insert(CountryStringMap::value_type("BG", tr("Bulgaria"))); - countryStringMap.insert(CountryStringMap::value_type("BF", tr("Burkina Faso"))); - countryStringMap.insert(CountryStringMap::value_type("BI", tr("Burundi"))); - countryStringMap.insert(CountryStringMap::value_type("KH", tr("Cambodia"))); - countryStringMap.insert(CountryStringMap::value_type("CM", tr("Cameroon"))); - countryStringMap.insert(CountryStringMap::value_type("CA", tr("Canada"))); - countryStringMap.insert(CountryStringMap::value_type("CV", tr("Cape Verde"))); - countryStringMap.insert(CountryStringMap::value_type("KY", tr("Cayman Islands"))); - countryStringMap.insert(CountryStringMap::value_type("CF", tr("Central African Republic"))); - countryStringMap.insert(CountryStringMap::value_type("TD", tr("Chad"))); - countryStringMap.insert(CountryStringMap::value_type("CL", tr("Chile"))); - countryStringMap.insert(CountryStringMap::value_type("CN", tr("China"))); - countryStringMap.insert(CountryStringMap::value_type("CX", tr("Christmas Island"))); - countryStringMap.insert(CountryStringMap::value_type("CC", tr("Cocos (Keeling) Islands"))); - countryStringMap.insert(CountryStringMap::value_type("CO", tr("Colombia"))); - countryStringMap.insert(CountryStringMap::value_type("KM", tr("Comoros"))); - countryStringMap.insert(CountryStringMap::value_type("CG", tr("Congo"))); - countryStringMap.insert(CountryStringMap::value_type("CD", tr("Congo, The Democratic Republic Of The"))); - countryStringMap.insert(CountryStringMap::value_type("CK", tr("Cook Islands"))); - countryStringMap.insert(CountryStringMap::value_type("CR", tr("Costa Rica"))); - countryStringMap.insert(CountryStringMap::value_type("CI", tr("Cote D'Ivoire"))); - countryStringMap.insert(CountryStringMap::value_type("HR", tr("Croatia"))); - countryStringMap.insert(CountryStringMap::value_type("CU", tr("Cuba"))); - countryStringMap.insert(CountryStringMap::value_type("CY", tr("Cyprus"))); - countryStringMap.insert(CountryStringMap::value_type("CZ", tr("Czech Republic"))); - countryStringMap.insert(CountryStringMap::value_type("DK", tr("Denmark"))); - countryStringMap.insert(CountryStringMap::value_type("DJ", tr("Djibouti"))); - countryStringMap.insert(CountryStringMap::value_type("DM", tr("Dominica"))); - countryStringMap.insert(CountryStringMap::value_type("DO", tr("Dominican Republic"))); - countryStringMap.insert(CountryStringMap::value_type("EC", tr("Ecuador"))); - countryStringMap.insert(CountryStringMap::value_type("EG", tr("Egypt"))); - countryStringMap.insert(CountryStringMap::value_type("SV", tr("El Salvador"))); - countryStringMap.insert(CountryStringMap::value_type("GQ", tr("Equatorial Guinea"))); - countryStringMap.insert(CountryStringMap::value_type("ER", tr("Eritrea"))); - countryStringMap.insert(CountryStringMap::value_type("EE", tr("Estonia"))); - countryStringMap.insert(CountryStringMap::value_type("ET", tr("Ethiopia"))); - countryStringMap.insert(CountryStringMap::value_type("FK", tr("Falkland Islands (Malvinas)"))); - countryStringMap.insert(CountryStringMap::value_type("FO", tr("Faroe Islands"))); - countryStringMap.insert(CountryStringMap::value_type("FJ", tr("Fiji"))); - countryStringMap.insert(CountryStringMap::value_type("FI", tr("Finland"))); - countryStringMap.insert(CountryStringMap::value_type("FR", tr("France"))); - countryStringMap.insert(CountryStringMap::value_type("GF", tr("French Guiana"))); - countryStringMap.insert(CountryStringMap::value_type("PF", tr("French Polynesia"))); - countryStringMap.insert(CountryStringMap::value_type("TF", tr("French Southern Territories"))); - countryStringMap.insert(CountryStringMap::value_type("GA", tr("Gabon"))); - countryStringMap.insert(CountryStringMap::value_type("GM", tr("Gambia"))); - countryStringMap.insert(CountryStringMap::value_type("GE", tr("Georgia"))); - countryStringMap.insert(CountryStringMap::value_type("DE", tr("Germany"))); - countryStringMap.insert(CountryStringMap::value_type("GH", tr("Ghana"))); - countryStringMap.insert(CountryStringMap::value_type("GI", tr("Gibraltar"))); - countryStringMap.insert(CountryStringMap::value_type("GR", tr("Greece"))); - countryStringMap.insert(CountryStringMap::value_type("GL", tr("Greenland"))); - countryStringMap.insert(CountryStringMap::value_type("GD", tr("Grenada"))); - countryStringMap.insert(CountryStringMap::value_type("GP", tr("Guadeloupe"))); - countryStringMap.insert(CountryStringMap::value_type("GU", tr("Guam"))); - countryStringMap.insert(CountryStringMap::value_type("GT", tr("Guatemala"))); - countryStringMap.insert(CountryStringMap::value_type("GG", tr("Guernsey"))); - countryStringMap.insert(CountryStringMap::value_type("GN", tr("Guinea"))); - countryStringMap.insert(CountryStringMap::value_type("GW", tr("Guinea-Bissau"))); - countryStringMap.insert(CountryStringMap::value_type("GY", tr("Guyana"))); - countryStringMap.insert(CountryStringMap::value_type("HT", tr("Haiti"))); - countryStringMap.insert(CountryStringMap::value_type("HM", tr("Heard Island And Mcdonald Islands"))); - countryStringMap.insert(CountryStringMap::value_type("VA", tr("Holy See (Vatican City State)"))); - countryStringMap.insert(CountryStringMap::value_type("HN", tr("Honduras"))); - countryStringMap.insert(CountryStringMap::value_type("HK", tr("Hong Kong"))); - countryStringMap.insert(CountryStringMap::value_type("HU", tr("Hungary"))); - countryStringMap.insert(CountryStringMap::value_type("IS", tr("Iceland"))); - countryStringMap.insert(CountryStringMap::value_type("IN", tr("India"))); - countryStringMap.insert(CountryStringMap::value_type("ID", tr("Indonesia"))); - countryStringMap.insert(CountryStringMap::value_type("IR", tr("Iran, Islamic Republic Of"))); - countryStringMap.insert(CountryStringMap::value_type("IQ", tr("Iraq"))); - countryStringMap.insert(CountryStringMap::value_type("IE", tr("Ireland"))); - countryStringMap.insert(CountryStringMap::value_type("IM", tr("Isle Of Man"))); - countryStringMap.insert(CountryStringMap::value_type("IL", tr("Israel"))); - countryStringMap.insert(CountryStringMap::value_type("IT", tr("Italy"))); - countryStringMap.insert(CountryStringMap::value_type("JM", tr("Jamaica"))); - countryStringMap.insert(CountryStringMap::value_type("JP", tr("Japan"))); - countryStringMap.insert(CountryStringMap::value_type("JE", tr("Jersey"))); - countryStringMap.insert(CountryStringMap::value_type("JO", tr("Jordan"))); - countryStringMap.insert(CountryStringMap::value_type("KZ", tr("Kazakhstan"))); - countryStringMap.insert(CountryStringMap::value_type("KE", tr("Kenya"))); - countryStringMap.insert(CountryStringMap::value_type("KI", tr("Kiribati"))); - countryStringMap.insert(CountryStringMap::value_type("KP", tr("Korea, Democratic People'S Republic Of"))); - countryStringMap.insert(CountryStringMap::value_type("KR", tr("Korea, Republic Of"))); - countryStringMap.insert(CountryStringMap::value_type("KW", tr("Kuwait"))); - countryStringMap.insert(CountryStringMap::value_type("KG", tr("Kyrgyzstan"))); - countryStringMap.insert(CountryStringMap::value_type("LA", tr("Lao People'S Democratic Republic"))); - countryStringMap.insert(CountryStringMap::value_type("LV", tr("Latvia"))); - countryStringMap.insert(CountryStringMap::value_type("LB", tr("Lebanon"))); - countryStringMap.insert(CountryStringMap::value_type("LS", tr("Lesotho"))); - countryStringMap.insert(CountryStringMap::value_type("LR", tr("Liberia"))); - countryStringMap.insert(CountryStringMap::value_type("LY", tr("Libyan Arab Jamahiriya"))); - countryStringMap.insert(CountryStringMap::value_type("LI", tr("Liechtenstein"))); - countryStringMap.insert(CountryStringMap::value_type("LT", tr("Lithuania"))); - countryStringMap.insert(CountryStringMap::value_type("LU", tr("Luxembourg"))); - countryStringMap.insert(CountryStringMap::value_type("MO", tr("Macao"))); - countryStringMap.insert(CountryStringMap::value_type("MK", tr("Macedonia, The Former Yugoslav Republic Of"))); - countryStringMap.insert(CountryStringMap::value_type("MG", tr("Madagascar"))); - countryStringMap.insert(CountryStringMap::value_type("MW", tr("Malawi"))); - countryStringMap.insert(CountryStringMap::value_type("MY", tr("Malaysia"))); - countryStringMap.insert(CountryStringMap::value_type("MV", tr("Maldives"))); - countryStringMap.insert(CountryStringMap::value_type("ML", tr("Mali"))); - countryStringMap.insert(CountryStringMap::value_type("MT", tr("Malta"))); - countryStringMap.insert(CountryStringMap::value_type("MH", tr("Marshall Islands"))); - countryStringMap.insert(CountryStringMap::value_type("MQ", tr("Martinique"))); - countryStringMap.insert(CountryStringMap::value_type("MR", tr("Mauritania"))); - countryStringMap.insert(CountryStringMap::value_type("MU", tr("Mauritius"))); - countryStringMap.insert(CountryStringMap::value_type("YT", tr("Mayotte"))); - countryStringMap.insert(CountryStringMap::value_type("MX", tr("Mexico"))); - countryStringMap.insert(CountryStringMap::value_type("FM", tr("Micronesia, Federated States Of"))); - countryStringMap.insert(CountryStringMap::value_type("MD", tr("Moldova, Republic Of"))); - countryStringMap.insert(CountryStringMap::value_type("MC", tr("Monaco"))); - countryStringMap.insert(CountryStringMap::value_type("MN", tr("Mongolia"))); - countryStringMap.insert(CountryStringMap::value_type("MS", tr("Montserrat"))); - countryStringMap.insert(CountryStringMap::value_type("MA", tr("Morocco"))); - countryStringMap.insert(CountryStringMap::value_type("MZ", tr("Mozambique"))); - countryStringMap.insert(CountryStringMap::value_type("MM", tr("Myanmar"))); - countryStringMap.insert(CountryStringMap::value_type("NA", tr("Namibia"))); - countryStringMap.insert(CountryStringMap::value_type("NR", tr("Nauru"))); - countryStringMap.insert(CountryStringMap::value_type("NP", tr("Nepal"))); - countryStringMap.insert(CountryStringMap::value_type("NL", tr("Netherlands"))); - countryStringMap.insert(CountryStringMap::value_type("AN", tr("Netherlands Antilles"))); - countryStringMap.insert(CountryStringMap::value_type("NC", tr("New Caledonia"))); - countryStringMap.insert(CountryStringMap::value_type("NZ", tr("New Zealand"))); - countryStringMap.insert(CountryStringMap::value_type("NI", tr("Nicaragua"))); - countryStringMap.insert(CountryStringMap::value_type("NE", tr("Niger"))); - countryStringMap.insert(CountryStringMap::value_type("NG", tr("Nigeria"))); - countryStringMap.insert(CountryStringMap::value_type("NU", tr("Niue"))); - countryStringMap.insert(CountryStringMap::value_type("NF", tr("Norfolk Island"))); - countryStringMap.insert(CountryStringMap::value_type("MP", tr("Northern Mariana Islands"))); - countryStringMap.insert(CountryStringMap::value_type("NO", tr("Norway"))); - countryStringMap.insert(CountryStringMap::value_type("OM", tr("Oman"))); - countryStringMap.insert(CountryStringMap::value_type("PK", tr("Pakistan"))); - countryStringMap.insert(CountryStringMap::value_type("PW", tr("Palau"))); - countryStringMap.insert(CountryStringMap::value_type("PS", tr("Palestinian Territory, Occupied"))); - countryStringMap.insert(CountryStringMap::value_type("PA", tr("Panama"))); - countryStringMap.insert(CountryStringMap::value_type("PG", tr("Papua New Guinea"))); - countryStringMap.insert(CountryStringMap::value_type("PY", tr("Paraguay"))); - countryStringMap.insert(CountryStringMap::value_type("PE", tr("Peru"))); - countryStringMap.insert(CountryStringMap::value_type("PH", tr("Philippines"))); - countryStringMap.insert(CountryStringMap::value_type("PN", tr("Pitcairn"))); - countryStringMap.insert(CountryStringMap::value_type("PL", tr("Poland"))); - countryStringMap.insert(CountryStringMap::value_type("PT", tr("Portugal"))); - countryStringMap.insert(CountryStringMap::value_type("PR", tr("Puerto Rico"))); - countryStringMap.insert(CountryStringMap::value_type("QA", tr("Qatar"))); - countryStringMap.insert(CountryStringMap::value_type("RE", tr("Reunion"))); - countryStringMap.insert(CountryStringMap::value_type("RO", tr("Romania"))); - countryStringMap.insert(CountryStringMap::value_type("RU", tr("Russian Federation"))); - countryStringMap.insert(CountryStringMap::value_type("RW", tr("Rwanda"))); - countryStringMap.insert(CountryStringMap::value_type("SH", tr("Saint Helena"))); - countryStringMap.insert(CountryStringMap::value_type("KN", tr("Saint Kitts And Nevis"))); - countryStringMap.insert(CountryStringMap::value_type("LC", tr("Saint Lucia"))); - countryStringMap.insert(CountryStringMap::value_type("PM", tr("Saint Pierre And Miquelon"))); - countryStringMap.insert(CountryStringMap::value_type("VC", tr("Saint Vincent And The Grenadines"))); - countryStringMap.insert(CountryStringMap::value_type("WS", tr("Samoa"))); - countryStringMap.insert(CountryStringMap::value_type("SM", tr("San Marino"))); - countryStringMap.insert(CountryStringMap::value_type("ST", tr("Sao Tome And Principe"))); - countryStringMap.insert(CountryStringMap::value_type("SA", tr("Saudi Arabia"))); - countryStringMap.insert(CountryStringMap::value_type("SN", tr("Senegal"))); - countryStringMap.insert(CountryStringMap::value_type("CS", tr("Serbia And Montenegro"))); - countryStringMap.insert(CountryStringMap::value_type("SC", tr("Seychelles"))); - countryStringMap.insert(CountryStringMap::value_type("SL", tr("Sierra Leone"))); - countryStringMap.insert(CountryStringMap::value_type("SG", tr("Singapore"))); - countryStringMap.insert(CountryStringMap::value_type("SK", tr("Slovakia"))); - countryStringMap.insert(CountryStringMap::value_type("SI", tr("Slovenia"))); - countryStringMap.insert(CountryStringMap::value_type("SB", tr("Solomon Islands"))); - countryStringMap.insert(CountryStringMap::value_type("SO", tr("Somalia"))); - countryStringMap.insert(CountryStringMap::value_type("ZA", tr("South Africa"))); - countryStringMap.insert(CountryStringMap::value_type("GS", tr("South Georgia And The South Sandwich Islands"))); - countryStringMap.insert(CountryStringMap::value_type("ES", tr("Spain"))); - countryStringMap.insert(CountryStringMap::value_type("LK", tr("Sri Lanka"))); - countryStringMap.insert(CountryStringMap::value_type("SD", tr("Sudan"))); - countryStringMap.insert(CountryStringMap::value_type("SR", tr("Suriname"))); - countryStringMap.insert(CountryStringMap::value_type("SJ", tr("Svalbard And Jan Mayen"))); - countryStringMap.insert(CountryStringMap::value_type("SZ", tr("Swaziland"))); - countryStringMap.insert(CountryStringMap::value_type("SE", tr("Sweden"))); - countryStringMap.insert(CountryStringMap::value_type("CH", tr("Switzerland"))); - countryStringMap.insert(CountryStringMap::value_type("SY", tr("Syrian Arab Republic"))); - countryStringMap.insert(CountryStringMap::value_type("TW", tr("Taiwan, Province Of China"))); - countryStringMap.insert(CountryStringMap::value_type("TJ", tr("Tajikistan"))); - countryStringMap.insert(CountryStringMap::value_type("TZ", tr("Tanzania, United Republic Of"))); - countryStringMap.insert(CountryStringMap::value_type("TH", tr("Thailand"))); - countryStringMap.insert(CountryStringMap::value_type("TL", tr("Timor-Leste"))); - countryStringMap.insert(CountryStringMap::value_type("TG", tr("Togo"))); - countryStringMap.insert(CountryStringMap::value_type("TK", tr("Tokelau"))); - countryStringMap.insert(CountryStringMap::value_type("TO", tr("Tonga"))); - countryStringMap.insert(CountryStringMap::value_type("TT", tr("Trinidad And Tobago"))); - countryStringMap.insert(CountryStringMap::value_type("TN", tr("Tunisia"))); - countryStringMap.insert(CountryStringMap::value_type("TR", tr("Turkey"))); - countryStringMap.insert(CountryStringMap::value_type("TM", tr("Turkmenistan"))); - countryStringMap.insert(CountryStringMap::value_type("TC", tr("Turks And Caicos Islands"))); - countryStringMap.insert(CountryStringMap::value_type("TV", tr("Tuvalu"))); - countryStringMap.insert(CountryStringMap::value_type("UG", tr("Uganda"))); - countryStringMap.insert(CountryStringMap::value_type("UA", tr("Ukraine"))); - countryStringMap.insert(CountryStringMap::value_type("AE", tr("United Arab Emirates"))); - countryStringMap.insert(CountryStringMap::value_type("GB", tr("United Kingdom"))); - countryStringMap.insert(CountryStringMap::value_type("US", tr("United States"))); - countryStringMap.insert(CountryStringMap::value_type("UM", tr("United States Minor Outlying Islands"))); - countryStringMap.insert(CountryStringMap::value_type("UY", tr("Uruguay"))); - countryStringMap.insert(CountryStringMap::value_type("UZ", tr("Uzbekistan"))); - countryStringMap.insert(CountryStringMap::value_type("VU", tr("Vanuatu"))); - countryStringMap.insert(CountryStringMap::value_type("VE", tr("Venezuela"))); - countryStringMap.insert(CountryStringMap::value_type("VN", tr("Viet Nam"))); - countryStringMap.insert(CountryStringMap::value_type("VG", tr("Virgin Islands, British"))); - countryStringMap.insert(CountryStringMap::value_type("VI", tr("Virgin Islands, U.S."))); - countryStringMap.insert(CountryStringMap::value_type("WF", tr("Wallis And Futuna"))); - countryStringMap.insert(CountryStringMap::value_type("EH", tr("Western Sahara"))); - countryStringMap.insert(CountryStringMap::value_type("YE", tr("Yemen"))); - countryStringMap.insert(CountryStringMap::value_type("ZM", tr("Zambia"))); - countryStringMap.insert(CountryStringMap::value_type("ZW", tr("Zimbabwe"))); - } + // Initialise map of country strings, if needed. + if (countryStringMap.empty()) { + countryStringMap.insert(CountryStringMap::value_type("AF", tr("Afghanistan"))); + countryStringMap.insert(CountryStringMap::value_type("AX", tr("ALand Islands"))); + countryStringMap.insert(CountryStringMap::value_type("AL", tr("Albania"))); + countryStringMap.insert(CountryStringMap::value_type("DZ", tr("Algeria"))); + countryStringMap.insert(CountryStringMap::value_type("AS", tr("American Samoa"))); + countryStringMap.insert(CountryStringMap::value_type("AD", tr("Andorra"))); + countryStringMap.insert(CountryStringMap::value_type("AO", tr("Angola"))); + countryStringMap.insert(CountryStringMap::value_type("AI", tr("Anguilla"))); + countryStringMap.insert(CountryStringMap::value_type("AQ", tr("Antarctica"))); + countryStringMap.insert(CountryStringMap::value_type("AG", tr("Antigua And Barbuda"))); + countryStringMap.insert(CountryStringMap::value_type("AR", tr("Argentina"))); + countryStringMap.insert(CountryStringMap::value_type("AM", tr("Armenia"))); + countryStringMap.insert(CountryStringMap::value_type("AW", tr("Aruba"))); + countryStringMap.insert(CountryStringMap::value_type("AU", tr("Australia"))); + countryStringMap.insert(CountryStringMap::value_type("AT", tr("Austria"))); + countryStringMap.insert(CountryStringMap::value_type("AZ", tr("Azerbaijan"))); + countryStringMap.insert(CountryStringMap::value_type("BS", tr("Bahamas"))); + countryStringMap.insert(CountryStringMap::value_type("BH", tr("Bahrain"))); + countryStringMap.insert(CountryStringMap::value_type("BD", tr("Bangladesh"))); + countryStringMap.insert(CountryStringMap::value_type("BB", tr("Barbados"))); + countryStringMap.insert(CountryStringMap::value_type("BY", tr("Belarus"))); + countryStringMap.insert(CountryStringMap::value_type("BE", tr("Belgium"))); + countryStringMap.insert(CountryStringMap::value_type("BZ", tr("Belize"))); + countryStringMap.insert(CountryStringMap::value_type("BJ", tr("Benin"))); + countryStringMap.insert(CountryStringMap::value_type("BM", tr("Bermuda"))); + countryStringMap.insert(CountryStringMap::value_type("BT", tr("Bhutan"))); + countryStringMap.insert(CountryStringMap::value_type("BO", tr("Bolivia"))); + countryStringMap.insert(CountryStringMap::value_type("BA", tr("Bosnia And Herzegovina"))); + countryStringMap.insert(CountryStringMap::value_type("BW", tr("Botswana"))); + countryStringMap.insert(CountryStringMap::value_type("BV", tr("Bouvet Island"))); + countryStringMap.insert(CountryStringMap::value_type("BR", tr("Brazil"))); + countryStringMap.insert(CountryStringMap::value_type("IO", tr("British Indian Ocean Territory"))); + countryStringMap.insert(CountryStringMap::value_type("BN", tr("Brunei Darussalam"))); + countryStringMap.insert(CountryStringMap::value_type("BG", tr("Bulgaria"))); + countryStringMap.insert(CountryStringMap::value_type("BF", tr("Burkina Faso"))); + countryStringMap.insert(CountryStringMap::value_type("BI", tr("Burundi"))); + countryStringMap.insert(CountryStringMap::value_type("KH", tr("Cambodia"))); + countryStringMap.insert(CountryStringMap::value_type("CM", tr("Cameroon"))); + countryStringMap.insert(CountryStringMap::value_type("CA", tr("Canada"))); + countryStringMap.insert(CountryStringMap::value_type("CV", tr("Cape Verde"))); + countryStringMap.insert(CountryStringMap::value_type("KY", tr("Cayman Islands"))); + countryStringMap.insert(CountryStringMap::value_type("CF", tr("Central African Republic"))); + countryStringMap.insert(CountryStringMap::value_type("TD", tr("Chad"))); + countryStringMap.insert(CountryStringMap::value_type("CL", tr("Chile"))); + countryStringMap.insert(CountryStringMap::value_type("CN", tr("China"))); + countryStringMap.insert(CountryStringMap::value_type("CX", tr("Christmas Island"))); + countryStringMap.insert(CountryStringMap::value_type("CC", tr("Cocos (Keeling) Islands"))); + countryStringMap.insert(CountryStringMap::value_type("CO", tr("Colombia"))); + countryStringMap.insert(CountryStringMap::value_type("KM", tr("Comoros"))); + countryStringMap.insert(CountryStringMap::value_type("CG", tr("Congo"))); + countryStringMap.insert(CountryStringMap::value_type("CD", tr("Congo, The Democratic Republic Of The"))); + countryStringMap.insert(CountryStringMap::value_type("CK", tr("Cook Islands"))); + countryStringMap.insert(CountryStringMap::value_type("CR", tr("Costa Rica"))); + countryStringMap.insert(CountryStringMap::value_type("CI", tr("Cote D'Ivoire"))); + countryStringMap.insert(CountryStringMap::value_type("HR", tr("Croatia"))); + countryStringMap.insert(CountryStringMap::value_type("CU", tr("Cuba"))); + countryStringMap.insert(CountryStringMap::value_type("CY", tr("Cyprus"))); + countryStringMap.insert(CountryStringMap::value_type("CZ", tr("Czech Republic"))); + countryStringMap.insert(CountryStringMap::value_type("DK", tr("Denmark"))); + countryStringMap.insert(CountryStringMap::value_type("DJ", tr("Djibouti"))); + countryStringMap.insert(CountryStringMap::value_type("DM", tr("Dominica"))); + countryStringMap.insert(CountryStringMap::value_type("DO", tr("Dominican Republic"))); + countryStringMap.insert(CountryStringMap::value_type("EC", tr("Ecuador"))); + countryStringMap.insert(CountryStringMap::value_type("EG", tr("Egypt"))); + countryStringMap.insert(CountryStringMap::value_type("SV", tr("El Salvador"))); + countryStringMap.insert(CountryStringMap::value_type("GQ", tr("Equatorial Guinea"))); + countryStringMap.insert(CountryStringMap::value_type("ER", tr("Eritrea"))); + countryStringMap.insert(CountryStringMap::value_type("EE", tr("Estonia"))); + countryStringMap.insert(CountryStringMap::value_type("ET", tr("Ethiopia"))); + countryStringMap.insert(CountryStringMap::value_type("FK", tr("Falkland Islands (Malvinas)"))); + countryStringMap.insert(CountryStringMap::value_type("FO", tr("Faroe Islands"))); + countryStringMap.insert(CountryStringMap::value_type("FJ", tr("Fiji"))); + countryStringMap.insert(CountryStringMap::value_type("FI", tr("Finland"))); + countryStringMap.insert(CountryStringMap::value_type("FR", tr("France"))); + countryStringMap.insert(CountryStringMap::value_type("GF", tr("French Guiana"))); + countryStringMap.insert(CountryStringMap::value_type("PF", tr("French Polynesia"))); + countryStringMap.insert(CountryStringMap::value_type("TF", tr("French Southern Territories"))); + countryStringMap.insert(CountryStringMap::value_type("GA", tr("Gabon"))); + countryStringMap.insert(CountryStringMap::value_type("GM", tr("Gambia"))); + countryStringMap.insert(CountryStringMap::value_type("GE", tr("Georgia"))); + countryStringMap.insert(CountryStringMap::value_type("DE", tr("Germany"))); + countryStringMap.insert(CountryStringMap::value_type("GH", tr("Ghana"))); + countryStringMap.insert(CountryStringMap::value_type("GI", tr("Gibraltar"))); + countryStringMap.insert(CountryStringMap::value_type("GR", tr("Greece"))); + countryStringMap.insert(CountryStringMap::value_type("GL", tr("Greenland"))); + countryStringMap.insert(CountryStringMap::value_type("GD", tr("Grenada"))); + countryStringMap.insert(CountryStringMap::value_type("GP", tr("Guadeloupe"))); + countryStringMap.insert(CountryStringMap::value_type("GU", tr("Guam"))); + countryStringMap.insert(CountryStringMap::value_type("GT", tr("Guatemala"))); + countryStringMap.insert(CountryStringMap::value_type("GG", tr("Guernsey"))); + countryStringMap.insert(CountryStringMap::value_type("GN", tr("Guinea"))); + countryStringMap.insert(CountryStringMap::value_type("GW", tr("Guinea-Bissau"))); + countryStringMap.insert(CountryStringMap::value_type("GY", tr("Guyana"))); + countryStringMap.insert(CountryStringMap::value_type("HT", tr("Haiti"))); + countryStringMap.insert(CountryStringMap::value_type("HM", tr("Heard Island And Mcdonald Islands"))); + countryStringMap.insert(CountryStringMap::value_type("VA", tr("Holy See (Vatican City State)"))); + countryStringMap.insert(CountryStringMap::value_type("HN", tr("Honduras"))); + countryStringMap.insert(CountryStringMap::value_type("HK", tr("Hong Kong"))); + countryStringMap.insert(CountryStringMap::value_type("HU", tr("Hungary"))); + countryStringMap.insert(CountryStringMap::value_type("IS", tr("Iceland"))); + countryStringMap.insert(CountryStringMap::value_type("IN", tr("India"))); + countryStringMap.insert(CountryStringMap::value_type("ID", tr("Indonesia"))); + countryStringMap.insert(CountryStringMap::value_type("IR", tr("Iran, Islamic Republic Of"))); + countryStringMap.insert(CountryStringMap::value_type("IQ", tr("Iraq"))); + countryStringMap.insert(CountryStringMap::value_type("IE", tr("Ireland"))); + countryStringMap.insert(CountryStringMap::value_type("IM", tr("Isle Of Man"))); + countryStringMap.insert(CountryStringMap::value_type("IL", tr("Israel"))); + countryStringMap.insert(CountryStringMap::value_type("IT", tr("Italy"))); + countryStringMap.insert(CountryStringMap::value_type("JM", tr("Jamaica"))); + countryStringMap.insert(CountryStringMap::value_type("JP", tr("Japan"))); + countryStringMap.insert(CountryStringMap::value_type("JE", tr("Jersey"))); + countryStringMap.insert(CountryStringMap::value_type("JO", tr("Jordan"))); + countryStringMap.insert(CountryStringMap::value_type("KZ", tr("Kazakhstan"))); + countryStringMap.insert(CountryStringMap::value_type("KE", tr("Kenya"))); + countryStringMap.insert(CountryStringMap::value_type("KI", tr("Kiribati"))); + countryStringMap.insert(CountryStringMap::value_type("KP", tr("Korea, Democratic People'S Republic Of"))); + countryStringMap.insert(CountryStringMap::value_type("KR", tr("Korea, Republic Of"))); + countryStringMap.insert(CountryStringMap::value_type("KW", tr("Kuwait"))); + countryStringMap.insert(CountryStringMap::value_type("KG", tr("Kyrgyzstan"))); + countryStringMap.insert(CountryStringMap::value_type("LA", tr("Lao People'S Democratic Republic"))); + countryStringMap.insert(CountryStringMap::value_type("LV", tr("Latvia"))); + countryStringMap.insert(CountryStringMap::value_type("LB", tr("Lebanon"))); + countryStringMap.insert(CountryStringMap::value_type("LS", tr("Lesotho"))); + countryStringMap.insert(CountryStringMap::value_type("LR", tr("Liberia"))); + countryStringMap.insert(CountryStringMap::value_type("LY", tr("Libyan Arab Jamahiriya"))); + countryStringMap.insert(CountryStringMap::value_type("LI", tr("Liechtenstein"))); + countryStringMap.insert(CountryStringMap::value_type("LT", tr("Lithuania"))); + countryStringMap.insert(CountryStringMap::value_type("LU", tr("Luxembourg"))); + countryStringMap.insert(CountryStringMap::value_type("MO", tr("Macao"))); + countryStringMap.insert(CountryStringMap::value_type("MK", tr("Macedonia, The Former Yugoslav Republic Of"))); + countryStringMap.insert(CountryStringMap::value_type("MG", tr("Madagascar"))); + countryStringMap.insert(CountryStringMap::value_type("MW", tr("Malawi"))); + countryStringMap.insert(CountryStringMap::value_type("MY", tr("Malaysia"))); + countryStringMap.insert(CountryStringMap::value_type("MV", tr("Maldives"))); + countryStringMap.insert(CountryStringMap::value_type("ML", tr("Mali"))); + countryStringMap.insert(CountryStringMap::value_type("MT", tr("Malta"))); + countryStringMap.insert(CountryStringMap::value_type("MH", tr("Marshall Islands"))); + countryStringMap.insert(CountryStringMap::value_type("MQ", tr("Martinique"))); + countryStringMap.insert(CountryStringMap::value_type("MR", tr("Mauritania"))); + countryStringMap.insert(CountryStringMap::value_type("MU", tr("Mauritius"))); + countryStringMap.insert(CountryStringMap::value_type("YT", tr("Mayotte"))); + countryStringMap.insert(CountryStringMap::value_type("MX", tr("Mexico"))); + countryStringMap.insert(CountryStringMap::value_type("FM", tr("Micronesia, Federated States Of"))); + countryStringMap.insert(CountryStringMap::value_type("MD", tr("Moldova, Republic Of"))); + countryStringMap.insert(CountryStringMap::value_type("MC", tr("Monaco"))); + countryStringMap.insert(CountryStringMap::value_type("MN", tr("Mongolia"))); + countryStringMap.insert(CountryStringMap::value_type("MS", tr("Montserrat"))); + countryStringMap.insert(CountryStringMap::value_type("MA", tr("Morocco"))); + countryStringMap.insert(CountryStringMap::value_type("MZ", tr("Mozambique"))); + countryStringMap.insert(CountryStringMap::value_type("MM", tr("Myanmar"))); + countryStringMap.insert(CountryStringMap::value_type("NA", tr("Namibia"))); + countryStringMap.insert(CountryStringMap::value_type("NR", tr("Nauru"))); + countryStringMap.insert(CountryStringMap::value_type("NP", tr("Nepal"))); + countryStringMap.insert(CountryStringMap::value_type("NL", tr("Netherlands"))); + countryStringMap.insert(CountryStringMap::value_type("AN", tr("Netherlands Antilles"))); + countryStringMap.insert(CountryStringMap::value_type("NC", tr("New Caledonia"))); + countryStringMap.insert(CountryStringMap::value_type("NZ", tr("New Zealand"))); + countryStringMap.insert(CountryStringMap::value_type("NI", tr("Nicaragua"))); + countryStringMap.insert(CountryStringMap::value_type("NE", tr("Niger"))); + countryStringMap.insert(CountryStringMap::value_type("NG", tr("Nigeria"))); + countryStringMap.insert(CountryStringMap::value_type("NU", tr("Niue"))); + countryStringMap.insert(CountryStringMap::value_type("NF", tr("Norfolk Island"))); + countryStringMap.insert(CountryStringMap::value_type("MP", tr("Northern Mariana Islands"))); + countryStringMap.insert(CountryStringMap::value_type("NO", tr("Norway"))); + countryStringMap.insert(CountryStringMap::value_type("OM", tr("Oman"))); + countryStringMap.insert(CountryStringMap::value_type("PK", tr("Pakistan"))); + countryStringMap.insert(CountryStringMap::value_type("PW", tr("Palau"))); + countryStringMap.insert(CountryStringMap::value_type("PS", tr("Palestinian Territory, Occupied"))); + countryStringMap.insert(CountryStringMap::value_type("PA", tr("Panama"))); + countryStringMap.insert(CountryStringMap::value_type("PG", tr("Papua New Guinea"))); + countryStringMap.insert(CountryStringMap::value_type("PY", tr("Paraguay"))); + countryStringMap.insert(CountryStringMap::value_type("PE", tr("Peru"))); + countryStringMap.insert(CountryStringMap::value_type("PH", tr("Philippines"))); + countryStringMap.insert(CountryStringMap::value_type("PN", tr("Pitcairn"))); + countryStringMap.insert(CountryStringMap::value_type("PL", tr("Poland"))); + countryStringMap.insert(CountryStringMap::value_type("PT", tr("Portugal"))); + countryStringMap.insert(CountryStringMap::value_type("PR", tr("Puerto Rico"))); + countryStringMap.insert(CountryStringMap::value_type("QA", tr("Qatar"))); + countryStringMap.insert(CountryStringMap::value_type("RE", tr("Reunion"))); + countryStringMap.insert(CountryStringMap::value_type("RO", tr("Romania"))); + countryStringMap.insert(CountryStringMap::value_type("RU", tr("Russian Federation"))); + countryStringMap.insert(CountryStringMap::value_type("RW", tr("Rwanda"))); + countryStringMap.insert(CountryStringMap::value_type("SH", tr("Saint Helena"))); + countryStringMap.insert(CountryStringMap::value_type("KN", tr("Saint Kitts And Nevis"))); + countryStringMap.insert(CountryStringMap::value_type("LC", tr("Saint Lucia"))); + countryStringMap.insert(CountryStringMap::value_type("PM", tr("Saint Pierre And Miquelon"))); + countryStringMap.insert(CountryStringMap::value_type("VC", tr("Saint Vincent And The Grenadines"))); + countryStringMap.insert(CountryStringMap::value_type("WS", tr("Samoa"))); + countryStringMap.insert(CountryStringMap::value_type("SM", tr("San Marino"))); + countryStringMap.insert(CountryStringMap::value_type("ST", tr("Sao Tome And Principe"))); + countryStringMap.insert(CountryStringMap::value_type("SA", tr("Saudi Arabia"))); + countryStringMap.insert(CountryStringMap::value_type("SN", tr("Senegal"))); + countryStringMap.insert(CountryStringMap::value_type("CS", tr("Serbia And Montenegro"))); + countryStringMap.insert(CountryStringMap::value_type("SC", tr("Seychelles"))); + countryStringMap.insert(CountryStringMap::value_type("SL", tr("Sierra Leone"))); + countryStringMap.insert(CountryStringMap::value_type("SG", tr("Singapore"))); + countryStringMap.insert(CountryStringMap::value_type("SK", tr("Slovakia"))); + countryStringMap.insert(CountryStringMap::value_type("SI", tr("Slovenia"))); + countryStringMap.insert(CountryStringMap::value_type("SB", tr("Solomon Islands"))); + countryStringMap.insert(CountryStringMap::value_type("SO", tr("Somalia"))); + countryStringMap.insert(CountryStringMap::value_type("ZA", tr("South Africa"))); + countryStringMap.insert(CountryStringMap::value_type("GS", tr("South Georgia And The South Sandwich Islands"))); + countryStringMap.insert(CountryStringMap::value_type("ES", tr("Spain"))); + countryStringMap.insert(CountryStringMap::value_type("LK", tr("Sri Lanka"))); + countryStringMap.insert(CountryStringMap::value_type("SD", tr("Sudan"))); + countryStringMap.insert(CountryStringMap::value_type("SR", tr("Suriname"))); + countryStringMap.insert(CountryStringMap::value_type("SJ", tr("Svalbard And Jan Mayen"))); + countryStringMap.insert(CountryStringMap::value_type("SZ", tr("Swaziland"))); + countryStringMap.insert(CountryStringMap::value_type("SE", tr("Sweden"))); + countryStringMap.insert(CountryStringMap::value_type("CH", tr("Switzerland"))); + countryStringMap.insert(CountryStringMap::value_type("SY", tr("Syrian Arab Republic"))); + countryStringMap.insert(CountryStringMap::value_type("TW", tr("Taiwan, Province Of China"))); + countryStringMap.insert(CountryStringMap::value_type("TJ", tr("Tajikistan"))); + countryStringMap.insert(CountryStringMap::value_type("TZ", tr("Tanzania, United Republic Of"))); + countryStringMap.insert(CountryStringMap::value_type("TH", tr("Thailand"))); + countryStringMap.insert(CountryStringMap::value_type("TL", tr("Timor-Leste"))); + countryStringMap.insert(CountryStringMap::value_type("TG", tr("Togo"))); + countryStringMap.insert(CountryStringMap::value_type("TK", tr("Tokelau"))); + countryStringMap.insert(CountryStringMap::value_type("TO", tr("Tonga"))); + countryStringMap.insert(CountryStringMap::value_type("TT", tr("Trinidad And Tobago"))); + countryStringMap.insert(CountryStringMap::value_type("TN", tr("Tunisia"))); + countryStringMap.insert(CountryStringMap::value_type("TR", tr("Turkey"))); + countryStringMap.insert(CountryStringMap::value_type("TM", tr("Turkmenistan"))); + countryStringMap.insert(CountryStringMap::value_type("TC", tr("Turks And Caicos Islands"))); + countryStringMap.insert(CountryStringMap::value_type("TV", tr("Tuvalu"))); + countryStringMap.insert(CountryStringMap::value_type("UG", tr("Uganda"))); + countryStringMap.insert(CountryStringMap::value_type("UA", tr("Ukraine"))); + countryStringMap.insert(CountryStringMap::value_type("AE", tr("United Arab Emirates"))); + countryStringMap.insert(CountryStringMap::value_type("GB", tr("United Kingdom"))); + countryStringMap.insert(CountryStringMap::value_type("US", tr("United States"))); + countryStringMap.insert(CountryStringMap::value_type("UM", tr("United States Minor Outlying Islands"))); + countryStringMap.insert(CountryStringMap::value_type("UY", tr("Uruguay"))); + countryStringMap.insert(CountryStringMap::value_type("UZ", tr("Uzbekistan"))); + countryStringMap.insert(CountryStringMap::value_type("VU", tr("Vanuatu"))); + countryStringMap.insert(CountryStringMap::value_type("VE", tr("Venezuela"))); + countryStringMap.insert(CountryStringMap::value_type("VN", tr("Viet Nam"))); + countryStringMap.insert(CountryStringMap::value_type("VG", tr("Virgin Islands, British"))); + countryStringMap.insert(CountryStringMap::value_type("VI", tr("Virgin Islands, U.S."))); + countryStringMap.insert(CountryStringMap::value_type("WF", tr("Wallis And Futuna"))); + countryStringMap.insert(CountryStringMap::value_type("EH", tr("Western Sahara"))); + countryStringMap.insert(CountryStringMap::value_type("YE", tr("Yemen"))); + countryStringMap.insert(CountryStringMap::value_type("ZM", tr("Zambia"))); + countryStringMap.insert(CountryStringMap::value_type("ZW", tr("Zimbabwe"))); + } - QString fullString(""); - if(!cs.isEmpty()) { - CountryStringMap::const_iterator pos = countryStringMap.find(cs); - if (pos != countryStringMap.end()) { - fullString = pos->second; - } - } - return fullString; + QString fullString(""); + if(!cs.isEmpty()) { + CountryStringMap::const_iterator pos = countryStringMap.find(cs); + if (pos != countryStringMap.end()) { + fullString = pos->second; + } + } + return fullString; } void gameLobbyDialogImpl::stopWaitStartGameMsgBoxTimer() { - waitStartGameMsgBoxTimer->stop(); + waitStartGameMsgBoxTimer->stop(); } void gameLobbyDialogImpl::closeAllChildDialogs() { - inviteOnlyInfoMsgBox->hide(); - waitStartGameMsgBox->hide(); - waitRejoinStartGameMsgBox->hide(); + inviteOnlyInfoMsgBox->hide(); + waitStartGameMsgBox->hide(); + waitRejoinStartGameMsgBox->hide(); } void gameLobbyDialogImpl::reportBadGameName() { - assert(mySession); - QItemSelectionModel *selection = treeView_GameList->selectionModel(); - if (selection->hasSelection()) { - unsigned gameId = selection->selectedRows().first().data(Qt::UserRole).toUInt(); - GameInfo info(mySession->getClientGameInfo(gameId)); + assert(mySession); + QItemSelectionModel *selection = treeView_GameList->selectionModel(); + if (selection->hasSelection()) { + unsigned gameId = selection->selectedRows().first().data(Qt::UserRole).toUInt(); + GameInfo info(mySession->getClientGameInfo(gameId)); - int ret = MyMessageBox::question(this, tr("PokerTH - Question"), - tr("Are you sure you want to report the game name:\n\"%1\" as inappropriate?").arg(QString::fromUtf8(info.name.c_str())), QMessageBox::Yes | QMessageBox::No); + int ret = MyMessageBox::question(this, tr("PokerTH - Question"), + tr("Are you sure you want to report the game name:\n\"%1\" as inappropriate?").arg(QString::fromUtf8(info.name.c_str())), QMessageBox::Yes | QMessageBox::No); - if(ret == QMessageBox::Yes) { - mySession->reportBadGameName(gameId); - } - } + if(ret == QMessageBox::Yes) { + mySession->reportBadGameName(gameId); + } + } } diff --git a/src/gui/qt/gamelobbydialog/gamelobbydialogimpl.h b/src/gui/qt/gamelobbydialog/gamelobbydialogimpl.h index 7122b42c..7ef39709 100644 --- a/src/gui/qt/gamelobbydialog/gamelobbydialogimpl.h +++ b/src/gui/qt/gamelobbydialog/gamelobbydialogimpl.h @@ -164,8 +164,8 @@ private: CountryStringMap countryStringMap; QString myAppDataPath; - MyMessageBox *waitStartGameMsgBox; - MyMessageBox *waitRejoinStartGameMsgBox; + MyMessageBox *waitStartGameMsgBox; + MyMessageBox *waitRejoinStartGameMsgBox; myMessageDialogImpl *inviteOnlyInfoMsgBox; QTimer *waitStartGameMsgBoxTimer; QTimer *blinkingButtonAnimationTimer; diff --git a/src/gui/qt/gamelobbydialog/mygamelistsortfilterproxymodel.cpp b/src/gui/qt/gamelobbydialog/mygamelistsortfilterproxymodel.cpp index 485f8e29..154031bf 100644 --- a/src/gui/qt/gamelobbydialog/mygamelistsortfilterproxymodel.cpp +++ b/src/gui/qt/gamelobbydialog/mygamelistsortfilterproxymodel.cpp @@ -20,40 +20,40 @@ #include MyGameListSortFilterProxyModel::MyGameListSortFilterProxyModel(QObject *parent) - : QSortFilterProxyModel(parent) + : QSortFilterProxyModel(parent) { } bool MyGameListSortFilterProxyModel::filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const { - QModelIndex index0 = sourceModel()->index(sourceRow, 0, sourceParent); - QModelIndex index1 = sourceModel()->index(sourceRow, 1, sourceParent); - QModelIndex index2 = sourceModel()->index(sourceRow, 2, sourceParent); - QModelIndex index3 = sourceModel()->index(sourceRow, 3, sourceParent); - QModelIndex index4 = sourceModel()->index(sourceRow, 4, sourceParent); - QModelIndex index5 = sourceModel()->index(sourceRow, 5, sourceParent); + QModelIndex index0 = sourceModel()->index(sourceRow, 0, sourceParent); + QModelIndex index1 = sourceModel()->index(sourceRow, 1, sourceParent); + QModelIndex index2 = sourceModel()->index(sourceRow, 2, sourceParent); + QModelIndex index3 = sourceModel()->index(sourceRow, 3, sourceParent); + QModelIndex index4 = sourceModel()->index(sourceRow, 4, sourceParent); + QModelIndex index5 = sourceModel()->index(sourceRow, 5, sourceParent); - return ((sourceModel()->data(index1, 16).toString().contains(column1RegExp) - && sourceModel()->data(index2, 16).toString().contains(column2RegExp) - && sourceModel()->data(index3, 16).toString().contains(column3RegExp) - && sourceModel()->data(index4, 16).toString().contains(column4RegExp) - && sourceModel()->data(index5, 16).toString().contains(column5RegExp)) || sourceModel()->data(index0, 16) == "MeInThisGame"); + return ((sourceModel()->data(index1, 16).toString().contains(column1RegExp) + && sourceModel()->data(index2, 16).toString().contains(column2RegExp) + && sourceModel()->data(index3, 16).toString().contains(column3RegExp) + && sourceModel()->data(index4, 16).toString().contains(column4RegExp) + && sourceModel()->data(index5, 16).toString().contains(column5RegExp)) || sourceModel()->data(index0, 16) == "MeInThisGame"); } bool MyGameListSortFilterProxyModel::lessThan(const QModelIndex &left, const QModelIndex &right) const { - switch(sortColumn()) { + switch(sortColumn()) { - case 5: { - return sourceModel()->data(left, 16).toString() < sourceModel()->data(right, 16).toString(); - } - break; - default: { - return QSortFilterProxyModel::lessThan(left, right); - } - break; - } + case 5: { + return sourceModel()->data(left, 16).toString() < sourceModel()->data(right, 16).toString(); + } + break; + default: { + return QSortFilterProxyModel::lessThan(left, right); + } + break; + } - return false; + return false; } diff --git a/src/gui/qt/gamelobbydialog/mygamelistsortfilterproxymodel.h b/src/gui/qt/gamelobbydialog/mygamelistsortfilterproxymodel.h index 0aad271e..c2b4bf87 100644 --- a/src/gui/qt/gamelobbydialog/mygamelistsortfilterproxymodel.h +++ b/src/gui/qt/gamelobbydialog/mygamelistsortfilterproxymodel.h @@ -38,20 +38,20 @@ public: void setColumn4RegExp(QRegExp column4) { column4RegExp = column4; } - void setColumn5RegExp(QRegExp column5) { - column5RegExp = column5; - } + void setColumn5RegExp(QRegExp column5) { + column5RegExp = column5; + } protected: bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const; - bool lessThan(const QModelIndex &left, const QModelIndex &right) const; + bool lessThan(const QModelIndex &left, const QModelIndex &right) const; private: QRegExp column1RegExp; QRegExp column2RegExp; QRegExp column3RegExp; QRegExp column4RegExp; - QRegExp column5RegExp; + QRegExp column5RegExp; }; diff --git a/src/gui/qt/gametable/gametableimpl.cpp b/src/gui/qt/gametable/gametableimpl.cpp index 9b33cc63..cc232a24 100755 --- a/src/gui/qt/gametable/gametableimpl.cpp +++ b/src/gui/qt/gametable/gametableimpl.cpp @@ -74,7 +74,7 @@ gameTableImpl::gameTableImpl(ConfigFile *c, QMainWindow *parent) setupUi(this); - //Sound + //Sound mySoundEventHandler = new SoundEvents(myConfig); // Init game table style @@ -92,10 +92,10 @@ gameTableImpl::gameTableImpl(ConfigFile *c, QMainWindow *parent) //set myStyle to widgets wich needs it #ifdef GUI_800x480 tabsDiag = new QDialog(this); - tabs.setupUi(tabsDiag); + tabs.setupUi(tabsDiag); textLabel_handLabel->hide(); #ifdef ANDROID - tabsDiag->setStyleSheet("QObject { font: 26px; } QDialog { background-image: url(:/android/android-data/gfx/gui/table/default_800x480/table_dark.png); background-position: bottom center; background-origin: content; background-repeat: no-repeat;}"); + tabsDiag->setStyleSheet("QObject { font: 26px; } QDialog { background-image: url(:/android/android-data/gfx/gui/table/default_800x480/table_dark.png); background-position: bottom center; background-origin: content; background-repeat: no-repeat;}"); #endif tabs.label_chance->setMyStyle(myGameTableStyle); #else @@ -303,13 +303,13 @@ gameTableImpl::gameTableImpl(ConfigFile *c, QMainWindow *parent) playerTipLabelArray[9] = label_playerTip9; #ifdef GUI_800x480 - int j; - for (i=0; ihide(); - } - playerTipLabelArray[i]->hide(); - } + int j; + for (i=0; ihide(); + } + playerTipLabelArray[i]->hide(); + } #endif @@ -389,8 +389,8 @@ gameTableImpl::gameTableImpl(ConfigFile *c, QMainWindow *parent) textLabel_Status0->setMyW(this); - //check position depending on card deck type - checkActionLabelPosition(); + //check position depending on card deck type + checkActionLabelPosition(); // GroupBoxArray init @@ -496,12 +496,12 @@ gameTableImpl::gameTableImpl(ConfigFile *c, QMainWindow *parent) // Dialogs #ifdef GUI_800x480 myChat = new ChatTools(tabs.lineEdit_ChatInput, myConfig, INGAME_CHAT, tabs.textBrowser_Chat); - myChat->setMyStyle(myGameTableStyle); - tabs.lineEdit_ChatInput->installEventFilter(this); + myChat->setMyStyle(myGameTableStyle); + tabs.lineEdit_ChatInput->installEventFilter(this); #else myChat = new ChatTools(lineEdit_ChatInput, myConfig, INGAME_CHAT, textBrowser_Chat); - myChat->setMyStyle(myGameTableStyle); - lineEdit_ChatInput->installEventFilter(this); + myChat->setMyStyle(myGameTableStyle); + lineEdit_ChatInput->installEventFilter(this); #endif this->installEventFilter(this); @@ -510,10 +510,10 @@ gameTableImpl::gameTableImpl(ConfigFile *c, QMainWindow *parent) myUniversalMessageDialog = new myMessageDialogImpl(myConfig, this); myUniversalMessageDialog->setParent(this); - //hide left and right icon and menubar from maemo gui for ANDROID + //hide left and right icon and menubar from maemo gui for ANDROID #ifdef ANDROID - fullscreenButton->hide(); - menubar->hide(); + fullscreenButton->hide(); + menubar->hide(); // tabsButton->hide(); #endif @@ -683,9 +683,9 @@ void gameTableImpl::callSettingsDialog() void gameTableImpl::applySettings(settingsDialogImpl* mySettingsDialog) { - //apply card deck style + //apply card deck style myCardDeckStyle->readStyleFile(QString::fromUtf8(myConfig->readConfigString("CurrentCardDeckStyle").c_str())); - checkActionLabelPosition(); + checkActionLabelPosition(); //apply game table style myGameTableStyle->readStyleFile(QString::fromUtf8(myConfig->readConfigString("CurrentGameTableStyle").c_str())); @@ -837,75 +837,75 @@ void gameTableImpl::applySettings(settingsDialogImpl* mySettingsDialog) provideMyActions(); } - mySoundEventHandler->reInitSoundEngine(); + mySoundEventHandler->reInitSoundEngine(); } void gameTableImpl::initGui(int speed) -{ - //kill running Singleshots!!! - stopTimer(); +{ + //kill running Singleshots!!! + stopTimer(); - label_handNumber->setText(HandString+":"); - label_gameNumber->setText(GameString+":"); + label_handNumber->setText(HandString+":"); + label_gameNumber->setText(GameString+":"); - //set WindowTitle dynamically - QString titleString = ""; - assert(myStartWindow->getSession()); - if(myStartWindow->getSession()->getGameType() == Session::GAME_TYPE_INTERNET || myStartWindow->getSession()->getGameType() == Session::GAME_TYPE_NETWORK) { - GameInfo info(myStartWindow->getSession()->getClientGameInfo(myStartWindow->getSession()->getClientCurrentGameId())); - titleString = QString::fromUtf8(info.name.c_str())+" - "; - } + //set WindowTitle dynamically + QString titleString = ""; + assert(myStartWindow->getSession()); + if(myStartWindow->getSession()->getGameType() == Session::GAME_TYPE_INTERNET || myStartWindow->getSession()->getGameType() == Session::GAME_TYPE_NETWORK) { + GameInfo info(myStartWindow->getSession()->getClientGameInfo(myStartWindow->getSession()->getClientCurrentGameId())); + titleString = QString::fromUtf8(info.name.c_str())+" - "; + } - //show human player buttons - for(int i=0; i<6; i++) { - userWidgetsArray[i]->show(); - } + //show human player buttons + for(int i=0; i<6; i++) { + userWidgetsArray[i]->show(); + } - //set speeds for local game and for first network game - if( !myStartWindow->getSession()->isNetworkClientRunning() || (myStartWindow->getSession()->isNetworkClientRunning() && !myStartWindow->getSession()->getCurrentGame()) ) { - guiGameSpeed = speed; - setSpeeds(); - } + //set speeds for local game and for first network game + if( !myStartWindow->getSession()->isNetworkClientRunning() || (myStartWindow->getSession()->isNetworkClientRunning() && !myStartWindow->getSession()->getCurrentGame()) ) { + guiGameSpeed = speed; + setSpeeds(); + } - //set session for chat - myChat->setSession(this->getSession()); + //set session for chat + myChat->setSession(this->getSession()); #ifdef GUI_800x480 - tabsDiag->setWindowTitle("Tabs"); - this->setWindowTitle(QString(titleString + tr("PokerTH %1").arg(POKERTH_BETA_RELEASE_STRING))); + tabsDiag->setWindowTitle("Tabs"); + this->setWindowTitle(QString(titleString + tr("PokerTH %1").arg(POKERTH_BETA_RELEASE_STRING))); - label_Sets->setText(BetsString); - label_Total->setText(TotalString); - tabs.groupBox_RightToolBox->setDisabled(FALSE); - tabs.groupBox_LeftToolBox->setDisabled(FALSE); + label_Sets->setText(BetsString); + label_Total->setText(TotalString); + tabs.groupBox_RightToolBox->setDisabled(FALSE); + tabs.groupBox_LeftToolBox->setDisabled(FALSE); - //set minimum gui speed to prevent gui lags on fast inet games - if( myStartWindow->getSession()->isNetworkClientRunning() ) { - tabs.horizontalSlider_speed->setMinimum(speed); - } else { - tabs.horizontalSlider_speed->setMinimum(1); - } + //set minimum gui speed to prevent gui lags on fast inet games + if( myStartWindow->getSession()->isNetworkClientRunning() ) { + tabs.horizontalSlider_speed->setMinimum(speed); + } else { + tabs.horizontalSlider_speed->setMinimum(1); + } - //positioning Slider - tabs.horizontalSlider_speed->setValue(guiGameSpeed); + //positioning Slider + tabs.horizontalSlider_speed->setValue(guiGameSpeed); #else - this->setWindowTitle(QString(titleString + tr("PokerTH %1 - The Open-Source Texas Holdem Engine").arg(POKERTH_BETA_RELEASE_STRING))); + this->setWindowTitle(QString(titleString + tr("PokerTH %1 - The Open-Source Texas Holdem Engine").arg(POKERTH_BETA_RELEASE_STRING))); - label_Pot->setText(PotString); - label_Total->setText(TotalString+":"); - label_Sets->setText(BetsString+":"); - groupBox_RightToolBox->setDisabled(FALSE); - groupBox_LeftToolBox->setDisabled(FALSE); + label_Pot->setText(PotString); + label_Total->setText(TotalString+":"); + label_Sets->setText(BetsString+":"); + groupBox_RightToolBox->setDisabled(FALSE); + groupBox_LeftToolBox->setDisabled(FALSE); - //set minimum gui speed to prevent gui lags on fast inet games - if( myStartWindow->getSession()->isNetworkClientRunning() ) { - horizontalSlider_speed->setMinimum(speed); - } else { - horizontalSlider_speed->setMinimum(1); - } + //set minimum gui speed to prevent gui lags on fast inet games + if( myStartWindow->getSession()->isNetworkClientRunning() ) { + horizontalSlider_speed->setMinimum(speed); + } else { + horizontalSlider_speed->setMinimum(1); + } - horizontalSlider_speed->setValue(guiGameSpeed); + horizontalSlider_speed->setValue(guiGameSpeed); #endif @@ -1164,7 +1164,7 @@ void gameTableImpl::refreshAction(int playerID, int playerAction) //play sounds if exist if(myConfig->readConfigInt("PlayGameActions")) - mySoundEventHandler->playSound(actionArray[playerAction].toStdString(), playerID); + mySoundEventHandler->playSound(actionArray[playerAction].toStdString(), playerID); } if (playerAction == 1) { // FOLD @@ -1878,13 +1878,13 @@ void gameTableImpl::meInAction() myActionIsRaise = 0; myActionIsBet = 0; -/* if(myConfig->readConfigInt("ShowStatusbarMessages")) { - if ( myConfig->readConfigInt("AlternateFKeysUserActionMode") == 0 ) { - // // statusBar()->showMessage(tr("F1 - Fold | F2 - Check/Call | F3 - Bet/Raise | F4 - All-In"), 15000); - } else { - // statusBar()->showMessage(tr("F1 - All-In | F2 - Bet/Raise | F3 - Check/Call | F4 - Fold"), 15000); - } - }*/ + /* if(myConfig->readConfigInt("ShowStatusbarMessages")) { + if ( myConfig->readConfigInt("AlternateFKeysUserActionMode") == 0 ) { + // // statusBar()->showMessage(tr("F1 - Fold | F2 - Check/Call | F3 - Bet/Raise | F4 - All-In"), 15000); + } else { + // statusBar()->showMessage(tr("F1 - All-In | F2 - Bet/Raise | F3 - Check/Call | F4 - Fold"), 15000); + } + }*/ QString lastPushButtonFoldString = pushButton_Fold->text(); @@ -3232,11 +3232,11 @@ bool gameTableImpl::eventFilter(QObject *obj, QEvent *event) if (/*obj == lineEdit_ChatInput && lineEdit_ChatInput->text() != "" && */event->type() == QEvent::KeyPress && keyEvent->key() == Qt::Key_Tab) { myChat->nickAutoCompletition(); return true; - } else if (event->type() == QEvent::KeyPress && keyEvent->key() == Qt::Key_Back) { - event->ignore(); - closeGameTable(); - return true; - } else if (event->type() == QEvent::Close) { + } else if (event->type() == QEvent::KeyPress && keyEvent->key() == Qt::Key_Back) { + event->ignore(); + closeGameTable(); + return true; + } else if (event->type() == QEvent::Close) { event->ignore(); closeGameTable(); return true; @@ -3707,8 +3707,8 @@ void gameTableImpl::closeGameTable() if (myStartWindow->getMyServerGuiInterface() && myStartWindow->getMyServerGuiInterface()->getSession()->isNetworkServerRunning()) { - MyMessageBox msgBox(QMessageBox::Warning, tr("Closing PokerTH during network game"), - tr("You are the hosting server. Do you want to close PokerTH anyway?"), QMessageBox::Yes | QMessageBox::No, this); + MyMessageBox msgBox(QMessageBox::Warning, tr("Closing PokerTH during network game"), + tr("You are the hosting server. Do you want to close PokerTH anyway?"), QMessageBox::Yes | QMessageBox::No, this); if (msgBox.exec() == QMessageBox::Yes ) { myStartWindow->getSession()->terminateNetworkClient(); @@ -3722,8 +3722,8 @@ void gameTableImpl::closeGameTable() bool close = true; - if(myUniversalMessageDialog->checkIfMesssageWillBeDisplayed(CLOSE_GAMETABLE_QUESTION ) && (myStartWindow->getSession()->getGameType() == Session::GAME_TYPE_INTERNET || myStartWindow->getSession()->getGameType() == Session::GAME_TYPE_NETWORK ) && this->isVisible()) { - if (myUniversalMessageDialog->exec(CLOSE_GAMETABLE_QUESTION , tr("Really want to exit?"), tr("PokerTH - Close Table?"), QPixmap(":/gfx/logoChip3D.png"), QDialogButtonBox::Yes|QDialogButtonBox::No, true) == QDialog::Rejected) { + if(myUniversalMessageDialog->checkIfMesssageWillBeDisplayed(CLOSE_GAMETABLE_QUESTION ) && (myStartWindow->getSession()->getGameType() == Session::GAME_TYPE_INTERNET || myStartWindow->getSession()->getGameType() == Session::GAME_TYPE_NETWORK ) && this->isVisible()) { + if (myUniversalMessageDialog->exec(CLOSE_GAMETABLE_QUESTION , tr("Really want to exit?"), tr("PokerTH - Close Table?"), QPixmap(":/gfx/logoChip3D.png"), QDialogButtonBox::Yes|QDialogButtonBox::No, true) == QDialog::Rejected) { close = false; } } @@ -3741,61 +3741,59 @@ void gameTableImpl::closeGameTable() void gameTableImpl::changeSpinBoxBetValue(int value) { - if(betSliderChangedByInput) { - //prevent interval cutting of spinBox_betValue input from code below - betSliderChangedByInput = FALSE; - } - else { + if(betSliderChangedByInput) { + //prevent interval cutting of spinBox_betValue input from code below + betSliderChangedByInput = FALSE; + } else { - if(horizontalSlider_bet->value() == horizontalSlider_bet->maximum()) { + if(horizontalSlider_bet->value() == horizontalSlider_bet->maximum()) { - spinBox_betValue->setValue(horizontalSlider_bet->value()); - } - else { + spinBox_betValue->setValue(horizontalSlider_bet->value()); + } else { - int temp; - if(horizontalSlider_bet->maximum() <= 1000 ) { - temp = (int)((value/10)*10); - } else if(horizontalSlider_bet->maximum() > 1000 && horizontalSlider_bet->maximum() <= 10000) { - temp = (int)((value/50)*50); - } else if(horizontalSlider_bet->maximum() > 10000 && horizontalSlider_bet->maximum() <= 100000) { - temp = (int)((value/500)*500); - } else { - temp = (int)((value/5000)*5000); - } + int temp; + if(horizontalSlider_bet->maximum() <= 1000 ) { + temp = (int)((value/10)*10); + } else if(horizontalSlider_bet->maximum() > 1000 && horizontalSlider_bet->maximum() <= 10000) { + temp = (int)((value/50)*50); + } else if(horizontalSlider_bet->maximum() > 10000 && horizontalSlider_bet->maximum() <= 100000) { + temp = (int)((value/500)*500); + } else { + temp = (int)((value/5000)*5000); + } - if(temp < horizontalSlider_bet->minimum()) - spinBox_betValue->setValue(horizontalSlider_bet->minimum()); - else - spinBox_betValue->setValue(temp); - } - } + if(temp < horizontalSlider_bet->minimum()) + spinBox_betValue->setValue(horizontalSlider_bet->minimum()); + else + spinBox_betValue->setValue(temp); + } + } } void gameTableImpl::spinBoxBetValueChanged(int value) { - if(horizontalSlider_bet->isEnabled()) { + if(horizontalSlider_bet->isEnabled()) { - QString betRaise = pushButton_BetRaise->text().section("\n",0 ,0); + QString betRaise = pushButton_BetRaise->text().section("\n",0 ,0); - if(value >= horizontalSlider_bet->minimum()) { + if(value >= horizontalSlider_bet->minimum()) { - if(value > horizontalSlider_bet->maximum()) { // print the maximum - pushButton_BetRaise->setText(betRaise + "\n$" + QString("%L1").arg(horizontalSlider_bet->maximum())); - betSliderChangedByInput = TRUE; - horizontalSlider_bet->setValue(horizontalSlider_bet->maximum()); - } else { // really print the value - pushButton_BetRaise->setText(betRaise + "\n$" + QString("%L1").arg(value)); - betSliderChangedByInput = TRUE; - horizontalSlider_bet->setValue(value); - } - } else { // print the minimum - pushButton_BetRaise->setText(betRaise + "\n$" + QString("%L1").arg(horizontalSlider_bet->minimum())); - betSliderChangedByInput = TRUE; - horizontalSlider_bet->setValue(horizontalSlider_bet->minimum()); - } - } + if(value > horizontalSlider_bet->maximum()) { // print the maximum + pushButton_BetRaise->setText(betRaise + "\n$" + QString("%L1").arg(horizontalSlider_bet->maximum())); + betSliderChangedByInput = TRUE; + horizontalSlider_bet->setValue(horizontalSlider_bet->maximum()); + } else { // really print the value + pushButton_BetRaise->setText(betRaise + "\n$" + QString("%L1").arg(value)); + betSliderChangedByInput = TRUE; + horizontalSlider_bet->setValue(value); + } + } else { // print the minimum + pushButton_BetRaise->setText(betRaise + "\n$" + QString("%L1").arg(horizontalSlider_bet->minimum())); + betSliderChangedByInput = TRUE; + horizontalSlider_bet->setValue(horizontalSlider_bet->minimum()); + } + } } void gameTableImpl::leaveCurrentNetworkGame() @@ -3803,12 +3801,12 @@ void gameTableImpl::leaveCurrentNetworkGame() if (myStartWindow->getSession()->isNetworkClientRunning()) { - if(!myUniversalMessageDialog->checkIfMesssageWillBeDisplayed(BACKTO_LOBBY_QUESTION)) { + if(!myUniversalMessageDialog->checkIfMesssageWillBeDisplayed(BACKTO_LOBBY_QUESTION)) { assert(myStartWindow->getSession()); myStartWindow->getSession()->sendLeaveCurrentGame(); } else { - if (myUniversalMessageDialog->exec(BACKTO_LOBBY_QUESTION, 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::Yes|QDialogButtonBox::No, true) == QDialog::Accepted) { + if (myUniversalMessageDialog->exec(BACKTO_LOBBY_QUESTION, 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::Yes|QDialogButtonBox::No, true) == QDialog::Accepted) { assert(myStartWindow->getSession()); myStartWindow->getSession()->sendLeaveCurrentGame(); } @@ -4040,7 +4038,7 @@ void gameTableImpl::refreshGameTableStyle() myGameTableStyle->setWindowsGeometry(this); #ifdef GUI_800x480 #ifdef ANDROID - myGameTableStyle->setChatLogStyle(tabs.textBrowser_Log); + myGameTableStyle->setChatLogStyle(tabs.textBrowser_Log); #endif myGameTableStyle->setChatLogStyle(tabs.textBrowser_Chat); myGameTableStyle->setChatLogStyle(tabs.textEdit_tipInput); @@ -4061,8 +4059,8 @@ void gameTableImpl::refreshGameTableStyle() } #ifdef GUI_800x480 - myGameTableStyle->setBigFontBoardStyle(label_Sets); - myGameTableStyle->setBigFontBoardStyle(label_Total); + myGameTableStyle->setBigFontBoardStyle(label_Sets); + myGameTableStyle->setBigFontBoardStyle(label_Total); myGameTableStyle->setBigFontBoardStyle(textLabel_Sets); myGameTableStyle->setBigFontBoardStyle(textLabel_Pot); myGameTableStyle->setBigFontBoardStyle(label_handNumber); @@ -4071,8 +4069,8 @@ void gameTableImpl::refreshGameTableStyle() myGameTableStyle->setBigFontBoardStyle(label_gameNumberValue); myGameTableStyle->setBigFontBoardStyle(textLabel_handLabel); #else - myGameTableStyle->setSmallFontBoardStyle(label_Sets); - myGameTableStyle->setSmallFontBoardStyle(label_Total); + myGameTableStyle->setSmallFontBoardStyle(label_Sets); + myGameTableStyle->setSmallFontBoardStyle(label_Total); myGameTableStyle->setSmallFontBoardStyle(textLabel_Sets); myGameTableStyle->setSmallFontBoardStyle(textLabel_Pot); myGameTableStyle->setSmallFontBoardStyle(label_handNumber); @@ -4261,12 +4259,12 @@ void gameTableImpl::saveGameTableGeometry() void gameTableImpl::restoreGameTableGeometry() { #ifdef ANDROID - this->showFullScreen(); + this->showFullScreen(); #else if(myConfig->readConfigInt("GameTableFullScreenSave")) { - #ifndef GUI_800x480 +#ifndef GUI_800x480 if(actionFullScreen->isEnabled()) this->showFullScreen(); - #endif +#endif } else { //resize only if style size allow this and if NOT fixed windows size if(!myGameTableStyle->getIfFixedWindowSize().toInt() && myConfig->readConfigInt("GameTableHeightSave") <= myGameTableStyle->getMaximumWindowHeight().toInt() && myConfig->readConfigInt("GameTableHeightSave") >= myGameTableStyle->getMinimumWindowHeight().toInt() && myConfig->readConfigInt("GameTableWidthSave") <= myGameTableStyle->getMaximumWindowWidth().toInt() && myConfig->readConfigInt("GameTableWidthSave") >= myGameTableStyle->getMinimumWindowWidth().toInt()) { @@ -4337,7 +4335,7 @@ void gameTableImpl::hide() //clear log #ifdef GUI_800x480 tabs.textBrowser_Log->clear(); - tabsDiag->hide(); + tabsDiag->hide(); #else textBrowser_Log->clear(); #endif @@ -4377,7 +4375,7 @@ void gameTableImpl::enableCallCheckPushButton() void gameTableImpl::tabsButtonClicked() { tabsDiag->setParent(this, Qt::Dialog); - tabsDiag->showFullScreen(); + tabsDiag->showFullScreen(); tabsDiag->show(); tabsDiag->raise(); tabsDiag->activateWindow(); @@ -4390,36 +4388,34 @@ void gameTableImpl::tabsButtonClose() #endif -void gameTableImpl::checkActionLabelPosition() { +void gameTableImpl::checkActionLabelPosition() +{ #ifndef GUI_800x480 - int i; - if(myCardDeckStyle->getBigIndexesActionBottom() == "1") { - for (i=0; i=3 && i<=7) { - if(actionLabelArray[i]->y() == 56) { - actionLabelArray[i]->move(actionLabelArray[i]->x(), 80); - } - } - else { - if(actionLabelArray[i]->y() == 43) { - actionLabelArray[i]->move(actionLabelArray[i]->x(), 67); - } - } - } - } - else { - for (i=0; i=3 && i<=7) { - if(actionLabelArray[i]->y() == 80) { - actionLabelArray[i]->move(actionLabelArray[i]->x(), 56); - } - } - else { - if(actionLabelArray[i]->y() == 67) { - actionLabelArray[i]->move(actionLabelArray[i]->x(), 43); - } - } - } - } + int i; + if(myCardDeckStyle->getBigIndexesActionBottom() == "1") { + for (i=0; i=3 && i<=7) { + if(actionLabelArray[i]->y() == 56) { + actionLabelArray[i]->move(actionLabelArray[i]->x(), 80); + } + } else { + if(actionLabelArray[i]->y() == 43) { + actionLabelArray[i]->move(actionLabelArray[i]->x(), 67); + } + } + } + } else { + for (i=0; i=3 && i<=7) { + if(actionLabelArray[i]->y() == 80) { + actionLabelArray[i]->move(actionLabelArray[i]->x(), 56); + } + } else { + if(actionLabelArray[i]->y() == 67) { + actionLabelArray[i]->move(actionLabelArray[i]->x(), 43); + } + } + } + } #endif } diff --git a/src/gui/qt/gametable/gametableimpl.h b/src/gui/qt/gametable/gametableimpl.h index f5be66af..9fdb948d 100755 --- a/src/gui/qt/gametable/gametableimpl.h +++ b/src/gui/qt/gametable/gametableimpl.h @@ -341,10 +341,10 @@ public slots: void sendShowMyCardsSignal(); void closeMessageBoxes(); - void hide(); + void hide(); void soundEvent_blindsWereSet(int); - void enableCallCheckPushButton(); - void checkActionLabelPosition(); + void enableCallCheckPushButton(); + void checkActionLabelPosition(); #ifdef GUI_800x480 void tabsButtonClicked(); diff --git a/src/gui/qt/gametable/myavatarlabel.cpp b/src/gui/qt/gametable/myavatarlabel.cpp index 6114935a..0a5a6256 100644 --- a/src/gui/qt/gametable/myavatarlabel.cpp +++ b/src/gui/qt/gametable/myavatarlabel.cpp @@ -412,7 +412,7 @@ void MyAvatarLabel::putPlayerOnIgnoreList() if(!playerIsOnIgnoreList(list.at(myId))) { myMessageDialogImpl dialog(myW->getMyConfig(), this); - if(dialog.exec(INGNORE_PLAYER_QUESTION, tr("You will no longer receive chat messages or game invitations from this user.
Do you really want to put player %1 on ignore list?").arg(list.at(myId)), tr("PokerTH - Question"), QPixmap(":/gfx/im-ban-user_64.png"), QDialogButtonBox::Yes|QDialogButtonBox::No, false ) == QDialog::Accepted) { + if(dialog.exec(INGNORE_PLAYER_QUESTION, tr("You will no longer receive chat messages or game invitations from this user.
Do you really want to put player %1 on ignore list?").arg(list.at(myId)), tr("PokerTH - Question"), QPixmap(":/gfx/im-ban-user_64.png"), QDialogButtonBox::Yes|QDialogButtonBox::No, false ) == QDialog::Accepted) { std::list playerIgnoreList = myW->getMyConfig()->readConfigStringList("PlayerIgnoreList"); playerIgnoreList.push_back(list.at(myId).toUtf8().constData()); @@ -440,7 +440,7 @@ void MyAvatarLabel::reportBadAvatar() QString nick = QString::fromUtf8((*it_c)->getMyName().c_str()); int ret = MyMessageBox::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); + 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); diff --git a/src/gui/qt/gametable/mycardspixmaplabel.cpp b/src/gui/qt/gametable/mycardspixmaplabel.cpp index 87bb65b1..d825123f 100755 --- a/src/gui/qt/gametable/mycardspixmaplabel.cpp +++ b/src/gui/qt/gametable/mycardspixmaplabel.cpp @@ -108,7 +108,7 @@ void MyCardsPixmapLabel::startFlipCards(int speed, const QPixmap &frontPix, cons QLabel::setPixmap(frontPix); frameFlipCardsAction1Size = 1.0; - frameFlipCardsAction2Size = 0.0; + frameFlipCardsAction2Size = 0.0; front = frontPix.scaled(width(), height(), Qt::IgnoreAspectRatio, Qt::SmoothTransformation);; flipside = flipsidePix.scaled(width(), height(), Qt::IgnoreAspectRatio, Qt::SmoothTransformation);; @@ -124,7 +124,7 @@ void MyCardsPixmapLabel::startFlipCards(int speed, const QPixmap &frontPix, cons } if(speed > 8 && speed <= 10) { flipCardsScaleIntervall = 0.5; - } + } if(speed != 11) { flipCardsAction1 = TRUE; @@ -146,7 +146,7 @@ void MyCardsPixmapLabel::stopFlipCardsAnimation() void MyCardsPixmapLabel::nextFlipCardsFrame() { - if (frameFlipCardsAction1Size > 0.1 ) { + if (frameFlipCardsAction1Size > 0.1 ) { //erst flipside verkleinern frameFlipCardsAction1Size -= flipCardsScaleIntervall; update(); @@ -156,9 +156,9 @@ void MyCardsPixmapLabel::nextFlipCardsFrame() flipCardsAction2 = TRUE; } else { //dann front vergrößern - if (frameFlipCardsAction2Size < 0.95 ) { + if (frameFlipCardsAction2Size < 0.95 ) { frameFlipCardsAction2Size += flipCardsScaleIntervall; - update(); + update(); } else { flipCardsAction2 = FALSE; flipCardsTimer->stop(); @@ -264,8 +264,8 @@ void MyCardsPixmapLabel::mouseReleaseEvent(QMouseEvent * event) void MyCardsPixmapLabel::setFront ( const QPixmap& theValue ) { #ifdef GUI_800x480 - front = theValue.scaled(width(), height(), Qt::IgnoreAspectRatio, Qt::SmoothTransformation);; + front = theValue.scaled(width(), height(), Qt::IgnoreAspectRatio, Qt::SmoothTransformation);; #else - front = theValue; + front = theValue; #endif } diff --git a/src/gui/qt/gametable/mycardspixmaplabel.h b/src/gui/qt/gametable/mycardspixmaplabel.h index 1b9396ff..9fca270c 100755 --- a/src/gui/qt/gametable/mycardspixmaplabel.h +++ b/src/gui/qt/gametable/mycardspixmaplabel.h @@ -81,7 +81,7 @@ public slots: void mousePressEvent ( QMouseEvent *); void mouseReleaseEvent ( QMouseEvent *); - void setFront ( const QPixmap& theValue ); + void setFront ( const QPixmap& theValue ); private: diff --git a/src/gui/qt/gametable/mylefttabwidget.h b/src/gui/qt/gametable/mylefttabwidget.h index 9ac9d8bb..d543a37c 100755 --- a/src/gui/qt/gametable/mylefttabwidget.h +++ b/src/gui/qt/gametable/mylefttabwidget.h @@ -26,7 +26,7 @@ class MyLeftTabWidget : public QTabWidget { Q_OBJECT public: - MyLeftTabWidget(QGroupBox*); + MyLeftTabWidget(QGroupBox*); ~MyLeftTabWidget(); diff --git a/src/gui/qt/gametable/myrighttabwidget.h b/src/gui/qt/gametable/myrighttabwidget.h index 44290b1f..688344e3 100755 --- a/src/gui/qt/gametable/myrighttabwidget.h +++ b/src/gui/qt/gametable/myrighttabwidget.h @@ -25,7 +25,7 @@ class MyRightTabWidget : public QTabWidget { Q_OBJECT public: - MyRightTabWidget(QGroupBox*); + MyRightTabWidget(QGroupBox*); ~MyRightTabWidget(); diff --git a/src/gui/qt/gametable/mytimeoutlabel.cpp b/src/gui/qt/gametable/mytimeoutlabel.cpp index ee00e452..730abc81 100644 --- a/src/gui/qt/gametable/mytimeoutlabel.cpp +++ b/src/gui/qt/gametable/mytimeoutlabel.cpp @@ -96,7 +96,7 @@ void MyTimeoutLabel::nextTimeOutAnimationFrame() if(timeOutFrame > waitFrames) { //play beep after waitFrames one time if(isBeep && !isBeepPlayed) { - myW->getMySoundEventHandler()->playSound("yourturn",0); + myW->getMySoundEventHandler()->playSound("yourturn",0); isBeepPlayed = TRUE; } //save gfx ressources and never play more the 10 pps diff --git a/src/gui/qt/internetgamelogindialog/internetgamelogindialogimpl.cpp b/src/gui/qt/internetgamelogindialog/internetgamelogindialogimpl.cpp index b2cc88fa..1c5b40f8 100644 --- a/src/gui/qt/internetgamelogindialog/internetgamelogindialogimpl.cpp +++ b/src/gui/qt/internetgamelogindialog/internetgamelogindialogimpl.cpp @@ -25,11 +25,11 @@ internetGameLoginDialogImpl::internetGameLoginDialogImpl(QWidget *parent, Config QDialog(parent), myConfig(c) { setupUi(this); - this->installEventFilter(this); + this->installEventFilter(this); - //html stuff - QString createAccount(QString("%1").arg(tr("Create new user account"))); - label_createAnAccount->setText(createAccount); + //html stuff + QString createAccount(QString("%1").arg(tr("Create new user account"))); + label_createAnAccount->setText(createAccount); connect(groupBox_reguser, SIGNAL(toggled(bool)), this, SLOT(regUserToggled(bool))); @@ -152,24 +152,24 @@ void internetGameLoginDialogImpl::okButtonCheck() bool internetGameLoginDialogImpl::eventFilter(QObject *obj, QEvent *event) { - QKeyEvent *keyEvent = static_cast(event); + QKeyEvent *keyEvent = static_cast(event); #ifdef ANDROID //androi changes for return key behavior (hopefully useless from necessitas beta2) - if (event->type() == QEvent::KeyPress && keyEvent->key() == Qt::Key_Return) { - if(lineEdit_username->hasFocus()) { - lineEdit_password->setFocus(); - } - if(lineEdit_password->hasFocus()) { - QTimer::singleShot(1000, this, SLOT(clickLoginButton())); - } - event->ignore(); - return false; - } else { - // pass the event on to the parent class - return QDialog::eventFilter(obj, event); - } + if (event->type() == QEvent::KeyPress && keyEvent->key() == Qt::Key_Return) { + if(lineEdit_username->hasFocus()) { + lineEdit_password->setFocus(); + } + if(lineEdit_password->hasFocus()) { + QTimer::singleShot(1000, this, SLOT(clickLoginButton())); + } + event->ignore(); + return false; + } else { + // pass the event on to the parent class + return QDialog::eventFilter(obj, event); + } #else - return QDialog::eventFilter(obj, event); + return QDialog::eventFilter(obj, event); #endif } diff --git a/src/gui/qt/internetgamelogindialog/internetgamelogindialogimpl.h b/src/gui/qt/internetgamelogindialog/internetgamelogindialogimpl.h index c1a52494..5a8ffc44 100644 --- a/src/gui/qt/internetgamelogindialog/internetgamelogindialogimpl.h +++ b/src/gui/qt/internetgamelogindialog/internetgamelogindialogimpl.h @@ -35,13 +35,15 @@ public: void exec(); void accept(); - bool eventFilter(QObject *obj, QEvent *event); + bool eventFilter(QObject *obj, QEvent *event); public slots: void regUserToggled(bool); void guestUserToggled(bool); void okButtonCheck(); - void clickLoginButton() { pushButton_login->click(); } + void clickLoginButton() { + pushButton_login->click(); + } private: diff --git a/src/gui/qt/joinnetworkgamedialog/joinnetworkgamedialogimpl.cpp b/src/gui/qt/joinnetworkgamedialog/joinnetworkgamedialogimpl.cpp index 53ed6f10..94355c58 100644 --- a/src/gui/qt/joinnetworkgamedialog/joinnetworkgamedialogimpl.cpp +++ b/src/gui/qt/joinnetworkgamedialog/joinnetworkgamedialogimpl.cpp @@ -120,8 +120,8 @@ void joinNetworkGameDialogImpl::fillServerProfileList() TiXmlDocument doc(QString::fromUtf8(myServerProfilesFile.c_str()).toStdString()); if(!doc.LoadFile()) { MyMessageBox::warning(this, tr("Load Server-Profile-File Error"), - tr("Could not load server-profiles-file:\n"+QString::fromUtf8(myServerProfilesFile.c_str()).toAscii()), - QMessageBox::Close); + tr("Could not load server-profiles-file:\n"+QString::fromUtf8(myServerProfilesFile.c_str()).toAscii()), + QMessageBox::Close); } TiXmlHandle docHandle( &doc ); @@ -171,8 +171,8 @@ void joinNetworkGameDialogImpl::itemFillForm (QTreeWidgetItem* item, int /*colum TiXmlDocument doc(QString::fromUtf8(myServerProfilesFile.c_str()).toStdString()); if(!doc.LoadFile()) { MyMessageBox::warning(this, tr("Load Server-Profile-File Error"), - tr("Could not load server-profiles-file:\n"+QString::fromUtf8(myServerProfilesFile.c_str()).toAscii()), - QMessageBox::Close); + tr("Could not load server-profiles-file:\n"+QString::fromUtf8(myServerProfilesFile.c_str()).toAscii()), + QMessageBox::Close); } TiXmlHandle docHandle( &doc ); @@ -198,8 +198,8 @@ void joinNetworkGameDialogImpl::saveServerProfile() TiXmlDocument doc(QString::fromUtf8(myServerProfilesFile.c_str()).toStdString()); if(!doc.LoadFile()) { MyMessageBox::warning(this, tr("Load Server-Profile-File Error"), - tr("Could not load server-profiles-file:\n"+QString::fromUtf8(myServerProfilesFile.c_str()).toAscii()), - QMessageBox::Close); + tr("Could not load server-profiles-file:\n"+QString::fromUtf8(myServerProfilesFile.c_str()).toAscii()), + QMessageBox::Close); } TiXmlHandle docHandle( &doc ); @@ -210,8 +210,8 @@ void joinNetworkGameDialogImpl::saveServerProfile() if( testProfile ) { // Wenn der Name schon existiert --> Überschreiben? - MyMessageBox msgBox(QMessageBox::Warning, tr("Save Server Profile Error"), - QString(tr("A profile with the name: %1 already exists.\nWould you like to overwrite ?")).arg(lineEdit_profileName->text()), QMessageBox::Yes | QMessageBox::No, this); + MyMessageBox msgBox(QMessageBox::Warning, tr("Save Server Profile Error"), + QString(tr("A profile with the name: %1 already exists.\nWould you like to overwrite ?")).arg(lineEdit_profileName->text()), QMessageBox::Yes | QMessageBox::No, this); switch (msgBox.exec()) { case QMessageBox::Yes: { @@ -249,14 +249,14 @@ void joinNetworkGameDialogImpl::saveServerProfile() } } else { MyMessageBox::warning(this, tr("Read Server-Profile List Error"), - tr("Could not read server-profiles list"), - QMessageBox::Close); + tr("Could not read server-profiles list"), + QMessageBox::Close); } if(!doc.SaveFile()) { MyMessageBox::warning(this, tr("Save Server-Profile-File Error"), - tr("Could not save server-profiles-file:\n"+QString::fromUtf8(myServerProfilesFile.c_str()).toAscii()), - QMessageBox::Close); + tr("Could not save server-profiles-file:\n"+QString::fromUtf8(myServerProfilesFile.c_str()).toAscii()), + QMessageBox::Close); } fillServerProfileList(); @@ -268,8 +268,8 @@ void joinNetworkGameDialogImpl::deleteServerProfile() TiXmlDocument doc(QString::fromUtf8(myServerProfilesFile.c_str()).toStdString()); if(!doc.LoadFile()) { MyMessageBox::warning(this, tr("Load Server-Profile-File Error"), - tr("Could not load server-profiles-file:\n"+QString::fromUtf8(myServerProfilesFile.c_str()).toAscii()), - QMessageBox::Close); + tr("Could not load server-profiles-file:\n"+QString::fromUtf8(myServerProfilesFile.c_str()).toAscii()), + QMessageBox::Close); } else { TiXmlHandle docHandle( &doc ); @@ -281,8 +281,8 @@ void joinNetworkGameDialogImpl::deleteServerProfile() if(!doc.SaveFile()) { MyMessageBox::warning(this, tr("Save Server-Profile-File Error"), - tr("Could not save server-profiles-file:\n"+QString::fromUtf8(myServerProfilesFile.c_str()).toAscii()), - QMessageBox::Close); + tr("Could not save server-profiles-file:\n"+QString::fromUtf8(myServerProfilesFile.c_str()).toAscii()), + QMessageBox::Close); } //Liste Füllen diff --git a/src/gui/qt/logfiledialog/logfiledialog.cpp b/src/gui/qt/logfiledialog/logfiledialog.cpp index 47f0171d..0e4ba3c4 100644 --- a/src/gui/qt/logfiledialog/logfiledialog.cpp +++ b/src/gui/qt/logfiledialog/logfiledialog.cpp @@ -30,21 +30,21 @@ #include LogFileDialog::LogFileDialog(QWidget *parent, ConfigFile *c) : -QDialog(parent), myConfig(c), -ui(new Ui::LogFileDialog) + QDialog(parent), myConfig(c), + ui(new Ui::LogFileDialog) { - ui->setupUi(this); + ui->setupUi(this); - ui->label_animation->setMaximumWidth(0); - ui->horizontalLayout_animation->setSpacing(0); + ui->label_animation->setMaximumWidth(0); + ui->horizontalLayout_animation->setSpacing(0); connect( ui->pushButton_deleteLog, SIGNAL(clicked()), this, SLOT (deleteLogFile())); connect( ui->pushButton_exportLogHtml, SIGNAL(clicked()), this, SLOT (exportLogToHtml())); connect( ui->pushButton_exportLogTxt, SIGNAL(clicked()), this, SLOT (exportLogToTxt())); connect( ui->pushButton_saveLogAs, SIGNAL(clicked()), this, SLOT (saveLogFileAs())); - connect( ui->treeWidget_logFiles, SIGNAL(currentItemChanged(QTreeWidgetItem*, QTreeWidgetItem*)), this, SLOT(showLogFilePreviewInit())); - connect( ui->pushButton_analyseLogfile, SIGNAL(clicked()), this, SLOT (uploadFile())); - connect( ui->comboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(showLogFilePreviewSelected())); + connect( ui->treeWidget_logFiles, SIGNAL(currentItemChanged(QTreeWidgetItem*, QTreeWidgetItem*)), this, SLOT(showLogFilePreviewInit())); + connect( ui->pushButton_analyseLogfile, SIGNAL(clicked()), this, SLOT (uploadFile())); + connect( ui->comboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(showLogFilePreviewSelected())); connect( this, SIGNAL(signalUploadCompleted(QString,QString)), this, SLOT(showLogAnalysis(QString,QString))); connect( this, SIGNAL(signalUploadError(QString,QString)), this, SLOT(showUploadError(QString,QString))); @@ -85,16 +85,16 @@ void LogFileDialog::refreshLogFileList() QFileInfo currentSqliteLogFile(QString::fromStdString(myGuiLog->getMySqliteLogFileName())); - ui->treeWidget_logFiles->blockSignals(TRUE); + ui->treeWidget_logFiles->blockSignals(TRUE); ui->treeWidget_logFiles->clear(); int i; for (i=0; i < dbFilesList.size(); i++) { QTreeWidgetItem *item = new QTreeWidgetItem; #ifdef GUI_800x480 - item->setText(0, dbFilesList.at(i).fileName().remove("pokerth-log-")); + item->setText(0, dbFilesList.at(i).fileName().remove("pokerth-log-")); #else - item->setText(0, dbFilesList.at(i).fileName()); + item->setText(0, dbFilesList.at(i).fileName()); #endif item->setData(0, Qt::UserRole, dbFilesList.at(i).absoluteFilePath()); if(currentSqliteLogFile.fileName() == dbFilesList.at(i).fileName()) { @@ -105,8 +105,8 @@ void LogFileDialog::refreshLogFileList() ui->treeWidget_logFiles->addTopLevelItem(item); } ui->treeWidget_logFiles->sortItems(0, Qt::DescendingOrder); - ui->treeWidget_logFiles->blockSignals(FALSE); - ui->treeWidget_logFiles->setCurrentItem(ui->treeWidget_logFiles->topLevelItem(0)); + ui->treeWidget_logFiles->blockSignals(FALSE); + ui->treeWidget_logFiles->setCurrentItem(ui->treeWidget_logFiles->topLevelItem(0)); } void LogFileDialog::deleteLogFile() @@ -116,8 +116,8 @@ void LogFileDialog::deleteLogFile() if(!selectedItemsList.isEmpty() && !( selectedItemsList.size() == 1 && selectedItemsList.front()->data(0, Qt::UserRole+1).toString() == "current" )) { int ret = MyMessageBox::warning(this, tr("PokerTH - Delete log files"), - tr("Do you really want to delete the selected log files?"), - QMessageBox::Yes | QMessageBox::No); + tr("Do you really want to delete the selected log files?"), + QMessageBox::Yes | QMessageBox::No); if(ret == QMessageBox::Yes) { for (int i = 0; i < selectedItemsList.size(); ++i) { @@ -138,7 +138,7 @@ void LogFileDialog::exportLogToHtml() QTreeWidgetItem* selectedItem = ui->treeWidget_logFiles->currentItem(); if(selectedItem) { - QFileInfo fi(selectedItem->data(0, Qt::UserRole).toString()); + QFileInfo fi(selectedItem->data(0, Qt::UserRole).toString()); QString fileName = QFileDialog::getSaveFileName(this, tr("Export PokerTH log file to HTML"), QDir::homePath()+"/"+fi.baseName()+".html", tr("PokerTH HTML log (*.html)")); @@ -154,7 +154,7 @@ void LogFileDialog::exportLogToTxt() QTreeWidgetItem* selectedItem = ui->treeWidget_logFiles->currentItem(); if(selectedItem) { - QFileInfo fi(selectedItem->data(0, Qt::UserRole).toString()); + QFileInfo fi(selectedItem->data(0, Qt::UserRole).toString()); QString fileName = QFileDialog::getSaveFileName(this, tr("Export PokerTH log file to plain text"), QDir::homePath()+"/"+fi.baseName()+".txt", tr("PokerTH plain text log (*.txt)")); @@ -170,7 +170,7 @@ void LogFileDialog::saveLogFileAs() QTreeWidgetItem* selectedItem = ui->treeWidget_logFiles->currentItem(); if(selectedItem) { - QFileInfo fi(selectedItem->data(0, Qt::UserRole).toString()); + QFileInfo fi(selectedItem->data(0, Qt::UserRole).toString()); QString fileName = QFileDialog::getSaveFileName(this, tr("Save PokerTH log file"), QDir::homePath()+"/"+fi.baseName()+".pdb", tr("PokerTH SQL log (*.pdb)")); @@ -185,19 +185,19 @@ void LogFileDialog::showLogFilePreview(ShowLogMode mode) { QTreeWidgetItem* selectedItem = ui->treeWidget_logFiles->currentItem(); - if(mode == INIT_VIEW) { - ui->comboBox->blockSignals(TRUE); - ui->comboBox->clear(); - QList gameIds = myGuiLog->getGameList(selectedItem->data(0, Qt::UserRole).toString()); - QList::const_iterator it; - for (it = gameIds.constBegin(); it != gameIds.constEnd(); ++it) { - ui->comboBox->addItem(QString::number(*it)); - } - ui->comboBox->blockSignals(FALSE); - } + if(mode == INIT_VIEW) { + ui->comboBox->blockSignals(TRUE); + ui->comboBox->clear(); + QList gameIds = myGuiLog->getGameList(selectedItem->data(0, Qt::UserRole).toString()); + QList::const_iterator it; + for (it = gameIds.constBegin(); it != gameIds.constEnd(); ++it) { + ui->comboBox->addItem(QString::number(*it)); + } + ui->comboBox->blockSignals(FALSE); + } if(selectedItem) { - myGuiLog->showLog(selectedItem->data(0, Qt::UserRole).toString(), ui->textBrowser_logPreview, ui->comboBox->itemText(ui->comboBox->currentIndex()).toInt()); + myGuiLog->showLog(selectedItem->data(0, Qt::UserRole).toString(), ui->textBrowser_logPreview, ui->comboBox->itemText(ui->comboBox->currentIndex()).toInt()); } QTextCursor cursor(ui->textBrowser_logPreview->textCursor()); @@ -209,9 +209,9 @@ void LogFileDialog::keyPressEvent ( QKeyEvent * event ) { if (event->key() == Qt::Key_Delete ) { /*Delete*/ if(ui->treeWidget_logFiles->hasFocus()) { - ui->pushButton_deleteLog->click(); + ui->pushButton_deleteLog->click(); } - } + } } void LogFileDialog::uploadFile() @@ -237,21 +237,21 @@ void LogFileDialog::uploadInProgressAnimationStart() //const QString buttonText(tr("Upload in progress")); ui->pushButton_analyseLogfile->setDisabled(TRUE); - QMovie *movie = new QMovie(":/gfx/loader.gif"); - ui->label_animation->setMovie(movie); - ui->label_animation->setMaximumWidth(32); - ui->horizontalLayout_animation->setSpacing(-1); - ui->label_animation->setGeometry(0,0,32,32); - movie->start(); + QMovie *movie = new QMovie(":/gfx/loader.gif"); + ui->label_animation->setMovie(movie); + ui->label_animation->setMaximumWidth(32); + ui->horizontalLayout_animation->setSpacing(-1); + ui->label_animation->setGeometry(0,0,32,32); + movie->start(); } void LogFileDialog::uploadInProgressAnimationStop() { - ui->pushButton_analyseLogfile->setDisabled(FALSE); + ui->pushButton_analyseLogfile->setDisabled(FALSE); - ui->label_animation->setMaximumWidth(0); - ui->horizontalLayout_animation->setSpacing(0); - ui->label_animation->setGeometry(0,0,0,0); + ui->label_animation->setMaximumWidth(0); + ui->horizontalLayout_animation->setSpacing(0); + ui->label_animation->setGeometry(0,0,0,0); } void LogFileDialog::showLogAnalysis(QString /*filename*/, QString returnMessage) diff --git a/src/gui/qt/logfiledialog/logfiledialog.h b/src/gui/qt/logfiledialog/logfiledialog.h index 8900efe4..1a03b705 100644 --- a/src/gui/qt/logfiledialog/logfiledialog.h +++ b/src/gui/qt/logfiledialog/logfiledialog.h @@ -26,8 +26,9 @@ class UploaderThread; -namespace Ui { - class LogFileDialog; +namespace Ui +{ +class LogFileDialog; } enum ShowLogMode { INIT_VIEW, SELECTED_GAME }; @@ -39,12 +40,14 @@ class Callback; class LogFileDialog : public QDialog, public UploadCallback { Q_OBJECT - + public: explicit LogFileDialog(QWidget *parent = 0, ConfigFile *c = 0); ~LogFileDialog(); - void setGuiLog(guiLog *g) { myGuiLog = g; } + void setGuiLog(guiLog *g) { + myGuiLog = g; + } void exec(); virtual void UploadCompleted(const std::string &filename, const std::string &returnMessage); @@ -60,25 +63,29 @@ public slots: void exportLogToHtml(); void exportLogToTxt(); void saveLogFileAs(); - void showLogFilePreviewInit() {showLogFilePreview(INIT_VIEW); } - void showLogFilePreviewSelected() {showLogFilePreview(SELECTED_GAME); } - void showLogFilePreview(ShowLogMode); - void keyPressEvent ( QKeyEvent * event ); - void uploadFile(); - void uploadInProgressAnimationStart(); - void uploadInProgressAnimationStop(); + void showLogFilePreviewInit() { + showLogFilePreview(INIT_VIEW); + } + void showLogFilePreviewSelected() { + showLogFilePreview(SELECTED_GAME); + } + void showLogFilePreview(ShowLogMode); + void keyPressEvent ( QKeyEvent * event ); + void uploadFile(); + void uploadInProgressAnimationStart(); + void uploadInProgressAnimationStop(); void showLogAnalysis(QString filename, QString returnMessage); void showUploadError(QString filename, QString errorMessage); -private: +private: ConfigFile *myConfig; guiLog *myGuiLog; - Ui::LogFileDialog *ui; - int writer(char *data, size_t size, size_t nmemb,std::string *buffer); - QFile file; - QString id; - boost::shared_ptr uploader; + Ui::LogFileDialog *ui; + int writer(char *data, size_t size, size_t nmemb,std::string *buffer); + QFile file; + QString id; + boost::shared_ptr uploader; }; #endif // LOGFILEDIALOG_H diff --git a/src/gui/qt/mymessagebox/mymessagebox.cpp b/src/gui/qt/mymessagebox/mymessagebox.cpp index 7a955346..ac6f52c2 100644 --- a/src/gui/qt/mymessagebox/mymessagebox.cpp +++ b/src/gui/qt/mymessagebox/mymessagebox.cpp @@ -2,22 +2,22 @@ #include MyMessageBox::MyMessageBox(QWidget *parent) : - QMessageBox(parent) + QMessageBox(parent) { #ifdef ANDROID - this->setWindowModality(Qt::WindowModal); - this->setWindowFlags(Qt::ToolTip); - this->setStyleSheet("QDialog{ border: 1px solid black; border-style: solid; border-radius: 4px; }"); + this->setWindowModality(Qt::WindowModal); + this->setWindowFlags(Qt::ToolTip); + this->setStyleSheet("QDialog{ border: 1px solid black; border-style: solid; border-radius: 4px; }"); #endif } MyMessageBox::MyMessageBox(Icon icon, const QString &title, const QString &text, QFlags buttons, QWidget *parent, Qt::WindowFlags flags) : - QMessageBox(icon, title, text, buttons, parent, flags) + QMessageBox(icon, title, text, buttons, parent, flags) { #ifdef ANDROID - this->setWindowModality(Qt::WindowModal); - this->setWindowFlags(Qt::ToolTip); - this->setStyleSheet("QDialog{ border: 1px solid black; border-style: solid; border-radius: 4px; }"); + this->setWindowModality(Qt::WindowModal); + this->setWindowFlags(Qt::ToolTip); + this->setStyleSheet("QDialog{ border: 1px solid black; border-style: solid; border-radius: 4px; }"); #endif } @@ -28,49 +28,49 @@ MyMessageBox::~MyMessageBox() QMessageBox::StandardButton MyMessageBox::information(QWidget *parent, const QString &title, const QString &text, QFlags buttons, QMessageBox::StandardButton defaultButton) { - QMessageBox box(QMessageBox::Information, title, text, buttons, parent); + QMessageBox box(QMessageBox::Information, title, text, buttons, parent); #ifdef ANDROID - box.setWindowModality(Qt::WindowModal); - box.setWindowFlags(Qt::ToolTip); - box.setStyleSheet("QDialog{ border: 1px solid black; border-style: solid; border-radius: 4px; }"); + box.setWindowModality(Qt::WindowModal); + box.setWindowFlags(Qt::ToolTip); + box.setStyleSheet("QDialog{ border: 1px solid black; border-style: solid; border-radius: 4px; }"); #endif - box.setDefaultButton(defaultButton); - return static_cast(box.exec()); + box.setDefaultButton(defaultButton); + return static_cast(box.exec()); } QMessageBox::StandardButton MyMessageBox::question(QWidget *parent, const QString &title, const QString &text, QFlags buttons, QMessageBox::StandardButton defaultButton) { - QMessageBox box(QMessageBox::Question, title, text, buttons, parent); + QMessageBox box(QMessageBox::Question, title, text, buttons, parent); #ifdef ANDROID - box.setWindowModality(Qt::WindowModal); - box.setWindowFlags(Qt::ToolTip); - box.setStyleSheet("QDialog{ border: 1px solid black; border-style: solid; border-radius: 4px; }"); + box.setWindowModality(Qt::WindowModal); + box.setWindowFlags(Qt::ToolTip); + box.setStyleSheet("QDialog{ border: 1px solid black; border-style: solid; border-radius: 4px; }"); #endif - box.setDefaultButton(defaultButton); - return static_cast(box.exec()); + box.setDefaultButton(defaultButton); + return static_cast(box.exec()); } QMessageBox::StandardButton MyMessageBox::warning(QWidget *parent, const QString &title, const QString &text, QFlags buttons, QMessageBox::StandardButton defaultButton) { - QMessageBox box(QMessageBox::Warning, title, text, buttons, parent); + QMessageBox box(QMessageBox::Warning, title, text, buttons, parent); #ifdef ANDROID - box.setWindowModality(Qt::WindowModal); - box.setWindowFlags(Qt::ToolTip); - box.setStyleSheet("QDialog{ border: 1px solid black; border-style: solid; border-radius: 4px; }"); + box.setWindowModality(Qt::WindowModal); + box.setWindowFlags(Qt::ToolTip); + box.setStyleSheet("QDialog{ border: 1px solid black; border-style: solid; border-radius: 4px; }"); #endif - box.setDefaultButton(defaultButton); - return static_cast(box.exec()); + box.setDefaultButton(defaultButton); + return static_cast(box.exec()); } QMessageBox::StandardButton MyMessageBox::critical(QWidget *parent, const QString &title, const QString &text, QFlags buttons, QMessageBox::StandardButton defaultButton) { - QMessageBox box(QMessageBox::Critical, title, text, buttons, parent); + QMessageBox box(QMessageBox::Critical, title, text, buttons, parent); #ifdef ANDROID - box.setWindowModality(Qt::WindowModal); - box.setWindowFlags(Qt::ToolTip); - box.setStyleSheet("QDialog{ border: 1px solid black; border-style: solid; border-radius: 4px; }"); + box.setWindowModality(Qt::WindowModal); + box.setWindowFlags(Qt::ToolTip); + box.setStyleSheet("QDialog{ border: 1px solid black; border-style: solid; border-radius: 4px; }"); #endif - box.setDefaultButton(defaultButton); - return static_cast(box.exec()); + box.setDefaultButton(defaultButton); + return static_cast(box.exec()); } diff --git a/src/gui/qt/mymessagebox/mymessagebox.h b/src/gui/qt/mymessagebox/mymessagebox.h index 95a45c5c..2aec26d2 100644 --- a/src/gui/qt/mymessagebox/mymessagebox.h +++ b/src/gui/qt/mymessagebox/mymessagebox.h @@ -5,27 +5,27 @@ class MyMessageBox : public QMessageBox { - Q_OBJECT + Q_OBJECT public: - MyMessageBox(QWidget *parent = 0); + MyMessageBox(QWidget *parent = 0); - MyMessageBox(Icon icon, const QString &title, const QString &text, - QFlags buttons = QMessageBox::NoButton, QWidget *parent = 0, - Qt::WindowFlags flags = Qt::Dialog | Qt::MSWindowsFixedSizeDialogHint); + MyMessageBox(Icon icon, const QString &title, const QString &text, + QFlags buttons = QMessageBox::NoButton, QWidget *parent = 0, + Qt::WindowFlags flags = Qt::Dialog | Qt::MSWindowsFixedSizeDialogHint); - ~MyMessageBox(); + ~MyMessageBox(); - static QMessageBox::StandardButton information(QWidget *parent, const QString &title, - const QString &text, QFlags buttons = QMessageBox::Ok, QMessageBox::StandardButton defaultButton = QMessageBox::NoButton); + static QMessageBox::StandardButton information(QWidget *parent, const QString &title, + const QString &text, QFlags buttons = QMessageBox::Ok, QMessageBox::StandardButton defaultButton = QMessageBox::NoButton); - static QMessageBox::StandardButton question(QWidget *parent, const QString &title, - const QString &text, QFlags buttons = QMessageBox::Ok, QMessageBox::StandardButton defaultButton = QMessageBox::NoButton); + static QMessageBox::StandardButton question(QWidget *parent, const QString &title, + const QString &text, QFlags buttons = QMessageBox::Ok, QMessageBox::StandardButton defaultButton = QMessageBox::NoButton); - static QMessageBox::StandardButton warning(QWidget *parent, const QString &title, - const QString &text, QFlags buttons = QMessageBox::Ok, QMessageBox::StandardButton defaultButton = QMessageBox::NoButton); + static QMessageBox::StandardButton warning(QWidget *parent, const QString &title, + const QString &text, QFlags buttons = QMessageBox::Ok, QMessageBox::StandardButton defaultButton = QMessageBox::NoButton); - static QMessageBox::StandardButton critical(QWidget *parent, const QString &title, - const QString &text, QFlags buttons = QMessageBox::Ok, QMessageBox::StandardButton defaultButton = QMessageBox::NoButton); + static QMessageBox::StandardButton critical(QWidget *parent, const QString &title, + const QString &text, QFlags buttons = QMessageBox::Ok, QMessageBox::StandardButton defaultButton = QMessageBox::NoButton); signals: diff --git a/src/gui/qt/mymessagedialog/mymessagedialogimpl.h b/src/gui/qt/mymessagedialog/mymessagedialogimpl.h index 598a7556..e484d022 100644 --- a/src/gui/qt/mymessagedialog/mymessagedialogimpl.h +++ b/src/gui/qt/mymessagedialog/mymessagedialogimpl.h @@ -25,18 +25,18 @@ #endif enum MESSAGE_CONTENT { - NONE=0, //0: not set ;) - BACKTO_LOBBY_QUESTION, //1: leave lobby during online game: Question(Do you really wanna leave?) - INFO_AFTER_JOIN_INVITE_GAME, //2: join invite only game: Info(You can invite people with right click ...) - JOIN_INVITE_GAME_QUESTION, //3: reciev invite to game: Question(You've been invited to the game %1 by %2.
Do you want to join this game?) - INGNORE_PLAYER_QUESTION, //4: click ignore player: Question(Do you really want to put this player on ignore List?) - GT_VALUES_MISSING, //5: Selected game table style \"%1\" seems to be incomplete or defective. \n\nThe value(s) of: \n%2 \nis/are missing. - CLOSE_GAMETABLE_QUESTION, //6: close gametable: Do you really wanna quit? - GT_PICS_MISSING, //7: One or more pictures from current game table style \"%1\" were not found: - GT_OUTDATED, //8: Selected game table style \"%1\" seems to be outdated. \nThe current PokerTH game table style version is - CD_VALUES_MISSING, //9: - CD_PICS_MISSING, //10: - CD_OUTDATED //11: + NONE=0, //0: not set ;) + BACKTO_LOBBY_QUESTION, //1: leave lobby during online game: Question(Do you really wanna leave?) + INFO_AFTER_JOIN_INVITE_GAME, //2: join invite only game: Info(You can invite people with right click ...) + JOIN_INVITE_GAME_QUESTION, //3: reciev invite to game: Question(You've been invited to the game %1 by %2.
Do you want to join this game?) + INGNORE_PLAYER_QUESTION, //4: click ignore player: Question(Do you really want to put this player on ignore List?) + GT_VALUES_MISSING, //5: Selected game table style \"%1\" seems to be incomplete or defective. \n\nThe value(s) of: \n%2 \nis/are missing. + CLOSE_GAMETABLE_QUESTION, //6: close gametable: Do you really wanna quit? + GT_PICS_MISSING, //7: One or more pictures from current game table style \"%1\" were not found: + GT_OUTDATED, //8: Selected game table style \"%1\" seems to be outdated. \nThe current PokerTH game table style version is + CD_VALUES_MISSING, //9: + CD_PICS_MISSING, //10: + CD_OUTDATED //11: }; diff --git a/src/gui/qt/newlocalgamedialog/newgamedialogimpl.cpp b/src/gui/qt/newlocalgamedialog/newgamedialogimpl.cpp index 0c5354f7..d2b13143 100755 --- a/src/gui/qt/newlocalgamedialog/newgamedialogimpl.cpp +++ b/src/gui/qt/newlocalgamedialog/newgamedialogimpl.cpp @@ -100,12 +100,10 @@ bool newGameDialogImpl::eventFilter(QObject *obj, QEvent *event) } event->ignore(); return false; - } - else if (event->type() == QEvent::KeyPress && keyEvent->key() == Qt::Key_Back) { + } else if (event->type() == QEvent::KeyPress && keyEvent->key() == Qt::Key_Back) { this->reject(); return true; - } - else { + } else { // pass the event on to the parent class return QDialog::eventFilter(obj, event); } diff --git a/src/gui/qt/newlocalgamedialog/newgamedialogimpl.h b/src/gui/qt/newlocalgamedialog/newgamedialogimpl.h index a71aaed2..48d3bcc1 100755 --- a/src/gui/qt/newlocalgamedialog/newgamedialogimpl.h +++ b/src/gui/qt/newlocalgamedialog/newgamedialogimpl.h @@ -42,7 +42,7 @@ public: return myChangeCompleteBlindsDialog; } - bool eventFilter(QObject *obj, QEvent *event); + bool eventFilter(QObject *obj, QEvent *event); public slots: diff --git a/src/gui/qt/settingsdialog/manualblindsorderdialog/manualblindsorderdialogimpl.cpp b/src/gui/qt/settingsdialog/manualblindsorderdialog/manualblindsorderdialogimpl.cpp index 8e095cca..60fe8056 100644 --- a/src/gui/qt/settingsdialog/manualblindsorderdialog/manualblindsorderdialogimpl.cpp +++ b/src/gui/qt/settingsdialog/manualblindsorderdialog/manualblindsorderdialogimpl.cpp @@ -48,8 +48,8 @@ void manualBlindsOrderDialogImpl::addBlindValueToList() if(listWidget_blinds->count() == 30) { MyMessageBox::warning(this, tr("Manual Blinds Order"), - tr("You cannot set more than 30 manual blinds."), - QMessageBox::Close); + tr("You cannot set more than 30 manual blinds."), + QMessageBox::Close); } else { listWidget_blinds->addItem(QString::number(spinBox_input->value(),10)); sortBlindsList(); diff --git a/src/gui/qt/settingsdialog/selectavatardialog/selectavatardialogimpl.cpp b/src/gui/qt/settingsdialog/selectavatardialog/selectavatardialogimpl.cpp index 2ce2b0d8..fc8dd03b 100644 --- a/src/gui/qt/settingsdialog/selectavatardialog/selectavatardialogimpl.cpp +++ b/src/gui/qt/settingsdialog/selectavatardialog/selectavatardialogimpl.cpp @@ -239,8 +239,8 @@ void selectAvatarDialogImpl::isAccepted() if(groupBox->isChecked()) { if(myItemList.size() == 0) { MyMessageBox::warning(this, tr("Avatar File Error"), - tr("Please select an avatar from the list!"), - QMessageBox::Ok); + tr("Please select an avatar from the list!"), + QMessageBox::Ok); settingsCorrect = FALSE; } else settingsCorrect = TRUE;; } @@ -254,18 +254,18 @@ void selectAvatarDialogImpl::isAccepted() settingsCorrect = TRUE; } else { MyMessageBox::warning(this, tr("Avatar File Error"), - tr("The file size of the chosen picture is too big. (max. 30KB)\n" - "Please choose a smaller picture!"), - QMessageBox::Ok); + tr("The file size of the chosen picture is too big. (max. 30KB)\n" + "Please choose a smaller picture!"), + QMessageBox::Ok); settingsCorrect = FALSE; externalAvatar = ""; } } else { MyMessageBox::warning(this, tr("Avatar File Error"), - tr("The entered avatar picture doesn't exist.\n" - "Please enter an valid picture!"), - QMessageBox::Ok); + tr("The entered avatar picture doesn't exist.\n" + "Please enter an valid picture!"), + QMessageBox::Ok); settingsCorrect = FALSE; externalAvatar = ""; } diff --git a/src/gui/qt/settingsdialog/settingsdialogimpl.cpp b/src/gui/qt/settingsdialog/settingsdialogimpl.cpp index 4a0aeff8..3550d5dd 100644 --- a/src/gui/qt/settingsdialog/settingsdialogimpl.cpp +++ b/src/gui/qt/settingsdialog/settingsdialogimpl.cpp @@ -37,11 +37,11 @@ settingsDialogImpl::settingsDialogImpl(QWidget *parent, ConfigFile *c, selectAva setupUi(this); #ifdef ANDROID - stackedWidget->removeWidget(page_styles); - listWidget->takeItem(1); - label_soundvol->hide(); - label_soundVolume->hide(); - horizontalSlider_soundVolume->hide(); + stackedWidget->removeWidget(page_styles); + listWidget->takeItem(1); + label_soundvol->hide(); + label_soundVolume->hide(); + horizontalSlider_soundVolume->hide(); #endif myManualBlindsOrderDialog = new manualBlindsOrderDialogImpl; @@ -131,8 +131,8 @@ settingsDialogImpl::settingsDialogImpl(QWidget *parent, ConfigFile *c, selectAva connect( pushButton_internetGameRemoveIgnoredPlayer, SIGNAL( clicked()), this, SLOT( removePlayerFromIgnoredPlayersList())); #ifdef GUI_800x480 - //make the scrollbar touchable for mobile guis - comboBox_switchLanguage->setStyleSheet("QObject {font: 30px} QScrollBar:vertical { border: 1px solid grey; background: white; width: 60px; margin: 0px -1px 0px 0px; } QScrollBar::handle:vertical { border-radius: 3px; border: 2px solid grey; background: LightGrey ; min-height: 60px; } QScrollBar::add-line:vertical { background: none; } QScrollBar::sub-line:vertical { background: none; } QScrollBar:up-arrow:vertical, QScrollBar::down-arrow:vertical { background: none; } QScrollBar::add-page:vertical, QScrollBar::sub-page:vertical { background: none; }"); + //make the scrollbar touchable for mobile guis + comboBox_switchLanguage->setStyleSheet("QObject {font: 30px} QScrollBar:vertical { border: 1px solid grey; background: white; width: 60px; margin: 0px -1px 0px 0px; } QScrollBar::handle:vertical { border-radius: 3px; border: 2px solid grey; background: LightGrey ; min-height: 60px; } QScrollBar::add-line:vertical { background: none; } QScrollBar::sub-line:vertical { background: none; } QScrollBar:up-arrow:vertical, QScrollBar::down-arrow:vertical { background: none; } QScrollBar::add-page:vertical, QScrollBar::sub-page:vertical { background: none; }"); #endif } @@ -211,10 +211,10 @@ void settingsDialogImpl::prepareDialog() checkBox_useIpv6->setChecked(myConfig->readConfigInt("ServerUseIpv6")); checkBox_useSctp->setChecked(myConfig->readConfigInt("ServerUseSctp")); - //Internet Game Settings + //Internet Game Settings - checkBox_InternetServerUseSctp->hide(); //temporarely disabled until sctp support is back - label_whatIsSctp->hide(); + checkBox_InternetServerUseSctp->hide(); //temporarely disabled until sctp support is back + label_whatIsSctp->hide(); lineEdit_InternetServerListAddress->setText(QString::fromUtf8(myConfig->readConfigString("InternetServerListAddress").c_str())); lineEdit_InternetServerAddress->setText(QString::fromUtf8(myConfig->readConfigString("InternetServerAddress").c_str())); @@ -237,11 +237,11 @@ void settingsDialogImpl::prepareDialog() checkBox_InetGane_AutoLeaveTheTableAfterGameFinished->setChecked(myConfig->readConfigInt("NetAutoLeaveGameAfterFinish")); comboBox_internetGameType->setCurrentIndex(myConfig->readConfigInt("InternetGameType")); lineEdit_internetGameName->setText(QString::fromUtf8(myConfig->readConfigString("InternetGameName").c_str())); - if(myConfig->readConfigInt("InternetServerConfigMode")) { - groupBox_manualServerConfig->setChecked(TRUE); - } else { - groupBox_automaticServerConfig->setChecked(TRUE); - } + if(myConfig->readConfigInt("InternetServerConfigMode")) { + groupBox_manualServerConfig->setChecked(TRUE); + } else { + groupBox_automaticServerConfig->setChecked(TRUE); + } std::list playerIgnoreList = myConfig->readConfigStringList("PlayerIgnoreList"); std::list::iterator it5; @@ -275,21 +275,21 @@ void settingsDialogImpl::prepareDialog() #ifdef GUI_800x480 // define PokerTH default GameTableStyle for Maemo treeWidget_gameTableStyles->clear(); - QString filename; + QString filename; #ifdef MAEMO - filename = "defaulttablestyle_800x480.xml"; + filename = "defaulttablestyle_800x480.xml"; #elif ANDROID - filename = "android_tablestyle_800x480.xml"; + filename = "android_tablestyle_800x480.xml"; #endif GameTableStyleReader defaultTableStyle(myConfig, this); - defaultTableStyle.readStyleFile(QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str())+"gfx/gui/table/default_800x480/"+filename); + defaultTableStyle.readStyleFile(QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str())+"gfx/gui/table/default_800x480/"+filename); if(defaultTableStyle.getLoadedSuccessfull()) { QStringList tempStringList1; tempStringList1 << defaultTableStyle.getStyleDescription() << defaultTableStyle.getStyleMaintainerName(); MyStyleListItem *defaultTableItem = new MyStyleListItem(tempStringList1, treeWidget_gameTableStyles); - defaultTableItem->setData(0, 15, QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str())+"gfx/gui/table/default_800x480/"+filename); + defaultTableItem->setData(0, 15, QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str())+"gfx/gui/table/default_800x480/"+filename); defaultTableItem->setData(0, 16, POKERTH_DISTRIBUTED_STYLE); - defaultTableItem->setData(0, Qt::ToolTipRole, QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str())+"gfx/gui/table/default_800x480/"+filename); + defaultTableItem->setData(0, Qt::ToolTipRole, QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str())+"gfx/gui/table/default_800x480/"+filename); defaultTableItem->setData(2, Qt::ToolTipRole, defaultTableStyle.getMyStateToolTipInfo()); if(defaultTableStyle.getState()) defaultTableItem->setIcon(2, QIcon(":/gfx/emblem-important.png")); else defaultTableItem->setIcon(2, QIcon(":/gfx/dialog_ok_apply.png")); @@ -383,23 +383,23 @@ void settingsDialogImpl::prepareDialog() showCurrentGameTableStylePreview(); //CARDS - // define PokerTH 1.0 default carddeck - treeWidget_cardDeckStyles->clear(); - CardDeckStyleReader defaultCardStyle10(myConfig, this); - defaultCardStyle10.readStyleFile(QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str())+"gfx/cards/default_800x480/defaultdeckstyle_800x480.xml"); - if(defaultCardStyle10.getLoadedSuccessfull()) { - QStringList tempStringList1; - tempStringList1 << defaultCardStyle10.getStyleDescription() << defaultCardStyle10.getStyleMaintainerName(); - MyStyleListItem *defaultCardItem = new MyStyleListItem(tempStringList1, treeWidget_cardDeckStyles); - defaultCardItem->setData(0, 15, QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str())+"gfx/cards/default_800x480/defaultdeckstyle_800x480.xml"); - defaultCardItem->setData(0, 16, POKERTH_DISTRIBUTED_STYLE); - defaultCardItem->setData(0, Qt::ToolTipRole, QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str())+"gfx/cards/default_800x480/defaultdeckstyle_800x480.xml"); - defaultCardItem->setData(2, Qt::ToolTipRole, defaultCardStyle10.getMyStateToolTipInfo()); - if(defaultCardStyle10.getState()) defaultCardItem->setIcon(2, QIcon(":/gfx/emblem-important.png")); - else defaultCardItem->setIcon(2, QIcon(":/gfx/dialog_ok_apply.png")); - } + // define PokerTH 1.0 default carddeck + treeWidget_cardDeckStyles->clear(); + CardDeckStyleReader defaultCardStyle10(myConfig, this); + defaultCardStyle10.readStyleFile(QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str())+"gfx/cards/default_800x480/defaultdeckstyle_800x480.xml"); + if(defaultCardStyle10.getLoadedSuccessfull()) { + QStringList tempStringList1; + tempStringList1 << defaultCardStyle10.getStyleDescription() << defaultCardStyle10.getStyleMaintainerName(); + MyStyleListItem *defaultCardItem = new MyStyleListItem(tempStringList1, treeWidget_cardDeckStyles); + defaultCardItem->setData(0, 15, QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str())+"gfx/cards/default_800x480/defaultdeckstyle_800x480.xml"); + defaultCardItem->setData(0, 16, POKERTH_DISTRIBUTED_STYLE); + defaultCardItem->setData(0, Qt::ToolTipRole, QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str())+"gfx/cards/default_800x480/defaultdeckstyle_800x480.xml"); + defaultCardItem->setData(2, Qt::ToolTipRole, defaultCardStyle10.getMyStateToolTipInfo()); + if(defaultCardStyle10.getState()) defaultCardItem->setIcon(2, QIcon(":/gfx/emblem-important.png")); + else defaultCardItem->setIcon(2, QIcon(":/gfx/dialog_ok_apply.png")); + } #ifndef GUI_800x480 - //define PokerTH old default CardDeck + //define PokerTH old default CardDeck CardDeckStyleReader defaultCardStyle(myConfig, this); defaultCardStyle.readStyleFile(QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str())+"gfx/cards/default/defaultdeckstyle.xml"); if(defaultCardStyle.getLoadedSuccessfull()) { @@ -409,11 +409,11 @@ void settingsDialogImpl::prepareDialog() defaultCardItem->setData(0, 15, QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str())+"gfx/cards/default/defaultdeckstyle.xml"); defaultCardItem->setData(0, 16, POKERTH_DISTRIBUTED_STYLE); defaultCardItem->setData(0, Qt::ToolTipRole, QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str())+"gfx/cards/default/defaultdeckstyle.xml"); - defaultCardItem->setData(2, Qt::ToolTipRole, defaultCardStyle.getMyStateToolTipInfo()); - if(defaultCardStyle.getState()) defaultCardItem->setIcon(2, QIcon(":/gfx/emblem-important.png")); - else defaultCardItem->setIcon(2, QIcon(":/gfx/dialog_ok_apply.png")); + defaultCardItem->setData(2, Qt::ToolTipRole, defaultCardStyle.getMyStateToolTipInfo()); + if(defaultCardStyle.getState()) defaultCardItem->setIcon(2, QIcon(":/gfx/emblem-important.png")); + else defaultCardItem->setIcon(2, QIcon(":/gfx/dialog_ok_apply.png")); } - //define PokerTH old default CardDeck4c + //define PokerTH old default CardDeck4c CardDeckStyleReader default4cCardStyle(myConfig, this); default4cCardStyle.readStyleFile(QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str())+"gfx/cards/default4c/default4cdeckstyle.xml"); if(default4cCardStyle.getLoadedSuccessfull()) { @@ -421,11 +421,11 @@ void settingsDialogImpl::prepareDialog() tempStringList1 << default4cCardStyle.getStyleDescription() << default4cCardStyle.getStyleMaintainerName(); MyStyleListItem *default4cCardItem = new MyStyleListItem(tempStringList1, treeWidget_cardDeckStyles); default4cCardItem->setData(0, 15, QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str())+"gfx/cards/default4c/default4cdeckstyle.xml"); - default4cCardItem->setData(0, 16, POKERTH_DISTRIBUTED_STYLE); + default4cCardItem->setData(0, 16, POKERTH_DISTRIBUTED_STYLE); default4cCardItem->setData(0, Qt::ToolTipRole, QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str())+"gfx/cards/default4c/default4cdeckstyle.xml"); - default4cCardItem->setData(2, Qt::ToolTipRole, default4cCardStyle.getMyStateToolTipInfo()); - if(default4cCardStyle.getState()) default4cCardItem->setIcon(2, QIcon(":/gfx/emblem-important.png")); - else default4cCardItem->setIcon(2, QIcon(":/gfx/dialog_ok_apply.png")); + default4cCardItem->setData(2, Qt::ToolTipRole, default4cCardStyle.getMyStateToolTipInfo()); + if(default4cCardStyle.getState()) default4cCardItem->setIcon(2, QIcon(":/gfx/emblem-important.png")); + else default4cCardItem->setIcon(2, QIcon(":/gfx/dialog_ok_apply.png")); } #endif //load secondary card styles into list (if fallback no entry) @@ -441,9 +441,9 @@ void settingsDialogImpl::prepareDialog() nextItem->setData(0, 15,QString::fromUtf8(it2->c_str())); nextItem->setData(0, 16, ADDITIONAL_STYLE); nextItem->setData(0, Qt::ToolTipRole,QString::fromUtf8(it2->c_str())); - nextItem->setData(2, Qt::ToolTipRole, nextStyle.getMyStateToolTipInfo()); - if(nextStyle.getState()) nextItem->setIcon(2, QIcon(":/gfx/emblem-important.png")); - else nextItem->setIcon(2, QIcon(":/gfx/dialog_ok_apply.png")); + nextItem->setData(2, Qt::ToolTipRole, nextStyle.getMyStateToolTipInfo()); + if(nextStyle.getState()) nextItem->setIcon(2, QIcon(":/gfx/emblem-important.png")); + else nextItem->setIcon(2, QIcon(":/gfx/dialog_ok_apply.png")); treeWidget_cardDeckStyles->addTopLevelItem(nextItem); } } @@ -579,9 +579,9 @@ void settingsDialogImpl::isAccepted() if(checkSetPlayerNicks.count() != 10) { MyMessageBox::warning(this, tr("Settings Error"), - tr("The opponent names are not unique.\n" - "Please choose different names for each Opponent!"), - QMessageBox::Ok); + tr("The opponent names are not unique.\n" + "Please choose different names for each Opponent!"), + QMessageBox::Ok); settingsCorrect = FALSE; } else { //save nicks and avatars @@ -660,9 +660,9 @@ void settingsDialogImpl::isAccepted() myConfig->writeConfigString("InternetServerListAddress", lineEdit_InternetServerListAddress->text().toUtf8().constData()); } else { MyMessageBox::warning(this, tr("Settings Error"), - tr("The entered server list address is not a valid URL.\n" - "Please enter a valid server list address!"), - QMessageBox::Ok); + tr("The entered server list address is not a valid URL.\n" + "Please enter a valid server list address!"), + QMessageBox::Ok); settingsCorrect = FALSE; } } @@ -722,9 +722,9 @@ void settingsDialogImpl::isAccepted() myConfig->writeConfigString("FlipsideOwnFile", lineEdit_OwnFlipsideFilename->text().toUtf8().constData()); } else { MyMessageBox::warning(this, tr("Settings Error"), - tr("The entered flipside picture doesn't exist.\n" - "Please enter an valid picture!"), - QMessageBox::Ok); + tr("The entered flipside picture doesn't exist.\n" + "Please enter an valid picture!"), + QMessageBox::Ok); settingsCorrect = FALSE; } } @@ -782,9 +782,9 @@ void settingsDialogImpl::isAccepted() myConfig->writeConfigString("LogDir", lineEdit_logDir->text().toUtf8().constData()); } else { MyMessageBox::warning(this, tr("Settings Error"), - tr("The log file directory doesn't exist.\n" - "Please select an valid directory!"), - QMessageBox::Ok); + tr("The log file directory doesn't exist.\n" + "Please select an valid directory!"), + QMessageBox::Ok); settingsCorrect = FALSE; } @@ -812,8 +812,8 @@ void settingsDialogImpl::isAccepted() if(languageIsChanged) { MyMessageBox::information(this, tr("Language Changed"), - tr("You have changed application language to %1.\nPlease restart PokerTH to load new language!").arg(comboBox_switchLanguage->itemText(changedLanguageIndex)), - QMessageBox::Ok); + tr("You have changed application language to %1.\nPlease restart PokerTH to load new language!").arg(comboBox_switchLanguage->itemText(changedLanguageIndex)), + QMessageBox::Ok); } //Wenn alles richtig eingegeben wurde --> Dialog schließen @@ -951,14 +951,14 @@ void settingsDialogImpl::setLogDir() if(logDir.exists()) { lineEdit_logDir->setText(dir); MyMessageBox::information(this, tr("Settings Information"), - tr("You have changed the log file directory.\n" - "Please restart PokerTH to use the new directory for the log files!"), - QMessageBox::Ok); + tr("You have changed the log file directory.\n" + "Please restart PokerTH to use the new directory for the log files!"), + QMessageBox::Ok); } else { MyMessageBox::warning(this, tr("Settings Error"), - tr("The log file directory doesn't exist.\n" - "Please select an valid directory!"), - QMessageBox::Ok); + tr("The log file directory doesn't exist.\n" + "Please select an valid directory!"), + QMessageBox::Ok); } } } @@ -1059,8 +1059,8 @@ void settingsDialogImpl::setFirstSmallBlindMargin() if(radioButton_manualBlindsOrder->isChecked() && !myManualBlindsList.empty()) { if(spinBox_firstSmallBlind->value() > myManualBlindsList.front()) { MyMessageBox::warning(this, tr("Blinds Error"), - tr("The first element in your manual-blinds-list \nis smaller than current first-small-blind!\nThis first-small-blind-value will be set to maximum allowed value."), - QMessageBox::Close); + tr("The first element in your manual-blinds-list \nis smaller than current first-small-blind!\nThis first-small-blind-value will be set to maximum allowed value."), + QMessageBox::Close); } spinBox_firstSmallBlind->setMaximum(myManualBlindsList.front()); } else { @@ -1069,8 +1069,8 @@ void settingsDialogImpl::setFirstSmallBlindMargin() if(radioButton_netManualBlindsOrder->isChecked() && !myNetManualBlindsList.empty()) { if(spinBox_netFirstSmallBlind->value() > myNetManualBlindsList.front()) { MyMessageBox::warning(this, tr("Blinds Error"), - tr("The first element in your manual-blinds-list \nis smaller than current first-small-blind!\nThis first-small-blind-value will be set to maximum allowed value."), - QMessageBox::Close); + tr("The first element in your manual-blinds-list \nis smaller than current first-small-blind!\nThis first-small-blind-value will be set to maximum allowed value."), + QMessageBox::Close); } spinBox_netFirstSmallBlind->setMaximum(myNetManualBlindsList.front()); } else { @@ -1187,8 +1187,8 @@ void settingsDialogImpl::addGameTableStyle() if(fileNameAlreadyFound) { MyMessageBox::warning(this, tr("Game Table Style Error"), - tr("Selected game table style file is already in the list. \nPlease select another one to add!"), - QMessageBox::Ok); + tr("Selected game table style file is already in the list. \nPlease select another one to add!"), + QMessageBox::Ok); } else { GameTableStyleReader newStyle(myConfig, this); newStyle.readStyleFile(fileName); @@ -1210,8 +1210,8 @@ void settingsDialogImpl::addGameTableStyle() if(newStyle.getState() != GT_STYLE_OK) newStyle.showErrorMessage(); } else { MyMessageBox::warning(this, tr("Game Table Style File Error"), - tr("Could not load game table style file correctly. \nStyle will not be placed into list!"), - QMessageBox::Ok); + tr("Could not load game table style file correctly. \nStyle will not be placed into list!"), + QMessageBox::Ok); } } //save current filepath @@ -1313,8 +1313,8 @@ void settingsDialogImpl::addCardDeckStyle() if(fileNameAlreadyFound) { MyMessageBox::warning(this, tr("Card Deck Style Error"), - tr("Selected card deck style file is already in the list. \nPlease select another one to add!"), - QMessageBox::Ok); + tr("Selected card deck style file is already in the list. \nPlease select another one to add!"), + QMessageBox::Ok); } else { CardDeckStyleReader newStyle(myConfig, this); newStyle.readStyleFile(fileName); @@ -1325,21 +1325,21 @@ void settingsDialogImpl::addCardDeckStyle() newItem->setData(0, 15,fileName); newItem->setData(0, 16, ADDITIONAL_STYLE); newItem->setData(0, Qt::ToolTipRole,fileName); - newItem->setData(2, Qt::ToolTipRole, newStyle.getMyStateToolTipInfo()); - if(newStyle.getState() != CD_STYLE_OK) newItem->setIcon(2, QIcon(":/gfx/emblem-important.png")); - else newItem->setIcon(2, QIcon(":/gfx/dialog-ok-apply.png")); + newItem->setData(2, Qt::ToolTipRole, newStyle.getMyStateToolTipInfo()); + if(newStyle.getState() != CD_STYLE_OK) newItem->setIcon(2, QIcon(":/gfx/emblem-important.png")); + else newItem->setIcon(2, QIcon(":/gfx/dialog-ok-apply.png")); - qDebug() << "settings: " << newStyle.getStyleDescription() << newStyle.getState(); - if(newStyle.getState() != CD_STYLE_OK) newStyle.showErrorMessage(); + qDebug() << "settings: " << newStyle.getStyleDescription() << newStyle.getState(); + if(newStyle.getState() != CD_STYLE_OK) newStyle.showErrorMessage(); - treeWidget_cardDeckStyles->addTopLevelItem(newItem); + treeWidget_cardDeckStyles->addTopLevelItem(newItem); treeWidget_cardDeckStyles->setCurrentItem(newItem); treeWidget_cardDeckStyles->sortItems(0, Qt::AscendingOrder); } else { MyMessageBox::warning(this, tr("Card Deck Style File Error"), - tr("Could not load card deck style file correctly. \nStyle will not be placed into list!"), - QMessageBox::Ok); + tr("Could not load card deck style file correctly. \nStyle will not be placed into list!"), + QMessageBox::Ok); } } //save current filepath @@ -1376,9 +1376,9 @@ void settingsDialogImpl::removePlayerFromIgnoredPlayersList() void settingsDialogImpl::resetSettings() { int ret = MyMessageBox::warning(this, tr("PokerTH - Settings"), - tr("Attention: this will delete all your personal settings and close PokerTH!\n" - "Do you really want to reset factory settings?"), - QMessageBox::Yes | QMessageBox::No); + tr("Attention: this will delete all your personal settings and close PokerTH!\n" + "Do you really want to reset factory settings?"), + QMessageBox::Yes | QMessageBox::No); if(ret == QMessageBox::Yes) { myConfig->deleteConfigFile(); exit(0); diff --git a/src/gui/qt/settingsdialog/settingsdialogimpl.h b/src/gui/qt/settingsdialog/settingsdialogimpl.h index bdd5c261..288e245d 100644 --- a/src/gui/qt/settingsdialog/settingsdialogimpl.h +++ b/src/gui/qt/settingsdialog/settingsdialogimpl.h @@ -143,7 +143,7 @@ private: bool calledIngame; int changedLanguageIndex; guiLog *myGuiLog; - FlickCharm *fc; + FlickCharm *fc; }; #endif diff --git a/src/gui/qt/sound/androidapi8dummy.cpp b/src/gui/qt/sound/androidapi8dummy.cpp index ed653532..d3e87360 100644 --- a/src/gui/qt/sound/androidapi8dummy.cpp +++ b/src/gui/qt/sound/androidapi8dummy.cpp @@ -2,7 +2,7 @@ #include "androidapi8dummy.h" AndroidApi8Dummy::AndroidApi8Dummy(ConfigFile *c, QObject *parent) : - QObject(parent), myConfig(c) + QObject(parent), myConfig(c) { } diff --git a/src/gui/qt/sound/androidapi8dummy.h b/src/gui/qt/sound/androidapi8dummy.h index 4f1bb2dc..87f54e12 100644 --- a/src/gui/qt/sound/androidapi8dummy.h +++ b/src/gui/qt/sound/androidapi8dummy.h @@ -6,24 +6,24 @@ class ConfigFile; class AndroidApi8Dummy : public QObject { - Q_OBJECT + Q_OBJECT public: - explicit AndroidApi8Dummy(ConfigFile *c, QObject *parent = 0); - ~AndroidApi8Dummy(); + explicit AndroidApi8Dummy(ConfigFile *c, QObject *parent = 0); + ~AndroidApi8Dummy(); signals: public slots: - void registerSound(const QString&, const QString&){} - void reallyPlaySound(const QString&){} - void playSound(const std::string&, int){} - void initAudio(){} - void closeAudio(){} - void reInit(){} + void registerSound(const QString&, const QString&) {} + void reallyPlaySound(const QString&) {} + void playSound(const std::string&, int) {} + void initAudio() {} + void closeAudio() {} + void reInit() {} private: - ConfigFile *myConfig; + ConfigFile *myConfig; }; diff --git a/src/gui/qt/sound/androidaudio.cpp b/src/gui/qt/sound/androidaudio.cpp index a4858bb7..b5619828 100644 --- a/src/gui/qt/sound/androidaudio.cpp +++ b/src/gui/qt/sound/androidaudio.cpp @@ -5,103 +5,103 @@ #include AndroidAudio::AndroidAudio(ConfigFile *c, QObject *parent) : - QObject(parent), mEngineObject(NULL), mEngineEngine(NULL), mOutputMixObject(NULL), mSounds(), mSoundCount(0), mPlayerObject(NULL), myConfig(c), audioEnabled(FALSE) + QObject(parent), mEngineObject(NULL), mEngineEngine(NULL), mOutputMixObject(NULL), mSounds(), mSoundCount(0), mPlayerObject(NULL), myConfig(c), audioEnabled(FALSE) { - initAudio(); + initAudio(); } AndroidAudio::~AndroidAudio() { - closeAudio(); + closeAudio(); } void AndroidAudio::initAudio() { - if (!audioEnabled && myConfig->readConfigInt("PlaySoundEffects")) { - createEngine(); - startSoundPlayer(); - audioEnabled = TRUE; - } + if (!audioEnabled && myConfig->readConfigInt("PlaySoundEffects")) { + createEngine(); + startSoundPlayer(); + audioEnabled = TRUE; + } } void AndroidAudio::closeAudio() { - if(audioEnabled) { - destroyEngine(); + if(audioEnabled) { + destroyEngine(); - for (int32_t i = 0; i < mSoundCount; ++i) { - qDeleteAll(mSounds); - } - audioEnabled = FALSE; - } + for (int32_t i = 0; i < mSoundCount; ++i) { + qDeleteAll(mSounds); + } + audioEnabled = FALSE; + } } void AndroidAudio::reInit() { - initAudio(); + initAudio(); } // create the engine and output mix objects void AndroidAudio::createEngine() { - SLresult result; + SLresult result; - // create engine - result = slCreateEngine(&mEngineObject, 0, NULL, 0, NULL, NULL); - Q_ASSERT(SL_RESULT_SUCCESS == result); + // create engine + result = slCreateEngine(&mEngineObject, 0, NULL, 0, NULL, NULL); + Q_ASSERT(SL_RESULT_SUCCESS == result); - // realize the engine - result = (*mEngineObject)->Realize(mEngineObject, SL_BOOLEAN_FALSE); - Q_ASSERT(SL_RESULT_SUCCESS == result); + // realize the engine + result = (*mEngineObject)->Realize(mEngineObject, SL_BOOLEAN_FALSE); + Q_ASSERT(SL_RESULT_SUCCESS == result); - // get the engine interface, which is needed in order to create other objects - result = (*mEngineObject)->GetInterface(mEngineObject, SL_IID_ENGINE, &mEngineEngine); - Q_ASSERT(SL_RESULT_SUCCESS == result); + // get the engine interface, which is needed in order to create other objects + result = (*mEngineObject)->GetInterface(mEngineObject, SL_IID_ENGINE, &mEngineEngine); + Q_ASSERT(SL_RESULT_SUCCESS == result); - // create output mix - const SLInterfaceID ids[] = {}; - const SLboolean req[] = {}; - result = (*mEngineEngine)->CreateOutputMix(mEngineEngine, &mOutputMixObject, 0, ids, req); - Q_ASSERT(SL_RESULT_SUCCESS == result); + // create output mix + const SLInterfaceID ids[] = {}; + const SLboolean req[] = {}; + result = (*mEngineEngine)->CreateOutputMix(mEngineEngine, &mOutputMixObject, 0, ids, req); + Q_ASSERT(SL_RESULT_SUCCESS == result); - // realize the output mix - result = (*mOutputMixObject)->Realize(mOutputMixObject, SL_BOOLEAN_FALSE); - Q_ASSERT(SL_RESULT_SUCCESS == result); + // realize the output mix + result = (*mOutputMixObject)->Realize(mOutputMixObject, SL_BOOLEAN_FALSE); + Q_ASSERT(SL_RESULT_SUCCESS == result); - qDebug() << "Created Android Audio Engine"; + qDebug() << "Created Android Audio Engine"; } void AndroidAudio::destroyEngine() { - if (mOutputMixObject != NULL) { - (*mOutputMixObject)->Destroy(mOutputMixObject); - } + if (mOutputMixObject != NULL) { + (*mOutputMixObject)->Destroy(mOutputMixObject); + } - if (mEngineObject != NULL) { - (*mEngineObject)->Destroy(mEngineObject); - } + if (mEngineObject != NULL) { + (*mEngineObject)->Destroy(mEngineObject); + } - if (mPlayerObject != NULL) { - (*mPlayerObject)->Destroy(mPlayerObject); - } + if (mPlayerObject != NULL) { + (*mPlayerObject)->Destroy(mPlayerObject); + } - for (int32_t i = 0; i < mSoundCount; ++i) { - mSounds.values().at(i)->unload(); - } + for (int32_t i = 0; i < mSoundCount; ++i) { + mSounds.values().at(i)->unload(); + } - qDebug() << "Destroyed Android Audio Engine"; + qDebug() << "Destroyed Android Audio Engine"; } void AndroidAudio::registerSound(const QString& path, const QString& name) { // qDebug() << "registerSound:" << path << name; - AndroidSoundEffect *lSound = new AndroidSoundEffect(path, this); + AndroidSoundEffect *lSound = new AndroidSoundEffect(path, this); // qDebug() << "registerSound:created"; - mSounds[name] = lSound; + mSounds[name] = lSound; // qDebug() << "registerSound:loading"; - lSound->load(); + lSound->load(); // qDebug() << "registerSound:loaded"; } @@ -109,98 +109,99 @@ void AndroidAudio::startSoundPlayer() { // qDebug() << "Starting Sound Player"; - SLresult lRes; + SLresult lRes; - //Configure the sound player input/output - SLDataLocator_AndroidSimpleBufferQueue lDataLocatorIn; - lDataLocatorIn.locatorType = SL_DATALOCATOR_BUFFERQUEUE; - lDataLocatorIn.numBuffers = 1; + //Configure the sound player input/output + SLDataLocator_AndroidSimpleBufferQueue lDataLocatorIn; + lDataLocatorIn.locatorType = SL_DATALOCATOR_BUFFERQUEUE; + lDataLocatorIn.numBuffers = 1; - //Set the data format as mono-pcm-16bit-44100 - SLDataFormat_PCM lDataFormat; - lDataFormat.formatType = SL_DATAFORMAT_PCM; - lDataFormat.numChannels = 2; - lDataFormat.samplesPerSec = SL_SAMPLINGRATE_44_1; - lDataFormat.bitsPerSample = SL_PCMSAMPLEFORMAT_FIXED_16; - lDataFormat.containerSize = SL_PCMSAMPLEFORMAT_FIXED_16; - lDataFormat.channelMask = SL_SPEAKER_FRONT_LEFT | SL_SPEAKER_FRONT_RIGHT; - lDataFormat.endianness = SL_BYTEORDER_LITTLEENDIAN; + //Set the data format as mono-pcm-16bit-44100 + SLDataFormat_PCM lDataFormat; + lDataFormat.formatType = SL_DATAFORMAT_PCM; + lDataFormat.numChannels = 2; + lDataFormat.samplesPerSec = SL_SAMPLINGRATE_44_1; + lDataFormat.bitsPerSample = SL_PCMSAMPLEFORMAT_FIXED_16; + lDataFormat.containerSize = SL_PCMSAMPLEFORMAT_FIXED_16; + lDataFormat.channelMask = SL_SPEAKER_FRONT_LEFT | SL_SPEAKER_FRONT_RIGHT; + lDataFormat.endianness = SL_BYTEORDER_LITTLEENDIAN; - SLDataSource lDataSource; - lDataSource.pLocator = &lDataLocatorIn; - lDataSource.pFormat = &lDataFormat; + SLDataSource lDataSource; + lDataSource.pLocator = &lDataLocatorIn; + lDataSource.pFormat = &lDataFormat; - SLDataLocator_OutputMix lDataLocatorOut; - lDataLocatorOut.locatorType = SL_DATALOCATOR_OUTPUTMIX; - lDataLocatorOut.outputMix = mOutputMixObject; + SLDataLocator_OutputMix lDataLocatorOut; + lDataLocatorOut.locatorType = SL_DATALOCATOR_OUTPUTMIX; + lDataLocatorOut.outputMix = mOutputMixObject; - SLDataSink lDataSink; - lDataSink.pLocator = &lDataLocatorOut; - lDataSink.pFormat = NULL; + SLDataSink lDataSink; + lDataSink.pLocator = &lDataLocatorOut; + lDataSink.pFormat = NULL; - //Create the sound player - const SLuint32 lSoundPlayerIIDCount = 2; - const SLInterfaceID lSoundPlayerIIDs[] = { SL_IID_PLAY, SL_IID_BUFFERQUEUE }; - const SLboolean lSoundPlayerReqs[] = { SL_BOOLEAN_TRUE, SL_BOOLEAN_TRUE }; + //Create the sound player + const SLuint32 lSoundPlayerIIDCount = 2; + const SLInterfaceID lSoundPlayerIIDs[] = { SL_IID_PLAY, SL_IID_BUFFERQUEUE }; + const SLboolean lSoundPlayerReqs[] = { SL_BOOLEAN_TRUE, SL_BOOLEAN_TRUE }; // qDebug() << "Configured Sound Player"; - lRes = (*mEngineEngine)->CreateAudioPlayer(mEngineEngine, &mPlayerObject, &lDataSource, &lDataSink, lSoundPlayerIIDCount, lSoundPlayerIIDs, lSoundPlayerReqs); - Q_ASSERT(SL_RESULT_SUCCESS == lRes); + lRes = (*mEngineEngine)->CreateAudioPlayer(mEngineEngine, &mPlayerObject, &lDataSource, &lDataSink, lSoundPlayerIIDCount, lSoundPlayerIIDs, lSoundPlayerReqs); + Q_ASSERT(SL_RESULT_SUCCESS == lRes); // qDebug() << "Created Sound Player"; - lRes = (*mPlayerObject)->Realize(mPlayerObject, SL_BOOLEAN_FALSE); - Q_ASSERT(SL_RESULT_SUCCESS == lRes); + lRes = (*mPlayerObject)->Realize(mPlayerObject, SL_BOOLEAN_FALSE); + Q_ASSERT(SL_RESULT_SUCCESS == lRes); - qDebug() << "Realised Sound Player"; - lRes = (*mPlayerObject)->GetInterface(mPlayerObject, SL_IID_PLAY, &mPlayerPlay); - Q_ASSERT(SL_RESULT_SUCCESS == lRes); + qDebug() << "Realised Sound Player"; + lRes = (*mPlayerObject)->GetInterface(mPlayerObject, SL_IID_PLAY, &mPlayerPlay); + Q_ASSERT(SL_RESULT_SUCCESS == lRes); - lRes = (*mPlayerObject)->GetInterface(mPlayerObject, SL_IID_BUFFERQUEUE, &mPlayerQueue); - Q_ASSERT(SL_RESULT_SUCCESS == lRes); + lRes = (*mPlayerObject)->GetInterface(mPlayerObject, SL_IID_BUFFERQUEUE, &mPlayerQueue); + Q_ASSERT(SL_RESULT_SUCCESS == lRes); - lRes = (*mPlayerPlay)->SetPlayState(mPlayerPlay, SL_PLAYSTATE_PLAYING); - Q_ASSERT(SL_RESULT_SUCCESS == lRes); + lRes = (*mPlayerPlay)->SetPlayState(mPlayerPlay, SL_PLAYSTATE_PLAYING); + Q_ASSERT(SL_RESULT_SUCCESS == lRes); // qDebug() << "Created Buffer Player"; } -void AndroidAudio::playSound(const std::string& name, int i) { +void AndroidAudio::playSound(const std::string& name, int i) +{ - if(audioEnabled && myConfig->readConfigInt("PlaySoundEffects")) { + if(audioEnabled && myConfig->readConfigInt("PlaySoundEffects")) { - this->registerSound(QString(":/android/android-data/sounds/default/"+QString::fromStdString(name)+".wav"), QString::fromStdString(name)); - this->reallyPlaySound(QString::fromStdString(name)); - } + this->registerSound(QString(":/android/android-data/sounds/default/"+QString::fromStdString(name)+".wav"), QString::fromStdString(name)); + this->reallyPlaySound(QString::fromStdString(name)); + } } void AndroidAudio::reallyPlaySound(const QString& name) { - SLresult lRes; - SLuint32 lPlayerState; + SLresult lRes; + SLuint32 lPlayerState; - AndroidSoundEffect* sound = mSounds[name]; + AndroidSoundEffect* sound = mSounds[name]; - if (!sound) { - qDebug() << "No such sound:" << name; - return; - } - //Get the current state of the player - (*mPlayerObject)->GetState(mPlayerObject, &lPlayerState); + if (!sound) { + qDebug() << "No such sound:" << name; + return; + } + //Get the current state of the player + (*mPlayerObject)->GetState(mPlayerObject, &lPlayerState); - //If the player is realised - if (lPlayerState == SL_OBJECT_STATE_REALIZED) { - //Get the buffer and length of the effect - int16_t* lBuffer = (int16_t *)sound->mBuffer; - off_t lLength = sound->mLength; + //If the player is realised + if (lPlayerState == SL_OBJECT_STATE_REALIZED) { + //Get the buffer and length of the effect + int16_t* lBuffer = (int16_t *)sound->mBuffer; + off_t lLength = sound->mLength; - //Remove any sound from the queue - lRes = (*mPlayerQueue)->Clear(mPlayerQueue); - Q_ASSERT(SL_RESULT_SUCCESS == lRes); + //Remove any sound from the queue + lRes = (*mPlayerQueue)->Clear(mPlayerQueue); + Q_ASSERT(SL_RESULT_SUCCESS == lRes); - //Play the new sound - (*mPlayerQueue)->Enqueue(mPlayerQueue, lBuffer, lLength); - Q_ASSERT(SL_RESULT_SUCCESS == lRes); - } + //Play the new sound + (*mPlayerQueue)->Enqueue(mPlayerQueue, lBuffer, lLength); + Q_ASSERT(SL_RESULT_SUCCESS == lRes); + } } diff --git a/src/gui/qt/sound/androidaudio.h b/src/gui/qt/sound/androidaudio.h index 725d473a..92a2e90c 100644 --- a/src/gui/qt/sound/androidaudio.h +++ b/src/gui/qt/sound/androidaudio.h @@ -17,44 +17,44 @@ class ConfigFile; class AndroidAudio : public QObject { - Q_OBJECT + Q_OBJECT public: - explicit AndroidAudio(ConfigFile *c, QObject *parent = 0); - ~AndroidAudio(); + explicit AndroidAudio(ConfigFile *c, QObject *parent = 0); + ~AndroidAudio(); signals: public slots: - void registerSound(const QString& path, const QString &name); - void reallyPlaySound(const QString& name); - void playSound(const std::string& name, int i); - void initAudio(); - void closeAudio(); - void reInit(); + void registerSound(const QString& path, const QString &name); + void reallyPlaySound(const QString& name); + void playSound(const std::string& name, int i); + void initAudio(); + void closeAudio(); + void reInit(); private: - void createEngine(); - void destroyEngine(); - void startSoundPlayer(); + void createEngine(); + void destroyEngine(); + void startSoundPlayer(); - // engine interfaces - SLObjectItf mEngineObject; - SLEngineItf mEngineEngine; + // engine interfaces + SLObjectItf mEngineObject; + SLEngineItf mEngineEngine; - // output mix interfaces - SLObjectItf mOutputMixObject; + // output mix interfaces + SLObjectItf mOutputMixObject; - // buffer queue player interfaces - Effects - SLObjectItf mPlayerObject; - SLPlayItf mPlayerPlay; - SLBufferQueueItf mPlayerQueue; + // buffer queue player interfaces - Effects + SLObjectItf mPlayerObject; + SLPlayItf mPlayerPlay; + SLBufferQueueItf mPlayerQueue; - QMap mSounds; - int32_t mSoundCount; + QMap mSounds; + int32_t mSoundCount; - ConfigFile *myConfig; - bool audioEnabled; + ConfigFile *myConfig; + bool audioEnabled; }; #endif // ANDROIDAUDIO_H diff --git a/src/gui/qt/sound/androidsoundeffect.cpp b/src/gui/qt/sound/androidsoundeffect.cpp index 4d82bba0..f6722cb7 100644 --- a/src/gui/qt/sound/androidsoundeffect.cpp +++ b/src/gui/qt/sound/androidsoundeffect.cpp @@ -6,110 +6,110 @@ #include AndroidSoundEffect::AndroidSoundEffect(const QString& path, QObject *parent) : - QObject(parent), mBuffer(NULL), mLength(0), mPath(path) + QObject(parent), mBuffer(NULL), mLength(0), mPath(path) { } AndroidSoundEffect::~AndroidSoundEffect() { - this->unload(); + this->unload(); } bool AndroidSoundEffect::load() { - QFile lSoundFile(mPath); + QFile lSoundFile(mPath); // qDebug() << "opening:" << mPath; - if (!lSoundFile.open(QIODevice::ReadOnly)) { - qDebug() << "Could not open: " << mPath; - return false; - } + if (!lSoundFile.open(QIODevice::ReadOnly)) { + qDebug() << "Could not open: " << mPath; + return false; + } - // parse WAV file + // parse WAV file // qDebug() << " reading header:"; - char id[4]; - lSoundFile.read(id, 4); - if( strncmp(id, "RIFF", 4) != 0 ) { - qDebug() << "not a WAV file - header not RIFF"; - lSoundFile.close(); - return false; - } + char id[4]; + lSoundFile.read(id, 4); + if( strncmp(id, "RIFF", 4) != 0 ) { + qDebug() << "not a WAV file - header not RIFF"; + lSoundFile.close(); + return false; + } - int size = 0; - lSoundFile.read((char *)&size, 4); + int size = 0; + lSoundFile.read((char *)&size, 4); // qDebug() << " size:" << size; - lSoundFile.read(id, 4); - if( strncmp(id, "WAVE", 4) != 0 ) { - qDebug() << "not a WAV file - header not WAVE"; - lSoundFile.close(); - return false; - } + lSoundFile.read(id, 4); + if( strncmp(id, "WAVE", 4) != 0 ) { + qDebug() << "not a WAV file - header not WAVE"; + lSoundFile.close(); + return false; + } - lSoundFile.read(id, 4); // "fmt " + lSoundFile.read(id, 4); // "fmt " - int format_length = 0; - lSoundFile.read((char *)&format_length, 4); + int format_length = 0; + lSoundFile.read((char *)&format_length, 4); // qDebug() << " format_length:" << format_length; - short format_tag = 0; - lSoundFile.read((char *)&format_tag, 2); + short format_tag = 0; + lSoundFile.read((char *)&format_tag, 2); - short n_channels = 0; - lSoundFile.read((char *)&n_channels, 2); + short n_channels = 0; + lSoundFile.read((char *)&n_channels, 2); // qDebug() << " n_channels:" << n_channels; - int sample_rate = 0; - lSoundFile.read((char *)&sample_rate, 4); + int sample_rate = 0; + lSoundFile.read((char *)&sample_rate, 4); // qDebug() << " sample_rate:" << sample_rate; - int avg_bytes_sec = 0; - lSoundFile.read((char *)&avg_bytes_sec, 4); + int avg_bytes_sec = 0; + lSoundFile.read((char *)&avg_bytes_sec, 4); // qDebug() << " avg_bytes_sec:" << avg_bytes_sec; - short block_align = 0; - lSoundFile.read((char *)&block_align, 2); + short block_align = 0; + lSoundFile.read((char *)&block_align, 2); - short bits_per_sample = 0; - lSoundFile.read((char *)&bits_per_sample, 2); + short bits_per_sample = 0; + lSoundFile.read((char *)&bits_per_sample, 2); // qDebug() << " bits_per_sample:" << bits_per_sample; - lSoundFile.read(id, 4); - if( strncmp(id, "data", 4) != 0 ) { - qDebug() << "not a WAV file - didn't find data"; - lSoundFile.close(); - return false; - } + lSoundFile.read(id, 4); + if( strncmp(id, "data", 4) != 0 ) { + qDebug() << "not a WAV file - didn't find data"; + lSoundFile.close(); + return false; + } - lSoundFile.read((char *)&mLength, 4); + lSoundFile.read((char *)&mLength, 4); // qDebug() << " reading data:" << mLength; - mBuffer = (char*)malloc((mLength)); + mBuffer = (char*)malloc((mLength)); - int dataRead = lSoundFile.read(mBuffer, mLength); - if (dataRead != mLength) { - qDebug() << "didn't read correct amount of data' :" << mPath; - lSoundFile.close(); - delete [] mBuffer; - mBuffer = NULL; - return false; - } + int dataRead = lSoundFile.read(mBuffer, mLength); + if (dataRead != mLength) { + qDebug() << "didn't read correct amount of data' :" << mPath; + lSoundFile.close(); + delete [] mBuffer; + mBuffer = NULL; + return false; + } // qDebug() << " closing:"; - lSoundFile.close(); - return true; + lSoundFile.close(); + return true; } bool AndroidSoundEffect::unload() { - delete[] mBuffer; - mBuffer = NULL; - mLength = 0; - return true; + delete[] mBuffer; + mBuffer = NULL; + mLength = 0; + return true; } #endif diff --git a/src/gui/qt/sound/androidsoundeffect.h b/src/gui/qt/sound/androidsoundeffect.h index f1e3667a..c300d462 100644 --- a/src/gui/qt/sound/androidsoundeffect.h +++ b/src/gui/qt/sound/androidsoundeffect.h @@ -12,26 +12,26 @@ class AndroidSoundEffect : public QObject { - Q_OBJECT + Q_OBJECT public: - explicit AndroidSoundEffect(const QString& pPath, QObject *parent = 0); - ~AndroidSoundEffect(); + explicit AndroidSoundEffect(const QString& pPath, QObject *parent = 0); + ~AndroidSoundEffect(); - const char* getPath(); - bool load(); - bool unload(); + const char* getPath(); + bool load(); + bool unload(); signals: public slots: private: - char* mBuffer; - off_t mLength; + char* mBuffer; + off_t mLength; - QString mPath; + QString mPath; - friend class AndroidAudio; + friend class AndroidAudio; }; #endif // ANDROIDSOUNDEFFECT_H diff --git a/src/gui/qt/sound/sdlplayer.cpp b/src/gui/qt/sound/sdlplayer.cpp index 33950e88..7da3b020 100644 --- a/src/gui/qt/sound/sdlplayer.cpp +++ b/src/gui/qt/sound/sdlplayer.cpp @@ -26,128 +26,128 @@ using namespace std; SDLPlayer::SDLPlayer(ConfigFile *c) - : sound(NULL), soundData(NULL), currentChannel(0), audioEnabled(FALSE), myConfig(c) + : sound(NULL), soundData(NULL), currentChannel(0), audioEnabled(FALSE), myConfig(c) { - myAppDataPath = QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str()); - SDL_Init(SDL_INIT_AUDIO); - initAudio(); + myAppDataPath = QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str()); + SDL_Init(SDL_INIT_AUDIO); + initAudio(); } SDLPlayer::~SDLPlayer() { - closeAudio(); - SDL_Quit(); + closeAudio(); + SDL_Quit(); } void SDLPlayer::initAudio() { - if (!audioEnabled && myConfig->readConfigInt("PlaySoundEffects")) { - int audio_rate = 44100; - Uint16 audio_format = AUDIO_S16; /* 16-bit stereo */ - int audio_channels = 2; - int audio_buffers = 4096; - sound = NULL; + if (!audioEnabled && myConfig->readConfigInt("PlaySoundEffects")) { + int audio_rate = 44100; + Uint16 audio_format = AUDIO_S16; /* 16-bit stereo */ + int audio_channels = 2; + int audio_buffers = 4096; + sound = NULL; - if( Mix_OpenAudio(audio_rate, audio_format, audio_channels, audio_buffers) == 0) { - Mix_QuerySpec(&audio_rate, &audio_format, &audio_channels); - audioEnabled = 1; - } - else { - qDebug() << "Mix_OpenAudio() was not successfull, no sound possible :("; - } - } + if( Mix_OpenAudio(audio_rate, audio_format, audio_channels, audio_buffers) == 0) { + Mix_QuerySpec(&audio_rate, &audio_format, &audio_channels); + audioEnabled = 1; + } else { + qDebug() << "Mix_OpenAudio() was not successfull, no sound possible :("; + } + } } void SDLPlayer::playSound(string audioString, int playerID) { - if(audioEnabled && myConfig->readConfigInt("PlaySoundEffects")) { + if(audioEnabled && myConfig->readConfigInt("PlaySoundEffects")) { - QFile myFile(myAppDataPath + "sounds/default/" + QString::fromStdString(audioString)+".wav"); + QFile myFile(myAppDataPath + "sounds/default/" + QString::fromStdString(audioString)+".wav"); - if(myFile.open(QIODevice::ReadOnly)) { + if(myFile.open(QIODevice::ReadOnly)) { - //set 3d position for player - int position = 0; - int distance = 0; + //set 3d position for player + int position = 0; + int distance = 0; - switch (playerID) { + switch (playerID) { - case 0: { - position = 180; - distance = 10; - } - break; - case 1: { - position = 281; - distance = 50; - } - break; - case 2: { - position = 315; - distance = 120; - } - break; - case 3: { - position = 338; - distance = 160; - } - break; - case 4: { - position = 23; - distance = 160; - } - break; - case 5: { - position = 45; - distance = 120; - } - break; - case 6: { - position = 79; - distance = 50; - } - break; - default: { - position = 0; - distance = 0; - } - break; - } + case 0: { + position = 180; + distance = 10; + } + break; + case 1: { + position = 281; + distance = 50; + } + break; + case 2: { + position = 315; + distance = 120; + } + break; + case 3: { + position = 338; + distance = 160; + } + break; + case 4: { + position = 23; + distance = 160; + } + break; + case 5: { + position = 45; + distance = 120; + } + break; + case 6: { + position = 79; + distance = 50; + } + break; + default: { + position = 0; + distance = 0; + } + break; + } - QDataStream in(&myFile); - soundData = new Uint8[(int)myFile.size()]; - in.readRawData( (char*)soundData, (int)myFile.size() ); - sound = Mix_QuickLoad_WAV(soundData); + QDataStream in(&myFile); + soundData = new Uint8[(int)myFile.size()]; + in.readRawData( (char*)soundData, (int)myFile.size() ); + sound = Mix_QuickLoad_WAV(soundData); - // set channel 0 to settings volume - Mix_Volume(-1,myConfig->readConfigInt("SoundVolume")*10); + // set channel 0 to settings volume + Mix_Volume(-1,myConfig->readConfigInt("SoundVolume")*10); - // set 3d effect - if(!Mix_SetPosition(0, position, distance)) { - printf("Mix_SetPosition: %s\n", Mix_GetError()); - // no position effect, is it ok? - } - currentChannel = Mix_PlayChannel(-1, sound,0); - } - } + // set 3d effect + if(!Mix_SetPosition(0, position, distance)) { + printf("Mix_SetPosition: %s\n", Mix_GetError()); + // no position effect, is it ok? + } + currentChannel = Mix_PlayChannel(-1, sound,0); + } + } } void SDLPlayer::closeAudio() -{ if(audioEnabled) { - Mix_HaltChannel(currentChannel); - Mix_FreeChunk(sound); - sound = NULL; - delete[] soundData; - soundData = NULL; - Mix_CloseAudio(); - qDebug() << "Mix_CloseAudio()"; - audioEnabled = false; - } +{ + if(audioEnabled) { + Mix_HaltChannel(currentChannel); + Mix_FreeChunk(sound); + sound = NULL; + delete[] soundData; + soundData = NULL; + Mix_CloseAudio(); + qDebug() << "Mix_CloseAudio()"; + audioEnabled = false; + } } void SDLPlayer::reInit() { - closeAudio(); - initAudio(); + closeAudio(); + initAudio(); } diff --git a/src/gui/qt/sound/sdlplayer.h b/src/gui/qt/sound/sdlplayer.h index 1f4cb269..00c9d287 100644 --- a/src/gui/qt/sound/sdlplayer.h +++ b/src/gui/qt/sound/sdlplayer.h @@ -29,7 +29,7 @@ #include #endif - struct Mix_Chunk; +struct Mix_Chunk; /** @author FThauer FHammer @@ -46,13 +46,13 @@ public: void initAudio(); void playSound(std::string, int playerID); void closeAudio(); - void reInit(); + void reInit(); private: - Mix_Chunk *sound; + Mix_Chunk *sound; unsigned char *soundData; int currentChannel; - bool audioEnabled; + bool audioEnabled; ConfigFile *myConfig; QString myAppDataPath; }; diff --git a/src/gui/qt/sound/soundevents.cpp b/src/gui/qt/sound/soundevents.cpp index 9e6d0ccb..d31acc93 100644 --- a/src/gui/qt/sound/soundevents.cpp +++ b/src/gui/qt/sound/soundevents.cpp @@ -1,13 +1,13 @@ #include "soundevents.h" #ifdef ANDROID - #ifdef ANDROID_API8 - #include "androidapi8dummy.h" - #else - #include "androidaudio.h" - #endif +#ifdef ANDROID_API8 +#include "androidapi8dummy.h" #else - #include "sdlplayer.h" +#include "androidaudio.h" +#endif +#else +#include "sdlplayer.h" #endif @@ -22,25 +22,25 @@ SoundEvents::SoundEvents(ConfigFile *c): myConfig(c), lastSBValue(0), lastSBLeve { #ifdef ANDROID - #ifdef ANDROID_API8 - myPlayer = new AndroidApi8Dummy(myConfig); - #else - myPlayer = new AndroidAudio(myConfig); - #endif +#ifdef ANDROID_API8 + myPlayer = new AndroidApi8Dummy(myConfig); #else - myPlayer = new SDLPlayer(myConfig); + myPlayer = new AndroidAudio(myConfig); +#endif +#else + myPlayer = new SDLPlayer(myConfig); #endif } SoundEvents::~SoundEvents() { - myPlayer->deleteLater(); + myPlayer->deleteLater(); } void SoundEvents::reInitSoundEngine() { - myPlayer->reInit(); + myPlayer->reInit(); } void SoundEvents::blindsWereSet(int sB) @@ -58,13 +58,13 @@ void SoundEvents::blindsWereSet(int sB) if(myConfig->readConfigInt("PlayBlindRaiseNotification")) { if(lastSBLevel == 1 || lastSBLevel == 2) { - myPlayer->playSound("blinds_raises_level1", 0); + myPlayer->playSound("blinds_raises_level1", 0); } if(lastSBLevel == 3 || lastSBLevel == 4) { - myPlayer->playSound("blinds_raises_level2", 0); + myPlayer->playSound("blinds_raises_level2", 0); } if(lastSBLevel >= 5) { - myPlayer->playSound("blinds_raises_level3", 0); + myPlayer->playSound("blinds_raises_level3", 0); } } } @@ -78,5 +78,5 @@ void SoundEvents::newGameStarts() //HACK until playSound is done by events void SoundEvents::playSound(std::string audioString, int playerID) { - myPlayer->playSound(audioString, playerID); + myPlayer->playSound(audioString, playerID); } diff --git a/src/gui/qt/sound/soundevents.h b/src/gui/qt/sound/soundevents.h index ed5ef9a8..a584b4f4 100644 --- a/src/gui/qt/sound/soundevents.h +++ b/src/gui/qt/sound/soundevents.h @@ -4,13 +4,13 @@ #include #ifdef ANDROID - #ifdef ANDROID_API8 - class AndroidApi8Dummy; - #else - class AndroidAudio; - #endif +#ifdef ANDROID_API8 +class AndroidApi8Dummy; #else - class SDLPlayer; +class AndroidAudio; +#endif +#else +class SDLPlayer; #endif @@ -23,8 +23,8 @@ public: void blindsWereSet(int sB); void newGameStarts(); - void playSound(std::string audioString, int playerID); - void reInitSoundEngine(); + void playSound(std::string audioString, int playerID); + void reInitSoundEngine(); protected: // Prevent copy construction. @@ -34,13 +34,13 @@ protected: private: #ifdef ANDROID - #ifdef ANDROID_API8 - AndroidApi8Dummy *myPlayer; - #else - AndroidAudio *myPlayer; - #endif +#ifdef ANDROID_API8 + AndroidApi8Dummy *myPlayer; #else - SDLPlayer *myPlayer; + AndroidAudio *myPlayer; +#endif +#else + SDLPlayer *myPlayer; #endif ConfigFile *myConfig; int lastSBValue; diff --git a/src/gui/qt/startnetworkgamedialog/startnetworkgamedialogimpl.cpp b/src/gui/qt/startnetworkgamedialog/startnetworkgamedialogimpl.cpp index 757b37ad..6d1d5f92 100644 --- a/src/gui/qt/startnetworkgamedialog/startnetworkgamedialogimpl.cpp +++ b/src/gui/qt/startnetworkgamedialog/startnetworkgamedialogimpl.cpp @@ -94,9 +94,9 @@ void startNetworkGameDialogImpl::addConnectedPlayer(unsigned playerId, QString p if(this->isVisible() && myConfig->readConfigInt("PlayNetworkGameNotification")) { if(treeWidget->topLevelItemCount() < info.data.maxNumberOfPlayers) { - myW->getMySoundEventHandler()->playSound("playerconnected", 0); + myW->getMySoundEventHandler()->playSound("playerconnected", 0); } else { - myW->getMySoundEventHandler()->playSound("onlinegameready", 0); + myW->getMySoundEventHandler()->playSound("onlinegameready", 0); } } @@ -161,8 +161,8 @@ void startNetworkGameDialogImpl::kickPlayer() if(playerName == QString::fromUtf8(myConfig->readConfigString("MyName").c_str())) { { MyMessageBox::warning(this, tr("Server Error"), - tr("You should not kick yourself from this game!"), - QMessageBox::Close); + tr("You should not kick yourself from this game!"), + QMessageBox::Close); } } else { assert(mySession); diff --git a/src/gui/qt/startwindow/startwindowimpl.cpp b/src/gui/qt/startwindow/startwindowimpl.cpp index 65667778..91653e66 100644 --- a/src/gui/qt/startwindow/startwindowimpl.cpp +++ b/src/gui/qt/startwindow/startwindowimpl.cpp @@ -70,53 +70,51 @@ startWindowImpl::startWindowImpl(ConfigFile *c, Log *l) this->installEventFilter(this); //Widgets Grafiken per Stylesheets setzen - QString myAppDataPath = QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str()); + QString myAppDataPath = QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str()); this->setWindowIcon(QIcon(myAppDataPath+"gfx/gui/misc/windowicon.png")); this->setStatusBar(0); #ifdef GUI_800x480 - #ifdef ANDROID - this->menubar->hide(); +#ifdef ANDROID + this->menubar->hide(); - //check if custom background picture for the resolution is there. Otherwise create it! - QString UserDataDir = QString::fromUtf8(myConfig->readConfigString("UserDataDir").c_str()); - QDesktopWidget dw; - int screenWidth = dw.screenGeometry().width(); - int screenHeight = dw.screenGeometry().height(); - QString customStartWindowBgFileString(UserDataDir+"/startwindowbg_"+QString::number(screenWidth)+"x"+QString::number(screenHeight)+".png"); - QFile customStartWindowBgFile(customStartWindowBgFileString); - if(customStartWindowBgFile.exists()) { - centralwidget->setStyleSheet(".QWidget { background-image: url("+QFileInfo(customStartWindowBgFile).absoluteFilePath()+"); background-position: bottom center; background-origin: content; background-repeat: no-repeat;}"); - } - else { - QPixmap pix(":/android/android-data/gfx/gui/misc/startwindowbg_800x480.png"); - pix = pix.scaled(screenWidth, screenHeight, Qt::IgnoreAspectRatio, Qt::SmoothTransformation); - if(pix.save(customStartWindowBgFileString)) { - centralwidget->setStyleSheet(".QWidget { background-image: url("+QFileInfo(customStartWindowBgFile).absoluteFilePath()+"); background-position: bottom center; background-origin: content; background-repeat: no-repeat;}"); - } - else { - centralwidget->setStyleSheet(".QWidget { background-image: url(:/android/android-data/gfx/gui/misc/startwindowbg_800x480.png); background-position: bottom center; background-origin: content; background-repeat: no-repeat;}"); - } + //check if custom background picture for the resolution is there. Otherwise create it! + QString UserDataDir = QString::fromUtf8(myConfig->readConfigString("UserDataDir").c_str()); + QDesktopWidget dw; + int screenWidth = dw.screenGeometry().width(); + int screenHeight = dw.screenGeometry().height(); + QString customStartWindowBgFileString(UserDataDir+"/startwindowbg_"+QString::number(screenWidth)+"x"+QString::number(screenHeight)+".png"); + QFile customStartWindowBgFile(customStartWindowBgFileString); + if(customStartWindowBgFile.exists()) { + centralwidget->setStyleSheet(".QWidget { background-image: url("+QFileInfo(customStartWindowBgFile).absoluteFilePath()+"); background-position: bottom center; background-origin: content; background-repeat: no-repeat;}"); + } else { + QPixmap pix(":/android/android-data/gfx/gui/misc/startwindowbg_800x480.png"); + pix = pix.scaled(screenWidth, screenHeight, Qt::IgnoreAspectRatio, Qt::SmoothTransformation); + if(pix.save(customStartWindowBgFileString)) { + centralwidget->setStyleSheet(".QWidget { background-image: url("+QFileInfo(customStartWindowBgFile).absoluteFilePath()+"); background-position: bottom center; background-origin: content; background-repeat: no-repeat;}"); + } else { + centralwidget->setStyleSheet(".QWidget { background-image: url(:/android/android-data/gfx/gui/misc/startwindowbg_800x480.png); background-position: bottom center; background-origin: content; background-repeat: no-repeat;}"); + } - } - this->showFullScreen(); - #else + } + this->showFullScreen(); +#else // this->menubar->setStyleSheet("QMenuBar { background-color: #4B4B4B; font-size:20px; border-width: 0px;} QMenuBar::item { color: #F0F0F0; }"); - this->menubar->hide(); - centralwidget->setStyleSheet(".QWidget { background-image: url(\""+myAppDataPath+"gfx/gui/misc/startwindowbg_800x480.png\"); background-position: bottom center; background-origin: content; background-repeat: no-repeat;}"); - #endif - pushButtonStart_Local_Game->setStyleSheet("QPushButton { text-align:left; font-weight:bold; padding-left: 3px; padding-bottom: 3px; padding-top: 3px; padding-right: 3px; background-color: #4B4B4B; color: #F0F0F0; font-size:22px; border-width: 0px;}"); - pushButtonInternet_Game->setStyleSheet("QPushButton { text-align:left; font-weight:bold; padding-left: 3px; padding-bottom: 3px; padding-top: 3px; padding-right: 3px; background-color: #4B4B4B; color: #F0F0F0; font-size:22px; border-width: 0px;}"); - pushButton_Create_Network_Game->setStyleSheet("QPushButton { text-align:left; font-weight:bold; padding-left: 3px; padding-bottom: 3px; padding-top: 3px; padding-right: 3px; background-color: #4B4B4B; color: #F0F0F0; font-size:22px; border-width: 0px;}"); - pushButton_Join_Network_Game->setStyleSheet("QPushButton { text-align:left; font-weight:bold; padding-left: 3px; padding-bottom: 3px; padding-top: 3px; padding-right: 3px; background-color: #4B4B4B; color: #F0F0F0; font-size:22px; border-width: 0px;}"); - pushButton_about->setStyleSheet("QPushButton { text-align:left; font-weight:bold; padding-left: 3px; padding-bottom: 3px; padding-top: 3px; padding-right: 3px; background-color: #4B4B4B; color: #F0F0F0; font-size:22px; border-width: 0px;}"); - pushButton_configure->setStyleSheet("QPushButton { text-align:left; font-weight:bold; padding-left: 3px; padding-bottom: 3px; padding-top: 3px; padding-right: 3px; background-color: #4B4B4B; color: #F0F0F0; font-size:22px; border-width: 0px;}"); - pushButton_Logs->setStyleSheet("QPushButton { text-align:left; font-weight:bold; padding-left: 3px; padding-bottom: 3px; padding-top: 3px; padding-right: 3px; background-color: #4B4B4B; color: #F0F0F0; font-size:22px; border-width: 0px;}"); + this->menubar->hide(); + centralwidget->setStyleSheet(".QWidget { background-image: url(\""+myAppDataPath+"gfx/gui/misc/startwindowbg_800x480.png\"); background-position: bottom center; background-origin: content; background-repeat: no-repeat;}"); +#endif + pushButtonStart_Local_Game->setStyleSheet("QPushButton { text-align:left; font-weight:bold; padding-left: 3px; padding-bottom: 3px; padding-top: 3px; padding-right: 3px; background-color: #4B4B4B; color: #F0F0F0; font-size:22px; border-width: 0px;}"); + pushButtonInternet_Game->setStyleSheet("QPushButton { text-align:left; font-weight:bold; padding-left: 3px; padding-bottom: 3px; padding-top: 3px; padding-right: 3px; background-color: #4B4B4B; color: #F0F0F0; font-size:22px; border-width: 0px;}"); + pushButton_Create_Network_Game->setStyleSheet("QPushButton { text-align:left; font-weight:bold; padding-left: 3px; padding-bottom: 3px; padding-top: 3px; padding-right: 3px; background-color: #4B4B4B; color: #F0F0F0; font-size:22px; border-width: 0px;}"); + pushButton_Join_Network_Game->setStyleSheet("QPushButton { text-align:left; font-weight:bold; padding-left: 3px; padding-bottom: 3px; padding-top: 3px; padding-right: 3px; background-color: #4B4B4B; color: #F0F0F0; font-size:22px; border-width: 0px;}"); + pushButton_about->setStyleSheet("QPushButton { text-align:left; font-weight:bold; padding-left: 3px; padding-bottom: 3px; padding-top: 3px; padding-right: 3px; background-color: #4B4B4B; color: #F0F0F0; font-size:22px; border-width: 0px;}"); + pushButton_configure->setStyleSheet("QPushButton { text-align:left; font-weight:bold; padding-left: 3px; padding-bottom: 3px; padding-top: 3px; padding-right: 3px; background-color: #4B4B4B; color: #F0F0F0; font-size:22px; border-width: 0px;}"); + pushButton_Logs->setStyleSheet("QPushButton { text-align:left; font-weight:bold; padding-left: 3px; padding-bottom: 3px; padding-top: 3px; padding-right: 3px; background-color: #4B4B4B; color: #F0F0F0; font-size:22px; border-width: 0px;}"); - connect( pushButton_about, SIGNAL( clicked() ), this, SLOT( callAboutPokerthDialog() ) ); - connect( pushButton_configure, SIGNAL( clicked() ), this, SLOT( callSettingsDialogFromStartwindow() ) ); - connect( pushButton_Logs, SIGNAL( clicked() ), this, SLOT( callLogFileDialog() ) ); + connect( pushButton_about, SIGNAL( clicked() ), this, SLOT( callAboutPokerthDialog() ) ); + connect( pushButton_configure, SIGNAL( clicked() ), this, SLOT( callSettingsDialogFromStartwindow() ) ); + connect( pushButton_Logs, SIGNAL( clicked() ), this, SLOT( callLogFileDialog() ) ); #else this->menubar->setStyleSheet("QMenuBar { background-color: #4B4B4B; font-size:12px; border-width: 0px;} QMenuBar::item { color: #F0F0F0; }"); @@ -127,8 +125,8 @@ startWindowImpl::startWindowImpl(ConfigFile *c, Log *l) pushButton_Create_Network_Game->setStyleSheet("QPushButton { text-align:left; font-weight:bold; padding-left: 1px; padding-bottom: 3px; padding-top: 3px; padding-right: 3px; background-color: #4B4B4B; color: #F0F0F0; font-size:12px; border-width: 0px;}"); pushButton_Join_Network_Game->setStyleSheet("QPushButton { text-align:left; font-weight:bold; padding-left: 1px; padding-bottom: 3px; padding-top: 3px; padding-right: 3px; background-color: #4B4B4B; color: #F0F0F0; font-size:12px; border-width: 0px;}"); - connect( actionAbout_PokerTH, SIGNAL( triggered() ), this, SLOT( callAboutPokerthDialog() ) ); - connect( actionConfigure_PokerTH, SIGNAL( triggered() ), this, SLOT( callSettingsDialogFromStartwindow() ) ); + connect( actionAbout_PokerTH, SIGNAL( triggered() ), this, SLOT( callAboutPokerthDialog() ) ); + connect( actionConfigure_PokerTH, SIGNAL( triggered() ), this, SLOT( callSettingsDialogFromStartwindow() ) ); #endif @@ -243,7 +241,7 @@ void startWindowImpl::callNewGameDialog() if(myConfig->readConfigInt("ShowGameSettingsDialogOnNewGame")) { #ifdef ANDROID - myGuiInterface->getMyW()->hide(); + myGuiInterface->getMyW()->hide(); #endif myNewGameDialog->exec(); if (myNewGameDialog->result() == QDialog::Accepted ) { @@ -440,7 +438,7 @@ void startWindowImpl::callRejoinPossibleDialog(unsigned gameId) assert(mySession); GameInfo info(mySession->getClientGameInfo(gameId));*/ - MyMessageBox msgBox; + MyMessageBox msgBox; msgBox.setIcon(QMessageBox::Question); msgBox.setWindowTitle("Rejoin possible!"); // msgBox.setText(QString("There is an existing session with the game: %1").arg(QString::fromUtf8(info.name.c_str()))); @@ -684,165 +682,165 @@ void startWindowImpl::networkError(int errorID, int /*osErrorID*/) hideTimeoutDialog(); switch (errorID) { case ERR_SOCK_SERVERADDR_NOT_SET: { - MyMessageBox::warning(this, tr("Network Error"), - tr("Server address was not set."), - QMessageBox::Close); + MyMessageBox::warning(this, tr("Network Error"), + tr("Server address was not set."), + QMessageBox::Close); } break; case ERR_SOCK_INVALID_PORT: { - MyMessageBox::warning(this, tr("Network Error"), - tr("An invalid port was set (ports 0-1023 are not allowed)."), - QMessageBox::Close); + MyMessageBox::warning(this, tr("Network Error"), + tr("An invalid port was set (ports 0-1023 are not allowed)."), + QMessageBox::Close); } break; case ERR_SOCK_CREATION_FAILED: { - MyMessageBox::warning(this, tr("Network Error"), - tr("Could not create a socket for TCP communication."), - QMessageBox::Close); + MyMessageBox::warning(this, tr("Network Error"), + tr("Could not create a socket for TCP communication."), + QMessageBox::Close); } break; case ERR_SOCK_SET_ADDR_FAILED: { - MyMessageBox::warning(this, tr("Network Error"), - tr("Could not set the IP address."), - QMessageBox::Close); + MyMessageBox::warning(this, tr("Network Error"), + tr("Could not set the IP address."), + QMessageBox::Close); } break; case ERR_SOCK_SET_PORT_FAILED: { - MyMessageBox::warning(this, tr("Network Error"), - tr("Could not set the port for this type of address."), - QMessageBox::Close); + MyMessageBox::warning(this, tr("Network Error"), + tr("Could not set the port for this type of address."), + QMessageBox::Close); } break; case ERR_SOCK_RESOLVE_FAILED: { - MyMessageBox::warning(this, tr("Network Error"), - tr("The server name could not be resolved."), - QMessageBox::Close); + MyMessageBox::warning(this, tr("Network Error"), + tr("The server name could not be resolved."), + QMessageBox::Close); } break; case ERR_SOCK_BIND_FAILED: { - MyMessageBox::warning(this, tr("Network Error"), - tr("Bind failed - please choose a different port."), - QMessageBox::Close); + MyMessageBox::warning(this, tr("Network Error"), + tr("Bind failed - please choose a different port."), + QMessageBox::Close); } break; case ERR_SOCK_LISTEN_FAILED: { - MyMessageBox::warning(this, tr("Network Error"), - tr("Internal network error: \"listen\" failed."), - QMessageBox::Close); + MyMessageBox::warning(this, tr("Network Error"), + tr("Internal network error: \"listen\" failed."), + QMessageBox::Close); } break; case ERR_SOCK_ACCEPT_FAILED: { - MyMessageBox::warning(this, tr("Network Error"), - tr("Server execution was terminated."), - QMessageBox::Close); + MyMessageBox::warning(this, tr("Network Error"), + tr("Server execution was terminated."), + QMessageBox::Close); } break; case ERR_SOCK_CONNECT_FAILED: { - MyMessageBox::warning(this, tr("Network Error"), - tr("Could not connect to the server."), - QMessageBox::Close); + MyMessageBox::warning(this, tr("Network Error"), + tr("Could not connect to the server."), + QMessageBox::Close); } break; case ERR_SOCK_CONNECT_TIMEOUT: { - MyMessageBox::warning(this, tr("Network Error"), - tr("Connection timed out.\nPlease check the server address.\n\nIf the server is behind a NAT-Router, make sure port forwarding has been set up on server side."), - QMessageBox::Close); + MyMessageBox::warning(this, tr("Network Error"), + tr("Connection timed out.\nPlease check the server address.\n\nIf the server is behind a NAT-Router, make sure port forwarding has been set up on server side."), + QMessageBox::Close); } break; case ERR_SOCK_SELECT_FAILED: { - MyMessageBox::warning(this, tr("Network Error"), - tr("Internal network error: \"select\" failed."), - QMessageBox::Close); + MyMessageBox::warning(this, tr("Network Error"), + tr("Internal network error: \"select\" failed."), + QMessageBox::Close); } break; case ERR_SOCK_SEND_FAILED: { - MyMessageBox::warning(this, tr("Network Error"), - tr("Internal network error: \"send\" failed."), - QMessageBox::Close); + MyMessageBox::warning(this, tr("Network Error"), + tr("Internal network error: \"send\" failed."), + QMessageBox::Close); } break; case ERR_SOCK_RECV_FAILED: // Sometimes windows reports recv failed on close. case ERR_SOCK_CONN_RESET: { - MyMessageBox::warning(this, tr("Network Error"), - tr("The connection to the server was lost."), - QMessageBox::Close); + MyMessageBox::warning(this, tr("Network Error"), + tr("The connection to the server was lost."), + QMessageBox::Close); } break; case ERR_SOCK_CONN_EXISTS: { - MyMessageBox::warning(this, tr("Network Error"), - tr("Internal network error: Duplicate TCP connection."), - QMessageBox::Close); + MyMessageBox::warning(this, tr("Network Error"), + tr("Internal network error: Duplicate TCP connection."), + QMessageBox::Close); } break; case ERR_SOCK_INVALID_PACKET: { - MyMessageBox::warning(this, tr("Network Error"), - tr("An invalid network packet was received.\nPlease make sure that all players use the same version of PokerTH."), - QMessageBox::Close); + MyMessageBox::warning(this, tr("Network Error"), + tr("An invalid network packet was received.\nPlease make sure that all players use the same version of PokerTH."), + QMessageBox::Close); } break; case ERR_SOCK_INVALID_STATE: { - MyMessageBox::warning(this, tr("Network Error"), - tr("Internal state error.\nPlease make sure that all players use the same version of PokerTH."), - QMessageBox::Close); + MyMessageBox::warning(this, tr("Network Error"), + tr("Internal state error.\nPlease make sure that all players use the same version of PokerTH."), + QMessageBox::Close); } break; case ERR_SOCK_INVALID_SERVERLIST_URL: case ERR_SOCK_TRANSFER_INVALID_URL: { - MyMessageBox::warning(this, tr("Network Error"), - tr("Invalid server list URL.\nPlease correct the address in the settings."), - QMessageBox::Close); + MyMessageBox::warning(this, tr("Network Error"), + tr("Invalid server list URL.\nPlease correct the address in the settings."), + QMessageBox::Close); } break; case ERR_SOCK_INVALID_SERVERLIST_XML: { - MyMessageBox::warning(this, tr("Network Error"), - tr("The PokerTH internet server list contains invalid data.\nIf you use a custom server list, please make sure its format is correct."), - QMessageBox::Close); + MyMessageBox::warning(this, tr("Network Error"), + tr("The PokerTH internet server list contains invalid data.\nIf you use a custom server list, please make sure its format is correct."), + QMessageBox::Close); } break; case ERR_SOCK_UNZIP_FAILED: { - MyMessageBox::warning(this, tr("Network Error"), - tr("Could not unzip the PokerTH internet server list."), - QMessageBox::Close); + MyMessageBox::warning(this, tr("Network Error"), + tr("Could not unzip the PokerTH internet server list."), + QMessageBox::Close); } break; case ERR_SOCK_TRANSFER_INIT_FAILED: case ERR_SOCK_TRANSFER_SELECT_FAILED: case ERR_SOCK_TRANSFER_FAILED: { - MyMessageBox::warning(this, tr("Network Error"), - tr("Could not download the PokerTH internet server list.\nPlease make sure you are directly connected to the internet."), - QMessageBox::Close); + MyMessageBox::warning(this, tr("Network Error"), + tr("Could not download the PokerTH internet server list.\nPlease make sure you are directly connected to the internet."), + QMessageBox::Close); } break; case ERR_SOCK_TRANSFER_OPEN_FAILED: { - MyMessageBox::warning(this, tr("Network Error"), - tr("Could not open the target file when downloading the server list."), - QMessageBox::Close); + MyMessageBox::warning(this, tr("Network Error"), + tr("Could not open the target file when downloading the server list."), + QMessageBox::Close); } break; case ERR_NET_VERSION_NOT_SUPPORTED: { - MyMessageBox msgBox(QMessageBox::Warning, tr("Network Error"), - tr("The PokerTH server does not support this version of the game.
Please go to http://www.pokerth.net and download the latest version."), - QMessageBox::Close, this); + MyMessageBox msgBox(QMessageBox::Warning, tr("Network Error"), + tr("The PokerTH server does not support this version of the game.
Please go to http://www.pokerth.net and download the latest version."), + QMessageBox::Close, this); msgBox.setTextFormat(Qt::RichText); msgBox.exec(); } break; case ERR_NET_SERVER_FULL: { - MyMessageBox::warning(this, tr("Network Error"), - tr("Sorry, this server is already full."), - QMessageBox::Close); + MyMessageBox::warning(this, tr("Network Error"), + tr("Sorry, this server is already full."), + QMessageBox::Close); } break; case ERR_NET_INVALID_PASSWORD: { - MyMessageBox::warning(this, tr("Network Error"), - tr("Invalid login.\nPlease check your username and password."), - QMessageBox::Close); + MyMessageBox::warning(this, tr("Network Error"), + tr("Invalid login.\nPlease check your username and password."), + QMessageBox::Close); } break; case ERR_NET_INVALID_PASSWORD_STR: { - MyMessageBox::warning(this, tr("Network Error"), - tr("The password is too long. Please choose another one."), - QMessageBox::Close); + MyMessageBox::warning(this, tr("Network Error"), + tr("The password is too long. Please choose another one."), + QMessageBox::Close); } break; case ERR_NET_PLAYER_NAME_IN_USE: { @@ -856,122 +854,122 @@ void startWindowImpl::networkError(int errorID, int /*osErrorID*/) } break; case ERR_NET_INVALID_GAME_NAME: { - MyMessageBox::warning(this, tr("Network Error"), - tr("The game name is either too short or too long. Please choose another one."), - QMessageBox::Close); + MyMessageBox::warning(this, tr("Network Error"), + tr("The game name is either too short or too long. Please choose another one."), + QMessageBox::Close); } break; case ERR_NET_UNKNOWN_GAME: { - MyMessageBox::warning(this, tr("Network Error"), - tr("The game could not be found."), - QMessageBox::Close); + MyMessageBox::warning(this, tr("Network Error"), + tr("The game could not be found."), + QMessageBox::Close); } break; case ERR_NET_INVALID_CHAT_TEXT: { - MyMessageBox::warning(this, tr("Network Error"), - tr("The chat text is invalid."), - QMessageBox::Close); + MyMessageBox::warning(this, tr("Network Error"), + tr("The chat text is invalid."), + QMessageBox::Close); } break; case ERR_NET_UNKNOWN_PLAYER_ID: { - MyMessageBox::warning(this, tr("Network Error"), - tr("The server referred to an unknown player. Aborting."), - QMessageBox::Close); + MyMessageBox::warning(this, tr("Network Error"), + tr("The server referred to an unknown player. Aborting."), + QMessageBox::Close); } break; case ERR_NET_NO_CURRENT_PLAYER: { - MyMessageBox::warning(this, tr("Network Error"), - tr("Internal error: The current player could not be found."), - QMessageBox::Close); + MyMessageBox::warning(this, tr("Network Error"), + tr("Internal error: The current player could not be found."), + QMessageBox::Close); } break; case ERR_NET_PLAYER_NOT_ACTIVE: { - MyMessageBox::warning(this, tr("Network Error"), - tr("Internal error: The current player is not active."), - QMessageBox::Close); + MyMessageBox::warning(this, tr("Network Error"), + tr("Internal error: The current player is not active."), + QMessageBox::Close); } break; case ERR_NET_PLAYER_KICKED: { mySession->terminateNetworkClient(); - MyMessageBox::warning(this, tr("Network Error"), - tr("You were kicked from the server."), - QMessageBox::Close); + MyMessageBox::warning(this, tr("Network Error"), + tr("You were kicked from the server."), + QMessageBox::Close); } break; case ERR_NET_PLAYER_BANNED: { mySession->terminateNetworkClient(); - MyMessageBox::warning(this, tr("Network Error"), - tr("You were temporarily banned from the server."), - QMessageBox::Close); + MyMessageBox::warning(this, tr("Network Error"), + tr("You were temporarily banned from the server."), + QMessageBox::Close); } break; case ERR_NET_PLAYER_BLOCKED: { mySession->terminateNetworkClient(); - MyMessageBox::warning(this, tr("Network Error"), - tr("Your account is blocked indefinitely."), - QMessageBox::Close); + MyMessageBox::warning(this, tr("Network Error"), + tr("Your account is blocked indefinitely."), + QMessageBox::Close); } break; case ERR_NET_SESSION_TIMED_OUT: { mySession->terminateNetworkClient(); - MyMessageBox::warning(this, tr("Network Error"), - tr("Your server connection timed out due to inactivity. You are very welcome to reconnect!"), - QMessageBox::Close); + MyMessageBox::warning(this, tr("Network Error"), + tr("Your server connection timed out due to inactivity. You are very welcome to reconnect!"), + QMessageBox::Close); } break; case ERR_NET_INVALID_PLAYER_COUNT: { - MyMessageBox::warning(this, tr("Network Error"), - tr("The client player count is invalid."), - QMessageBox::Close); + MyMessageBox::warning(this, tr("Network Error"), + tr("The client player count is invalid."), + QMessageBox::Close); } break; case ERR_NET_TOO_MANY_MANUAL_BLINDS: { - MyMessageBox::warning(this, tr("Network Error"), - tr("Too many manual blinds were set. Please reconfigure the manual blinds."), - QMessageBox::Close); + MyMessageBox::warning(this, tr("Network Error"), + tr("Too many manual blinds were set. Please reconfigure the manual blinds."), + QMessageBox::Close); } break; case ERR_NET_INVALID_AVATAR_FILE: case ERR_NET_WRONG_AVATAR_SIZE: { - MyMessageBox::warning(this, tr("Network Error"), - tr("An invalid avatar file was configured. Please choose a different avatar."), - QMessageBox::Close); + MyMessageBox::warning(this, tr("Network Error"), + tr("An invalid avatar file was configured. Please choose a different avatar."), + QMessageBox::Close); } break; case ERR_NET_AVATAR_TOO_LARGE: { - MyMessageBox::warning(this, tr("Network Error"), - tr("The selected avatar file is too large. Please choose a different avatar."), - QMessageBox::Close); + MyMessageBox::warning(this, tr("Network Error"), + tr("The selected avatar file is too large. Please choose a different avatar."), + QMessageBox::Close); } break; case ERR_NET_INIT_BLOCKED: { - MyMessageBox::warning(this, tr("Network Error"), - tr("You cannot login at this time. Please try again in a few seconds."), - QMessageBox::Close); + MyMessageBox::warning(this, tr("Network Error"), + tr("You cannot login at this time. Please try again in a few seconds."), + QMessageBox::Close); } break; case ERR_NET_INVALID_REQUEST_ID: { - MyMessageBox::warning(this, tr("Network Error"), - tr("An internal avatar error occured. Please report this to an admin in the lobby chat."), - QMessageBox::Close); + MyMessageBox::warning(this, tr("Network Error"), + tr("An internal avatar error occured. Please report this to an admin in the lobby chat."), + QMessageBox::Close); } break; case ERR_NET_START_TIMEOUT: { - MyMessageBox::warning(this, tr("Network Error"), - tr("Could not start game: Synchronization failed."), - QMessageBox::Close); + MyMessageBox::warning(this, tr("Network Error"), + tr("Could not start game: Synchronization failed."), + QMessageBox::Close); } break; case ERR_NET_SERVER_MAINTENANCE: { - MyMessageBox::warning(this, tr("Network Error"), - tr("The server is down for maintenance. Please try again later."), - QMessageBox::Close); + MyMessageBox::warning(this, tr("Network Error"), + tr("The server is down for maintenance. Please try again later."), + QMessageBox::Close); } break; default: { - MyMessageBox::warning(this, tr("Network Error"), - tr("An internal error occured."), - QMessageBox::Close); + MyMessageBox::warning(this, tr("Network Error"), + tr("An internal error occured."), + QMessageBox::Close); } } // close dialogs @@ -988,44 +986,44 @@ void startWindowImpl::networkNotification(int notificationId) hideTimeoutDialog(); switch (notificationId) { case NTF_NET_JOIN_IP_BLOCKED: { - MyMessageBox::warning(this, tr("Network Notification"), - tr("You cannot join this game, because another player in that game has your network address."), - QMessageBox::Close); + MyMessageBox::warning(this, tr("Network Notification"), + tr("You cannot join this game, because another player in that game has your network address."), + QMessageBox::Close); } break; case NTF_NET_REMOVED_START_FAILED: { myGameLobbyDialog->stopWaitStartGameMsgBoxTimer(); - if(MyMessageBox::warning(this, tr("Network Notification"), - tr("Your connection to the server is very slow, the game had to start without you."), - QMessageBox::Close) == QMessageBox::Close) { + if(MyMessageBox::warning(this, tr("Network Notification"), + tr("Your connection to the server is very slow, the game had to start without you."), + QMessageBox::Close) == QMessageBox::Close) { myGameLobbyDialog->hideWaitStartGameMsgBox(); } } break; case NTF_NET_REMOVED_KICKED: { - MyMessageBox::warning(this, tr("Network Notification"), - tr("You were kicked from the game."), - QMessageBox::Close); + MyMessageBox::warning(this, tr("Network Notification"), + tr("You were kicked from the game."), + QMessageBox::Close); } break; case NTF_NET_REMOVED_GAME_FULL: case NTF_NET_JOIN_GAME_FULL: { - MyMessageBox::warning(this, tr("Network Notification"), - tr("Sorry, this game is already full."), - QMessageBox::Close); + MyMessageBox::warning(this, tr("Network Notification"), + tr("Sorry, this game is already full."), + QMessageBox::Close); } break; case NTF_NET_REMOVED_ALREADY_RUNNING: case NTF_NET_JOIN_ALREADY_RUNNING: { - MyMessageBox::warning(this, tr("Network Notification"), - tr("Unable to join - the server has already started the game."), - QMessageBox::Close); + MyMessageBox::warning(this, tr("Network Notification"), + tr("Unable to join - the server has already started the game."), + QMessageBox::Close); } break; case NTF_NET_JOIN_NOT_INVITED: { - MyMessageBox::warning(this, tr("Network Notification"), - tr("This game is of type invite-only. You cannot join this game without being invited."), - QMessageBox::Close); + MyMessageBox::warning(this, tr("Network Notification"), + tr("This game is of type invite-only. You cannot join this game without being invited."), + QMessageBox::Close); } break; case NTF_NET_JOIN_GAME_NAME_IN_USE: { @@ -1045,27 +1043,27 @@ void startWindowImpl::networkNotification(int notificationId) } break; case NTF_NET_REMOVED_TIMEOUT: { - MyMessageBox::warning(this, tr("Network Notification"), - tr("Your admin state timed out due to inactivity. Feel free to create a new game!"), - QMessageBox::Close); + MyMessageBox::warning(this, tr("Network Notification"), + tr("Your admin state timed out due to inactivity. Feel free to create a new game!"), + QMessageBox::Close); } break; case NTF_NET_JOIN_INVALID_PASSWORD: { - MyMessageBox::warning(this, tr("Network Notification"), - tr("Invalid password when joining the game.\nPlease reenter the password and try again."), - QMessageBox::Close); + MyMessageBox::warning(this, tr("Network Notification"), + tr("Invalid password when joining the game.\nPlease reenter the password and try again."), + QMessageBox::Close); } break; case NTF_NET_JOIN_GUEST_FORBIDDEN: { - MyMessageBox::warning(this, tr("Network Notification"), - tr("You cannot join this type of game as guest."), - QMessageBox::Close); + MyMessageBox::warning(this, tr("Network Notification"), + tr("You cannot join this type of game as guest."), + QMessageBox::Close); } break; case NTF_NET_JOIN_INVALID_SETTINGS: { - MyMessageBox::warning(this, tr("Network Notification"), - tr("The settings are invalid for this type of game."), - QMessageBox::Close); + MyMessageBox::warning(this, tr("Network Notification"), + tr("The settings are invalid for this type of game."), + QMessageBox::Close); } break; case NTF_NET_NEW_RELEASE_AVAILABLE: { @@ -1095,8 +1093,8 @@ void startWindowImpl::networkNotification(int notificationId) void startWindowImpl::networkMessage(QString msg) { - MyMessageBox msgBox(QMessageBox::Information, tr("Server Message"), - msg, QMessageBox::Close, this); + MyMessageBox msgBox(QMessageBox::Information, tr("Server Message"), + msg, QMessageBox::Close, this); msgBox.setTextFormat(Qt::RichText); msgBox.exec(); } @@ -1136,8 +1134,8 @@ void startWindowImpl::networkMessage(unsigned msgId) break; } - MyMessageBox msgBox(QMessageBox::Information, tr("Server Message"), - msgText, QMessageBox::Close, this); + MyMessageBox msgBox(QMessageBox::Information, tr("Server Message"), + msgText, QMessageBox::Close, this); // msgBox.setTextFormat(Qt::RichText); msgBox.exec(); } diff --git a/src/gui/qt/styles/carddeckstylereader.cpp b/src/gui/qt/styles/carddeckstylereader.cpp index c3621d41..732c0dfe 100644 --- a/src/gui/qt/styles/carddeckstylereader.cpp +++ b/src/gui/qt/styles/carddeckstylereader.cpp @@ -38,204 +38,202 @@ CardDeckStyleReader::~CardDeckStyleReader() void CardDeckStyleReader::readStyleFile(QString file) { - BigIndexesActionBottom = ""; + BigIndexesActionBottom = ""; #ifdef ANDROID - //on Android we use just the defaul style packed with the binary via qrc - currentFileName = ":/android/android-data/gfx/cards/default_800x480/defaultdeckstyle_800x480.xml"; - currentDir = ":/android/android-data/gfx/cards/default_800x480/"; + //on Android we use just the defaul style packed with the binary via qrc + currentFileName = ":/android/android-data/gfx/cards/default_800x480/defaultdeckstyle_800x480.xml"; + currentDir = ":/android/android-data/gfx/cards/default_800x480/"; #else - //if style file failed --> default style fallback - if(QFile(file).exists()) { - currentFileName = file; - } else { - currentFileName = QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str())+"gfx/cards/default_800x480/defaultdeckstyle_800x480.xml"; - fallBack = 1; - } + //if style file failed --> default style fallback + if(QFile(file).exists()) { + currentFileName = file; + } else { + currentFileName = QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str())+"gfx/cards/default_800x480/defaultdeckstyle_800x480.xml"; + fallBack = 1; + } - QFileInfo info(currentFileName); - currentDir = info.absolutePath()+"/"; + QFileInfo info(currentFileName); + currentDir = info.absolutePath()+"/"; #endif - QFile myFile(currentFileName); - myFile.open(QIODevice::ReadOnly); - fileContent = myFile.readAll(); + QFile myFile(currentFileName); + myFile.open(QIODevice::ReadOnly); + fileContent = myFile.readAll(); - //start reading the file and fill vars - string tempString1(""); + //start reading the file and fill vars + string tempString1(""); - TiXmlDocument doc; - doc.Parse(fileContent.constData()); + TiXmlDocument doc; + doc.Parse(fileContent.constData()); - if(doc.RootElement()) { - TiXmlHandle docHandle( &doc ); - TiXmlElement *GameTableElement = docHandle.FirstChild( "PokerTH" ).FirstChild( "TableStyle" ).ToElement(); - if(GameTableElement) { - MyMessageBox::warning(myW, tr("Card Deck Style Error"), - tr("A game table style was selected instead of a card deck style.\nPlease select a card deck style and try again!"), - QMessageBox::Ok); - } else { + if(doc.RootElement()) { + TiXmlHandle docHandle( &doc ); + TiXmlElement *GameTableElement = docHandle.FirstChild( "PokerTH" ).FirstChild( "TableStyle" ).ToElement(); + if(GameTableElement) { + MyMessageBox::warning(myW, tr("Card Deck Style Error"), + tr("A game table style was selected instead of a card deck style.\nPlease select a card deck style and try again!"), + QMessageBox::Ok); + } else { - TiXmlElement* itemsList = docHandle.FirstChild( "PokerTH" ).FirstChild( "CardDeck" ).FirstChild().ToElement(); - for( ; itemsList; itemsList=itemsList->NextSiblingElement()) { - const char *tmpStr1 = itemsList->Attribute("value"); - if (tmpStr1) { - tempString1 = tmpStr1; + TiXmlElement* itemsList = docHandle.FirstChild( "PokerTH" ).FirstChild( "CardDeck" ).FirstChild().ToElement(); + for( ; itemsList; itemsList=itemsList->NextSiblingElement()) { + const char *tmpStr1 = itemsList->Attribute("value"); + if (tmpStr1) { + tempString1 = tmpStr1; - if(itemsList->ValueStr() == "StyleDescription") { - StyleDescription = QString::fromUtf8(tempString1.c_str()); - } else if(itemsList->ValueStr() == "StyleMaintainerName") { - StyleMaintainerName = QString::fromUtf8(tempString1.c_str()); - } else if(itemsList->ValueStr() == "StyleMaintainerEMail") { - StyleMaintainerEMail = QString::fromUtf8(tempString1.c_str()); - } else if(itemsList->ValueStr() == "StyleCreateDate") { - StyleCreateDate = QString::fromUtf8(tempString1.c_str()); - } else if(itemsList->ValueStr() == "PokerTHStyleFileVersion") { - PokerTHStyleFileVersion = QString::fromUtf8(tempString1.c_str()); - } else if (itemsList->ValueStr() == "Preview") { - Preview = currentDir+QString::fromUtf8(tempString1.c_str()); - } else if (itemsList->ValueStr() == "BigIndexesActionBottom") { - BigIndexesActionBottom = QString::fromUtf8(tempString1.c_str()); - } - } - } - //check if style items are left and show warning - leftItems.clear(); + if(itemsList->ValueStr() == "StyleDescription") { + StyleDescription = QString::fromUtf8(tempString1.c_str()); + } else if(itemsList->ValueStr() == "StyleMaintainerName") { + StyleMaintainerName = QString::fromUtf8(tempString1.c_str()); + } else if(itemsList->ValueStr() == "StyleMaintainerEMail") { + StyleMaintainerEMail = QString::fromUtf8(tempString1.c_str()); + } else if(itemsList->ValueStr() == "StyleCreateDate") { + StyleCreateDate = QString::fromUtf8(tempString1.c_str()); + } else if(itemsList->ValueStr() == "PokerTHStyleFileVersion") { + PokerTHStyleFileVersion = QString::fromUtf8(tempString1.c_str()); + } else if (itemsList->ValueStr() == "Preview") { + Preview = currentDir+QString::fromUtf8(tempString1.c_str()); + } else if (itemsList->ValueStr() == "BigIndexesActionBottom") { + BigIndexesActionBottom = QString::fromUtf8(tempString1.c_str()); + } + } + } + //check if style items are left and show warning + leftItems.clear(); - if(StyleDescription == "") { - leftItems << "StyleDescription"; - } - if(StyleMaintainerName == "") { - leftItems << "StyleMaintainerName"; - } - if(StyleMaintainerEMail == "") { - leftItems << "StyleMaintainerEMail"; - } - if(StyleCreateDate == "") { - leftItems << "StyleCreateDate"; - } - if(PokerTHStyleFileVersion == "") { - leftItems << "PokerTHStyleFileVersion"; - } - if(BigIndexesActionBottom == "") { - //ATTENTION: no fallback action here because default position is mostly CENTER - BigIndexesActionBottom = "0"; - leftItems << "BigIndexesActionBottom"; - } + if(StyleDescription == "") { + leftItems << "StyleDescription"; + } + if(StyleMaintainerName == "") { + leftItems << "StyleMaintainerName"; + } + if(StyleMaintainerEMail == "") { + leftItems << "StyleMaintainerEMail"; + } + if(StyleCreateDate == "") { + leftItems << "StyleCreateDate"; + } + if(PokerTHStyleFileVersion == "") { + leftItems << "PokerTHStyleFileVersion"; + } + if(BigIndexesActionBottom == "") { + //ATTENTION: no fallback action here because default position is mostly CENTER + BigIndexesActionBottom = "0"; + leftItems << "BigIndexesActionBottom"; + } - //check if all files are there - cardsLeft.clear(); - int i; - for(i=0; i<52; i++) { - QString cardString(QString::number(i)+".png"); - if(!QDir(currentDir).exists(cardString)) { - cardsLeft << cardString; - } - } - if(!QDir(currentDir).exists("flipside.png")) { - cardsLeft << "flipside.png"; - } + //check if all files are there + cardsLeft.clear(); + int i; + for(i=0; i<52; i++) { + QString cardString(QString::number(i)+".png"); + if(!QDir(currentDir).exists(cardString)) { + cardsLeft << cardString; + } + } + if(!QDir(currentDir).exists("flipside.png")) { + cardsLeft << "flipside.png"; + } - // set loadedSuccessfull TRUE if everything works - if(leftItems.isEmpty() && cardsLeft.isEmpty() && PokerTHStyleFileVersion != "" && PokerTHStyleFileVersion.toInt() == POKERTH_CD_STYLE_FILE_VERSION) { - myState = CD_STYLE_OK; - } - else { - //check for style file version - if(PokerTHStyleFileVersion != "" && PokerTHStyleFileVersion.toInt() != POKERTH_CD_STYLE_FILE_VERSION) { - myState = CD_STYLE_OUTDATED; - } else { - //if one or more items are left - if(!leftItems.isEmpty() && myW != 0) myState = CD_STYLE_FIELDS_EMPTY; + // set loadedSuccessfull TRUE if everything works + if(leftItems.isEmpty() && cardsLeft.isEmpty() && PokerTHStyleFileVersion != "" && PokerTHStyleFileVersion.toInt() == POKERTH_CD_STYLE_FILE_VERSION) { + myState = CD_STYLE_OK; + } else { + //check for style file version + if(PokerTHStyleFileVersion != "" && PokerTHStyleFileVersion.toInt() != POKERTH_CD_STYLE_FILE_VERSION) { + myState = CD_STYLE_OUTDATED; + } else { + //if one or more items are left + if(!leftItems.isEmpty() && myW != 0) myState = CD_STYLE_FIELDS_EMPTY; - //if one or more pictures where not found - if(!cardsLeft.isEmpty() && myW != 0) myState = CD_STYLE_PICTURES_MISSING; - } - } - loadedSuccessfull = 1; - } - } - else { - loadedSuccessfull = 0; - MyMessageBox::warning(myW, tr("Card Deck Style Error"), - tr("Cannot load card deck style file: %1 \n\nPlease check the style file or choose another style!").arg(currentFileName), - QMessageBox::Ok); - } + //if one or more pictures where not found + if(!cardsLeft.isEmpty() && myW != 0) myState = CD_STYLE_PICTURES_MISSING; + } + } + loadedSuccessfull = 1; + } + } else { + loadedSuccessfull = 0; + MyMessageBox::warning(myW, tr("Card Deck Style Error"), + tr("Cannot load card deck style file: %1 \n\nPlease check the style file or choose another style!").arg(currentFileName), + QMessageBox::Ok); + } } void CardDeckStyleReader::showErrorMessage() { - switch (myState) { - case CD_STYLE_PICTURES_MISSING: - showCardsLeftErrorMessage(); - break; - case CD_STYLE_FIELDS_EMPTY: - showLeftItemsErrorMessage(); - break; - case CD_STYLE_OUTDATED: - showOutdatedErrorMessage(); - break; - default: - ; - } + switch (myState) { + case CD_STYLE_PICTURES_MISSING: + showCardsLeftErrorMessage(); + break; + case CD_STYLE_FIELDS_EMPTY: + showLeftItemsErrorMessage(); + break; + case CD_STYLE_OUTDATED: + showOutdatedErrorMessage(); + break; + default: + ; + } } QString CardDeckStyleReader::getMyStateToolTipInfo() { - switch (myState) { - case CD_STYLE_OK: - return QString(tr("Everything OK!")); - break; - case CD_STYLE_PICTURES_MISSING: - return QString(tr("Some cards pictures are missing, please contact style maintainer for this issue.")); - break; - case CD_STYLE_FIELDS_EMPTY: - return QString(tr("Some style fields are missing, please contact style maintainer for this issue.")); - break; - case CD_STYLE_OUTDATED: - return QString(tr("This style is outdated, please contact style maintainer for this issue.")); - break; - default: - return QString(""); - } + switch (myState) { + case CD_STYLE_OK: + return QString(tr("Everything OK!")); + break; + case CD_STYLE_PICTURES_MISSING: + return QString(tr("Some cards pictures are missing, please contact style maintainer for this issue.")); + break; + case CD_STYLE_FIELDS_EMPTY: + return QString(tr("Some style fields are missing, please contact style maintainer for this issue.")); + break; + case CD_STYLE_OUTDATED: + return QString(tr("This style is outdated, please contact style maintainer for this issue.")); + break; + default: + return QString(""); + } } void CardDeckStyleReader::showLeftItemsErrorMessage() { - QString items = leftItems.join("\n"); - QString EMail; - if(StyleMaintainerEMail != "NULL") EMail = StyleMaintainerEMail; + QString items = leftItems.join("\n"); + QString EMail; + if(StyleMaintainerEMail != "NULL") EMail = StyleMaintainerEMail; - myMessageDialogImpl dialog(myConfig, myW); + myMessageDialogImpl dialog(myConfig, myW); - if(dialog.checkIfMesssageWillBeDisplayed(CD_VALUES_MISSING)) { - dialog.exec(CD_VALUES_MISSING, tr("Selected card deck style \"%1\" seems to be incomplete or defective. \n\nThe value(s) of: \n%2 \nis/are missing. \n\nAnyway you can play with this deck, because the missing content will be filled up by PokerTH default card deck. \n\nPlease contact the card deck style builder via \"%3\".").arg(StyleDescription).arg(items).arg(EMail), tr("Card Deck Style Error - Fields content missing"), QPixmap(":/gfx/emblem-important-64.png"), QDialogButtonBox::Ok, true); - } + if(dialog.checkIfMesssageWillBeDisplayed(CD_VALUES_MISSING)) { + dialog.exec(CD_VALUES_MISSING, tr("Selected card deck style \"%1\" seems to be incomplete or defective. \n\nThe value(s) of: \n%2 \nis/are missing. \n\nAnyway you can play with this deck, because the missing content will be filled up by PokerTH default card deck. \n\nPlease contact the card deck style builder via \"%3\".").arg(StyleDescription).arg(items).arg(EMail), tr("Card Deck Style Error - Fields content missing"), QPixmap(":/gfx/emblem-important-64.png"), QDialogButtonBox::Ok, true); + } } void CardDeckStyleReader::showCardsLeftErrorMessage() { - QString pics = cardsLeft.join("\n"); - QString EMail; - if(StyleMaintainerEMail != "NULL") EMail = StyleMaintainerEMail; + QString pics = cardsLeft.join("\n"); + QString EMail; + if(StyleMaintainerEMail != "NULL") EMail = StyleMaintainerEMail; - myMessageDialogImpl dialog(myConfig, myW); + myMessageDialogImpl dialog(myConfig, myW); - if(dialog.checkIfMesssageWillBeDisplayed(CD_PICS_MISSING)) { - dialog.exec(CD_PICS_MISSING, tr("One or more pictures from current card deck style \"%1\" were not found: \n\n%2 \n\nPlease contact the card deck style builder via \"%3\".").arg(StyleDescription).arg(pics).arg(EMail), tr("Card Deck Style Error - Pictures missing"), QPixmap(":/gfx/emblem-important-64.png"), QDialogButtonBox::Ok, true); - } + if(dialog.checkIfMesssageWillBeDisplayed(CD_PICS_MISSING)) { + dialog.exec(CD_PICS_MISSING, tr("One or more pictures from current card deck style \"%1\" were not found: \n\n%2 \n\nPlease contact the card deck style builder via \"%3\".").arg(StyleDescription).arg(pics).arg(EMail), tr("Card Deck Style Error - Pictures missing"), QPixmap(":/gfx/emblem-important-64.png"), QDialogButtonBox::Ok, true); + } } void CardDeckStyleReader::showOutdatedErrorMessage() { - QString EMail; - if(StyleMaintainerEMail != "NULL") EMail = StyleMaintainerEMail; + QString EMail; + if(StyleMaintainerEMail != "NULL") EMail = StyleMaintainerEMail; - myMessageDialogImpl dialog(myConfig, myW); + myMessageDialogImpl dialog(myConfig, myW); - if(dialog.checkIfMesssageWillBeDisplayed(CD_OUTDATED)) { - dialog.exec(CD_OUTDATED, tr("Selected card deck style \"%1\" seems to be outdated. \nThe current PokerTH card deck style version is \"%2\", but this deck has version \"%3\" set. \n\nAnyway you can play with this deck, because the missing content will be filled up by PokerTH default card deck. \n\nPlease contact the card deck style builder via \"%4\".").arg(StyleDescription).arg(POKERTH_CD_STYLE_FILE_VERSION).arg(PokerTHStyleFileVersion).arg(EMail), tr("Card Deck Style Error - Outdated"), QPixmap(":/gfx/emblem-important-64.png"), QDialogButtonBox::Ok, true); - } + if(dialog.checkIfMesssageWillBeDisplayed(CD_OUTDATED)) { + dialog.exec(CD_OUTDATED, tr("Selected card deck style \"%1\" seems to be outdated. \nThe current PokerTH card deck style version is \"%2\", but this deck has version \"%3\" set. \n\nAnyway you can play with this deck, because the missing content will be filled up by PokerTH default card deck. \n\nPlease contact the card deck style builder via \"%4\".").arg(StyleDescription).arg(POKERTH_CD_STYLE_FILE_VERSION).arg(PokerTHStyleFileVersion).arg(EMail), tr("Card Deck Style Error - Outdated"), QPixmap(":/gfx/emblem-important-64.png"), QDialogButtonBox::Ok, true); + } } diff --git a/src/gui/qt/styles/carddeckstylereader.h b/src/gui/qt/styles/carddeckstylereader.h index ca7f7b82..641dc0f5 100644 --- a/src/gui/qt/styles/carddeckstylereader.h +++ b/src/gui/qt/styles/carddeckstylereader.h @@ -31,7 +31,7 @@ enum CdStyleState { CD_STYLE_OUTDATED, CD_STYLE_FIELDS_EMPTY, CD_STYLE_PICTURES_MISSING, - CD_STYLE_UNDEFINED + CD_STYLE_UNDEFINED }; class CardDeckStyleReader : public QObject @@ -67,26 +67,26 @@ public: return Preview; } - QString getBigIndexesActionBottom() const { - return BigIndexesActionBottom; - } + QString getBigIndexesActionBottom() const { + return BigIndexesActionBottom; + } bool getFallBack() const { return fallBack; } bool getLoadedSuccessfull() const { return loadedSuccessfull; - } + } - CdStyleState getState() const { - return myState; - } + CdStyleState getState() const { + return myState; + } - QString getMyStateToolTipInfo(); - void showErrorMessage(); - void showLeftItemsErrorMessage(); - void showCardsLeftErrorMessage(); - void showOutdatedErrorMessage(); + QString getMyStateToolTipInfo(); + void showErrorMessage(); + void showLeftItemsErrorMessage(); + void showCardsLeftErrorMessage(); + void showOutdatedErrorMessage(); private: @@ -96,7 +96,7 @@ private: QString StyleCreateDate; QString PokerTHStyleFileVersion; QString Preview; - QString BigIndexesActionBottom; + QString BigIndexesActionBottom; QString currentFileName; QString currentDir; @@ -109,9 +109,9 @@ private: QWidget *myW; bool fallBack; - bool loadedSuccessfull; + bool loadedSuccessfull; - CdStyleState myState; + CdStyleState myState; }; #endif diff --git a/src/gui/qt/styles/gametablestylereader.cpp b/src/gui/qt/styles/gametablestylereader.cpp index af09a5d5..81cf85f1 100644 --- a/src/gui/qt/styles/gametablestylereader.cpp +++ b/src/gui/qt/styles/gametablestylereader.cpp @@ -21,74 +21,74 @@ using namespace std; GameTableStyleReader::GameTableStyleReader(ConfigFile *c, QWidget *w) - : myConfig(c), myW(w), fallBack(0), loadedSuccessfull(0), myState(GT_STYLE_UNDEFINED) + : myConfig(c), myW(w), fallBack(0), loadedSuccessfull(0), myState(GT_STYLE_UNDEFINED) { - //set fonts and font sizes + //set fonts and font sizes #ifdef _WIN32 - font1String = "font-family: \"Arial\";"; - font2String = "font-family: \"Nimbus Sans L\";"; - cashFontSize = "11"; - setLabelFontSize = "11"; - playerNameLabelFontSize = "11"; - smallBoardFontSize = "13"; - bigBoardFontSize = "18"; - humanPlayerButtonFontSize = "13"; - betValueFontSize = "11"; - tabBarPaddingTop = "2"; - tabBarPaddingSide = "10"; + font1String = "font-family: \"Arial\";"; + font2String = "font-family: \"Nimbus Sans L\";"; + cashFontSize = "11"; + setLabelFontSize = "11"; + playerNameLabelFontSize = "11"; + smallBoardFontSize = "13"; + bigBoardFontSize = "18"; + humanPlayerButtonFontSize = "13"; + betValueFontSize = "11"; + tabBarPaddingTop = "2"; + tabBarPaddingSide = "10"; #elif __APPLE__ - font1String = "font-family: \"Lucida Grande\";"; - font2String = "font-family: \"Lucida Grande\";"; - tabBarPaddingTop = "1"; - tabBarPaddingSide = "9"; - textBrowserFontsize= "10"; - cashFontSize = "10"; - setLabelFontSize = "10"; - playerNameLabelFontSize = "11"; - smallBoardFontSize = "13"; - bigBoardFontSize = "17"; - humanPlayerButtonFontSize = "12"; - betValueFontSize = "10"; + font1String = "font-family: \"Lucida Grande\";"; + font2String = "font-family: \"Lucida Grande\";"; + tabBarPaddingTop = "1"; + tabBarPaddingSide = "9"; + textBrowserFontsize= "10"; + cashFontSize = "10"; + setLabelFontSize = "10"; + playerNameLabelFontSize = "11"; + smallBoardFontSize = "13"; + bigBoardFontSize = "17"; + humanPlayerButtonFontSize = "12"; + betValueFontSize = "10"; #elif MAEMO - font1String = "font-family: \"Nimbus Sans L\";"; - font2String = "font-family: \"DejaVu Sans\";"; - tabBarPaddingTop = "0"; - tabBarPaddingSide = "9"; - textBrowserFontsize= "10"; + font1String = "font-family: \"Nimbus Sans L\";"; + font2String = "font-family: \"DejaVu Sans\";"; + tabBarPaddingTop = "0"; + tabBarPaddingSide = "9"; + textBrowserFontsize= "10"; cashFontSize = "12"; setLabelFontSize = "13"; - playerNameLabelFontSize = "11"; - smallBoardFontSize = "13"; - bigBoardFontSize = "17"; - humanPlayerButtonFontSize = "12"; - betValueFontSize = "10"; + playerNameLabelFontSize = "11"; + smallBoardFontSize = "13"; + bigBoardFontSize = "17"; + humanPlayerButtonFontSize = "12"; + betValueFontSize = "10"; #elif ANDROID - font1String = "font-family: \"Nimbus Sans L\";"; - font2String = "font-family: \"DejaVu Sans\";"; - tabBarPaddingTop = "0"; - tabBarPaddingSide = "9"; - textBrowserFontsize= "10"; - cashFontSize = "12"; - setLabelFontSize = "13"; - playerNameLabelFontSize = "11"; - smallBoardFontSize = "13"; - bigBoardFontSize = "17"; - humanPlayerButtonFontSize = "12"; - betValueFontSize = "15"; + font1String = "font-family: \"Nimbus Sans L\";"; + font2String = "font-family: \"DejaVu Sans\";"; + tabBarPaddingTop = "0"; + tabBarPaddingSide = "9"; + textBrowserFontsize= "10"; + cashFontSize = "12"; + setLabelFontSize = "13"; + playerNameLabelFontSize = "11"; + smallBoardFontSize = "13"; + bigBoardFontSize = "17"; + humanPlayerButtonFontSize = "12"; + betValueFontSize = "15"; #else //Linux - font1String = "font-family: \"Nimbus Sans L\";"; - font2String = "font-family: \"DejaVu Sans\";"; - tabBarPaddingTop = "0"; - tabBarPaddingSide = "9"; - textBrowserFontsize= "10"; - cashFontSize = "10"; - setLabelFontSize = "10"; - playerNameLabelFontSize = "11"; - smallBoardFontSize = "13"; - bigBoardFontSize = "17"; - humanPlayerButtonFontSize = "12"; - betValueFontSize = "10"; + font1String = "font-family: \"Nimbus Sans L\";"; + font2String = "font-family: \"DejaVu Sans\";"; + tabBarPaddingTop = "0"; + tabBarPaddingSide = "9"; + textBrowserFontsize= "10"; + cashFontSize = "10"; + setLabelFontSize = "10"; + playerNameLabelFontSize = "11"; + smallBoardFontSize = "13"; + bigBoardFontSize = "17"; + humanPlayerButtonFontSize = "12"; + betValueFontSize = "10"; #endif } @@ -100,1630 +100,1629 @@ GameTableStyleReader::~GameTableStyleReader() void GameTableStyleReader::readStyleFile(QString file) { #ifdef ANDROID - //on Android we currently just use the defaul style packed with the binary via qrc - currentFileName = ":/android/android-data/gfx/gui/table/default_800x480/android_tablestyle_800x480.xml"; - currentDir = ":/android/android-data/gfx/gui/table/default_800x480/"; + //on Android we currently just use the defaul style packed with the binary via qrc + currentFileName = ":/android/android-data/gfx/gui/table/default_800x480/android_tablestyle_800x480.xml"; + currentDir = ":/android/android-data/gfx/gui/table/default_800x480/"; #else - //if style file failed --> default style fallback - if(QFile(file).exists()) { - currentFileName = QFile(file).fileName(); - } else { - currentFileName = QFile(QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str())+"gfx/gui/table/default/defaulttablestyle.xml").fileName(); - fallBack = 1; - } + //if style file failed --> default style fallback + if(QFile(file).exists()) { + currentFileName = QFile(file).fileName(); + } else { + currentFileName = QFile(QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str())+"gfx/gui/table/default/defaulttablestyle.xml").fileName(); + fallBack = 1; + } - QFileInfo info(currentFileName); - currentDir = info.absolutePath()+"/"; + QFileInfo info(currentFileName); + currentDir = info.absolutePath()+"/"; #endif - QFile myFile(currentFileName); - myFile.open(QIODevice::ReadOnly); - fileContent = myFile.readAll(); + QFile myFile(currentFileName); + myFile.open(QIODevice::ReadOnly); + fileContent = myFile.readAll(); - //start reading the file and fill vars - string tempString1(""); - TiXmlDocument doc; - doc.Parse(fileContent.constData()); + //start reading the file and fill vars + string tempString1(""); + TiXmlDocument doc; + doc.Parse(fileContent.constData()); - if(doc.RootElement()) { - TiXmlHandle docHandle( &doc ); - TiXmlElement *CardDeckElement = docHandle.FirstChild( "PokerTH" ).FirstChild( "CardDeck" ).ToElement(); - if(CardDeckElement) { - MyMessageBox::warning(myW, tr("Game Table Style Error"), - tr("A card deck style was selected instead of a game table style.\nPlease select a game table style and try again!"), - QMessageBox::Ok); - } else { - //in case of rereading clear old variables: - StyleDescription.clear(); - StyleMaintainerName.clear(); - StyleMaintainerEMail.clear(); - StyleCreateDate.clear(); - PokerTHStyleFileVersion.clear(); - IfFixedWindowSize.clear(); - FixedWindowWidth.clear(); - FixedWindowHeight.clear(); - MinimumWindowWidth.clear(); - MinimumWindowHeight.clear(); - MaximumWindowWidth.clear(); - MaximumWindowHeight.clear(); - Preview.clear(); - ActionAllInI18NPic.clear(); - ActionRaiseI18NPic.clear(); - ActionBetI18NPic.clear(); - ActionCallI18NPic.clear(); - ActionCheckI18NPic.clear(); - ActionFoldI18NPic.clear(); - ActionWinnerI18NPic.clear(); - BigBlindPuck.clear(); - SmallBlindPuck.clear(); - DealerPuck.clear(); - DefaultAvatar.clear(); - CardHolderFlop.clear(); - CardHolderTurn.clear(); - CardHolderRiver.clear(); - FoldButtonDefault.clear(); - FoldButtonHover.clear(); - FoldButtonChecked.clear(); - FoldButtonCheckedHover.clear(); - CheckCallButtonDefault.clear(); - CheckCallButtonHover.clear(); - CheckCallButtonChecked.clear(); - CheckCallButtonCheckedHover.clear(); - BetRaiseButtonDefault.clear(); - BetRaiseButtonHover.clear(); - BetRaiseButtonChecked.clear(); - BetRaiseButtonCheckedHover.clear(); - AllInButtonDefault.clear(); - AllInButtonHover.clear(); - AllInButtonChecked.clear(); - AllInButtonCheckedHover.clear(); - RadioButtonPressed.clear(); - RadioButtonChecked.clear(); - RadioButtonCheckedHover.clear(); - RadioButtonUnchecked.clear(); - RadioButtonUncheckedHover.clear(); - PlayerTopSeatInactive.clear(); - PlayerTopSeatActive.clear(); - PlayerBottomSeatInactive.clear(); - PlayerBottomSeatActive.clear(); - Table.clear(); - HandRanking.clear(); - ToolBoxBackground.clear(); - ShowMyCardsButtonDefault.clear(); - ShowMyCardsButtonHover.clear(); - ActionAllInI18NString.clear(); - ActionRaiseI18NString.clear(); - ActionBetI18NString.clear(); - ActionCallI18NString.clear(); - ActionCheckI18NString.clear(); - ActionFoldI18NString.clear(); - PotI18NString.clear(); - TotalI18NString.clear(); - BetsI18NString.clear(); - GameI18NString.clear(); - HandI18NString.clear(); - PreflopI18NString.clear(); - FlopI18NString.clear(); - TurnI18NString.clear(); - RiverI18NString.clear(); - FKeyIndicatorColor.clear(); - ChanceLabelPossibleColor.clear(); - ChanceLabelImpossibleColor.clear(); - ChatTextNickNotifyColor.clear(); - ChatLogTextColor.clear(); - ChatLogBgColor.clear(); - ChatLogScrollBarBorderColor.clear(); - ChatLogScrollBarBgColor.clear(); - ChatLogScrollBarHandleBorderColor.clear(); - ChatLogScrollBarHandleBgColor.clear(); - ChatLogScrollBarArrowBorderColor.clear(); - ChatLogScrollBarArrowBgColor.clear(); - LogWinnerMainPotColor.clear(); - LogWinnerSidePotColor.clear(); - LogPlayerSitsOutColor.clear(); - LogNewGameAdminColor.clear(); - TabWidgetBorderColor.clear(); - TabWidgetBgColor.clear(); - TabWidgetTextColor.clear(); - MenuBgColor.clear(); - MenuTextColor.clear(); - BreakLobbyButtonBgColor.clear(); - BreakLobbyButtonTextColor.clear(); - BreakLobbyButtonBgDisabledColor.clear(); - BreakLobbyButtonTextDisabledColor.clear(); - BreakLobbyButtonBgBlinkColor.clear(); - BreakLobbyButtonTextBlinkColor.clear(); - PlayerCashTextColor.clear(); - PlayerBetTextColor.clear(); - PlayerNickTextColor.clear(); - BoardBigTextColor.clear(); - BoardSmallTextColor.clear(); - SpeedTextColor.clear(); - VoteButtonBgColor.clear(); - VoteButtonTextColor.clear(); - BetInputTextColor.clear(); - BetInputBgColor.clear(); - BetInputDisabledTextColor.clear(); - BetInputDisabledBgColor.clear(); - FoldButtonTextColor.clear(); - FoldButtonCheckableTextColor.clear(); - CheckCallButtonTextColor.clear(); - CheckCallButtonCheckableTextColor.clear(); - BetRaiseButtonTextColor.clear(); - BetRaiseButtonCheckableTextColor.clear(); - AllInButtonTextColor.clear(); - AllInButtonCheckableTextColor.clear(); - BetSpeedSliderGrooveBgColor.clear(); - BetSpeedSliderGrooveBorderColor.clear(); - BetSpeedSliderHandleBgColor.clear(); - BetSpeedSliderHandleBorderColor.clear(); - ShowMyCardsButtonTextColor.clear(); - RatingStarsColor.clear(); - PlayerInfoHintTextColor.clear(); - ChatLogTextSize.clear(); + if(doc.RootElement()) { + TiXmlHandle docHandle( &doc ); + TiXmlElement *CardDeckElement = docHandle.FirstChild( "PokerTH" ).FirstChild( "CardDeck" ).ToElement(); + if(CardDeckElement) { + MyMessageBox::warning(myW, tr("Game Table Style Error"), + tr("A card deck style was selected instead of a game table style.\nPlease select a game table style and try again!"), + QMessageBox::Ok); + } else { + //in case of rereading clear old variables: + StyleDescription.clear(); + StyleMaintainerName.clear(); + StyleMaintainerEMail.clear(); + StyleCreateDate.clear(); + PokerTHStyleFileVersion.clear(); + IfFixedWindowSize.clear(); + FixedWindowWidth.clear(); + FixedWindowHeight.clear(); + MinimumWindowWidth.clear(); + MinimumWindowHeight.clear(); + MaximumWindowWidth.clear(); + MaximumWindowHeight.clear(); + Preview.clear(); + ActionAllInI18NPic.clear(); + ActionRaiseI18NPic.clear(); + ActionBetI18NPic.clear(); + ActionCallI18NPic.clear(); + ActionCheckI18NPic.clear(); + ActionFoldI18NPic.clear(); + ActionWinnerI18NPic.clear(); + BigBlindPuck.clear(); + SmallBlindPuck.clear(); + DealerPuck.clear(); + DefaultAvatar.clear(); + CardHolderFlop.clear(); + CardHolderTurn.clear(); + CardHolderRiver.clear(); + FoldButtonDefault.clear(); + FoldButtonHover.clear(); + FoldButtonChecked.clear(); + FoldButtonCheckedHover.clear(); + CheckCallButtonDefault.clear(); + CheckCallButtonHover.clear(); + CheckCallButtonChecked.clear(); + CheckCallButtonCheckedHover.clear(); + BetRaiseButtonDefault.clear(); + BetRaiseButtonHover.clear(); + BetRaiseButtonChecked.clear(); + BetRaiseButtonCheckedHover.clear(); + AllInButtonDefault.clear(); + AllInButtonHover.clear(); + AllInButtonChecked.clear(); + AllInButtonCheckedHover.clear(); + RadioButtonPressed.clear(); + RadioButtonChecked.clear(); + RadioButtonCheckedHover.clear(); + RadioButtonUnchecked.clear(); + RadioButtonUncheckedHover.clear(); + PlayerTopSeatInactive.clear(); + PlayerTopSeatActive.clear(); + PlayerBottomSeatInactive.clear(); + PlayerBottomSeatActive.clear(); + Table.clear(); + HandRanking.clear(); + ToolBoxBackground.clear(); + ShowMyCardsButtonDefault.clear(); + ShowMyCardsButtonHover.clear(); + ActionAllInI18NString.clear(); + ActionRaiseI18NString.clear(); + ActionBetI18NString.clear(); + ActionCallI18NString.clear(); + ActionCheckI18NString.clear(); + ActionFoldI18NString.clear(); + PotI18NString.clear(); + TotalI18NString.clear(); + BetsI18NString.clear(); + GameI18NString.clear(); + HandI18NString.clear(); + PreflopI18NString.clear(); + FlopI18NString.clear(); + TurnI18NString.clear(); + RiverI18NString.clear(); + FKeyIndicatorColor.clear(); + ChanceLabelPossibleColor.clear(); + ChanceLabelImpossibleColor.clear(); + ChatTextNickNotifyColor.clear(); + ChatLogTextColor.clear(); + ChatLogBgColor.clear(); + ChatLogScrollBarBorderColor.clear(); + ChatLogScrollBarBgColor.clear(); + ChatLogScrollBarHandleBorderColor.clear(); + ChatLogScrollBarHandleBgColor.clear(); + ChatLogScrollBarArrowBorderColor.clear(); + ChatLogScrollBarArrowBgColor.clear(); + LogWinnerMainPotColor.clear(); + LogWinnerSidePotColor.clear(); + LogPlayerSitsOutColor.clear(); + LogNewGameAdminColor.clear(); + TabWidgetBorderColor.clear(); + TabWidgetBgColor.clear(); + TabWidgetTextColor.clear(); + MenuBgColor.clear(); + MenuTextColor.clear(); + BreakLobbyButtonBgColor.clear(); + BreakLobbyButtonTextColor.clear(); + BreakLobbyButtonBgDisabledColor.clear(); + BreakLobbyButtonTextDisabledColor.clear(); + BreakLobbyButtonBgBlinkColor.clear(); + BreakLobbyButtonTextBlinkColor.clear(); + PlayerCashTextColor.clear(); + PlayerBetTextColor.clear(); + PlayerNickTextColor.clear(); + BoardBigTextColor.clear(); + BoardSmallTextColor.clear(); + SpeedTextColor.clear(); + VoteButtonBgColor.clear(); + VoteButtonTextColor.clear(); + BetInputTextColor.clear(); + BetInputBgColor.clear(); + BetInputDisabledTextColor.clear(); + BetInputDisabledBgColor.clear(); + FoldButtonTextColor.clear(); + FoldButtonCheckableTextColor.clear(); + CheckCallButtonTextColor.clear(); + CheckCallButtonCheckableTextColor.clear(); + BetRaiseButtonTextColor.clear(); + BetRaiseButtonCheckableTextColor.clear(); + AllInButtonTextColor.clear(); + AllInButtonCheckableTextColor.clear(); + BetSpeedSliderGrooveBgColor.clear(); + BetSpeedSliderGrooveBorderColor.clear(); + BetSpeedSliderHandleBgColor.clear(); + BetSpeedSliderHandleBorderColor.clear(); + ShowMyCardsButtonTextColor.clear(); + RatingStarsColor.clear(); + PlayerInfoHintTextColor.clear(); + ChatLogTextSize.clear(); - //now reading! - TiXmlElement* itemsList = docHandle.FirstChild( "PokerTH" ).FirstChild( "TableStyle" ).FirstChild().ToElement(); - for( ; itemsList; itemsList=itemsList->NextSiblingElement()) { - const char *tmpStr1 = itemsList->Attribute("value"); - if (tmpStr1) { - tempString1 = tmpStr1; + //now reading! + TiXmlElement* itemsList = docHandle.FirstChild( "PokerTH" ).FirstChild( "TableStyle" ).FirstChild().ToElement(); + for( ; itemsList; itemsList=itemsList->NextSiblingElement()) { + const char *tmpStr1 = itemsList->Attribute("value"); + if (tmpStr1) { + tempString1 = tmpStr1; - // INFOS - if(itemsList->ValueStr() == "StyleDescription") { - StyleDescription = QString::fromUtf8(tempString1.c_str()); - } else if(itemsList->ValueStr() == "StyleMaintainerName") { - StyleMaintainerName = QString::fromUtf8(tempString1.c_str()); - } else if(itemsList->ValueStr() == "StyleMaintainerEMail") { - StyleMaintainerEMail = QString::fromUtf8(tempString1.c_str()); - } else if(itemsList->ValueStr() == "StyleCreateDate") { - StyleCreateDate = QString::fromUtf8(tempString1.c_str()); - } else if(itemsList->ValueStr() == "PokerTHStyleFileVersion") { - PokerTHStyleFileVersion = QString::fromUtf8(tempString1.c_str()); - } - // WINDOWS SETTINGS - else if (itemsList->ValueStr() == "IfFixedWindowSize") { - IfFixedWindowSize = QString::fromUtf8(tempString1.c_str()); - } else if (itemsList->ValueStr() == "FixedWindowWidth") { - FixedWindowWidth = QString::fromUtf8(tempString1.c_str()); - } else if (itemsList->ValueStr() == "FixedWindowHeight") { - FixedWindowHeight = QString::fromUtf8(tempString1.c_str()); - } else if (itemsList->ValueStr() == "MinimumWindowWidth") { - MinimumWindowWidth = QString::fromUtf8(tempString1.c_str()); - } else if (itemsList->ValueStr() == "MinimumWindowHeight") { - MinimumWindowHeight = QString::fromUtf8(tempString1.c_str()); - } else if (itemsList->ValueStr() == "MaximumWindowWidth") { - MaximumWindowWidth = QString::fromUtf8(tempString1.c_str()); - } else if (itemsList->ValueStr() == "MaximumWindowHeight") { - MaximumWindowHeight = QString::fromUtf8(tempString1.c_str()); - } - // PICS - else if (itemsList->ValueStr() == "Preview") { - Preview = currentDir+QString::fromUtf8(tempString1.c_str()); - } else if (itemsList->ValueStr() == "ActionAllInI18NPic") { - ActionAllInI18NPic = currentDir+QString::fromUtf8(tempString1.c_str()); - } else if (itemsList->ValueStr() == "ActionRaiseI18NPic") { - ActionRaiseI18NPic = currentDir+QString::fromUtf8(tempString1.c_str()); - } else if (itemsList->ValueStr() == "ActionBetI18NPic") { - ActionBetI18NPic = currentDir+QString::fromUtf8(tempString1.c_str()); - } else if (itemsList->ValueStr() == "ActionCallI18NPic") { - ActionCallI18NPic = currentDir+QString::fromUtf8(tempString1.c_str()); - } else if (itemsList->ValueStr() == "ActionCheckI18NPic") { - ActionCheckI18NPic = currentDir+QString::fromUtf8(tempString1.c_str()); - } else if (itemsList->ValueStr() == "ActionFoldI18NPic") { - ActionFoldI18NPic = currentDir+QString::fromUtf8(tempString1.c_str()); - } else if (itemsList->ValueStr() == "ActionWinnerI18NPic") { - ActionWinnerI18NPic = currentDir+QString::fromUtf8(tempString1.c_str()); - } else if (itemsList->ValueStr() == "BigBlindPuck") { - BigBlindPuck = currentDir+QString::fromUtf8(tempString1.c_str()); - } else if (itemsList->ValueStr() == "SmallBlindPuck") { - SmallBlindPuck = currentDir+QString::fromUtf8(tempString1.c_str()); - } else if (itemsList->ValueStr() == "DealerPuck") { - DealerPuck = currentDir+QString::fromUtf8(tempString1.c_str()); - } else if (itemsList->ValueStr() == "DefaultAvatar") { - DefaultAvatar = currentDir+QString::fromUtf8(tempString1.c_str()); - } else if (itemsList->ValueStr() == "CardHolderFlop") { - CardHolderFlop = currentDir+QString::fromUtf8(tempString1.c_str()); - } else if (itemsList->ValueStr() == "CardHolderTurn") { - CardHolderTurn = currentDir+QString::fromUtf8(tempString1.c_str()); - } else if (itemsList->ValueStr() == "CardHolderRiver") { - CardHolderRiver = currentDir+QString::fromUtf8(tempString1.c_str()); - } else if (itemsList->ValueStr() == "FoldButtonDefault") { - FoldButtonDefault = currentDir+QString::fromUtf8(tempString1.c_str()); - } else if (itemsList->ValueStr() == "FoldButtonHover") { - FoldButtonHover = currentDir+QString::fromUtf8(tempString1.c_str()); - } else if (itemsList->ValueStr() == "FoldButtonChecked") { - FoldButtonChecked = currentDir+QString::fromUtf8(tempString1.c_str()); - } else if (itemsList->ValueStr() == "FoldButtonCheckedHover") { - FoldButtonCheckedHover = currentDir+QString::fromUtf8(tempString1.c_str()); - } else if (itemsList->ValueStr() == "CheckCallButtonDefault") { - CheckCallButtonDefault = currentDir+QString::fromUtf8(tempString1.c_str()); - } else if (itemsList->ValueStr() == "CheckCallButtonHover") { - CheckCallButtonHover = currentDir+QString::fromUtf8(tempString1.c_str()); - } else if (itemsList->ValueStr() == "CheckCallButtonChecked") { - CheckCallButtonChecked = currentDir+QString::fromUtf8(tempString1.c_str()); - } else if (itemsList->ValueStr() == "CheckCallButtonCheckedHover") { - CheckCallButtonCheckedHover = currentDir+QString::fromUtf8(tempString1.c_str()); - } else if (itemsList->ValueStr() == "BetRaiseButtonDefault") { - BetRaiseButtonDefault = currentDir+QString::fromUtf8(tempString1.c_str()); - } else if (itemsList->ValueStr() == "BetRaiseButtonHover") { - BetRaiseButtonHover = currentDir+QString::fromUtf8(tempString1.c_str()); - } else if (itemsList->ValueStr() == "BetRaiseButtonChecked") { - BetRaiseButtonChecked = currentDir+QString::fromUtf8(tempString1.c_str()); - } else if (itemsList->ValueStr() == "BetRaiseButtonCheckedHover") { - BetRaiseButtonCheckedHover = currentDir+QString::fromUtf8(tempString1.c_str()); - } else if (itemsList->ValueStr() == "AllInButtonDefault") { - AllInButtonDefault = currentDir+QString::fromUtf8(tempString1.c_str()); - } else if (itemsList->ValueStr() == "AllInButtonHover") { - AllInButtonHover = currentDir+QString::fromUtf8(tempString1.c_str()); - } else if (itemsList->ValueStr() == "AllInButtonChecked") { - AllInButtonChecked = currentDir+QString::fromUtf8(tempString1.c_str()); - } else if (itemsList->ValueStr() == "AllInButtonCheckedHover") { - AllInButtonCheckedHover = currentDir+QString::fromUtf8(tempString1.c_str()); - } else if (itemsList->ValueStr() == "RadioButtonPressed") { - RadioButtonPressed = currentDir+QString::fromUtf8(tempString1.c_str()); - } else if (itemsList->ValueStr() == "RadioButtonChecked") { - RadioButtonChecked = currentDir+QString::fromUtf8(tempString1.c_str()); - } else if (itemsList->ValueStr() == "RadioButtonCheckedHover") { - RadioButtonCheckedHover = currentDir+QString::fromUtf8(tempString1.c_str()); - } else if (itemsList->ValueStr() == "RadioButtonUnchecked") { - RadioButtonUnchecked = currentDir+QString::fromUtf8(tempString1.c_str()); - } else if (itemsList->ValueStr() == "RadioButtonUncheckedHover") { - RadioButtonUncheckedHover = currentDir+QString::fromUtf8(tempString1.c_str()); - } else if (itemsList->ValueStr() == "PlayerTopSeatInactive") { - PlayerTopSeatInactive = currentDir+QString::fromUtf8(tempString1.c_str()); - } else if (itemsList->ValueStr() == "PlayerTopSeatActive") { - PlayerTopSeatActive = currentDir+QString::fromUtf8(tempString1.c_str()); - } else if (itemsList->ValueStr() == "PlayerBottomSeatInactive") { - PlayerBottomSeatInactive = currentDir+QString::fromUtf8(tempString1.c_str()); - } else if (itemsList->ValueStr() == "PlayerBottomSeatActive") { - PlayerBottomSeatActive = currentDir+QString::fromUtf8(tempString1.c_str()); - } else if (itemsList->ValueStr() == "Table") { - Table = currentDir+QString::fromUtf8(tempString1.c_str()); - } else if (itemsList->ValueStr() == "HandRanking") { - HandRanking = currentDir+QString::fromUtf8(tempString1.c_str()); - } else if (itemsList->ValueStr() == "ToolBoxBackground") { - ToolBoxBackground = currentDir+QString::fromUtf8(tempString1.c_str()); - } else if (itemsList->ValueStr() == "ShowMyCardsButtonDefault") { - ShowMyCardsButtonDefault = currentDir+QString::fromUtf8(tempString1.c_str()); - } else if (itemsList->ValueStr() == "ShowMyCardsButtonHover") { - ShowMyCardsButtonHover = currentDir+QString::fromUtf8(tempString1.c_str()); - } + // INFOS + if(itemsList->ValueStr() == "StyleDescription") { + StyleDescription = QString::fromUtf8(tempString1.c_str()); + } else if(itemsList->ValueStr() == "StyleMaintainerName") { + StyleMaintainerName = QString::fromUtf8(tempString1.c_str()); + } else if(itemsList->ValueStr() == "StyleMaintainerEMail") { + StyleMaintainerEMail = QString::fromUtf8(tempString1.c_str()); + } else if(itemsList->ValueStr() == "StyleCreateDate") { + StyleCreateDate = QString::fromUtf8(tempString1.c_str()); + } else if(itemsList->ValueStr() == "PokerTHStyleFileVersion") { + PokerTHStyleFileVersion = QString::fromUtf8(tempString1.c_str()); + } + // WINDOWS SETTINGS + else if (itemsList->ValueStr() == "IfFixedWindowSize") { + IfFixedWindowSize = QString::fromUtf8(tempString1.c_str()); + } else if (itemsList->ValueStr() == "FixedWindowWidth") { + FixedWindowWidth = QString::fromUtf8(tempString1.c_str()); + } else if (itemsList->ValueStr() == "FixedWindowHeight") { + FixedWindowHeight = QString::fromUtf8(tempString1.c_str()); + } else if (itemsList->ValueStr() == "MinimumWindowWidth") { + MinimumWindowWidth = QString::fromUtf8(tempString1.c_str()); + } else if (itemsList->ValueStr() == "MinimumWindowHeight") { + MinimumWindowHeight = QString::fromUtf8(tempString1.c_str()); + } else if (itemsList->ValueStr() == "MaximumWindowWidth") { + MaximumWindowWidth = QString::fromUtf8(tempString1.c_str()); + } else if (itemsList->ValueStr() == "MaximumWindowHeight") { + MaximumWindowHeight = QString::fromUtf8(tempString1.c_str()); + } + // PICS + else if (itemsList->ValueStr() == "Preview") { + Preview = currentDir+QString::fromUtf8(tempString1.c_str()); + } else if (itemsList->ValueStr() == "ActionAllInI18NPic") { + ActionAllInI18NPic = currentDir+QString::fromUtf8(tempString1.c_str()); + } else if (itemsList->ValueStr() == "ActionRaiseI18NPic") { + ActionRaiseI18NPic = currentDir+QString::fromUtf8(tempString1.c_str()); + } else if (itemsList->ValueStr() == "ActionBetI18NPic") { + ActionBetI18NPic = currentDir+QString::fromUtf8(tempString1.c_str()); + } else if (itemsList->ValueStr() == "ActionCallI18NPic") { + ActionCallI18NPic = currentDir+QString::fromUtf8(tempString1.c_str()); + } else if (itemsList->ValueStr() == "ActionCheckI18NPic") { + ActionCheckI18NPic = currentDir+QString::fromUtf8(tempString1.c_str()); + } else if (itemsList->ValueStr() == "ActionFoldI18NPic") { + ActionFoldI18NPic = currentDir+QString::fromUtf8(tempString1.c_str()); + } else if (itemsList->ValueStr() == "ActionWinnerI18NPic") { + ActionWinnerI18NPic = currentDir+QString::fromUtf8(tempString1.c_str()); + } else if (itemsList->ValueStr() == "BigBlindPuck") { + BigBlindPuck = currentDir+QString::fromUtf8(tempString1.c_str()); + } else if (itemsList->ValueStr() == "SmallBlindPuck") { + SmallBlindPuck = currentDir+QString::fromUtf8(tempString1.c_str()); + } else if (itemsList->ValueStr() == "DealerPuck") { + DealerPuck = currentDir+QString::fromUtf8(tempString1.c_str()); + } else if (itemsList->ValueStr() == "DefaultAvatar") { + DefaultAvatar = currentDir+QString::fromUtf8(tempString1.c_str()); + } else if (itemsList->ValueStr() == "CardHolderFlop") { + CardHolderFlop = currentDir+QString::fromUtf8(tempString1.c_str()); + } else if (itemsList->ValueStr() == "CardHolderTurn") { + CardHolderTurn = currentDir+QString::fromUtf8(tempString1.c_str()); + } else if (itemsList->ValueStr() == "CardHolderRiver") { + CardHolderRiver = currentDir+QString::fromUtf8(tempString1.c_str()); + } else if (itemsList->ValueStr() == "FoldButtonDefault") { + FoldButtonDefault = currentDir+QString::fromUtf8(tempString1.c_str()); + } else if (itemsList->ValueStr() == "FoldButtonHover") { + FoldButtonHover = currentDir+QString::fromUtf8(tempString1.c_str()); + } else if (itemsList->ValueStr() == "FoldButtonChecked") { + FoldButtonChecked = currentDir+QString::fromUtf8(tempString1.c_str()); + } else if (itemsList->ValueStr() == "FoldButtonCheckedHover") { + FoldButtonCheckedHover = currentDir+QString::fromUtf8(tempString1.c_str()); + } else if (itemsList->ValueStr() == "CheckCallButtonDefault") { + CheckCallButtonDefault = currentDir+QString::fromUtf8(tempString1.c_str()); + } else if (itemsList->ValueStr() == "CheckCallButtonHover") { + CheckCallButtonHover = currentDir+QString::fromUtf8(tempString1.c_str()); + } else if (itemsList->ValueStr() == "CheckCallButtonChecked") { + CheckCallButtonChecked = currentDir+QString::fromUtf8(tempString1.c_str()); + } else if (itemsList->ValueStr() == "CheckCallButtonCheckedHover") { + CheckCallButtonCheckedHover = currentDir+QString::fromUtf8(tempString1.c_str()); + } else if (itemsList->ValueStr() == "BetRaiseButtonDefault") { + BetRaiseButtonDefault = currentDir+QString::fromUtf8(tempString1.c_str()); + } else if (itemsList->ValueStr() == "BetRaiseButtonHover") { + BetRaiseButtonHover = currentDir+QString::fromUtf8(tempString1.c_str()); + } else if (itemsList->ValueStr() == "BetRaiseButtonChecked") { + BetRaiseButtonChecked = currentDir+QString::fromUtf8(tempString1.c_str()); + } else if (itemsList->ValueStr() == "BetRaiseButtonCheckedHover") { + BetRaiseButtonCheckedHover = currentDir+QString::fromUtf8(tempString1.c_str()); + } else if (itemsList->ValueStr() == "AllInButtonDefault") { + AllInButtonDefault = currentDir+QString::fromUtf8(tempString1.c_str()); + } else if (itemsList->ValueStr() == "AllInButtonHover") { + AllInButtonHover = currentDir+QString::fromUtf8(tempString1.c_str()); + } else if (itemsList->ValueStr() == "AllInButtonChecked") { + AllInButtonChecked = currentDir+QString::fromUtf8(tempString1.c_str()); + } else if (itemsList->ValueStr() == "AllInButtonCheckedHover") { + AllInButtonCheckedHover = currentDir+QString::fromUtf8(tempString1.c_str()); + } else if (itemsList->ValueStr() == "RadioButtonPressed") { + RadioButtonPressed = currentDir+QString::fromUtf8(tempString1.c_str()); + } else if (itemsList->ValueStr() == "RadioButtonChecked") { + RadioButtonChecked = currentDir+QString::fromUtf8(tempString1.c_str()); + } else if (itemsList->ValueStr() == "RadioButtonCheckedHover") { + RadioButtonCheckedHover = currentDir+QString::fromUtf8(tempString1.c_str()); + } else if (itemsList->ValueStr() == "RadioButtonUnchecked") { + RadioButtonUnchecked = currentDir+QString::fromUtf8(tempString1.c_str()); + } else if (itemsList->ValueStr() == "RadioButtonUncheckedHover") { + RadioButtonUncheckedHover = currentDir+QString::fromUtf8(tempString1.c_str()); + } else if (itemsList->ValueStr() == "PlayerTopSeatInactive") { + PlayerTopSeatInactive = currentDir+QString::fromUtf8(tempString1.c_str()); + } else if (itemsList->ValueStr() == "PlayerTopSeatActive") { + PlayerTopSeatActive = currentDir+QString::fromUtf8(tempString1.c_str()); + } else if (itemsList->ValueStr() == "PlayerBottomSeatInactive") { + PlayerBottomSeatInactive = currentDir+QString::fromUtf8(tempString1.c_str()); + } else if (itemsList->ValueStr() == "PlayerBottomSeatActive") { + PlayerBottomSeatActive = currentDir+QString::fromUtf8(tempString1.c_str()); + } else if (itemsList->ValueStr() == "Table") { + Table = currentDir+QString::fromUtf8(tempString1.c_str()); + } else if (itemsList->ValueStr() == "HandRanking") { + HandRanking = currentDir+QString::fromUtf8(tempString1.c_str()); + } else if (itemsList->ValueStr() == "ToolBoxBackground") { + ToolBoxBackground = currentDir+QString::fromUtf8(tempString1.c_str()); + } else if (itemsList->ValueStr() == "ShowMyCardsButtonDefault") { + ShowMyCardsButtonDefault = currentDir+QString::fromUtf8(tempString1.c_str()); + } else if (itemsList->ValueStr() == "ShowMyCardsButtonHover") { + ShowMyCardsButtonHover = currentDir+QString::fromUtf8(tempString1.c_str()); + } - //I18N ACTION STRINGS - else if (itemsList->ValueStr() == "ActionAllInI18NString") { - ActionAllInI18NString = QString::fromUtf8(tempString1.c_str()); - } else if (itemsList->ValueStr() == "ActionRaiseI18NString") { - ActionRaiseI18NString = QString::fromUtf8(tempString1.c_str()); - } else if (itemsList->ValueStr() == "ActionBetI18NString") { - ActionBetI18NString = QString::fromUtf8(tempString1.c_str()); - } else if (itemsList->ValueStr() == "ActionCallI18NString") { - ActionCallI18NString = QString::fromUtf8(tempString1.c_str()); - } else if (itemsList->ValueStr() == "ActionCheckI18NString") { - ActionCheckI18NString = QString::fromUtf8(tempString1.c_str()); - } else if (itemsList->ValueStr() == "ActionFoldI18NString") { - ActionFoldI18NString = QString::fromUtf8(tempString1.c_str()); - } else if (itemsList->ValueStr() == "PotI18NString") { - PotI18NString = QString::fromUtf8(tempString1.c_str()); - } else if (itemsList->ValueStr() == "TotalI18NString") { - TotalI18NString = QString::fromUtf8(tempString1.c_str()); - } else if (itemsList->ValueStr() == "BetsI18NString") { - BetsI18NString = QString::fromUtf8(tempString1.c_str()); - } else if (itemsList->ValueStr() == "GameI18NString") { - GameI18NString = QString::fromUtf8(tempString1.c_str()); - } else if (itemsList->ValueStr() == "HandI18NString") { - HandI18NString = QString::fromUtf8(tempString1.c_str()); - } else if (itemsList->ValueStr() == "PreflopI18NString") { - PreflopI18NString = QString::fromUtf8(tempString1.c_str()); - } else if (itemsList->ValueStr() == "FlopI18NString") { - FlopI18NString = QString::fromUtf8(tempString1.c_str()); - } else if (itemsList->ValueStr() == "TurnI18NString") { - TurnI18NString = QString::fromUtf8(tempString1.c_str()); - } else if (itemsList->ValueStr() == "RiverI18NString") { - RiverI18NString = QString::fromUtf8(tempString1.c_str()); - } + //I18N ACTION STRINGS + else if (itemsList->ValueStr() == "ActionAllInI18NString") { + ActionAllInI18NString = QString::fromUtf8(tempString1.c_str()); + } else if (itemsList->ValueStr() == "ActionRaiseI18NString") { + ActionRaiseI18NString = QString::fromUtf8(tempString1.c_str()); + } else if (itemsList->ValueStr() == "ActionBetI18NString") { + ActionBetI18NString = QString::fromUtf8(tempString1.c_str()); + } else if (itemsList->ValueStr() == "ActionCallI18NString") { + ActionCallI18NString = QString::fromUtf8(tempString1.c_str()); + } else if (itemsList->ValueStr() == "ActionCheckI18NString") { + ActionCheckI18NString = QString::fromUtf8(tempString1.c_str()); + } else if (itemsList->ValueStr() == "ActionFoldI18NString") { + ActionFoldI18NString = QString::fromUtf8(tempString1.c_str()); + } else if (itemsList->ValueStr() == "PotI18NString") { + PotI18NString = QString::fromUtf8(tempString1.c_str()); + } else if (itemsList->ValueStr() == "TotalI18NString") { + TotalI18NString = QString::fromUtf8(tempString1.c_str()); + } else if (itemsList->ValueStr() == "BetsI18NString") { + BetsI18NString = QString::fromUtf8(tempString1.c_str()); + } else if (itemsList->ValueStr() == "GameI18NString") { + GameI18NString = QString::fromUtf8(tempString1.c_str()); + } else if (itemsList->ValueStr() == "HandI18NString") { + HandI18NString = QString::fromUtf8(tempString1.c_str()); + } else if (itemsList->ValueStr() == "PreflopI18NString") { + PreflopI18NString = QString::fromUtf8(tempString1.c_str()); + } else if (itemsList->ValueStr() == "FlopI18NString") { + FlopI18NString = QString::fromUtf8(tempString1.c_str()); + } else if (itemsList->ValueStr() == "TurnI18NString") { + TurnI18NString = QString::fromUtf8(tempString1.c_str()); + } else if (itemsList->ValueStr() == "RiverI18NString") { + RiverI18NString = QString::fromUtf8(tempString1.c_str()); + } - // COLORS - if (itemsList->ValueStr() == "FKeyIndicatorColor") { - FKeyIndicatorColor = QString::fromUtf8(tempString1.c_str()); - } else if (itemsList->ValueStr() == "ChanceLabelPossibleColor") { - ChanceLabelPossibleColor = QString::fromUtf8(tempString1.c_str()); - } else if (itemsList->ValueStr() == "ChanceLabelImpossibleColor") { - ChanceLabelImpossibleColor = QString::fromUtf8(tempString1.c_str()); - } else if (itemsList->ValueStr() == "ChatTextNickNotifyColor") { - ChatTextNickNotifyColor = QString::fromUtf8(tempString1.c_str()); - } else if (itemsList->ValueStr() == "ChatLogTextColor") { - ChatLogTextColor = QString::fromUtf8(tempString1.c_str()); - } else if (itemsList->ValueStr() == "ChatLogBgColor") { - ChatLogBgColor = QString::fromUtf8(tempString1.c_str()); - } else if (itemsList->ValueStr() == "ChatLogScrollBarBorderColor") { - ChatLogScrollBarBorderColor = QString::fromUtf8(tempString1.c_str()); - } else if (itemsList->ValueStr() == "ChatLogScrollBarBgColor") { - ChatLogScrollBarBgColor = QString::fromUtf8(tempString1.c_str()); - } else if (itemsList->ValueStr() == "ChatLogScrollBarHandleBorderColor") { - ChatLogScrollBarHandleBorderColor = QString::fromUtf8(tempString1.c_str()); - } else if (itemsList->ValueStr() == "ChatLogScrollBarHandleBgColor") { - ChatLogScrollBarHandleBgColor = QString::fromUtf8(tempString1.c_str()); - } else if (itemsList->ValueStr() == "ChatLogScrollBarArrowBorderColor") { - ChatLogScrollBarArrowBorderColor = QString::fromUtf8(tempString1.c_str()); - } else if (itemsList->ValueStr() == "ChatLogScrollBarArrowBgColor") { - ChatLogScrollBarArrowBgColor = QString::fromUtf8(tempString1.c_str()); - } else if (itemsList->ValueStr() == "LogWinnerMainPotColor") { - LogWinnerMainPotColor = QString::fromUtf8(tempString1.c_str()); - } else if (itemsList->ValueStr() == "LogWinnerSidePotColor") { - LogWinnerSidePotColor = QString::fromUtf8(tempString1.c_str()); - } else if (itemsList->ValueStr() == "LogPlayerSitsOutColor") { - LogPlayerSitsOutColor = QString::fromUtf8(tempString1.c_str()); - } else if (itemsList->ValueStr() == "LogNewGameAdminColor") { - LogNewGameAdminColor = QString::fromUtf8(tempString1.c_str()); - } else if (itemsList->ValueStr() == "TabWidgetBorderColor") { - TabWidgetBorderColor = QString::fromUtf8(tempString1.c_str()); - } else if (itemsList->ValueStr() == "TabWidgetBgColor") { - TabWidgetBgColor = QString::fromUtf8(tempString1.c_str()); - } else if (itemsList->ValueStr() == "TabWidgetTextColor") { - TabWidgetTextColor = QString::fromUtf8(tempString1.c_str()); - } else if (itemsList->ValueStr() == "MenuBgColor") { - MenuBgColor = QString::fromUtf8(tempString1.c_str()); - } else if (itemsList->ValueStr() == "MenuTextColor") { - MenuTextColor = QString::fromUtf8(tempString1.c_str()); - } else if (itemsList->ValueStr() == "BreakLobbyButtonBgColor") { - BreakLobbyButtonBgColor = QString::fromUtf8(tempString1.c_str()); - } else if (itemsList->ValueStr() == "BreakLobbyButtonTextColor") { - BreakLobbyButtonTextColor = QString::fromUtf8(tempString1.c_str()); - } else if (itemsList->ValueStr() == "BreakLobbyButtonBgDisabledColor") { - BreakLobbyButtonBgDisabledColor = QString::fromUtf8(tempString1.c_str()); - } else if (itemsList->ValueStr() == "BreakLobbyButtonTextDisabledColor") { - BreakLobbyButtonTextDisabledColor = QString::fromUtf8(tempString1.c_str()); - } else if (itemsList->ValueStr() == "BreakLobbyButtonBgBlinkColor") { - BreakLobbyButtonBgBlinkColor = QString::fromUtf8(tempString1.c_str()); - } else if (itemsList->ValueStr() == "BreakLobbyButtonTextBlinkColor") { - BreakLobbyButtonTextBlinkColor = QString::fromUtf8(tempString1.c_str()); - } else if (itemsList->ValueStr() == "PlayerCashTextColor") { - PlayerCashTextColor = QString::fromUtf8(tempString1.c_str()); - } else if (itemsList->ValueStr() == "PlayerBetTextColor") { - PlayerBetTextColor = QString::fromUtf8(tempString1.c_str()); - } else if (itemsList->ValueStr() == "PlayerNickTextColor") { - PlayerNickTextColor = QString::fromUtf8(tempString1.c_str()); - } else if (itemsList->ValueStr() == "BoardBigTextColor") { - BoardBigTextColor = QString::fromUtf8(tempString1.c_str()); - } else if (itemsList->ValueStr() == "BoardSmallTextColor") { - BoardSmallTextColor = QString::fromUtf8(tempString1.c_str()); - } else if (itemsList->ValueStr() == "SpeedTextColor") { - SpeedTextColor = QString::fromUtf8(tempString1.c_str()); - } else if (itemsList->ValueStr() == "VoteButtonBgColor") { - VoteButtonBgColor = QString::fromUtf8(tempString1.c_str()); - } else if (itemsList->ValueStr() == "VoteButtonTextColor") { - VoteButtonTextColor = QString::fromUtf8(tempString1.c_str()); - } else if (itemsList->ValueStr() == "BetInputTextColor") { - BetInputTextColor = QString::fromUtf8(tempString1.c_str()); - } else if (itemsList->ValueStr() == "BetInputBgColor") { - BetInputBgColor = QString::fromUtf8(tempString1.c_str()); - } else if (itemsList->ValueStr() == "BetInputDisabledTextColor") { - BetInputDisabledTextColor = QString::fromUtf8(tempString1.c_str()); - } else if (itemsList->ValueStr() == "BetInputDisabledBgColor") { - BetInputDisabledBgColor = QString::fromUtf8(tempString1.c_str()); - } else if (itemsList->ValueStr() == "FoldButtonTextColor") { - FoldButtonTextColor = QString::fromUtf8(tempString1.c_str()); - } else if (itemsList->ValueStr() == "FoldButtonCheckableTextColor") { - FoldButtonCheckableTextColor = QString::fromUtf8(tempString1.c_str()); - } else if (itemsList->ValueStr() == "CheckCallButtonTextColor") { - CheckCallButtonTextColor = QString::fromUtf8(tempString1.c_str()); - } else if (itemsList->ValueStr() == "CheckCallButtonCheckableTextColor") { - CheckCallButtonCheckableTextColor = QString::fromUtf8(tempString1.c_str()); - } else if (itemsList->ValueStr() == "BetRaiseButtonTextColor") { - BetRaiseButtonTextColor = QString::fromUtf8(tempString1.c_str()); - } else if (itemsList->ValueStr() == "BetRaiseButtonCheckableTextColor") { - BetRaiseButtonCheckableTextColor = QString::fromUtf8(tempString1.c_str()); - } else if (itemsList->ValueStr() == "AllInButtonTextColor") { - AllInButtonTextColor = QString::fromUtf8(tempString1.c_str()); - } else if (itemsList->ValueStr() == "AllInButtonCheckableTextColor") { - AllInButtonCheckableTextColor = QString::fromUtf8(tempString1.c_str()); - } else if (itemsList->ValueStr() == "BetSpeedSliderGrooveBgColor") { - BetSpeedSliderGrooveBgColor = QString::fromUtf8(tempString1.c_str()); - } else if (itemsList->ValueStr() == "BetSpeedSliderGrooveBorderColor") { - BetSpeedSliderGrooveBorderColor = QString::fromUtf8(tempString1.c_str()); - } else if (itemsList->ValueStr() == "BetSpeedSliderHandleBgColor") { - BetSpeedSliderHandleBgColor = QString::fromUtf8(tempString1.c_str()); - } else if (itemsList->ValueStr() == "BetSpeedSliderHandleBorderColor") { - BetSpeedSliderHandleBorderColor = QString::fromUtf8(tempString1.c_str()); - } else if (itemsList->ValueStr() == "ShowMyCardsButtonTextColor") { - ShowMyCardsButtonTextColor = QString::fromUtf8(tempString1.c_str()); - } else if (itemsList->ValueStr() == "RatingStarsColor") { - RatingStarsColor = QString::fromUtf8(tempString1.c_str()); - } else if (itemsList->ValueStr() == "PlayerInfoHintTextColor") { - PlayerInfoHintTextColor = QString::fromUtf8(tempString1.c_str()); - } - // SIZES - else if (itemsList->ValueStr() == "ChatLogTextSize") { - ChatLogTextSize = QString::fromUtf8(tempString1.c_str()); - } - } - } + // COLORS + if (itemsList->ValueStr() == "FKeyIndicatorColor") { + FKeyIndicatorColor = QString::fromUtf8(tempString1.c_str()); + } else if (itemsList->ValueStr() == "ChanceLabelPossibleColor") { + ChanceLabelPossibleColor = QString::fromUtf8(tempString1.c_str()); + } else if (itemsList->ValueStr() == "ChanceLabelImpossibleColor") { + ChanceLabelImpossibleColor = QString::fromUtf8(tempString1.c_str()); + } else if (itemsList->ValueStr() == "ChatTextNickNotifyColor") { + ChatTextNickNotifyColor = QString::fromUtf8(tempString1.c_str()); + } else if (itemsList->ValueStr() == "ChatLogTextColor") { + ChatLogTextColor = QString::fromUtf8(tempString1.c_str()); + } else if (itemsList->ValueStr() == "ChatLogBgColor") { + ChatLogBgColor = QString::fromUtf8(tempString1.c_str()); + } else if (itemsList->ValueStr() == "ChatLogScrollBarBorderColor") { + ChatLogScrollBarBorderColor = QString::fromUtf8(tempString1.c_str()); + } else if (itemsList->ValueStr() == "ChatLogScrollBarBgColor") { + ChatLogScrollBarBgColor = QString::fromUtf8(tempString1.c_str()); + } else if (itemsList->ValueStr() == "ChatLogScrollBarHandleBorderColor") { + ChatLogScrollBarHandleBorderColor = QString::fromUtf8(tempString1.c_str()); + } else if (itemsList->ValueStr() == "ChatLogScrollBarHandleBgColor") { + ChatLogScrollBarHandleBgColor = QString::fromUtf8(tempString1.c_str()); + } else if (itemsList->ValueStr() == "ChatLogScrollBarArrowBorderColor") { + ChatLogScrollBarArrowBorderColor = QString::fromUtf8(tempString1.c_str()); + } else if (itemsList->ValueStr() == "ChatLogScrollBarArrowBgColor") { + ChatLogScrollBarArrowBgColor = QString::fromUtf8(tempString1.c_str()); + } else if (itemsList->ValueStr() == "LogWinnerMainPotColor") { + LogWinnerMainPotColor = QString::fromUtf8(tempString1.c_str()); + } else if (itemsList->ValueStr() == "LogWinnerSidePotColor") { + LogWinnerSidePotColor = QString::fromUtf8(tempString1.c_str()); + } else if (itemsList->ValueStr() == "LogPlayerSitsOutColor") { + LogPlayerSitsOutColor = QString::fromUtf8(tempString1.c_str()); + } else if (itemsList->ValueStr() == "LogNewGameAdminColor") { + LogNewGameAdminColor = QString::fromUtf8(tempString1.c_str()); + } else if (itemsList->ValueStr() == "TabWidgetBorderColor") { + TabWidgetBorderColor = QString::fromUtf8(tempString1.c_str()); + } else if (itemsList->ValueStr() == "TabWidgetBgColor") { + TabWidgetBgColor = QString::fromUtf8(tempString1.c_str()); + } else if (itemsList->ValueStr() == "TabWidgetTextColor") { + TabWidgetTextColor = QString::fromUtf8(tempString1.c_str()); + } else if (itemsList->ValueStr() == "MenuBgColor") { + MenuBgColor = QString::fromUtf8(tempString1.c_str()); + } else if (itemsList->ValueStr() == "MenuTextColor") { + MenuTextColor = QString::fromUtf8(tempString1.c_str()); + } else if (itemsList->ValueStr() == "BreakLobbyButtonBgColor") { + BreakLobbyButtonBgColor = QString::fromUtf8(tempString1.c_str()); + } else if (itemsList->ValueStr() == "BreakLobbyButtonTextColor") { + BreakLobbyButtonTextColor = QString::fromUtf8(tempString1.c_str()); + } else if (itemsList->ValueStr() == "BreakLobbyButtonBgDisabledColor") { + BreakLobbyButtonBgDisabledColor = QString::fromUtf8(tempString1.c_str()); + } else if (itemsList->ValueStr() == "BreakLobbyButtonTextDisabledColor") { + BreakLobbyButtonTextDisabledColor = QString::fromUtf8(tempString1.c_str()); + } else if (itemsList->ValueStr() == "BreakLobbyButtonBgBlinkColor") { + BreakLobbyButtonBgBlinkColor = QString::fromUtf8(tempString1.c_str()); + } else if (itemsList->ValueStr() == "BreakLobbyButtonTextBlinkColor") { + BreakLobbyButtonTextBlinkColor = QString::fromUtf8(tempString1.c_str()); + } else if (itemsList->ValueStr() == "PlayerCashTextColor") { + PlayerCashTextColor = QString::fromUtf8(tempString1.c_str()); + } else if (itemsList->ValueStr() == "PlayerBetTextColor") { + PlayerBetTextColor = QString::fromUtf8(tempString1.c_str()); + } else if (itemsList->ValueStr() == "PlayerNickTextColor") { + PlayerNickTextColor = QString::fromUtf8(tempString1.c_str()); + } else if (itemsList->ValueStr() == "BoardBigTextColor") { + BoardBigTextColor = QString::fromUtf8(tempString1.c_str()); + } else if (itemsList->ValueStr() == "BoardSmallTextColor") { + BoardSmallTextColor = QString::fromUtf8(tempString1.c_str()); + } else if (itemsList->ValueStr() == "SpeedTextColor") { + SpeedTextColor = QString::fromUtf8(tempString1.c_str()); + } else if (itemsList->ValueStr() == "VoteButtonBgColor") { + VoteButtonBgColor = QString::fromUtf8(tempString1.c_str()); + } else if (itemsList->ValueStr() == "VoteButtonTextColor") { + VoteButtonTextColor = QString::fromUtf8(tempString1.c_str()); + } else if (itemsList->ValueStr() == "BetInputTextColor") { + BetInputTextColor = QString::fromUtf8(tempString1.c_str()); + } else if (itemsList->ValueStr() == "BetInputBgColor") { + BetInputBgColor = QString::fromUtf8(tempString1.c_str()); + } else if (itemsList->ValueStr() == "BetInputDisabledTextColor") { + BetInputDisabledTextColor = QString::fromUtf8(tempString1.c_str()); + } else if (itemsList->ValueStr() == "BetInputDisabledBgColor") { + BetInputDisabledBgColor = QString::fromUtf8(tempString1.c_str()); + } else if (itemsList->ValueStr() == "FoldButtonTextColor") { + FoldButtonTextColor = QString::fromUtf8(tempString1.c_str()); + } else if (itemsList->ValueStr() == "FoldButtonCheckableTextColor") { + FoldButtonCheckableTextColor = QString::fromUtf8(tempString1.c_str()); + } else if (itemsList->ValueStr() == "CheckCallButtonTextColor") { + CheckCallButtonTextColor = QString::fromUtf8(tempString1.c_str()); + } else if (itemsList->ValueStr() == "CheckCallButtonCheckableTextColor") { + CheckCallButtonCheckableTextColor = QString::fromUtf8(tempString1.c_str()); + } else if (itemsList->ValueStr() == "BetRaiseButtonTextColor") { + BetRaiseButtonTextColor = QString::fromUtf8(tempString1.c_str()); + } else if (itemsList->ValueStr() == "BetRaiseButtonCheckableTextColor") { + BetRaiseButtonCheckableTextColor = QString::fromUtf8(tempString1.c_str()); + } else if (itemsList->ValueStr() == "AllInButtonTextColor") { + AllInButtonTextColor = QString::fromUtf8(tempString1.c_str()); + } else if (itemsList->ValueStr() == "AllInButtonCheckableTextColor") { + AllInButtonCheckableTextColor = QString::fromUtf8(tempString1.c_str()); + } else if (itemsList->ValueStr() == "BetSpeedSliderGrooveBgColor") { + BetSpeedSliderGrooveBgColor = QString::fromUtf8(tempString1.c_str()); + } else if (itemsList->ValueStr() == "BetSpeedSliderGrooveBorderColor") { + BetSpeedSliderGrooveBorderColor = QString::fromUtf8(tempString1.c_str()); + } else if (itemsList->ValueStr() == "BetSpeedSliderHandleBgColor") { + BetSpeedSliderHandleBgColor = QString::fromUtf8(tempString1.c_str()); + } else if (itemsList->ValueStr() == "BetSpeedSliderHandleBorderColor") { + BetSpeedSliderHandleBorderColor = QString::fromUtf8(tempString1.c_str()); + } else if (itemsList->ValueStr() == "ShowMyCardsButtonTextColor") { + ShowMyCardsButtonTextColor = QString::fromUtf8(tempString1.c_str()); + } else if (itemsList->ValueStr() == "RatingStarsColor") { + RatingStarsColor = QString::fromUtf8(tempString1.c_str()); + } else if (itemsList->ValueStr() == "PlayerInfoHintTextColor") { + PlayerInfoHintTextColor = QString::fromUtf8(tempString1.c_str()); + } + // SIZES + else if (itemsList->ValueStr() == "ChatLogTextSize") { + ChatLogTextSize = QString::fromUtf8(tempString1.c_str()); + } + } + } - //check if style items are left and if pictures where not found - leftItems.clear(); - itemPicsLeft.clear(); + //check if style items are left and if pictures where not found + leftItems.clear(); + itemPicsLeft.clear(); - // INFOS - if(StyleDescription == "") { - leftItems << "StyleDescription"; - } - if(StyleMaintainerName == "") { - leftItems << "StyleMaintainerName"; - } - if(StyleMaintainerEMail == "") { - leftItems << "StyleMaintainerEMail"; - } - if(StyleCreateDate == "") { - leftItems << "StyleCreateDate"; - } - if(PokerTHStyleFileVersion == "") { - leftItems << "PokerTHStyleFileVersion"; - } - // WINDOWS SETTINGS - if(IfFixedWindowSize == "") { - IfFixedWindowSize = getFallBackFieldContent("IfFixedWindowSize", 0); - leftItems << "IfFixedWindowSize"; - } - if(FixedWindowWidth == "") { - FixedWindowWidth = getFallBackFieldContent("FixedWindowWidth", 0); - leftItems << "FixedWindowWidth"; - } - if(FixedWindowHeight == "") { - FixedWindowHeight = getFallBackFieldContent("FixedWindowHeight", 0); - leftItems << "FixedWindowHeight"; - } - if(MinimumWindowWidth == "") { - MinimumWindowWidth = getFallBackFieldContent("MinimumWindowWidth", 0); - leftItems << "MinimumWindowWidth"; - } - if(MinimumWindowHeight == "") { - MinimumWindowHeight = getFallBackFieldContent("MinimumWindowHeight", 0); - leftItems << "MinimumWindowHeight"; - } - if(MaximumWindowWidth == "") { - MaximumWindowWidth = getFallBackFieldContent("MaximumWindowWidth", 0); - leftItems << "MaximumWindowWidth"; - } - if(MaximumWindowHeight == "") { - MaximumWindowHeight = getFallBackFieldContent("MaximumWindowHeight", 0); - leftItems << "MaximumWindowHeight"; - } - // P I C S + // INFOS + if(StyleDescription == "") { + leftItems << "StyleDescription"; + } + if(StyleMaintainerName == "") { + leftItems << "StyleMaintainerName"; + } + if(StyleMaintainerEMail == "") { + leftItems << "StyleMaintainerEMail"; + } + if(StyleCreateDate == "") { + leftItems << "StyleCreateDate"; + } + if(PokerTHStyleFileVersion == "") { + leftItems << "PokerTHStyleFileVersion"; + } + // WINDOWS SETTINGS + if(IfFixedWindowSize == "") { + IfFixedWindowSize = getFallBackFieldContent("IfFixedWindowSize", 0); + leftItems << "IfFixedWindowSize"; + } + if(FixedWindowWidth == "") { + FixedWindowWidth = getFallBackFieldContent("FixedWindowWidth", 0); + leftItems << "FixedWindowWidth"; + } + if(FixedWindowHeight == "") { + FixedWindowHeight = getFallBackFieldContent("FixedWindowHeight", 0); + leftItems << "FixedWindowHeight"; + } + if(MinimumWindowWidth == "") { + MinimumWindowWidth = getFallBackFieldContent("MinimumWindowWidth", 0); + leftItems << "MinimumWindowWidth"; + } + if(MinimumWindowHeight == "") { + MinimumWindowHeight = getFallBackFieldContent("MinimumWindowHeight", 0); + leftItems << "MinimumWindowHeight"; + } + if(MaximumWindowWidth == "") { + MaximumWindowWidth = getFallBackFieldContent("MaximumWindowWidth", 0); + leftItems << "MaximumWindowWidth"; + } + if(MaximumWindowHeight == "") { + MaximumWindowHeight = getFallBackFieldContent("MaximumWindowHeight", 0); + leftItems << "MaximumWindowHeight"; + } + // P I C S - // I18N Pics - if(ActionAllInI18NPic == "") { - ActionAllInI18NPic = getFallBackFieldContent("ActionAllInI18NPic", 1); - leftItems << "ActionAllInI18NPic"; - } else if(ActionAllInI18NPic != QString(currentDir+"NULL") && !QFile(ActionAllInI18NPic).exists()) { - itemPicsLeft << "ActionAllInI18NPic = "+ActionAllInI18NPic; - ActionAllInI18NPic = getFallBackFieldContent("ActionAllInI18NPic", 1); - } + // I18N Pics + if(ActionAllInI18NPic == "") { + ActionAllInI18NPic = getFallBackFieldContent("ActionAllInI18NPic", 1); + leftItems << "ActionAllInI18NPic"; + } else if(ActionAllInI18NPic != QString(currentDir+"NULL") && !QFile(ActionAllInI18NPic).exists()) { + itemPicsLeft << "ActionAllInI18NPic = "+ActionAllInI18NPic; + ActionAllInI18NPic = getFallBackFieldContent("ActionAllInI18NPic", 1); + } - if(ActionRaiseI18NPic == "") { - ActionRaiseI18NPic = getFallBackFieldContent("ActionRaiseI18NPic", 1); - leftItems << "ActionRaiseI18NPic"; - } else if(ActionRaiseI18NPic != QString(currentDir+"NULL") && !QFile(ActionRaiseI18NPic).exists()) { - itemPicsLeft << "ActionRaiseI18NPic = "+ActionRaiseI18NPic; - ActionRaiseI18NPic = getFallBackFieldContent("ActionRaiseI18NPic", 1); - } + if(ActionRaiseI18NPic == "") { + ActionRaiseI18NPic = getFallBackFieldContent("ActionRaiseI18NPic", 1); + leftItems << "ActionRaiseI18NPic"; + } else if(ActionRaiseI18NPic != QString(currentDir+"NULL") && !QFile(ActionRaiseI18NPic).exists()) { + itemPicsLeft << "ActionRaiseI18NPic = "+ActionRaiseI18NPic; + ActionRaiseI18NPic = getFallBackFieldContent("ActionRaiseI18NPic", 1); + } - if(ActionBetI18NPic == "") { - ActionBetI18NPic = getFallBackFieldContent("ActionBetI18NPic", 1); - leftItems << "ActionBetI18NPic"; - } else if(ActionBetI18NPic != QString(currentDir+"NULL") && !QFile(ActionBetI18NPic).exists()) { - itemPicsLeft << "ActionBetI18NPic = "+ActionBetI18NPic; - ActionBetI18NPic = getFallBackFieldContent("ActionBetI18NPic", 1); - } + if(ActionBetI18NPic == "") { + ActionBetI18NPic = getFallBackFieldContent("ActionBetI18NPic", 1); + leftItems << "ActionBetI18NPic"; + } else if(ActionBetI18NPic != QString(currentDir+"NULL") && !QFile(ActionBetI18NPic).exists()) { + itemPicsLeft << "ActionBetI18NPic = "+ActionBetI18NPic; + ActionBetI18NPic = getFallBackFieldContent("ActionBetI18NPic", 1); + } - if(ActionCallI18NPic == "") { - ActionCallI18NPic = getFallBackFieldContent("ActionCallI18NPic", 1); - leftItems << "ActionCallI18NPic"; - } else if(ActionCallI18NPic != QString(currentDir+"NULL") && !QFile(ActionCallI18NPic).exists()) { - itemPicsLeft << "ActionCallI18NPic = "+ActionCallI18NPic; - ActionCallI18NPic = getFallBackFieldContent("ActionCallI18NPic", 1); - } + if(ActionCallI18NPic == "") { + ActionCallI18NPic = getFallBackFieldContent("ActionCallI18NPic", 1); + leftItems << "ActionCallI18NPic"; + } else if(ActionCallI18NPic != QString(currentDir+"NULL") && !QFile(ActionCallI18NPic).exists()) { + itemPicsLeft << "ActionCallI18NPic = "+ActionCallI18NPic; + ActionCallI18NPic = getFallBackFieldContent("ActionCallI18NPic", 1); + } - if(ActionCheckI18NPic == "") { - ActionCheckI18NPic = getFallBackFieldContent("ActionCheckI18NPic", 1); - leftItems << "ActionCheckI18NPic"; - } else if(ActionCheckI18NPic != QString(currentDir+"NULL") && !QFile(ActionCheckI18NPic).exists()) { - itemPicsLeft << "ActionCheckI18NPic = "+ActionCheckI18NPic; - ActionCheckI18NPic = getFallBackFieldContent("ActionCheckI18NPic", 1); - } + if(ActionCheckI18NPic == "") { + ActionCheckI18NPic = getFallBackFieldContent("ActionCheckI18NPic", 1); + leftItems << "ActionCheckI18NPic"; + } else if(ActionCheckI18NPic != QString(currentDir+"NULL") && !QFile(ActionCheckI18NPic).exists()) { + itemPicsLeft << "ActionCheckI18NPic = "+ActionCheckI18NPic; + ActionCheckI18NPic = getFallBackFieldContent("ActionCheckI18NPic", 1); + } - if(ActionFoldI18NPic == "") { - ActionFoldI18NPic = getFallBackFieldContent("ActionFoldI18NPic", 1); - leftItems << "ActionFoldI18NPic"; - } else if(ActionFoldI18NPic != QString(currentDir+"NULL") && !QFile(ActionFoldI18NPic).exists()) { - itemPicsLeft << "ActionFoldI18NPic = "+ActionFoldI18NPic; - ActionFoldI18NPic = getFallBackFieldContent("ActionFoldI18NPic", 1); - } + if(ActionFoldI18NPic == "") { + ActionFoldI18NPic = getFallBackFieldContent("ActionFoldI18NPic", 1); + leftItems << "ActionFoldI18NPic"; + } else if(ActionFoldI18NPic != QString(currentDir+"NULL") && !QFile(ActionFoldI18NPic).exists()) { + itemPicsLeft << "ActionFoldI18NPic = "+ActionFoldI18NPic; + ActionFoldI18NPic = getFallBackFieldContent("ActionFoldI18NPic", 1); + } - if(ActionWinnerI18NPic == "") { - ActionWinnerI18NPic = getFallBackFieldContent(" ActionWinnerI18NPic", 1); - leftItems << "ActionWinnerI18NPic"; - } else if(ActionWinnerI18NPic != QString(currentDir+"NULL") && !QFile(ActionWinnerI18NPic).exists()) { - itemPicsLeft << "ActionWinnerI18NPic = "+ActionWinnerI18NPic; - ActionWinnerI18NPic = getFallBackFieldContent(" ActionWinnerI18NPic", 1); - } + if(ActionWinnerI18NPic == "") { + ActionWinnerI18NPic = getFallBackFieldContent(" ActionWinnerI18NPic", 1); + leftItems << "ActionWinnerI18NPic"; + } else if(ActionWinnerI18NPic != QString(currentDir+"NULL") && !QFile(ActionWinnerI18NPic).exists()) { + itemPicsLeft << "ActionWinnerI18NPic = "+ActionWinnerI18NPic; + ActionWinnerI18NPic = getFallBackFieldContent(" ActionWinnerI18NPic", 1); + } - // Other Pics - if(BigBlindPuck == "") { - BigBlindPuck = getFallBackFieldContent("BigBlindPuck", 1); - leftItems << "BigBlindPuck"; - } else if(BigBlindPuck != QString(currentDir+"NULL") && !QFile(BigBlindPuck).exists()) { - itemPicsLeft << "BigBlindPuck = "+BigBlindPuck; - BigBlindPuck = getFallBackFieldContent("BigBlindPuck", 1); - } + // Other Pics + if(BigBlindPuck == "") { + BigBlindPuck = getFallBackFieldContent("BigBlindPuck", 1); + leftItems << "BigBlindPuck"; + } else if(BigBlindPuck != QString(currentDir+"NULL") && !QFile(BigBlindPuck).exists()) { + itemPicsLeft << "BigBlindPuck = "+BigBlindPuck; + BigBlindPuck = getFallBackFieldContent("BigBlindPuck", 1); + } - if(SmallBlindPuck == "") { - SmallBlindPuck = getFallBackFieldContent("SmallBlindPuck", 1); - leftItems << "SmallBlindPuck"; - } else if(SmallBlindPuck != QString(currentDir+"NULL") && !QFile(SmallBlindPuck).exists()) { - itemPicsLeft << "SmallBlindPuck = "+SmallBlindPuck; - SmallBlindPuck = getFallBackFieldContent("SmallBlindPuck", 1); - } + if(SmallBlindPuck == "") { + SmallBlindPuck = getFallBackFieldContent("SmallBlindPuck", 1); + leftItems << "SmallBlindPuck"; + } else if(SmallBlindPuck != QString(currentDir+"NULL") && !QFile(SmallBlindPuck).exists()) { + itemPicsLeft << "SmallBlindPuck = "+SmallBlindPuck; + SmallBlindPuck = getFallBackFieldContent("SmallBlindPuck", 1); + } - if(DealerPuck == "") { - DealerPuck = getFallBackFieldContent("DealerPuck", 1); - leftItems << "DealerPuck"; - } else if(DealerPuck != QString(currentDir+"NULL") && !QFile(DealerPuck).exists()) { - itemPicsLeft << "DealerPuck = "+DealerPuck; - DealerPuck = getFallBackFieldContent("DealerPuck", 1); - } + if(DealerPuck == "") { + DealerPuck = getFallBackFieldContent("DealerPuck", 1); + leftItems << "DealerPuck"; + } else if(DealerPuck != QString(currentDir+"NULL") && !QFile(DealerPuck).exists()) { + itemPicsLeft << "DealerPuck = "+DealerPuck; + DealerPuck = getFallBackFieldContent("DealerPuck", 1); + } - if(DefaultAvatar == "") { - DefaultAvatar = getFallBackFieldContent("DefaultAvatar", 1); - leftItems << "DefaultAvatar"; - } else if(DefaultAvatar != QString(currentDir+"NULL") && !QFile(DefaultAvatar).exists()) { - itemPicsLeft << "DefaultAvatar = "+DefaultAvatar; - DefaultAvatar = getFallBackFieldContent("DefaultAvatar", 1); - } + if(DefaultAvatar == "") { + DefaultAvatar = getFallBackFieldContent("DefaultAvatar", 1); + leftItems << "DefaultAvatar"; + } else if(DefaultAvatar != QString(currentDir+"NULL") && !QFile(DefaultAvatar).exists()) { + itemPicsLeft << "DefaultAvatar = "+DefaultAvatar; + DefaultAvatar = getFallBackFieldContent("DefaultAvatar", 1); + } - if(CardHolderFlop == "") { - CardHolderFlop = getFallBackFieldContent("CardHolderFlop", 1); - leftItems << "CardHolderFlop"; - } else if(CardHolderFlop != QString(currentDir+"NULL") && !QFile(CardHolderFlop).exists()) { - itemPicsLeft << "CardHolderFlop = "+CardHolderFlop; - CardHolderFlop = getFallBackFieldContent("CardHolderFlop", 1); - } + if(CardHolderFlop == "") { + CardHolderFlop = getFallBackFieldContent("CardHolderFlop", 1); + leftItems << "CardHolderFlop"; + } else if(CardHolderFlop != QString(currentDir+"NULL") && !QFile(CardHolderFlop).exists()) { + itemPicsLeft << "CardHolderFlop = "+CardHolderFlop; + CardHolderFlop = getFallBackFieldContent("CardHolderFlop", 1); + } - if(CardHolderTurn == "") { - CardHolderTurn = getFallBackFieldContent("CardHolderTurn", 1); - leftItems << "CardHolderTurn"; - } else if(CardHolderTurn != QString(currentDir+"NULL") && !QFile(CardHolderTurn).exists()) { - itemPicsLeft << "CardHolderTurn = "+CardHolderTurn; - CardHolderTurn = getFallBackFieldContent("CardHolderTurn", 1); - } + if(CardHolderTurn == "") { + CardHolderTurn = getFallBackFieldContent("CardHolderTurn", 1); + leftItems << "CardHolderTurn"; + } else if(CardHolderTurn != QString(currentDir+"NULL") && !QFile(CardHolderTurn).exists()) { + itemPicsLeft << "CardHolderTurn = "+CardHolderTurn; + CardHolderTurn = getFallBackFieldContent("CardHolderTurn", 1); + } - if(CardHolderRiver == "") { - CardHolderRiver = getFallBackFieldContent("CardHolderRiver", 1); - leftItems << "CardHolderRiver"; - } else if(CardHolderRiver != QString(currentDir+"NULL") && !QFile(CardHolderRiver).exists()) { - itemPicsLeft << "CardHolderRiver = "+CardHolderRiver; - CardHolderRiver = getFallBackFieldContent("CardHolderRiver", 1); - } + if(CardHolderRiver == "") { + CardHolderRiver = getFallBackFieldContent("CardHolderRiver", 1); + leftItems << "CardHolderRiver"; + } else if(CardHolderRiver != QString(currentDir+"NULL") && !QFile(CardHolderRiver).exists()) { + itemPicsLeft << "CardHolderRiver = "+CardHolderRiver; + CardHolderRiver = getFallBackFieldContent("CardHolderRiver", 1); + } - if(FoldButtonDefault == "") { - FoldButtonDefault = getFallBackFieldContent("FoldButtonDefault", 1); - leftItems << "FoldButtonDefault"; - } else if(FoldButtonDefault != QString(currentDir+"NULL") && !QFile(FoldButtonDefault).exists()) { - itemPicsLeft << "FoldButtonDefault = "+FoldButtonDefault; - FoldButtonDefault = getFallBackFieldContent("FoldButtonDefault", 1); - } + if(FoldButtonDefault == "") { + FoldButtonDefault = getFallBackFieldContent("FoldButtonDefault", 1); + leftItems << "FoldButtonDefault"; + } else if(FoldButtonDefault != QString(currentDir+"NULL") && !QFile(FoldButtonDefault).exists()) { + itemPicsLeft << "FoldButtonDefault = "+FoldButtonDefault; + FoldButtonDefault = getFallBackFieldContent("FoldButtonDefault", 1); + } - if(FoldButtonHover == "") { - FoldButtonHover = getFallBackFieldContent("FoldButtonHover", 1); - leftItems << "FoldButtonHover"; - } else if(FoldButtonHover != QString(currentDir+"NULL") && !QFile(FoldButtonHover).exists()) { - itemPicsLeft << "FoldButtonHover = "+FoldButtonHover; - FoldButtonHover = getFallBackFieldContent("FoldButtonHover", 1); - } + if(FoldButtonHover == "") { + FoldButtonHover = getFallBackFieldContent("FoldButtonHover", 1); + leftItems << "FoldButtonHover"; + } else if(FoldButtonHover != QString(currentDir+"NULL") && !QFile(FoldButtonHover).exists()) { + itemPicsLeft << "FoldButtonHover = "+FoldButtonHover; + FoldButtonHover = getFallBackFieldContent("FoldButtonHover", 1); + } - if(FoldButtonChecked == "") { - FoldButtonChecked = getFallBackFieldContent("FoldButtonChecked", 1); - leftItems << "FoldButtonChecked"; - } else if(FoldButtonChecked != QString(currentDir+"NULL") && !QFile(FoldButtonChecked).exists()) { - itemPicsLeft << "FoldButtonChecked = "+FoldButtonChecked; - FoldButtonChecked = getFallBackFieldContent("FoldButtonChecked", 1); - } + if(FoldButtonChecked == "") { + FoldButtonChecked = getFallBackFieldContent("FoldButtonChecked", 1); + leftItems << "FoldButtonChecked"; + } else if(FoldButtonChecked != QString(currentDir+"NULL") && !QFile(FoldButtonChecked).exists()) { + itemPicsLeft << "FoldButtonChecked = "+FoldButtonChecked; + FoldButtonChecked = getFallBackFieldContent("FoldButtonChecked", 1); + } - if(FoldButtonCheckedHover == "") { - FoldButtonCheckedHover = getFallBackFieldContent("FoldButtonCheckedHover", 1); - leftItems << "FoldButtonCheckedHover"; - } else if(FoldButtonCheckedHover != QString(currentDir+"NULL") && !QFile(FoldButtonCheckedHover).exists()) { - itemPicsLeft << "FoldButtonCheckedHover = "+FoldButtonCheckedHover; - FoldButtonCheckedHover = getFallBackFieldContent("FoldButtonCheckedHover", 1); - } + if(FoldButtonCheckedHover == "") { + FoldButtonCheckedHover = getFallBackFieldContent("FoldButtonCheckedHover", 1); + leftItems << "FoldButtonCheckedHover"; + } else if(FoldButtonCheckedHover != QString(currentDir+"NULL") && !QFile(FoldButtonCheckedHover).exists()) { + itemPicsLeft << "FoldButtonCheckedHover = "+FoldButtonCheckedHover; + FoldButtonCheckedHover = getFallBackFieldContent("FoldButtonCheckedHover", 1); + } - if(CheckCallButtonDefault == "") { - CheckCallButtonDefault = getFallBackFieldContent("CheckCallButtonDefault", 1); - leftItems << "CheckCallButtonDefault"; - } else if(CheckCallButtonDefault != QString(currentDir+"NULL") && !QFile(CheckCallButtonDefault).exists()) { - itemPicsLeft << "CheckCallButtonDefault = "+CheckCallButtonDefault; - CheckCallButtonDefault = getFallBackFieldContent("CheckCallButtonDefault", 1); - } + if(CheckCallButtonDefault == "") { + CheckCallButtonDefault = getFallBackFieldContent("CheckCallButtonDefault", 1); + leftItems << "CheckCallButtonDefault"; + } else if(CheckCallButtonDefault != QString(currentDir+"NULL") && !QFile(CheckCallButtonDefault).exists()) { + itemPicsLeft << "CheckCallButtonDefault = "+CheckCallButtonDefault; + CheckCallButtonDefault = getFallBackFieldContent("CheckCallButtonDefault", 1); + } - if(CheckCallButtonHover == "") { - CheckCallButtonHover = getFallBackFieldContent("CheckCallButtonHover", 1); - leftItems << "CheckCallButtonHover"; - } else if(CheckCallButtonHover != QString(currentDir+"NULL") && !QFile(CheckCallButtonHover).exists()) { - itemPicsLeft << "CheckCallButtonHover = "+CheckCallButtonHover; - CheckCallButtonHover = getFallBackFieldContent("CheckCallButtonHover", 1); - } + if(CheckCallButtonHover == "") { + CheckCallButtonHover = getFallBackFieldContent("CheckCallButtonHover", 1); + leftItems << "CheckCallButtonHover"; + } else if(CheckCallButtonHover != QString(currentDir+"NULL") && !QFile(CheckCallButtonHover).exists()) { + itemPicsLeft << "CheckCallButtonHover = "+CheckCallButtonHover; + CheckCallButtonHover = getFallBackFieldContent("CheckCallButtonHover", 1); + } - if(CheckCallButtonChecked == "") { - CheckCallButtonChecked = getFallBackFieldContent("CheckCallButtonChecked", 1); - leftItems << "CheckCallButtonChecked"; - } else if(CheckCallButtonChecked != QString(currentDir+"NULL") && !QFile(CheckCallButtonChecked).exists()) { - itemPicsLeft << "CheckCallButtonChecked = "+CheckCallButtonChecked; - CheckCallButtonChecked = getFallBackFieldContent("CheckCallButtonChecked", 1); - } + if(CheckCallButtonChecked == "") { + CheckCallButtonChecked = getFallBackFieldContent("CheckCallButtonChecked", 1); + leftItems << "CheckCallButtonChecked"; + } else if(CheckCallButtonChecked != QString(currentDir+"NULL") && !QFile(CheckCallButtonChecked).exists()) { + itemPicsLeft << "CheckCallButtonChecked = "+CheckCallButtonChecked; + CheckCallButtonChecked = getFallBackFieldContent("CheckCallButtonChecked", 1); + } - if(CheckCallButtonCheckedHover == "") { - CheckCallButtonCheckedHover = getFallBackFieldContent("CheckCallButtonCheckedHover", 1); - leftItems << "CheckCallButtonCheckedHover"; - } else if(CheckCallButtonCheckedHover != QString(currentDir+"NULL") && !QFile(CheckCallButtonCheckedHover).exists()) { - itemPicsLeft << "CheckCallButtonCheckedHover = "+CheckCallButtonCheckedHover; - CheckCallButtonCheckedHover = getFallBackFieldContent("CheckCallButtonCheckedHover", 1); - } + if(CheckCallButtonCheckedHover == "") { + CheckCallButtonCheckedHover = getFallBackFieldContent("CheckCallButtonCheckedHover", 1); + leftItems << "CheckCallButtonCheckedHover"; + } else if(CheckCallButtonCheckedHover != QString(currentDir+"NULL") && !QFile(CheckCallButtonCheckedHover).exists()) { + itemPicsLeft << "CheckCallButtonCheckedHover = "+CheckCallButtonCheckedHover; + CheckCallButtonCheckedHover = getFallBackFieldContent("CheckCallButtonCheckedHover", 1); + } - if(BetRaiseButtonDefault == "") { - BetRaiseButtonDefault = getFallBackFieldContent("BetRaiseButtonDefault", 1); - leftItems << "BetRaiseButtonDefault"; - } else if(BetRaiseButtonDefault != QString(currentDir+"NULL") && !QFile(BetRaiseButtonDefault).exists()) { - itemPicsLeft << "BetRaiseButtonDefault = "+BetRaiseButtonDefault; - BetRaiseButtonDefault = getFallBackFieldContent("BetRaiseButtonDefault", 1); - } + if(BetRaiseButtonDefault == "") { + BetRaiseButtonDefault = getFallBackFieldContent("BetRaiseButtonDefault", 1); + leftItems << "BetRaiseButtonDefault"; + } else if(BetRaiseButtonDefault != QString(currentDir+"NULL") && !QFile(BetRaiseButtonDefault).exists()) { + itemPicsLeft << "BetRaiseButtonDefault = "+BetRaiseButtonDefault; + BetRaiseButtonDefault = getFallBackFieldContent("BetRaiseButtonDefault", 1); + } - if(BetRaiseButtonHover == "") { - BetRaiseButtonHover = getFallBackFieldContent("BetRaiseButtonHover", 1); - leftItems << "BetRaiseButtonHover"; - } else if(BetRaiseButtonHover != QString(currentDir+"NULL") && !QFile(BetRaiseButtonHover).exists()) { - itemPicsLeft << "BetRaiseButtonHover = "+BetRaiseButtonHover; - BetRaiseButtonHover = getFallBackFieldContent("BetRaiseButtonHover", 1); - } + if(BetRaiseButtonHover == "") { + BetRaiseButtonHover = getFallBackFieldContent("BetRaiseButtonHover", 1); + leftItems << "BetRaiseButtonHover"; + } else if(BetRaiseButtonHover != QString(currentDir+"NULL") && !QFile(BetRaiseButtonHover).exists()) { + itemPicsLeft << "BetRaiseButtonHover = "+BetRaiseButtonHover; + BetRaiseButtonHover = getFallBackFieldContent("BetRaiseButtonHover", 1); + } - if(BetRaiseButtonChecked == "") { - BetRaiseButtonChecked = getFallBackFieldContent("BetRaiseButtonChecked", 1); - leftItems << "BetRaiseButtonChecked"; - } else if(BetRaiseButtonChecked != QString(currentDir+"NULL") && !QFile(BetRaiseButtonChecked).exists()) { - itemPicsLeft << "BetRaiseButtonChecked = "+BetRaiseButtonChecked; - BetRaiseButtonChecked = getFallBackFieldContent("BetRaiseButtonChecked", 1); - } + if(BetRaiseButtonChecked == "") { + BetRaiseButtonChecked = getFallBackFieldContent("BetRaiseButtonChecked", 1); + leftItems << "BetRaiseButtonChecked"; + } else if(BetRaiseButtonChecked != QString(currentDir+"NULL") && !QFile(BetRaiseButtonChecked).exists()) { + itemPicsLeft << "BetRaiseButtonChecked = "+BetRaiseButtonChecked; + BetRaiseButtonChecked = getFallBackFieldContent("BetRaiseButtonChecked", 1); + } - if(BetRaiseButtonCheckedHover == "") { - BetRaiseButtonCheckedHover = getFallBackFieldContent("BetRaiseButtonCheckedHover", 1); - leftItems << "BetRaiseButtonCheckedHover"; - } else if(BetRaiseButtonCheckedHover != QString(currentDir+"NULL") && !QFile(BetRaiseButtonCheckedHover).exists()) { - itemPicsLeft << "BetRaiseButtonCheckedHover = "+BetRaiseButtonCheckedHover; - BetRaiseButtonCheckedHover = getFallBackFieldContent("BetRaiseButtonCheckedHover", 1); - } + if(BetRaiseButtonCheckedHover == "") { + BetRaiseButtonCheckedHover = getFallBackFieldContent("BetRaiseButtonCheckedHover", 1); + leftItems << "BetRaiseButtonCheckedHover"; + } else if(BetRaiseButtonCheckedHover != QString(currentDir+"NULL") && !QFile(BetRaiseButtonCheckedHover).exists()) { + itemPicsLeft << "BetRaiseButtonCheckedHover = "+BetRaiseButtonCheckedHover; + BetRaiseButtonCheckedHover = getFallBackFieldContent("BetRaiseButtonCheckedHover", 1); + } - if(AllInButtonDefault == "") { - AllInButtonDefault = getFallBackFieldContent("AllInButtonDefault", 1); - leftItems << "AllInButtonDefault"; - } else if(AllInButtonDefault != QString(currentDir+"NULL") && !QFile(AllInButtonDefault).exists()) { - itemPicsLeft << "AllInButtonDefault = "+AllInButtonDefault; - AllInButtonDefault = getFallBackFieldContent("AllInButtonDefault", 1); - } + if(AllInButtonDefault == "") { + AllInButtonDefault = getFallBackFieldContent("AllInButtonDefault", 1); + leftItems << "AllInButtonDefault"; + } else if(AllInButtonDefault != QString(currentDir+"NULL") && !QFile(AllInButtonDefault).exists()) { + itemPicsLeft << "AllInButtonDefault = "+AllInButtonDefault; + AllInButtonDefault = getFallBackFieldContent("AllInButtonDefault", 1); + } - if(AllInButtonHover == "") { - AllInButtonHover = getFallBackFieldContent("AllInButtonHover", 1); - leftItems << "AllInButtonHover"; - } else if(AllInButtonHover != QString(currentDir+"NULL") && !QFile(AllInButtonHover).exists()) { - itemPicsLeft << "AllInButtonHover = "+AllInButtonHover; - AllInButtonHover = getFallBackFieldContent("AllInButtonHover", 1); - } + if(AllInButtonHover == "") { + AllInButtonHover = getFallBackFieldContent("AllInButtonHover", 1); + leftItems << "AllInButtonHover"; + } else if(AllInButtonHover != QString(currentDir+"NULL") && !QFile(AllInButtonHover).exists()) { + itemPicsLeft << "AllInButtonHover = "+AllInButtonHover; + AllInButtonHover = getFallBackFieldContent("AllInButtonHover", 1); + } - if(AllInButtonChecked == "") { - AllInButtonChecked = getFallBackFieldContent("AllInButtonChecked", 1); - leftItems << "AllInButtonChecked"; - } else if(AllInButtonChecked != QString(currentDir+"NULL") && !QFile(AllInButtonChecked).exists()) { - itemPicsLeft << "AllInButtonChecked = "+AllInButtonChecked; - AllInButtonChecked = getFallBackFieldContent("AllInButtonChecked", 1); - } + if(AllInButtonChecked == "") { + AllInButtonChecked = getFallBackFieldContent("AllInButtonChecked", 1); + leftItems << "AllInButtonChecked"; + } else if(AllInButtonChecked != QString(currentDir+"NULL") && !QFile(AllInButtonChecked).exists()) { + itemPicsLeft << "AllInButtonChecked = "+AllInButtonChecked; + AllInButtonChecked = getFallBackFieldContent("AllInButtonChecked", 1); + } - if(AllInButtonCheckedHover == "") { - AllInButtonCheckedHover = getFallBackFieldContent("AllInButtonCheckedHover", 1); - leftItems << "AllInButtonCheckedHover"; - } else if(AllInButtonCheckedHover != QString(currentDir+"NULL") && !QFile(AllInButtonCheckedHover).exists()) { - itemPicsLeft << "AllInButtonCheckedHover = "+AllInButtonCheckedHover; - AllInButtonCheckedHover = getFallBackFieldContent("AllInButtonCheckedHover", 1); - } + if(AllInButtonCheckedHover == "") { + AllInButtonCheckedHover = getFallBackFieldContent("AllInButtonCheckedHover", 1); + leftItems << "AllInButtonCheckedHover"; + } else if(AllInButtonCheckedHover != QString(currentDir+"NULL") && !QFile(AllInButtonCheckedHover).exists()) { + itemPicsLeft << "AllInButtonCheckedHover = "+AllInButtonCheckedHover; + AllInButtonCheckedHover = getFallBackFieldContent("AllInButtonCheckedHover", 1); + } - if(RadioButtonPressed == "") { - RadioButtonPressed = getFallBackFieldContent("RadioButtonPressed", 1); - leftItems << "RadioButtonPressed"; - } else if(RadioButtonPressed != QString(currentDir+"NULL") && !QFile(RadioButtonPressed).exists()) { - itemPicsLeft << "RadioButtonPressed = "+RadioButtonPressed; - RadioButtonPressed = getFallBackFieldContent("RadioButtonPressed", 1); - } + if(RadioButtonPressed == "") { + RadioButtonPressed = getFallBackFieldContent("RadioButtonPressed", 1); + leftItems << "RadioButtonPressed"; + } else if(RadioButtonPressed != QString(currentDir+"NULL") && !QFile(RadioButtonPressed).exists()) { + itemPicsLeft << "RadioButtonPressed = "+RadioButtonPressed; + RadioButtonPressed = getFallBackFieldContent("RadioButtonPressed", 1); + } - if(RadioButtonChecked == "") { - RadioButtonChecked = getFallBackFieldContent("RadioButtonChecked", 1); - leftItems << "RadioButtonChecked"; - } else if(RadioButtonChecked != QString(currentDir+"NULL") && !QFile(RadioButtonChecked).exists()) { - itemPicsLeft << "RadioButtonChecked = "+RadioButtonChecked; - RadioButtonChecked = getFallBackFieldContent("RadioButtonChecked", 1); - } + if(RadioButtonChecked == "") { + RadioButtonChecked = getFallBackFieldContent("RadioButtonChecked", 1); + leftItems << "RadioButtonChecked"; + } else if(RadioButtonChecked != QString(currentDir+"NULL") && !QFile(RadioButtonChecked).exists()) { + itemPicsLeft << "RadioButtonChecked = "+RadioButtonChecked; + RadioButtonChecked = getFallBackFieldContent("RadioButtonChecked", 1); + } - if(RadioButtonCheckedHover == "") { - RadioButtonCheckedHover = getFallBackFieldContent("RadioButtonCheckedHover", 1); - leftItems << "RadioButtonCheckedHover"; - } else if(RadioButtonCheckedHover != QString(currentDir+"NULL") && !QFile(RadioButtonCheckedHover).exists()) { - itemPicsLeft << "RadioButtonCheckedHover = "+RadioButtonCheckedHover; - RadioButtonCheckedHover = getFallBackFieldContent("RadioButtonCheckedHover", 1); - } + if(RadioButtonCheckedHover == "") { + RadioButtonCheckedHover = getFallBackFieldContent("RadioButtonCheckedHover", 1); + leftItems << "RadioButtonCheckedHover"; + } else if(RadioButtonCheckedHover != QString(currentDir+"NULL") && !QFile(RadioButtonCheckedHover).exists()) { + itemPicsLeft << "RadioButtonCheckedHover = "+RadioButtonCheckedHover; + RadioButtonCheckedHover = getFallBackFieldContent("RadioButtonCheckedHover", 1); + } - if(RadioButtonUnchecked == "") { - RadioButtonUnchecked = getFallBackFieldContent("RadioButtonUnchecked", 1); - leftItems << "RadioButtonUnchecked"; - } else if(RadioButtonUnchecked != QString(currentDir+"NULL") && !QFile(RadioButtonUnchecked).exists()) { - itemPicsLeft << "RadioButtonUnchecked = "+RadioButtonUnchecked; - RadioButtonUnchecked = getFallBackFieldContent("RadioButtonUnchecked", 1); - } + if(RadioButtonUnchecked == "") { + RadioButtonUnchecked = getFallBackFieldContent("RadioButtonUnchecked", 1); + leftItems << "RadioButtonUnchecked"; + } else if(RadioButtonUnchecked != QString(currentDir+"NULL") && !QFile(RadioButtonUnchecked).exists()) { + itemPicsLeft << "RadioButtonUnchecked = "+RadioButtonUnchecked; + RadioButtonUnchecked = getFallBackFieldContent("RadioButtonUnchecked", 1); + } - if(RadioButtonUncheckedHover == "") { - RadioButtonUncheckedHover = getFallBackFieldContent("RadioButtonUncheckedHover", 1); - leftItems << "RadioButtonUncheckedHover"; - } else if(RadioButtonUncheckedHover != QString(currentDir+"NULL") && !QFile(RadioButtonUncheckedHover).exists()) { - itemPicsLeft << "RadioButtonUncheckedHover = "+RadioButtonUncheckedHover; - RadioButtonUncheckedHover = getFallBackFieldContent("RadioButtonUncheckedHover", 1); - } + if(RadioButtonUncheckedHover == "") { + RadioButtonUncheckedHover = getFallBackFieldContent("RadioButtonUncheckedHover", 1); + leftItems << "RadioButtonUncheckedHover"; + } else if(RadioButtonUncheckedHover != QString(currentDir+"NULL") && !QFile(RadioButtonUncheckedHover).exists()) { + itemPicsLeft << "RadioButtonUncheckedHover = "+RadioButtonUncheckedHover; + RadioButtonUncheckedHover = getFallBackFieldContent("RadioButtonUncheckedHover", 1); + } - if(PlayerTopSeatActive == "") { - PlayerTopSeatActive = getFallBackFieldContent("PlayerTopSeatActive", 1); - leftItems << "PlayerTopSeatActive"; - } else if(PlayerTopSeatActive != QString(currentDir+"NULL") && !QFile(PlayerTopSeatActive).exists()) { - itemPicsLeft << "PlayerTopSeatActive = "+PlayerTopSeatActive; - PlayerTopSeatActive = getFallBackFieldContent("PlayerTopSeatActive", 1); - } + if(PlayerTopSeatActive == "") { + PlayerTopSeatActive = getFallBackFieldContent("PlayerTopSeatActive", 1); + leftItems << "PlayerTopSeatActive"; + } else if(PlayerTopSeatActive != QString(currentDir+"NULL") && !QFile(PlayerTopSeatActive).exists()) { + itemPicsLeft << "PlayerTopSeatActive = "+PlayerTopSeatActive; + PlayerTopSeatActive = getFallBackFieldContent("PlayerTopSeatActive", 1); + } - if(PlayerTopSeatInactive == "") { - PlayerTopSeatInactive = getFallBackFieldContent("PlayerTopSeatInactive", 1); - leftItems << "PlayerTopSeatInactive"; - } else if(PlayerTopSeatInactive != QString(currentDir+"NULL") && !QFile(PlayerTopSeatInactive).exists()) { - itemPicsLeft << "PlayerTopSeatInactive = "+PlayerTopSeatInactive; - PlayerTopSeatInactive = getFallBackFieldContent("PlayerTopSeatInactive", 1); - } + if(PlayerTopSeatInactive == "") { + PlayerTopSeatInactive = getFallBackFieldContent("PlayerTopSeatInactive", 1); + leftItems << "PlayerTopSeatInactive"; + } else if(PlayerTopSeatInactive != QString(currentDir+"NULL") && !QFile(PlayerTopSeatInactive).exists()) { + itemPicsLeft << "PlayerTopSeatInactive = "+PlayerTopSeatInactive; + PlayerTopSeatInactive = getFallBackFieldContent("PlayerTopSeatInactive", 1); + } - if(PlayerBottomSeatActive == "") { - PlayerBottomSeatActive = getFallBackFieldContent("PlayerBottomSeatActive", 1); - leftItems << "PlayerBottomSeatActive"; - } else if(PlayerBottomSeatActive != QString(currentDir+"NULL") && !QFile(PlayerBottomSeatActive).exists()) { - itemPicsLeft << "PlayerBottomSeatActive = "+PlayerBottomSeatActive; - PlayerBottomSeatActive = getFallBackFieldContent("PlayerBottomSeatActive", 1); - } + if(PlayerBottomSeatActive == "") { + PlayerBottomSeatActive = getFallBackFieldContent("PlayerBottomSeatActive", 1); + leftItems << "PlayerBottomSeatActive"; + } else if(PlayerBottomSeatActive != QString(currentDir+"NULL") && !QFile(PlayerBottomSeatActive).exists()) { + itemPicsLeft << "PlayerBottomSeatActive = "+PlayerBottomSeatActive; + PlayerBottomSeatActive = getFallBackFieldContent("PlayerBottomSeatActive", 1); + } - if(PlayerBottomSeatInactive == "") { - PlayerBottomSeatInactive = getFallBackFieldContent("PlayerBottomSeatInactive", 1); - leftItems << "PlayerBottomSeatInactive"; - } else if(PlayerBottomSeatInactive != QString(currentDir+"NULL") && !QFile(PlayerBottomSeatInactive).exists()) { - itemPicsLeft << "PlayerBottomSeatInactive = "+PlayerBottomSeatInactive; - PlayerBottomSeatInactive = getFallBackFieldContent("PlayerBottomSeatInactive", 1); - } + if(PlayerBottomSeatInactive == "") { + PlayerBottomSeatInactive = getFallBackFieldContent("PlayerBottomSeatInactive", 1); + leftItems << "PlayerBottomSeatInactive"; + } else if(PlayerBottomSeatInactive != QString(currentDir+"NULL") && !QFile(PlayerBottomSeatInactive).exists()) { + itemPicsLeft << "PlayerBottomSeatInactive = "+PlayerBottomSeatInactive; + PlayerBottomSeatInactive = getFallBackFieldContent("PlayerBottomSeatInactive", 1); + } - if(Table == "") { - Table = getFallBackFieldContent("Table", 1); - leftItems << "Table"; - } else if(Table != QString(currentDir+"NULL") && !QFile(Table).exists()) { - itemPicsLeft << "Table = "+Table; - Table = getFallBackFieldContent("Table", 1); - } + if(Table == "") { + Table = getFallBackFieldContent("Table", 1); + leftItems << "Table"; + } else if(Table != QString(currentDir+"NULL") && !QFile(Table).exists()) { + itemPicsLeft << "Table = "+Table; + Table = getFallBackFieldContent("Table", 1); + } - if(HandRanking == "") { - HandRanking = getFallBackFieldContent("HandRanking", 1); - leftItems << "HandRanking"; - } else if(HandRanking != QString(currentDir+"NULL") && !QFile(HandRanking).exists()) { - itemPicsLeft << "HandRanking = "+HandRanking; - HandRanking = getFallBackFieldContent("HandRanking", 1); - } + if(HandRanking == "") { + HandRanking = getFallBackFieldContent("HandRanking", 1); + leftItems << "HandRanking"; + } else if(HandRanking != QString(currentDir+"NULL") && !QFile(HandRanking).exists()) { + itemPicsLeft << "HandRanking = "+HandRanking; + HandRanking = getFallBackFieldContent("HandRanking", 1); + } - if(ToolBoxBackground == "") { - ToolBoxBackground = getFallBackFieldContent("ToolBoxBackground", 1); - leftItems << "ToolBoxBackground"; - } else if(ToolBoxBackground != QString(currentDir+"NULL") && !QFile(ToolBoxBackground).exists()) { - itemPicsLeft << "ToolBoxBackground = "+ToolBoxBackground; - ToolBoxBackground = getFallBackFieldContent("ToolBoxBackground", 1); - } + if(ToolBoxBackground == "") { + ToolBoxBackground = getFallBackFieldContent("ToolBoxBackground", 1); + leftItems << "ToolBoxBackground"; + } else if(ToolBoxBackground != QString(currentDir+"NULL") && !QFile(ToolBoxBackground).exists()) { + itemPicsLeft << "ToolBoxBackground = "+ToolBoxBackground; + ToolBoxBackground = getFallBackFieldContent("ToolBoxBackground", 1); + } - if(ShowMyCardsButtonDefault == "") { - ShowMyCardsButtonDefault = getFallBackFieldContent("ShowMyCardsButtonDefault", 1); - leftItems << "ShowMyCardsButtonDefault"; - } else if(ShowMyCardsButtonDefault != QString(currentDir+"NULL") && !QFile(ShowMyCardsButtonDefault).exists()) { - itemPicsLeft << "ShowMyCardsButtonDefault = "+ShowMyCardsButtonDefault; - ShowMyCardsButtonDefault = getFallBackFieldContent("ShowMyCardsButtonDefault", 1); - } + if(ShowMyCardsButtonDefault == "") { + ShowMyCardsButtonDefault = getFallBackFieldContent("ShowMyCardsButtonDefault", 1); + leftItems << "ShowMyCardsButtonDefault"; + } else if(ShowMyCardsButtonDefault != QString(currentDir+"NULL") && !QFile(ShowMyCardsButtonDefault).exists()) { + itemPicsLeft << "ShowMyCardsButtonDefault = "+ShowMyCardsButtonDefault; + ShowMyCardsButtonDefault = getFallBackFieldContent("ShowMyCardsButtonDefault", 1); + } - if(ShowMyCardsButtonHover == "") { - ShowMyCardsButtonHover = getFallBackFieldContent("ShowMyCardsButtonHover", 1); - leftItems << "ShowMyCardsButtonHover"; - } else if(ShowMyCardsButtonHover != QString(currentDir+"NULL") && !QFile(ShowMyCardsButtonHover).exists()) { - itemPicsLeft << "ShowMyCardsButtonHover = "+ShowMyCardsButtonHover; - ShowMyCardsButtonHover = getFallBackFieldContent("ShowMyCardsButtonHover", 1); - } + if(ShowMyCardsButtonHover == "") { + ShowMyCardsButtonHover = getFallBackFieldContent("ShowMyCardsButtonHover", 1); + leftItems << "ShowMyCardsButtonHover"; + } else if(ShowMyCardsButtonHover != QString(currentDir+"NULL") && !QFile(ShowMyCardsButtonHover).exists()) { + itemPicsLeft << "ShowMyCardsButtonHover = "+ShowMyCardsButtonHover; + ShowMyCardsButtonHover = getFallBackFieldContent("ShowMyCardsButtonHover", 1); + } - //I18N ACTION STRINGS - if(ActionAllInI18NString == "") { - ActionAllInI18NString = "NULL"; - leftItems << "ActionAllInI18NString"; - } - if(ActionRaiseI18NString == "") { - ActionRaiseI18NString = "NULL"; - leftItems << "ActionRaiseI18NString"; - } - if(ActionBetI18NString == "") { - ActionBetI18NString = "NULL"; - leftItems << "ActionBetI18NString"; - } - if(ActionCallI18NString == "") { - ActionCallI18NString = "NULL"; - leftItems << "ActionCallI18NString"; - } - if(ActionCheckI18NString == "") { - ActionCheckI18NString = "NULL"; - leftItems << "ActionCheckI18NString"; - } - if(ActionFoldI18NString == "") { - ActionFoldI18NString = "NULL"; - leftItems << "ActionFoldI18NString"; - } - if(PotI18NString == "") { - PotI18NString = "NULL"; - leftItems << "PotI18NString"; - } - if(TotalI18NString == "") { - TotalI18NString = "NULL"; - leftItems << "TotalI18NString"; - } - if(BetsI18NString == "") { - BetsI18NString = "NULL"; - leftItems << "BetsI18NString"; - } - if(GameI18NString == "") { - GameI18NString = "NULL"; - leftItems << "GameI18NString"; - } - if(HandI18NString == "") { - HandI18NString = "NULL"; - leftItems << "HandI18NString"; - } - if(PreflopI18NString == "") { - PreflopI18NString = "NULL"; - leftItems << "PreflopI18NString"; - } - if(FlopI18NString == "") { - FlopI18NString = "NULL"; - leftItems << "FlopI18NString"; - } - if(TurnI18NString == "") { - TurnI18NString = "NULL"; - leftItems << "TurnI18NString"; - } - if(RiverI18NString == "") { - RiverI18NString = "NULL"; - leftItems << "RiverI18NString"; - } + //I18N ACTION STRINGS + if(ActionAllInI18NString == "") { + ActionAllInI18NString = "NULL"; + leftItems << "ActionAllInI18NString"; + } + if(ActionRaiseI18NString == "") { + ActionRaiseI18NString = "NULL"; + leftItems << "ActionRaiseI18NString"; + } + if(ActionBetI18NString == "") { + ActionBetI18NString = "NULL"; + leftItems << "ActionBetI18NString"; + } + if(ActionCallI18NString == "") { + ActionCallI18NString = "NULL"; + leftItems << "ActionCallI18NString"; + } + if(ActionCheckI18NString == "") { + ActionCheckI18NString = "NULL"; + leftItems << "ActionCheckI18NString"; + } + if(ActionFoldI18NString == "") { + ActionFoldI18NString = "NULL"; + leftItems << "ActionFoldI18NString"; + } + if(PotI18NString == "") { + PotI18NString = "NULL"; + leftItems << "PotI18NString"; + } + if(TotalI18NString == "") { + TotalI18NString = "NULL"; + leftItems << "TotalI18NString"; + } + if(BetsI18NString == "") { + BetsI18NString = "NULL"; + leftItems << "BetsI18NString"; + } + if(GameI18NString == "") { + GameI18NString = "NULL"; + leftItems << "GameI18NString"; + } + if(HandI18NString == "") { + HandI18NString = "NULL"; + leftItems << "HandI18NString"; + } + if(PreflopI18NString == "") { + PreflopI18NString = "NULL"; + leftItems << "PreflopI18NString"; + } + if(FlopI18NString == "") { + FlopI18NString = "NULL"; + leftItems << "FlopI18NString"; + } + if(TurnI18NString == "") { + TurnI18NString = "NULL"; + leftItems << "TurnI18NString"; + } + if(RiverI18NString == "") { + RiverI18NString = "NULL"; + leftItems << "RiverI18NString"; + } - // COLORS - if(FKeyIndicatorColor == "") { - FKeyIndicatorColor = getFallBackFieldContent("FKeyIndicatorColor", 0); - leftItems << "FKeyIndicatorColor"; - } - if(ChanceLabelPossibleColor == "") { - ChanceLabelPossibleColor = getFallBackFieldContent("ChanceLabelPossibleColor", 0); - leftItems << "ChanceLabelPossibleColor"; - } - if(ChanceLabelImpossibleColor == "") { - ChanceLabelImpossibleColor = getFallBackFieldContent("ChanceLabelImpossibleColor", 0); - leftItems << "ChanceLabelImpossibleColor"; - } - if(ChatLogTextColor == "") { - ChatLogTextColor = getFallBackFieldContent("ChatLogTextColor", 0); - leftItems << "ChatLogTextColor"; - } - if(ChatTextNickNotifyColor == "") { - ChatTextNickNotifyColor = getFallBackFieldContent("ChatTextNickNotifyColor", 0); - leftItems << "ChatTextNickNotifyColor"; - } - if(ChatLogBgColor == "") { - ChatLogBgColor = getFallBackFieldContent("ChatLogBgColor", 0); - leftItems << "ChatLogBgColor"; - } - if(ChatLogScrollBarBorderColor == "") { - ChatLogScrollBarBorderColor = getFallBackFieldContent("ChatLogScrollBarBorderColor", 0); - leftItems << "ChatLogScrollBarBorderColor"; - } - if(ChatLogScrollBarBgColor == "") { - ChatLogScrollBarBgColor = getFallBackFieldContent("ChatLogScrollBarBgColor", 0); - leftItems << "ChatLogScrollBarBgColor"; - } - if(ChatLogScrollBarHandleBorderColor == "") { - ChatLogScrollBarHandleBorderColor = getFallBackFieldContent("ChatLogScrollBarHandleBorderColor", 0); - leftItems << "ChatLogScrollBarHandleBorderColor"; - } - if(ChatLogScrollBarHandleBgColor == "") { - ChatLogScrollBarHandleBgColor = getFallBackFieldContent("ChatLogScrollBarHandleBgColor", 0); - leftItems << "ChatLogScrollBarHandleBgColor"; - } - if(ChatLogScrollBarArrowBorderColor == "") { - ChatLogScrollBarArrowBorderColor = getFallBackFieldContent("ChatLogScrollBarArrowBorderColor", 0); - leftItems << "ChatLogScrollBarArrowBorderColor"; - } - if(ChatLogScrollBarArrowBgColor == "") { - ChatLogScrollBarArrowBgColor = getFallBackFieldContent("ChatLogScrollBarArrowBgColor", 0); - leftItems << "ChatLogScrollBarArrowBgColor"; - } - if(LogWinnerMainPotColor == "") { - LogWinnerMainPotColor = getFallBackFieldContent("LogWinnerMainPotColor", 0); - leftItems << "LogWinnerMainPotColor"; - } - if(LogWinnerSidePotColor == "") { - LogWinnerSidePotColor = getFallBackFieldContent("LogWinnerSidePotColor", 0); - leftItems << "LogWinnerSidePotColor"; - } - if(LogPlayerSitsOutColor == "") { - LogPlayerSitsOutColor = getFallBackFieldContent("LogPlayerSitsOutColor", 0); - leftItems << "LogPlayerSitsOutColor"; - } - if(LogNewGameAdminColor == "") { - LogNewGameAdminColor = getFallBackFieldContent("LogNewGameAdminColor", 0); - leftItems << "LogNewGameAdminColor"; - } - if(TabWidgetBorderColor == "") { - TabWidgetBorderColor = getFallBackFieldContent("TabWidgetBorderColor", 0); - leftItems << "TabWidgetBorderColor"; - } - if(TabWidgetBgColor == "") { - TabWidgetBgColor = getFallBackFieldContent("TabWidgetBgColor", 0); - leftItems << "TabWidgetBgColor"; - } - if(TabWidgetTextColor == "") { - TabWidgetTextColor = getFallBackFieldContent("TabWidgetTextColor", 0); - leftItems << "TabWidgetTextColor"; - } - if(MenuBgColor == "") { - MenuBgColor = getFallBackFieldContent("MenuBgColor", 0); - leftItems << "MenuBgColor"; - } - if(MenuTextColor == "") { - MenuTextColor = getFallBackFieldContent("MenuTextColor", 0); - leftItems << "MenuTextColor"; - } - if(BreakLobbyButtonBgColor == "") { - BreakLobbyButtonBgColor = getFallBackFieldContent("BreakLobbyButtonBgColor", 0); - leftItems << "BreakLobbyButtonBgColor"; - } - if(BreakLobbyButtonTextColor == "") { - BreakLobbyButtonTextColor = getFallBackFieldContent("BreakLobbyButtonTextColor", 0); - leftItems << "BreakLobbyButtonTextColor"; - } - if(BreakLobbyButtonBgDisabledColor == "") { - BreakLobbyButtonBgDisabledColor = getFallBackFieldContent("BreakLobbyButtonBgDisabledColor", 0); - leftItems << "BreakLobbyButtonBgDisabledColor"; - } - if(BreakLobbyButtonTextDisabledColor == "") { - BreakLobbyButtonTextDisabledColor = getFallBackFieldContent("BreakLobbyButtonTextDisabledColor", 0); - leftItems << "BreakLobbyButtonTextDisabledColor"; - } - if(BreakLobbyButtonBgBlinkColor == "") { - BreakLobbyButtonBgBlinkColor = getFallBackFieldContent("BreakLobbyButtonBgBlinkColor", 0); - leftItems << "BreakLobbyButtonBgBlinkColor"; - } - if(BreakLobbyButtonTextBlinkColor == "") { - BreakLobbyButtonTextBlinkColor = getFallBackFieldContent("BreakLobbyButtonTextBlinkColor", 0); - leftItems << "BreakLobbyButtonTextBlinkColor"; - } - if(PlayerCashTextColor == "") { - PlayerCashTextColor = getFallBackFieldContent("PlayerCashTextColor", 0); - leftItems << "PlayerCashTextColor"; - } - if(PlayerBetTextColor == "") { - PlayerBetTextColor = getFallBackFieldContent("PlayerBetTextColor", 0); - leftItems << "PlayerBetTextColor"; - } - if(PlayerNickTextColor == "") { - PlayerNickTextColor = getFallBackFieldContent("PlayerNickTextColor", 0); - leftItems << "PlayerNickTextColor"; - } - if(BoardBigTextColor == "") { - BoardBigTextColor = getFallBackFieldContent("BoardBigTextColor", 0); - leftItems << "BoardBigTextColor"; - } - if(BoardSmallTextColor == "") { - BoardSmallTextColor = getFallBackFieldContent("BoardSmallTextColor", 0); - leftItems << "BoardSmallTextColor"; - } - if(SpeedTextColor == "") { - SpeedTextColor = getFallBackFieldContent("SpeedTextColor", 0); - leftItems << "SpeedTextColor"; - } - if(VoteButtonBgColor == "") { - VoteButtonBgColor = getFallBackFieldContent("VoteButtonBgColor", 0); - leftItems << "VoteButtonBgColor"; - } - if(VoteButtonTextColor == "") { - VoteButtonTextColor = getFallBackFieldContent("VoteButtonTextColor", 0); - leftItems << "VoteButtonTextColor"; - } - if(BetInputTextColor == "") { - BetInputTextColor = getFallBackFieldContent("BetInputTextColor", 0); - leftItems << "BetInputTextColor"; - } - if(BetInputBgColor == "") { - BetInputBgColor = getFallBackFieldContent("BetInputBgColor", 0); - leftItems << "BetInputBgColor"; - } - if(BetInputDisabledTextColor == "") { - BetInputDisabledTextColor = getFallBackFieldContent("BetInputDisabledTextColor", 0); - leftItems << "BetInputDisabledTextColor"; - } - if(BetInputDisabledBgColor == "") { - BetInputDisabledBgColor = getFallBackFieldContent("BetInputDisabledBgColor", 0); - leftItems << "BetInputDisabledBgColor"; - } - if(FoldButtonTextColor == "") { - FoldButtonTextColor = getFallBackFieldContent("FoldButtonTextColor", 0); - leftItems << "FoldButtonTextColor"; - } - if(FoldButtonCheckableTextColor == "") { - FoldButtonCheckableTextColor = getFallBackFieldContent("FoldButtonCheckableTextColor", 0); - leftItems << "FoldButtonCheckableTextColor"; - } - if(CheckCallButtonTextColor == "") { - CheckCallButtonTextColor = getFallBackFieldContent("CheckCallButtonTextColor", 0); - leftItems << "CheckCallButtonTextColor"; - } - if(CheckCallButtonCheckableTextColor == "") { - CheckCallButtonCheckableTextColor = getFallBackFieldContent("CheckCallButtonCheckableTextColor", 0); - leftItems << "CheckCallButtonCheckableTextColor"; - } - if(BetRaiseButtonTextColor == "") { - BetRaiseButtonTextColor = getFallBackFieldContent("BetRaiseButtonTextColor", 0); - leftItems << "BetRaiseButtonTextColor"; - } - if(BetRaiseButtonCheckableTextColor == "") { - BetRaiseButtonCheckableTextColor = getFallBackFieldContent("BetRaiseButtonCheckableTextColor", 0); - leftItems << "BetRaiseButtonCheckableTextColor"; - } - if(AllInButtonTextColor == "") { - AllInButtonTextColor = getFallBackFieldContent("AllInButtonTextColor", 0); - leftItems << "AllInButtonTextColor"; - } - if(AllInButtonCheckableTextColor == "") { - AllInButtonCheckableTextColor = getFallBackFieldContent("AllInButtonCheckableTextColor", 0); - leftItems << "AllInButtonCheckableTextColor"; - } - if(BetSpeedSliderGrooveBgColor == "") { - BetSpeedSliderGrooveBgColor = getFallBackFieldContent("BetSpeedSliderGrooveBgColor", 0); - leftItems << "BetSpeedSliderGrooveBgColor"; - } - if(BetSpeedSliderGrooveBorderColor == "") { - BetSpeedSliderGrooveBorderColor = getFallBackFieldContent("BetSpeedSliderGrooveBorderColor", 0); - leftItems << "BetSpeedSliderGrooveBorderColor"; - } - if(BetSpeedSliderHandleBgColor == "") { - BetSpeedSliderHandleBgColor = getFallBackFieldContent("BetSpeedSliderHandleBgColor", 0); - leftItems << "BetSpeedSliderHandleBgColor"; - } - if(BetSpeedSliderHandleBorderColor == "") { - BetSpeedSliderHandleBorderColor = getFallBackFieldContent("BetSpeedSliderHandleBorderColor", 0); - leftItems << "BetSpeedSliderHandleBorderColor"; - } - if(ShowMyCardsButtonTextColor == "") { - ShowMyCardsButtonTextColor = getFallBackFieldContent("ShowMyCardsButtonTextColor", 0); - leftItems << "ShowMyCardsButtonTextColor"; - } - if(RatingStarsColor == "") { - RatingStarsColor = getFallBackFieldContent("RatingStarsColor", 0); - leftItems << "RatingStarsColor"; - } - if(PlayerInfoHintTextColor == "") { - PlayerInfoHintTextColor = getFallBackFieldContent("PlayerInfoHintTextColor", 0); - leftItems << "PlayerInfoHintTextColor"; - } + // COLORS + if(FKeyIndicatorColor == "") { + FKeyIndicatorColor = getFallBackFieldContent("FKeyIndicatorColor", 0); + leftItems << "FKeyIndicatorColor"; + } + if(ChanceLabelPossibleColor == "") { + ChanceLabelPossibleColor = getFallBackFieldContent("ChanceLabelPossibleColor", 0); + leftItems << "ChanceLabelPossibleColor"; + } + if(ChanceLabelImpossibleColor == "") { + ChanceLabelImpossibleColor = getFallBackFieldContent("ChanceLabelImpossibleColor", 0); + leftItems << "ChanceLabelImpossibleColor"; + } + if(ChatLogTextColor == "") { + ChatLogTextColor = getFallBackFieldContent("ChatLogTextColor", 0); + leftItems << "ChatLogTextColor"; + } + if(ChatTextNickNotifyColor == "") { + ChatTextNickNotifyColor = getFallBackFieldContent("ChatTextNickNotifyColor", 0); + leftItems << "ChatTextNickNotifyColor"; + } + if(ChatLogBgColor == "") { + ChatLogBgColor = getFallBackFieldContent("ChatLogBgColor", 0); + leftItems << "ChatLogBgColor"; + } + if(ChatLogScrollBarBorderColor == "") { + ChatLogScrollBarBorderColor = getFallBackFieldContent("ChatLogScrollBarBorderColor", 0); + leftItems << "ChatLogScrollBarBorderColor"; + } + if(ChatLogScrollBarBgColor == "") { + ChatLogScrollBarBgColor = getFallBackFieldContent("ChatLogScrollBarBgColor", 0); + leftItems << "ChatLogScrollBarBgColor"; + } + if(ChatLogScrollBarHandleBorderColor == "") { + ChatLogScrollBarHandleBorderColor = getFallBackFieldContent("ChatLogScrollBarHandleBorderColor", 0); + leftItems << "ChatLogScrollBarHandleBorderColor"; + } + if(ChatLogScrollBarHandleBgColor == "") { + ChatLogScrollBarHandleBgColor = getFallBackFieldContent("ChatLogScrollBarHandleBgColor", 0); + leftItems << "ChatLogScrollBarHandleBgColor"; + } + if(ChatLogScrollBarArrowBorderColor == "") { + ChatLogScrollBarArrowBorderColor = getFallBackFieldContent("ChatLogScrollBarArrowBorderColor", 0); + leftItems << "ChatLogScrollBarArrowBorderColor"; + } + if(ChatLogScrollBarArrowBgColor == "") { + ChatLogScrollBarArrowBgColor = getFallBackFieldContent("ChatLogScrollBarArrowBgColor", 0); + leftItems << "ChatLogScrollBarArrowBgColor"; + } + if(LogWinnerMainPotColor == "") { + LogWinnerMainPotColor = getFallBackFieldContent("LogWinnerMainPotColor", 0); + leftItems << "LogWinnerMainPotColor"; + } + if(LogWinnerSidePotColor == "") { + LogWinnerSidePotColor = getFallBackFieldContent("LogWinnerSidePotColor", 0); + leftItems << "LogWinnerSidePotColor"; + } + if(LogPlayerSitsOutColor == "") { + LogPlayerSitsOutColor = getFallBackFieldContent("LogPlayerSitsOutColor", 0); + leftItems << "LogPlayerSitsOutColor"; + } + if(LogNewGameAdminColor == "") { + LogNewGameAdminColor = getFallBackFieldContent("LogNewGameAdminColor", 0); + leftItems << "LogNewGameAdminColor"; + } + if(TabWidgetBorderColor == "") { + TabWidgetBorderColor = getFallBackFieldContent("TabWidgetBorderColor", 0); + leftItems << "TabWidgetBorderColor"; + } + if(TabWidgetBgColor == "") { + TabWidgetBgColor = getFallBackFieldContent("TabWidgetBgColor", 0); + leftItems << "TabWidgetBgColor"; + } + if(TabWidgetTextColor == "") { + TabWidgetTextColor = getFallBackFieldContent("TabWidgetTextColor", 0); + leftItems << "TabWidgetTextColor"; + } + if(MenuBgColor == "") { + MenuBgColor = getFallBackFieldContent("MenuBgColor", 0); + leftItems << "MenuBgColor"; + } + if(MenuTextColor == "") { + MenuTextColor = getFallBackFieldContent("MenuTextColor", 0); + leftItems << "MenuTextColor"; + } + if(BreakLobbyButtonBgColor == "") { + BreakLobbyButtonBgColor = getFallBackFieldContent("BreakLobbyButtonBgColor", 0); + leftItems << "BreakLobbyButtonBgColor"; + } + if(BreakLobbyButtonTextColor == "") { + BreakLobbyButtonTextColor = getFallBackFieldContent("BreakLobbyButtonTextColor", 0); + leftItems << "BreakLobbyButtonTextColor"; + } + if(BreakLobbyButtonBgDisabledColor == "") { + BreakLobbyButtonBgDisabledColor = getFallBackFieldContent("BreakLobbyButtonBgDisabledColor", 0); + leftItems << "BreakLobbyButtonBgDisabledColor"; + } + if(BreakLobbyButtonTextDisabledColor == "") { + BreakLobbyButtonTextDisabledColor = getFallBackFieldContent("BreakLobbyButtonTextDisabledColor", 0); + leftItems << "BreakLobbyButtonTextDisabledColor"; + } + if(BreakLobbyButtonBgBlinkColor == "") { + BreakLobbyButtonBgBlinkColor = getFallBackFieldContent("BreakLobbyButtonBgBlinkColor", 0); + leftItems << "BreakLobbyButtonBgBlinkColor"; + } + if(BreakLobbyButtonTextBlinkColor == "") { + BreakLobbyButtonTextBlinkColor = getFallBackFieldContent("BreakLobbyButtonTextBlinkColor", 0); + leftItems << "BreakLobbyButtonTextBlinkColor"; + } + if(PlayerCashTextColor == "") { + PlayerCashTextColor = getFallBackFieldContent("PlayerCashTextColor", 0); + leftItems << "PlayerCashTextColor"; + } + if(PlayerBetTextColor == "") { + PlayerBetTextColor = getFallBackFieldContent("PlayerBetTextColor", 0); + leftItems << "PlayerBetTextColor"; + } + if(PlayerNickTextColor == "") { + PlayerNickTextColor = getFallBackFieldContent("PlayerNickTextColor", 0); + leftItems << "PlayerNickTextColor"; + } + if(BoardBigTextColor == "") { + BoardBigTextColor = getFallBackFieldContent("BoardBigTextColor", 0); + leftItems << "BoardBigTextColor"; + } + if(BoardSmallTextColor == "") { + BoardSmallTextColor = getFallBackFieldContent("BoardSmallTextColor", 0); + leftItems << "BoardSmallTextColor"; + } + if(SpeedTextColor == "") { + SpeedTextColor = getFallBackFieldContent("SpeedTextColor", 0); + leftItems << "SpeedTextColor"; + } + if(VoteButtonBgColor == "") { + VoteButtonBgColor = getFallBackFieldContent("VoteButtonBgColor", 0); + leftItems << "VoteButtonBgColor"; + } + if(VoteButtonTextColor == "") { + VoteButtonTextColor = getFallBackFieldContent("VoteButtonTextColor", 0); + leftItems << "VoteButtonTextColor"; + } + if(BetInputTextColor == "") { + BetInputTextColor = getFallBackFieldContent("BetInputTextColor", 0); + leftItems << "BetInputTextColor"; + } + if(BetInputBgColor == "") { + BetInputBgColor = getFallBackFieldContent("BetInputBgColor", 0); + leftItems << "BetInputBgColor"; + } + if(BetInputDisabledTextColor == "") { + BetInputDisabledTextColor = getFallBackFieldContent("BetInputDisabledTextColor", 0); + leftItems << "BetInputDisabledTextColor"; + } + if(BetInputDisabledBgColor == "") { + BetInputDisabledBgColor = getFallBackFieldContent("BetInputDisabledBgColor", 0); + leftItems << "BetInputDisabledBgColor"; + } + if(FoldButtonTextColor == "") { + FoldButtonTextColor = getFallBackFieldContent("FoldButtonTextColor", 0); + leftItems << "FoldButtonTextColor"; + } + if(FoldButtonCheckableTextColor == "") { + FoldButtonCheckableTextColor = getFallBackFieldContent("FoldButtonCheckableTextColor", 0); + leftItems << "FoldButtonCheckableTextColor"; + } + if(CheckCallButtonTextColor == "") { + CheckCallButtonTextColor = getFallBackFieldContent("CheckCallButtonTextColor", 0); + leftItems << "CheckCallButtonTextColor"; + } + if(CheckCallButtonCheckableTextColor == "") { + CheckCallButtonCheckableTextColor = getFallBackFieldContent("CheckCallButtonCheckableTextColor", 0); + leftItems << "CheckCallButtonCheckableTextColor"; + } + if(BetRaiseButtonTextColor == "") { + BetRaiseButtonTextColor = getFallBackFieldContent("BetRaiseButtonTextColor", 0); + leftItems << "BetRaiseButtonTextColor"; + } + if(BetRaiseButtonCheckableTextColor == "") { + BetRaiseButtonCheckableTextColor = getFallBackFieldContent("BetRaiseButtonCheckableTextColor", 0); + leftItems << "BetRaiseButtonCheckableTextColor"; + } + if(AllInButtonTextColor == "") { + AllInButtonTextColor = getFallBackFieldContent("AllInButtonTextColor", 0); + leftItems << "AllInButtonTextColor"; + } + if(AllInButtonCheckableTextColor == "") { + AllInButtonCheckableTextColor = getFallBackFieldContent("AllInButtonCheckableTextColor", 0); + leftItems << "AllInButtonCheckableTextColor"; + } + if(BetSpeedSliderGrooveBgColor == "") { + BetSpeedSliderGrooveBgColor = getFallBackFieldContent("BetSpeedSliderGrooveBgColor", 0); + leftItems << "BetSpeedSliderGrooveBgColor"; + } + if(BetSpeedSliderGrooveBorderColor == "") { + BetSpeedSliderGrooveBorderColor = getFallBackFieldContent("BetSpeedSliderGrooveBorderColor", 0); + leftItems << "BetSpeedSliderGrooveBorderColor"; + } + if(BetSpeedSliderHandleBgColor == "") { + BetSpeedSliderHandleBgColor = getFallBackFieldContent("BetSpeedSliderHandleBgColor", 0); + leftItems << "BetSpeedSliderHandleBgColor"; + } + if(BetSpeedSliderHandleBorderColor == "") { + BetSpeedSliderHandleBorderColor = getFallBackFieldContent("BetSpeedSliderHandleBorderColor", 0); + leftItems << "BetSpeedSliderHandleBorderColor"; + } + if(ShowMyCardsButtonTextColor == "") { + ShowMyCardsButtonTextColor = getFallBackFieldContent("ShowMyCardsButtonTextColor", 0); + leftItems << "ShowMyCardsButtonTextColor"; + } + if(RatingStarsColor == "") { + RatingStarsColor = getFallBackFieldContent("RatingStarsColor", 0); + leftItems << "RatingStarsColor"; + } + if(PlayerInfoHintTextColor == "") { + PlayerInfoHintTextColor = getFallBackFieldContent("PlayerInfoHintTextColor", 0); + leftItems << "PlayerInfoHintTextColor"; + } - // SIZE - if(ChatLogTextSize == "") { - ChatLogTextSize = getFallBackFieldContent("ChatLogTextSize", 0); - leftItems << "ChatLogTextSize"; - } + // SIZE + if(ChatLogTextSize == "") { + ChatLogTextSize = getFallBackFieldContent("ChatLogTextSize", 0); + leftItems << "ChatLogTextSize"; + } - //set loadedSuccessfull TRUE if everything works - // qDebug() << "leftitem is empty: " << leftItems.isEmpty() << "pics left is empty: " << itemPicsLeft.isEmpty() << "stylefileversion is: " << PokerTHStyleFileVersion; - if(leftItems.isEmpty() && itemPicsLeft.isEmpty() && PokerTHStyleFileVersion != "" && PokerTHStyleFileVersion.toInt() == POKERTH_GT_STYLE_FILE_VERSION) { - myState = GT_STYLE_OK; - // qDebug() << "myState of: " << StyleDescription << "is now: " << myState; - } else { - //check for style file version - if(PokerTHStyleFileVersion != "" && PokerTHStyleFileVersion.toInt() != POKERTH_GT_STYLE_FILE_VERSION) { - myState = GT_STYLE_OUTDATED; - } else { - //if one or more items are left - if(!leftItems.isEmpty() && myW != 0) myState = GT_STYLE_FIELDS_EMPTY; + //set loadedSuccessfull TRUE if everything works + // qDebug() << "leftitem is empty: " << leftItems.isEmpty() << "pics left is empty: " << itemPicsLeft.isEmpty() << "stylefileversion is: " << PokerTHStyleFileVersion; + if(leftItems.isEmpty() && itemPicsLeft.isEmpty() && PokerTHStyleFileVersion != "" && PokerTHStyleFileVersion.toInt() == POKERTH_GT_STYLE_FILE_VERSION) { + myState = GT_STYLE_OK; + // qDebug() << "myState of: " << StyleDescription << "is now: " << myState; + } else { + //check for style file version + if(PokerTHStyleFileVersion != "" && PokerTHStyleFileVersion.toInt() != POKERTH_GT_STYLE_FILE_VERSION) { + myState = GT_STYLE_OUTDATED; + } else { + //if one or more items are left + if(!leftItems.isEmpty() && myW != 0) myState = GT_STYLE_FIELDS_EMPTY; - //if one or more pictures where not found - if(!itemPicsLeft.isEmpty() && myW != 0) myState = GT_STYLE_PICTURES_MISSING; - } + //if one or more pictures where not found + if(!itemPicsLeft.isEmpty() && myW != 0) myState = GT_STYLE_PICTURES_MISSING; + } - // qDebug() << "myState of: " << StyleDescription << "is now: " << myState; - } - loadedSuccessfull = 1; - } - } - else { - loadedSuccessfull = 0; - MyMessageBox::warning(myW, tr("Game Table Style Error"), - tr("Cannot load game table style file: %1 \n\nPlease check the style file or choose another style!").arg(currentFileName), - QMessageBox::Ok); - } + // qDebug() << "myState of: " << StyleDescription << "is now: " << myState; + } + loadedSuccessfull = 1; + } + } else { + loadedSuccessfull = 0; + MyMessageBox::warning(myW, tr("Game Table Style Error"), + tr("Cannot load game table style file: %1 \n\nPlease check the style file or choose another style!").arg(currentFileName), + QMessageBox::Ok); + } } void GameTableStyleReader::showErrorMessage() { - switch (myState) { - case GT_STYLE_PICTURES_MISSING: - showItemPicsLeftErrorMessage(); - break; - case GT_STYLE_FIELDS_EMPTY: - showLeftItemsErrorMessage(); - break; - case GT_STYLE_OUTDATED: - showOutdatedErrorMessage(); - break; - default: - ; - } + switch (myState) { + case GT_STYLE_PICTURES_MISSING: + showItemPicsLeftErrorMessage(); + break; + case GT_STYLE_FIELDS_EMPTY: + showLeftItemsErrorMessage(); + break; + case GT_STYLE_OUTDATED: + showOutdatedErrorMessage(); + break; + default: + ; + } } void GameTableStyleReader::showLeftItemsErrorMessage() { - QString items = leftItems.join("\n"); - QString EMail; - if(StyleMaintainerEMail != "NULL") EMail = StyleMaintainerEMail; + QString items = leftItems.join("\n"); + QString EMail; + if(StyleMaintainerEMail != "NULL") EMail = StyleMaintainerEMail; - myMessageDialogImpl dialog(myConfig, myW); + myMessageDialogImpl dialog(myConfig, myW); - if(dialog.checkIfMesssageWillBeDisplayed(GT_VALUES_MISSING)) { - dialog.exec(GT_VALUES_MISSING, tr("Selected game table style \"%1\" seems to be incomplete or defective. \n\nThe value(s) of: \n%2 \nis/are missing. \n\nAnyway you can play with this style, because the missing content will be filled up by PokerTH default style. \n\nPlease contact the game table style builder via \"%3\".").arg(StyleDescription).arg(items).arg(EMail), tr("Game Table Style Error - Fields content missing"), QPixmap(":/gfx/emblem-important-64.png"), QDialogButtonBox::Ok, true); - } + if(dialog.checkIfMesssageWillBeDisplayed(GT_VALUES_MISSING)) { + dialog.exec(GT_VALUES_MISSING, tr("Selected game table style \"%1\" seems to be incomplete or defective. \n\nThe value(s) of: \n%2 \nis/are missing. \n\nAnyway you can play with this style, because the missing content will be filled up by PokerTH default style. \n\nPlease contact the game table style builder via \"%3\".").arg(StyleDescription).arg(items).arg(EMail), tr("Game Table Style Error - Fields content missing"), QPixmap(":/gfx/emblem-important-64.png"), QDialogButtonBox::Ok, true); + } } void GameTableStyleReader::showItemPicsLeftErrorMessage() { - QString pics = itemPicsLeft.join("\n"); - QString EMail; - if(StyleMaintainerEMail != "NULL") EMail = StyleMaintainerEMail; + QString pics = itemPicsLeft.join("\n"); + QString EMail; + if(StyleMaintainerEMail != "NULL") EMail = StyleMaintainerEMail; - myMessageDialogImpl dialog(myConfig, myW); + myMessageDialogImpl dialog(myConfig, myW); - if(dialog.checkIfMesssageWillBeDisplayed(GT_PICS_MISSING)) { - dialog.exec(GT_PICS_MISSING, tr("One or more pictures from current game table style \"%1\" were not found: \n\n%2 \n\nAnyway you can play with this style, because the missing content will be filled up by PokerTH default style. \n\nPlease contact the game table style builder via \"%3\".").arg(StyleDescription).arg(pics).arg(EMail), tr("Game Table Style Error - Pictures missing"), QPixmap(":/gfx/emblem-important-64.png"), QDialogButtonBox::Ok, true); - } + if(dialog.checkIfMesssageWillBeDisplayed(GT_PICS_MISSING)) { + dialog.exec(GT_PICS_MISSING, tr("One or more pictures from current game table style \"%1\" were not found: \n\n%2 \n\nAnyway you can play with this style, because the missing content will be filled up by PokerTH default style. \n\nPlease contact the game table style builder via \"%3\".").arg(StyleDescription).arg(pics).arg(EMail), tr("Game Table Style Error - Pictures missing"), QPixmap(":/gfx/emblem-important-64.png"), QDialogButtonBox::Ok, true); + } } void GameTableStyleReader::showOutdatedErrorMessage() { - QString EMail; - if(StyleMaintainerEMail != "NULL") EMail = StyleMaintainerEMail; + QString EMail; + if(StyleMaintainerEMail != "NULL") EMail = StyleMaintainerEMail; - myMessageDialogImpl dialog(myConfig, myW); + myMessageDialogImpl dialog(myConfig, myW); - if(dialog.checkIfMesssageWillBeDisplayed(GT_OUTDATED)) { - dialog.exec(GT_OUTDATED, tr("Selected game table style \"%1\" seems to be outdated. \nThe current PokerTH game table style version is \"%2\", but this style has version \"%3\" set. \n\nAnyway you can play with this style, because the missing content will be filled up by PokerTH default style. \n\nPlease contact the game table style builder via \"%4\".").arg(StyleDescription).arg(POKERTH_GT_STYLE_FILE_VERSION).arg(PokerTHStyleFileVersion).arg(EMail), tr("Game Table Style Error - Outdated"), QPixmap(":/gfx/emblem-important-64.png"), QDialogButtonBox::Ok, true); - } + if(dialog.checkIfMesssageWillBeDisplayed(GT_OUTDATED)) { + dialog.exec(GT_OUTDATED, tr("Selected game table style \"%1\" seems to be outdated. \nThe current PokerTH game table style version is \"%2\", but this style has version \"%3\" set. \n\nAnyway you can play with this style, because the missing content will be filled up by PokerTH default style. \n\nPlease contact the game table style builder via \"%4\".").arg(StyleDescription).arg(POKERTH_GT_STYLE_FILE_VERSION).arg(PokerTHStyleFileVersion).arg(EMail), tr("Game Table Style Error - Outdated"), QPixmap(":/gfx/emblem-important-64.png"), QDialogButtonBox::Ok, true); + } } void GameTableStyleReader::setTableBackground(gameTableImpl *gt) { - gt->setStyleSheet("QMainWindow { background-image: url(\""+Table+"\"); background-position: bottom center; background-origin: content; background-repeat: no-repeat;}"); + gt->setStyleSheet("QMainWindow { background-image: url(\""+Table+"\"); background-position: bottom center; background-origin: content; background-repeat: no-repeat;}"); } void GameTableStyleReader::setChatLogStyle(QTextBrowser *tb) { #ifdef GUI_800x480 - //make the scrollbar touchable for mobile guis - tb->setStyleSheet("QTextBrowser { "+ font1String +" font-size: "+ChatLogTextSize+"px; color: #"+ChatLogTextColor+"; background-color: #"+ChatLogBgColor+"; border:none; } QScrollBar:vertical { border: 1px solid #"+ChatLogScrollBarBorderColor+"; background: #"+ChatLogScrollBarBgColor+"; width: 60px; margin: 0px -1px 0px 0px; } QScrollBar::handle:vertical { border-radius: 4px; border: 3px solid #"+ChatLogScrollBarHandleBorderColor+"; background: #"+ChatLogScrollBarHandleBgColor+"; min-height: 60px; } QScrollBar::add-line:vertical, QScrollBar::sub-line:vertical, QScrollBar:up-arrow:vertical, QScrollBar::down-arrow:vertical, QScrollBar::add-page:vertical, QScrollBar::sub-page:vertical { background: none; }"); + //make the scrollbar touchable for mobile guis + tb->setStyleSheet("QTextBrowser { "+ font1String +" font-size: "+ChatLogTextSize+"px; color: #"+ChatLogTextColor+"; background-color: #"+ChatLogBgColor+"; border:none; } QScrollBar:vertical { border: 1px solid #"+ChatLogScrollBarBorderColor+"; background: #"+ChatLogScrollBarBgColor+"; width: 60px; margin: 0px -1px 0px 0px; } QScrollBar::handle:vertical { border-radius: 4px; border: 3px solid #"+ChatLogScrollBarHandleBorderColor+"; background: #"+ChatLogScrollBarHandleBgColor+"; min-height: 60px; } QScrollBar::add-line:vertical, QScrollBar::sub-line:vertical, QScrollBar:up-arrow:vertical, QScrollBar::down-arrow:vertical, QScrollBar::add-page:vertical, QScrollBar::sub-page:vertical { background: none; }"); #else - tb->setStyleSheet("QTextBrowser { "+ font1String +" font-size: "+ChatLogTextSize+"px; color: #"+ChatLogTextColor+"; background-color: #"+ChatLogBgColor+"; border:none; } QScrollBar:vertical { border: 1px solid #"+ChatLogScrollBarBorderColor+"; background: #"+ChatLogScrollBarBgColor+"; width: 15px; margin: 17px -1px 17px 0px; } QScrollBar::handle:vertical { border-radius: 1px; border: 1px solid #"+ChatLogScrollBarHandleBorderColor+"; background: #"+ChatLogScrollBarHandleBgColor+"; min-height: 20px; } QScrollBar::add-line:vertical { margin-right: 0px; margin-left: 1px; border-bottom-right-radius: 2px; border-bottom-left-radius: 2px; border-top-right-radius: 1px; border-top-left-radius: 1px; border: 1px solid #"+ChatLogScrollBarHandleBorderColor+"; background: #"+ChatLogScrollBarHandleBgColor+"; height: 15px; subcontrol-position: bottom; subcontrol-origin: margin; } QScrollBar::sub-line:vertical { margin-right: 0px; margin-left: 1px; border-bottom-right-radius: 1px; border-bottom-left-radius: 1px; border-top-right-radius: 2px; border-top-left-radius: 2px; border: 1px solid #"+ChatLogScrollBarHandleBorderColor+"; background: #"+ChatLogScrollBarHandleBgColor+"; height: 15px; subcontrol-position: top; subcontrol-origin: margin; } QScrollBar:up-arrow:vertical, QScrollBar::down-arrow:vertical { border: 1px solid #"+ChatLogScrollBarArrowBorderColor+"; height: 3px; width: 3px; background: #"+ChatLogScrollBarArrowBgColor+"; } QScrollBar::add-page:vertical, QScrollBar::sub-page:vertical { background: none; }"); + tb->setStyleSheet("QTextBrowser { "+ font1String +" font-size: "+ChatLogTextSize+"px; color: #"+ChatLogTextColor+"; background-color: #"+ChatLogBgColor+"; border:none; } QScrollBar:vertical { border: 1px solid #"+ChatLogScrollBarBorderColor+"; background: #"+ChatLogScrollBarBgColor+"; width: 15px; margin: 17px -1px 17px 0px; } QScrollBar::handle:vertical { border-radius: 1px; border: 1px solid #"+ChatLogScrollBarHandleBorderColor+"; background: #"+ChatLogScrollBarHandleBgColor+"; min-height: 20px; } QScrollBar::add-line:vertical { margin-right: 0px; margin-left: 1px; border-bottom-right-radius: 2px; border-bottom-left-radius: 2px; border-top-right-radius: 1px; border-top-left-radius: 1px; border: 1px solid #"+ChatLogScrollBarHandleBorderColor+"; background: #"+ChatLogScrollBarHandleBgColor+"; height: 15px; subcontrol-position: bottom; subcontrol-origin: margin; } QScrollBar::sub-line:vertical { margin-right: 0px; margin-left: 1px; border-bottom-right-radius: 1px; border-bottom-left-radius: 1px; border-top-right-radius: 2px; border-top-left-radius: 2px; border: 1px solid #"+ChatLogScrollBarHandleBorderColor+"; background: #"+ChatLogScrollBarHandleBgColor+"; height: 15px; subcontrol-position: top; subcontrol-origin: margin; } QScrollBar:up-arrow:vertical, QScrollBar::down-arrow:vertical { border: 1px solid #"+ChatLogScrollBarArrowBorderColor+"; height: 3px; width: 3px; background: #"+ChatLogScrollBarArrowBgColor+"; } QScrollBar::add-page:vertical, QScrollBar::sub-page:vertical { background: none; }"); #endif } void GameTableStyleReader::setChatLogStyle(QPlainTextEdit* pte) { #ifdef GUI_800x480 - //make the scrollbar touchable for mobile guis - pte->setStyleSheet("QPlainTextEdit { "+ font1String +" font-size: "+ChatLogTextSize+"px; color: #"+ChatLogTextColor+"; background-color: #"+ChatLogBgColor+"; border:none; } QScrollBar:vertical { border: 1px solid #"+ChatLogScrollBarBorderColor+"; background: #"+ChatLogScrollBarBgColor+"; width: 60px; margin: 0px -1px 0px 0px; } QScrollBar::handle:vertical { border-radius: 4px; border: 3px solid #"+ChatLogScrollBarHandleBorderColor+"; background: #"+ChatLogScrollBarHandleBgColor+"; min-height: 60px; } QScrollBar::add-line:vertical, QScrollBar::sub-line:vertical, QScrollBar:up-arrow:vertical, QScrollBar::down-arrow:vertical, QScrollBar::add-page:vertical, QScrollBar::sub-page:vertical { background: none; }"); + //make the scrollbar touchable for mobile guis + pte->setStyleSheet("QPlainTextEdit { "+ font1String +" font-size: "+ChatLogTextSize+"px; color: #"+ChatLogTextColor+"; background-color: #"+ChatLogBgColor+"; border:none; } QScrollBar:vertical { border: 1px solid #"+ChatLogScrollBarBorderColor+"; background: #"+ChatLogScrollBarBgColor+"; width: 60px; margin: 0px -1px 0px 0px; } QScrollBar::handle:vertical { border-radius: 4px; border: 3px solid #"+ChatLogScrollBarHandleBorderColor+"; background: #"+ChatLogScrollBarHandleBgColor+"; min-height: 60px; } QScrollBar::add-line:vertical, QScrollBar::sub-line:vertical, QScrollBar:up-arrow:vertical, QScrollBar::down-arrow:vertical, QScrollBar::add-page:vertical, QScrollBar::sub-page:vertical { background: none; }"); #else - pte->setStyleSheet("QPlainTextEdit { "+ font1String +" font-size: "+ChatLogTextSize+"px; color: #"+ChatLogTextColor+"; background-color: #"+ChatLogBgColor+"; border:none; } QScrollBar:vertical { border: 1px solid #"+ChatLogScrollBarBorderColor+"; background: #"+ChatLogScrollBarBgColor+"; width: 15px; margin: 17px -1px 17px 0px; } QScrollBar::handle:vertical { border-radius: 1px; border: 1px solid #"+ChatLogScrollBarHandleBorderColor+"; background: #"+ChatLogScrollBarHandleBgColor+"; min-height: 20px; } QScrollBar::add-line:vertical { margin-right: 0px; margin-left: 1px; border-bottom-right-radius: 2px; border-bottom-left-radius: 2px; border-top-right-radius: 1px; border-top-left-radius: 1px; border: 1px solid #"+ChatLogScrollBarHandleBorderColor+"; background: #"+ChatLogScrollBarHandleBgColor+"; height: 15px; subcontrol-position: bottom; subcontrol-origin: margin; } QScrollBar::sub-line:vertical { margin-right: 0px; margin-left: 1px; border-bottom-right-radius: 1px; border-bottom-left-radius: 1px; border-top-right-radius: 2px; border-top-left-radius: 2px; border: 1px solid #"+ChatLogScrollBarHandleBorderColor+"; background: #"+ChatLogScrollBarHandleBgColor+"; height: 15px; subcontrol-position: top; subcontrol-origin: margin; } QScrollBar:up-arrow:vertical, QScrollBar::down-arrow:vertical { border: 1px solid #"+ChatLogScrollBarArrowBorderColor+"; height: 3px; width: 3px; background: #"+ChatLogScrollBarArrowBgColor+"; } QScrollBar::add-page:vertical, QScrollBar::sub-page:vertical { background: none; }"); + pte->setStyleSheet("QPlainTextEdit { "+ font1String +" font-size: "+ChatLogTextSize+"px; color: #"+ChatLogTextColor+"; background-color: #"+ChatLogBgColor+"; border:none; } QScrollBar:vertical { border: 1px solid #"+ChatLogScrollBarBorderColor+"; background: #"+ChatLogScrollBarBgColor+"; width: 15px; margin: 17px -1px 17px 0px; } QScrollBar::handle:vertical { border-radius: 1px; border: 1px solid #"+ChatLogScrollBarHandleBorderColor+"; background: #"+ChatLogScrollBarHandleBgColor+"; min-height: 20px; } QScrollBar::add-line:vertical { margin-right: 0px; margin-left: 1px; border-bottom-right-radius: 2px; border-bottom-left-radius: 2px; border-top-right-radius: 1px; border-top-left-radius: 1px; border: 1px solid #"+ChatLogScrollBarHandleBorderColor+"; background: #"+ChatLogScrollBarHandleBgColor+"; height: 15px; subcontrol-position: bottom; subcontrol-origin: margin; } QScrollBar::sub-line:vertical { margin-right: 0px; margin-left: 1px; border-bottom-right-radius: 1px; border-bottom-left-radius: 1px; border-top-right-radius: 2px; border-top-left-radius: 2px; border: 1px solid #"+ChatLogScrollBarHandleBorderColor+"; background: #"+ChatLogScrollBarHandleBgColor+"; height: 15px; subcontrol-position: top; subcontrol-origin: margin; } QScrollBar:up-arrow:vertical, QScrollBar::down-arrow:vertical { border: 1px solid #"+ChatLogScrollBarArrowBorderColor+"; height: 3px; width: 3px; background: #"+ChatLogScrollBarArrowBgColor+"; } QScrollBar::add-page:vertical, QScrollBar::sub-page:vertical { background: none; }"); #endif } void GameTableStyleReader::setChatInputStyle(QLineEdit *ci) { - QString myFontSize; + QString myFontSize; #ifdef GUI_800x480 - myFontSize="28"; + myFontSize="28"; #else - myFontSize=ChatLogTextSize; + myFontSize=ChatLogTextSize; #endif - ci->setStyleSheet("QLineEdit { "+ font1String +" font-size: "+myFontSize+"px; color: #"+ChatLogTextColor+"; background-color: #"+ChatLogBgColor+"; border-top: 2px solid #"+TabWidgetBorderColor+"; }"); + ci->setStyleSheet("QLineEdit { "+ font1String +" font-size: "+myFontSize+"px; color: #"+ChatLogTextColor+"; background-color: #"+ChatLogBgColor+"; border-top: 2px solid #"+TabWidgetBorderColor+"; }"); } void GameTableStyleReader::setCashLabelStyle(QLabel *cl) { - cl->setStyleSheet("QLabel { "+ font2String +" font-size: "+cashFontSize+"px; font-weight: bold; color: #"+PlayerCashTextColor+"; }"); + cl->setStyleSheet("QLabel { "+ font2String +" font-size: "+cashFontSize+"px; font-weight: bold; color: #"+PlayerCashTextColor+"; }"); } void GameTableStyleReader::setSetLabelStyle(QLabel *sl) { - sl->setStyleSheet("QLabel { "+ font2String +" font-size: "+setLabelFontSize+"px; font-weight: bold; color: #"+PlayerBetTextColor+"; }"); + sl->setStyleSheet("QLabel { "+ font2String +" font-size: "+setLabelFontSize+"px; font-weight: bold; color: #"+PlayerBetTextColor+"; }"); } void GameTableStyleReader::setPlayerNameLabelStyle(QLabel *pnl) { - pnl->setStyleSheet("QLabel { "+ font2String +" font-size: "+playerNameLabelFontSize+"px; font-weight: bold; color: #"+PlayerNickTextColor+"; }"); + pnl->setStyleSheet("QLabel { "+ font2String +" font-size: "+playerNameLabelFontSize+"px; font-weight: bold; color: #"+PlayerNickTextColor+"; }"); } void GameTableStyleReader::setSmallFontBoardStyle(QLabel *l) { - l->setStyleSheet("QLabel { "+ font2String +" font-size: "+smallBoardFontSize+"px; font-weight: bold; color: #"+BoardSmallTextColor+"; }"); + l->setStyleSheet("QLabel { "+ font2String +" font-size: "+smallBoardFontSize+"px; font-weight: bold; color: #"+BoardSmallTextColor+"; }"); } void GameTableStyleReader::setBigFontBoardStyle(QLabel *l) { - l->setStyleSheet("QLabel { "+ font2String +" font-size: "+bigBoardFontSize+"px; font-weight: bold; color: #"+BoardBigTextColor+"; }"); + l->setStyleSheet("QLabel { "+ font2String +" font-size: "+bigBoardFontSize+"px; font-weight: bold; color: #"+BoardBigTextColor+"; }"); } void GameTableStyleReader::setCardHolderStyle(QLabel *l, int bero) { - switch(bero) { - case 0: - l->setPixmap(CardHolderFlop); - break; - case 1: - l->setPixmap(CardHolderTurn); - break; - case 2: - l->setPixmap(CardHolderRiver); - break; - } + switch(bero) { + case 0: + l->setPixmap(CardHolderFlop); + break; + case 1: + l->setPixmap(CardHolderTurn); + break; + case 2: + l->setPixmap(CardHolderRiver); + break; + } } void GameTableStyleReader::setMenuBarStyle(QMenuBar *mb) { - mb->setStyleSheet("QMenuBar { background-color: #"+MenuBgColor+"; font-size:12px; border-width: 0px;} QMenuBar::item { color: #"+MenuTextColor+"; }"); + mb->setStyleSheet("QMenuBar { background-color: #"+MenuBgColor+"; font-size:12px; border-width: 0px;} QMenuBar::item { color: #"+MenuTextColor+"; }"); } void GameTableStyleReader::setBreakButtonStyle(QPushButton *bb, int state) { - switch(state) { - // default - case 0: + switch(state) { + // default + case 0: #ifdef GUI_800x480 - bb->setStyleSheet("QPushButton:enabled { padding: 10px; background-color: #"+BreakLobbyButtonBgColor+"; color: #"+BreakLobbyButtonTextColor+"; font-size: 26px} QPushButton:disabled { padding: 10px; background-color: #"+BreakLobbyButtonBgDisabledColor+"; color: #"+BreakLobbyButtonTextDisabledColor+"; font-weight: 900; font-size: 26px}"); + bb->setStyleSheet("QPushButton:enabled { padding: 10px; background-color: #"+BreakLobbyButtonBgColor+"; color: #"+BreakLobbyButtonTextColor+"; font-size: 26px} QPushButton:disabled { padding: 10px; background-color: #"+BreakLobbyButtonBgDisabledColor+"; color: #"+BreakLobbyButtonTextDisabledColor+"; font-weight: 900; font-size: 26px}"); #else - bb->setStyleSheet("QPushButton:enabled { background-color: #"+BreakLobbyButtonBgColor+"; color: #"+BreakLobbyButtonTextColor+";} QPushButton:disabled { background-color: #"+BreakLobbyButtonBgDisabledColor+"; color: #"+BreakLobbyButtonTextDisabledColor+"; font-weight: 900;}"); + bb->setStyleSheet("QPushButton:enabled { background-color: #"+BreakLobbyButtonBgColor+"; color: #"+BreakLobbyButtonTextColor+";} QPushButton:disabled { background-color: #"+BreakLobbyButtonBgDisabledColor+"; color: #"+BreakLobbyButtonTextDisabledColor+"; font-weight: 900;}"); #endif - break; - // blink - case 1: + break; + // blink + case 1: #ifdef GUI_800x480 - bb->setStyleSheet("QPushButton { padding: 10px; background-color: #"+BreakLobbyButtonBgBlinkColor+"; color: "+BreakLobbyButtonTextBlinkColor+"; font-size: 26px}"); + bb->setStyleSheet("QPushButton { padding: 10px; background-color: #"+BreakLobbyButtonBgBlinkColor+"; color: "+BreakLobbyButtonTextBlinkColor+"; font-size: 26px}"); #else - bb->setStyleSheet("QPushButton { background-color: #"+BreakLobbyButtonBgBlinkColor+"; color: "+BreakLobbyButtonTextBlinkColor+";}"); + bb->setStyleSheet("QPushButton { background-color: #"+BreakLobbyButtonBgBlinkColor+"; color: "+BreakLobbyButtonTextBlinkColor+";}"); #endif - break; - } + break; + } } void GameTableStyleReader::setSpeedStringStyle(QLabel *l) { #ifdef GUI_800x480 - l->setStyleSheet("QLabel { color: #"+SpeedTextColor+"; font-size: 24px}"); + l->setStyleSheet("QLabel { color: #"+SpeedTextColor+"; font-size: 24px}"); #else - l->setStyleSheet("QLabel { color: #"+SpeedTextColor+";}"); + l->setStyleSheet("QLabel { color: #"+SpeedTextColor+";}"); #endif } void GameTableStyleReader::setVoteButtonStyle(QPushButton *b) { - b->setStyleSheet("QPushButton:enabled { background-color: #"+VoteButtonBgColor+"; color: #"+VoteButtonTextColor+";} "); + b->setStyleSheet("QPushButton:enabled { background-color: #"+VoteButtonBgColor+"; color: #"+VoteButtonTextColor+";} "); } void GameTableStyleReader::setVoteStringsStyle(QLabel *l) { - l->setStyleSheet("QLabel { color: #"+TabWidgetTextColor+"; font-size: 11px;}"); + l->setStyleSheet("QLabel { color: #"+TabWidgetTextColor+"; font-size: 11px;}"); } void GameTableStyleReader::setPlayerSeatInactiveStyle(QGroupBox *ps) { - // check if seat is on top or bottom line - if(ps->objectName() == "groupBox2" || ps->objectName() == "groupBox1" || ps->objectName() == "groupBox0" || ps->objectName() == "groupBox9" || ps->objectName() == "groupBox8") { - ps->setStyleSheet("QGroupBox { border:none; background-image: url(\""+PlayerBottomSeatInactive+"\") }"); - } else { - ps->setStyleSheet("QGroupBox { border:none; background-image: url(\""+PlayerTopSeatInactive+"\") }"); - } + // check if seat is on top or bottom line + if(ps->objectName() == "groupBox2" || ps->objectName() == "groupBox1" || ps->objectName() == "groupBox0" || ps->objectName() == "groupBox9" || ps->objectName() == "groupBox8") { + ps->setStyleSheet("QGroupBox { border:none; background-image: url(\""+PlayerBottomSeatInactive+"\") }"); + } else { + ps->setStyleSheet("QGroupBox { border:none; background-image: url(\""+PlayerTopSeatInactive+"\") }"); + } } void GameTableStyleReader::setPlayerSeatActiveStyle(QGroupBox *ps) { - // check if seat is on top or bottom line - if(ps->objectName() == "groupBox2" || ps->objectName() == "groupBox1" || ps->objectName() == "groupBox0" || ps->objectName() == "groupBox9" || ps->objectName() == "groupBox8") { - ps->setStyleSheet("QGroupBox { border:none; background-image: url(\""+PlayerBottomSeatActive+"\") }"); - } else { - ps->setStyleSheet("QGroupBox { border:none; background-image: url(\""+PlayerTopSeatActive+"\") }"); - } + // check if seat is on top or bottom line + if(ps->objectName() == "groupBox2" || ps->objectName() == "groupBox1" || ps->objectName() == "groupBox0" || ps->objectName() == "groupBox9" || ps->objectName() == "groupBox8") { + ps->setStyleSheet("QGroupBox { border:none; background-image: url(\""+PlayerBottomSeatActive+"\") }"); + } else { + ps->setStyleSheet("QGroupBox { border:none; background-image: url(\""+PlayerTopSeatActive+"\") }"); + } } void GameTableStyleReader::setBetValueInputStyle(QSpinBox *bv) { - bv->setStyleSheet("QSpinBox { "+ font2String +" font-size: "+betValueFontSize+"px; font-weight: bold; background-color: #"+BetInputBgColor+"; color: #"+BetInputTextColor+"; } QSpinBox:disabled { background-color: #"+BetInputDisabledBgColor+"; color: #"+BetInputDisabledTextColor+" }"); + bv->setStyleSheet("QSpinBox { "+ font2String +" font-size: "+betValueFontSize+"px; font-weight: bold; background-color: #"+BetInputBgColor+"; color: #"+BetInputTextColor+"; } QSpinBox:disabled { background-color: #"+BetInputDisabledBgColor+"; color: #"+BetInputDisabledTextColor+" }"); } void GameTableStyleReader::setAwayRadioButtonsStyle(QRadioButton *rb) { - rb->setStyleSheet("QRadioButton { color: #"+TabWidgetTextColor+"; } QRadioButton::indicator { width: 13px; height: 13px;} QRadioButton::indicator::checked { image: url(\""+RadioButtonChecked+"\");} QRadioButton::indicator::unchecked { image: url(\""+RadioButtonUnchecked+"\");} QRadioButton::indicator:unchecked:hover { image: url(\""+RadioButtonUncheckedHover+"\");} QRadioButton::indicator:unchecked:pressed { image: url(\""+RadioButtonPressed+"\");} QRadioButton::indicator::checked { image: url(\""+RadioButtonChecked+"\");} QRadioButton::indicator:checked:hover { image: url(\""+RadioButtonCheckedHover+"\");} QRadioButton::indicator:checked:pressed { image: url(\""+RadioButtonPressed+"\");}"); + rb->setStyleSheet("QRadioButton { color: #"+TabWidgetTextColor+"; } QRadioButton::indicator { width: 13px; height: 13px;} QRadioButton::indicator::checked { image: url(\""+RadioButtonChecked+"\");} QRadioButton::indicator::unchecked { image: url(\""+RadioButtonUnchecked+"\");} QRadioButton::indicator:unchecked:hover { image: url(\""+RadioButtonUncheckedHover+"\");} QRadioButton::indicator:unchecked:pressed { image: url(\""+RadioButtonPressed+"\");} QRadioButton::indicator::checked { image: url(\""+RadioButtonChecked+"\");} QRadioButton::indicator:checked:hover { image: url(\""+RadioButtonCheckedHover+"\");} QRadioButton::indicator:checked:pressed { image: url(\""+RadioButtonPressed+"\");}"); } QString GameTableStyleReader::getActionPic(int action) { - QString myAppDataPath = QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str()); + QString myAppDataPath = QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str()); - // 1 = fold, 2 = check, 3 = call, 4 = bet, 5 = raise, 6 = allin, 7 = winner - switch(action) { - case 1: { - if(myConfig->readConfigInt("DontTranslateInternationalPokerStringsFromStyle") || ActionFoldI18NPic.endsWith("NULL")) - return myAppDataPath+"gfx/gui/misc/actionpics/action_fold.png"; - else - return ActionFoldI18NPic; - } - break; - case 2: { - if(myConfig->readConfigInt("DontTranslateInternationalPokerStringsFromStyle") || ActionCheckI18NPic.endsWith("NULL")) - return myAppDataPath+"gfx/gui/misc/actionpics/action_check.png"; - else - return ActionCheckI18NPic; - } - break; - case 3: { - if(myConfig->readConfigInt("DontTranslateInternationalPokerStringsFromStyle") || ActionCallI18NPic.endsWith("NULL")) - return myAppDataPath+"gfx/gui/misc/actionpics/action_call.png"; - else - return ActionCallI18NPic; - } - break; - case 4: { - if(myConfig->readConfigInt("DontTranslateInternationalPokerStringsFromStyle") || ActionBetI18NPic.endsWith("NULL")) - return myAppDataPath+"gfx/gui/misc/actionpics/action_bet.png"; - else - return ActionBetI18NPic; - } - break; - case 5: { - if(myConfig->readConfigInt("DontTranslateInternationalPokerStringsFromStyle") || ActionRaiseI18NPic.endsWith("NULL")) - return myAppDataPath+"gfx/gui/misc/actionpics/action_raise.png"; - else - return ActionRaiseI18NPic; - } - break; - case 6: { - if(myConfig->readConfigInt("DontTranslateInternationalPokerStringsFromStyle") || ActionAllInI18NPic.endsWith("NULL")) - return myAppDataPath+"gfx/gui/misc/actionpics/action_allin.png"; - else - return ActionAllInI18NPic; - } - break; - case 7: { - if(myConfig->readConfigInt("DontTranslateInternationalPokerStringsFromStyle") || ActionWinnerI18NPic.endsWith("NULL")) - return myAppDataPath+"gfx/gui/misc/actionpics/action_winner.png"; - else - return ActionWinnerI18NPic; - } - break; - } - return QString(""); + // 1 = fold, 2 = check, 3 = call, 4 = bet, 5 = raise, 6 = allin, 7 = winner + switch(action) { + case 1: { + if(myConfig->readConfigInt("DontTranslateInternationalPokerStringsFromStyle") || ActionFoldI18NPic.endsWith("NULL")) + return myAppDataPath+"gfx/gui/misc/actionpics/action_fold.png"; + else + return ActionFoldI18NPic; + } + break; + case 2: { + if(myConfig->readConfigInt("DontTranslateInternationalPokerStringsFromStyle") || ActionCheckI18NPic.endsWith("NULL")) + return myAppDataPath+"gfx/gui/misc/actionpics/action_check.png"; + else + return ActionCheckI18NPic; + } + break; + case 3: { + if(myConfig->readConfigInt("DontTranslateInternationalPokerStringsFromStyle") || ActionCallI18NPic.endsWith("NULL")) + return myAppDataPath+"gfx/gui/misc/actionpics/action_call.png"; + else + return ActionCallI18NPic; + } + break; + case 4: { + if(myConfig->readConfigInt("DontTranslateInternationalPokerStringsFromStyle") || ActionBetI18NPic.endsWith("NULL")) + return myAppDataPath+"gfx/gui/misc/actionpics/action_bet.png"; + else + return ActionBetI18NPic; + } + break; + case 5: { + if(myConfig->readConfigInt("DontTranslateInternationalPokerStringsFromStyle") || ActionRaiseI18NPic.endsWith("NULL")) + return myAppDataPath+"gfx/gui/misc/actionpics/action_raise.png"; + else + return ActionRaiseI18NPic; + } + break; + case 6: { + if(myConfig->readConfigInt("DontTranslateInternationalPokerStringsFromStyle") || ActionAllInI18NPic.endsWith("NULL")) + return myAppDataPath+"gfx/gui/misc/actionpics/action_allin.png"; + else + return ActionAllInI18NPic; + } + break; + case 7: { + if(myConfig->readConfigInt("DontTranslateInternationalPokerStringsFromStyle") || ActionWinnerI18NPic.endsWith("NULL")) + return myAppDataPath+"gfx/gui/misc/actionpics/action_winner.png"; + else + return ActionWinnerI18NPic; + } + break; + } + return QString(""); } void GameTableStyleReader::setButtonsStyle(MyActionButton *br, MyActionButton *cc, MyActionButton *f, MyActionButton *a, int state) { - br->setMyStyle(this); - cc->setMyStyle(this); - f->setMyStyle(this); - a->setMyStyle(this); + br->setMyStyle(this); + cc->setMyStyle(this); + f->setMyStyle(this); + a->setMyStyle(this); - switch(state) { - //default - case 0: { - br->setStyleSheet("QPushButton { border:none; background-repeat: no-repeat; background-position: center center; background-image: url(\""+BetRaiseButtonDefault+"\"); "+ font2String +" font-size: "+humanPlayerButtonFontSize+"px; font-weight: bold; color: #"+BetRaiseButtonTextColor+";} QPushButton:unchecked { background-repeat: no-repeat; background-position: center center; background-image: url(\""+BetRaiseButtonDefault+"\"); } QPushButton:checked { background-repeat: no-repeat; background-position: center center; background-image: url(\""+BetRaiseButtonChecked+"\");} QPushButton:hover { background-repeat: no-repeat; background-position: center center; background-image: url(\""+BetRaiseButtonHover+"\"); } QPushButton:checked:hover { background-repeat: no-repeat; background-position: center center; background-image: url(\""+BetRaiseButtonCheckedHover+"\");}"); + switch(state) { + //default + case 0: { + br->setStyleSheet("QPushButton { border:none; background-repeat: no-repeat; background-position: center center; background-image: url(\""+BetRaiseButtonDefault+"\"); "+ font2String +" font-size: "+humanPlayerButtonFontSize+"px; font-weight: bold; color: #"+BetRaiseButtonTextColor+";} QPushButton:unchecked { background-repeat: no-repeat; background-position: center center; background-image: url(\""+BetRaiseButtonDefault+"\"); } QPushButton:checked { background-repeat: no-repeat; background-position: center center; background-image: url(\""+BetRaiseButtonChecked+"\");} QPushButton:hover { background-repeat: no-repeat; background-position: center center; background-image: url(\""+BetRaiseButtonHover+"\"); } QPushButton:checked:hover { background-repeat: no-repeat; background-position: center center; background-image: url(\""+BetRaiseButtonCheckedHover+"\");}"); - cc->setStyleSheet("QPushButton { border:none; background-repeat: no-repeat; background-position: center center; background-image: url(\""+CheckCallButtonDefault+"\"); "+ font2String +" font-size: "+humanPlayerButtonFontSize+"px; font-weight: bold; color: #"+CheckCallButtonTextColor+";} QPushButton:unchecked { background-repeat: no-repeat; background-position: center center; background-image: url(\""+CheckCallButtonDefault+"\"); } QPushButton:checked { background-repeat: no-repeat; background-position: center center; background-image: url(\""+CheckCallButtonChecked+"\");} QPushButton:hover { background-repeat: no-repeat; background-position: center center; background-image: url(\""+CheckCallButtonHover+"\"); } QPushButton:checked:hover { background-repeat: no-repeat; background-position: center center; background-image: url(\""+CheckCallButtonCheckedHover+"\");}"); + cc->setStyleSheet("QPushButton { border:none; background-repeat: no-repeat; background-position: center center; background-image: url(\""+CheckCallButtonDefault+"\"); "+ font2String +" font-size: "+humanPlayerButtonFontSize+"px; font-weight: bold; color: #"+CheckCallButtonTextColor+";} QPushButton:unchecked { background-repeat: no-repeat; background-position: center center; background-image: url(\""+CheckCallButtonDefault+"\"); } QPushButton:checked { background-repeat: no-repeat; background-position: center center; background-image: url(\""+CheckCallButtonChecked+"\");} QPushButton:hover { background-repeat: no-repeat; background-position: center center; background-image: url(\""+CheckCallButtonHover+"\"); } QPushButton:checked:hover { background-repeat: no-repeat; background-position: center center; background-image: url(\""+CheckCallButtonCheckedHover+"\");}"); - f->setStyleSheet("QPushButton { border:none; background-repeat: no-repeat; background-position: center center; background-image: url(\""+FoldButtonDefault+"\"); "+ font2String +" font-size: "+humanPlayerButtonFontSize+"px; font-weight: bold; color: #"+FoldButtonTextColor+";} QPushButton:unchecked { background-repeat: no-repeat; background-position: center center; background-image: url(\""+FoldButtonDefault+"\"); } QPushButton:checked { background-repeat: no-repeat; background-position: center center; background-image: url(\""+FoldButtonChecked+"\");} QPushButton:hover { background-repeat: no-repeat; background-position: center center; background-image: url(\""+FoldButtonHover+"\"); } QPushButton:checked:hover { background-repeat: no-repeat; background-position: center center; background-image: url(\""+FoldButtonCheckedHover+"\");}"); + f->setStyleSheet("QPushButton { border:none; background-repeat: no-repeat; background-position: center center; background-image: url(\""+FoldButtonDefault+"\"); "+ font2String +" font-size: "+humanPlayerButtonFontSize+"px; font-weight: bold; color: #"+FoldButtonTextColor+";} QPushButton:unchecked { background-repeat: no-repeat; background-position: center center; background-image: url(\""+FoldButtonDefault+"\"); } QPushButton:checked { background-repeat: no-repeat; background-position: center center; background-image: url(\""+FoldButtonChecked+"\");} QPushButton:hover { background-repeat: no-repeat; background-position: center center; background-image: url(\""+FoldButtonHover+"\"); } QPushButton:checked:hover { background-repeat: no-repeat; background-position: center center; background-image: url(\""+FoldButtonCheckedHover+"\");}"); - a->setStyleSheet("QPushButton { border:none; background-repeat: no-repeat; background-position: center center; background-image: url(\""+AllInButtonDefault+"\"); "+ font2String +" font-size: "+humanPlayerButtonFontSize+"px; font-weight: bold; color: #"+AllInButtonTextColor+";} QPushButton:unchecked { background-repeat: no-repeat; background-position: center center; background-image: url(\""+AllInButtonDefault+"\"); } QPushButton:checked { background-repeat: no-repeat; background-position: center center; background-image: url(\""+AllInButtonChecked+"\");} QPushButton:hover { background-repeat: no-repeat; background-position: center center; background-image: url(\""+AllInButtonHover+"\"); } QPushButton:checked:hover { background-repeat: no-repeat; background-position: center center; background-image: url(\""+AllInButtonCheckedHover+"\");}"); - } - break; - //no hover - case 1: { - br->setStyleSheet("QPushButton { border:none; background-repeat: no-repeat; background-position: center center; background-image: url(\""+BetRaiseButtonDefault+"\"); "+ font2String +" font-size: "+humanPlayerButtonFontSize+"px; font-weight: bold; color: #"+BetRaiseButtonTextColor+";} QPushButton:unchecked { background-repeat: no-repeat; background-position: center center; background-image: url(\""+BetRaiseButtonDefault+"\"); } QPushButton:checked { background-repeat: no-repeat; background-position: center center; background-image: url(\""+BetRaiseButtonChecked+"\");} QPushButton:hover { background-repeat: no-repeat; background-position: center center; background-image: url(\""+BetRaiseButtonDefault+"\"); } QPushButton:checked:hover { background-repeat: no-repeat; background-position: center center; background-image: url(\""+BetRaiseButtonChecked+"\");}"); + a->setStyleSheet("QPushButton { border:none; background-repeat: no-repeat; background-position: center center; background-image: url(\""+AllInButtonDefault+"\"); "+ font2String +" font-size: "+humanPlayerButtonFontSize+"px; font-weight: bold; color: #"+AllInButtonTextColor+";} QPushButton:unchecked { background-repeat: no-repeat; background-position: center center; background-image: url(\""+AllInButtonDefault+"\"); } QPushButton:checked { background-repeat: no-repeat; background-position: center center; background-image: url(\""+AllInButtonChecked+"\");} QPushButton:hover { background-repeat: no-repeat; background-position: center center; background-image: url(\""+AllInButtonHover+"\"); } QPushButton:checked:hover { background-repeat: no-repeat; background-position: center center; background-image: url(\""+AllInButtonCheckedHover+"\");}"); + } + break; + //no hover + case 1: { + br->setStyleSheet("QPushButton { border:none; background-repeat: no-repeat; background-position: center center; background-image: url(\""+BetRaiseButtonDefault+"\"); "+ font2String +" font-size: "+humanPlayerButtonFontSize+"px; font-weight: bold; color: #"+BetRaiseButtonTextColor+";} QPushButton:unchecked { background-repeat: no-repeat; background-position: center center; background-image: url(\""+BetRaiseButtonDefault+"\"); } QPushButton:checked { background-repeat: no-repeat; background-position: center center; background-image: url(\""+BetRaiseButtonChecked+"\");} QPushButton:hover { background-repeat: no-repeat; background-position: center center; background-image: url(\""+BetRaiseButtonDefault+"\"); } QPushButton:checked:hover { background-repeat: no-repeat; background-position: center center; background-image: url(\""+BetRaiseButtonChecked+"\");}"); - cc->setStyleSheet("QPushButton { border:none; background-repeat: no-repeat; background-position: center center; background-image: url(\""+CheckCallButtonDefault+"\"); "+ font2String +" font-size: "+humanPlayerButtonFontSize+"px; font-weight: bold; color: #"+CheckCallButtonTextColor+";} QPushButton:unchecked { background-repeat: no-repeat; background-position: center center; background-image: url(\""+CheckCallButtonDefault+"\"); } QPushButton:checked { background-repeat: no-repeat; background-position: center center; background-image: url(\""+CheckCallButtonChecked+"\");} QPushButton:hover { background-repeat: no-repeat; background-position: center center; background-image: url(\""+CheckCallButtonDefault+"\"); } QPushButton:checked:hover { background-repeat: no-repeat; background-position: center center; background-image: url(\""+CheckCallButtonChecked+"\");}"); + cc->setStyleSheet("QPushButton { border:none; background-repeat: no-repeat; background-position: center center; background-image: url(\""+CheckCallButtonDefault+"\"); "+ font2String +" font-size: "+humanPlayerButtonFontSize+"px; font-weight: bold; color: #"+CheckCallButtonTextColor+";} QPushButton:unchecked { background-repeat: no-repeat; background-position: center center; background-image: url(\""+CheckCallButtonDefault+"\"); } QPushButton:checked { background-repeat: no-repeat; background-position: center center; background-image: url(\""+CheckCallButtonChecked+"\");} QPushButton:hover { background-repeat: no-repeat; background-position: center center; background-image: url(\""+CheckCallButtonDefault+"\"); } QPushButton:checked:hover { background-repeat: no-repeat; background-position: center center; background-image: url(\""+CheckCallButtonChecked+"\");}"); - f->setStyleSheet("QPushButton { border:none; background-repeat: no-repeat; background-position: center center; background-image: url(\""+FoldButtonDefault+"\"); "+ font2String +" font-size: "+humanPlayerButtonFontSize+"px; font-weight: bold; color: #"+FoldButtonTextColor+";} QPushButton:unchecked { background-repeat: no-repeat; background-position: center center; background-image: url(\""+FoldButtonDefault+"\"); } QPushButton:checked { background-repeat: no-repeat; background-position: center center; background-image: url(\""+FoldButtonChecked+"\");} QPushButton:hover { background-repeat: no-repeat; background-position: center center; background-image: url(\""+FoldButtonDefault+"\"); } QPushButton:checked:hover { background-repeat: no-repeat; background-position: center center; background-image: url(\""+FoldButtonChecked+"\");}"); + f->setStyleSheet("QPushButton { border:none; background-repeat: no-repeat; background-position: center center; background-image: url(\""+FoldButtonDefault+"\"); "+ font2String +" font-size: "+humanPlayerButtonFontSize+"px; font-weight: bold; color: #"+FoldButtonTextColor+";} QPushButton:unchecked { background-repeat: no-repeat; background-position: center center; background-image: url(\""+FoldButtonDefault+"\"); } QPushButton:checked { background-repeat: no-repeat; background-position: center center; background-image: url(\""+FoldButtonChecked+"\");} QPushButton:hover { background-repeat: no-repeat; background-position: center center; background-image: url(\""+FoldButtonDefault+"\"); } QPushButton:checked:hover { background-repeat: no-repeat; background-position: center center; background-image: url(\""+FoldButtonChecked+"\");}"); - a->setStyleSheet("QPushButton { border:none; background-repeat: no-repeat; background-position: center center; background-image: url(\""+AllInButtonDefault+"\"); "+ font2String +" font-size: "+humanPlayerButtonFontSize+"px; font-weight: bold; color: #"+AllInButtonTextColor+";} QPushButton:unchecked { background-repeat: no-repeat; background-position: center center; background-image: url(\""+AllInButtonDefault+"\"); } QPushButton:checked { background-repeat: no-repeat; background-position: center center; background-image: url(\""+AllInButtonChecked+"\");} QPushButton:hover { background-repeat: no-repeat; background-position: center center; background-image: url(\""+AllInButtonDefault+"\"); } QPushButton:checked:hover { background-repeat: no-repeat; background-position: center center; background-image: url(\""+AllInButtonChecked+"\");}"); - } - break; - //checkable - case 2: { - br->setStyleSheet("QPushButton { border:none; background-repeat: no-repeat; background-position: center center; background-image: url(\""+BetRaiseButtonDefault+"\"); "+ font2String +" font-size: "+humanPlayerButtonFontSize+"px; font-weight: bold; color: #"+BetRaiseButtonCheckableTextColor+";} QPushButton:unchecked { background-repeat: no-repeat; background-position: center center; background-image: url(\""+BetRaiseButtonDefault+"\"); } QPushButton:checked { background-repeat: no-repeat; background-position: center center; background-image: url(\""+BetRaiseButtonChecked+"\");} QPushButton:hover { background-repeat: no-repeat; background-position: center center; background-image: url(\""+BetRaiseButtonHover+"\"); } QPushButton:checked:hover { background-repeat: no-repeat; background-position: center center; background-image: url(\""+BetRaiseButtonCheckedHover+"\");}"); + a->setStyleSheet("QPushButton { border:none; background-repeat: no-repeat; background-position: center center; background-image: url(\""+AllInButtonDefault+"\"); "+ font2String +" font-size: "+humanPlayerButtonFontSize+"px; font-weight: bold; color: #"+AllInButtonTextColor+";} QPushButton:unchecked { background-repeat: no-repeat; background-position: center center; background-image: url(\""+AllInButtonDefault+"\"); } QPushButton:checked { background-repeat: no-repeat; background-position: center center; background-image: url(\""+AllInButtonChecked+"\");} QPushButton:hover { background-repeat: no-repeat; background-position: center center; background-image: url(\""+AllInButtonDefault+"\"); } QPushButton:checked:hover { background-repeat: no-repeat; background-position: center center; background-image: url(\""+AllInButtonChecked+"\");}"); + } + break; + //checkable + case 2: { + br->setStyleSheet("QPushButton { border:none; background-repeat: no-repeat; background-position: center center; background-image: url(\""+BetRaiseButtonDefault+"\"); "+ font2String +" font-size: "+humanPlayerButtonFontSize+"px; font-weight: bold; color: #"+BetRaiseButtonCheckableTextColor+";} QPushButton:unchecked { background-repeat: no-repeat; background-position: center center; background-image: url(\""+BetRaiseButtonDefault+"\"); } QPushButton:checked { background-repeat: no-repeat; background-position: center center; background-image: url(\""+BetRaiseButtonChecked+"\");} QPushButton:hover { background-repeat: no-repeat; background-position: center center; background-image: url(\""+BetRaiseButtonHover+"\"); } QPushButton:checked:hover { background-repeat: no-repeat; background-position: center center; background-image: url(\""+BetRaiseButtonCheckedHover+"\");}"); - cc->setStyleSheet("QPushButton { border:none; background-repeat: no-repeat; background-position: center center; background-image: url(\""+CheckCallButtonDefault+"\"); "+ font2String +" font-size: "+humanPlayerButtonFontSize+"px; font-weight: bold; color: #"+CheckCallButtonCheckableTextColor+";} QPushButton:unchecked { background-repeat: no-repeat; background-position: center center; background-image: url(\""+CheckCallButtonDefault+"\"); } QPushButton:checked { background-repeat: no-repeat; background-position: center center; background-image: url(\""+CheckCallButtonChecked+"\");} QPushButton:hover { background-repeat: no-repeat; background-position: center center; background-image: url(\""+CheckCallButtonHover+"\"); } QPushButton:checked:hover { background-repeat: no-repeat; background-position: center center; background-image: url(\""+CheckCallButtonCheckedHover+"\");}"); + cc->setStyleSheet("QPushButton { border:none; background-repeat: no-repeat; background-position: center center; background-image: url(\""+CheckCallButtonDefault+"\"); "+ font2String +" font-size: "+humanPlayerButtonFontSize+"px; font-weight: bold; color: #"+CheckCallButtonCheckableTextColor+";} QPushButton:unchecked { background-repeat: no-repeat; background-position: center center; background-image: url(\""+CheckCallButtonDefault+"\"); } QPushButton:checked { background-repeat: no-repeat; background-position: center center; background-image: url(\""+CheckCallButtonChecked+"\");} QPushButton:hover { background-repeat: no-repeat; background-position: center center; background-image: url(\""+CheckCallButtonHover+"\"); } QPushButton:checked:hover { background-repeat: no-repeat; background-position: center center; background-image: url(\""+CheckCallButtonCheckedHover+"\");}"); - f->setStyleSheet("QPushButton { border:none; background-repeat: no-repeat; background-position: center center; background-image: url(\""+FoldButtonDefault+"\"); "+ font2String +" font-size: "+humanPlayerButtonFontSize+"px; font-weight: bold; color: #"+FoldButtonCheckableTextColor+";} QPushButton:unchecked { background-repeat: no-repeat; background-position: center center; background-image: url(\""+FoldButtonDefault+"\"); } QPushButton:checked { background-repeat: no-repeat; background-position: center center; background-image: url(\""+FoldButtonChecked+"\");} QPushButton:hover { background-repeat: no-repeat; background-position: center center; background-image: url(\""+FoldButtonHover+"\"); } QPushButton:checked:hover { background-repeat: no-repeat; background-position: center center; background-image: url(\""+FoldButtonCheckedHover+"\");}"); + f->setStyleSheet("QPushButton { border:none; background-repeat: no-repeat; background-position: center center; background-image: url(\""+FoldButtonDefault+"\"); "+ font2String +" font-size: "+humanPlayerButtonFontSize+"px; font-weight: bold; color: #"+FoldButtonCheckableTextColor+";} QPushButton:unchecked { background-repeat: no-repeat; background-position: center center; background-image: url(\""+FoldButtonDefault+"\"); } QPushButton:checked { background-repeat: no-repeat; background-position: center center; background-image: url(\""+FoldButtonChecked+"\");} QPushButton:hover { background-repeat: no-repeat; background-position: center center; background-image: url(\""+FoldButtonHover+"\"); } QPushButton:checked:hover { background-repeat: no-repeat; background-position: center center; background-image: url(\""+FoldButtonCheckedHover+"\");}"); - a->setStyleSheet("QPushButton { border:none; background-repeat: no-repeat; background-position: center center; background-image: url(\""+AllInButtonDefault+"\"); "+ font2String +" font-size: "+humanPlayerButtonFontSize+"px; font-weight: bold; color: #"+AllInButtonCheckableTextColor+";} QPushButton:unchecked { background-repeat: no-repeat; background-position: center center; background-image: url(\""+AllInButtonDefault+"\"); } QPushButton:checked { background-repeat: no-repeat; background-position: center center; background-image: url(\""+AllInButtonChecked+"\");} QPushButton:hover { background-repeat: no-repeat; background-position: center center; background-image: url(\""+AllInButtonHover+"\"); } QPushButton:checked:hover { background-repeat: no-repeat; background-position: center center; background-image: url(\""+AllInButtonCheckedHover+"\");}"); - } - break; - } + a->setStyleSheet("QPushButton { border:none; background-repeat: no-repeat; background-position: center center; background-image: url(\""+AllInButtonDefault+"\"); "+ font2String +" font-size: "+humanPlayerButtonFontSize+"px; font-weight: bold; color: #"+AllInButtonCheckableTextColor+";} QPushButton:unchecked { background-repeat: no-repeat; background-position: center center; background-image: url(\""+AllInButtonDefault+"\"); } QPushButton:checked { background-repeat: no-repeat; background-position: center center; background-image: url(\""+AllInButtonChecked+"\");} QPushButton:hover { background-repeat: no-repeat; background-position: center center; background-image: url(\""+AllInButtonHover+"\"); } QPushButton:checked:hover { background-repeat: no-repeat; background-position: center center; background-image: url(\""+AllInButtonCheckedHover+"\");}"); + } + break; + } } void GameTableStyleReader::setShowMyCardsButtonStyle( MyActionButton *sc) { - sc->setMyStyle(this); + sc->setMyStyle(this); - //Show My Cards Button has same look and feel all the time - sc->setStyleSheet("QPushButton { border:none; background-repeat: no-repeat; background-position: center center; background-image: url(\""+ShowMyCardsButtonDefault+"\"); "+ font2String +" font-size: "+humanPlayerButtonFontSize+"px; font-weight: bold; color: #"+ShowMyCardsButtonTextColor+";} QPushButton:unchecked { background-repeat: no-repeat; background-position: center center; background-image: url(\""+ShowMyCardsButtonDefault+"\"); } QPushButton:checked { background-repeat: no-repeat; background-position: center center; background-image: url(\""+BetRaiseButtonDefault+"\");} QPushButton:hover { background-repeat: no-repeat; background-position: center center; background-image: url(\""+ShowMyCardsButtonHover+"\"); } QPushButton:checked:hover { background-repeat: no-repeat; background-position: center center; background-image: url(\""+ShowMyCardsButtonHover+"\");}"); + //Show My Cards Button has same look and feel all the time + sc->setStyleSheet("QPushButton { border:none; background-repeat: no-repeat; background-position: center center; background-image: url(\""+ShowMyCardsButtonDefault+"\"); "+ font2String +" font-size: "+humanPlayerButtonFontSize+"px; font-weight: bold; color: #"+ShowMyCardsButtonTextColor+";} QPushButton:unchecked { background-repeat: no-repeat; background-position: center center; background-image: url(\""+ShowMyCardsButtonDefault+"\"); } QPushButton:checked { background-repeat: no-repeat; background-position: center center; background-image: url(\""+BetRaiseButtonDefault+"\");} QPushButton:hover { background-repeat: no-repeat; background-position: center center; background-image: url(\""+ShowMyCardsButtonHover+"\"); } QPushButton:checked:hover { background-repeat: no-repeat; background-position: center center; background-image: url(\""+ShowMyCardsButtonHover+"\");}"); } void GameTableStyleReader::setToolBoxBackground(QGroupBox* gb) { #ifndef ANDROID - gb->setStyleSheet("QGroupBox { border:none; background-image: url(\""+ToolBoxBackground+"\") }"); + gb->setStyleSheet("QGroupBox { border:none; background-image: url(\""+ToolBoxBackground+"\") }"); #endif } void GameTableStyleReader::setTabWidgetStyle(QTabWidget *tw, QTabBar *tb) { - tw->setStyleSheet("QTabWidget::pane { border: 2px solid #"+TabWidgetBorderColor+"; border-radius: 2px; background-color: #"+TabWidgetBgColor+"; } QTabWidget::tab-bar { left: 5px; } "); + tw->setStyleSheet("QTabWidget::pane { border: 2px solid #"+TabWidgetBorderColor+"; border-radius: 2px; background-color: #"+TabWidgetBgColor+"; } QTabWidget::tab-bar { left: 5px; } "); - QString bottomPadding(""); + QString bottomPadding(""); #ifdef _WIN32 - bottomPadding = " padding-bottom: 3px;"; + bottomPadding = " padding-bottom: 3px;"; #endif - QString tabTextFontSize; + QString tabTextFontSize; #ifndef ANDROID - tabTextFontSize = "font-size: 11px; "; + tabTextFontSize = "font-size: 11px; "; #endif #ifndef MAEMO - tb->setStyleSheet("QTabBar::tab{ "+ font1String + tabTextFontSize +" color: #"+TabWidgetTextColor+"; background-color: #"+TabWidgetBgColor+"; border: 2px solid #"+TabWidgetBorderColor+"; border-bottom-color: #"+TabWidgetBorderColor+"; border-top-left-radius: 4px; border-top-right-radius: 4px; padding-top: "+tabBarPaddingTop+"px;"+bottomPadding+" padding-left:"+tabBarPaddingSide+"px; padding-right:"+tabBarPaddingSide+"px;} QTabBar::tab:selected, QTabBar::tab:hover { background-color: #"+TabWidgetBgColor+"; padding-top: "+tabBarPaddingTop+"px; padding-left:"+tabBarPaddingSide+"px; padding-right:"+tabBarPaddingSide+"px;} QTabBar::tab:selected { border-color: #"+TabWidgetBorderColor+"; border-bottom-color: #"+TabWidgetBgColor+"; padding-top: "+tabBarPaddingTop+"px; padding-left:"+tabBarPaddingSide+"px; padding-right:"+tabBarPaddingSide+"px;} QTabBar::tab:!selected { margin-top: 2px; padding-top: "+tabBarPaddingTop+"px; padding-left:"+tabBarPaddingSide+"px; padding-right:"+tabBarPaddingSide+"px;} QTabBar::tab:selected { margin-left: -4px; margin-right: -4px; padding-top: "+tabBarPaddingTop+"px; padding-left:"+tabBarPaddingSide+"px; padding-right:"+tabBarPaddingSide+"px;} QTabBar::tab:first:selected { margin-left: 0; padding-top: "+tabBarPaddingTop+"px; padding-left:"+tabBarPaddingSide+"px; padding-right:"+tabBarPaddingSide+"px;} QTabBar::tab:last:selected { margin-right: 0; padding-top: "+tabBarPaddingTop+"px; padding-left:"+tabBarPaddingSide+"px; padding-right:"+tabBarPaddingSide+"px;} QTabBar::tab:only-one { margin: 0; } "); + tb->setStyleSheet("QTabBar::tab{ "+ font1String + tabTextFontSize +" color: #"+TabWidgetTextColor+"; background-color: #"+TabWidgetBgColor+"; border: 2px solid #"+TabWidgetBorderColor+"; border-bottom-color: #"+TabWidgetBorderColor+"; border-top-left-radius: 4px; border-top-right-radius: 4px; padding-top: "+tabBarPaddingTop+"px;"+bottomPadding+" padding-left:"+tabBarPaddingSide+"px; padding-right:"+tabBarPaddingSide+"px;} QTabBar::tab:selected, QTabBar::tab:hover { background-color: #"+TabWidgetBgColor+"; padding-top: "+tabBarPaddingTop+"px; padding-left:"+tabBarPaddingSide+"px; padding-right:"+tabBarPaddingSide+"px;} QTabBar::tab:selected { border-color: #"+TabWidgetBorderColor+"; border-bottom-color: #"+TabWidgetBgColor+"; padding-top: "+tabBarPaddingTop+"px; padding-left:"+tabBarPaddingSide+"px; padding-right:"+tabBarPaddingSide+"px;} QTabBar::tab:!selected { margin-top: 2px; padding-top: "+tabBarPaddingTop+"px; padding-left:"+tabBarPaddingSide+"px; padding-right:"+tabBarPaddingSide+"px;} QTabBar::tab:selected { margin-left: -4px; margin-right: -4px; padding-top: "+tabBarPaddingTop+"px; padding-left:"+tabBarPaddingSide+"px; padding-right:"+tabBarPaddingSide+"px;} QTabBar::tab:first:selected { margin-left: 0; padding-top: "+tabBarPaddingTop+"px; padding-left:"+tabBarPaddingSide+"px; padding-right:"+tabBarPaddingSide+"px;} QTabBar::tab:last:selected { margin-right: 0; padding-top: "+tabBarPaddingTop+"px; padding-left:"+tabBarPaddingSide+"px; padding-right:"+tabBarPaddingSide+"px;} QTabBar::tab:only-one { margin: 0; } "); #endif } void GameTableStyleReader::setWindowsGeometry(gameTableImpl *gt) { - if(IfFixedWindowSize.toInt()) { - gt->setMinimumSize(FixedWindowWidth.toInt(), FixedWindowHeight.toInt()); - gt->setMaximumSize(FixedWindowWidth.toInt(), FixedWindowHeight.toInt()); - gt->resize(FixedWindowWidth.toInt(), FixedWindowHeight.toInt()); + if(IfFixedWindowSize.toInt()) { + gt->setMinimumSize(FixedWindowWidth.toInt(), FixedWindowHeight.toInt()); + gt->setMaximumSize(FixedWindowWidth.toInt(), FixedWindowHeight.toInt()); + gt->resize(FixedWindowWidth.toInt(), FixedWindowHeight.toInt()); #ifndef GUI_800x480 - QDesktopWidget dw; - int availableWidth = dw.screenGeometry().width(); - int availableHeight = dw.screenGeometry().height(); - if(availableWidth == FixedWindowWidth.toInt() && availableHeight == FixedWindowHeight.toInt()) { - gt->actionFullScreen->setEnabled(TRUE); - } else { - gt->actionFullScreen->setDisabled(TRUE); - if(gt->isFullScreen()) { - gt->showNormal(); - gt->move(50,50); - } - } + QDesktopWidget dw; + int availableWidth = dw.screenGeometry().width(); + int availableHeight = dw.screenGeometry().height(); + if(availableWidth == FixedWindowWidth.toInt() && availableHeight == FixedWindowHeight.toInt()) { + gt->actionFullScreen->setEnabled(TRUE); + } else { + gt->actionFullScreen->setDisabled(TRUE); + if(gt->isFullScreen()) { + gt->showNormal(); + gt->move(50,50); + } + } #endif - } else { - gt->setMinimumSize(MinimumWindowWidth.toInt(), MinimumWindowHeight.toInt()); - gt->setMaximumSize(MaximumWindowWidth.toInt(), MaximumWindowHeight.toInt()); - gt->resize(MinimumWindowWidth.toInt(), MinimumWindowHeight.toInt()); + } else { + gt->setMinimumSize(MinimumWindowWidth.toInt(), MinimumWindowHeight.toInt()); + gt->setMaximumSize(MaximumWindowWidth.toInt(), MaximumWindowHeight.toInt()); + gt->resize(MinimumWindowWidth.toInt(), MinimumWindowHeight.toInt()); #ifndef GUI_800x480 - QDesktopWidget dw; - int availableWidth = dw.screenGeometry().width(); - int availableHeight = dw.screenGeometry().height(); - if(availableWidth <= MaximumWindowWidth.toInt() && availableHeight <= MaximumWindowHeight.toInt()) { - gt->actionFullScreen->setEnabled(TRUE); - } else { - gt->actionFullScreen->setDisabled(TRUE); - if(gt->isFullScreen()) { - gt->showNormal(); - gt->move(50,50); - } - } + QDesktopWidget dw; + int availableWidth = dw.screenGeometry().width(); + int availableHeight = dw.screenGeometry().height(); + if(availableWidth <= MaximumWindowWidth.toInt() && availableHeight <= MaximumWindowHeight.toInt()) { + gt->actionFullScreen->setEnabled(TRUE); + } else { + gt->actionFullScreen->setDisabled(TRUE); + if(gt->isFullScreen()) { + gt->showNormal(); + gt->move(50,50); + } + } #endif - } + } } void GameTableStyleReader::setSliderStyle(QSlider *s) { - QString height(""); + QString height(""); #ifdef GUI_800x480 - height = " height: 10px;"; + height = " height: 10px;"; #else - height = " height: 3px;"; + height = " height: 3px;"; #endif #if QT_VERSION >= 0x040700 #ifdef GUI_800x480 - s->setStyleSheet("QSlider::groove:horizontal { border: 2px solid #"+BetSpeedSliderGrooveBorderColor+";"+height+" background: #"+BetSpeedSliderGrooveBgColor+"; margin: 2px 0; border-radius: 2px; } QSlider::handle:horizontal { background: #"+BetSpeedSliderHandleBgColor+"; border: 2px solid #"+BetSpeedSliderHandleBorderColor+"; width: 58px; margin: -24px 0; border-radius: 4px;}"); + s->setStyleSheet("QSlider::groove:horizontal { border: 2px solid #"+BetSpeedSliderGrooveBorderColor+";"+height+" background: #"+BetSpeedSliderGrooveBgColor+"; margin: 2px 0; border-radius: 2px; } QSlider::handle:horizontal { background: #"+BetSpeedSliderHandleBgColor+"; border: 2px solid #"+BetSpeedSliderHandleBorderColor+"; width: 58px; margin: -24px 0; border-radius: 4px;}"); #else - s->setStyleSheet("QSlider::groove:horizontal { border: 1px solid #"+BetSpeedSliderGrooveBorderColor+";"+height+" background: #"+BetSpeedSliderGrooveBgColor+"; margin: 4px 0; border-radius: 2px; } QSlider::handle:horizontal { background: #"+BetSpeedSliderHandleBgColor+"; border: 1px solid #"+BetSpeedSliderHandleBorderColor+"; width: 12px; margin: -7px 0; border-radius: 4px;}"); + s->setStyleSheet("QSlider::groove:horizontal { border: 1px solid #"+BetSpeedSliderGrooveBorderColor+";"+height+" background: #"+BetSpeedSliderGrooveBgColor+"; margin: 4px 0; border-radius: 2px; } QSlider::handle:horizontal { background: #"+BetSpeedSliderHandleBgColor+"; border: 1px solid #"+BetSpeedSliderHandleBorderColor+"; width: 12px; margin: -7px 0; border-radius: 4px;}"); #endif #else - s->setStyleSheet("QSlider::groove:horizontal { border: 1px solid #"+BetSpeedSliderGrooveBorderColor+";"+height+" background: #"+BetSpeedSliderGrooveBgColor+"; margin: 4px 0; border-radius: 2px; } QSlider::handle:horizontal { background: #"+BetSpeedSliderHandleBgColor+"; border: 1px solid #"+BetSpeedSliderHandleBorderColor+"; width: 12px; margin: -2px 0; border-radius: 4px;}"); + s->setStyleSheet("QSlider::groove:horizontal { border: 1px solid #"+BetSpeedSliderGrooveBorderColor+";"+height+" background: #"+BetSpeedSliderGrooveBgColor+"; margin: 4px 0; border-radius: 2px; } QSlider::handle:horizontal { background: #"+BetSpeedSliderHandleBgColor+"; border: 1px solid #"+BetSpeedSliderHandleBorderColor+"; width: 12px; margin: -2px 0; border-radius: 4px;}"); #endif } QString GameTableStyleReader::getFallBackFieldContent(QString field, int type) { - QFile myFile(QFile(QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str())+"gfx/gui/table/default/defaulttablestyle.xml").fileName()); - myFile.open(QIODevice::ReadOnly); - QByteArray thisContent = myFile.readAll(); + QFile myFile(QFile(QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str())+"gfx/gui/table/default/defaulttablestyle.xml").fileName()); + myFile.open(QIODevice::ReadOnly); + QByteArray thisContent = myFile.readAll(); - //start reading the file and fill vars - string tempString1(""); - TiXmlDocument doc; - doc.Parse(thisContent.constData()); + //start reading the file and fill vars + string tempString1(""); + TiXmlDocument doc; + doc.Parse(thisContent.constData()); - if(doc.RootElement()) { - TiXmlHandle docHandle( &doc ); - TiXmlElement* itemsList = docHandle.FirstChild( "PokerTH" ).FirstChild( "TableStyle" ).FirstChild().ToElement(); - for( ; itemsList; itemsList=itemsList->NextSiblingElement()) { - const char *tmpStr1 = itemsList->Attribute("value"); - if (tmpStr1) { - tempString1 = tmpStr1; - if(itemsList->ValueStr() == field.toStdString()) { - if(type == 1) return QString(QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str())+"gfx/gui/table/default/"+QString::fromUtf8(tempString1.c_str())); - else return QString::fromUtf8(tempString1.c_str()); - } - } - } - } - return QString(""); + if(doc.RootElement()) { + TiXmlHandle docHandle( &doc ); + TiXmlElement* itemsList = docHandle.FirstChild( "PokerTH" ).FirstChild( "TableStyle" ).FirstChild().ToElement(); + for( ; itemsList; itemsList=itemsList->NextSiblingElement()) { + const char *tmpStr1 = itemsList->Attribute("value"); + if (tmpStr1) { + tempString1 = tmpStr1; + if(itemsList->ValueStr() == field.toStdString()) { + if(type == 1) return QString(QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str())+"gfx/gui/table/default/"+QString::fromUtf8(tempString1.c_str())); + else return QString::fromUtf8(tempString1.c_str()); + } + } + } + } + return QString(""); } QString GameTableStyleReader::getMyStateToolTipInfo() { - switch (myState) { - case GT_STYLE_OK: - return QString(tr("Everything OK!")); - break; - case GT_STYLE_PICTURES_MISSING: - return QString(tr("Some pictures are missing, please contact style maintainer for this issue.")); - break; - case GT_STYLE_FIELDS_EMPTY: - return QString(tr("Some style fields are missing, please contact style maintainer for this issue.")); - break; - case GT_STYLE_OUTDATED: - return QString(tr("This style is outdated, please contact style maintainer for this issue.")); - break; - default: - return QString(""); - } + switch (myState) { + case GT_STYLE_OK: + return QString(tr("Everything OK!")); + break; + case GT_STYLE_PICTURES_MISSING: + return QString(tr("Some pictures are missing, please contact style maintainer for this issue.")); + break; + case GT_STYLE_FIELDS_EMPTY: + return QString(tr("Some style fields are missing, please contact style maintainer for this issue.")); + break; + case GT_STYLE_OUTDATED: + return QString(tr("This style is outdated, please contact style maintainer for this issue.")); + break; + default: + return QString(""); + } } diff --git a/src/gui/qt/styles/gametablestylereader.h b/src/gui/qt/styles/gametablestylereader.h index 2c81b84f..9c39a793 100644 --- a/src/gui/qt/styles/gametablestylereader.h +++ b/src/gui/qt/styles/gametablestylereader.h @@ -87,9 +87,9 @@ public: QString getHandRanking() const { return HandRanking; } - QString getTable() const { - return Table; - } + QString getTable() const { + return Table; + } QString getActionPic(int); diff --git a/src/gui/qt/timeoutmsgbox/timeoutmsgboximpl.cpp b/src/gui/qt/timeoutmsgbox/timeoutmsgboximpl.cpp index e0440c3b..acfab763 100644 --- a/src/gui/qt/timeoutmsgbox/timeoutmsgboximpl.cpp +++ b/src/gui/qt/timeoutmsgbox/timeoutmsgboximpl.cpp @@ -27,9 +27,9 @@ timeoutMsgBoxImpl::timeoutMsgBoxImpl(QMainWindow *parent) this->setIcon(QMessageBox::Warning); this->setInformativeText(tr("Please click \"OK\" to stop the countdown!")); #ifdef ANDROID - this->setWindowModality(Qt::WindowModal); - this->setWindowFlags(Qt::ToolTip); - this->setStyleSheet("QDialog{ border: 1px solid black; border-style: solid; border-radius: 4px; }"); + this->setWindowModality(Qt::WindowModal); + this->setWindowFlags(Qt::ToolTip); + this->setStyleSheet("QDialog{ border: 1px solid black; border-style: solid; border-radius: 4px; }"); #endif timeOutTimer = new QTimer; diff --git a/src/net/common/clientstate.cpp b/src/net/common/clientstate.cpp index c22ae72b..ba325063 100644 --- a/src/net/common/clientstate.cpp +++ b/src/net/common/clientstate.cpp @@ -560,24 +560,24 @@ AbstractClientStateReceiving::HandlePacket(boost::shared_ptr clien client->GetCallback().SignalNetClientWaitDialog(); int removeReason; switch (netRemoved.removedfromgamereason()) { - case RemovedFromGameMessage::kickedFromGame : - removeReason = NTF_NET_REMOVED_KICKED; - break; - case RemovedFromGameMessage::gameIsFull : - removeReason = NTF_NET_REMOVED_GAME_FULL; - break; - case RemovedFromGameMessage::gameIsRunning : - removeReason = NTF_NET_REMOVED_ALREADY_RUNNING; - break; - case RemovedFromGameMessage::gameTimeout : - removeReason = NTF_NET_REMOVED_TIMEOUT; - break; - case RemovedFromGameMessage::removedStartFailed : - removeReason = NTF_NET_REMOVED_START_FAILED; - break; - default : - removeReason = NTF_NET_REMOVED_ON_REQUEST; - break; + case RemovedFromGameMessage::kickedFromGame : + removeReason = NTF_NET_REMOVED_KICKED; + break; + case RemovedFromGameMessage::gameIsFull : + removeReason = NTF_NET_REMOVED_GAME_FULL; + break; + case RemovedFromGameMessage::gameIsRunning : + removeReason = NTF_NET_REMOVED_ALREADY_RUNNING; + break; + case RemovedFromGameMessage::gameTimeout : + removeReason = NTF_NET_REMOVED_TIMEOUT; + break; + case RemovedFromGameMessage::removedStartFailed : + removeReason = NTF_NET_REMOVED_START_FAILED; + break; + default : + removeReason = NTF_NET_REMOVED_ON_REQUEST; + break; } client->GetCallback().SignalNetClientRemovedFromGame(removeReason); client->SetState(ClientStateWaitJoin::Instance()); @@ -1177,7 +1177,7 @@ ClientStateWaitJoin::InternalHandlePacket(boost::shared_ptr client // Player number is 0 on init. Will be set when the game starts. boost::shared_ptr playerData( new PlayerData(client->GetGuiPlayerId(), 0, PLAYER_TYPE_HUMAN, - context.GetPlayerRights(), netJoinAck.areyougameadmin())); + context.GetPlayerRights(), netJoinAck.areyougameadmin())); playerData->SetName(context.GetPlayerName()); playerData->SetAvatarFile(context.GetAvatarFile()); client->AddPlayerData(playerData); @@ -1393,8 +1393,7 @@ void ClientStateWaitStart::InternalHandlePacket(boost::shared_ptr client, boost::shared_ptr tmpPacket) { if (tmpPacket->GetMsg()->messagetype() == PokerTHMessage::Type_GameStartInitialMessage - || tmpPacket->GetMsg()->messagetype() == PokerTHMessage::Type_GameStartRejoinMessage) - { + || tmpPacket->GetMsg()->messagetype() == PokerTHMessage::Type_GameStartRejoinMessage) { PlayerIdList tmpPlayerList; unsigned tmpHandId = 0; diff --git a/src/net/common/receivebuffer.cpp b/src/net/common/receivebuffer.cpp index 7bd2a504..156835dc 100644 --- a/src/net/common/receivebuffer.cpp +++ b/src/net/common/receivebuffer.cpp @@ -85,8 +85,7 @@ ReceiveBuffer::ScanPackets() uint32_t nativeVal; memcpy(&nativeVal, &recvBuf[0], sizeof(uint32_t)); size_t packetSize = ntohl(nativeVal); - if (recvBufUsed >= packetSize + NET_HEADER_SIZE) - { + if (recvBufUsed >= packetSize + NET_HEADER_SIZE) { try { tmpPacket = NetPacket::Create(&recvBuf[NET_HEADER_SIZE], packetSize); if (tmpPacket) { diff --git a/src/net/common/servergame.cpp b/src/net/common/servergame.cpp index cc01ba50..e5c65f51 100644 --- a/src/net/common/servergame.cpp +++ b/src/net/common/servergame.cpp @@ -549,12 +549,12 @@ ServerGame::InternalDenyVoteKick(boost::shared_ptr byWhom, unsigned netVoteReply->set_gameid(GetId()); netVoteReply->set_petitionid(petitionId); switch(reason) { - case VOTE_DENIED_ALREADY_VOTED : - netVoteReply->set_votekickreplytype(VoteKickReplyMessage::voteKickDeniedAlreadyVoted); - break; - default: - netVoteReply->set_votekickreplytype(VoteKickReplyMessage::voteKickDeniedInvalid); - break; + case VOTE_DENIED_ALREADY_VOTED : + netVoteReply->set_votekickreplytype(VoteKickReplyMessage::voteKickDeniedAlreadyVoted); + break; + default: + netVoteReply->set_votekickreplytype(VoteKickReplyMessage::voteKickDeniedInvalid); + break; } GetLobbyThread().GetSender().Send(byWhom, packet); } diff --git a/src/net/common/serverlobbythread.cpp b/src/net/common/serverlobbythread.cpp index 44719f81..ec6234c9 100644 --- a/src/net/common/serverlobbythread.cpp +++ b/src/net/common/serverlobbythread.cpp @@ -904,7 +904,7 @@ ServerLobbyThread::HandlePacket(boost::shared_ptr session, boost::s } else if (packet->GetMsg()->messagetype() == PokerTHMessage::Type_JoinExistingGameMessage) { HandleNetPacketJoinGame(session, packet->GetMsg()->joinexistinggamemessage()); } else if (packet->GetMsg()->messagetype() == PokerTHMessage::Type_RejoinExistingGameMessage) { - HandleNetPacketRejoinGame(session, packet->GetMsg()->rejoinexistinggamemessage()); + HandleNetPacketRejoinGame(session, packet->GetMsg()->rejoinexistinggamemessage()); } else if (packet->GetMsg()->messagetype() == PokerTHMessage::Type_ChatRequestMessage) { HandleNetPacketChatRequest(session, packet->GetMsg()->chatrequestmessage()); } else if (packet->GetMsg()->messagetype() == PokerTHMessage::Type_RejectGameInvitationMessage) { diff --git a/src/net/common/uploadhelper.cpp b/src/net/common/uploadhelper.cpp index f7f3a9ed..b2440209 100644 --- a/src/net/common/uploadhelper.cpp +++ b/src/net/common/uploadhelper.cpp @@ -74,9 +74,9 @@ UploadHelper::InternalInit(const string &/*url*/, const string &targetFileName, // Curl will handle file I/O. struct curl_httppost *last = NULL; curl_formadd(&GetData()->post, &last, - CURLFORM_COPYNAME, httpPost.c_str(), - CURLFORM_FILE, targetFileName.c_str(), - CURLFORM_END); + CURLFORM_COPYNAME, httpPost.c_str(), + CURLFORM_FILE, targetFileName.c_str(), + CURLFORM_END); curl_easy_setopt(GetData()->curlHandle, CURLOPT_HTTPPOST, GetData()->post); curl_easy_setopt(GetData()->curlHandle, CURLOPT_WRITEFUNCTION, writeFunction); curl_easy_setopt(GetData()->curlHandle, CURLOPT_WRITEDATA, &GetData()->returnMessage); diff --git a/src/pokerth.cpp b/src/pokerth.cpp index 8ff5cff7..0495ada4 100755 --- a/src/pokerth.cpp +++ b/src/pokerth.cpp @@ -64,102 +64,102 @@ class Game; int main( int argc, char **argv ) { - //ENABLE_LEAK_CHECK(); + //ENABLE_LEAK_CHECK(); - //_CrtSetBreakAlloc(49937); - socket_startup(); - curl_global_init(CURL_GLOBAL_NOTHING); + //_CrtSetBreakAlloc(49937); + socket_startup(); + curl_global_init(CURL_GLOBAL_NOTHING); - /////// can be removed for non-qt-guis //////////// - QtSingleApplication a( argc, argv ); + /////// can be removed for non-qt-guis //////////// + QtSingleApplication a( argc, argv ); - if (a.sendMessage("Wake up!")) { - return 0; - } + if (a.sendMessage("Wake up!")) { + return 0; + } #ifdef __APPLE__ - // The following needs to be done directly after the application is created. - QDir dir(QApplication::applicationDirPath()); - dir.cdUp(); - dir.cd("plugins"); - QApplication::setLibraryPaths(QStringList(dir.absolutePath())); + // The following needs to be done directly after the application is created. + QDir dir(QApplication::applicationDirPath()); + dir.cdUp(); + dir.cd("plugins"); + QApplication::setLibraryPaths(QStringList(dir.absolutePath())); #endif - //create defaultconfig - ConfigFile *myConfig = new ConfigFile(argv[0], false); - Log *myLog = new Log(myConfig); + //create defaultconfig + ConfigFile *myConfig = new ConfigFile(argv[0], false); + Log *myLog = new Log(myConfig); - // set PlastiqueStyle even for mac-version to prevent artefacts on styled widgets - a.setStyle(new QPlastiqueStyle); - - QString myAppDataPath = QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str()); - //set QApplication default font + // set PlastiqueStyle even for mac-version to prevent artefacts on styled widgets + a.setStyle(new QPlastiqueStyle); - QFontDatabase::addApplicationFont (myAppDataPath +"fonts/n019003l.pfb"); - QFontDatabase::addApplicationFont (myAppDataPath +"fonts/VeraBd.ttf"); - QFontDatabase::addApplicationFont (myAppDataPath +"fonts/c059013l.pfb"); - QFontDatabase::addApplicationFont (myAppDataPath +"fonts/DejaVuSans-Bold.ttf"); + QString myAppDataPath = QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str()); + //set QApplication default font + + QFontDatabase::addApplicationFont (myAppDataPath +"fonts/n019003l.pfb"); + QFontDatabase::addApplicationFont (myAppDataPath +"fonts/VeraBd.ttf"); + QFontDatabase::addApplicationFont (myAppDataPath +"fonts/c059013l.pfb"); + QFontDatabase::addApplicationFont (myAppDataPath +"fonts/DejaVuSans-Bold.ttf"); #ifdef _WIN32 - QString font1String("QApplication, QWidget, QDialog { font-size: 12px; }"); + QString font1String("QApplication, QWidget, QDialog { font-size: 12px; }"); #elif __APPLE__ - // QString font1String("font-family: \"Lucida Grande\";"); - QString font1String("QApplication, QWidget, QDialog { font-size: 11px; }"); + // QString font1String("font-family: \"Lucida Grande\";"); + QString font1String("QApplication, QWidget, QDialog { font-size: 11px; }"); #elif ANDROID - QString font1String("QApplication, QWidget, QDialog { font-family: \"Nimbus Sans L\"; font-size: 26px; }"); - QPalette p = a.palette(); - p.setColor(QPalette::Button, QColor::fromRgb(80,80,80)); - p.setColor(QPalette::Base, QColor::fromRgb(80,80,80)); - p.setColor(QPalette::Window, QColor::fromRgb(50,50,50)); - p.setColor(QPalette::ButtonText, QColor::fromRgb(255,255,255)); - p.setColor(QPalette::Disabled, QPalette::ButtonText, QColor::fromRgb(100,100,100)); - p.setColor(QPalette::WindowText, QColor::fromRgb(255,255,255)); - p.setColor(QPalette::Disabled, QPalette::WindowText, QColor::fromRgb(100,100,100)); - p.setColor(QPalette::Text, QColor::fromRgb(255,255,255)); - p.setColor(QPalette::Disabled, QPalette::Text, QColor::fromRgb(100,100,100)); - p.setColor(QPalette::Link, QColor::fromRgb(192,192,255)); - p.setColor(QPalette::LinkVisited, QColor::fromRgb(192,192,255)); - a.setPalette(p); + QString font1String("QApplication, QWidget, QDialog { font-family: \"Nimbus Sans L\"; font-size: 26px; }"); + QPalette p = a.palette(); + p.setColor(QPalette::Button, QColor::fromRgb(80,80,80)); + p.setColor(QPalette::Base, QColor::fromRgb(80,80,80)); + p.setColor(QPalette::Window, QColor::fromRgb(50,50,50)); + p.setColor(QPalette::ButtonText, QColor::fromRgb(255,255,255)); + p.setColor(QPalette::Disabled, QPalette::ButtonText, QColor::fromRgb(100,100,100)); + p.setColor(QPalette::WindowText, QColor::fromRgb(255,255,255)); + p.setColor(QPalette::Disabled, QPalette::WindowText, QColor::fromRgb(100,100,100)); + p.setColor(QPalette::Text, QColor::fromRgb(255,255,255)); + p.setColor(QPalette::Disabled, QPalette::Text, QColor::fromRgb(100,100,100)); + p.setColor(QPalette::Link, QColor::fromRgb(192,192,255)); + p.setColor(QPalette::LinkVisited, QColor::fromRgb(192,192,255)); + a.setPalette(p); #else - QString font1String("QApplication, QWidget, QDialog { font-family: \"Nimbus Sans L\"; font-size: 12px; }"); + QString font1String("QApplication, QWidget, QDialog { font-family: \"Nimbus Sans L\"; font-size: 12px; }"); #endif - a.setStyleSheet(font1String + " QDialogButtonBox, QMessageBox { dialogbuttonbox-buttons-have-icons: 1; dialog-ok-icon: url(:/gfx/dialog_ok_apply.png); dialog-cancel-icon: url(:/gfx/dialog_close.png); dialog-close-icon: url(:/gfx/dialog_close.png); dialog-yes-icon: url(:/gfx/dialog_ok_apply.png); dialog-no-icon: url(:/gfx/dialog_close.png) }"); + a.setStyleSheet(font1String + " QDialogButtonBox, QMessageBox { dialogbuttonbox-buttons-have-icons: 1; dialog-ok-icon: url(:/gfx/dialog_ok_apply.png); dialog-cancel-icon: url(:/gfx/dialog_close.png); dialog-close-icon: url(:/gfx/dialog_close.png); dialog-yes-icon: url(:/gfx/dialog_ok_apply.png); dialog-no-icon: url(:/gfx/dialog_close.png) }"); - QPixmap pixmap(myAppDataPath + "gfx/gui/misc/welcomepokerth.png"); + QPixmap pixmap(myAppDataPath + "gfx/gui/misc/welcomepokerth.png"); #ifdef ANDROID - QDesktopWidget dw; - pixmap = pixmap.scaled(dw.screenGeometry().width(), dw.screenGeometry().height(), Qt::IgnoreAspectRatio, Qt::SmoothTransformation); + QDesktopWidget dw; + pixmap = pixmap.scaled(dw.screenGeometry().width(), dw.screenGeometry().height(), Qt::IgnoreAspectRatio, Qt::SmoothTransformation); #endif - StartSplash splash(pixmap); - if(!myConfig->readConfigInt("DisableSplashScreenOnStartup")) { - splash.show(); - splash.showMessage(QString("Version %1").arg(POKERTH_BETA_RELEASE_STRING), 0x0042, QColor(255,255,255)); - } + StartSplash splash(pixmap); + if(!myConfig->readConfigInt("DisableSplashScreenOnStartup")) { + splash.show(); + splash.showMessage(QString("Version %1").arg(POKERTH_BETA_RELEASE_STRING), 0x0042, QColor(255,255,255)); + } - //Set translations - QTranslator qtTranslator; - qtTranslator.load(QString(myAppDataPath +"translations/qt_") + QString::fromStdString(myConfig->readConfigString("Language"))); - a.installTranslator(&qtTranslator); + //Set translations + QTranslator qtTranslator; + qtTranslator.load(QString(myAppDataPath +"translations/qt_") + QString::fromStdString(myConfig->readConfigString("Language"))); + a.installTranslator(&qtTranslator); - QTranslator translator; - translator.load(QString(myAppDataPath +"translations/pokerth_") + QString::fromStdString(myConfig->readConfigString("Language"))); - a.installTranslator(&translator); + QTranslator translator; + translator.load(QString(myAppDataPath +"translations/pokerth_") + QString::fromStdString(myConfig->readConfigString("Language"))); + a.installTranslator(&translator); - qRegisterMetaType("unsigned"); - qRegisterMetaType >("boost::shared_ptr"); - qRegisterMetaType("ServerStats"); - qRegisterMetaType("DenyGameInvitationReason"); - /////////////////////////////////////////////////// + qRegisterMetaType("unsigned"); + qRegisterMetaType >("boost::shared_ptr"); + qRegisterMetaType("ServerStats"); + qRegisterMetaType("DenyGameInvitationReason"); + /////////////////////////////////////////////////// - startWindowImpl mainWin(myConfig,myLog); - a.setActivationWindow(&mainWin, true); + startWindowImpl mainWin(myConfig,myLog); + a.setActivationWindow(&mainWin, true); - int retVal = a.exec(); + int retVal = a.exec(); - curl_global_cleanup(); - socket_cleanup(); + curl_global_cleanup(); + socket_cleanup(); - return retVal; + return retVal; } diff --git a/src/session.cpp b/src/session.cpp index 8778e28e..da6f5307 100755 --- a/src/session.cpp +++ b/src/session.cpp @@ -91,7 +91,7 @@ void Session::startLocalGame(const GameData &gameData, const StartData &startDat currentGame.reset(); - currentGameNum++; + currentGameNum++; myGui->initGui(gameData.guiSpeed); @@ -177,10 +177,10 @@ void Session::startInternetClient() myNetClient->Init( myConfig->readConfigString("InternetServerAddress"), // myConfig->readConfigString("InternetServerListAddress"), - "pokerth.net/serverlist_testing.xml.z", + "pokerth.net/serverlist_testing.xml.z", myConfig->readConfigString("ServerPassword"), // myConfig->readConfigInt("InternetServerConfigMode") == 0, - true, + true, myConfig->readConfigInt("InternetServerPort"), myConfig->readConfigInt("InternetServerUseIpv6") == 1, myConfig->readConfigInt("InternetServerUseSctp") == 1,