Back to rev. 347

This commit is contained in:
lotodore
2007-04-20 23:14:08 +00:00
parent 57927b7d73
commit a8cce94d3b
32 changed files with 315 additions and 333 deletions
+3 -1
View File
@@ -90,11 +90,13 @@ public:
// virtual void timerBlockerFalse() const=0;
virtual void meInAction() const=0;
//log.cpp
virtual void logPlayerActionMsg(std::string playName, int action, int setValue) =0;
virtual void logNewGameHandMsg(int gameID, int HandID) =0;
//qthelper.cpp
virtual std::string stringToUtf8(const std::string &) =0;
};
@@ -21,13 +21,11 @@
#include "session.h"
#include "configfile.h"
createNetworkGameDialogImpl::createNetworkGameDialogImpl(QWidget *parent, std::string path)
: QDialog(parent), myConfig(0)
createNetworkGameDialogImpl::createNetworkGameDialogImpl(QWidget *parent)
: QDialog(parent)
{
myConfig = new ConfigFile(path);
setupUi(this);
setupUi(this);
fillFormular();
@@ -48,13 +46,14 @@ void createNetworkGameDialogImpl::cancel() {
void createNetworkGameDialogImpl::fillFormular() {
//Formulare Füllen
ConfigFile myConfig;
//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_gameSpeed->setValue(myConfig->readConfigInt("NetGameSpeed"));
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_gameSpeed->setValue(myConfig.readConfigInt("NetGameSpeed"));
}
void createNetworkGameDialogImpl::showDialog() {
@@ -23,18 +23,15 @@
#include "ui_createnetworkgamedialog.h"
#include <iostream>
#include <string>
#include <QtGui>
#include <QtCore>
class Session;
class ConfigFile;
class createNetworkGameDialogImpl: public QDialog, public Ui::createNetworkGameDialog {
Q_OBJECT
public:
createNetworkGameDialogImpl(QWidget *parent = 0, std::string = "");
createNetworkGameDialogImpl(QWidget *parent = 0);
public slots:
@@ -43,10 +40,6 @@ public slots:
void fillFormular();
void showDialog();
void keyPressEvent ( QKeyEvent * event );
private:
ConfigFile *myConfig;
};
#endif
+9 -3
View File
@@ -24,13 +24,16 @@
using namespace std;
GuiWrapper::GuiWrapper(Session *session) : myLog(0), myW(0)
GuiWrapper::GuiWrapper() : myLog(0), myW(0)
{
myW = new mainWindowImpl(session);
myW = new mainWindowImpl;
myW->show();
myLog = new Log(myW);
myConfig = new ConfigFile;
}
@@ -85,6 +88,9 @@ void GuiWrapper::meInAction() const { myW->meInAction(); }
void GuiWrapper::logPlayerActionMsg(string playerName, int action, int setValue) { myLog->logPlayerActionMsg(playerName, action, setValue); }
void GuiWrapper::logNewGameHandMsg(int gameID, int handID) { myLog->logNewGameHandMsg(gameID, handID); }
std::string GuiWrapper::stringToUtf8(const std::string &myString) { return myQtHelper->stringToUtf8(myString); }
void GuiWrapper::SignalNetClientConnect(int actionID) { myW->SignalNetClientConnect(actionID); }
void GuiWrapper::SignalNetClientGameInfo(int actionID) { myW->SignalNetClientGameInfo(actionID); }
void GuiWrapper::SignalNetClientError(int errorID, int osErrorID) { myW->SignalNetClientError(errorID, osErrorID); }
+6 -1
View File
@@ -25,6 +25,7 @@
#include "log.h"
#include "mainwindowimpl.h"
#include "connecttoserverdialogimpl.h"
#include "qthelper.h"
#include "configfile.h"
#include <string>
@@ -38,7 +39,7 @@
class GuiWrapper : public GuiInterface
{
public:
GuiWrapper(Session*);
GuiWrapper();
~GuiWrapper();
@@ -88,6 +89,8 @@ public:
void logPlayerActionMsg(std::string playerName, int action, int setValue) ;
void logNewGameHandMsg(int gameID, int handID) ;
std::string stringToUtf8(const std::string &);
void SignalNetClientConnect(int actionID);
void SignalNetClientGameInfo(int actionID);
void SignalNetClientError(int errorID, int osErrorID);
@@ -100,6 +103,8 @@ private:
Log *myLog;
mainWindowImpl *myW;
ConfigFile *myConfig;
QtHelper *myQtHelper;
};
@@ -24,12 +24,11 @@
using namespace std;
joinNetworkGameDialogImpl::joinNetworkGameDialogImpl(QWidget *parent, std::string path)
: QDialog(parent), myConfig(0)
joinNetworkGameDialogImpl::joinNetworkGameDialogImpl(QWidget *parent)
: QDialog(parent)
{
myConfig = new ConfigFile(path);
setupUi(this);
setupUi(this);
//Profile Name darf nicht mit einer Zahl beginnen --> XML konform
QRegExp rx("[A-Z|a-z]+[A-Z|a-z|\\d]*");
@@ -40,7 +39,7 @@ joinNetworkGameDialogImpl::joinNetworkGameDialogImpl(QWidget *parent, std::strin
lineEdit_ipAddress->setFocus();
myServerProfilesFile = myConfig->readConfigString("DataDir")+"serverprofiles.xml";
myServerProfilesFile = myConfig.readConfigString("DataDir")+"serverprofiles.xml";
//Anlegen wenn noch nicht existiert!
QFile serverProfilesfile(QString::fromUtf8(myServerProfilesFile.c_str()));
@@ -24,6 +24,7 @@
#include <iostream>
#include <string>
#include "configfile.h"
#include <QtGui>
#include <QtCore>
@@ -33,9 +34,9 @@ class ConfigFile;
class joinNetworkGameDialogImpl: public QDialog, public Ui::joinNetworkGameDialog {
Q_OBJECT
public:
joinNetworkGameDialogImpl(QWidget *parent = 0, std::string = "");
joinNetworkGameDialogImpl(QWidget *parent = 0);
ConfigFile myConfig;
std::string myServerProfilesFile;
public slots:
@@ -46,9 +47,6 @@ public slots:
void saveServerProfile();
void deleteServerProfile();
void keyPressEvent ( QKeyEvent * event );
private:
ConfigFile *myConfig;
};
#endif
+1 -3
View File
@@ -21,7 +21,6 @@
#include "mainwindowimpl.h"
#include <game_defs.h>
#include "session.h"
using namespace std;
@@ -29,8 +28,7 @@ Log::Log(mainWindowImpl* w) : myW(w)
{
myW->setLog(this);
myConfig = new ConfigFile(myW->getSession()->getConfigPath());
myConfig = new ConfigFile;
if(myConfig->readConfigString("LogDir") != "" && QDir::QDir(QString::fromUtf8(myConfig->readConfigString("LogDir").c_str())).exists()) {
#ifdef _WIN32
+1
View File
@@ -30,6 +30,7 @@
class mainWindowImpl;
class Log{
public:
Log(mainWindowImpl*);
+9 -12
View File
@@ -39,8 +39,6 @@
#include "log.h"
#include "configfile.h"
#include "appdirpath.h"
#include <net/socket_msg.h>
@@ -50,8 +48,8 @@
using namespace std;
mainWindowImpl::mainWindowImpl(Session* s, QMainWindow *parent)
: QMainWindow(parent), actualGame(0), actualHand(0), mySession(s), gameSpeed(0), debugMode(0), breakAfterActualHand(FALSE)
mainWindowImpl::mainWindowImpl(QMainWindow *parent)
: QMainWindow(parent), actualGame(0), actualHand(0), mySession(0), gameSpeed(0), debugMode(0), breakAfterActualHand(FALSE)
{
int i;
@@ -61,8 +59,7 @@ mainWindowImpl::mainWindowImpl(Session* s, QMainWindow *parent)
}
////////////////////////////
AppDirPath myAppDirPath;
myConfig = new ConfigFile(myAppDirPath.getMyPath());
myConfig = new ConfigFile;
// Resourcen abladen
QFile preflopValuesFile(":data/resources/data/preflopValues");
@@ -482,10 +479,10 @@ mainWindowImpl::mainWindowImpl(Session* s, QMainWindow *parent)
}
//Dialoge
myJoinNetworkGameDialog = new joinNetworkGameDialogImpl(this, mySession->getConfigPath());
myJoinNetworkGameDialog = new joinNetworkGameDialogImpl(this);
myConnectToServerDialog = new connectToServerDialogImpl(this);
myStartNetworkGameDialog = new startNetworkGameDialogImpl(this);
myCreateNetworkGameDialog = new createNetworkGameDialogImpl(this, mySession->getConfigPath());
myCreateNetworkGameDialog = new createNetworkGameDialogImpl(this);
myWaitingForServerGameDialog = new waitForServerToStartGameDialogImpl(this);
//Connects
@@ -557,7 +554,7 @@ void mainWindowImpl::callNewGameDialog() {
//wenn Dialogfenster gezeigt werden soll
if(myConfig->readConfigInt("ShowGameSettingsDialogOnNewGame")){
newGameDialogImpl *v = new newGameDialogImpl(this, mySession->getConfigPath());
newGameDialogImpl *v = new newGameDialogImpl(this);
v->exec();
if (v->result() == QDialog::Accepted ) { startNewLocalGame(v); }
// else { startNewLocalGame(); }
@@ -688,7 +685,7 @@ void mainWindowImpl::callJoinNetworkGameDialog() {
void mainWindowImpl::callSettingsDialog() {
settingsDialogImpl *v = new settingsDialogImpl(this, mySession->getConfigPath());
settingsDialogImpl *v = new settingsDialogImpl(this);
v->exec();
@@ -829,7 +826,7 @@ void mainWindowImpl::refreshPlayerAvatar() {
if(actualHand->getPlayerArray()[i]->getMyActiveStatus()) {
if(!i) {
if(actualHand->getPlayerArray()[0]->getMyAvatar() == ""/* || !QDir::QDir(QString::fromUtf8(actualHand->getPlayerArray()[0]->getMyAvatar().c_str())).exists()*/) {
if(actualHand->getPlayerArray()[0]->getMyAvatar() == "") {
playerAvatarLabelArray[0]->setPixmap(QPixmap(":/guiv2/resources/guiv2/genereticAvatar.png"));
}
else {
@@ -837,7 +834,7 @@ void mainWindowImpl::refreshPlayerAvatar() {
}
}
else {
if(actualHand->getPlayerArray()[i]->getMyAvatar() == ""/* || !QDir::QDir(QString::fromUtf8(actualHand->getPlayerArray()[i]->getMyAvatar().c_str())).exists()*/) {
if(actualHand->getPlayerArray()[i]->getMyAvatar() == "") {
playerAvatarLabelArray[i]->setPixmap(QPixmap(":/guiv2/resources/guiv2/genereticAvatar.png"));
}
else {
+1 -2
View File
@@ -53,14 +53,13 @@ class mainWindowImpl: public QMainWindow, public Ui::mainWindow {
Q_OBJECT
public:
mainWindowImpl(Session* = 0, QMainWindow *parent = 0 );
mainWindowImpl(QMainWindow *parent = 0 );
~mainWindowImpl();
void setGame(Game*);
void setHand(HandInterface*);
void setSession(Session*);
Session* getSession() { return mySession; }
void setLog(Log*);
void setActualHand(HandInterface* theValue) { actualHand = theValue;}
@@ -20,22 +20,22 @@
#include "newgamedialogimpl.h"
#include "configfile.h"
newGameDialogImpl::newGameDialogImpl(QWidget *parent, std::string path)
newGameDialogImpl::newGameDialogImpl(QWidget *parent)
: QDialog(parent)
{
setupUi(this);
//Formulare Füllen
myConfig = new ConfigFile(path);
ConfigFile myConfig;
//Game Settings
spinBox_quantityPlayers->setValue(myConfig->readConfigInt("NumberOfPlayers"));
spinBox_startCash->setValue(myConfig->readConfigInt("StartCash"));
spinBox_smallBlind->setValue(myConfig->readConfigInt("SmallBlind"));
spinBox_gameSpeed->setValue(myConfig->readConfigInt("GameSpeed"));
spinBox_handsBeforeRaiseSmallBlind->setValue(myConfig->readConfigInt("HandsBeforeRaiseSmallBlind"));
spinBox_quantityPlayers->setValue(myConfig.readConfigInt("NumberOfPlayers"));
spinBox_startCash->setValue(myConfig.readConfigInt("StartCash"));
spinBox_smallBlind->setValue(myConfig.readConfigInt("SmallBlind"));
spinBox_gameSpeed->setValue(myConfig.readConfigInt("GameSpeed"));
spinBox_handsBeforeRaiseSmallBlind->setValue(myConfig.readConfigInt("HandsBeforeRaiseSmallBlind"));
}
@@ -23,22 +23,17 @@
#include "ui_newgamedialog.h"
#include <iostream>
#include <string>
#include <QtGui>
#include <QtCore>
class ConfigFile;
class newGameDialogImpl: public QDialog, public Ui::newGameDialog {
Q_OBJECT
public:
newGameDialogImpl(QWidget *parent = 0, std::string = "");
newGameDialogImpl(QWidget *parent = 0);
public slots:
private:
ConfigFile *myConfig;
};
#endif
+30
View File
@@ -0,0 +1,30 @@
//
// C++ Implementation: qthelper
//
// Description:
//
//
// Author: FThauer FHammer <webmaster@pokerth.net>, (C) 2007
//
// Copyright: See COPYING file that comes with this distribution
//
//
#include "qthelper.h"
QtHelper::QtHelper()
{
}
QtHelper::~QtHelper()
{
}
std::string QtHelper::stringToUtf8(const std::string &myString) {
QString tmpString = QString::fromStdString(myString);
std::string myUtf8String = tmpString.toUtf8().constData();
return myUtf8String;
}
+29
View File
@@ -0,0 +1,29 @@
//
// C++ Interface: qthelper
//
// Description:
//
//
// Author: FThauer FHammer <webmaster@pokerth.net>, (C) 2007
//
// Copyright: See COPYING file that comes with this distribution
//
//
#ifndef QTHELPER_H
#define QTHELPER_H
#include <QtCore>
/**
@author FThauer FHammer <webmaster@pokerth.net>
*/
class QtHelper{
public:
QtHelper();
~QtHelper();
std::string stringToUtf8(const std::string &);
};
#endif
@@ -22,10 +22,9 @@
#include <iostream>
settingsDialogImpl::settingsDialogImpl(QWidget *parent, std::string path)
settingsDialogImpl::settingsDialogImpl(QWidget *parent)
: QDialog(parent)
{
myConfig = new ConfigFile(path);
setupUi(this);
@@ -36,64 +35,64 @@ settingsDialogImpl::settingsDialogImpl(QWidget *parent, std::string path)
playerNickIsChanged = FALSE;
//Formulare Füllen
ConfigFile myConfig;
//Player Nicks
lineEdit_humanPlayerName->setText(QString::fromUtf8(myConfig->readConfigString("MyName").c_str()));
lineEdit_humanPlayerAvatar->setText(QString::fromUtf8(myConfig->readConfigString("MyAvatar").c_str()));
lineEdit_Opponent1Name->setText(QString::fromUtf8(myConfig->readConfigString("Opponent1Name").c_str()));
lineEdit_Opponent1Avatar->setText(QString::fromUtf8(myConfig->readConfigString("Opponent1Avatar").c_str()));
lineEdit_Opponent2Name->setText(QString::fromUtf8(myConfig->readConfigString("Opponent2Name").c_str()));
lineEdit_Opponent2Avatar->setText(QString::fromUtf8(myConfig->readConfigString("Opponent2Avatar").c_str()));
lineEdit_Opponent3Name->setText(QString::fromUtf8(myConfig->readConfigString("Opponent3Name").c_str()));
lineEdit_Opponent3Avatar->setText(QString::fromUtf8(myConfig->readConfigString("Opponent3Avatar").c_str()));
lineEdit_Opponent4Name->setText(QString::fromUtf8(myConfig->readConfigString("Opponent4Name").c_str()));
lineEdit_Opponent4Avatar->setText(QString::fromUtf8(myConfig->readConfigString("Opponent4Avatar").c_str()));
lineEdit_Opponent5Name->setText(QString::fromUtf8(myConfig->readConfigString("Opponent5Name").c_str()));
lineEdit_Opponent5Avatar->setText(QString::fromUtf8(myConfig->readConfigString("Opponent5Avatar").c_str()));
lineEdit_Opponent6Name->setText(QString::fromUtf8(myConfig->readConfigString("Opponent6Name").c_str()));
lineEdit_Opponent6Avatar->setText(QString::fromUtf8(myConfig->readConfigString("Opponent6Avatar").c_str()));
lineEdit_humanPlayerName->setText(QString::fromUtf8(myConfig.readConfigString("MyName").c_str()));
lineEdit_humanPlayerAvatar->setText(QString::fromUtf8(myConfig.readConfigString("MyAvatar").c_str()));
lineEdit_Opponent1Name->setText(QString::fromUtf8(myConfig.readConfigString("Opponent1Name").c_str()));
lineEdit_Opponent1Avatar->setText(QString::fromUtf8(myConfig.readConfigString("Opponent1Avatar").c_str()));
lineEdit_Opponent2Name->setText(QString::fromUtf8(myConfig.readConfigString("Opponent2Name").c_str()));
lineEdit_Opponent2Avatar->setText(QString::fromUtf8(myConfig.readConfigString("Opponent2Avatar").c_str()));
lineEdit_Opponent3Name->setText(QString::fromUtf8(myConfig.readConfigString("Opponent3Name").c_str()));
lineEdit_Opponent3Avatar->setText(QString::fromUtf8(myConfig.readConfigString("Opponent3Avatar").c_str()));
lineEdit_Opponent4Name->setText(QString::fromUtf8(myConfig.readConfigString("Opponent4Name").c_str()));
lineEdit_Opponent4Avatar->setText(QString::fromUtf8(myConfig.readConfigString("Opponent4Avatar").c_str()));
lineEdit_Opponent5Name->setText(QString::fromUtf8(myConfig.readConfigString("Opponent5Name").c_str()));
lineEdit_Opponent5Avatar->setText(QString::fromUtf8(myConfig.readConfigString("Opponent5Avatar").c_str()));
lineEdit_Opponent6Name->setText(QString::fromUtf8(myConfig.readConfigString("Opponent6Name").c_str()));
lineEdit_Opponent6Avatar->setText(QString::fromUtf8(myConfig.readConfigString("Opponent6Avatar").c_str()));
//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_gameSpeed->setValue(myConfig->readConfigInt("GameSpeed"));
checkBox_pauseBetweenHands->setChecked(myConfig->readConfigInt("PauseBetweenHands"));
checkBox_showGameSettingsDialogOnNewGame->setChecked(myConfig->readConfigInt("ShowGameSettingsDialogOnNewGame"));
comboBox_engineVersion->setCurrentIndex(myConfig->readConfigInt("EngineVersion"));
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_gameSpeed->setValue(myConfig.readConfigInt("GameSpeed"));
checkBox_pauseBetweenHands->setChecked(myConfig.readConfigInt("PauseBetweenHands"));
checkBox_showGameSettingsDialogOnNewGame->setChecked(myConfig.readConfigInt("ShowGameSettingsDialogOnNewGame"));
comboBox_engineVersion->setCurrentIndex(myConfig.readConfigInt("EngineVersion"));
//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_netGameSpeed->setValue(myConfig->readConfigInt("NetGameSpeed"));
comboBox_netEngineVersion->setCurrentIndex(myConfig->readConfigInt("NetEngineVersion"));
spinBox_serverPort->setValue(myConfig->readConfigInt("ServerPort"));
lineEdit_serverPassword->setText(QString::fromUtf8(myConfig->readConfigString("ServerPassword").c_str()));
checkBox_useIpv6->setChecked(myConfig->readConfigInt("ServerUseIpv6"));
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_netGameSpeed->setValue(myConfig.readConfigInt("NetGameSpeed"));
comboBox_netEngineVersion->setCurrentIndex(myConfig.readConfigInt("NetEngineVersion"));
spinBox_serverPort->setValue(myConfig.readConfigInt("ServerPort"));
lineEdit_serverPassword->setText(QString::fromUtf8(myConfig.readConfigString("ServerPassword").c_str()));
checkBox_useIpv6->setChecked(myConfig.readConfigInt("ServerUseIpv6"));
//Interface
checkBox_showLeftToolbox->setChecked(myConfig->readConfigInt("ShowLeftToolBox"));
checkBox_showRightToolbox->setChecked(myConfig->readConfigInt("ShowRightToolBox"));
checkBox_showStatusbarMessages->setChecked(myConfig->readConfigInt("ShowStatusbarMessages"));
checkBox_showIntro->setChecked(myConfig->readConfigInt("ShowIntro"));
checkBox_showFadeOutCardsAnimation->setChecked(myConfig->readConfigInt("ShowFadeOutCardsAnimation"));
checkBox_showFlipCardsAnimation->setChecked(myConfig->readConfigInt("ShowFlipCardsAnimation"));
radioButton_flipsideTux->setChecked(myConfig->readConfigInt("FlipsideTux"));
radioButton_flipsideOwn->setChecked(myConfig->readConfigInt("FlipsideOwn"));
checkBox_showLeftToolbox->setChecked(myConfig.readConfigInt("ShowLeftToolBox"));
checkBox_showRightToolbox->setChecked(myConfig.readConfigInt("ShowRightToolBox"));
checkBox_showStatusbarMessages->setChecked(myConfig.readConfigInt("ShowStatusbarMessages"));
checkBox_showIntro->setChecked(myConfig.readConfigInt("ShowIntro"));
checkBox_showFadeOutCardsAnimation->setChecked(myConfig.readConfigInt("ShowFadeOutCardsAnimation"));
checkBox_showFlipCardsAnimation->setChecked(myConfig.readConfigInt("ShowFlipCardsAnimation"));
radioButton_flipsideTux->setChecked(myConfig.readConfigInt("FlipsideTux"));
radioButton_flipsideOwn->setChecked(myConfig.readConfigInt("FlipsideOwn"));
if(radioButton_flipsideOwn->isChecked()) {
lineEdit_OwnFlipsideFilename->setEnabled(TRUE);
pushButton_openFlipsidePicture->setEnabled(TRUE);
}
lineEdit_OwnFlipsideFilename->setText(QString::fromUtf8(myConfig->readConfigString("FlipsideOwnFile").c_str()));
lineEdit_OwnFlipsideFilename->setText(QString::fromUtf8(myConfig.readConfigString("FlipsideOwnFile").c_str()));
//Log
lineEdit_logDir->setText(QString::fromUtf8(myConfig->readConfigString("LogDir").c_str()));
spinBox_logStoreDuration->setValue(myConfig->readConfigInt("LogStoreDuration"));
lineEdit_logDir->setText(QString::fromUtf8(myConfig.readConfigString("LogDir").c_str()));
spinBox_logStoreDuration->setValue(myConfig.readConfigInt("LogStoreDuration"));
connect( buttonBox, SIGNAL( accepted() ), this, SLOT( isAccepted() ) );
connect( lineEdit_humanPlayerName, SIGNAL( textChanged( const QString &) ), this, SLOT( playerNickChanged() ) );
@@ -119,11 +118,12 @@ void settingsDialogImpl::isAccepted() {
settingsCorrect = TRUE;
//Daten speichern
ConfigFile myConfig;
// Player Nicks
myConfig->writeConfigString("MyName", lineEdit_humanPlayerName->text().toUtf8().constData());
myConfig.writeConfigString("MyName", lineEdit_humanPlayerName->text().toUtf8().constData());
if(QFile::QFile(lineEdit_humanPlayerAvatar->text()).exists() || lineEdit_humanPlayerAvatar->text() == "") {
myConfig->writeConfigString("MyAvatar", lineEdit_humanPlayerAvatar->text().toUtf8().constData());
myConfig.writeConfigString("MyAvatar", lineEdit_humanPlayerAvatar->text().toUtf8().constData());
}
else { QMessageBox::warning(this, tr("Settings Error"),
tr("The entered human player avatar picture doesn't exists.\n"
@@ -132,9 +132,9 @@ void settingsDialogImpl::isAccepted() {
settingsCorrect = FALSE;
}
myConfig->writeConfigString("Opponent1Name", lineEdit_Opponent1Name->text().toUtf8().constData());
myConfig.writeConfigString("Opponent1Name", lineEdit_Opponent1Name->text().toUtf8().constData());
if(QFile::QFile(lineEdit_Opponent1Avatar->text()).exists() || lineEdit_Opponent1Avatar->text() == "") {
myConfig->writeConfigString("Opponent1Avatar", lineEdit_Opponent1Avatar->text().toUtf8().constData());
myConfig.writeConfigString("Opponent1Avatar", lineEdit_Opponent1Avatar->text().toUtf8().constData());
}
else { QMessageBox::warning(this, tr("Settings Error"),
tr("The entered \"opponent 1\" avatar picture doesn't exists.\n"
@@ -143,9 +143,9 @@ void settingsDialogImpl::isAccepted() {
settingsCorrect = FALSE;
}
myConfig->writeConfigString("Opponent2Name", lineEdit_Opponent2Name->text().toUtf8().constData());
myConfig.writeConfigString("Opponent2Name", lineEdit_Opponent2Name->text().toUtf8().constData());
if(QFile::QFile(lineEdit_Opponent2Avatar->text()).exists() || lineEdit_Opponent2Avatar->text() == "") {
myConfig->writeConfigString("Opponent2Avatar", lineEdit_Opponent2Avatar->text().toUtf8().constData());
myConfig.writeConfigString("Opponent2Avatar", lineEdit_Opponent2Avatar->text().toUtf8().constData());
}
else { QMessageBox::warning(this, tr("Settings Error"),
tr("The entered \"opponent 2\" avatar picture doesn't exists.\n"
@@ -154,9 +154,9 @@ void settingsDialogImpl::isAccepted() {
settingsCorrect = FALSE;
}
myConfig->writeConfigString("Opponent3Name", lineEdit_Opponent3Name->text().toUtf8().constData());
myConfig.writeConfigString("Opponent3Name", lineEdit_Opponent3Name->text().toUtf8().constData());
if(QFile::QFile(lineEdit_Opponent3Avatar->text()).exists() || lineEdit_Opponent3Avatar->text() == "") {
myConfig->writeConfigString("Opponent3Avatar", lineEdit_Opponent3Avatar->text().toUtf8().constData());
myConfig.writeConfigString("Opponent3Avatar", lineEdit_Opponent3Avatar->text().toUtf8().constData());
}
else { QMessageBox::warning(this, tr("Settings Error"),
tr("The entered \"opponent 3\" avatar picture doesn't exists.\n"
@@ -165,9 +165,9 @@ void settingsDialogImpl::isAccepted() {
settingsCorrect = FALSE;
}
myConfig->writeConfigString("Opponent4Name", lineEdit_Opponent4Name->text().toUtf8().constData());
myConfig.writeConfigString("Opponent4Name", lineEdit_Opponent4Name->text().toUtf8().constData());
if(QFile::QFile(lineEdit_Opponent4Avatar->text()).exists() || lineEdit_Opponent4Avatar->text() == "") {
myConfig->writeConfigString("Opponent4Avatar", lineEdit_Opponent4Avatar->text().toUtf8().constData());
myConfig.writeConfigString("Opponent4Avatar", lineEdit_Opponent4Avatar->text().toUtf8().constData());
}
else { QMessageBox::warning(this, tr("Settings Error"),
tr("The entered \"opponent 4\" avatar picture doesn't exists.\n"
@@ -176,9 +176,9 @@ void settingsDialogImpl::isAccepted() {
settingsCorrect = FALSE;
}
myConfig->writeConfigString("Opponent5Name", lineEdit_Opponent5Name->text().toUtf8().constData());
myConfig.writeConfigString("Opponent5Name", lineEdit_Opponent5Name->text().toUtf8().constData());
if(QFile::QFile(lineEdit_Opponent5Avatar->text()).exists() || lineEdit_Opponent5Avatar->text() == "") {
myConfig->writeConfigString("Opponent5Avatar", lineEdit_Opponent5Avatar->text().toUtf8().constData());
myConfig.writeConfigString("Opponent5Avatar", lineEdit_Opponent5Avatar->text().toUtf8().constData());
}
else { QMessageBox::warning(this, tr("Settings Error"),
tr("The entered \"opponent 5\" avatar picture doesn't exists.\n"
@@ -187,9 +187,9 @@ void settingsDialogImpl::isAccepted() {
settingsCorrect = FALSE;
}
myConfig->writeConfigString("Opponent6Name", lineEdit_Opponent6Name->text().toUtf8().constData());
myConfig.writeConfigString("Opponent6Name", lineEdit_Opponent6Name->text().toUtf8().constData());
if(QFile::QFile(lineEdit_Opponent6Avatar->text()).exists() || lineEdit_Opponent6Avatar->text() == "") {
myConfig->writeConfigString("Opponent6Avatar", lineEdit_Opponent6Avatar->text().toUtf8().constData());
myConfig.writeConfigString("Opponent6Avatar", lineEdit_Opponent6Avatar->text().toUtf8().constData());
}
else { QMessageBox::warning(this, tr("Settings Error"),
tr("The entered \"opponent 6\" avatar picture doesn't exists.\n"
@@ -199,38 +199,38 @@ 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("GameSpeed", spinBox_gameSpeed->value());
myConfig->writeConfigInt("EngineVersion", comboBox_engineVersion->currentIndex());
myConfig->writeConfigInt("PauseBetweenHands", checkBox_pauseBetweenHands->isChecked());
myConfig->writeConfigInt("ShowGameSettingsDialogOnNewGame", checkBox_showGameSettingsDialogOnNewGame->isChecked());
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("GameSpeed", spinBox_gameSpeed->value());
myConfig.writeConfigInt("EngineVersion", comboBox_engineVersion->currentIndex());
myConfig.writeConfigInt("PauseBetweenHands", checkBox_pauseBetweenHands->isChecked());
myConfig.writeConfigInt("ShowGameSettingsDialogOnNewGame", checkBox_showGameSettingsDialogOnNewGame->isChecked());
//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("NetGameSpeed", spinBox_netGameSpeed->value());
myConfig->writeConfigInt("NetEngineVersion", comboBox_netEngineVersion->currentIndex());
myConfig->writeConfigInt("ServerPort", spinBox_serverPort->value());
myConfig->writeConfigString("ServerPassword", lineEdit_serverPassword->text().toUtf8().constData());
myConfig->writeConfigInt("ServerUseIpv6", checkBox_useIpv6->isChecked());
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("NetGameSpeed", spinBox_netGameSpeed->value());
myConfig.writeConfigInt("NetEngineVersion", comboBox_netEngineVersion->currentIndex());
myConfig.writeConfigInt("ServerPort", spinBox_serverPort->value());
myConfig.writeConfigString("ServerPassword", lineEdit_serverPassword->text().toUtf8().constData());
myConfig.writeConfigInt("ServerUseIpv6", checkBox_useIpv6->isChecked());
// Interface
myConfig->writeConfigInt("ShowLeftToolBox", checkBox_showLeftToolbox->isChecked());
myConfig->writeConfigInt("ShowRightToolBox", checkBox_showRightToolbox->isChecked());
myConfig->writeConfigInt("ShowStatusbarMessages", checkBox_showStatusbarMessages->isChecked());
myConfig->writeConfigInt("ShowIntro", checkBox_showIntro->isChecked());
myConfig->writeConfigInt("ShowFadeOutCardsAnimation", checkBox_showFadeOutCardsAnimation->isChecked());
myConfig->writeConfigInt("ShowFlipCardsAnimation", checkBox_showFlipCardsAnimation->isChecked());
myConfig->writeConfigInt("FlipsideTux", radioButton_flipsideTux->isChecked());
myConfig->writeConfigInt("FlipsideOwn", radioButton_flipsideOwn->isChecked());
myConfig.writeConfigInt("ShowLeftToolBox", checkBox_showLeftToolbox->isChecked());
myConfig.writeConfigInt("ShowRightToolBox", checkBox_showRightToolbox->isChecked());
myConfig.writeConfigInt("ShowStatusbarMessages", checkBox_showStatusbarMessages->isChecked());
myConfig.writeConfigInt("ShowIntro", checkBox_showIntro->isChecked());
myConfig.writeConfigInt("ShowFadeOutCardsAnimation", checkBox_showFadeOutCardsAnimation->isChecked());
myConfig.writeConfigInt("ShowFlipCardsAnimation", checkBox_showFlipCardsAnimation->isChecked());
myConfig.writeConfigInt("FlipsideTux", radioButton_flipsideTux->isChecked());
myConfig.writeConfigInt("FlipsideOwn", radioButton_flipsideOwn->isChecked());
if(radioButton_flipsideOwn->isChecked()) {
if(QFile::QFile(lineEdit_OwnFlipsideFilename->text()).exists() && lineEdit_OwnFlipsideFilename->text() != "") {myConfig->writeConfigString("FlipsideOwnFile", lineEdit_OwnFlipsideFilename->text().toUtf8().constData()); }
if(QFile::QFile(lineEdit_OwnFlipsideFilename->text()).exists() && lineEdit_OwnFlipsideFilename->text() != "") {myConfig.writeConfigString("FlipsideOwnFile", lineEdit_OwnFlipsideFilename->text().toUtf8().constData()); }
else { QMessageBox::warning(this, tr("Settings Error"),
tr("The entered flipside picture doesn't exists.\n"
"Please enter an valid picture!"),
@@ -240,7 +240,7 @@ void settingsDialogImpl::isAccepted() {
}
// Log
if(QDir::QDir(lineEdit_logDir->text()).exists() && lineEdit_logDir->text() != "") { myConfig->writeConfigString("LogDir", lineEdit_logDir->text().toUtf8().constData()); }
if(QDir::QDir(lineEdit_logDir->text()).exists() && lineEdit_logDir->text() != "") { myConfig.writeConfigString("LogDir", lineEdit_logDir->text().toUtf8().constData()); }
else {
QMessageBox::warning(this, tr("Settings Error"),
tr("The log file directory doesn't exists.\n"
@@ -249,7 +249,7 @@ void settingsDialogImpl::isAccepted() {
settingsCorrect = FALSE;
}
myConfig->writeConfigInt("LogStoreDuration", spinBox_logStoreDuration->value());
myConfig.writeConfigInt("LogStoreDuration", spinBox_logStoreDuration->value());
//Wenn alles richtig eingegeben wurde --> Dialog schließen
if(settingsCorrect) { this->hide(); }
@@ -22,16 +22,14 @@
#include "ui_settingsdialog.h"
#include <string>
#include <QtCore>
#include <QtGui>
class ConfigFile;
class settingsDialogImpl: public QDialog, public Ui::settingsDialog {
Q_OBJECT
public:
settingsDialogImpl(QWidget *parent = 0, std::string = "");
settingsDialogImpl(QWidget *parent = 0);
void setPlayerNickIsChanged(bool theValue){ playerNickIsChanged = theValue;}
bool getPlayerNickIsChanged() const{ return playerNickIsChanged;}
@@ -55,7 +53,6 @@ private:
bool playerNickIsChanged;
bool settingsCorrect;
ConfigFile *myConfig;
};
-26
View File
@@ -1,26 +0,0 @@
/***************************************************************************
* 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 "qttoolsinterface.h"
QtToolsInterface::~QtToolsInterface()
{
}
-35
View File
@@ -1,35 +0,0 @@
/***************************************************************************
* 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 QTTOOLSINTERFACE_H
#define QTTOOLSINTERFACE_H
#include <string>
class QtToolsInterface {
public:
virtual ~QtToolsInterface();
//appdirpath.cpp
virtual std::string getMyAppDirPath() const =0;
};
#endif