This commit is contained in:
@@ -31,6 +31,7 @@
|
|||||||
#include "session.h"
|
#include "session.h"
|
||||||
|
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
|
#include "configfile.h"
|
||||||
|
|
||||||
#define FORMATLEFT(X) "<p align='center'>(X)"
|
#define FORMATLEFT(X) "<p align='center'>(X)"
|
||||||
#define FORMATRIGHT(X) "(X)</p>"
|
#define FORMATRIGHT(X) "(X)</p>"
|
||||||
@@ -186,41 +187,83 @@ mainWindowImpl::mainWindowImpl(QMainWindow *parent, const char *name)
|
|||||||
|
|
||||||
void mainWindowImpl::callNewGameDialog() {
|
void mainWindowImpl::callNewGameDialog() {
|
||||||
|
|
||||||
newGameDialogImpl *v = new newGameDialogImpl();
|
ConfigFile configFile;
|
||||||
v->exec();
|
|
||||||
|
|
||||||
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("<p align='center'><span style='font-size:x-large; font-weight:bold'>Pot Total</span></p>");
|
||||||
|
label_Sets->setText("<p align='center'><span style='font-size:medium; font-weight:bold'>Sets:</span></p>");
|
||||||
|
|
||||||
|
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) {
|
if(actualGame) {
|
||||||
mySession->deleteGame();
|
mySession->deleteGame();
|
||||||
actualGame = 0;
|
actualGame = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
//restliche Singleshots abfangen!!!
|
//restliche Singleshots abfangen!!!
|
||||||
if (firstCallNewGame) { firstCallNewGame = FALSE; }
|
if (firstCallNewGame) { firstCallNewGame = FALSE; }
|
||||||
else { newRoundTimerBlock = TRUE; }
|
else { newRoundTimerBlock = TRUE; }
|
||||||
QTimer::singleShot(40*gameSpeed, this, SLOT( timerBlockerFalse() ));
|
QTimer::singleShot(40*gameSpeed, this, SLOT( timerBlockerFalse() ));
|
||||||
|
|
||||||
|
|
||||||
label_Pot->setText("<p align='center'><span style='font-size:x-large; font-weight:bold'>Pot Total</span></p>");
|
label_Pot->setText("<p align='center'><span style='font-size:x-large; font-weight:bold'>Pot Total</span></p>");
|
||||||
label_Sets->setText("<p align='center'><span style='font-size:medium; font-weight:bold'>Sets:</span></p>");
|
label_Sets->setText("<p align='center'><span style='font-size:medium; font-weight:bold'>Sets:</span></p>");
|
||||||
|
|
||||||
guiGameSpeed = v->spinBox_gameSpeed->value();
|
guiGameSpeed = configFile.readConfig("gamespeed","4").toInt(&ok,10);
|
||||||
// debugMode = v->checkBox_debugMode->isChecked();
|
// debugMode = v->checkBox_debugMode->isChecked();
|
||||||
|
|
||||||
//Tools und Board aufhellen und enablen
|
//Tools und Board aufhellen und enablen
|
||||||
QPalette tempPalette = groupBox_board->palette();
|
QPalette tempPalette = groupBox_board->palette();
|
||||||
tempPalette.setColor(QPalette::Window, active);
|
tempPalette.setColor(QPalette::Window, active);
|
||||||
groupBox_board->setPalette(tempPalette);
|
groupBox_board->setPalette(tempPalette);
|
||||||
groupBox_tools->setDisabled(FALSE);
|
groupBox_tools->setDisabled(FALSE);
|
||||||
|
|
||||||
//Speeds
|
//Speeds
|
||||||
setSpeeds();
|
setSpeeds();
|
||||||
//positioning Slider
|
//positioning Slider
|
||||||
horizontalSlider_speed->setValue(guiGameSpeed);
|
horizontalSlider_speed->setValue(guiGameSpeed);
|
||||||
|
|
||||||
//Start Game!!!
|
//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));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -55,8 +55,6 @@ settingsDialogImpl::settingsDialogImpl(QWidget *parent, const char *name)
|
|||||||
|
|
||||||
void settingsDialogImpl::accept() {
|
void settingsDialogImpl::accept() {
|
||||||
|
|
||||||
std::cout << "wursst" << "\n";
|
|
||||||
|
|
||||||
//Daten speichern
|
//Daten speichern
|
||||||
ConfigFile config;
|
ConfigFile config;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user