From e1367de95dab41f345daf368a26be156c9643197 Mon Sep 17 00:00:00 2001 From: doitux Date: Fri, 19 Jan 2007 02:03:30 +0000 Subject: [PATCH] --- src/gui/qt/mainwindowimpl.cpp | 69 +++++++++++++++++++++++++------ src/gui/qt/settingsdialogimpl.cpp | 2 - 2 files changed, 56 insertions(+), 15 deletions(-) diff --git a/src/gui/qt/mainwindowimpl.cpp b/src/gui/qt/mainwindowimpl.cpp index df61a4f3..39ca1fa9 100755 --- a/src/gui/qt/mainwindowimpl.cpp +++ b/src/gui/qt/mainwindowimpl.cpp @@ -31,6 +31,7 @@ #include "session.h" #include "log.h" +#include "configfile.h" #define FORMATLEFT(X) "

(X)" #define FORMATRIGHT(X) "(X)

" @@ -186,41 +187,83 @@ mainWindowImpl::mainWindowImpl(QMainWindow *parent, const char *name) void mainWindowImpl::callNewGameDialog() { - newGameDialogImpl *v = new newGameDialogImpl(); - v->exec(); + ConfigFile configFile; - if (v->result() == QDialog::Accepted ) { + //wenn Dialogfenster gezeigt werden soll + bool ok; + if(configFile.readConfig("showgamesettingsdialogonnewgame", "1").toInt(&ok,10)) { + newGameDialogImpl *v = new newGameDialogImpl(); + v->exec(); + + if (v->result() == QDialog::Accepted ) { + + if(actualGame) { + mySession->deleteGame(); + actualGame = 0; + } + + //restliche Singleshots abfangen!!! + if (firstCallNewGame) { firstCallNewGame = FALSE; } + else { newRoundTimerBlock = TRUE; } + QTimer::singleShot(40*gameSpeed, this, SLOT( timerBlockerFalse() )); + + + label_Pot->setText("

Pot Total

"); + label_Sets->setText("

Sets:

"); + + guiGameSpeed = v->spinBox_gameSpeed->value(); + // debugMode = v->checkBox_debugMode->isChecked(); + + //Tools und Board aufhellen und enablen + QPalette tempPalette = groupBox_board->palette(); + tempPalette.setColor(QPalette::Window, active); + groupBox_board->setPalette(tempPalette); + groupBox_tools->setDisabled(FALSE); + + //Speeds + setSpeeds(); + //positioning Slider + horizontalSlider_speed->setValue(guiGameSpeed); + + //Start Game!!! + mySession->startGame(v->spinBox_quantityPlayers->value(), v->spinBox_startCash->value(), v->spinBox_smallBlind->value()); + + } + } + // sonst mit gespeicherten Werten starten + else { + if(actualGame) { mySession->deleteGame(); actualGame = 0; } - + //restliche Singleshots abfangen!!! if (firstCallNewGame) { firstCallNewGame = FALSE; } else { newRoundTimerBlock = TRUE; } QTimer::singleShot(40*gameSpeed, this, SLOT( timerBlockerFalse() )); - - + + label_Pot->setText("

Pot Total

"); label_Sets->setText("

Sets:

"); - - guiGameSpeed = v->spinBox_gameSpeed->value(); -// debugMode = v->checkBox_debugMode->isChecked(); - + + guiGameSpeed = configFile.readConfig("gamespeed","4").toInt(&ok,10); + // debugMode = v->checkBox_debugMode->isChecked(); + //Tools und Board aufhellen und enablen QPalette tempPalette = groupBox_board->palette(); tempPalette.setColor(QPalette::Window, active); groupBox_board->setPalette(tempPalette); groupBox_tools->setDisabled(FALSE); - + //Speeds setSpeeds(); //positioning Slider horizontalSlider_speed->setValue(guiGameSpeed); - + //Start Game!!! - mySession->startGame(v->spinBox_quantityPlayers->value(), v->spinBox_startCash->value(), v->spinBox_smallBlind->value()); + mySession->startGame(configFile.readConfig("numberofplayers","5").toInt(&ok,10), configFile.readConfig("startcash","2000").toInt(&ok,10), configFile.readConfig("smallblind","10").toInt(&ok,10)); } diff --git a/src/gui/qt/settingsdialogimpl.cpp b/src/gui/qt/settingsdialogimpl.cpp index 7fae1219..42fc626e 100644 --- a/src/gui/qt/settingsdialogimpl.cpp +++ b/src/gui/qt/settingsdialogimpl.cpp @@ -55,8 +55,6 @@ settingsDialogImpl::settingsDialogImpl(QWidget *parent, const char *name) void settingsDialogImpl::accept() { - std::cout << "wursst" << "\n"; - //Daten speichern ConfigFile config;