2007-08-21 23:31:09 +00:00
|
|
|
/***************************************************************************
|
|
|
|
|
* 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 "createinternetgamedialogimpl.h"
|
|
|
|
|
#include "session.h"
|
|
|
|
|
#include "configfile.h"
|
2007-09-27 00:35:30 +00:00
|
|
|
#include "changecompleteblindsdialogimpl.h"
|
|
|
|
|
|
2007-08-21 23:31:09 +00:00
|
|
|
|
|
|
|
|
createInternetGameDialogImpl::createInternetGameDialogImpl(QWidget *parent, ConfigFile *c)
|
|
|
|
|
: QDialog(parent), myConfig(c)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
setupUi(this);
|
|
|
|
|
|
2007-09-27 00:35:30 +00:00
|
|
|
myChangeCompleteBlindsDialog = new changeCompleteBlindsDialogImpl;
|
|
|
|
|
|
2007-08-21 23:31:09 +00:00
|
|
|
fillFormular();
|
|
|
|
|
|
2007-09-27 00:35:30 +00:00
|
|
|
connect( radioButton_changeBlindsSettings, SIGNAL( clicked(bool) ), this, SLOT( callChangeBlindsDialog(bool) ) );
|
2007-08-21 23:31:09 +00:00
|
|
|
connect( pushButton_cancel, SIGNAL( clicked() ), this, SLOT( cancel() ) );
|
|
|
|
|
connect( pushButton_createGame, SIGNAL( clicked() ), this, SLOT( createGame() ) );
|
2007-08-26 12:45:37 +00:00
|
|
|
connect( checkBox_Password, SIGNAL( toggled(bool) ), this, SLOT( clearGamePassword(bool)) );
|
2007-08-21 23:31:09 +00:00
|
|
|
//temporarely unused until ai is enabled in network
|
|
|
|
|
// label_5->hide();
|
|
|
|
|
// spinBox_gameSpeed->hide();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void createInternetGameDialogImpl::exec() {
|
|
|
|
|
|
|
|
|
|
fillFormular();
|
|
|
|
|
QDialog::exec();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void createInternetGameDialogImpl::createGame() {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void createInternetGameDialogImpl::cancel() {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void createInternetGameDialogImpl::fillFormular() {
|
|
|
|
|
|
|
|
|
|
//Network Game Settings
|
|
|
|
|
spinBox_quantityPlayers->setValue(myConfig->readConfigInt("NetNumberOfPlayers"));
|
|
|
|
|
spinBox_startCash->setValue(myConfig->readConfigInt("NetStartCash"));
|
|
|
|
|
//temporarely unused until ai is enabled in network
|
|
|
|
|
spinBox_gameSpeed->setValue(myConfig->readConfigInt("NetGameSpeed"));
|
|
|
|
|
spinBox_netTimeOutPlayerAction->setValue(myConfig->readConfigInt("NetTimeOutPlayerAction"));
|
2007-08-26 08:02:07 +00:00
|
|
|
checkBox_Password->setChecked(myConfig->readConfigInt("UseInternetGamePassword"));
|
|
|
|
|
if(myConfig->readConfigInt("UseInternetGamePassword")) {
|
|
|
|
|
lineEdit_Password->setText(QString::fromUtf8(myConfig->readConfigString("InternetGamePassword").c_str()));
|
|
|
|
|
}
|
|
|
|
|
|
2007-09-27 00:35:30 +00:00
|
|
|
//fill changeCompleteBlindsDialog
|
|
|
|
|
myChangeCompleteBlindsDialog->spinBox_firstSmallBlind->setValue(myConfig->readConfigInt("NetFirstSmallBlind"));
|
|
|
|
|
myChangeCompleteBlindsDialog->radioButton_raiseBlindsAtHands->setChecked(myConfig->readConfigInt("NetRaiseBlindsAtHands"));
|
|
|
|
|
myChangeCompleteBlindsDialog->radioButton_raiseBlindsAtMinutes->setChecked(myConfig->readConfigInt("NetRaiseBlindsAtMinutes"));
|
|
|
|
|
myChangeCompleteBlindsDialog->spinBox_raiseSmallBlindEveryHands->setValue(myConfig->readConfigInt("NetRaiseSmallBlindEveryHands"));
|
|
|
|
|
myChangeCompleteBlindsDialog->spinBox_raiseSmallBlindEveryMinutes->setValue(myConfig->readConfigInt("NetRaiseSmallBlindEveryMinutes"));
|
|
|
|
|
myChangeCompleteBlindsDialog->radioButton_alwaysDoubleBlinds->setChecked(myConfig->readConfigInt("NetAlwaysDoubleBlinds"));
|
|
|
|
|
myChangeCompleteBlindsDialog->radioButton_manualBlindsOrder->setChecked(myConfig->readConfigInt("NetManualBlindsOrder"));
|
|
|
|
|
|
|
|
|
|
myChangeCompleteBlindsDialog->listWidget_blinds->clear();
|
|
|
|
|
myChangeCompleteBlindsDialog->spinBox_input->setMinimum(myChangeCompleteBlindsDialog->spinBox_firstSmallBlind->value()+1);
|
|
|
|
|
|
|
|
|
|
std::list<int> myBlindsList = myConfig->readConfigIntList("NetManualBlindsList");
|
|
|
|
|
std::list<int>::iterator it1;
|
|
|
|
|
|
|
|
|
|
for(it1= myBlindsList.begin(); it1 != myBlindsList.end(); it1++) {
|
|
|
|
|
myChangeCompleteBlindsDialog->listWidget_blinds->addItem(QString::number(*it1,10));
|
|
|
|
|
}
|
|
|
|
|
myChangeCompleteBlindsDialog->sortBlindsList();
|
|
|
|
|
|
|
|
|
|
myChangeCompleteBlindsDialog->radioButton_afterThisAlwaysDoubleBlinds->setChecked(myConfig->readConfigInt("NetAfterMBAlwaysDoubleBlinds"));
|
|
|
|
|
myChangeCompleteBlindsDialog->radioButton_afterThisAlwaysRaiseAbout->setChecked(myConfig->readConfigInt("NetAfterMBAlwaysRaiseAbout"));
|
|
|
|
|
myChangeCompleteBlindsDialog->spinBox_afterThisAlwaysRaiseValue->setValue(myConfig->readConfigInt("NetAfterMBAlwaysRaiseValue"));
|
|
|
|
|
myChangeCompleteBlindsDialog->radioButton_afterThisStayAtLastBlind->setChecked(myConfig->readConfigInt("NetAfterMBStayAtLastBlind"));
|
2007-08-21 23:31:09 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void createInternetGameDialogImpl::showDialog() {
|
|
|
|
|
|
|
|
|
|
fillFormular();
|
|
|
|
|
exec();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void createInternetGameDialogImpl::keyPressEvent ( QKeyEvent * event ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (event->key() == 16777220) { pushButton_createGame->click(); } //ENTER
|
|
|
|
|
|
|
|
|
|
}
|
2007-08-26 12:45:37 +00:00
|
|
|
|
|
|
|
|
void createInternetGameDialogImpl::clearGamePassword(bool clear) {
|
|
|
|
|
|
|
|
|
|
if(!clear) { lineEdit_Password->clear(); }
|
2007-09-04 23:37:32 +00:00
|
|
|
}
|
|
|
|
|
|
2007-09-27 00:35:30 +00:00
|
|
|
void createInternetGameDialogImpl::callChangeBlindsDialog(bool show) {
|
|
|
|
|
|
|
|
|
|
if(show) {
|
|
|
|
|
myChangeCompleteBlindsDialog->exec();
|
|
|
|
|
if(myChangeCompleteBlindsDialog->result() == QDialog::Accepted ) {}
|
|
|
|
|
else {
|
|
|
|
|
radioButton_useSavedBlindsSettings->setChecked(TRUE);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|