diff --git a/data/gfx/cards/default/defaultcarddeck.xml b/data/gfx/cards/default/defaultcarddeck.xml deleted file mode 100644 index c23e6996..00000000 --- a/data/gfx/cards/default/defaultcarddeck.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/data/gfx/cards/default/defaultdeckstyle.xml b/data/gfx/cards/default/defaultdeckstyle.xml new file mode 100644 index 00000000..a5d3d852 --- /dev/null +++ b/data/gfx/cards/default/defaultdeckstyle.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/data/gfx/cards/default/preview.png b/data/gfx/cards/default/preview.png new file mode 100644 index 00000000..e4e55941 Binary files /dev/null and b/data/gfx/cards/default/preview.png differ diff --git a/pokerth_game.pro b/pokerth_game.pro index c2b9f4cc..7e6c5de7 100644 --- a/pokerth_game.pro +++ b/pokerth_game.pro @@ -178,6 +178,7 @@ HEADERS += \ src/gui/qt/startnetworkgamedialog/startnetworkgamedialogimpl.h \ src/gui/qt/startwindow/startwindowimpl.h \ src/gui/qt/styles/gametablestylereader.h \ + src/gui/qt/styles/carddeckstylereader.h \ src/gui/qt/changehumanplayernamedialog/changehumanplayernamedialogimpl.h \ src/gui/qt/changecompleteblindsdialog/changecompleteblindsdialogimpl.h \ src/gui/qt/gamelobbydialog/gamelobbydialogimpl.h \ @@ -242,6 +243,7 @@ SOURCES += \ src/gui/qt/startnetworkgamedialog/startnetworkgamedialogimpl.cpp \ src/gui/qt/startwindow/startwindowimpl.cpp \ src/gui/qt/styles/gametablestylereader.cpp \ + src/gui/qt/styles/carddeckstylereader.cpp \ src/gui/qt/changehumanplayernamedialog/changehumanplayernamedialogimpl.cpp \ src/gui/qt/changecompleteblindsdialog/changecompleteblindsdialogimpl.cpp \ src/gui/qt/mymessagedialog/mymessagedialogimpl.cpp \ diff --git a/src/config/configfile.cpp b/src/config/configfile.cpp index e24d022c..e50b0ef3 100644 --- a/src/config/configfile.cpp +++ b/src/config/configfile.cpp @@ -48,7 +48,7 @@ ConfigFile::ConfigFile(char *argv0, bool readonly) : noWriteAccess(readonly) myQtToolsInterface = CreateQtToolsWrapper(); // !!!! Revisionsnummer der Configdefaults !!!!! - configRev = 61; + configRev = 62; //standard defaults logOnOffDefault = "1"; @@ -148,8 +148,8 @@ ConfigFile::ConfigFile(char *argv0, bool readonly) : noWriteAccess(readonly) configList.push_back(ConfigInfo("FlipsideOwnFile", CONFIG_TYPE_STRING, "")); configList.push_back(ConfigInfo("GameTableStylesList", CONFIG_TYPE_STRING_LIST, "GameTableStyles")); configList.push_back(ConfigInfo("CurrentGameTableStyle", CONFIG_TYPE_STRING, "")); - configList.push_back(ConfigInfo("CardDecksList", CONFIG_TYPE_STRING_LIST, "CardDecks")); - configList.push_back(ConfigInfo("CurrentCardDeck", CONFIG_TYPE_STRING, "")); + configList.push_back(ConfigInfo("CardDeckStylesList", CONFIG_TYPE_STRING_LIST, "CardDeckStyles")); + configList.push_back(ConfigInfo("CurrentCardDeckStyle", CONFIG_TYPE_STRING, "")); configList.push_back(ConfigInfo("PlaySoundEffects", CONFIG_TYPE_INT, "1")); configList.push_back(ConfigInfo("SoundVolume", CONFIG_TYPE_INT, "8")); configList.push_back(ConfigInfo("PlayGameActions", CONFIG_TYPE_INT, "1")); diff --git a/src/gui/qt/gametable.ui b/src/gui/qt/gametable.ui index 6260b671..d3127977 100644 --- a/src/gui/qt/gametable.ui +++ b/src/gui/qt/gametable.ui @@ -3496,7 +3496,7 @@ - View + &View @@ -3508,7 +3508,7 @@ - Settings + &Settings diff --git a/src/gui/qt/settingsdialog.ui b/src/gui/qt/settingsdialog.ui index e35e10bb..176cea1c 100644 --- a/src/gui/qt/settingsdialog.ui +++ b/src/gui/qt/settingsdialog.ui @@ -481,13 +481,13 @@ p, li { white-space: pre-wrap; } - Card Decks + Card Deck Styles - + Activate @@ -507,14 +507,14 @@ p, li { white-space: pre-wrap; } - + Add ... - + Remove @@ -529,7 +529,7 @@ p, li { white-space: pre-wrap; } - + 160 @@ -551,7 +551,7 @@ p, li { white-space: pre-wrap; } - + diff --git a/src/gui/qt/settingsdialog/settingsdialogimpl.cpp b/src/gui/qt/settingsdialog/settingsdialogimpl.cpp index ea6122f9..7a2a4028 100644 --- a/src/gui/qt/settingsdialog/settingsdialogimpl.cpp +++ b/src/gui/qt/settingsdialog/settingsdialogimpl.cpp @@ -20,11 +20,13 @@ #include "settingsdialogimpl.h" #include "myavatarlistitem.h" #include "gametablestylereader.h" +#include "carddeckstylereader.h" #include "configfile.h" #include #define POKERTH_DISTRIBUTED_GAME_TABLE_STYLES 1 +#define POKERTH_DISTRIBUTED_CARD_DECK_STYLES 1 using namespace std; @@ -110,8 +112,10 @@ settingsDialogImpl::settingsDialogImpl(QWidget *parent, ConfigFile *c, selectAva connect( pushButton_addGameTableStyle, SIGNAL( clicked() ), this, SLOT( addGameTableStyle()) ); connect( pushButton_removeGameTableStyle, SIGNAL( clicked() ), this, SLOT( removeGameTableStyle()) ); - - + connect( listWidget_cardDeckStyles, SIGNAL( currentItemChanged(QListWidgetItem*, QListWidgetItem*) ), this, SLOT ( showCurrentCardDeckStylePreview() )); + connect( pushButton_activateCardDeckStyle, SIGNAL( clicked() ), this, SLOT( setSelectedCardDeckStyleActivated()) ); + connect( pushButton_addCardDeckStyle, SIGNAL( clicked() ), this, SLOT( addCardDeckStyle()) ); + connect( pushButton_removeCardDeckStyle, SIGNAL( clicked() ), this, SLOT( removeCardDeckStyle()) ); } void settingsDialogImpl::exec() { @@ -235,13 +239,14 @@ void settingsDialogImpl::exec() { lineEdit_OwnFlipsideFilename->setText(QString::fromUtf8(myConfig->readConfigString("FlipsideOwnFile").c_str())); //S t y l e + //TABLE // define PokerTH default GameTableStyle listWidget_gameTableStyles->clear(); - GameTableStyleReader defaultStyle(myConfig); - defaultStyle.readStyleFile(QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str())+"/gfx/gui/table/default/defaulttablestyle.xml"); - QListWidgetItem *defaultItem = new QListWidgetItem(defaultStyle.getStyleDescription(),listWidget_gameTableStyles); - defaultItem->setData(15, QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str())+"/gfx/gui/table/default/defaulttablestyle.xml"); + GameTableStyleReader defaultTableStyle(myConfig); + defaultTableStyle.readStyleFile(QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str())+"/gfx/gui/table/default/defaulttablestyle.xml"); + QListWidgetItem *defaultTableItem = new QListWidgetItem(defaultTableStyle.getStyleDescription(),listWidget_gameTableStyles); + defaultTableItem->setData(15, QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str())+"/gfx/gui/table/default/defaulttablestyle.xml"); //load secondary styles into list (if fallback no entry) myGameTableStylesList = myConfig->readConfigStringList("GameTableStylesList"); @@ -260,17 +265,17 @@ void settingsDialogImpl::exec() { GameTableStyleReader currentGameTableStyle(myConfig); currentGameTableStyle.readStyleFile(QString::fromUtf8(myConfig->readConfigString("CurrentGameTableStyle").c_str())); int i; - bool currentFound(FALSE); + bool currentGameTableFound(FALSE); for(i=0; i < listWidget_gameTableStyles->count(); i++) { QListWidgetItem *item = listWidget_gameTableStyles->item(i); if(item->data(15) == currentGameTableStyle.getCurrentFileName()) { item->setIcon(QIcon(QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str())+"/gfx/gui/misc/rating.png")); listWidget_gameTableStyles->setCurrentItem(item); - currentFound=TRUE; + currentGameTableFound=TRUE; } else item->setIcon(QIcon()); } - if(!currentFound) { + if(!currentGameTableFound) { qDebug() << "Config ERROR: current game table style file not found in List. Mark default as selected."; QListWidgetItem *item = listWidget_gameTableStyles->item(0); item->setIcon(QIcon(QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str())+"/gfx/gui/misc/rating.png")); @@ -279,11 +284,51 @@ void settingsDialogImpl::exec() { //refresh Game Table Style Preview showCurrentGameTableStylePreview(); - + //CARDS //define PokerTH default CardDeck -// defaultCardDeck = myQtToolsInterface->getDataPathStdString(myArgv0)+"gfx/cards/default/defaultcarddeck.xml"; + listWidget_cardDeckStyles->clear(); + CardDeckStyleReader defaultCardStyle(myConfig); + defaultCardStyle.readStyleFile(QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str())+"/gfx/cards/default/defaultdeckstyle.xml"); + QListWidgetItem *defaultCardItem = new QListWidgetItem(defaultCardStyle.getStyleDescription(),listWidget_cardDeckStyles); + defaultCardItem->setData(15, QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str())+"/gfx/cards/default/defaultdeckstyle.xml"); + //load secondary card styles into list (if fallback no entry) + myCardDeckStylesList = myConfig->readConfigStringList("CardDeckStylesList"); + list::iterator it2; + for(it2= myCardDeckStylesList.begin(); it2 != myCardDeckStylesList.end(); it2++) { + CardDeckStyleReader nextStyle(myConfig); + nextStyle.readStyleFile(QString::fromUtf8(it2->c_str())); + if(!nextStyle.getFallBack()) { + QListWidgetItem *nextItem = new QListWidgetItem(nextStyle.getStyleDescription()); + nextItem->setData(15,QString::fromUtf8(it2->c_str())); + listWidget_cardDeckStyles->addItem(nextItem); + } + } + + //set current card deck style from config file + CardDeckStyleReader currentCardDeckStyle(myConfig); + currentCardDeckStyle.readStyleFile(QString::fromUtf8(myConfig->readConfigString("CurrentCardDeckStyle").c_str())); + int j; + bool currentCardDeckFound(FALSE); + for(j=0; j < listWidget_cardDeckStyles->count(); j++) { + QListWidgetItem *item = listWidget_cardDeckStyles->item(j); + if(item->data(15) == currentCardDeckStyle.getCurrentFileName()) { + item->setIcon(QIcon(QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str())+"/gfx/gui/misc/rating.png")); + listWidget_cardDeckStyles->setCurrentItem(item); + currentCardDeckFound=TRUE; + } + else item->setIcon(QIcon()); + } + if(!currentCardDeckFound) { + qDebug() << "Config ERROR: current card deck style file not found in List. Mark default as selected."; + QListWidgetItem *item = listWidget_cardDeckStyles->item(0); + item->setIcon(QIcon(QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str())+"/gfx/gui/misc/rating.png")); + listWidget_cardDeckStyles->setCurrentItem(item); + } + +// refresh Card Deck Style Preview + showCurrentCardDeckStylePreview(); //Sound groupBox_playSoundEffects->setChecked(myConfig->readConfigInt("PlaySoundEffects")); @@ -469,6 +514,7 @@ void settingsDialogImpl::isAccepted() { } //S T Y L E +// TABLE //save game table styles list myGameTableStylesList.clear(); int i; @@ -483,7 +529,22 @@ void settingsDialogImpl::isAccepted() { if(!item->icon().isNull()) myConfig->writeConfigString("CurrentGameTableStyle", item->data(15).toString().toUtf8().constData()); } - +// CARDS + //save card deck styles list + myCardDeckStylesList.clear(); + int j; + for(j=POKERTH_DISTRIBUTED_CARD_DECK_STYLES; j < listWidget_cardDeckStyles->count(); j++) { + QListWidgetItem *item = listWidget_cardDeckStyles->item(j); + myCardDeckStylesList.push_back(item->data(15).toString().toUtf8().constData()); + } + myConfig->writeConfigStringList("CardDeckStylesList", myCardDeckStylesList); + //save current card deck style + for(j=0; j < listWidget_cardDeckStyles->count(); j++) { + QListWidgetItem *item = listWidget_cardDeckStyles->item(j); + if(!item->icon().isNull()) + myConfig->writeConfigString("CurrentCardDeckStyle", item->data(15).toString().toUtf8().constData()); + } + //Sound myConfig->writeConfigInt("PlaySoundEffects", groupBox_playSoundEffects->isChecked()); myConfig->writeConfigInt("SoundVolume", horizontalSlider_soundVolume->value()); @@ -865,3 +926,85 @@ void settingsDialogImpl::removeGameTableStyle() } } +void settingsDialogImpl::showCurrentCardDeckStylePreview() +{ + QListWidgetItem* item = listWidget_cardDeckStyles->currentItem(); + if(item) { + CardDeckStyleReader style(myConfig); + style.readStyleFile(item->data(15).toString()); + QPixmap preview(style.getPreview()); + if(preview.height() > 160 || preview.width() > 120) label_cardDeckStylePreview->setPixmap(preview.scaled(160,120,Qt::KeepAspectRatio,Qt::SmoothTransformation)); + else label_cardDeckStylePreview->setPixmap(preview); + } +} + +void settingsDialogImpl::setSelectedCardDeckStyleActivated() +{ + QListWidgetItem* selectedItem = listWidget_cardDeckStyles->currentItem(); + if(selectedItem) { + int i; + for(i=0; i < listWidget_cardDeckStyles->count(); i++) { + QListWidgetItem *item = listWidget_cardDeckStyles->item(i); + if(item == selectedItem) { + item->setIcon(QIcon(QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str())+"/gfx/gui/misc/rating.png")); + } + else item->setIcon(QIcon()); + } + } +} + +void settingsDialogImpl::addCardDeckStyle() +{ + QString fileName = QFileDialog::getOpenFileName(this, tr("Please select your card deck style"), + QDir::home().absolutePath(), + tr("PokerTH card deck styles (*.xml)")); + + if (!fileName.isEmpty()) { + + int i; + bool fileNameAlreadyFound(FALSE); + for(i=0; i < listWidget_cardDeckStyles->count(); i++) { + QListWidgetItem *item = listWidget_cardDeckStyles->item(i); + if(item->data(15).toString() == fileName) + fileNameAlreadyFound = TRUE; + } + + if(fileNameAlreadyFound) { + QMessageBox::warning(this, tr("Card Deck Style Error"), + tr("Selected card deck style file is already in the list. \nPlease select another one to add!"), + QMessageBox::Ok); + } + else { + CardDeckStyleReader newStyle(myConfig); + newStyle.readStyleFile(fileName); + if(!newStyle.getFallBack()) { + QListWidgetItem *newItem = new QListWidgetItem(newStyle.getStyleDescription()); + newItem->setData(15,fileName); + listWidget_cardDeckStyles->addItem(newItem); + } + else { + QMessageBox::warning(this, tr("Card Deck Style File Error"), + tr("Could not read card deck style file. \nStyle will not be placed into list!"), + QMessageBox::Ok); + } + } + } +} + +void settingsDialogImpl::removeCardDeckStyle() +{ + //never delete PokerTH defaullt Styles + if(listWidget_cardDeckStyles->currentRow() >= POKERTH_DISTRIBUTED_CARD_DECK_STYLES) { + + QListWidgetItem* selectedItem = listWidget_cardDeckStyles->currentItem(); + if(selectedItem) { + // if selected is activated --> swith activation to first default + if(!selectedItem->icon().isNull()) { + QListWidgetItem* firstItem = listWidget_cardDeckStyles->item(0); + firstItem->setIcon(QIcon(QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str())+"/gfx/gui/misc/rating.png")); + } + //remove from List + listWidget_cardDeckStyles->takeItem(listWidget_cardDeckStyles->currentRow()); + } + } +} diff --git a/src/gui/qt/settingsdialog/settingsdialogimpl.h b/src/gui/qt/settingsdialog/settingsdialogimpl.h index b55cf934..0db1d18b 100644 --- a/src/gui/qt/settingsdialog/settingsdialogimpl.h +++ b/src/gui/qt/settingsdialog/settingsdialogimpl.h @@ -85,6 +85,11 @@ public slots: void addGameTableStyle(); void removeGameTableStyle(); + void setSelectedCardDeckStyleActivated(); + void showCurrentCardDeckStylePreview(); + void addCardDeckStyle(); + void removeCardDeckStyle(); + private: bool playerNickIsChanged; @@ -101,7 +106,7 @@ private: std::list myManualBlindsList; std::list myNetManualBlindsList; std::list myGameTableStylesList; - std::list myCardDecksList; + std::list myCardDeckStylesList; ConfigFile* myConfig; boost::shared_ptr mySelectAvatarDialogImpl; diff --git a/src/gui/qt/startwindow.ui b/src/gui/qt/startwindow.ui index e2c0fded..c5880bbd 100644 --- a/src/gui/qt/startwindow.ui +++ b/src/gui/qt/startwindow.ui @@ -1,7 +1,8 @@ - + + startWindow - - + + 0 0 @@ -9,29 +10,29 @@ 350 - + 450 350 - + 450 350 - + PokerTH 0.6.3 - The Open-Source Texas Holdem Engine - - - + + + - + Qt::Vertical - + 20 95 @@ -39,12 +40,12 @@ - + - + Qt::Horizontal - + 63 20 @@ -52,24 +53,24 @@ - - - + + + 6 - - + + Qt::NoFocus - + &1 Start Local Game - - + + :/gfx/swbuttonlocalgame.png:/gfx/swbuttonlocalgame.png - + 32 32 @@ -78,18 +79,18 @@ - - + + Qt::NoFocus - + &2 Internet Game - - + + :/gfx/swbuttoninternetgame.png:/gfx/swbuttoninternetgame.png - + 32 32 @@ -98,18 +99,18 @@ - - + + Qt::NoFocus - + &3 Create Network Game - - + + :/gfx/swbuttoncreatenetworkgame.png:/gfx/swbuttoncreatenetworkgame.png - + 32 32 @@ -118,18 +119,18 @@ - - + + Qt::NoFocus - + &4 Join Network Game - - + + :/gfx/swbuttonjoinnetworkgame.png:/gfx/swbuttonjoinnetworkgame.png - + 32 32 @@ -139,12 +140,12 @@ - + - + Qt::Horizontal - + 63 20 @@ -152,12 +153,12 @@ - + - + Qt::Vertical - + 20 95 @@ -167,113 +168,113 @@ - - + + 0 0 450 - 23 + 25 - - - PokerTH + + + &PokerTH - - + + Network Game - - + + - - - - - + + + + + - - - Settings + + + &Settings - + - - + + - - - - + + + + :/gfx/swbuttonlocalgame.png:/gfx/swbuttonlocalgame.png - + Start Local Game ... - + Ctrl+N - - - + + + :/gfx/swbuttoninternetgame.png:/gfx/swbuttoninternetgame.png - + Internet Game ... - + Ctrl+I - - + + About PokerTH - - - + + + :/gfx/systemsettings.png:/gfx/systemsettings.png - + Configure PokerTH ... - - - + + + :/gfx/application_exit.png:/gfx/application_exit.png - + Quit - + Ctrl+Q - - - + + + :/gfx/swbuttoncreatenetworkgame.png:/gfx/swbuttoncreatenetworkgame.png - + Create Network Game ... - - - + + + :/gfx/swbuttonjoinnetworkgame.png:/gfx/swbuttonjoinnetworkgame.png - + Join Network Game ... - + @@ -282,11 +283,11 @@ startWindow close() - + -1 -1 - + 221 168 diff --git a/src/gui/qt/styles/carddeckstylereader.cpp b/src/gui/qt/styles/carddeckstylereader.cpp new file mode 100644 index 00000000..cba705ca --- /dev/null +++ b/src/gui/qt/styles/carddeckstylereader.cpp @@ -0,0 +1,82 @@ +/*************************************************************************** + * Copyright (C) 2006 by Felix Hammer * + * f.hammer@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 "carddeckstylereader.h" +#include +#include +#include +#include + + +using namespace std; + +CardDeckStyleReader::CardDeckStyleReader(ConfigFile *c, gameTableImpl *w) : myConfig(c), myW(w), fallBack(0) +{ + +} + + +CardDeckStyleReader::~CardDeckStyleReader() +{ +} + +void CardDeckStyleReader::readStyleFile(QString file) { + + string tinyFileName; + + //if style file failed --> default style fallback + if(QFile(file).exists()) { + currentFileName = QFile(file).fileName(); + tinyFileName = currentFileName.toUtf8().constData(); + } + else { + currentFileName = QFile(QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str())+"/gfx/cards/default/defaultdeckstyle.xml").fileName(); + tinyFileName = currentFileName.toUtf8().constData(); + fallBack = 1; + } + QFileInfo info(currentFileName); + currentFileDir = info.absolutePath(); + + //start reading the file and fill vars + string tempString1(""); + TiXmlDocument doc(tinyFileName); + + if(doc.LoadFile()) { + TiXmlHandle docHandle( &doc ); + + TiXmlElement* itemsList = docHandle.FirstChild( "PokerTH" ).FirstChild( "CardDeck" ).FirstChild().ToElement(); + for( ; itemsList; itemsList=itemsList->NextSiblingElement()) { + const char *tmpStr1 = itemsList->Attribute("value"); + if (tmpStr1) { + tempString1 = tmpStr1; + + if(itemsList->ValueStr() == "StyleDescription") { StyleDescription = QString::fromUtf8(tempString1.c_str()); } + else if (itemsList->ValueStr() == "Preview") { Preview = QString::fromUtf8(tempString1.c_str()); } + } + } + + } + else { qDebug() << "could not load card deck file: " << tinyFileName.c_str(); } +} + +QString CardDeckStyleReader::getPreview() +{ + return QString(currentFileDir+"/"+Preview); +} + diff --git a/src/gui/qt/styles/carddeckstylereader.h b/src/gui/qt/styles/carddeckstylereader.h new file mode 100644 index 00000000..f6f622a6 --- /dev/null +++ b/src/gui/qt/styles/carddeckstylereader.h @@ -0,0 +1,58 @@ +/*************************************************************************** + * Copyright (C) 2009 by Felix Hammer * + * f.hammer@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 CARDDECKSTYLEREADER_H +#define CARDDECKSTYLEREADER_H + +#include "tinyxml.h" +#include "gametableimpl.h" +#include "configfile.h" +#include +#include +#include + +class CardDeckStyleReader : public QObject { +Q_OBJECT +public: + CardDeckStyleReader(ConfigFile *c, gameTableImpl *w =0 ); + ~CardDeckStyleReader(); + + void readStyleFile(QString); + + QString getStyleDescription() const { return StyleDescription; } + QString getCurrentFileName() const { return currentFileName; } + QString getPreview(); + + bool getFallBack() const { return fallBack; } + +private: + + QString StyleDescription; + QString Preview; + + QString currentFileName; + QString currentFileDir; + + ConfigFile *myConfig; + gameTableImpl *myW; + + bool fallBack; +}; + +#endif diff --git a/src/gui/qt/styles/gametablestylereader.h b/src/gui/qt/styles/gametablestylereader.h index 998ffb38..a1107a9d 100644 --- a/src/gui/qt/styles/gametablestylereader.h +++ b/src/gui/qt/styles/gametablestylereader.h @@ -41,10 +41,7 @@ public: QString getCurrentFileName() const { return currentFileName; } QString getPreview(); - bool getFallBack() const { return fallBack; } - - - + bool getFallBack() const { return fallBack; } private: