move some style related defines and enums back to gui context

This commit is contained in:
doitux
2010-07-10 13:25:23 +00:00
parent deee0e8853
commit 98d7e84ed2
4 changed files with 30 additions and 21 deletions
+10
View File
@@ -26,6 +26,16 @@
#include <QtCore>
#include <QtGui>
#define POKERTH_CD_STYLE_FILE_VERSION 1
enum CdStyleState {
CD_STYLE_OK = 0,
CD_STYLE_OUTDATED,
CD_STYLE_FIELDS_EMPTY,
CD_STYLE_PICTURES_MISSING,
CD_STYLE_NOT_READABLE
};
class CardDeckStyleReader : public QObject {
Q_OBJECT
public:
+8 -9
View File
@@ -23,7 +23,6 @@
#include <cstdlib>
#include <fstream>
using namespace std;
GameTableStyleReader::GameTableStyleReader(ConfigFile *c, QWidget *w) : myConfig(c), myW(w), fallBack(0), loadedSuccessfull(0)
@@ -482,20 +481,20 @@ void GameTableStyleReader::readStyleFile(QString file) {
//set loadedSuccessfull TRUE if everything works
if(leftItems.isEmpty() && itemPicsLeft.isEmpty() && PokerTHStyleFileVersion != "" && PokerTHStyleFileVersion.toInt() == POKERTH_GT_STYLE_FILE_VERSION) {
loadedSuccessfull = 1;
myState = OK;
myState = GT_STYLE_OK;
}
else
loadedSuccessfull = 1;
//check for style file version
if(PokerTHStyleFileVersion != "" && PokerTHStyleFileVersion.toInt() != POKERTH_GT_STYLE_FILE_VERSION)
myState = OUTDATED;
myState = GT_STYLE_OUTDATED;
else {
//if one or more items are left
if(!leftItems.isEmpty() && myW != 0) myState = FIELDS_EMPTY;
if(!leftItems.isEmpty() && myW != 0) myState = GT_STYLE_FIELDS_EMPTY;
//if one or more pictures where not found
if(!itemPicsLeft.isEmpty() && myW != 0) myState = PICTURES_MISSING;
if(!itemPicsLeft.isEmpty() && myW != 0) myState = GT_STYLE_PICTURES_MISSING;
}
}
}
@@ -881,13 +880,13 @@ QString GameTableStyleReader::getFallBackFieldContent(QString field, int type)
QString GameTableStyleReader::getMyStateToolTipInfo()
{
switch (myState) {
case OK: return QString(tr("Everything OK!"));
case GT_STYLE_OK: return QString(tr("Everything OK!"));
break;
case PICTURES_MISSING: return QString(tr("Some pictures are missing, please contact style maintainer for this issue."));
case GT_STYLE_PICTURES_MISSING: return QString(tr("Some pictures are missing, please contact style maintainer for this issue."));
break;
case FIELDS_EMPTY: return QString(tr("Some style fields are missing, please contact style maintainer for this issue."));
case GT_STYLE_FIELDS_EMPTY: return QString(tr("Some style fields are missing, please contact style maintainer for this issue."));
break;
case OUTDATED: return QString(tr("This style is outdated, please contact style maintainer for this issue."));
case GT_STYLE_OUTDATED: return QString(tr("This style is outdated, please contact style maintainer for this issue."));
break;
default: return QString("");
}
+12 -2
View File
@@ -28,6 +28,16 @@
#include <QtCore>
#include <QtGui>
#define POKERTH_GT_STYLE_FILE_VERSION 2
enum GtStyleState {
GT_STYLE_OK = 0,
GT_STYLE_OUTDATED,
GT_STYLE_FIELDS_EMPTY,
GT_STYLE_PICTURES_MISSING,
GT_STYLE_NOT_READABLE
};
class gameTableImpl;
class GameTableStyleReader : public QObject {
@@ -77,7 +87,7 @@ public:
bool getFallBack() const { return fallBack; }
bool getLoadedSuccessfull() const { return loadedSuccessfull; }
StyleState getState() const { return myState; }
GtStyleState getState() const { return myState; }
//set pictures
void setTableBackground(gameTableImpl*);
@@ -294,7 +304,7 @@ private:
bool fallBack;
bool loadedSuccessfull;
StyleState myState;
GtStyleState myState;
};