one ConfigFile for all
killed the tinyxml warnings
This commit is contained in:
@@ -127,23 +127,23 @@ public:
|
|||||||
virtual ~TiXmlVisitor() {}
|
virtual ~TiXmlVisitor() {}
|
||||||
|
|
||||||
/// Visit a document.
|
/// Visit a document.
|
||||||
virtual bool VisitEnter( const TiXmlDocument& doc ) { return true; }
|
virtual bool VisitEnter( const TiXmlDocument& ) { return true; }
|
||||||
/// Visit a document.
|
/// Visit a document.
|
||||||
virtual bool VisitExit( const TiXmlDocument& doc ) { return true; }
|
virtual bool VisitExit( const TiXmlDocument& ) { return true; }
|
||||||
|
|
||||||
/// Visit an element.
|
/// Visit an element.
|
||||||
virtual bool VisitEnter( const TiXmlElement& element, const TiXmlAttribute* firstAttribute ) { return true; }
|
virtual bool VisitEnter( const TiXmlElement&, const TiXmlAttribute* ) { return true; }
|
||||||
/// Visit an element.
|
/// Visit an element.
|
||||||
virtual bool VisitExit( const TiXmlElement& element ) { return true; }
|
virtual bool VisitExit( const TiXmlElement& ) { return true; }
|
||||||
|
|
||||||
/// Visit a declaration
|
/// Visit a declaration
|
||||||
virtual bool Visit( const TiXmlDeclaration& declaration ) { return true; }
|
virtual bool Visit( const TiXmlDeclaration& ) { return true; }
|
||||||
/// Visit a text node
|
/// Visit a text node
|
||||||
virtual bool Visit( const TiXmlText& text ) { return true; }
|
virtual bool Visit( const TiXmlText& ) { return true; }
|
||||||
/// Visit a comment node
|
/// Visit a comment node
|
||||||
virtual bool Visit( const TiXmlComment& comment ) { return true; }
|
virtual bool Visit( const TiXmlComment& ) { return true; }
|
||||||
/// Visit an unknow node
|
/// Visit an unknow node
|
||||||
virtual bool Visit( const TiXmlUnknown& unknown ) { return true; }
|
virtual bool Visit( const TiXmlUnknown& ) { return true; }
|
||||||
};
|
};
|
||||||
|
|
||||||
// Only used by Attribute::Query functions
|
// Only used by Attribute::Query functions
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -25,15 +25,13 @@
|
|||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
|
|
||||||
GuiWrapper::GuiWrapper() : myLog(0), myW(0)
|
GuiWrapper::GuiWrapper(ConfigFile *c) : myLog(0), myW(0), myConfig(c)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
myW = new mainWindowImpl;
|
myW = new mainWindowImpl(myConfig);
|
||||||
myW->show();
|
myW->show();
|
||||||
|
myLog = new Log(myW, myConfig);
|
||||||
myLog = new Log(myW);
|
|
||||||
myConfig = new ConfigFile;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ class Session;
|
|||||||
class GuiWrapper : public GuiInterface
|
class GuiWrapper : public GuiInterface
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
GuiWrapper();
|
GuiWrapper(ConfigFile*);
|
||||||
|
|
||||||
~GuiWrapper();
|
~GuiWrapper();
|
||||||
|
|
||||||
|
|||||||
@@ -27,11 +27,10 @@
|
|||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
Log::Log(mainWindowImpl* w) : myW(w)
|
Log::Log(mainWindowImpl* w, ConfigFile *c) : myW(w), myConfig(c)
|
||||||
{
|
{
|
||||||
myW->setLog(this);
|
myW->setLog(this);
|
||||||
|
|
||||||
myConfig = new ConfigFile;
|
|
||||||
if(myConfig->readConfigString("LogDir") != "" && QDir::QDir(QString::fromUtf8(myConfig->readConfigString("LogDir").c_str())).exists()) {
|
if(myConfig->readConfigString("LogDir") != "" && QDir::QDir(QString::fromUtf8(myConfig->readConfigString("LogDir").c_str())).exists()) {
|
||||||
|
|
||||||
myLogDir = new QDir(QString::fromUtf8(myConfig->readConfigString("LogDir").c_str()));
|
myLogDir = new QDir(QString::fromUtf8(myConfig->readConfigString("LogDir").c_str()));
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ class mainWindowImpl;
|
|||||||
|
|
||||||
class Log{
|
class Log{
|
||||||
public:
|
public:
|
||||||
Log(mainWindowImpl*);
|
Log(mainWindowImpl*, ConfigFile *c);
|
||||||
|
|
||||||
~Log();
|
~Log();
|
||||||
|
|
||||||
|
|||||||
@@ -49,8 +49,8 @@
|
|||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
mainWindowImpl::mainWindowImpl(QMainWindow *parent)
|
mainWindowImpl::mainWindowImpl(ConfigFile *c, QMainWindow *parent)
|
||||||
: QMainWindow(parent), gameSpeed(0), debugMode(0), breakAfterActualHand(FALSE)
|
: QMainWindow(parent), myConfig(c), gameSpeed(0), debugMode(0), breakAfterActualHand(FALSE)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
@@ -62,7 +62,6 @@ mainWindowImpl::mainWindowImpl(QMainWindow *parent)
|
|||||||
}
|
}
|
||||||
////////////////////////////
|
////////////////////////////
|
||||||
|
|
||||||
myConfig = new ConfigFile;
|
|
||||||
|
|
||||||
// Resourcen abladen
|
// Resourcen abladen
|
||||||
QFile preflopValuesFile(":data/resources/data/preflopValues");
|
QFile preflopValuesFile(":data/resources/data/preflopValues");
|
||||||
@@ -494,11 +493,14 @@ mainWindowImpl::mainWindowImpl(QMainWindow *parent)
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Dialoge
|
//Dialoge
|
||||||
|
myNewGameDialog = new newGameDialogImpl(this, myConfig);
|
||||||
|
mySettingsDialog = new settingsDialogImpl(this);
|
||||||
myJoinNetworkGameDialog = new joinNetworkGameDialogImpl(this);
|
myJoinNetworkGameDialog = new joinNetworkGameDialogImpl(this);
|
||||||
myConnectToServerDialog = new connectToServerDialogImpl(this);
|
myConnectToServerDialog = new connectToServerDialogImpl(this);
|
||||||
myStartNetworkGameDialog = new startNetworkGameDialogImpl(this);
|
myStartNetworkGameDialog = new startNetworkGameDialogImpl(this);
|
||||||
myCreateNetworkGameDialog = new createNetworkGameDialogImpl(this);
|
myCreateNetworkGameDialog = new createNetworkGameDialogImpl(this);
|
||||||
myWaitingForServerGameDialog = new waitForServerToStartGameDialogImpl(this);
|
myWaitingForServerGameDialog = new waitForServerToStartGameDialogImpl(this);
|
||||||
|
myAboutPokerthDialog = new aboutPokerthImpl(this);
|
||||||
|
|
||||||
//Connects
|
//Connects
|
||||||
connect(dealFlopCards0Timer, SIGNAL(timeout()), this, SLOT( dealFlopCards1() ));
|
connect(dealFlopCards0Timer, SIGNAL(timeout()), this, SLOT( dealFlopCards1() ));
|
||||||
@@ -580,9 +582,8 @@ void mainWindowImpl::callNewGameDialog() {
|
|||||||
//wenn Dialogfenster gezeigt werden soll
|
//wenn Dialogfenster gezeigt werden soll
|
||||||
if(myConfig->readConfigInt("ShowGameSettingsDialogOnNewGame")){
|
if(myConfig->readConfigInt("ShowGameSettingsDialogOnNewGame")){
|
||||||
|
|
||||||
newGameDialogImpl *v = new newGameDialogImpl(this);
|
myNewGameDialog->exec();
|
||||||
v->exec();
|
if (myNewGameDialog->result() == QDialog::Accepted ) { startNewLocalGame(myNewGameDialog); }
|
||||||
if (v->result() == QDialog::Accepted ) { startNewLocalGame(v); }
|
|
||||||
// else { startNewLocalGame(); }
|
// else { startNewLocalGame(); }
|
||||||
}
|
}
|
||||||
// sonst mit gespeicherten Werten starten
|
// sonst mit gespeicherten Werten starten
|
||||||
@@ -621,11 +622,7 @@ void mainWindowImpl::startNewLocalGame(newGameDialogImpl *v) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void mainWindowImpl::callAboutPokerthDialog() {
|
void mainWindowImpl::callAboutPokerthDialog() { myAboutPokerthDialog->exec(); }
|
||||||
|
|
||||||
aboutPokerthImpl *v = new aboutPokerthImpl(this);
|
|
||||||
v->exec();
|
|
||||||
}
|
|
||||||
|
|
||||||
void mainWindowImpl::callCreateNetworkGameDialog() {
|
void mainWindowImpl::callCreateNetworkGameDialog() {
|
||||||
|
|
||||||
@@ -699,11 +696,9 @@ void mainWindowImpl::callJoinNetworkGameDialog() {
|
|||||||
|
|
||||||
void mainWindowImpl::callSettingsDialog() {
|
void mainWindowImpl::callSettingsDialog() {
|
||||||
|
|
||||||
settingsDialogImpl *v = new settingsDialogImpl(this);
|
mySettingsDialog->exec();
|
||||||
v->exec();
|
|
||||||
|
|
||||||
|
if (mySettingsDialog->getSettingsCorrect()) {
|
||||||
if (v->getSettingsCorrect()) {
|
|
||||||
//Toolbox verstecken?
|
//Toolbox verstecken?
|
||||||
if (myConfig->readConfigInt("ShowLeftToolBox")) { groupBox_LeftToolBox->show(); }
|
if (myConfig->readConfigInt("ShowLeftToolBox")) { groupBox_LeftToolBox->show(); }
|
||||||
else { groupBox_LeftToolBox->hide(); }
|
else { groupBox_LeftToolBox->hide(); }
|
||||||
@@ -712,17 +707,17 @@ void mainWindowImpl::callSettingsDialog() {
|
|||||||
else { groupBox_RightToolBox->hide(); }
|
else { groupBox_RightToolBox->hide(); }
|
||||||
|
|
||||||
//Falls Spielernamen geändert wurden --> neu zeichnen --> erst beim nächsten Neustart neu ausgelesen
|
//Falls Spielernamen geändert wurden --> neu zeichnen --> erst beim nächsten Neustart neu ausgelesen
|
||||||
if (v->getPlayerNickIsChanged() && mySession->getCurrentGame()) {
|
if (mySettingsDialog->getPlayerNickIsChanged() && mySession->getCurrentGame()) {
|
||||||
|
|
||||||
HandInterface *currentHand = mySession->getCurrentGame()->getCurrentHand();
|
HandInterface *currentHand = mySession->getCurrentGame()->getCurrentHand();
|
||||||
currentHand->getPlayerArray()[0]->setMyName(v->lineEdit_humanPlayerName->text().toUtf8().constData());
|
currentHand->getPlayerArray()[0]->setMyName(mySettingsDialog->lineEdit_humanPlayerName->text().toUtf8().constData());
|
||||||
currentHand->getPlayerArray()[1]->setMyName(v->lineEdit_Opponent1Name->text().toUtf8().constData());
|
currentHand->getPlayerArray()[1]->setMyName(mySettingsDialog->lineEdit_Opponent1Name->text().toUtf8().constData());
|
||||||
currentHand->getPlayerArray()[2]->setMyName(v->lineEdit_Opponent2Name->text().toUtf8().constData());
|
currentHand->getPlayerArray()[2]->setMyName(mySettingsDialog->lineEdit_Opponent2Name->text().toUtf8().constData());
|
||||||
currentHand->getPlayerArray()[3]->setMyName(v->lineEdit_Opponent3Name->text().toUtf8().constData());
|
currentHand->getPlayerArray()[3]->setMyName(mySettingsDialog->lineEdit_Opponent3Name->text().toUtf8().constData());
|
||||||
currentHand->getPlayerArray()[4]->setMyName(v->lineEdit_Opponent4Name->text().toUtf8().constData());
|
currentHand->getPlayerArray()[4]->setMyName(mySettingsDialog->lineEdit_Opponent4Name->text().toUtf8().constData());
|
||||||
currentHand->getPlayerArray()[5]->setMyName(v->lineEdit_Opponent5Name->text().toUtf8().constData());
|
currentHand->getPlayerArray()[5]->setMyName(mySettingsDialog->lineEdit_Opponent5Name->text().toUtf8().constData());
|
||||||
currentHand->getPlayerArray()[6]->setMyName(v->lineEdit_Opponent6Name->text().toUtf8().constData());
|
currentHand->getPlayerArray()[6]->setMyName(mySettingsDialog->lineEdit_Opponent6Name->text().toUtf8().constData());
|
||||||
v->setPlayerNickIsChanged(FALSE);
|
mySettingsDialog->setPlayerNickIsChanged(FALSE);
|
||||||
|
|
||||||
refreshPlayerName();
|
refreshPlayerName();
|
||||||
}
|
}
|
||||||
@@ -730,13 +725,13 @@ void mainWindowImpl::callSettingsDialog() {
|
|||||||
if(mySession->getCurrentGame()) {
|
if(mySession->getCurrentGame()) {
|
||||||
|
|
||||||
HandInterface *currentHand = mySession->getCurrentGame()->getCurrentHand();
|
HandInterface *currentHand = mySession->getCurrentGame()->getCurrentHand();
|
||||||
currentHand->getPlayerArray()[0]->setMyAvatar(v->lineEdit_humanPlayerAvatar->text().toUtf8().constData());
|
currentHand->getPlayerArray()[0]->setMyAvatar(mySettingsDialog->lineEdit_humanPlayerAvatar->text().toUtf8().constData());
|
||||||
currentHand->getPlayerArray()[1]->setMyAvatar(v->lineEdit_Opponent1Avatar->text().toUtf8().constData());
|
currentHand->getPlayerArray()[1]->setMyAvatar(mySettingsDialog->lineEdit_Opponent1Avatar->text().toUtf8().constData());
|
||||||
currentHand->getPlayerArray()[2]->setMyAvatar(v->lineEdit_Opponent2Avatar->text().toUtf8().constData());
|
currentHand->getPlayerArray()[2]->setMyAvatar(mySettingsDialog->lineEdit_Opponent2Avatar->text().toUtf8().constData());
|
||||||
currentHand->getPlayerArray()[3]->setMyAvatar(v->lineEdit_Opponent3Avatar->text().toUtf8().constData());
|
currentHand->getPlayerArray()[3]->setMyAvatar(mySettingsDialog->lineEdit_Opponent3Avatar->text().toUtf8().constData());
|
||||||
currentHand->getPlayerArray()[4]->setMyAvatar(v->lineEdit_Opponent4Avatar->text().toUtf8().constData());
|
currentHand->getPlayerArray()[4]->setMyAvatar(mySettingsDialog->lineEdit_Opponent4Avatar->text().toUtf8().constData());
|
||||||
currentHand->getPlayerArray()[5]->setMyAvatar(v->lineEdit_Opponent5Avatar->text().toUtf8().constData());
|
currentHand->getPlayerArray()[5]->setMyAvatar(mySettingsDialog->lineEdit_Opponent5Avatar->text().toUtf8().constData());
|
||||||
currentHand->getPlayerArray()[6]->setMyAvatar(v->lineEdit_Opponent6Avatar->text().toUtf8().constData());
|
currentHand->getPlayerArray()[6]->setMyAvatar(mySettingsDialog->lineEdit_Opponent6Avatar->text().toUtf8().constData());
|
||||||
|
|
||||||
//avatar refresh
|
//avatar refresh
|
||||||
refreshPlayerAvatar();
|
refreshPlayerAvatar();
|
||||||
|
|||||||
@@ -40,6 +40,8 @@ class BoardInterface;
|
|||||||
class PlayerInterface;
|
class PlayerInterface;
|
||||||
class MyCardsPixmapLabel;
|
class MyCardsPixmapLabel;
|
||||||
class newGameDialogImpl;
|
class newGameDialogImpl;
|
||||||
|
class settingsDialogImpl;
|
||||||
|
class aboutPokerthImpl;
|
||||||
class joinNetworkGameDialogImpl;
|
class joinNetworkGameDialogImpl;
|
||||||
class connectToServerDialogImpl;
|
class connectToServerDialogImpl;
|
||||||
class createNetworkGameDialogImpl;
|
class createNetworkGameDialogImpl;
|
||||||
@@ -53,7 +55,7 @@ class mainWindowImpl: public QMainWindow, public Ui::mainWindow {
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
mainWindowImpl(QMainWindow *parent = 0 );
|
mainWindowImpl(ConfigFile *c = 0, QMainWindow *parent = 0);
|
||||||
|
|
||||||
~mainWindowImpl();
|
~mainWindowImpl();
|
||||||
|
|
||||||
@@ -279,6 +281,9 @@ private:
|
|||||||
QPixmap *flipside;
|
QPixmap *flipside;
|
||||||
|
|
||||||
//Dialoge
|
//Dialoge
|
||||||
|
aboutPokerthImpl *myAboutPokerthDialog;
|
||||||
|
newGameDialogImpl *myNewGameDialog;
|
||||||
|
settingsDialogImpl *mySettingsDialog;
|
||||||
joinNetworkGameDialogImpl *myJoinNetworkGameDialog;
|
joinNetworkGameDialogImpl *myJoinNetworkGameDialog;
|
||||||
connectToServerDialogImpl *myConnectToServerDialog;
|
connectToServerDialogImpl *myConnectToServerDialog;
|
||||||
startNetworkGameDialogImpl *myStartNetworkGameDialog;
|
startNetworkGameDialogImpl *myStartNetworkGameDialog;
|
||||||
|
|||||||
@@ -20,22 +20,18 @@
|
|||||||
#include "newgamedialogimpl.h"
|
#include "newgamedialogimpl.h"
|
||||||
#include "configfile.h"
|
#include "configfile.h"
|
||||||
|
|
||||||
newGameDialogImpl::newGameDialogImpl(QWidget *parent)
|
newGameDialogImpl::newGameDialogImpl(QWidget *parent, ConfigFile *c)
|
||||||
: QDialog(parent)
|
: QDialog(parent), myConfig(c)
|
||||||
{
|
{
|
||||||
|
|
||||||
setupUi(this);
|
setupUi(this);
|
||||||
|
|
||||||
//Formulare Füllen
|
|
||||||
ConfigFile myConfig;
|
|
||||||
|
|
||||||
//Game Settings
|
//Game Settings
|
||||||
|
spinBox_quantityPlayers->setValue(myConfig->readConfigInt("NumberOfPlayers"));
|
||||||
spinBox_quantityPlayers->setValue(myConfig.readConfigInt("NumberOfPlayers"));
|
spinBox_startCash->setValue(myConfig->readConfigInt("StartCash"));
|
||||||
spinBox_startCash->setValue(myConfig.readConfigInt("StartCash"));
|
spinBox_smallBlind->setValue(myConfig->readConfigInt("SmallBlind"));
|
||||||
spinBox_smallBlind->setValue(myConfig.readConfigInt("SmallBlind"));
|
spinBox_gameSpeed->setValue(myConfig->readConfigInt("GameSpeed"));
|
||||||
spinBox_gameSpeed->setValue(myConfig.readConfigInt("GameSpeed"));
|
spinBox_handsBeforeRaiseSmallBlind->setValue(myConfig->readConfigInt("HandsBeforeRaiseSmallBlind"));
|
||||||
spinBox_handsBeforeRaiseSmallBlind->setValue(myConfig.readConfigInt("HandsBeforeRaiseSmallBlind"));
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -26,14 +26,19 @@
|
|||||||
#include <QtGui>
|
#include <QtGui>
|
||||||
#include <QtCore>
|
#include <QtCore>
|
||||||
|
|
||||||
|
class ConfigFile;
|
||||||
|
|
||||||
class newGameDialogImpl: public QDialog, public Ui::newGameDialog {
|
class newGameDialogImpl: public QDialog, public Ui::newGameDialog {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
newGameDialogImpl(QWidget *parent = 0);
|
newGameDialogImpl(QWidget *parent = 0, ConfigFile* = 0);
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
ConfigFile *myConfig;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
+3
-3
@@ -62,7 +62,7 @@ int main( int argc, char **argv )
|
|||||||
{
|
{
|
||||||
//create defaultconfig
|
//create defaultconfig
|
||||||
bool configFirstStart = 1;
|
bool configFirstStart = 1;
|
||||||
ConfigFile myConfig(configFirstStart);
|
ConfigFile *myConfig = new ConfigFile(configFirstStart);
|
||||||
|
|
||||||
//ENABLE_LEAK_CHECK();
|
//ENABLE_LEAK_CHECK();
|
||||||
|
|
||||||
@@ -86,9 +86,9 @@ int main( int argc, char **argv )
|
|||||||
a.installTranslator(&translator);
|
a.installTranslator(&translator);
|
||||||
///////////////////////////////////////////////////
|
///////////////////////////////////////////////////
|
||||||
|
|
||||||
GuiInterface *myGuiInterface = new GuiWrapper();
|
GuiInterface *myGuiInterface = new GuiWrapper(myConfig);
|
||||||
{
|
{
|
||||||
boost::shared_ptr<Session> session(new Session(myGuiInterface));
|
boost::shared_ptr<Session> session(new Session(myGuiInterface, myConfig));
|
||||||
myGuiInterface->setSession(session);
|
myGuiInterface->setSession(session);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+2
-3
@@ -29,11 +29,10 @@
|
|||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
Session::Session(GuiInterface *g)
|
Session::Session(GuiInterface *g, ConfigFile *c)
|
||||||
: currentGameID(0), myNetClient(0), myNetServer(0), currentGame(0), myGui(g)
|
: currentGameID(0), myNetClient(0), myNetServer(0), currentGame(0), myGui(g), myConfig(c)
|
||||||
{
|
{
|
||||||
|
|
||||||
myConfig = new ConfigFile;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -32,7 +32,7 @@ class ServerThread;
|
|||||||
class Session{
|
class Session{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
Session(GuiInterface*);
|
Session(GuiInterface*, ConfigFile*);
|
||||||
|
|
||||||
~Session();
|
~Session();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user