adds more information for styles shown in settings dialog

This commit is contained in:
doitux
2009-04-10 18:31:31 +00:00
parent 2417778152
commit e0ff82e31f
11 changed files with 265 additions and 151 deletions
@@ -2,7 +2,10 @@
<PokerTH>
<CardDeck>
<StyleDescription value="PokerTH default card deck" /> <!-- This string will be shown in settings/game table style list -->
<StyleMaintainerName value="PokerTH Development Team" /> <!-- This string should contain the name of the style maintainer and will be shown in style information -->
<StyleMaintainerEMail value="webmaster@pokerth.net" /> <!-- This string will be shown in error message if there is a problem with the style -->
<StyleCreateDate value="04.04.2009" /> <!-- This string should contain the create date or last date of modification and will be shown in style information-->
<PokerTHStyleFileVersion value="1" /> <!-- This number matches the current PokerTH internal version that is supported, you should not change it unless PokerTH tells you to update the style -->
<Preview value="preview.png" /> <!-- This preview picture will be shown in settings/card deck style if this style is selected. The value should contain a filename of the preview picture which have to be stored in the same folder as this xml file. -->
</CardDeck>
</PokerTH>
@@ -2,7 +2,10 @@
<PokerTH>
<CardDeck>
<StyleDescription value="PokerTH default card deck (4 color)" /> <!-- This string will be shown in settings/game table style list -->
<StyleMaintainerName value="PokerTH Development Team" /> <!-- This string should contain the name of the style maintainer and will be shown in style information -->
<StyleMaintainerEMail value="webmaster@pokerth.net" /> <!-- This string will be shown in error message if there is a problem with the style -->
<StyleCreateDate value="04.04.2009" /> <!-- This string should contain the create date or last date of modification and will be shown in style information-->
<PokerTHStyleFileVersion value="1" /> <!-- This number matches the current PokerTH internal version that is supported, you should not change it unless PokerTH tells you to update the style -->
<Preview value="preview.png" /> <!-- This preview picture will be shown in settings/card deck style if this style is selected. The value should contain a filename of the preview picture which have to be stored in the same folder as this xml file. -->
</CardDeck>
</PokerTH>
@@ -1,8 +1,10 @@
<?xml version="1.0" encoding="UTF-8" ?>
<PokerTH>
<TableStyle>
<StyleDescription value="danuxi table design (1024x600 fixed)" /> <!-- This string will be shown in settings/game table style list -->
<StyleDescription value="danuxi table design" /> <!-- This string will be shown in settings/game table style list -->
<StyleMaintainerName value="Daniel Hammer" />
<StyleMaintainerEMail value="webmaster@pokerth.net" /> <!-- This string will be shown in error message if there is a problem with the style -->
<StyleCreateDate value="06.04.2009" />
<PokerTHStyleFileVersion value="1" />
<Preview value="preview.png" />
<IfFixedWindowSize value="1" /> <!-- value [1,0] 1 = fixed window size, 0 = resizeable window -->
Binary file not shown.

Before

Width:  |  Height:  |  Size: 562 KiB

After

Width:  |  Height:  |  Size: 23 KiB

@@ -2,7 +2,9 @@
<PokerTH>
<TableStyle>
<StyleDescription value="PokerTH default table style" /><!-- This string will be shown in settings/game table style list -->
<StyleMaintainerEMail value="webmaster@pokerth.net" /> <!-- This string will be shown in error message if there is a problem with the style -->
<StyleMaintainerName value="PokerTH Development Team" /> <!-- This string should contain the name of the style maintainer and will be shown in style information -->
<StyleMaintainerEMail value="webmaster@pokerth.net" /> <!-- This string should contain the email address of the style maintainer and will be shown in style information and also in error message if there is a problem with the style -->
<StyleCreateDate value="04.04.2009" /> <!-- This string should contain the create date or last date of modification and will be shown in style information-->
<PokerTHStyleFileVersion value="1" /> <!-- This number matches the current PokerTH internal version that is supported, you should not change it unless PokerTH tells you to update the style -->
<Preview value="preview.png" /> <!-- This preview picture will be shown in settings/game table style if this style is selected. The value should contain a filename of the preview picture which have to be stored in the same folder as this xml file. -->
+193 -145
View File
@@ -393,159 +393,210 @@ p, li { white-space: pre-wrap; }
</widget>
</item>
<item row="2" column="0" >
<widget class="QGroupBox" name="groupBox_11" >
<property name="title" >
<string>Game Table Styles</string>
<widget class="QTabWidget" name="tabWidget" >
<property name="currentIndex" >
<number>0</number>
</property>
<layout class="QGridLayout" name="gridLayout_13" >
<item row="0" column="1" >
<layout class="QVBoxLayout" name="verticalLayout" >
<item>
<widget class="QPushButton" name="pushButton_activateGameTableStyle" >
<property name="text" >
<string>Activate</string>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer_3" >
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0" >
<size>
<width>20</width>
<height>17</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="pushButton_addGameTableStyle" >
<property name="text" >
<string>Add ...</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButton_removeGameTableStyle" >
<property name="text" >
<string>Remove</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="0" column="2" >
<widget class="QGroupBox" name="groupBox_13" >
<property name="title" >
<string>Preview:</string>
</property>
<layout class="QGridLayout" name="gridLayout_15" >
<item row="0" column="0" >
<widget class="QLabel" name="label_gameTableStylePreview" >
<property name="minimumSize" >
<size>
<width>160</width>
<height>120</height>
</size>
</property>
<property name="maximumSize" >
<size>
<width>160</width>
<height>120</height>
</size>
</property>
<widget class="QWidget" name="tab_3" >
<attribute name="title" >
<string>Game Table Styles</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_13" >
<item row="0" column="0" >
<widget class="QListWidget" name="listWidget_gameTableStyles" />
</item>
<item row="0" column="1" >
<layout class="QVBoxLayout" name="verticalLayout" >
<item>
<widget class="QPushButton" name="pushButton_activateGameTableStyle" >
<property name="text" >
<string/>
<string>Activate</string>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer_3" >
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0" >
<size>
<width>20</width>
<height>17</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="pushButton_addGameTableStyle" >
<property name="text" >
<string>Add ...</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButton_removeGameTableStyle" >
<property name="text" >
<string>Remove</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="0" column="0" >
<widget class="QListWidget" name="listWidget_gameTableStyles" />
</item>
</layout>
</widget>
</item>
<item row="3" column="0" >
<widget class="QGroupBox" name="groupBox_12" >
<property name="title" >
<string>Card Deck Styles</string>
</property>
<layout class="QGridLayout" name="gridLayout_14" >
<item row="0" column="1" >
<layout class="QVBoxLayout" name="verticalLayout_2" >
<item>
<widget class="QPushButton" name="pushButton_activateCardDeckStyle" >
<property name="text" >
<string>Activate</string>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer_3" >
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0" >
<size>
<width>20</width>
<height>17</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="pushButton_addCardDeckStyle" >
<property name="text" >
<string>Add ...</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButton_removeCardDeckStyle" >
<property name="text" >
<string>Remove</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="0" column="2" >
<widget class="QGroupBox" name="groupBox_14" >
<property name="title" >
<string>Preview:</string>
</property>
<layout class="QGridLayout" name="gridLayout_16" >
<item row="0" column="0" >
<widget class="QLabel" name="label_cardDeckStylePreview" >
<property name="minimumSize" >
<size>
<width>160</width>
<height>120</height>
</size>
</property>
<property name="maximumSize" >
<size>
<width>160</width>
<height>120</height>
</size>
</property>
</item>
<item row="1" column="0" colspan="2" >
<widget class="QGroupBox" name="groupBox_13" >
<property name="title" >
<string>Preview - Information:</string>
</property>
<layout class="QGridLayout" name="gridLayout_15" >
<item row="0" column="0" >
<widget class="QLabel" name="label_gameTableStylePreview" >
<property name="minimumSize" >
<size>
<width>160</width>
<height>120</height>
</size>
</property>
<property name="maximumSize" >
<size>
<width>160</width>
<height>120</height>
</size>
</property>
<property name="text" >
<string/>
</property>
</widget>
</item>
<item row="0" column="1" >
<widget class="QLabel" name="label_gameTableStyleInfo" >
<property name="text" >
<string/>
</property>
<property name="textFormat" >
<enum>Qt::RichText</enum>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="2" column="0" colspan="2" >
<widget class="QLabel" name="label_55" >
<property name="text" >
<string>&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
&lt;html>&lt;head>&lt;meta name="qrichtext" content="1" />&lt;style type="text/css">
p, li { white-space: pre-wrap; }
&lt;/style>&lt;/head>&lt;body style=" font-family:'Nimbus Sans L'; font-size:8pt; font-weight:400; font-style:normal;">
&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">&lt;a href="http://gtstyles.pokerth.net/">&lt;span style=" text-decoration: underline; color:#0000ff;">Get new PokerTH game table styles ...&lt;/span>&lt;/a>&lt;/p>&lt;/body>&lt;/html></string>
</property>
<property name="openExternalLinks" >
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="tab_4" >
<attribute name="title" >
<string>Card Deck Styles</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_14" >
<item row="0" column="0" >
<widget class="QListWidget" name="listWidget_cardDeckStyles" />
</item>
<item row="0" column="1" >
<layout class="QVBoxLayout" name="verticalLayout_2" >
<item>
<widget class="QPushButton" name="pushButton_activateCardDeckStyle" >
<property name="text" >
<string/>
<string>Activate</string>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer_3" >
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0" >
<size>
<width>20</width>
<height>17</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="pushButton_addCardDeckStyle" >
<property name="text" >
<string>Add ...</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButton_removeCardDeckStyle" >
<property name="text" >
<string>Remove</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="0" column="0" >
<widget class="QListWidget" name="listWidget_cardDeckStyles" />
</item>
</layout>
</item>
<item row="1" column="0" colspan="2" >
<widget class="QGroupBox" name="groupBox_14" >
<property name="title" >
<string>Preview - Information:</string>
</property>
<layout class="QGridLayout" name="gridLayout_16" >
<item row="0" column="0" >
<widget class="QLabel" name="label_cardDeckStylePreview" >
<property name="minimumSize" >
<size>
<width>160</width>
<height>120</height>
</size>
</property>
<property name="maximumSize" >
<size>
<width>160</width>
<height>120</height>
</size>
</property>
<property name="text" >
<string/>
</property>
</widget>
</item>
<item row="0" column="1" >
<widget class="QLabel" name="label_cardDeckStyleInfo" >
<property name="text" >
<string/>
</property>
<property name="textFormat" >
<enum>Qt::RichText</enum>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="2" column="0" colspan="2" >
<widget class="QLabel" name="label_56" >
<property name="text" >
<string>&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
&lt;html>&lt;head>&lt;meta name="qrichtext" content="1" />&lt;style type="text/css">
p, li { white-space: pre-wrap; }
&lt;/style>&lt;/head>&lt;body style=" font-family:'Nimbus Sans L'; font-size:8pt; font-weight:400; font-style:normal;">
&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">&lt;a href="http://cdstyles.pokerth.net/">&lt;span style=" text-decoration: underline; color:#0000ff;">Get new PokerTH card deck styles ...&lt;/span>&lt;/a>&lt;/p>&lt;/body>&lt;/html></string>
</property>
<property name="openExternalLinks" >
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
</item>
</layout>
@@ -3400,11 +3451,8 @@ p, li { white-space: pre-wrap; }
<tabstop>radioButton_flipsideOwn</tabstop>
<tabstop>lineEdit_OwnFlipsideFilename</tabstop>
<tabstop>pushButton_openFlipsidePicture</tabstop>
<tabstop>listWidget_gameTableStyles</tabstop>
<tabstop>pushButton_activateGameTableStyle</tabstop>
<tabstop>pushButton_addGameTableStyle</tabstop>
<tabstop>pushButton_removeGameTableStyle</tabstop>
<tabstop>listWidget_cardDeckStyles</tabstop>
<tabstop>pushButton_activateCardDeckStyle</tabstop>
<tabstop>pushButton_addCardDeckStyle</tabstop>
<tabstop>pushButton_removeCardDeckStyle</tabstop>
@@ -866,6 +866,12 @@ void settingsDialogImpl::showCurrentGameTableStylePreview()
QPixmap preview(style.getPreview());
if(preview.height() > 160 || preview.width() > 120) label_gameTableStylePreview->setPixmap(preview.scaled(160,120,Qt::KeepAspectRatio,Qt::SmoothTransformation));
else label_gameTableStylePreview->setPixmap(preview);
QString MaintainerName = tr("Maintainer Name");
QString MaintainerEMail = tr("Maintainer EMail");
QString CreateDate = tr("Create Date");
label_gameTableStyleInfo->setText("<b>"+MaintainerName+":</b> <i>"+style.getStyleMaintainerName()+"</i><br><b>"+MaintainerEMail+":</b> <i>"+style.getStyleMaintainerEMail()+"</i><br><b>"+CreateDate+":</b> <i>"+style.getStyleCreateDate()+"</i>");
}
}
@@ -949,7 +955,13 @@ void settingsDialogImpl::showCurrentCardDeckStylePreview()
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);
else label_cardDeckStylePreview->setPixmap(preview);
QString MaintainerName = tr("Maintainer Name");
QString MaintainerEMail = tr("Maintainer EMail");
QString CreateDate = tr("Create Date");
label_cardDeckStyleInfo->setText("<b>"+MaintainerName+":</b> <i>"+style.getStyleMaintainerName()+"</i><br><b>"+MaintainerEMail+":</b> <i>"+style.getStyleMaintainerEMail()+"</i><br><b>"+CreateDate+":</b> <i>"+style.getStyleCreateDate()+"</i>");
}
}
+26 -2
View File
@@ -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(", ");
+10 -1
View File
@@ -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"; }
+6
View File
@@ -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;