diff --git a/pokerth_game.pro b/pokerth_game.pro index 20fb447d..6ba5115e 100644 --- a/pokerth_game.pro +++ b/pokerth_game.pro @@ -37,6 +37,7 @@ INCLUDEPATH += . \ src/gui/qt/newlocalgamedialog \ src/gui/qt/settingsdialog \ src/gui/qt/settingsdialog/selectavatardialog \ + src/gui/qt/settingsdialog/manualblindsorderdialog \ src/gui/qt/startnetworkgamedialog \ src/gui/qt/changehumanplayernamedialog \ src/gui/qt/gamelobbydialog \ @@ -70,6 +71,7 @@ DEPENDPATH += . \ src/gui/qt/newlocalgamedialog \ src/gui/qt/settingsdialog \ src/gui/qt/settingsdialog/selectavatardialog \ + src/gui/qt/settingsdialog/manualblindsorderdialog \ src/gui/qt/startnetworkgamedialog \ src/gui/qt/changehumanplayernamedialog \ src/gui/qt/gamelobbydialog \ @@ -144,6 +146,7 @@ HEADERS += \ src/gui/qt/settingsdialog/myhpavatarbutton.h \ src/gui/qt/settingsdialog/selectavatardialog/selectavatardialogimpl.h \ src/gui/qt/settingsdialog/selectavatardialog/myavatarlistitem.h \ + src/gui/qt/settingsdialog/manualblindsorderdialog/manualblindsorderdialogimpl.h \ src/gui/qt/startnetworkgamedialog/startnetworkgamedialogimpl.h \ src/gui/qt/changehumanplayernamedialog/changehumanplayernamedialogimpl.h \ src/gui/qt/gamelobbydialog/gamelobbydialogimpl.h \ @@ -165,7 +168,8 @@ FORMS += \ src/gui/qt/selectavatardialog.ui \ src/gui/qt/startnetworkgamedialog.ui \ src/gui/qt/changehumanplayernamedialog.ui \ - src/gui/qt/gamelobbydialog.ui + src/gui/qt/gamelobbydialog.ui \ + src/gui/qt/manualblindsorderdialog.ui SOURCES += \ src/pokerth.cpp \ @@ -191,6 +195,7 @@ SOURCES += \ src/gui/qt/settingsdialog/myhpavatarbutton.cpp \ src/gui/qt/settingsdialog/selectavatardialog/selectavatardialogimpl.cpp \ src/gui/qt/settingsdialog/selectavatardialog/myavatarlistitem.cpp \ + src/gui/qt/settingsdialog/manualblindsorderdialog/manualblindsorderdialogimpl.cpp \ src/gui/qt/startnetworkgamedialog/startnetworkgamedialogimpl.cpp \ src/gui/qt/changehumanplayernamedialog/changehumanplayernamedialogimpl.cpp \ src/gui/qt/gamelobbydialog/gamelobbydialogimpl.cpp \ diff --git a/src/config/configfile.cpp b/src/config/configfile.cpp index 0c798c12..66b11640 100644 --- a/src/config/configfile.cpp +++ b/src/config/configfile.cpp @@ -55,7 +55,7 @@ ConfigFile::ConfigFile(int argc, char **argv) : noWriteAccess(0) if(strcmp(argv[i], "--nowriteaccess") == 0) { noWriteAccess = 1; } } // !!!! Revisionsnummer der Configdefaults !!!!! - configRev = 35; + configRev = 37; //standard defaults logOnOffDefault = "1"; @@ -168,16 +168,26 @@ ConfigFile::ConfigFile(int argc, char **argv) : noWriteAccess(0) configList.push_back(ConfigInfo("FlipsideOwnFile", CONFIG_TYPE_STRING, "")); configList.push_back(ConfigInfo("NumberOfPlayers", CONFIG_TYPE_INT, "7")); configList.push_back(ConfigInfo("StartCash", CONFIG_TYPE_INT, "3000")); - configList.push_back(ConfigInfo("SmallBlind", CONFIG_TYPE_INT, "10")); - configList.push_back(ConfigInfo("HandsBeforeRaiseSmallBlind", CONFIG_TYPE_INT, "8")); + configList.push_back(ConfigInfo("FirstSmallBlind", CONFIG_TYPE_INT, "10")); + configList.push_back(ConfigInfo("RaiseBlindsAtHands", CONFIG_TYPE_INT, "1")); + configList.push_back(ConfigInfo("RaiseBlindsAtMinutes", CONFIG_TYPE_INT, "0")); + configList.push_back(ConfigInfo("RaiseSmallBlindEveryHands", CONFIG_TYPE_INT, "8")); + configList.push_back(ConfigInfo("RaiseSmallBlindEveryMinutes", CONFIG_TYPE_INT, "5")); + configList.push_back(ConfigInfo("AlwaysDoubleBlinds", CONFIG_TYPE_INT, "1")); + configList.push_back(ConfigInfo("ManualBlindsOrder", CONFIG_TYPE_INT, "0")); configList.push_back(ConfigInfo("GameSpeed", CONFIG_TYPE_INT, "4")); configList.push_back(ConfigInfo("EngineVersion", CONFIG_TYPE_INT, "0")); configList.push_back(ConfigInfo("PauseBetweenHands", CONFIG_TYPE_INT, "0")); configList.push_back(ConfigInfo("ShowGameSettingsDialogOnNewGame", CONFIG_TYPE_INT, "1")); configList.push_back(ConfigInfo("NetNumberOfPlayers", CONFIG_TYPE_INT, "7")); configList.push_back(ConfigInfo("NetStartCash", CONFIG_TYPE_INT, "3000")); - configList.push_back(ConfigInfo("NetSmallBlind", CONFIG_TYPE_INT, "10")); - configList.push_back(ConfigInfo("NetHandsBeforeRaiseSmallBlind", CONFIG_TYPE_INT, "8")); + configList.push_back(ConfigInfo("NetFirstSmallBlind", CONFIG_TYPE_INT, "10")); + configList.push_back(ConfigInfo("NetRaiseBlindsAtHands", CONFIG_TYPE_INT, "1")); + configList.push_back(ConfigInfo("NetRaiseBlindsAtMinutes", CONFIG_TYPE_INT, "0")); + configList.push_back(ConfigInfo("NetRaiseSmallBlindEveryHands", CONFIG_TYPE_INT, "8")); + configList.push_back(ConfigInfo("NetRaiseSmallBlindEveryMinutes", CONFIG_TYPE_INT, "5")); + configList.push_back(ConfigInfo("NetAlwaysDoubleBlinds", CONFIG_TYPE_INT, "1")); + configList.push_back(ConfigInfo("NetManualBlindsOrder", CONFIG_TYPE_INT, "0")); configList.push_back(ConfigInfo("NetGameSpeed", CONFIG_TYPE_INT, "4")); configList.push_back(ConfigInfo("NetEngineVersion", CONFIG_TYPE_INT, "0")); configList.push_back(ConfigInfo("NetTimeOutPlayerAction", CONFIG_TYPE_INT, "20")); @@ -429,26 +439,6 @@ string ConfigFile::readConfigString(string varName) const size_t i; string tempString(""); -// TiXmlDocument doc(configFileName); -// if(!doc.LoadFile()) { cout << "Could Not Load Config-File!!! " << configFileName << "\n"; } -// TiXmlHandle docHandle( &doc ); -// -// TiXmlElement* conf = docHandle.FirstChild( "PokerTH" ).FirstChild( "Configuration" ).FirstChild( varName ).ToElement(); -// if ( conf ) { -// const char *tmpStr = conf->Attribute("value"); -// if (tmpStr) tempString = tmpStr; -// } /*else { -// //Wenn nicht gefunden eines neues Anlegen -// TiXmlElement* config = docHandle.FirstChild( "PokerTH" ).FirstChild( "Configuration" ).ToElement(); -// if ( config ) { -// TiXmlElement * confElement1 = new TiXmlElement( varName ); -// config->LinkEndChild( confElement1 ); -// confElement1->SetAttribute("value", defaultValue); -// if(!doc.SaveFile()) { cout << "Could Not Save Config-File!!! " << configFileName << "\n"; } -// -// return readConfigString(varName, defaultValue); -// } -// }*/ for (i=0; iQueryIntAttribute("value", &tempInt ); -// // cout << varName << " : " << tempInt << "\n"; -// } /*else { -// // Wenn nicht gefunden eines neues Anlegen -// TiXmlElement* config = docHandle.FirstChild( "PokerTH" ).FirstChild( "Configuration" ).ToElement(); -// if ( config ) { -// TiXmlElement * confElement1 = new TiXmlElement( varName ); -// config->LinkEndChild( confElement1 ); -// confElement1->SetAttribute("value", defaultValue); -// if(!doc.SaveFile()) { cout << "Could Not Save Config-File!!! " << configFileName << "\n"; } -// -// return readConfigInt(varName, defaultValue); -// } -// }*/ - for (i=0; isetValue(myConfig->readConfigInt("NetNumberOfPlayers")); spinBox_startCash->setValue(myConfig->readConfigInt("NetStartCash")); - spinBox_smallBlind->setValue(myConfig->readConfigInt("NetSmallBlind")); - spinBox_handsBeforeRaiseSmallBlind->setValue(myConfig->readConfigInt("NetHandsBeforeRaiseSmallBlind")); + spinBox_smallBlind->setValue(myConfig->readConfigInt("NetFirstSmallBlind")); + spinBox_handsBeforeRaiseSmallBlind->setValue(myConfig->readConfigInt("NetRaiseSmallBlindEveryHands")); //temporarely unused until ai is enabled in network spinBox_gameSpeed->setValue(myConfig->readConfigInt("NetGameSpeed")); spinBox_netTimeOutPlayerAction->setValue(myConfig->readConfigInt("NetTimeOutPlayerAction")); diff --git a/src/gui/qt/createnetworkgamedialog/createnetworkgamedialogimpl.cpp b/src/gui/qt/createnetworkgamedialog/createnetworkgamedialogimpl.cpp index 15e4c26d..548f687e 100644 --- a/src/gui/qt/createnetworkgamedialog/createnetworkgamedialogimpl.cpp +++ b/src/gui/qt/createnetworkgamedialog/createnetworkgamedialogimpl.cpp @@ -59,8 +59,8 @@ void createNetworkGameDialogImpl::fillFormular() { //Network Game Settings spinBox_quantityPlayers->setValue(myConfig->readConfigInt("NetNumberOfPlayers")); spinBox_startCash->setValue(myConfig->readConfigInt("NetStartCash")); - spinBox_smallBlind->setValue(myConfig->readConfigInt("NetSmallBlind")); - spinBox_handsBeforeRaiseSmallBlind->setValue(myConfig->readConfigInt("NetHandsBeforeRaiseSmallBlind")); + spinBox_smallBlind->setValue(myConfig->readConfigInt("NetFirstSmallBlind")); + spinBox_handsBeforeRaiseSmallBlind->setValue(myConfig->readConfigInt("NetRaiseSmallBlindEveryHands")); //temporarely unused until ai is enabled in network spinBox_gameSpeed->setValue(myConfig->readConfigInt("NetGameSpeed")); spinBox_netTimeOutPlayerAction->setValue(myConfig->readConfigInt("NetTimeOutPlayerAction")); diff --git a/src/gui/qt/mainwindow/mainwindowimpl.cpp b/src/gui/qt/mainwindow/mainwindowimpl.cpp index 44d3f48a..b473922b 100755 --- a/src/gui/qt/mainwindow/mainwindowimpl.cpp +++ b/src/gui/qt/mainwindow/mainwindowimpl.cpp @@ -724,8 +724,8 @@ void mainWindowImpl::startNewLocalGame(newGameDialogImpl *v) { // Set Game Data gameData.maxNumberOfPlayers = myConfig->readConfigInt("NumberOfPlayers"); gameData.startMoney = myConfig->readConfigInt("StartCash"); - gameData.smallBlind = myConfig->readConfigInt("SmallBlind"); - gameData.handsBeforeRaise = myConfig->readConfigInt("HandsBeforeRaiseSmallBlind"); + gameData.smallBlind = myConfig->readConfigInt("FirstSmallBlind"); + gameData.handsBeforeRaise = myConfig->readConfigInt("RaiseSmallBlindEveryHands"); //Speeds gameData.guiSpeed = myConfig->readConfigInt("GameSpeed"); } diff --git a/src/gui/qt/manualblindsorderdialog.ui b/src/gui/qt/manualblindsorderdialog.ui new file mode 100644 index 00000000..01fe4ada --- /dev/null +++ b/src/gui/qt/manualblindsorderdialog.ui @@ -0,0 +1,185 @@ + + manualBlindsOrderDialog + + + + 0 + 0 + 248 + 407 + + + + Manual Blinds Order + + + + + + 4 + + + + + true + + + + + + + Delete + + + + + + + Qt::Vertical + + + + 20 + 121 + + + + + + + + 9999 + + + + + + + Add + + + + + + + + + After this: + + + + + + Always double blinds + + + true + + + + + + + + + Always raise about: + + + + + + + + + + $ + + + + + + + + + Stay at last blind + + + + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::NoButton|QDialogButtonBox::Ok + + + + + + + listWidget_blinds + spinBox_input + pushButton_add + pushButton_delete + radioButton_alwaysDoubleBlinds + radioButton_alwaysRaiseAbout + spinBox_AfterThisAlwaysRaiseValue + radioButton_stayAtLastBlind + buttonBox + + + + + buttonBox + accepted() + manualBlindsOrderDialog + accept() + + + 228 + 394 + + + 157 + 274 + + + + + buttonBox + rejected() + manualBlindsOrderDialog + reject() + + + 270 + 400 + + + 286 + 274 + + + + + radioButton_alwaysRaiseAbout + toggled(bool) + spinBox_AfterThisAlwaysRaiseValue + setEnabled(bool) + + + 109 + 307 + + + 173 + 303 + + + + + diff --git a/src/gui/qt/newlocalgamedialog/newgamedialogimpl.cpp b/src/gui/qt/newlocalgamedialog/newgamedialogimpl.cpp index 50b8a5c2..c10cf414 100755 --- a/src/gui/qt/newlocalgamedialog/newgamedialogimpl.cpp +++ b/src/gui/qt/newlocalgamedialog/newgamedialogimpl.cpp @@ -33,9 +33,9 @@ void newGameDialogImpl::exec() { spinBox_quantityPlayers->setValue(myConfig->readConfigInt("NumberOfPlayers")); spinBox_startCash->setValue(myConfig->readConfigInt("StartCash")); - spinBox_smallBlind->setValue(myConfig->readConfigInt("SmallBlind")); + spinBox_smallBlind->setValue(myConfig->readConfigInt("FirstSmallBlind")); spinBox_gameSpeed->setValue(myConfig->readConfigInt("GameSpeed")); - spinBox_handsBeforeRaiseSmallBlind->setValue(myConfig->readConfigInt("HandsBeforeRaiseSmallBlind")); + spinBox_handsBeforeRaiseSmallBlind->setValue(myConfig->readConfigInt("RaiseSmallBlindEveryHands")); QDialog::exec(); diff --git a/src/gui/qt/settingsdialog.ui b/src/gui/qt/settingsdialog.ui index 2cae2be3..75a7b8b6 100644 --- a/src/gui/qt/settingsdialog.ui +++ b/src/gui/qt/settingsdialog.ui @@ -6,7 +6,7 @@ 0 0 632 - 571 + 606 @@ -394,68 +394,260 @@ p, li { white-space: pre-wrap; } - - 9 - - - 9 - - - 9 - - - 9 - - - 6 - - - 6 - - - + + + + QLabel { font-weight: bold; } + - Show game settings dialog on every new game + Local Game Settings - - - - 1 - - - 11 - - - 1 - - - - - - - 2 - - - 7 - - - 7 - - - - - - - Hands before raise blinds: + + + + Qt::Horizontal - + + + + + Number of players: + + + + + + + 2 + + + 7 + + + 7 + + + + + + + + + + + Start Cash: + + + + + + + 1000 + + + 5000 + + + + + + + + + + + First small blind: + + + + + + + 5 + + + 500 + + + + + + + + + + + Raise blinds: + + + + 9 + + + 0 + + + 9 + + + + + Every: + + + true + + + + + + + + + + + 0 + 0 + + + + hands + + + + + + + Every: + + + + + + + + + + + 0 + 0 + + + + minutes + + + + + + + + + + + 0 + 0 + + + + Raise mode: + + + + 0 + + + + + Always double blinds + + + true + + + + + + + Manual blinds order: + + + + + + + false + + + Edit ... + + + + + + + + + + + + + + Game Speed: + + + + + + + 1 + + + 11 + + + 1 + + + + + + + + + + + Engine Version: + + + + + + + + 0.4 (current) + + + + + + + + - Number of players: + Pause between hands (press "start" button to go on) + + + + + + + Show game settings dialog on every new game @@ -467,125 +659,284 @@ p, li { white-space: pre-wrap; } 20 - 20 + 141 - - - - QLabel { font-weight: bold; } - - - Local Game Settings - - - - - - - Qt::Horizontal - - - - - - - 5 - - - 500 - - - - - - - Small Blind: - - - - - - - 1000 - - - 5000 - - - - - - - Game Speed: - - - - - - - Start Cash: - - - - - - - Pause between hands (press "start" button to go on) - - - - - - - 1 - - - 9 - - - - - - - - 0.4 (current) - - - - - - - - Engine Version: - - - - - 9 - - - 9 - - - 9 - - - 9 - - - 6 - - - 6 - + + + + QLabel { font-weight: bold; } + + + Network Game Settings + + + + + + + Qt::Horizontal + + + + + + + + + Maximum number of players: + + + + + + + 2 + + + 7 + + + 7 + + + + + + + + + + + Start Cash: + + + + + + + 1000 + + + 5000 + + + + + + + + + + First small blind: + + + + + + + 5 + + + 500 + + + + + + + + + + + Raise blinds: + + + + 0 + + + + + Every: + + + true + + + + + + + + + + + 0 + 0 + + + + hands + + + + + + + Every: + + + + + + + + + + + 0 + 0 + + + + minutes + + + + + + + + + + + 0 + 0 + + + + Raise mode: + + + + 0 + + + + + Always double blinds + + + true + + + + + + + Manual blinds order: + + + + + + + false + + + Edit ... + + + + + + + + + + + + + + Game Speed for computer opponents: + + + + + + + 1 + + + 11 + + + 1 + + + + + + + + + + + Engine Version for computer opponents: + + + + + + + + 0.4 (current) + + + + + + + + + + + + Timeout for player action (sec): + + + + + + + 5 + + + 60 + + + 20 + + + + + + + + + Qt::Horizontal + + + + Network Server Settings @@ -595,7 +946,7 @@ p, li { white-space: pre-wrap; } 9 - 9 + 0 9 @@ -683,180 +1034,7 @@ p, li { white-space: pre-wrap; } - - - - Qt::Horizontal - - - - - - - QLabel { font-weight: bold; } - - - Network Game Settings - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - 6 - - - 6 - - - - - 1 - - - 9 - - - - - - - 1000 - - - 5000 - - - - - - - 2 - - - 7 - - - 7 - - - - - - - 1 - - - 11 - - - 1 - - - - - - - Small Blind: - - - - - - - Game Speed for computer opponents: - - - - - - - Maximum number of players: - - - - - - - - 0.4 (current) - - - - - - - - Engine Version for computer opponents: - - - - - - - Start Cash: - - - - - - - 5 - - - 500 - - - - - - - Hands before raise blinds: - - - - - - - Timeout for player action (sec): - - - - - - - 5 - - - 60 - - - 20 - - - - - - - - - Qt::Horizontal - - - - + Qt::Vertical @@ -2800,16 +2978,14 @@ p, li { white-space: pre-wrap; } pushButton_openFlipsidePicture spinBox_quantityPlayers spinBox_startCash - spinBox_smallBlind - spinBox_handsBeforeRaiseSmallBlind + spinBox_firstSmallBlind spinBox_gameSpeed comboBox_engineVersion checkBox_pauseBetweenHands checkBox_showGameSettingsDialogOnNewGame spinBox_netQuantityPlayers spinBox_netStartCash - spinBox_netSmallBlind - spinBox_netHandsBeforeRaiseSmallBlind + spinBox_netFirstSmallBlind spinBox_netGameSpeed comboBox_netEngineVersion spinBox_netTimeOutPlayerAction @@ -2862,12 +3038,12 @@ p, li { white-space: pre-wrap; } setEnabled(bool) - 308 - 356 + 360 + 395 - 540 - 355 + 571 + 395 @@ -2878,12 +3054,12 @@ p, li { white-space: pre-wrap; } setEnabled(bool) - 308 - 356 + 360 + 395 - 567 - 356 + 600 + 396 @@ -2894,8 +3070,8 @@ p, li { white-space: pre-wrap; } accept() - 480 - 578 + 489 + 596 354 @@ -2910,8 +3086,8 @@ p, li { white-space: pre-wrap; } reject() - 568 - 578 + 577 + 596 599 @@ -2926,11 +3102,11 @@ p, li { white-space: pre-wrap; } setEnabled(bool) - 409 + 314 327 - 600 + 515 328 @@ -2951,5 +3127,37 @@ p, li { white-space: pre-wrap; } + + radioButton_manualBlindsOrder + toggled(bool) + pushButton_editManualBlindsOrder + setEnabled(bool) + + + 557 + 219 + + + 498 + 248 + + + + + radioButton_netManualBlindsOrder + toggled(bool) + pushButton_netEditManualBlindsOrder + setEnabled(bool) + + + 463 + 212 + + + 521 + 244 + + + diff --git a/src/gui/qt/settingsdialog/manualblindsorderdialog/manualblindsorderdialogimpl.cpp b/src/gui/qt/settingsdialog/manualblindsorderdialog/manualblindsorderdialogimpl.cpp new file mode 100644 index 00000000..5ef7a7c0 --- /dev/null +++ b/src/gui/qt/settingsdialog/manualblindsorderdialog/manualblindsorderdialogimpl.cpp @@ -0,0 +1,53 @@ +/*************************************************************************** + * Copyright (C) 2006 by FThauer FHammer * + * f.thauer@web.de * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#include "manualblindsorderdialogimpl.h" +#include "configfile.h" +#include + + +manualBlindsOrderDialogImpl::manualBlindsOrderDialogImpl(QWidget *parent, ConfigFile *c) + : QDialog(parent), myConfig(c), settingsCorrect(TRUE) +{ + + setupUi(this); + + connect( pushButton_add, SIGNAL( clicked() ), this, SLOT( addBlindValueToList() ) ); + connect( pushButton_delete, SIGNAL( clicked() ), this, SLOT( removeBlindFromList() ) ); + +} + +void manualBlindsOrderDialogImpl::exec() { + + + QDialog::exec(); +} + + +void manualBlindsOrderDialogImpl::addBlindValueToList() { + + listWidget_blinds->addItem(QString::number(spinBox_input->value(),10)); + listWidget_blinds->sortItems(); +} + +void manualBlindsOrderDialogImpl::removeBlindFromList() { + + listWidget_blinds->removeItemWidget(listWidget_blinds->currentItem()); + listWidget_blinds->sortItems(); +} diff --git a/src/gui/qt/settingsdialog/manualblindsorderdialog/manualblindsorderdialogimpl.h b/src/gui/qt/settingsdialog/manualblindsorderdialog/manualblindsorderdialogimpl.h new file mode 100644 index 00000000..61efb232 --- /dev/null +++ b/src/gui/qt/settingsdialog/manualblindsorderdialog/manualblindsorderdialogimpl.h @@ -0,0 +1,51 @@ +/*************************************************************************** + * Copyright (C) 2006 by FThauer FHammer * + * f.thauer@web.de * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#ifndef MANUALBLINDSORDERDIALOGIMPL_H +#define MANUALBLINDSORDERDIALOGIMPL_H + +#include "ui_manualblindsorderdialog.h" + +#include +#include + +class ConfigFile; + +class manualBlindsOrderDialogImpl: public QDialog, public Ui::manualBlindsOrderDialog { +Q_OBJECT +public: + manualBlindsOrderDialogImpl(QWidget *parent = 0, ConfigFile *c = 0); + + void exec(); + + +public slots: + bool getSettingsCorrect() const { return settingsCorrect;} + + void addBlindValueToList(); + void removeBlindFromList(); + +private: + + ConfigFile* myConfig; + + bool settingsCorrect; +}; + +#endif diff --git a/src/gui/qt/settingsdialog/settingsdialogimpl.cpp b/src/gui/qt/settingsdialog/settingsdialogimpl.cpp index e87ea73f..037359db 100644 --- a/src/gui/qt/settingsdialog/settingsdialogimpl.cpp +++ b/src/gui/qt/settingsdialog/settingsdialogimpl.cpp @@ -31,6 +31,8 @@ settingsDialogImpl::settingsDialogImpl(QWidget *parent, ConfigFile *c, selectAva setupUi(this); + myManualBlindsOrderDialog = new manualBlindsOrderDialogImpl; + myAppDataPath = QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str()); pushButton_openFlipsidePicture->setIcon(QIcon(QPixmap(myAppDataPath+"gfx/gui/misc/fileopen16.png"))); @@ -56,6 +58,9 @@ settingsDialogImpl::settingsDialogImpl(QWidget *parent, ConfigFile *c, selectAva connect( pushButton_Opponent5Avatar, SIGNAL( clicked() ), this, SLOT( setAvatarFile5()) ); connect( pushButton_Opponent6Avatar, SIGNAL( clicked() ), this, SLOT( setAvatarFile6()) ); + connect( pushButton_editManualBlindsOrder, SIGNAL( clicked() ), this, SLOT( callManualBlindsOrderDialog()) ); + connect( pushButton_netEditManualBlindsOrder, SIGNAL( clicked() ), this, SLOT( callNetManualBlindsOrderDialog()) ); + connect( checkBox_UseInternetGamePassword, SIGNAL( toggled(bool) ), this, SLOT( clearInternetGamePassword(bool)) ); //temporarely unused until ai is enabled in network @@ -103,8 +108,13 @@ void settingsDialogImpl::exec() { //Local Game Settings spinBox_quantityPlayers->setValue(myConfig->readConfigInt("NumberOfPlayers")); spinBox_startCash->setValue(myConfig->readConfigInt("StartCash")); - spinBox_smallBlind->setValue(myConfig->readConfigInt("SmallBlind")); - spinBox_handsBeforeRaiseSmallBlind->setValue(myConfig->readConfigInt("HandsBeforeRaiseSmallBlind")); + spinBox_firstSmallBlind->setValue(myConfig->readConfigInt("FirstSmallBlind")); + radioButton_raiseBlindsAtHands->setChecked(myConfig->readConfigInt("RaiseBlindsAtHands")); + radioButton_raiseBlindsAtMinutes->setChecked(myConfig->readConfigInt("RaiseBlindsAtMinutes")); + spinBox_raiseSmallBlindEveryHands->setValue(myConfig->readConfigInt("RaiseSmallBlindEveryHands")); + spinBox_raiseSmallBlindEveryMinutes->setValue(myConfig->readConfigInt("RaiseSmallBlindEveryMinutes")); + radioButton_alwaysDoubleBlinds->setChecked(myConfig->readConfigInt("AlwaysDoubleBlinds")); + radioButton_manualBlindsOrder->setChecked(myConfig->readConfigInt("ManualBlindsOrder")); spinBox_gameSpeed->setValue(myConfig->readConfigInt("GameSpeed")); checkBox_pauseBetweenHands->setChecked(myConfig->readConfigInt("PauseBetweenHands")); checkBox_showGameSettingsDialogOnNewGame->setChecked(myConfig->readConfigInt("ShowGameSettingsDialogOnNewGame")); @@ -113,8 +123,13 @@ void settingsDialogImpl::exec() { //Network Game Settings spinBox_netQuantityPlayers->setValue(myConfig->readConfigInt("NetNumberOfPlayers")); spinBox_netStartCash->setValue(myConfig->readConfigInt("NetStartCash")); - spinBox_netSmallBlind->setValue(myConfig->readConfigInt("NetSmallBlind")); - spinBox_netHandsBeforeRaiseSmallBlind->setValue(myConfig->readConfigInt("NetHandsBeforeRaiseSmallBlind")); + spinBox_netFirstSmallBlind->setValue(myConfig->readConfigInt("NetFirstSmallBlind")); + radioButton_netRaiseBlindsAtHands->setChecked(myConfig->readConfigInt("NetRaiseBlindsAtHands")); + radioButton_netRaiseBlindsAtMinutes->setChecked(myConfig->readConfigInt("NetRaiseBlindsAtMinutes")); + spinBox_netRaiseSmallBlindEveryHands->setValue(myConfig->readConfigInt("NetRaiseSmallBlindEveryHands")); + spinBox_netRaiseSmallBlindEveryMinutes->setValue(myConfig->readConfigInt("NetRaiseSmallBlindEveryMinutes")); + radioButton_netAlwaysDoubleBlinds->setChecked(myConfig->readConfigInt("NetAlwaysDoubleBlinds")); + radioButton_netManualBlindsOrder->setChecked(myConfig->readConfigInt("NetManualBlindsOrder")); spinBox_netGameSpeed->setValue(myConfig->readConfigInt("NetGameSpeed")); comboBox_netEngineVersion->setCurrentIndex(myConfig->readConfigInt("NetEngineVersion")); spinBox_netTimeOutPlayerAction->setValue(myConfig->readConfigInt("NetTimeOutPlayerAction")); @@ -200,8 +215,13 @@ void settingsDialogImpl::isAccepted() { // Local Game Settings myConfig->writeConfigInt("NumberOfPlayers", spinBox_quantityPlayers->value()); myConfig->writeConfigInt("StartCash", spinBox_startCash->value()); - myConfig->writeConfigInt("SmallBlind", spinBox_smallBlind->value()); - myConfig->writeConfigInt("HandsBeforeRaiseSmallBlind", spinBox_handsBeforeRaiseSmallBlind->value()); + myConfig->writeConfigInt("FirstSmallBlind", spinBox_firstSmallBlind->value()); + myConfig->writeConfigInt("RaiseBlindsAtHands", radioButton_raiseBlindsAtHands->isChecked()); + myConfig->writeConfigInt("RaiseBlindsAtMinutes", radioButton_raiseBlindsAtMinutes->isChecked()); + myConfig->writeConfigInt("RaiseSmallBlindEveryHands", spinBox_raiseSmallBlindEveryHands->value()); + myConfig->writeConfigInt("RaiseSmallBlindEveryMinutes", spinBox_raiseSmallBlindEveryMinutes->value()); + myConfig->writeConfigInt("AlwaysDoubleBlinds", radioButton_alwaysDoubleBlinds->isChecked()); + myConfig->writeConfigInt("ManualBlindsOrder", radioButton_manualBlindsOrder->isChecked()); myConfig->writeConfigInt("GameSpeed", spinBox_gameSpeed->value()); myConfig->writeConfigInt("EngineVersion", comboBox_engineVersion->currentIndex()); myConfig->writeConfigInt("PauseBetweenHands", checkBox_pauseBetweenHands->isChecked()); @@ -210,8 +230,13 @@ void settingsDialogImpl::isAccepted() { //Network Game Settings myConfig->writeConfigInt("NetNumberOfPlayers", spinBox_netQuantityPlayers->value()); myConfig->writeConfigInt("NetStartCash", spinBox_netStartCash->value()); - myConfig->writeConfigInt("NetSmallBlind", spinBox_netSmallBlind->value()); - myConfig->writeConfigInt("NetHandsBeforeRaiseSmallBlind", spinBox_netHandsBeforeRaiseSmallBlind->value()); + myConfig->writeConfigInt("NetFirstSmallBlind", spinBox_netFirstSmallBlind->value()); + myConfig->writeConfigInt("NetRaiseBlindsAtHands", radioButton_netRaiseBlindsAtHands->isChecked()); + myConfig->writeConfigInt("NetRaiseBlindsAtMinutes", radioButton_netRaiseBlindsAtMinutes->isChecked()); + myConfig->writeConfigInt("NetRaiseSmallBlindEveryHands", spinBox_netRaiseSmallBlindEveryHands->value()); + myConfig->writeConfigInt("NetRaiseSmallBlindEveryMinutes", spinBox_netRaiseSmallBlindEveryMinutes->value()); + myConfig->writeConfigInt("NetAlwaysDoubleBlinds", radioButton_netAlwaysDoubleBlinds->isChecked()); + myConfig->writeConfigInt("NetManualBlindsOrder", radioButton_netManualBlindsOrder->isChecked()); myConfig->writeConfigInt("NetGameSpeed", spinBox_netGameSpeed->value()); myConfig->writeConfigInt("NetEngineVersion", comboBox_netEngineVersion->currentIndex()); myConfig->writeConfigInt("NetTimeOutPlayerAction", spinBox_netTimeOutPlayerAction->value()); @@ -371,3 +396,5 @@ void settingsDialogImpl::clearInternetGamePassword(bool clear) { if(!clear) { lineEdit_InternetGamePassword->clear(); } } +void settingsDialogImpl::callManualBlindsOrderDialog() { myManualBlindsOrderDialog->exec(); } +void settingsDialogImpl::callNetManualBlindsOrderDialog() { myManualBlindsOrderDialog->exec(); } \ No newline at end of file diff --git a/src/gui/qt/settingsdialog/settingsdialogimpl.h b/src/gui/qt/settingsdialog/settingsdialogimpl.h index 876b0d68..8340325c 100644 --- a/src/gui/qt/settingsdialog/settingsdialogimpl.h +++ b/src/gui/qt/settingsdialog/settingsdialogimpl.h @@ -22,12 +22,14 @@ #include "ui_settingsdialog.h" #include "selectavatardialogimpl.h" +#include "manualblindsorderdialogimpl.h" #include #include class ConfigFile; class selectAvatarDialogImpl; +class manualBlindsOrderDialogImpl; class settingsDialogImpl: public QDialog, public Ui::settingsDialog { Q_OBJECT @@ -55,10 +57,15 @@ public slots: void setAvatarFile5(); void setAvatarFile6(); + void callManualBlindsOrderDialog(); + void callNetManualBlindsOrderDialog(); + void callSelectAvatarDialog() { mySelectAvatarDialogImpl->exec(); } void clearInternetGamePassword(bool); + + private: bool playerNickIsChanged; @@ -66,6 +73,7 @@ private: ConfigFile* myConfig; selectAvatarDialogImpl* mySelectAvatarDialogImpl; + manualBlindsOrderDialogImpl* myManualBlindsOrderDialog; QString myAppDataPath; };