add a new show-cards-button, change styles handling in settings dialog

This commit is contained in:
doitux
2010-07-08 22:01:07 +00:00
parent 3b4c57d24f
commit 6104acc011
16 changed files with 326 additions and 143 deletions
@@ -4,8 +4,8 @@
<StyleDescription value="danuxi table design" />
<StyleMaintainerName value="Daniel Hammer" />
<StyleMaintainerEMail value="webmaster@pokerth.net" />
<StyleCreateDate value="06.04.2009" />
<PokerTHStyleFileVersion value="1" />
<StyleCreateDate value="08.07.2010" />
<PokerTHStyleFileVersion value="2" />
<Preview value="preview.png" />
<IfFixedWindowSize value="1" />
<FixedWindowWidth value="1024" />
@@ -49,6 +49,8 @@
<Table value="table.png" />
<ToolBoxBackground value="toolboxbg.png" />
<HandRanking value="handranking.png" />
<ShowMyCardsButtonDefault value="playeraction_purple.png" />
<ShowMyCardsButtonHover value="playeraction_purple_hover.png" />
<ActionAllInI18NPic value="NULL" />
<ActionRaiseI18NPic value="NULL" />
<ActionBetI18NPic value="NULL" />
@@ -122,6 +124,7 @@
<BetSpeedSliderGrooveBorderColor value="142568" />
<BetSpeedSliderHandleBgColor value="A1B4FF" />
<BetSpeedSliderHandleBorderColor value="00177D" />
<ShowMyCardsButtonTextColor value="F0F0F0" />
<ChatLogTextSize value="11" />
</TableStyle>
</PokerTH>
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

@@ -4,8 +4,8 @@
<StyleDescription value="PokerTH default table style" /><!-- 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 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. If you dont like to post your mail address here please write value="NULL". -->
<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 -->
<StyleCreateDate value="08.07.2010" /> <!-- This string should contain the create date or last date of modification and will be shown in style information-->
<PokerTHStyleFileVersion value="2" /> <!-- 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. -->
<!-- Windows Settings -->
@@ -53,6 +53,8 @@
<Table value="table.png" /> <!-- minimal size width:height in px [1024:600] -->
<ToolBoxBackground value="toolboxbg.png" /> <!-- minimal size width:height in px [260:188] -->
<HandRanking value="handranking.png" /> <!-- minimal size width:height in px [240:153] -->
<ShowMyCardsButtonDefault value="playeraction_purple.png" /> <!-- optimal size width:height in px [100:25] -->
<ShowMyCardsButtonHover value="playeraction_purple_hover.png" /> <!-- optimal size width:height in px [100:25] -->
<!-- Action*I18NPic: If you wanna set action pics with specific language strings you can set them here. If you wanna use the default english strings just write "NULL" instead of picture files names. PokerTH will automatically display the english ones. -->
<ActionAllInI18NPic value="NULL" /> <!-- optimal size width:height in px [100:40] -->
@@ -132,6 +134,7 @@
<BetSpeedSliderGrooveBorderColor value="286400" />
<BetSpeedSliderHandleBgColor value="99D500" />
<BetSpeedSliderHandleBorderColor value="286400" />
<ShowMyCardsButtonTextColor value="F0F0F0" />
<!-- Table Font Sizes - values should be set in px -->
<ChatLogTextSize value="11" />
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

+1 -1
View File
@@ -35,7 +35,7 @@
#define POKERTH_BETA_REVISION 0
#define POKERTH_BETA_RELEASE_STRING "0.8-svn"
#define POKERTH_GT_STYLE_FILE_VERSION 1
#define POKERTH_GT_STYLE_FILE_VERSION 2
#define POKERTH_CD_STYLE_FILE_VERSION 1
enum ServerMode {
+13
View File
@@ -2450,6 +2450,19 @@
<string/>
</property>
</widget>
<widget class="MyActionButton" name="pushButton_showMyCards">
<property name="geometry">
<rect>
<x>72</x>
<y>72</y>
<width>100</width>
<height>25</height>
</rect>
</property>
<property name="text">
<string>uncover!</string>
</property>
</widget>
</widget>
</item>
<item>
+17 -1
View File
@@ -337,6 +337,8 @@ gameTableImpl::gameTableImpl(ConfigFile *c, QMainWindow *parent)
holeCardsArray[9][0] = pixmapLabel_card9a;
holeCardsArray[9][1] = pixmapLabel_card9b;
pushButton_showMyCards->hide();
//style Game Table
refreshGameTableStyle();
@@ -466,6 +468,8 @@ gameTableImpl::gameTableImpl(ConfigFile *c, QMainWindow *parent)
connect( pushButton_voteOnKickYes, SIGNAL( clicked() ), this, SLOT( voteOnKickYes() ) );
connect( pushButton_voteOnKickNo, SIGNAL( clicked() ), this, SLOT( voteOnKickNo() ) );
connect( pushButton_showMyCards, SIGNAL( clicked() ), this, SLOT( sendShowMyCardsSignal() ) );
//Nachrichten Thread-Save
connect(this, SIGNAL(signalInitGui(int)), this, SLOT(initGui(int)));
connect(this, SIGNAL(signalRefreshSet()), this, SLOT(refreshSet()));
@@ -2664,7 +2668,7 @@ void gameTableImpl::keyPressEvent ( QKeyEvent * event ) {
else { keyUpDownChatCounter = 0; }
//TESTING UNIT
//if (event->key() == Qt::Key_M) { startVoteOnKick(3,60, 6); }
if (event->key() == Qt::Key_M) { showShowMyCardsButton(); }
}
void gameTableImpl::changePlayingMode() {
@@ -3324,6 +3328,7 @@ void gameTableImpl::refreshGameTableStyle()
}
//Human player button
myGameTableStyle->setButtonsStyle(pushButton_BetRaise, pushButton_CallCheck, pushButton_Fold, pushButton_AllIn, 0);
myGameTableStyle->setShowMyCardsButtonStyle(pushButton_showMyCards);
myGameTableStyle->setBetValueInputStyle(lineEdit_betValue);
myGameTableStyle->setSliderStyle(horizontalSlider_bet);
@@ -3435,3 +3440,14 @@ void gameTableImpl::guestUserMode()
lineEdit_ChatInput->setDisabled(true);
guestMode = true;
}
void gameTableImpl::showShowMyCardsButton()
{
pushButton_showMyCards->show();
pushButton_showMyCards->raise();
}
void gameTableImpl::sendShowMyCardsSignal()
{
pushButton_showMyCards->hide();
}
+3
View File
@@ -306,6 +306,9 @@ public slots:
void registeredUserMode();
void guestUserMode();
void showShowMyCardsButton();
void sendShowMyCardsSignal();
private:
boost::shared_ptr<GuiInterface> myServerGuiInterface;
+91 -8
View File
@@ -310,9 +310,6 @@
<string>Game Table</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>
@@ -399,6 +396,55 @@ p, li { white-space: pre-wrap; }
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QTreeWidget" name="treeWidget_gameTableStyles">
<property name="indentation">
<number>5</number>
</property>
<property name="rootIsDecorated">
<bool>false</bool>
</property>
<property name="itemsExpandable">
<bool>false</bool>
</property>
<property name="sortingEnabled">
<bool>true</bool>
</property>
<property name="allColumnsShowFocus">
<bool>true</bool>
</property>
<property name="columnCount">
<number>3</number>
</property>
<attribute name="headerCascadingSectionResizes">
<bool>false</bool>
</attribute>
<attribute name="headerShowSortIndicator" stdset="0">
<bool>true</bool>
</attribute>
<attribute name="headerCascadingSectionResizes">
<bool>false</bool>
</attribute>
<attribute name="headerShowSortIndicator" stdset="0">
<bool>true</bool>
</attribute>
<column>
<property name="text">
<string>Description</string>
</property>
</column>
<column>
<property name="text">
<string>Maintainer</string>
</property>
</column>
<column>
<property name="text">
<string>State</string>
</property>
</column>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="tab_4">
@@ -406,9 +452,6 @@ p, li { white-space: pre-wrap; }
<string>Card Deck</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>
@@ -495,6 +538,46 @@ p, li { white-space: pre-wrap; }
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QTreeWidget" name="treeWidget_cardDeckStyles">
<property name="indentation">
<number>5</number>
</property>
<property name="rootIsDecorated">
<bool>false</bool>
</property>
<property name="itemsExpandable">
<bool>false</bool>
</property>
<property name="sortingEnabled">
<bool>true</bool>
</property>
<property name="allColumnsShowFocus">
<bool>true</bool>
</property>
<attribute name="headerShowSortIndicator" stdset="0">
<bool>true</bool>
</attribute>
<attribute name="headerShowSortIndicator" stdset="0">
<bool>true</bool>
</attribute>
<column>
<property name="text">
<string>Description</string>
</property>
</column>
<column>
<property name="text">
<string>Maintainer</string>
</property>
</column>
<column>
<property name="text">
<string>State</string>
</property>
</column>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="tab">
@@ -3538,10 +3621,10 @@ p, li { white-space: pre-wrap; }
<tabstop>checkBox_dontTranslatePokerStrings</tabstop>
<tabstop>checkBox_enableBetInputFocusSwitch</tabstop>
<tabstop>tabWidget</tabstop>
<tabstop>listWidget_gameTableStyles</tabstop>
<tabstop>treeWidget_gameTableStyles</tabstop>
<tabstop>pushButton_addGameTableStyle</tabstop>
<tabstop>pushButton_removeGameTableStyle</tabstop>
<tabstop>listWidget_cardDeckStyles</tabstop>
<tabstop>treeWidget_cardDeckStyles</tabstop>
<tabstop>pushButton_addCardDeckStyle</tabstop>
<tabstop>pushButton_removeCardDeckStyle</tabstop>
<tabstop>groupBox_playSoundEffects</tabstop>
@@ -11,8 +11,8 @@
//
#include "mystylelistitem.h"
MyStyleListItem::MyStyleListItem(QString s, QListWidget *w)
: QListWidgetItem(s, w, QListWidgetItem::UserType)
MyStyleListItem::MyStyleListItem(QStringList s, QTreeWidget *w)
: QTreeWidgetItem(w, s, QTreeWidgetItem::UserType)
{
}
@@ -20,8 +20,8 @@ MyStyleListItem::~MyStyleListItem()
{
}
bool MyStyleListItem::operator<( const QListWidgetItem &other ) const
bool MyStyleListItem::operator<( const QTreeWidgetItem &other ) const
{
return text().toLower() < other.text().toLower();
return text(0).toLower() < other.text(0).toLower();
}
+3 -3
View File
@@ -10,12 +10,12 @@
#include <QtGui>
#include <QtCore>
class MyStyleListItem : public QListWidgetItem {
class MyStyleListItem : public QTreeWidgetItem {
public:
MyStyleListItem(QString, QListWidget * =0);
MyStyleListItem(QStringList, QTreeWidget *);
~MyStyleListItem();
virtual bool operator<( const QListWidgetItem &) const;
virtual bool operator<( const QTreeWidgetItem &) const;
};
#endif // MYSTYLELISTITEM_H
+155 -120
View File
@@ -111,11 +111,11 @@ settingsDialogImpl::settingsDialogImpl(QWidget *parent, ConfigFile *c, selectAva
connect(groupBox_automaticServerConfig, SIGNAL(toggled(bool)), this, SLOT(toggleGroupBoxAutomaticServerConfig(bool)));
connect(groupBox_manualServerConfig, SIGNAL(toggled(bool)), this, SLOT(toggleGroupBoxManualServerConfig(bool)));
connect( listWidget_gameTableStyles, SIGNAL( currentItemChanged(QListWidgetItem*, QListWidgetItem*) ), this, SLOT ( showCurrentGameTableStylePreview() ));
connect( treeWidget_gameTableStyles, SIGNAL( currentItemChanged(QTreeWidgetItem*, QTreeWidgetItem*) ), this, SLOT ( showCurrentGameTableStylePreview() ));
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( treeWidget_cardDeckStyles, SIGNAL( currentItemChanged(QTreeWidgetItem*, QTreeWidgetItem*) ), this, SLOT ( showCurrentCardDeckStylePreview() ));
connect( pushButton_addCardDeckStyle, SIGNAL( clicked() ), this, SLOT( addCardDeckStyle()) );
connect( pushButton_removeCardDeckStyle, SIGNAL( clicked() ), this, SLOT( removeCardDeckStyle()) );
connect( pushButton_internetGameRemoveIgnoredPlayer, SIGNAL( clicked()), this, SLOT( removePlayerFromIgnoredPlayersList()));
@@ -244,24 +244,28 @@ void settingsDialogImpl::exec() {
//S t y l e
//TABLE
// define PokerTH default GameTableStyle
listWidget_gameTableStyles->clear();
treeWidget_gameTableStyles->clear();
GameTableStyleReader defaultTableStyle(myConfig, this);
defaultTableStyle.readStyleFile(QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str())+"gfx/gui/table/default/defaulttablestyle.xml");
if(defaultTableStyle.getLoadedSuccessfull()) {
MyStyleListItem *defaultTableItem = new MyStyleListItem(defaultTableStyle.getStyleDescription(),listWidget_gameTableStyles);
defaultTableItem->setData(15, QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str())+"gfx/gui/table/default/defaulttablestyle.xml");
defaultTableItem->setData(16, POKERTH_DISTRIBUTED_STYLE);
defaultTableItem->setData(Qt::ToolTipRole, QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str())+"gfx/gui/table/default/defaulttablestyle.xml");
QStringList tempStringList1;
tempStringList1 << defaultTableStyle.getStyleDescription() << defaultTableStyle.getStyleMaintainerName();
MyStyleListItem *defaultTableItem = new MyStyleListItem(tempStringList1, treeWidget_gameTableStyles);
defaultTableItem->setData(0, 15, QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str())+"gfx/gui/table/default/defaulttablestyle.xml");
defaultTableItem->setData(0, 16, POKERTH_DISTRIBUTED_STYLE);
defaultTableItem->setData(0, Qt::ToolTipRole, QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str())+"gfx/gui/table/default/defaulttablestyle.xml");
}
//add danuxi table
GameTableStyleReader danuxi1TableStyle(myConfig, this);
danuxi1TableStyle.readStyleFile(QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str())+"gfx/gui/table/danuxi1/danuxi1tablestyle.xml");
if(danuxi1TableStyle.getLoadedSuccessfull()) {
MyStyleListItem *danuxi1TableItem = new MyStyleListItem(danuxi1TableStyle.getStyleDescription(),listWidget_gameTableStyles);
danuxi1TableItem->setData(15, QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str())+"gfx/gui/table/danuxi1/danuxi1tablestyle.xml");
danuxi1TableItem->setData(16, POKERTH_DISTRIBUTED_STYLE);
danuxi1TableItem->setData(Qt::ToolTipRole, QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str())+"gfx/gui/table/danuxi1/danuxi1tablestyle.xml");
QStringList tempStringList2;
tempStringList2 << danuxi1TableStyle.getStyleDescription() << danuxi1TableStyle.getStyleMaintainerName();
MyStyleListItem *danuxi1TableItem = new MyStyleListItem(tempStringList2, treeWidget_gameTableStyles);
danuxi1TableItem->setData(0, 15, QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str())+"gfx/gui/table/danuxi1/danuxi1tablestyle.xml");
danuxi1TableItem->setData(0, 16, POKERTH_DISTRIBUTED_STYLE);
danuxi1TableItem->setData(0, Qt::ToolTipRole, QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str())+"gfx/gui/table/danuxi1/danuxi1tablestyle.xml");
}
//load secondary styles into list (if fallback no entry)
@@ -271,14 +275,16 @@ void settingsDialogImpl::exec() {
GameTableStyleReader nextStyle(myConfig, this);
nextStyle.readStyleFile(QString::fromUtf8(it1->c_str()));
if(!nextStyle.getFallBack() && nextStyle.getLoadedSuccessfull()) {
MyStyleListItem *nextItem = new MyStyleListItem(nextStyle.getStyleDescription());
nextItem->setData(15,QString::fromUtf8(it1->c_str()));
nextItem->setData(16, ADDITIONAL_STYLE);
nextItem->setData(Qt::ToolTipRole,QString::fromUtf8(it1->c_str()));
listWidget_gameTableStyles->addItem(nextItem);
QStringList tempStringList1;
tempStringList1 << nextStyle.getStyleDescription() << nextStyle.getStyleMaintainerName();
MyStyleListItem *nextItem = new MyStyleListItem(tempStringList1, treeWidget_gameTableStyles);
nextItem->setData(0, 15,QString::fromUtf8(it1->c_str()));
nextItem->setData(0, 16, ADDITIONAL_STYLE);
nextItem->setData(0, Qt::ToolTipRole,QString::fromUtf8(it1->c_str()));
treeWidget_gameTableStyles->addTopLevelItem(nextItem);
}
}
listWidget_gameTableStyles->sortItems(Qt::AscendingOrder);
treeWidget_gameTableStyles->sortItems(0, Qt::AscendingOrder);
//set current Game Table Style from config file or fallback to first entry
GameTableStyleReader currentGameTableStyle(myConfig, this);
@@ -286,30 +292,30 @@ void settingsDialogImpl::exec() {
if(currentGameTableStyle.getLoadedSuccessfull()) {
int i;
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);
for(i=0; i < treeWidget_gameTableStyles->topLevelItemCount(); i++) {
QTreeWidgetItem *item = treeWidget_gameTableStyles->topLevelItem(i);
if(item->data(0, 15) == currentGameTableStyle.getCurrentFileName()) {
item->setIcon(0, QIcon(QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str())+"/gfx/gui/misc/rating.png"));
treeWidget_gameTableStyles->setCurrentItem(item);
currentGameTableFound=TRUE;
}
else item->setIcon(QIcon());
else item->setIcon(0, QIcon());
}
if(!currentGameTableFound) {
qDebug() << "Config ERROR: current game table style file not found in List. Try to mark default as selected.";
QListWidgetItem *item = listWidget_gameTableStyles->item(0);
QTreeWidgetItem *item = treeWidget_gameTableStyles->topLevelItem(0);
if(item) {
item->setIcon(QIcon(QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str())+"/gfx/gui/misc/rating.png"));
listWidget_gameTableStyles->setCurrentItem(item);
item->setIcon(0, QIcon(QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str())+"/gfx/gui/misc/rating.png"));
treeWidget_gameTableStyles->setCurrentItem(item);
}
}
}
else {
qDebug() << "Config ERROR: current game table style file could not be loaded. Try to mark default as selected.";
QListWidgetItem *item = listWidget_gameTableStyles->item(0);
QTreeWidgetItem *item = treeWidget_gameTableStyles->topLevelItem(0);
if(item) {
item->setIcon(QIcon(QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str())+"/gfx/gui/misc/rating.png"));
listWidget_gameTableStyles->setCurrentItem(item);
item->setIcon(0, QIcon(QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str())+"/gfx/gui/misc/rating.png"));
treeWidget_gameTableStyles->setCurrentItem(item);
}
}
@@ -318,23 +324,27 @@ void settingsDialogImpl::exec() {
//CARDS
//define PokerTH default CardDeck
listWidget_cardDeckStyles->clear();
treeWidget_cardDeckStyles->clear();
CardDeckStyleReader defaultCardStyle(myConfig, this);
defaultCardStyle.readStyleFile(QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str())+"gfx/cards/default/defaultdeckstyle.xml");
if(defaultCardStyle.getLoadedSuccessfull()) {
MyStyleListItem *defaultCardItem = new MyStyleListItem(defaultCardStyle.getStyleDescription(),listWidget_cardDeckStyles);
defaultCardItem->setData(15, QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str())+"gfx/cards/default/defaultdeckstyle.xml");
defaultCardItem->setData(16, POKERTH_DISTRIBUTED_STYLE);
defaultCardItem->setData(Qt::ToolTipRole, QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str())+"gfx/cards/default/defaultdeckstyle.xml");
QStringList tempStringList1;
tempStringList1 << defaultCardStyle.getStyleDescription() << defaultCardStyle.getStyleMaintainerName();
MyStyleListItem *defaultCardItem = new MyStyleListItem(tempStringList1, treeWidget_cardDeckStyles);
defaultCardItem->setData(0, 15, QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str())+"gfx/cards/default/defaultdeckstyle.xml");
defaultCardItem->setData(0, 16, POKERTH_DISTRIBUTED_STYLE);
defaultCardItem->setData(0, Qt::ToolTipRole, QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str())+"gfx/cards/default/defaultdeckstyle.xml");
}
//define PokerTH default CardDeck4c
CardDeckStyleReader default4cCardStyle(myConfig, this);
default4cCardStyle.readStyleFile(QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str())+"gfx/cards/default4c/default4cdeckstyle.xml");
if(default4cCardStyle.getLoadedSuccessfull()) {
MyStyleListItem *default4cCardItem = new MyStyleListItem(default4cCardStyle.getStyleDescription(),listWidget_cardDeckStyles);
default4cCardItem->setData(15, QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str())+"gfx/cards/default4c/default4cdeckstyle.xml");
default4cCardItem->setData(16, POKERTH_DISTRIBUTED_STYLE);
default4cCardItem->setData(Qt::ToolTipRole, QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str())+"gfx/cards/default4c/default4cdeckstyle.xml");
QStringList tempStringList1;
tempStringList1 << default4cCardStyle.getStyleDescription() << default4cCardStyle.getStyleMaintainerName();
MyStyleListItem *default4cCardItem = new MyStyleListItem(tempStringList1, treeWidget_cardDeckStyles);
default4cCardItem->setData(0, 15, QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str())+"gfx/cards/default4c/default4cdeckstyle.xml");
default4cCardItem->setData(0, 16, POKERTH_DISTRIBUTED_STYLE);
default4cCardItem->setData(0, Qt::ToolTipRole, QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str())+"gfx/cards/default4c/default4cdeckstyle.xml");
}
//load secondary card styles into list (if fallback no entry)
@@ -344,14 +354,16 @@ void settingsDialogImpl::exec() {
CardDeckStyleReader nextStyle(myConfig, this);
nextStyle.readStyleFile(QString::fromUtf8(it2->c_str()));
if(!nextStyle.getFallBack() && nextStyle.getLoadedSuccessfull()) {
MyStyleListItem *nextItem = new MyStyleListItem(nextStyle.getStyleDescription());
nextItem->setData(15,QString::fromUtf8(it2->c_str()));
nextItem->setData(16, ADDITIONAL_STYLE);
nextItem->setData(Qt::ToolTipRole,QString::fromUtf8(it2->c_str()));
listWidget_cardDeckStyles->addItem(nextItem);
QStringList tempStringList1;
tempStringList1 << nextStyle.getStyleDescription() << nextStyle.getStyleMaintainerName();
MyStyleListItem *nextItem = new MyStyleListItem(tempStringList1, treeWidget_cardDeckStyles);
nextItem->setData(0, 15,QString::fromUtf8(it2->c_str()));
nextItem->setData(0, 16, ADDITIONAL_STYLE);
nextItem->setData(0, Qt::ToolTipRole,QString::fromUtf8(it2->c_str()));
treeWidget_cardDeckStyles->addTopLevelItem(nextItem);
}
}
listWidget_cardDeckStyles->sortItems(Qt::AscendingOrder);
treeWidget_cardDeckStyles->sortItems(0, Qt::AscendingOrder);
//set current card deck style from config file
CardDeckStyleReader currentCardDeckStyle(myConfig, this);
@@ -359,36 +371,45 @@ void settingsDialogImpl::exec() {
if(currentCardDeckStyle.getLoadedSuccessfull()) {
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);
for(j=0; j < treeWidget_cardDeckStyles->topLevelItemCount(); j++) {
QTreeWidgetItem *item = treeWidget_cardDeckStyles->topLevelItem(j);
if(item->data(0, 15) == currentCardDeckStyle.getCurrentFileName()) {
item->setIcon(0, QIcon(QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str())+"/gfx/gui/misc/rating.png"));
treeWidget_cardDeckStyles->setCurrentItem(item);
currentCardDeckFound=TRUE;
}
else item->setIcon(QIcon());
else item->setIcon(0, QIcon());
}
if(!currentCardDeckFound) {
qDebug() << "Config ERROR: current card deck style file not found in List. Try to mark default as selected.";
QListWidgetItem *item = listWidget_cardDeckStyles->item(0);
QTreeWidgetItem *item = treeWidget_cardDeckStyles->topLevelItem(0);
if(item) {
item->setIcon(QIcon(QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str())+"/gfx/gui/misc/rating.png"));
listWidget_cardDeckStyles->setCurrentItem(item);
item->setIcon(0, QIcon(QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str())+"/gfx/gui/misc/rating.png"));
treeWidget_cardDeckStyles->setCurrentItem(item);
}
}
}
else {
qDebug() << "Config ERROR: current card deck style file could not be loaded. Try to mark default as selected.";
QListWidgetItem *item = listWidget_cardDeckStyles->item(0);
QTreeWidgetItem *item = treeWidget_cardDeckStyles->topLevelItem(0);
if(item) {
item->setIcon(QIcon(QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str())+"/gfx/gui/misc/rating.png"));
listWidget_cardDeckStyles->setCurrentItem(item);
item->setIcon(0, QIcon(QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str())+"/gfx/gui/misc/rating.png"));
treeWidget_cardDeckStyles->setCurrentItem(item);
}
}
// refresh Card Deck Style Preview
showCurrentCardDeckStylePreview();
//adjust column sizes for styles treeWidgets
treeWidget_gameTableStyles->resizeColumnToContents(0);
treeWidget_gameTableStyles->resizeColumnToContents(1);
treeWidget_gameTableStyles->resizeColumnToContents(2);
treeWidget_cardDeckStyles->resizeColumnToContents(0);
treeWidget_cardDeckStyles->resizeColumnToContents(1);
treeWidget_cardDeckStyles->resizeColumnToContents(2);
radioButton_flipsideTux->setChecked(myConfig->readConfigInt("FlipsideTux"));
radioButton_flipsideOwn->setChecked(myConfig->readConfigInt("FlipsideOwn"));
if(radioButton_flipsideOwn->isChecked()) {
@@ -591,35 +612,35 @@ void settingsDialogImpl::isAccepted() {
//save game table styles list
myGameTableStylesList.clear();
int i;
for(i=0; i < listWidget_gameTableStyles->count(); i++) {
QListWidgetItem *item = listWidget_gameTableStyles->item(i);
if(item->data(16).toInt() == ADDITIONAL_STYLE) {
myGameTableStylesList.push_back(item->data(15).toString().toUtf8().constData());
for(i=0; i < treeWidget_gameTableStyles->topLevelItemCount(); i++) {
QTreeWidgetItem *item = treeWidget_gameTableStyles->topLevelItem(i);
if(item->data(0, 16).toInt() == ADDITIONAL_STYLE) {
myGameTableStylesList.push_back(item->data(0, 15).toString().toUtf8().constData());
}
}
myConfig->writeConfigStringList("GameTableStylesList", myGameTableStylesList);
//save current game table style
for(i=0; i < listWidget_gameTableStyles->count(); i++) {
QListWidgetItem *item = listWidget_gameTableStyles->item(i);
if(!item->icon().isNull())
myConfig->writeConfigString("CurrentGameTableStyle", item->data(15).toString().toUtf8().constData());
for(i=0; i < treeWidget_gameTableStyles->topLevelItemCount(); i++) {
QTreeWidgetItem *item = treeWidget_gameTableStyles->topLevelItem(i);
if(!item->icon(0).isNull())
myConfig->writeConfigString("CurrentGameTableStyle", item->data(0, 15).toString().toUtf8().constData());
}
// CARDS
//save card deck styles list
myCardDeckStylesList.clear();
int j;
for(j=0; j < listWidget_cardDeckStyles->count(); j++) {
QListWidgetItem *item = listWidget_cardDeckStyles->item(j);
if(item->data(16).toInt() == ADDITIONAL_STYLE) {
myCardDeckStylesList.push_back(item->data(15).toString().toUtf8().constData());
for(j=0; j < treeWidget_cardDeckStyles->topLevelItemCount(); j++) {
QTreeWidgetItem *item = treeWidget_cardDeckStyles->topLevelItem(j);
if(item->data(0, 16).toInt() == ADDITIONAL_STYLE) {
myCardDeckStylesList.push_back(item->data(0, 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());
for(j=0; j < treeWidget_cardDeckStyles->topLevelItemCount(); j++) {
QTreeWidgetItem *item = treeWidget_cardDeckStyles->topLevelItem(j);
if(!item->icon(0).isNull())
myConfig->writeConfigString("CurrentCardDeckStyle", item->data(0, 15).toString().toUtf8().constData());
}
//Sound
@@ -936,10 +957,10 @@ void settingsDialogImpl::toggleGroupBoxManualServerConfig(bool toggleState) {
void settingsDialogImpl::showCurrentGameTableStylePreview()
{
QListWidgetItem* item = listWidget_gameTableStyles->currentItem();
QTreeWidgetItem* item = treeWidget_gameTableStyles->currentItem();
if(item) {
GameTableStyleReader style(myConfig, this);
style.readStyleFile(item->data(15).toString());
style.readStyleFile(item->data(0, 15).toString());
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);
@@ -973,7 +994,7 @@ void settingsDialogImpl::showCurrentGameTableStylePreview()
setSelectedGameTableStyleActivated();
//disable remove button for distributed styles
if(item->data(16).toInt() == POKERTH_DISTRIBUTED_STYLE) { pushButton_removeGameTableStyle->setDisabled(TRUE); }
if(item->data(0, 16).toInt() == POKERTH_DISTRIBUTED_STYLE) { pushButton_removeGameTableStyle->setDisabled(TRUE); }
else { pushButton_removeGameTableStyle->setDisabled(FALSE); }
}
@@ -981,15 +1002,15 @@ void settingsDialogImpl::showCurrentGameTableStylePreview()
void settingsDialogImpl::setSelectedGameTableStyleActivated()
{
QListWidgetItem* selectedItem = listWidget_gameTableStyles->currentItem();
QTreeWidgetItem* selectedItem = treeWidget_gameTableStyles->currentItem();
if(selectedItem) {
int i;
for(i=0; i < listWidget_gameTableStyles->count(); i++) {
QListWidgetItem *item = listWidget_gameTableStyles->item(i);
for(i=0; i < treeWidget_gameTableStyles->topLevelItemCount(); i++) {
QTreeWidgetItem *item = treeWidget_gameTableStyles->topLevelItem(i);
if(item == selectedItem) {
item->setIcon(QIcon(QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str())+"/gfx/gui/misc/rating.png"));
item->setIcon(0, QIcon(QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str())+"/gfx/gui/misc/rating.png"));
}
else item->setIcon(QIcon());
else item->setIcon(0, QIcon());
}
}
}
@@ -1010,9 +1031,9 @@ void settingsDialogImpl::addGameTableStyle()
int i;
bool fileNameAlreadyFound(FALSE);
for(i=0; i < listWidget_gameTableStyles->count(); i++) {
QListWidgetItem *item = listWidget_gameTableStyles->item(i);
if(item->data(15).toString() == fileName)
for(i=0; i < treeWidget_gameTableStyles->topLevelItemCount(); i++) {
QTreeWidgetItem *item = treeWidget_gameTableStyles->topLevelItem(i);
if(item->data(0, 15).toString() == fileName)
fileNameAlreadyFound = TRUE;
}
@@ -1025,13 +1046,15 @@ void settingsDialogImpl::addGameTableStyle()
GameTableStyleReader newStyle(myConfig, this);
newStyle.readStyleFile(fileName);
if(!newStyle.getFallBack() && newStyle.getLoadedSuccessfull()) {
MyStyleListItem *newItem = new MyStyleListItem(newStyle.getStyleDescription());
newItem->setData(15,fileName);
newItem->setData(16, ADDITIONAL_STYLE);
newItem->setData(Qt::ToolTipRole,fileName);
listWidget_gameTableStyles->addItem(newItem);
listWidget_gameTableStyles->setCurrentItem(newItem);
listWidget_gameTableStyles->sortItems(Qt::AscendingOrder);
QStringList tempStringList1;
tempStringList1 << newStyle.getStyleDescription() << newStyle.getStyleMaintainerName();
MyStyleListItem *newItem = new MyStyleListItem(tempStringList1, treeWidget_gameTableStyles);
newItem->setData(0, 15,fileName);
newItem->setData(0, 16, ADDITIONAL_STYLE);
newItem->setData(0, Qt::ToolTipRole,fileName);
treeWidget_gameTableStyles->addTopLevelItem(newItem);
treeWidget_gameTableStyles->setCurrentItem(newItem);
treeWidget_gameTableStyles->sortItems(0, Qt::AscendingOrder);
}
else {
QMessageBox::warning(this, tr("Game Table Style File Error"),
@@ -1041,30 +1064,36 @@ void settingsDialogImpl::addGameTableStyle()
}
//save current filepath
myConfig->writeConfigString("LastGameTableStyleDir",QFileInfo(fileName).absolutePath().toUtf8().constData());
//adjust column sizes for styles treeWidgets
treeWidget_gameTableStyles->resizeColumnToContents(0);
treeWidget_gameTableStyles->resizeColumnToContents(1);
treeWidget_gameTableStyles->resizeColumnToContents(2);
}
}
void settingsDialogImpl::removeGameTableStyle()
{
QListWidgetItem* selectedItem = listWidget_gameTableStyles->currentItem();
QTreeWidgetItem* selectedItem = treeWidget_gameTableStyles->currentItem();
//never delete PokerTH defaullt Styles
if(selectedItem && selectedItem->data(16).toInt() == ADDITIONAL_STYLE) {
if(selectedItem && selectedItem->data(0, 16).toInt() == ADDITIONAL_STYLE) {
// if selected is activated --> swith activation to first default
if(!selectedItem->icon().isNull()) {
QListWidgetItem* firstItem = listWidget_gameTableStyles->item(0);
firstItem->setIcon(QIcon(QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str())+"/gfx/gui/misc/rating.png"));
if(!selectedItem->icon(0).isNull()) {
QTreeWidgetItem* firstItem = treeWidget_gameTableStyles->topLevelItem(0);
firstItem->setIcon(0, QIcon(QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str())+"/gfx/gui/misc/rating.png"));
}
//remove from List
listWidget_gameTableStyles->takeItem(listWidget_gameTableStyles->currentRow());
treeWidget_gameTableStyles->takeTopLevelItem(treeWidget_gameTableStyles->currentIndex().row());
}
}
void settingsDialogImpl::showCurrentCardDeckStylePreview()
{
QListWidgetItem* item = listWidget_cardDeckStyles->currentItem();
QTreeWidgetItem* item = treeWidget_cardDeckStyles->currentItem();
if(item) {
CardDeckStyleReader style(myConfig, this);
style.readStyleFile(item->data(15).toString());
style.readStyleFile(item->data(0, 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);
@@ -1083,22 +1112,22 @@ void settingsDialogImpl::showCurrentCardDeckStylePreview()
setSelectedCardDeckStyleActivated();
//disable remove button for distributed styles
if(item->data(16).toInt() == POKERTH_DISTRIBUTED_STYLE) { pushButton_removeCardDeckStyle->setDisabled(TRUE); }
if(item->data(0, 16).toInt() == POKERTH_DISTRIBUTED_STYLE) { pushButton_removeCardDeckStyle->setDisabled(TRUE); }
else { pushButton_removeCardDeckStyle->setDisabled(FALSE); }
}
}
void settingsDialogImpl::setSelectedCardDeckStyleActivated()
{
QListWidgetItem* selectedItem = listWidget_cardDeckStyles->currentItem();
QTreeWidgetItem* selectedItem = treeWidget_cardDeckStyles->currentItem();
if(selectedItem) {
int i;
for(i=0; i < listWidget_cardDeckStyles->count(); i++) {
QListWidgetItem *item = listWidget_cardDeckStyles->item(i);
for(i=0; i < treeWidget_cardDeckStyles->topLevelItemCount(); i++) {
QTreeWidgetItem *item = treeWidget_cardDeckStyles->topLevelItem(i);
if(item == selectedItem) {
item->setIcon(QIcon(QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str())+"/gfx/gui/misc/rating.png"));
item->setIcon(0, QIcon(QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str())+"/gfx/gui/misc/rating.png"));
}
else item->setIcon(QIcon());
else item->setIcon(0, QIcon());
}
}
}
@@ -1119,9 +1148,9 @@ void settingsDialogImpl::addCardDeckStyle()
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)
for(i=0; i < treeWidget_cardDeckStyles->topLevelItemCount(); i++) {
QTreeWidgetItem *item = treeWidget_cardDeckStyles->topLevelItem(i);
if(item->data(0, 15).toString() == fileName)
fileNameAlreadyFound = TRUE;
}
@@ -1134,13 +1163,15 @@ void settingsDialogImpl::addCardDeckStyle()
CardDeckStyleReader newStyle(myConfig, this);
newStyle.readStyleFile(fileName);
if(!newStyle.getFallBack() && newStyle.getLoadedSuccessfull()) {
MyStyleListItem *newItem = new MyStyleListItem(newStyle.getStyleDescription());
newItem->setData(15,fileName);
newItem->setData(16, ADDITIONAL_STYLE);
newItem->setData(Qt::ToolTipRole,fileName);
listWidget_cardDeckStyles->addItem(newItem);
listWidget_cardDeckStyles->setCurrentItem(newItem);
listWidget_cardDeckStyles->sortItems(Qt::AscendingOrder);
QStringList tempStringList1;
tempStringList1 << newStyle.getStyleDescription() << newStyle.getStyleMaintainerName();
MyStyleListItem *newItem = new MyStyleListItem(tempStringList1, treeWidget_cardDeckStyles);
newItem->setData(0, 15,fileName);
newItem->setData(0, 16, ADDITIONAL_STYLE);
newItem->setData(0, Qt::ToolTipRole,fileName);
treeWidget_cardDeckStyles->addTopLevelItem(newItem);
treeWidget_cardDeckStyles->setCurrentItem(newItem);
treeWidget_cardDeckStyles->sortItems(0, Qt::AscendingOrder);
}
else {
QMessageBox::warning(this, tr("Card Deck Style File Error"),
@@ -1150,21 +1181,25 @@ void settingsDialogImpl::addCardDeckStyle()
}
//save current filepath
myConfig->writeConfigString("LastCardDeckStyleDir",QFileInfo(fileName).absolutePath().toUtf8().constData());
treeWidget_cardDeckStyles->resizeColumnToContents(0);
treeWidget_cardDeckStyles->resizeColumnToContents(1);
treeWidget_cardDeckStyles->resizeColumnToContents(2);
}
}
void settingsDialogImpl::removeCardDeckStyle()
{
QListWidgetItem* selectedItem = listWidget_cardDeckStyles->currentItem();
QTreeWidgetItem* selectedItem = treeWidget_cardDeckStyles->currentItem();
//never delete PokerTH defaullt Styles
if(selectedItem && selectedItem->data(16).toInt() == ADDITIONAL_STYLE) {
if(selectedItem && selectedItem->data(0, 16).toInt() == ADDITIONAL_STYLE) {
// 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"));
if(!selectedItem->icon(0).isNull()) {
QTreeWidgetItem* firstItem = treeWidget_cardDeckStyles->topLevelItem(0);
firstItem->setIcon(0, QIcon(QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str())+"/gfx/gui/misc/rating.png"));
}
//remove from List
listWidget_cardDeckStyles->takeItem(listWidget_cardDeckStyles->currentRow());
treeWidget_cardDeckStyles->takeTopLevelItem(treeWidget_cardDeckStyles->currentIndex().row());
}
}
@@ -171,6 +171,8 @@ void GameTableStyleReader::readStyleFile(QString file) {
else if (itemsList->ValueStr() == "Table") { Table = currentDir+QString::fromUtf8(tempString1.c_str()); }
else if (itemsList->ValueStr() == "HandRanking") { HandRanking = currentDir+QString::fromUtf8(tempString1.c_str()); }
else if (itemsList->ValueStr() == "ToolBoxBackground") { ToolBoxBackground = currentDir+QString::fromUtf8(tempString1.c_str()); }
else if (itemsList->ValueStr() == "ShowMyCardsButtonDefault") { ShowMyCardsButtonDefault = currentDir+QString::fromUtf8(tempString1.c_str()); }
else if (itemsList->ValueStr() == "ShowMyCardsButtonHover") { ShowMyCardsButtonHover = currentDir+QString::fromUtf8(tempString1.c_str()); }
//I18N ACTION STRINGS
else if (itemsList->ValueStr() == "ActionAllInI18NString") { ActionAllInI18NString = QString::fromUtf8(tempString1.c_str()); }
@@ -241,6 +243,7 @@ void GameTableStyleReader::readStyleFile(QString file) {
else if (itemsList->ValueStr() == "BetSpeedSliderGrooveBorderColor") { BetSpeedSliderGrooveBorderColor = QString::fromUtf8(tempString1.c_str()); }
else if (itemsList->ValueStr() == "BetSpeedSliderHandleBgColor") { BetSpeedSliderHandleBgColor = QString::fromUtf8(tempString1.c_str()); }
else if (itemsList->ValueStr() == "BetSpeedSliderHandleBorderColor") { BetSpeedSliderHandleBorderColor = QString::fromUtf8(tempString1.c_str()); }
else if (itemsList->ValueStr() == "ShowMyCardsButtonTextColor") { ShowMyCardsButtonTextColor = QString::fromUtf8(tempString1.c_str()); }
// SIZES
else if (itemsList->ValueStr() == "ChatLogTextSize") { ChatLogTextSize = QString::fromUtf8(tempString1.c_str()); }
}
@@ -391,6 +394,13 @@ void GameTableStyleReader::readStyleFile(QString file) {
if(ToolBoxBackground == "") { leftItems << "ToolBoxBackground"; }
else if(ToolBoxBackground != QString(currentDir+"NULL") && !QFile(ToolBoxBackground).exists()) { itemPicsLeft << "ToolBoxBackground = "+ToolBoxBackground; }
if(ShowMyCardsButtonDefault == "") { leftItems << "ShowMyCardsButtonDefault"; }
else if(ShowMyCardsButtonDefault != QString(currentDir+"NULL") && !QFile(ShowMyCardsButtonDefault).exists()) { itemPicsLeft << "ShowMyCardsButtonDefault = "+ShowMyCardsButtonDefault; }
if(ShowMyCardsButtonHover == "") { leftItems << "ShowMyCardsButtonHover"; }
else if(ShowMyCardsButtonHover != QString(currentDir+"NULL") && !QFile(ShowMyCardsButtonHover).exists()) { itemPicsLeft << "ShowMyCardsButtonHover = "+ShowMyCardsButtonHover; }
//I18N ACTION STRINGS
if(ActionAllInI18NString == "") { leftItems << "ActionAllInI18NString"; }
if(ActionRaiseI18NString == "") { leftItems << "ActionRaiseI18NString"; }
@@ -460,6 +470,8 @@ void GameTableStyleReader::readStyleFile(QString file) {
if(BetSpeedSliderGrooveBorderColor == "") { leftItems << "BetSpeedSliderGrooveBorderColor"; }
if(BetSpeedSliderHandleBgColor == "") { leftItems << "BetSpeedSliderHandleBgColor"; }
if(BetSpeedSliderHandleBorderColor == "") { leftItems << "BetSpeedSliderHandleBorderColor"; }
if(ShowMyCardsButtonTextColor == "") { leftItems << "ShowMyCardsButtonTextColor"; }
// SIZE
if(ChatLogTextSize == "") { leftItems << "ChatLogTextSize"; }
@@ -735,6 +747,16 @@ void GameTableStyleReader::setButtonsStyle(MyActionButton *br, MyActionButton *c
}
break;
}
}
void GameTableStyleReader::setShowMyCardsButtonStyle( MyActionButton *sc)
{
sc->setMyStyle(this);
//Show My Cards Button has same look and feel all the time
sc->setStyleSheet("QPushButton { border:none; background-image: url(\""+ShowMyCardsButtonDefault+"\"); "+ font2String +" font-size: "+humanPlayerButtonFontSize+"px; font-weight: bold; color: #"+ShowMyCardsButtonTextColor+";} QPushButton:unchecked { background-image: url(\""+ShowMyCardsButtonDefault+"\"); } QPushButton:checked { background-image: url(\""+BetRaiseButtonDefault+"\");} QPushButton:hover { background-image: url(\""+ShowMyCardsButtonHover+"\"); } QPushButton:checked:hover { background-image: url(\""+ShowMyCardsButtonHover+"\");}");
}
void GameTableStyleReader::setToolBoxBackground(QGroupBox* gb)
+5
View File
@@ -105,6 +105,7 @@ public:
//set pics and fonts and colors
void setButtonsStyle(MyActionButton*, MyActionButton*, MyActionButton*, MyActionButton*, int);
void setShowMyCardsButtonStyle( MyActionButton *sc);
void setAwayRadioButtonsStyle(QRadioButton*);
QString getActionAllInI18NString() const { return ActionAllInI18NString; }
@@ -183,6 +184,8 @@ private:
QString Table;
QString HandRanking;
QString ToolBoxBackground;
QString ShowMyCardsButtonDefault;
QString ShowMyCardsButtonHover;
// I18N ACTION STRINGS
QString ActionAllInI18NString;
@@ -253,6 +256,8 @@ private:
QString BetSpeedSliderGrooveBorderColor;
QString BetSpeedSliderHandleBgColor;
QString BetSpeedSliderHandleBorderColor;
QString ShowMyCardsButtonTextColor;
// SIZES
QString ChatLogTextSize;