adds more information for styles shown in settings dialog
This commit is contained in:
@@ -67,7 +67,10 @@ void CardDeckStyleReader::readStyleFile(QString file) {
|
||||
tempString1 = tmpStr1;
|
||||
|
||||
if(itemsList->ValueStr() == "StyleDescription") { StyleDescription = QString::fromUtf8(tempString1.c_str()); }
|
||||
else if(itemsList->ValueStr() == "StyleMaintainerName") { StyleMaintainerName = QString::fromUtf8(tempString1.c_str()); }
|
||||
else if(itemsList->ValueStr() == "StyleMaintainerEMail") { StyleMaintainerEMail = QString::fromUtf8(tempString1.c_str()); }
|
||||
else if(itemsList->ValueStr() == "StyleCreateDate") { StyleCreateDate = QString::fromUtf8(tempString1.c_str()); }
|
||||
else if(itemsList->ValueStr() == "PokerTHStyleFileVersion") { PokerTHStyleFileVersion = QString::fromUtf8(tempString1.c_str()); }
|
||||
else if (itemsList->ValueStr() == "Preview") { Preview = currentDir+QString::fromUtf8(tempString1.c_str()); }
|
||||
}
|
||||
}
|
||||
@@ -75,6 +78,15 @@ void CardDeckStyleReader::readStyleFile(QString file) {
|
||||
}
|
||||
else { qDebug() << "could not load card deck file: " << tinyFileName.c_str(); }
|
||||
|
||||
//check if style items are left and show warning
|
||||
leftItems.clear();
|
||||
|
||||
if(StyleDescription == "") { leftItems << "StyleDescription"; }
|
||||
if(StyleMaintainerName == "") { leftItems << "StyleMaintainerName"; }
|
||||
if(StyleMaintainerEMail == "") { leftItems << "StyleMaintainerEMail"; }
|
||||
if(StyleCreateDate == "") { leftItems << "StyleCreateDate"; }
|
||||
if(PokerTHStyleFileVersion == "") { leftItems << "PokerTHStyleFileVersion"; }
|
||||
|
||||
//check if all files are there
|
||||
cardsLeft.clear();
|
||||
int i;
|
||||
@@ -88,10 +100,22 @@ void CardDeckStyleReader::readStyleFile(QString file) {
|
||||
cardsLeft << "flipside.png";
|
||||
}
|
||||
|
||||
if(!cardsLeft.isEmpty() && myW != 0) showErrorMessage(StyleDescription, cardsLeft, StyleMaintainerEMail);
|
||||
if(!leftItems.isEmpty() && myW != 0) showLeftItemsErrorMessage(StyleDescription, leftItems, StyleMaintainerEMail);
|
||||
else {
|
||||
if(!cardsLeft.isEmpty() && myW != 0) showCardsLeftErrorMessage(StyleDescription, cardsLeft, StyleMaintainerEMail);
|
||||
}
|
||||
}
|
||||
|
||||
void CardDeckStyleReader::showErrorMessage(QString style, QStringList failedItems, QString email)
|
||||
void CardDeckStyleReader::showLeftItemsErrorMessage(QString style, QStringList failedItems, QString email)
|
||||
{
|
||||
QString items = failedItems.join(", ");
|
||||
|
||||
QMessageBox::warning(myW, tr("Game Table Style Error"),
|
||||
tr("Selected game table style \"%1\" seems to be incomplete or defective. \n\nThe value(s) of \"%2\" is/are left. \n\nPlease contact the game table style builder %3.").arg(style).arg(items).arg(email),
|
||||
QMessageBox::Ok);
|
||||
}
|
||||
|
||||
void CardDeckStyleReader::showCardsLeftErrorMessage(QString style, QStringList failedItems, QString email)
|
||||
{
|
||||
QString items = failedItems.join(", ");
|
||||
|
||||
|
||||
@@ -36,24 +36,33 @@ public:
|
||||
void readStyleFile(QString);
|
||||
|
||||
QString getStyleDescription() const { return StyleDescription; }
|
||||
QString getStyleMaintainerName() const { return StyleMaintainerName; }
|
||||
QString getStyleMaintainerEMail() const { return StyleMaintainerEMail; }
|
||||
QString getStyleCreateDate() const { return StyleCreateDate; }
|
||||
|
||||
QString getCurrentFileName() const { return currentFileName; }
|
||||
QString getCurrentDir() const { return currentDir; }
|
||||
|
||||
QString getPreview() const { return Preview; }
|
||||
|
||||
bool getFallBack() const { return fallBack; }
|
||||
void showErrorMessage(QString, QStringList, QString);
|
||||
void showLeftItemsErrorMessage(QString, QStringList, QString);
|
||||
void showCardsLeftErrorMessage(QString, QStringList, QString);
|
||||
|
||||
private:
|
||||
|
||||
QString StyleDescription;
|
||||
QString StyleMaintainerName;
|
||||
QString StyleMaintainerEMail;
|
||||
QString StyleCreateDate;
|
||||
QString PokerTHStyleFileVersion;
|
||||
QString Preview;
|
||||
|
||||
QString currentFileName;
|
||||
QString currentDir;
|
||||
|
||||
QStringList cardsLeft;
|
||||
QStringList leftItems;
|
||||
|
||||
ConfigFile *myConfig;
|
||||
gameTableImpl *myW;
|
||||
|
||||
@@ -106,7 +106,9 @@ void GameTableStyleReader::readStyleFile(QString file) {
|
||||
|
||||
// INFOS
|
||||
if(itemsList->ValueStr() == "StyleDescription") { StyleDescription = QString::fromUtf8(tempString1.c_str()); }
|
||||
else if(itemsList->ValueStr() == "StyleMaintainerName") { StyleMaintainerName = QString::fromUtf8(tempString1.c_str()); }
|
||||
else if(itemsList->ValueStr() == "StyleMaintainerEMail") { StyleMaintainerEMail = QString::fromUtf8(tempString1.c_str()); }
|
||||
else if(itemsList->ValueStr() == "StyleCreateDate") { StyleCreateDate = QString::fromUtf8(tempString1.c_str()); }
|
||||
else if(itemsList->ValueStr() == "PokerTHStyleFileVersion") { PokerTHStyleFileVersion = QString::fromUtf8(tempString1.c_str()); }
|
||||
// WINDOWS SETTINGS
|
||||
else if (itemsList->ValueStr() == "IfFixedWindowSize") { IfFixedWindowSize = QString::fromUtf8(tempString1.c_str()); }
|
||||
@@ -234,6 +236,9 @@ void GameTableStyleReader::readStyleFile(QString file) {
|
||||
|
||||
// INFOS
|
||||
if(StyleDescription == "") { leftItems << "StyleDescription"; }
|
||||
if(StyleMaintainerName == "") { leftItems << "StyleMaintainerName"; }
|
||||
if(StyleMaintainerEMail == "") { leftItems << "StyleMaintainerEMail"; }
|
||||
if(StyleCreateDate == "") { leftItems << "StyleCreateDate"; }
|
||||
if(PokerTHStyleFileVersion == "") { leftItems << "PokerTHStyleFileVersion"; }
|
||||
// WINDOWS SETTINGS
|
||||
if(IfFixedWindowSize == "") { leftItems << "IfFixedWindowSize"; }
|
||||
|
||||
@@ -41,6 +41,10 @@ public:
|
||||
void showItemPicsLeftErrorMessage(QString, QStringList, QString);
|
||||
|
||||
QString getStyleDescription() const { return StyleDescription; }
|
||||
QString getStyleMaintainerName() const { return StyleMaintainerName; }
|
||||
QString getStyleMaintainerEMail() const { return StyleMaintainerEMail; }
|
||||
QString getStyleCreateDate() const { return StyleCreateDate; }
|
||||
|
||||
QString getCurrentFileName() const { return currentFileName; }
|
||||
QString getPreview() const { return Preview; }
|
||||
QString getDefaultAvatar() const { return DefaultAvatar; }
|
||||
@@ -111,7 +115,9 @@ private:
|
||||
//style values
|
||||
// INFOS
|
||||
QString StyleDescription;
|
||||
QString StyleMaintainerName;
|
||||
QString StyleMaintainerEMail;
|
||||
QString StyleCreateDate;
|
||||
QString PokerTHStyleFileVersion;
|
||||
// WINDOWS SETTINGS
|
||||
QString IfFixedWindowSize;
|
||||
|
||||
Reference in New Issue
Block a user