move some style related defines and enums back to gui context
This commit is contained in:
@@ -35,8 +35,6 @@
|
||||
#define POKERTH_BETA_REVISION 0
|
||||
#define POKERTH_BETA_RELEASE_STRING "0.8-svn"
|
||||
|
||||
#define POKERTH_GT_STYLE_FILE_VERSION 2
|
||||
#define POKERTH_CD_STYLE_FILE_VERSION 1
|
||||
|
||||
enum ServerMode {
|
||||
SERVER_MODE_LAN,
|
||||
@@ -134,12 +132,4 @@ struct ServerStats
|
||||
unsigned maxPlayersLoggedIn;
|
||||
};
|
||||
|
||||
enum StyleState {
|
||||
OK = 0,
|
||||
OUTDATED,
|
||||
FIELDS_EMPTY,
|
||||
PICTURES_MISSING,
|
||||
NOT_READABLE
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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("");
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user