utf8 for logdir and datadir xml stream
This commit is contained in:
+10
-4
@@ -22,7 +22,8 @@ DEPENDPATH += . \
|
|||||||
src/gui/qt/createnetworkgamedialog \
|
src/gui/qt/createnetworkgamedialog \
|
||||||
src/gui/qt/joinnetworkgamedialog \
|
src/gui/qt/joinnetworkgamedialog \
|
||||||
src/gui/qt/log \
|
src/gui/qt/log \
|
||||||
src/gui/qt/qthelper \
|
src/gui/qt/qttools \
|
||||||
|
src/gui/qt/qttools/qthelper \
|
||||||
src/gui/qt/newlocalgamedialog \
|
src/gui/qt/newlocalgamedialog \
|
||||||
src/gui/qt/settingsdialog \
|
src/gui/qt/settingsdialog \
|
||||||
src/gui/qt/startnetworkgamedialog \
|
src/gui/qt/startnetworkgamedialog \
|
||||||
@@ -37,9 +38,10 @@ INCLUDEPATH += . \
|
|||||||
src/core/tinyxml \
|
src/core/tinyxml \
|
||||||
src/gui/qt \
|
src/gui/qt \
|
||||||
src/gui/qt/log \
|
src/gui/qt/log \
|
||||||
src/gui/qt/qthelper \
|
|
||||||
src/gui/qt/connecttoserverdialog \
|
src/gui/qt/connecttoserverdialog \
|
||||||
src/core \
|
src/core \
|
||||||
|
src/gui/qt/qttools \
|
||||||
|
src/gui/qt/qttools/qthelper \
|
||||||
src/gui/qt/mainwindow \
|
src/gui/qt/mainwindow \
|
||||||
src/gui/qt/mainwindow/startsplash \
|
src/gui/qt/mainwindow/startsplash \
|
||||||
src/gui/qt/aboutpokerth \
|
src/gui/qt/aboutpokerth \
|
||||||
@@ -102,7 +104,9 @@ HEADERS += src/game.h \
|
|||||||
src/gui/qt/settingsdialog/settingsdialogimpl.h \
|
src/gui/qt/settingsdialog/settingsdialogimpl.h \
|
||||||
src/gui/qt/startnetworkgamedialog/startnetworkgamedialogimpl.h \
|
src/gui/qt/startnetworkgamedialog/startnetworkgamedialogimpl.h \
|
||||||
src/gui/qt/waitforservertostartgamedialog/waitforservertostartgamedialogimpl.h \
|
src/gui/qt/waitforservertostartgamedialog/waitforservertostartgamedialogimpl.h \
|
||||||
src/gui/qt/qthelper/qthelper.h
|
src/gui/qttoolsinterface.h \
|
||||||
|
src/gui/qt/qttools/qttoolswrapper.h \
|
||||||
|
src/gui/qt/qttools/qthelper/qthelper.h
|
||||||
FORMS += src/gui/qt/mainwindow.ui \
|
FORMS += src/gui/qt/mainwindow.ui \
|
||||||
src/gui/qt/aboutpokerth.ui \
|
src/gui/qt/aboutpokerth.ui \
|
||||||
src/gui/qt/connecttoserverdialog.ui \
|
src/gui/qt/connecttoserverdialog.ui \
|
||||||
@@ -174,7 +178,9 @@ SOURCES += src/game.cpp \
|
|||||||
src/gui/qt/settingsdialog/settingsdialogimpl.cpp \
|
src/gui/qt/settingsdialog/settingsdialogimpl.cpp \
|
||||||
src/gui/qt/startnetworkgamedialog/startnetworkgamedialogimpl.cpp \
|
src/gui/qt/startnetworkgamedialog/startnetworkgamedialogimpl.cpp \
|
||||||
src/gui/qt/waitforservertostartgamedialog/waitforservertostartgamedialogimpl.cpp \
|
src/gui/qt/waitforservertostartgamedialog/waitforservertostartgamedialogimpl.cpp \
|
||||||
src/gui/qt/qthelper/qthelper.cpp
|
src/gui/qttoolsinterface.cpp \
|
||||||
|
src/gui/qt/qttools/qttoolswrapper.cpp \
|
||||||
|
src/gui/qt/qttools/qthelper/qthelper.cpp
|
||||||
RESOURCES += src/gui/qt/resources.qrc
|
RESOURCES += src/gui/qt/resources.qrc
|
||||||
|
|
||||||
TEMPLATE = vcapp
|
TEMPLATE = vcapp
|
||||||
|
|||||||
+151
-143
@@ -19,6 +19,8 @@
|
|||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
#include "configfile.h"
|
#include "configfile.h"
|
||||||
|
|
||||||
|
#include <qttoolswrapper.h>
|
||||||
|
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
@@ -30,6 +32,8 @@
|
|||||||
#include <direct.h>
|
#include <direct.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
class QtToolsWrapper;
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
ConfigFile::ConfigFile()
|
ConfigFile::ConfigFile()
|
||||||
@@ -120,158 +124,162 @@ ConfigFile::~ConfigFile()
|
|||||||
|
|
||||||
void ConfigFile::createDefaultConfig() {
|
void ConfigFile::createDefaultConfig() {
|
||||||
|
|
||||||
//Anlegen!
|
QtToolsInterface *myQtToolsInterface = new QtToolsWrapper;
|
||||||
TiXmlDocument doc;
|
|
||||||
TiXmlDeclaration * decl = new TiXmlDeclaration( "1.0", "UTF-8", "");
|
|
||||||
doc.LinkEndChild( decl );
|
|
||||||
|
|
||||||
TiXmlElement * root = new TiXmlElement( "PokerTH" );
|
//Anlegen!
|
||||||
doc.LinkEndChild( root );
|
TiXmlDocument doc;
|
||||||
//
|
TiXmlDeclaration * decl = new TiXmlDeclaration( "1.0", "UTF-8", "");
|
||||||
TiXmlElement * config;
|
doc.LinkEndChild( decl );
|
||||||
config = new TiXmlElement( "Configuration" );
|
|
||||||
root->LinkEndChild( config );
|
|
||||||
|
|
||||||
|
TiXmlElement * root = new TiXmlElement( "PokerTH" );
|
||||||
|
doc.LinkEndChild( root );
|
||||||
|
|
||||||
TiXmlElement * confElement0 = new TiXmlElement( "ConfigRevision" );
|
TiXmlElement * config;
|
||||||
config->LinkEndChild( confElement0 );
|
config = new TiXmlElement( "Configuration" );
|
||||||
confElement0->SetAttribute("value", configRev);
|
root->LinkEndChild( config );
|
||||||
TiXmlElement * confElement11 = new TiXmlElement( "ShowLeftToolBox" );
|
|
||||||
config->LinkEndChild( confElement11 );
|
|
||||||
confElement11->SetAttribute("value", 1);
|
|
||||||
TiXmlElement * confElement22 = new TiXmlElement( "ShowRightToolBox" );
|
|
||||||
config->LinkEndChild( confElement22 );
|
|
||||||
confElement22->SetAttribute("value", 1);
|
|
||||||
TiXmlElement * confElement43 = new TiXmlElement( "ShowStatusbarMessages" );
|
|
||||||
config->LinkEndChild( confElement43 );
|
|
||||||
confElement43->SetAttribute("value", 1);
|
|
||||||
TiXmlElement * confElement13 = new TiXmlElement( "ShowIntro" );
|
|
||||||
config->LinkEndChild( confElement13 );
|
|
||||||
confElement13->SetAttribute("value", 1);
|
|
||||||
TiXmlElement * confElement15 = new TiXmlElement( "ShowFadeOutCardsAnimation" );
|
|
||||||
config->LinkEndChild( confElement15 );
|
|
||||||
confElement15->SetAttribute("value", 1);
|
|
||||||
TiXmlElement * confElement19 = new TiXmlElement( "ShowFlipCardsAnimation" );
|
|
||||||
config->LinkEndChild( confElement19 );
|
|
||||||
confElement19->SetAttribute("value", 1);
|
|
||||||
TiXmlElement * confElement16 = new TiXmlElement( "FlipsideTux" );
|
|
||||||
config->LinkEndChild( confElement16 );
|
|
||||||
confElement16->SetAttribute("value", 1);
|
|
||||||
TiXmlElement * confElement17 = new TiXmlElement( "FlipsideOwn" );
|
|
||||||
config->LinkEndChild( confElement17 );
|
|
||||||
confElement17->SetAttribute("value", 0);
|
|
||||||
TiXmlElement * confElement18 = new TiXmlElement( "FlipsideOwnFile" );
|
|
||||||
config->LinkEndChild( confElement18 );
|
|
||||||
confElement18->SetAttribute("value", "");
|
|
||||||
|
|
||||||
TiXmlElement * confElement1 = new TiXmlElement( "NumberOfPlayers" );
|
TiXmlElement * confElement0 = new TiXmlElement( "ConfigRevision" );
|
||||||
config->LinkEndChild( confElement1 );
|
config->LinkEndChild( confElement0 );
|
||||||
confElement1->SetAttribute("value", 7);
|
confElement0->SetAttribute("value", configRev);
|
||||||
TiXmlElement * confElement2 = new TiXmlElement( "StartCash" );
|
TiXmlElement * confElement11 = new TiXmlElement( "ShowLeftToolBox" );
|
||||||
config->LinkEndChild( confElement2 );
|
config->LinkEndChild( confElement11 );
|
||||||
confElement2->SetAttribute("value", 3000);
|
confElement11->SetAttribute("value", 1);
|
||||||
TiXmlElement * confElement3 = new TiXmlElement( "SmallBlind" );
|
TiXmlElement * confElement22 = new TiXmlElement( "ShowRightToolBox" );
|
||||||
config->LinkEndChild( confElement3 );
|
config->LinkEndChild( confElement22 );
|
||||||
confElement3->SetAttribute("value", 10);
|
confElement22->SetAttribute("value", 1);
|
||||||
TiXmlElement * confElement12 = new TiXmlElement( "HandsBeforeRaiseSmallBlind" );
|
TiXmlElement * confElement43 = new TiXmlElement( "ShowStatusbarMessages" );
|
||||||
config->LinkEndChild( confElement12 );
|
config->LinkEndChild( confElement43 );
|
||||||
confElement12->SetAttribute("value", 8);
|
confElement43->SetAttribute("value", 1);
|
||||||
TiXmlElement * confElement4 = new TiXmlElement( "GameSpeed" );
|
TiXmlElement * confElement13 = new TiXmlElement( "ShowIntro" );
|
||||||
config->LinkEndChild( confElement4 );
|
config->LinkEndChild( confElement13 );
|
||||||
confElement4->SetAttribute("value", 4);
|
confElement13->SetAttribute("value", 1);
|
||||||
TiXmlElement * confElement32 = new TiXmlElement( "EngineVersion" );
|
TiXmlElement * confElement15 = new TiXmlElement( "ShowFadeOutCardsAnimation" );
|
||||||
config->LinkEndChild( confElement32 );
|
config->LinkEndChild( confElement15 );
|
||||||
confElement32->SetAttribute("value", 0);
|
confElement15->SetAttribute("value", 1);
|
||||||
TiXmlElement * confElement14 = new TiXmlElement( "PauseBetweenHands" );
|
TiXmlElement * confElement19 = new TiXmlElement( "ShowFlipCardsAnimation" );
|
||||||
config->LinkEndChild( confElement14 );
|
config->LinkEndChild( confElement19 );
|
||||||
confElement14->SetAttribute("value", 0);
|
confElement19->SetAttribute("value", 1);
|
||||||
TiXmlElement * confElement5 = new TiXmlElement( "ShowGameSettingsDialogOnNewGame" );
|
TiXmlElement * confElement16 = new TiXmlElement( "FlipsideTux" );
|
||||||
config->LinkEndChild( confElement5 );
|
config->LinkEndChild( confElement16 );
|
||||||
confElement5->SetAttribute("value", 1);
|
confElement16->SetAttribute("value", 1);
|
||||||
|
TiXmlElement * confElement17 = new TiXmlElement( "FlipsideOwn" );
|
||||||
|
config->LinkEndChild( confElement17 );
|
||||||
|
confElement17->SetAttribute("value", 0);
|
||||||
|
TiXmlElement * confElement18 = new TiXmlElement( "FlipsideOwnFile" );
|
||||||
|
config->LinkEndChild( confElement18 );
|
||||||
|
confElement18->SetAttribute("value", "");
|
||||||
|
|
||||||
TiXmlElement * confElement23 = new TiXmlElement( "NetNumberOfPlayers" );
|
TiXmlElement * confElement1 = new TiXmlElement( "NumberOfPlayers" );
|
||||||
config->LinkEndChild( confElement23 );
|
config->LinkEndChild( confElement1 );
|
||||||
confElement23->SetAttribute("value", 7);
|
confElement1->SetAttribute("value", 7);
|
||||||
TiXmlElement * confElement24 = new TiXmlElement( "NetStartCash" );
|
TiXmlElement * confElement2 = new TiXmlElement( "StartCash" );
|
||||||
config->LinkEndChild( confElement24 );
|
config->LinkEndChild( confElement2 );
|
||||||
confElement24->SetAttribute("value", 2000);
|
confElement2->SetAttribute("value", 3000);
|
||||||
TiXmlElement * confElement25 = new TiXmlElement( "NetSmallBlind" );
|
TiXmlElement * confElement3 = new TiXmlElement( "SmallBlind" );
|
||||||
config->LinkEndChild( confElement25 );
|
config->LinkEndChild( confElement3 );
|
||||||
confElement25->SetAttribute("value", 10);
|
confElement3->SetAttribute("value", 10);
|
||||||
TiXmlElement * confElement26 = new TiXmlElement( "NetHandsBeforeRaiseSmallBlind" );
|
TiXmlElement * confElement12 = new TiXmlElement( "HandsBeforeRaiseSmallBlind" );
|
||||||
config->LinkEndChild( confElement26 );
|
config->LinkEndChild( confElement12 );
|
||||||
confElement26->SetAttribute("value", 9);
|
confElement12->SetAttribute("value", 8);
|
||||||
TiXmlElement * confElement27 = new TiXmlElement( "NetGameSpeed" );
|
TiXmlElement * confElement4 = new TiXmlElement( "GameSpeed" );
|
||||||
config->LinkEndChild( confElement27 );
|
config->LinkEndChild( confElement4 );
|
||||||
confElement27->SetAttribute("value", 4);
|
confElement4->SetAttribute("value", 4);
|
||||||
TiXmlElement * confElement33 = new TiXmlElement( "NetEngineVersion" );
|
TiXmlElement * confElement32 = new TiXmlElement( "EngineVersion" );
|
||||||
config->LinkEndChild( confElement33 );
|
config->LinkEndChild( confElement32 );
|
||||||
confElement33->SetAttribute("value", 1);
|
confElement32->SetAttribute("value", 0);
|
||||||
TiXmlElement * confElement28 = new TiXmlElement( "ServerPassword" );
|
TiXmlElement * confElement14 = new TiXmlElement( "PauseBetweenHands" );
|
||||||
config->LinkEndChild( confElement28 );
|
config->LinkEndChild( confElement14 );
|
||||||
confElement28->SetAttribute("value", "");
|
confElement14->SetAttribute("value", 0);
|
||||||
TiXmlElement * confElement29 = new TiXmlElement( "ServerUseIpv6" );
|
TiXmlElement * confElement5 = new TiXmlElement( "ShowGameSettingsDialogOnNewGame" );
|
||||||
config->LinkEndChild( confElement29 );
|
config->LinkEndChild( confElement5 );
|
||||||
confElement29->SetAttribute("value", 0);
|
confElement5->SetAttribute("value", 1);
|
||||||
TiXmlElement * confElement30 = new TiXmlElement( "ServerPort" );
|
|
||||||
config->LinkEndChild( confElement30 );
|
|
||||||
confElement30->SetAttribute("value", 7234);
|
|
||||||
|
|
||||||
TiXmlElement * confElement6 = new TiXmlElement( "MyName" );
|
TiXmlElement * confElement23 = new TiXmlElement( "NetNumberOfPlayers" );
|
||||||
config->LinkEndChild( confElement6 );
|
config->LinkEndChild( confElement23 );
|
||||||
confElement6->SetAttribute("value", "Human Player");
|
confElement23->SetAttribute("value", 7);
|
||||||
TiXmlElement * confElement34 = new TiXmlElement( "MyAvatar" );
|
TiXmlElement * confElement24 = new TiXmlElement( "NetStartCash" );
|
||||||
config->LinkEndChild( confElement34 );
|
config->LinkEndChild( confElement24 );
|
||||||
confElement34->SetAttribute("value", "");
|
confElement24->SetAttribute("value", 2000);
|
||||||
TiXmlElement * confElement7 = new TiXmlElement( "Opponent1Name" );
|
TiXmlElement * confElement25 = new TiXmlElement( "NetSmallBlind" );
|
||||||
config->LinkEndChild( confElement7 );
|
config->LinkEndChild( confElement25 );
|
||||||
confElement7->SetAttribute("value", "Player 1");
|
confElement25->SetAttribute("value", 10);
|
||||||
TiXmlElement * confElement35 = new TiXmlElement( "Opponent1Avatar" );
|
TiXmlElement * confElement26 = new TiXmlElement( "NetHandsBeforeRaiseSmallBlind" );
|
||||||
config->LinkEndChild( confElement35 );
|
config->LinkEndChild( confElement26 );
|
||||||
confElement35->SetAttribute("value", "");
|
confElement26->SetAttribute("value", 9);
|
||||||
TiXmlElement * confElement8 = new TiXmlElement( "Opponent2Name" );
|
TiXmlElement * confElement27 = new TiXmlElement( "NetGameSpeed" );
|
||||||
config->LinkEndChild( confElement8 );
|
config->LinkEndChild( confElement27 );
|
||||||
confElement8->SetAttribute("value", "Player 2");
|
confElement27->SetAttribute("value", 4);
|
||||||
TiXmlElement * confElement36 = new TiXmlElement( "Opponent2Avatar" );
|
TiXmlElement * confElement33 = new TiXmlElement( "NetEngineVersion" );
|
||||||
config->LinkEndChild( confElement36 );
|
config->LinkEndChild( confElement33 );
|
||||||
confElement36->SetAttribute("value", "");
|
confElement33->SetAttribute("value", 1);
|
||||||
TiXmlElement * confElement9 = new TiXmlElement( "Opponent3Name" );
|
TiXmlElement * confElement28 = new TiXmlElement( "ServerPassword" );
|
||||||
config->LinkEndChild( confElement9 );
|
config->LinkEndChild( confElement28 );
|
||||||
confElement9->SetAttribute("value", "Player 3");
|
confElement28->SetAttribute("value", "");
|
||||||
TiXmlElement * confElement37 = new TiXmlElement( "Opponent3Avatar" );
|
TiXmlElement * confElement29 = new TiXmlElement( "ServerUseIpv6" );
|
||||||
config->LinkEndChild( confElement37 );
|
config->LinkEndChild( confElement29 );
|
||||||
confElement37->SetAttribute("value", "");
|
confElement29->SetAttribute("value", 0);
|
||||||
TiXmlElement * confElement10 = new TiXmlElement( "Opponent4Name" );
|
TiXmlElement * confElement30 = new TiXmlElement( "ServerPort" );
|
||||||
config->LinkEndChild( confElement10 );
|
config->LinkEndChild( confElement30 );
|
||||||
confElement10->SetAttribute("value", "Player 4");
|
confElement30->SetAttribute("value", 7234);
|
||||||
TiXmlElement * confElement38 = new TiXmlElement( "Opponent4Avatar" );
|
|
||||||
config->LinkEndChild( confElement38 );
|
|
||||||
confElement38->SetAttribute("value", "");
|
|
||||||
TiXmlElement * confElement39 = new TiXmlElement( "Opponent5Name" );
|
|
||||||
config->LinkEndChild( confElement39 );
|
|
||||||
confElement39->SetAttribute("value", "Player 5");
|
|
||||||
TiXmlElement * confElement40 = new TiXmlElement( "Opponent5Avatar" );
|
|
||||||
config->LinkEndChild( confElement40 );
|
|
||||||
confElement40->SetAttribute("value", "");
|
|
||||||
TiXmlElement * confElement41 = new TiXmlElement( "Opponent6Name" );
|
|
||||||
config->LinkEndChild( confElement41 );
|
|
||||||
confElement41->SetAttribute("value", "Player 6");
|
|
||||||
TiXmlElement * confElement42 = new TiXmlElement( "Opponent6Avatar" );
|
|
||||||
config->LinkEndChild( confElement42 );
|
|
||||||
confElement42->SetAttribute("value", "");
|
|
||||||
|
|
||||||
TiXmlElement * confElement20 = new TiXmlElement( "LogDir" );
|
TiXmlElement * confElement6 = new TiXmlElement( "MyName" );
|
||||||
config->LinkEndChild( confElement20 );
|
config->LinkEndChild( confElement6 );
|
||||||
confElement20->SetAttribute("value", logDir);
|
confElement6->SetAttribute("value", "Human Player");
|
||||||
TiXmlElement * confElement21 = new TiXmlElement( "LogStoreDuration" );
|
TiXmlElement * confElement34 = new TiXmlElement( "MyAvatar" );
|
||||||
config->LinkEndChild( confElement21 );
|
config->LinkEndChild( confElement34 );
|
||||||
confElement21->SetAttribute("value", 2);
|
confElement34->SetAttribute("value", "");
|
||||||
|
TiXmlElement * confElement7 = new TiXmlElement( "Opponent1Name" );
|
||||||
|
config->LinkEndChild( confElement7 );
|
||||||
|
confElement7->SetAttribute("value", "Player 1");
|
||||||
|
TiXmlElement * confElement35 = new TiXmlElement( "Opponent1Avatar" );
|
||||||
|
config->LinkEndChild( confElement35 );
|
||||||
|
confElement35->SetAttribute("value", "");
|
||||||
|
TiXmlElement * confElement8 = new TiXmlElement( "Opponent2Name" );
|
||||||
|
config->LinkEndChild( confElement8 );
|
||||||
|
confElement8->SetAttribute("value", "Player 2");
|
||||||
|
TiXmlElement * confElement36 = new TiXmlElement( "Opponent2Avatar" );
|
||||||
|
config->LinkEndChild( confElement36 );
|
||||||
|
confElement36->SetAttribute("value", "");
|
||||||
|
TiXmlElement * confElement9 = new TiXmlElement( "Opponent3Name" );
|
||||||
|
config->LinkEndChild( confElement9 );
|
||||||
|
confElement9->SetAttribute("value", "Player 3");
|
||||||
|
TiXmlElement * confElement37 = new TiXmlElement( "Opponent3Avatar" );
|
||||||
|
config->LinkEndChild( confElement37 );
|
||||||
|
confElement37->SetAttribute("value", "");
|
||||||
|
TiXmlElement * confElement10 = new TiXmlElement( "Opponent4Name" );
|
||||||
|
config->LinkEndChild( confElement10 );
|
||||||
|
confElement10->SetAttribute("value", "Player 4");
|
||||||
|
TiXmlElement * confElement38 = new TiXmlElement( "Opponent4Avatar" );
|
||||||
|
config->LinkEndChild( confElement38 );
|
||||||
|
confElement38->SetAttribute("value", "");
|
||||||
|
TiXmlElement * confElement39 = new TiXmlElement( "Opponent5Name" );
|
||||||
|
config->LinkEndChild( confElement39 );
|
||||||
|
confElement39->SetAttribute("value", "Player 5");
|
||||||
|
TiXmlElement * confElement40 = new TiXmlElement( "Opponent5Avatar" );
|
||||||
|
config->LinkEndChild( confElement40 );
|
||||||
|
confElement40->SetAttribute("value", "");
|
||||||
|
TiXmlElement * confElement41 = new TiXmlElement( "Opponent6Name" );
|
||||||
|
config->LinkEndChild( confElement41 );
|
||||||
|
confElement41->SetAttribute("value", "Player 6");
|
||||||
|
TiXmlElement * confElement42 = new TiXmlElement( "Opponent6Avatar" );
|
||||||
|
config->LinkEndChild( confElement42 );
|
||||||
|
confElement42->SetAttribute("value", "");
|
||||||
|
|
||||||
TiXmlElement * confElement31 = new TiXmlElement( "DataDir" );
|
TiXmlElement * confElement20 = new TiXmlElement( "LogDir" );
|
||||||
config->LinkEndChild( confElement31 );
|
config->LinkEndChild( confElement20 );
|
||||||
confElement31->SetAttribute("value", dataDir);
|
confElement20->SetAttribute("value", myQtToolsInterface->stringToUtf8(logDir));
|
||||||
|
TiXmlElement * confElement21 = new TiXmlElement( "LogStoreDuration" );
|
||||||
|
config->LinkEndChild( confElement21 );
|
||||||
|
confElement21->SetAttribute("value", 2);
|
||||||
|
|
||||||
doc.SaveFile( configFileName );
|
TiXmlElement * confElement31 = new TiXmlElement( "DataDir" );
|
||||||
|
config->LinkEndChild( confElement31 );
|
||||||
|
confElement31->SetAttribute("value", myQtToolsInterface->stringToUtf8(dataDir));
|
||||||
|
|
||||||
|
doc.SaveFile( configFileName );
|
||||||
|
|
||||||
|
delete myQtToolsInterface;
|
||||||
|
myQtToolsInterface = 0;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -23,6 +23,8 @@
|
|||||||
#include "tinyxml.h"
|
#include "tinyxml.h"
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class ConfigFile{
|
class ConfigFile{
|
||||||
public:
|
public:
|
||||||
ConfigFile();
|
ConfigFile();
|
||||||
|
|||||||
@@ -95,9 +95,6 @@ public:
|
|||||||
virtual void logPlayerActionMsg(std::string playName, int action, int setValue) =0;
|
virtual void logPlayerActionMsg(std::string playName, int action, int setValue) =0;
|
||||||
virtual void logNewGameHandMsg(int gameID, int HandID) =0;
|
virtual void logNewGameHandMsg(int gameID, int HandID) =0;
|
||||||
|
|
||||||
//qthelper.cpp
|
|
||||||
virtual std::string stringToUtf8(const std::string &) =0;
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -88,9 +88,6 @@ void GuiWrapper::meInAction() const { myW->meInAction(); }
|
|||||||
void GuiWrapper::logPlayerActionMsg(string playerName, int action, int setValue) { myLog->logPlayerActionMsg(playerName, action, setValue); }
|
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); }
|
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::SignalNetClientConnect(int actionID) { myW->SignalNetClientConnect(actionID); }
|
||||||
void GuiWrapper::SignalNetClientGameInfo(int actionID) { myW->SignalNetClientGameInfo(actionID); }
|
void GuiWrapper::SignalNetClientGameInfo(int actionID) { myW->SignalNetClientGameInfo(actionID); }
|
||||||
void GuiWrapper::SignalNetClientError(int errorID, int osErrorID) { myW->SignalNetClientError(errorID, osErrorID); }
|
void GuiWrapper::SignalNetClientError(int errorID, int osErrorID) { myW->SignalNetClientError(errorID, osErrorID); }
|
||||||
|
|||||||
@@ -25,7 +25,6 @@
|
|||||||
#include "log.h"
|
#include "log.h"
|
||||||
#include "mainwindowimpl.h"
|
#include "mainwindowimpl.h"
|
||||||
#include "connecttoserverdialogimpl.h"
|
#include "connecttoserverdialogimpl.h"
|
||||||
#include "qthelper.h"
|
|
||||||
#include "configfile.h"
|
#include "configfile.h"
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
@@ -89,8 +88,6 @@ public:
|
|||||||
void logPlayerActionMsg(std::string playerName, int action, int setValue) ;
|
void logPlayerActionMsg(std::string playerName, int action, int setValue) ;
|
||||||
void logNewGameHandMsg(int gameID, int handID) ;
|
void logNewGameHandMsg(int gameID, int handID) ;
|
||||||
|
|
||||||
std::string stringToUtf8(const std::string &);
|
|
||||||
|
|
||||||
void SignalNetClientConnect(int actionID);
|
void SignalNetClientConnect(int actionID);
|
||||||
void SignalNetClientGameInfo(int actionID);
|
void SignalNetClientGameInfo(int actionID);
|
||||||
void SignalNetClientError(int errorID, int osErrorID);
|
void SignalNetClientError(int errorID, int osErrorID);
|
||||||
@@ -104,7 +101,6 @@ private:
|
|||||||
Log *myLog;
|
Log *myLog;
|
||||||
mainWindowImpl *myW;
|
mainWindowImpl *myW;
|
||||||
ConfigFile *myConfig;
|
ConfigFile *myConfig;
|
||||||
QtHelper *myQtHelper;
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -94,6 +94,8 @@ Log::Log(mainWindowImpl* w) : myW(w)
|
|||||||
|
|
||||||
Log::~Log()
|
Log::~Log()
|
||||||
{
|
{
|
||||||
|
delete myConfig;
|
||||||
|
myConfig = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Log::logPlayerActionMsg(string playerName, int action, int setValue) {
|
void Log::logPlayerActionMsg(string playerName, int action, int setValue) {
|
||||||
|
|||||||
@@ -547,7 +547,11 @@ mainWindowImpl::mainWindowImpl(QMainWindow *parent)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
mainWindowImpl::~mainWindowImpl() {}
|
mainWindowImpl::~mainWindowImpl() {
|
||||||
|
|
||||||
|
delete myConfig;
|
||||||
|
myConfig = 0;
|
||||||
|
}
|
||||||
|
|
||||||
void mainWindowImpl::callNewGameDialog() {
|
void mainWindowImpl::callNewGameDialog() {
|
||||||
|
|
||||||
|
|||||||
@@ -20,21 +20,21 @@
|
|||||||
|
|
||||||
#include "qttoolswrapper.h"
|
#include "qttoolswrapper.h"
|
||||||
|
|
||||||
#include <appdirpath.h>
|
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
|
|
||||||
QtToolsWrapper::QtToolsWrapper() : myAppDirPath(0)
|
QtToolsWrapper::QtToolsWrapper() : myQtHelper(0)
|
||||||
{
|
{
|
||||||
|
|
||||||
myAppDirPath = new AppDirPath();
|
myQtHelper = new QtHelper();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
QtToolsWrapper::~QtToolsWrapper()
|
QtToolsWrapper::~QtToolsWrapper()
|
||||||
{
|
{
|
||||||
|
delete myQtHelper;
|
||||||
|
myQtHelper = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string QtToolsWrapper::getMyAppDirPath() const { return myAppDirPath->getMyPath(); }
|
std::string QtToolsWrapper::stringToUtf8(const std::string &myString) { return myQtHelper->stringToUtf8(myString); }
|
||||||
|
|
||||||
|
|||||||
@@ -21,11 +21,12 @@
|
|||||||
#define QTTOOLSWRAPPER_H
|
#define QTTOOLSWRAPPER_H
|
||||||
|
|
||||||
#include <qttoolsinterface.h>
|
#include <qttoolsinterface.h>
|
||||||
|
#include <qthelper.h>
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
class AppDirPath;
|
class QtHelper;
|
||||||
|
|
||||||
class QtToolsWrapper : public QtToolsInterface
|
class QtToolsWrapper : public QtToolsInterface
|
||||||
{
|
{
|
||||||
@@ -34,11 +35,11 @@ public:
|
|||||||
|
|
||||||
~QtToolsWrapper();
|
~QtToolsWrapper();
|
||||||
|
|
||||||
std::string getMyAppDirPath() const;
|
std::string stringToUtf8(const std::string &myString);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
AppDirPath *myAppDirPath;
|
QtHelper *myQtHelper;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,26 @@
|
|||||||
|
/***************************************************************************
|
||||||
|
* 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()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
/***************************************************************************
|
||||||
|
* 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();
|
||||||
|
|
||||||
|
//qthelper.cpp
|
||||||
|
virtual std::string stringToUtf8(const std::string &) =0;
|
||||||
|
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -42,6 +42,7 @@ Session::~Session()
|
|||||||
terminateNetworkServer();
|
terminateNetworkServer();
|
||||||
deleteGame();
|
deleteGame();
|
||||||
delete myConfig;
|
delete myConfig;
|
||||||
|
myConfig = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user