2011-07-02 23:03:18 +00:00
|
|
|
/*****************************************************************************
|
|
|
|
|
* PokerTH - The open source texas holdem engine *
|
|
|
|
|
* Copyright (C) 2006-2011 Felix Hammer, Florian Thauer, Lothar May *
|
|
|
|
|
* *
|
|
|
|
|
* This program is free software: you can redistribute it and/or modify *
|
|
|
|
|
* it under the terms of the GNU Affero General Public License as *
|
|
|
|
|
* published by the Free Software Foundation, either version 3 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 Affero General Public License for more details. *
|
|
|
|
|
* *
|
|
|
|
|
* You should have received a copy of the GNU Affero General Public License *
|
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
|
|
|
|
|
*****************************************************************************/ #include "newgamedialogimpl.h"
|
2007-09-27 00:35:30 +00:00
|
|
|
#include "changecompleteblindsdialogimpl.h"
|
2007-01-17 23:57:41 +00:00
|
|
|
#include "configfile.h"
|
2007-01-13 02:40:33 +00:00
|
|
|
|
2007-11-26 23:28:57 +00:00
|
|
|
newGameDialogImpl::newGameDialogImpl(QMainWindow *parent, ConfigFile *c)
|
2011-02-11 20:02:08 +00:00
|
|
|
: QDialog(parent), myConfig(c)
|
2007-01-13 02:40:33 +00:00
|
|
|
{
|
2007-12-04 01:37:43 +00:00
|
|
|
#ifdef __APPLE__
|
2007-11-28 22:00:42 +00:00
|
|
|
setWindowModality(Qt::ApplicationModal);
|
|
|
|
|
setWindowFlags(Qt::WindowSystemMenuHint | Qt::CustomizeWindowHint | Qt::Dialog);
|
2011-02-11 20:02:08 +00:00
|
|
|
#endif
|
|
|
|
|
setupUi(this);
|
|
|
|
|
|
2007-09-27 00:35:30 +00:00
|
|
|
myChangeCompleteBlindsDialog = new changeCompleteBlindsDialogImpl;
|
2007-01-13 02:40:33 +00:00
|
|
|
|
2007-09-27 00:35:30 +00:00
|
|
|
connect( radioButton_changeBlindsSettings, SIGNAL( clicked(bool) ), this, SLOT( callChangeBlindsDialog(bool) ) );
|
2011-02-11 20:02:08 +00:00
|
|
|
|
2007-05-13 15:08:10 +00:00
|
|
|
}
|
|
|
|
|
|
2011-02-11 20:02:08 +00:00
|
|
|
void newGameDialogImpl::exec()
|
|
|
|
|
{
|
2007-05-13 15:08:10 +00:00
|
|
|
|
2007-05-13 12:35:27 +00:00
|
|
|
spinBox_quantityPlayers->setValue(myConfig->readConfigInt("NumberOfPlayers"));
|
|
|
|
|
spinBox_startCash->setValue(myConfig->readConfigInt("StartCash"));
|
|
|
|
|
spinBox_gameSpeed->setValue(myConfig->readConfigInt("GameSpeed"));
|
2007-09-27 00:35:30 +00:00
|
|
|
|
|
|
|
|
//fill changeCompleteBlindsDialog
|
|
|
|
|
myChangeCompleteBlindsDialog->spinBox_firstSmallBlind->setValue(myConfig->readConfigInt("FirstSmallBlind"));
|
|
|
|
|
myChangeCompleteBlindsDialog->radioButton_raiseBlindsAtHands->setChecked(myConfig->readConfigInt("RaiseBlindsAtHands"));
|
|
|
|
|
myChangeCompleteBlindsDialog->radioButton_raiseBlindsAtMinutes->setChecked(myConfig->readConfigInt("RaiseBlindsAtMinutes"));
|
|
|
|
|
myChangeCompleteBlindsDialog->spinBox_raiseSmallBlindEveryHands->setValue(myConfig->readConfigInt("RaiseSmallBlindEveryHands"));
|
|
|
|
|
myChangeCompleteBlindsDialog->spinBox_raiseSmallBlindEveryMinutes->setValue(myConfig->readConfigInt("RaiseSmallBlindEveryMinutes"));
|
|
|
|
|
myChangeCompleteBlindsDialog->radioButton_alwaysDoubleBlinds->setChecked(myConfig->readConfigInt("AlwaysDoubleBlinds"));
|
|
|
|
|
myChangeCompleteBlindsDialog->radioButton_manualBlindsOrder->setChecked(myConfig->readConfigInt("ManualBlindsOrder"));
|
|
|
|
|
|
|
|
|
|
myChangeCompleteBlindsDialog->listWidget_blinds->clear();
|
|
|
|
|
myChangeCompleteBlindsDialog->spinBox_input->setMinimum(myChangeCompleteBlindsDialog->spinBox_firstSmallBlind->value()+1);
|
|
|
|
|
|
|
|
|
|
std::list<int> myBlindsList = myConfig->readConfigIntList("ManualBlindsList");
|
|
|
|
|
std::list<int>::iterator it1;
|
2011-02-11 20:02:08 +00:00
|
|
|
|
2011-02-09 14:33:39 +00:00
|
|
|
for(it1= myBlindsList.begin(); it1 != myBlindsList.end(); ++it1) {
|
2007-09-27 00:35:30 +00:00
|
|
|
myChangeCompleteBlindsDialog->listWidget_blinds->addItem(QString::number(*it1,10));
|
|
|
|
|
}
|
|
|
|
|
myChangeCompleteBlindsDialog->sortBlindsList();
|
2011-02-11 20:02:08 +00:00
|
|
|
|
2007-09-27 00:35:30 +00:00
|
|
|
myChangeCompleteBlindsDialog->radioButton_afterThisAlwaysDoubleBlinds->setChecked(myConfig->readConfigInt("AfterMBAlwaysDoubleBlinds"));
|
|
|
|
|
myChangeCompleteBlindsDialog->radioButton_afterThisAlwaysRaiseAbout->setChecked(myConfig->readConfigInt("AfterMBAlwaysRaiseAbout"));
|
|
|
|
|
myChangeCompleteBlindsDialog->spinBox_afterThisAlwaysRaiseValue->setValue(myConfig->readConfigInt("AfterMBAlwaysRaiseValue"));
|
|
|
|
|
myChangeCompleteBlindsDialog->radioButton_afterThisStayAtLastBlind->setChecked(myConfig->readConfigInt("AfterMBStayAtLastBlind"));
|
2007-01-17 23:57:41 +00:00
|
|
|
|
2007-05-13 15:08:10 +00:00
|
|
|
QDialog::exec();
|
2011-02-11 20:02:08 +00:00
|
|
|
|
2007-01-13 02:40:33 +00:00
|
|
|
}
|
2007-09-27 00:35:30 +00:00
|
|
|
|
2011-02-11 20:02:08 +00:00
|
|
|
void newGameDialogImpl::callChangeBlindsDialog(bool show)
|
|
|
|
|
{
|
2007-09-27 00:35:30 +00:00
|
|
|
|
|
|
|
|
if(show) {
|
|
|
|
|
myChangeCompleteBlindsDialog->exec();
|
|
|
|
|
if(myChangeCompleteBlindsDialog->result() == QDialog::Accepted ) {}
|
|
|
|
|
else {
|
|
|
|
|
radioButton_useSavedBlindsSettings->setChecked(TRUE);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|