next steps skinning implementation (config ready)
This commit is contained in:
@@ -1,7 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" ?>
|
|
||||||
<PokerTH>
|
|
||||||
<CardDeck>
|
|
||||||
<StyleDescription value="default card deck" />
|
|
||||||
<PreviewPicture value="preview.png" />
|
|
||||||
</CardDeck>
|
|
||||||
</PokerTH>
|
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<PokerTH>
|
||||||
|
<CardDeck>
|
||||||
|
<StyleDescription value="PokerTH default card deck" />
|
||||||
|
<StyleMaintainerEMail value="webmaster@pokerth.net" />
|
||||||
|
<Preview value="preview.png" />
|
||||||
|
</CardDeck>
|
||||||
|
</PokerTH>
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 28 KiB |
@@ -178,6 +178,7 @@ HEADERS += \
|
|||||||
src/gui/qt/startnetworkgamedialog/startnetworkgamedialogimpl.h \
|
src/gui/qt/startnetworkgamedialog/startnetworkgamedialogimpl.h \
|
||||||
src/gui/qt/startwindow/startwindowimpl.h \
|
src/gui/qt/startwindow/startwindowimpl.h \
|
||||||
src/gui/qt/styles/gametablestylereader.h \
|
src/gui/qt/styles/gametablestylereader.h \
|
||||||
|
src/gui/qt/styles/carddeckstylereader.h \
|
||||||
src/gui/qt/changehumanplayernamedialog/changehumanplayernamedialogimpl.h \
|
src/gui/qt/changehumanplayernamedialog/changehumanplayernamedialogimpl.h \
|
||||||
src/gui/qt/changecompleteblindsdialog/changecompleteblindsdialogimpl.h \
|
src/gui/qt/changecompleteblindsdialog/changecompleteblindsdialogimpl.h \
|
||||||
src/gui/qt/gamelobbydialog/gamelobbydialogimpl.h \
|
src/gui/qt/gamelobbydialog/gamelobbydialogimpl.h \
|
||||||
@@ -242,6 +243,7 @@ SOURCES += \
|
|||||||
src/gui/qt/startnetworkgamedialog/startnetworkgamedialogimpl.cpp \
|
src/gui/qt/startnetworkgamedialog/startnetworkgamedialogimpl.cpp \
|
||||||
src/gui/qt/startwindow/startwindowimpl.cpp \
|
src/gui/qt/startwindow/startwindowimpl.cpp \
|
||||||
src/gui/qt/styles/gametablestylereader.cpp \
|
src/gui/qt/styles/gametablestylereader.cpp \
|
||||||
|
src/gui/qt/styles/carddeckstylereader.cpp \
|
||||||
src/gui/qt/changehumanplayernamedialog/changehumanplayernamedialogimpl.cpp \
|
src/gui/qt/changehumanplayernamedialog/changehumanplayernamedialogimpl.cpp \
|
||||||
src/gui/qt/changecompleteblindsdialog/changecompleteblindsdialogimpl.cpp \
|
src/gui/qt/changecompleteblindsdialog/changecompleteblindsdialogimpl.cpp \
|
||||||
src/gui/qt/mymessagedialog/mymessagedialogimpl.cpp \
|
src/gui/qt/mymessagedialog/mymessagedialogimpl.cpp \
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ ConfigFile::ConfigFile(char *argv0, bool readonly) : noWriteAccess(readonly)
|
|||||||
myQtToolsInterface = CreateQtToolsWrapper();
|
myQtToolsInterface = CreateQtToolsWrapper();
|
||||||
|
|
||||||
// !!!! Revisionsnummer der Configdefaults !!!!!
|
// !!!! Revisionsnummer der Configdefaults !!!!!
|
||||||
configRev = 61;
|
configRev = 62;
|
||||||
|
|
||||||
//standard defaults
|
//standard defaults
|
||||||
logOnOffDefault = "1";
|
logOnOffDefault = "1";
|
||||||
@@ -148,8 +148,8 @@ ConfigFile::ConfigFile(char *argv0, bool readonly) : noWriteAccess(readonly)
|
|||||||
configList.push_back(ConfigInfo("FlipsideOwnFile", CONFIG_TYPE_STRING, ""));
|
configList.push_back(ConfigInfo("FlipsideOwnFile", CONFIG_TYPE_STRING, ""));
|
||||||
configList.push_back(ConfigInfo("GameTableStylesList", CONFIG_TYPE_STRING_LIST, "GameTableStyles"));
|
configList.push_back(ConfigInfo("GameTableStylesList", CONFIG_TYPE_STRING_LIST, "GameTableStyles"));
|
||||||
configList.push_back(ConfigInfo("CurrentGameTableStyle", CONFIG_TYPE_STRING, ""));
|
configList.push_back(ConfigInfo("CurrentGameTableStyle", CONFIG_TYPE_STRING, ""));
|
||||||
configList.push_back(ConfigInfo("CardDecksList", CONFIG_TYPE_STRING_LIST, "CardDecks"));
|
configList.push_back(ConfigInfo("CardDeckStylesList", CONFIG_TYPE_STRING_LIST, "CardDeckStyles"));
|
||||||
configList.push_back(ConfigInfo("CurrentCardDeck", CONFIG_TYPE_STRING, ""));
|
configList.push_back(ConfigInfo("CurrentCardDeckStyle", CONFIG_TYPE_STRING, ""));
|
||||||
configList.push_back(ConfigInfo("PlaySoundEffects", CONFIG_TYPE_INT, "1"));
|
configList.push_back(ConfigInfo("PlaySoundEffects", CONFIG_TYPE_INT, "1"));
|
||||||
configList.push_back(ConfigInfo("SoundVolume", CONFIG_TYPE_INT, "8"));
|
configList.push_back(ConfigInfo("SoundVolume", CONFIG_TYPE_INT, "8"));
|
||||||
configList.push_back(ConfigInfo("PlayGameActions", CONFIG_TYPE_INT, "1"));
|
configList.push_back(ConfigInfo("PlayGameActions", CONFIG_TYPE_INT, "1"));
|
||||||
|
|||||||
@@ -3496,7 +3496,7 @@
|
|||||||
</property>
|
</property>
|
||||||
<widget class="QMenu" name="menuView">
|
<widget class="QMenu" name="menuView">
|
||||||
<property name="title">
|
<property name="title">
|
||||||
<string>View</string>
|
<string>&View</string>
|
||||||
</property>
|
</property>
|
||||||
<addaction name="actionFullScreen"/>
|
<addaction name="actionFullScreen"/>
|
||||||
<addaction name="actionShowHideChat"/>
|
<addaction name="actionShowHideChat"/>
|
||||||
@@ -3508,7 +3508,7 @@
|
|||||||
</widget>
|
</widget>
|
||||||
<widget class="QMenu" name="menuSettings">
|
<widget class="QMenu" name="menuSettings">
|
||||||
<property name="title">
|
<property name="title">
|
||||||
<string>Settings</string>
|
<string>&Settings</string>
|
||||||
</property>
|
</property>
|
||||||
<addaction name="actionConfigure_PokerTH"/>
|
<addaction name="actionConfigure_PokerTH"/>
|
||||||
</widget>
|
</widget>
|
||||||
|
|||||||
@@ -481,13 +481,13 @@ p, li { white-space: pre-wrap; }
|
|||||||
<item row="3" column="0">
|
<item row="3" column="0">
|
||||||
<widget class="QGroupBox" name="groupBox_12">
|
<widget class="QGroupBox" name="groupBox_12">
|
||||||
<property name="title">
|
<property name="title">
|
||||||
<string>Card Decks</string>
|
<string>Card Deck Styles</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" name="gridLayout_14">
|
<layout class="QGridLayout" name="gridLayout_14">
|
||||||
<item row="0" column="1">
|
<item row="0" column="1">
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QPushButton" name="pushButton_activateCardDeck">
|
<widget class="QPushButton" name="pushButton_activateCardDeckStyle">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Activate</string>
|
<string>Activate</string>
|
||||||
</property>
|
</property>
|
||||||
@@ -507,14 +507,14 @@ p, li { white-space: pre-wrap; }
|
|||||||
</spacer>
|
</spacer>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QPushButton" name="pushButton_addCardDeck">
|
<widget class="QPushButton" name="pushButton_addCardDeckStyle">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Add ...</string>
|
<string>Add ...</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QPushButton" name="pushButton_removeCardDeck">
|
<widget class="QPushButton" name="pushButton_removeCardDeckStyle">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Remove</string>
|
<string>Remove</string>
|
||||||
</property>
|
</property>
|
||||||
@@ -529,7 +529,7 @@ p, li { white-space: pre-wrap; }
|
|||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" name="gridLayout_16">
|
<layout class="QGridLayout" name="gridLayout_16">
|
||||||
<item row="0" column="0">
|
<item row="0" column="0">
|
||||||
<widget class="QLabel" name="label_cardDeckPreview">
|
<widget class="QLabel" name="label_cardDeckStylePreview">
|
||||||
<property name="minimumSize">
|
<property name="minimumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>160</width>
|
<width>160</width>
|
||||||
@@ -551,7 +551,7 @@ p, li { white-space: pre-wrap; }
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="0" column="0">
|
<item row="0" column="0">
|
||||||
<widget class="QListWidget" name="listWidget_2"/>
|
<widget class="QListWidget" name="listWidget_cardDeckStyles"/>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
|
|||||||
@@ -20,11 +20,13 @@
|
|||||||
#include "settingsdialogimpl.h"
|
#include "settingsdialogimpl.h"
|
||||||
#include "myavatarlistitem.h"
|
#include "myavatarlistitem.h"
|
||||||
#include "gametablestylereader.h"
|
#include "gametablestylereader.h"
|
||||||
|
#include "carddeckstylereader.h"
|
||||||
|
|
||||||
#include "configfile.h"
|
#include "configfile.h"
|
||||||
#include <net/socket_startup.h>
|
#include <net/socket_startup.h>
|
||||||
|
|
||||||
#define POKERTH_DISTRIBUTED_GAME_TABLE_STYLES 1
|
#define POKERTH_DISTRIBUTED_GAME_TABLE_STYLES 1
|
||||||
|
#define POKERTH_DISTRIBUTED_CARD_DECK_STYLES 1
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
@@ -110,8 +112,10 @@ settingsDialogImpl::settingsDialogImpl(QWidget *parent, ConfigFile *c, selectAva
|
|||||||
connect( pushButton_addGameTableStyle, SIGNAL( clicked() ), this, SLOT( addGameTableStyle()) );
|
connect( pushButton_addGameTableStyle, SIGNAL( clicked() ), this, SLOT( addGameTableStyle()) );
|
||||||
connect( pushButton_removeGameTableStyle, SIGNAL( clicked() ), this, SLOT( removeGameTableStyle()) );
|
connect( pushButton_removeGameTableStyle, SIGNAL( clicked() ), this, SLOT( removeGameTableStyle()) );
|
||||||
|
|
||||||
|
connect( listWidget_cardDeckStyles, SIGNAL( currentItemChanged(QListWidgetItem*, QListWidgetItem*) ), this, SLOT ( showCurrentCardDeckStylePreview() ));
|
||||||
|
connect( pushButton_activateCardDeckStyle, SIGNAL( clicked() ), this, SLOT( setSelectedCardDeckStyleActivated()) );
|
||||||
|
connect( pushButton_addCardDeckStyle, SIGNAL( clicked() ), this, SLOT( addCardDeckStyle()) );
|
||||||
|
connect( pushButton_removeCardDeckStyle, SIGNAL( clicked() ), this, SLOT( removeCardDeckStyle()) );
|
||||||
}
|
}
|
||||||
|
|
||||||
void settingsDialogImpl::exec() {
|
void settingsDialogImpl::exec() {
|
||||||
@@ -235,13 +239,14 @@ void settingsDialogImpl::exec() {
|
|||||||
lineEdit_OwnFlipsideFilename->setText(QString::fromUtf8(myConfig->readConfigString("FlipsideOwnFile").c_str()));
|
lineEdit_OwnFlipsideFilename->setText(QString::fromUtf8(myConfig->readConfigString("FlipsideOwnFile").c_str()));
|
||||||
|
|
||||||
//S t y l e
|
//S t y l e
|
||||||
|
//TABLE
|
||||||
// define PokerTH default GameTableStyle
|
// define PokerTH default GameTableStyle
|
||||||
listWidget_gameTableStyles->clear();
|
listWidget_gameTableStyles->clear();
|
||||||
|
|
||||||
GameTableStyleReader defaultStyle(myConfig);
|
GameTableStyleReader defaultTableStyle(myConfig);
|
||||||
defaultStyle.readStyleFile(QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str())+"/gfx/gui/table/default/defaulttablestyle.xml");
|
defaultTableStyle.readStyleFile(QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str())+"/gfx/gui/table/default/defaulttablestyle.xml");
|
||||||
QListWidgetItem *defaultItem = new QListWidgetItem(defaultStyle.getStyleDescription(),listWidget_gameTableStyles);
|
QListWidgetItem *defaultTableItem = new QListWidgetItem(defaultTableStyle.getStyleDescription(),listWidget_gameTableStyles);
|
||||||
defaultItem->setData(15, QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str())+"/gfx/gui/table/default/defaulttablestyle.xml");
|
defaultTableItem->setData(15, QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str())+"/gfx/gui/table/default/defaulttablestyle.xml");
|
||||||
|
|
||||||
//load secondary styles into list (if fallback no entry)
|
//load secondary styles into list (if fallback no entry)
|
||||||
myGameTableStylesList = myConfig->readConfigStringList("GameTableStylesList");
|
myGameTableStylesList = myConfig->readConfigStringList("GameTableStylesList");
|
||||||
@@ -260,17 +265,17 @@ void settingsDialogImpl::exec() {
|
|||||||
GameTableStyleReader currentGameTableStyle(myConfig);
|
GameTableStyleReader currentGameTableStyle(myConfig);
|
||||||
currentGameTableStyle.readStyleFile(QString::fromUtf8(myConfig->readConfigString("CurrentGameTableStyle").c_str()));
|
currentGameTableStyle.readStyleFile(QString::fromUtf8(myConfig->readConfigString("CurrentGameTableStyle").c_str()));
|
||||||
int i;
|
int i;
|
||||||
bool currentFound(FALSE);
|
bool currentGameTableFound(FALSE);
|
||||||
for(i=0; i < listWidget_gameTableStyles->count(); i++) {
|
for(i=0; i < listWidget_gameTableStyles->count(); i++) {
|
||||||
QListWidgetItem *item = listWidget_gameTableStyles->item(i);
|
QListWidgetItem *item = listWidget_gameTableStyles->item(i);
|
||||||
if(item->data(15) == currentGameTableStyle.getCurrentFileName()) {
|
if(item->data(15) == currentGameTableStyle.getCurrentFileName()) {
|
||||||
item->setIcon(QIcon(QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str())+"/gfx/gui/misc/rating.png"));
|
item->setIcon(QIcon(QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str())+"/gfx/gui/misc/rating.png"));
|
||||||
listWidget_gameTableStyles->setCurrentItem(item);
|
listWidget_gameTableStyles->setCurrentItem(item);
|
||||||
currentFound=TRUE;
|
currentGameTableFound=TRUE;
|
||||||
}
|
}
|
||||||
else item->setIcon(QIcon());
|
else item->setIcon(QIcon());
|
||||||
}
|
}
|
||||||
if(!currentFound) {
|
if(!currentGameTableFound) {
|
||||||
qDebug() << "Config ERROR: current game table style file not found in List. Mark default as selected.";
|
qDebug() << "Config ERROR: current game table style file not found in List. Mark default as selected.";
|
||||||
QListWidgetItem *item = listWidget_gameTableStyles->item(0);
|
QListWidgetItem *item = listWidget_gameTableStyles->item(0);
|
||||||
item->setIcon(QIcon(QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str())+"/gfx/gui/misc/rating.png"));
|
item->setIcon(QIcon(QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str())+"/gfx/gui/misc/rating.png"));
|
||||||
@@ -279,11 +284,51 @@ void settingsDialogImpl::exec() {
|
|||||||
|
|
||||||
//refresh Game Table Style Preview
|
//refresh Game Table Style Preview
|
||||||
showCurrentGameTableStylePreview();
|
showCurrentGameTableStylePreview();
|
||||||
|
|
||||||
|
|
||||||
|
//CARDS
|
||||||
//define PokerTH default CardDeck
|
//define PokerTH default CardDeck
|
||||||
// defaultCardDeck = myQtToolsInterface->getDataPathStdString(myArgv0)+"gfx/cards/default/defaultcarddeck.xml";
|
listWidget_cardDeckStyles->clear();
|
||||||
|
CardDeckStyleReader defaultCardStyle(myConfig);
|
||||||
|
defaultCardStyle.readStyleFile(QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str())+"/gfx/cards/default/defaultdeckstyle.xml");
|
||||||
|
QListWidgetItem *defaultCardItem = new QListWidgetItem(defaultCardStyle.getStyleDescription(),listWidget_cardDeckStyles);
|
||||||
|
defaultCardItem->setData(15, QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str())+"/gfx/cards/default/defaultdeckstyle.xml");
|
||||||
|
|
||||||
|
//load secondary card styles into list (if fallback no entry)
|
||||||
|
myCardDeckStylesList = myConfig->readConfigStringList("CardDeckStylesList");
|
||||||
|
list<std::string>::iterator it2;
|
||||||
|
for(it2= myCardDeckStylesList.begin(); it2 != myCardDeckStylesList.end(); it2++) {
|
||||||
|
CardDeckStyleReader nextStyle(myConfig);
|
||||||
|
nextStyle.readStyleFile(QString::fromUtf8(it2->c_str()));
|
||||||
|
if(!nextStyle.getFallBack()) {
|
||||||
|
QListWidgetItem *nextItem = new QListWidgetItem(nextStyle.getStyleDescription());
|
||||||
|
nextItem->setData(15,QString::fromUtf8(it2->c_str()));
|
||||||
|
listWidget_cardDeckStyles->addItem(nextItem);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//set current card deck style from config file
|
||||||
|
CardDeckStyleReader currentCardDeckStyle(myConfig);
|
||||||
|
currentCardDeckStyle.readStyleFile(QString::fromUtf8(myConfig->readConfigString("CurrentCardDeckStyle").c_str()));
|
||||||
|
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);
|
||||||
|
currentCardDeckFound=TRUE;
|
||||||
|
}
|
||||||
|
else item->setIcon(QIcon());
|
||||||
|
}
|
||||||
|
if(!currentCardDeckFound) {
|
||||||
|
qDebug() << "Config ERROR: current card deck style file not found in List. Mark default as selected.";
|
||||||
|
QListWidgetItem *item = listWidget_cardDeckStyles->item(0);
|
||||||
|
item->setIcon(QIcon(QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str())+"/gfx/gui/misc/rating.png"));
|
||||||
|
listWidget_cardDeckStyles->setCurrentItem(item);
|
||||||
|
}
|
||||||
|
|
||||||
|
// refresh Card Deck Style Preview
|
||||||
|
showCurrentCardDeckStylePreview();
|
||||||
|
|
||||||
//Sound
|
//Sound
|
||||||
groupBox_playSoundEffects->setChecked(myConfig->readConfigInt("PlaySoundEffects"));
|
groupBox_playSoundEffects->setChecked(myConfig->readConfigInt("PlaySoundEffects"));
|
||||||
@@ -469,6 +514,7 @@ void settingsDialogImpl::isAccepted() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//S T Y L E
|
//S T Y L E
|
||||||
|
// TABLE
|
||||||
//save game table styles list
|
//save game table styles list
|
||||||
myGameTableStylesList.clear();
|
myGameTableStylesList.clear();
|
||||||
int i;
|
int i;
|
||||||
@@ -483,7 +529,22 @@ void settingsDialogImpl::isAccepted() {
|
|||||||
if(!item->icon().isNull())
|
if(!item->icon().isNull())
|
||||||
myConfig->writeConfigString("CurrentGameTableStyle", item->data(15).toString().toUtf8().constData());
|
myConfig->writeConfigString("CurrentGameTableStyle", item->data(15).toString().toUtf8().constData());
|
||||||
}
|
}
|
||||||
|
// CARDS
|
||||||
|
//save card deck styles list
|
||||||
|
myCardDeckStylesList.clear();
|
||||||
|
int j;
|
||||||
|
for(j=POKERTH_DISTRIBUTED_CARD_DECK_STYLES; j < listWidget_cardDeckStyles->count(); j++) {
|
||||||
|
QListWidgetItem *item = listWidget_cardDeckStyles->item(j);
|
||||||
|
myCardDeckStylesList.push_back(item->data(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());
|
||||||
|
}
|
||||||
|
|
||||||
//Sound
|
//Sound
|
||||||
myConfig->writeConfigInt("PlaySoundEffects", groupBox_playSoundEffects->isChecked());
|
myConfig->writeConfigInt("PlaySoundEffects", groupBox_playSoundEffects->isChecked());
|
||||||
myConfig->writeConfigInt("SoundVolume", horizontalSlider_soundVolume->value());
|
myConfig->writeConfigInt("SoundVolume", horizontalSlider_soundVolume->value());
|
||||||
@@ -865,3 +926,85 @@ void settingsDialogImpl::removeGameTableStyle()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void settingsDialogImpl::showCurrentCardDeckStylePreview()
|
||||||
|
{
|
||||||
|
QListWidgetItem* item = listWidget_cardDeckStyles->currentItem();
|
||||||
|
if(item) {
|
||||||
|
CardDeckStyleReader style(myConfig);
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void settingsDialogImpl::setSelectedCardDeckStyleActivated()
|
||||||
|
{
|
||||||
|
QListWidgetItem* selectedItem = listWidget_cardDeckStyles->currentItem();
|
||||||
|
if(selectedItem) {
|
||||||
|
int i;
|
||||||
|
for(i=0; i < listWidget_cardDeckStyles->count(); i++) {
|
||||||
|
QListWidgetItem *item = listWidget_cardDeckStyles->item(i);
|
||||||
|
if(item == selectedItem) {
|
||||||
|
item->setIcon(QIcon(QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str())+"/gfx/gui/misc/rating.png"));
|
||||||
|
}
|
||||||
|
else item->setIcon(QIcon());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void settingsDialogImpl::addCardDeckStyle()
|
||||||
|
{
|
||||||
|
QString fileName = QFileDialog::getOpenFileName(this, tr("Please select your card deck style"),
|
||||||
|
QDir::home().absolutePath(),
|
||||||
|
tr("PokerTH card deck styles (*.xml)"));
|
||||||
|
|
||||||
|
if (!fileName.isEmpty()) {
|
||||||
|
|
||||||
|
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)
|
||||||
|
fileNameAlreadyFound = TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(fileNameAlreadyFound) {
|
||||||
|
QMessageBox::warning(this, tr("Card Deck Style Error"),
|
||||||
|
tr("Selected card deck style file is already in the list. \nPlease select another one to add!"),
|
||||||
|
QMessageBox::Ok);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
CardDeckStyleReader newStyle(myConfig);
|
||||||
|
newStyle.readStyleFile(fileName);
|
||||||
|
if(!newStyle.getFallBack()) {
|
||||||
|
QListWidgetItem *newItem = new QListWidgetItem(newStyle.getStyleDescription());
|
||||||
|
newItem->setData(15,fileName);
|
||||||
|
listWidget_cardDeckStyles->addItem(newItem);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
QMessageBox::warning(this, tr("Card Deck Style File Error"),
|
||||||
|
tr("Could not read card deck style file. \nStyle will not be placed into list!"),
|
||||||
|
QMessageBox::Ok);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void settingsDialogImpl::removeCardDeckStyle()
|
||||||
|
{
|
||||||
|
//never delete PokerTH defaullt Styles
|
||||||
|
if(listWidget_cardDeckStyles->currentRow() >= POKERTH_DISTRIBUTED_CARD_DECK_STYLES) {
|
||||||
|
|
||||||
|
QListWidgetItem* selectedItem = listWidget_cardDeckStyles->currentItem();
|
||||||
|
if(selectedItem) {
|
||||||
|
// 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"));
|
||||||
|
}
|
||||||
|
//remove from List
|
||||||
|
listWidget_cardDeckStyles->takeItem(listWidget_cardDeckStyles->currentRow());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -85,6 +85,11 @@ public slots:
|
|||||||
void addGameTableStyle();
|
void addGameTableStyle();
|
||||||
void removeGameTableStyle();
|
void removeGameTableStyle();
|
||||||
|
|
||||||
|
void setSelectedCardDeckStyleActivated();
|
||||||
|
void showCurrentCardDeckStylePreview();
|
||||||
|
void addCardDeckStyle();
|
||||||
|
void removeCardDeckStyle();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
bool playerNickIsChanged;
|
bool playerNickIsChanged;
|
||||||
@@ -101,7 +106,7 @@ private:
|
|||||||
std::list<int> myManualBlindsList;
|
std::list<int> myManualBlindsList;
|
||||||
std::list<int> myNetManualBlindsList;
|
std::list<int> myNetManualBlindsList;
|
||||||
std::list<std::string> myGameTableStylesList;
|
std::list<std::string> myGameTableStylesList;
|
||||||
std::list<std::string> myCardDecksList;
|
std::list<std::string> myCardDeckStylesList;
|
||||||
|
|
||||||
ConfigFile* myConfig;
|
ConfigFile* myConfig;
|
||||||
boost::shared_ptr<selectAvatarDialogImpl> mySelectAvatarDialogImpl;
|
boost::shared_ptr<selectAvatarDialogImpl> mySelectAvatarDialogImpl;
|
||||||
|
|||||||
+102
-101
@@ -1,7 +1,8 @@
|
|||||||
<ui version="4.0" >
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<ui version="4.0">
|
||||||
<class>startWindow</class>
|
<class>startWindow</class>
|
||||||
<widget class="QMainWindow" name="startWindow" >
|
<widget class="QMainWindow" name="startWindow">
|
||||||
<property name="geometry" >
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
@@ -9,29 +10,29 @@
|
|||||||
<height>350</height>
|
<height>350</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="minimumSize" >
|
<property name="minimumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>450</width>
|
<width>450</width>
|
||||||
<height>350</height>
|
<height>350</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="maximumSize" >
|
<property name="maximumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>450</width>
|
<width>450</width>
|
||||||
<height>350</height>
|
<height>350</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle" >
|
<property name="windowTitle">
|
||||||
<string>PokerTH 0.6.3 - The Open-Source Texas Holdem Engine</string>
|
<string>PokerTH 0.6.3 - The Open-Source Texas Holdem Engine</string>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="centralwidget" >
|
<widget class="QWidget" name="centralwidget">
|
||||||
<layout class="QGridLayout" name="gridLayout" >
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
<item row="0" column="1" >
|
<item row="0" column="1">
|
||||||
<spacer>
|
<spacer>
|
||||||
<property name="orientation" >
|
<property name="orientation">
|
||||||
<enum>Qt::Vertical</enum>
|
<enum>Qt::Vertical</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="sizeHint" stdset="0" >
|
<property name="sizeHint" stdset="0">
|
||||||
<size>
|
<size>
|
||||||
<width>20</width>
|
<width>20</width>
|
||||||
<height>95</height>
|
<height>95</height>
|
||||||
@@ -39,12 +40,12 @@
|
|||||||
</property>
|
</property>
|
||||||
</spacer>
|
</spacer>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="0" >
|
<item row="1" column="0">
|
||||||
<spacer>
|
<spacer>
|
||||||
<property name="orientation" >
|
<property name="orientation">
|
||||||
<enum>Qt::Horizontal</enum>
|
<enum>Qt::Horizontal</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="sizeHint" stdset="0" >
|
<property name="sizeHint" stdset="0">
|
||||||
<size>
|
<size>
|
||||||
<width>63</width>
|
<width>63</width>
|
||||||
<height>20</height>
|
<height>20</height>
|
||||||
@@ -52,24 +53,24 @@
|
|||||||
</property>
|
</property>
|
||||||
</spacer>
|
</spacer>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="1" >
|
<item row="1" column="1">
|
||||||
<layout class="QVBoxLayout" name="verticalLayout" >
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
<property name="spacing" >
|
<property name="spacing">
|
||||||
<number>6</number>
|
<number>6</number>
|
||||||
</property>
|
</property>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QPushButton" name="pushButtonStart_Local_Game" >
|
<widget class="QPushButton" name="pushButtonStart_Local_Game">
|
||||||
<property name="focusPolicy" >
|
<property name="focusPolicy">
|
||||||
<enum>Qt::NoFocus</enum>
|
<enum>Qt::NoFocus</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="text" >
|
<property name="text">
|
||||||
<string>&1 Start Local Game</string>
|
<string>&1 Start Local Game</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="icon" >
|
<property name="icon">
|
||||||
<iconset resource="resources/pokerth.qrc" >
|
<iconset resource="resources/pokerth.qrc">
|
||||||
<normaloff>:/gfx/swbuttonlocalgame.png</normaloff>:/gfx/swbuttonlocalgame.png</iconset>
|
<normaloff>:/gfx/swbuttonlocalgame.png</normaloff>:/gfx/swbuttonlocalgame.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="iconSize" >
|
<property name="iconSize">
|
||||||
<size>
|
<size>
|
||||||
<width>32</width>
|
<width>32</width>
|
||||||
<height>32</height>
|
<height>32</height>
|
||||||
@@ -78,18 +79,18 @@
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QPushButton" name="pushButtonInternet_Game" >
|
<widget class="QPushButton" name="pushButtonInternet_Game">
|
||||||
<property name="focusPolicy" >
|
<property name="focusPolicy">
|
||||||
<enum>Qt::NoFocus</enum>
|
<enum>Qt::NoFocus</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="text" >
|
<property name="text">
|
||||||
<string>&2 Internet Game</string>
|
<string>&2 Internet Game</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="icon" >
|
<property name="icon">
|
||||||
<iconset resource="resources/pokerth.qrc" >
|
<iconset resource="resources/pokerth.qrc">
|
||||||
<normaloff>:/gfx/swbuttoninternetgame.png</normaloff>:/gfx/swbuttoninternetgame.png</iconset>
|
<normaloff>:/gfx/swbuttoninternetgame.png</normaloff>:/gfx/swbuttoninternetgame.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="iconSize" >
|
<property name="iconSize">
|
||||||
<size>
|
<size>
|
||||||
<width>32</width>
|
<width>32</width>
|
||||||
<height>32</height>
|
<height>32</height>
|
||||||
@@ -98,18 +99,18 @@
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QPushButton" name="pushButton_Create_Network_Game" >
|
<widget class="QPushButton" name="pushButton_Create_Network_Game">
|
||||||
<property name="focusPolicy" >
|
<property name="focusPolicy">
|
||||||
<enum>Qt::NoFocus</enum>
|
<enum>Qt::NoFocus</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="text" >
|
<property name="text">
|
||||||
<string>&3 Create Network Game</string>
|
<string>&3 Create Network Game</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="icon" >
|
<property name="icon">
|
||||||
<iconset resource="resources/pokerth.qrc" >
|
<iconset resource="resources/pokerth.qrc">
|
||||||
<normaloff>:/gfx/swbuttoncreatenetworkgame.png</normaloff>:/gfx/swbuttoncreatenetworkgame.png</iconset>
|
<normaloff>:/gfx/swbuttoncreatenetworkgame.png</normaloff>:/gfx/swbuttoncreatenetworkgame.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="iconSize" >
|
<property name="iconSize">
|
||||||
<size>
|
<size>
|
||||||
<width>32</width>
|
<width>32</width>
|
||||||
<height>32</height>
|
<height>32</height>
|
||||||
@@ -118,18 +119,18 @@
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QPushButton" name="pushButton_Join_Network_Game" >
|
<widget class="QPushButton" name="pushButton_Join_Network_Game">
|
||||||
<property name="focusPolicy" >
|
<property name="focusPolicy">
|
||||||
<enum>Qt::NoFocus</enum>
|
<enum>Qt::NoFocus</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="text" >
|
<property name="text">
|
||||||
<string>&4 Join Network Game</string>
|
<string>&4 Join Network Game</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="icon" >
|
<property name="icon">
|
||||||
<iconset resource="resources/pokerth.qrc" >
|
<iconset resource="resources/pokerth.qrc">
|
||||||
<normaloff>:/gfx/swbuttonjoinnetworkgame.png</normaloff>:/gfx/swbuttonjoinnetworkgame.png</iconset>
|
<normaloff>:/gfx/swbuttonjoinnetworkgame.png</normaloff>:/gfx/swbuttonjoinnetworkgame.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="iconSize" >
|
<property name="iconSize">
|
||||||
<size>
|
<size>
|
||||||
<width>32</width>
|
<width>32</width>
|
||||||
<height>32</height>
|
<height>32</height>
|
||||||
@@ -139,12 +140,12 @@
|
|||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="2" >
|
<item row="1" column="2">
|
||||||
<spacer>
|
<spacer>
|
||||||
<property name="orientation" >
|
<property name="orientation">
|
||||||
<enum>Qt::Horizontal</enum>
|
<enum>Qt::Horizontal</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="sizeHint" stdset="0" >
|
<property name="sizeHint" stdset="0">
|
||||||
<size>
|
<size>
|
||||||
<width>63</width>
|
<width>63</width>
|
||||||
<height>20</height>
|
<height>20</height>
|
||||||
@@ -152,12 +153,12 @@
|
|||||||
</property>
|
</property>
|
||||||
</spacer>
|
</spacer>
|
||||||
</item>
|
</item>
|
||||||
<item row="2" column="1" >
|
<item row="2" column="1">
|
||||||
<spacer>
|
<spacer>
|
||||||
<property name="orientation" >
|
<property name="orientation">
|
||||||
<enum>Qt::Vertical</enum>
|
<enum>Qt::Vertical</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="sizeHint" stdset="0" >
|
<property name="sizeHint" stdset="0">
|
||||||
<size>
|
<size>
|
||||||
<width>20</width>
|
<width>20</width>
|
||||||
<height>95</height>
|
<height>95</height>
|
||||||
@@ -167,113 +168,113 @@
|
|||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QMenuBar" name="menubar" >
|
<widget class="QMenuBar" name="menubar">
|
||||||
<property name="geometry" >
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>450</width>
|
<width>450</width>
|
||||||
<height>23</height>
|
<height>25</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QMenu" name="menuPokerTH" >
|
<widget class="QMenu" name="menuPokerTH">
|
||||||
<property name="title" >
|
<property name="title">
|
||||||
<string>PokerTH</string>
|
<string>&PokerTH</string>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QMenu" name="menuNetwork_Game" >
|
<widget class="QMenu" name="menuNetwork_Game">
|
||||||
<property name="title" >
|
<property name="title">
|
||||||
<string>Network Game</string>
|
<string>Network Game</string>
|
||||||
</property>
|
</property>
|
||||||
<addaction name="actionCreate_Network_Game" />
|
<addaction name="actionCreate_Network_Game"/>
|
||||||
<addaction name="actionJoin_Network_Game" />
|
<addaction name="actionJoin_Network_Game"/>
|
||||||
</widget>
|
</widget>
|
||||||
<addaction name="actionStart_Local_Game" />
|
<addaction name="actionStart_Local_Game"/>
|
||||||
<addaction name="menuNetwork_Game" />
|
<addaction name="menuNetwork_Game"/>
|
||||||
<addaction name="actionInternet_Game" />
|
<addaction name="actionInternet_Game"/>
|
||||||
<addaction name="actionAbout_PokerTH" />
|
<addaction name="actionAbout_PokerTH"/>
|
||||||
<addaction name="actionQuit" />
|
<addaction name="actionQuit"/>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QMenu" name="menuSettings" >
|
<widget class="QMenu" name="menuSettings">
|
||||||
<property name="title" >
|
<property name="title">
|
||||||
<string>Settings</string>
|
<string>&Settings</string>
|
||||||
</property>
|
</property>
|
||||||
<addaction name="actionConfigure_PokerTH" />
|
<addaction name="actionConfigure_PokerTH"/>
|
||||||
</widget>
|
</widget>
|
||||||
<addaction name="menuPokerTH" />
|
<addaction name="menuPokerTH"/>
|
||||||
<addaction name="menuSettings" />
|
<addaction name="menuSettings"/>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QStatusBar" name="statusbar" />
|
<widget class="QStatusBar" name="statusbar"/>
|
||||||
<action name="actionStart_Local_Game" >
|
<action name="actionStart_Local_Game">
|
||||||
<property name="icon" >
|
<property name="icon">
|
||||||
<iconset resource="resources/pokerth.qrc" >
|
<iconset resource="resources/pokerth.qrc">
|
||||||
<normaloff>:/gfx/swbuttonlocalgame.png</normaloff>:/gfx/swbuttonlocalgame.png</iconset>
|
<normaloff>:/gfx/swbuttonlocalgame.png</normaloff>:/gfx/swbuttonlocalgame.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="text" >
|
<property name="text">
|
||||||
<string>Start Local Game ...</string>
|
<string>Start Local Game ...</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="shortcut" >
|
<property name="shortcut">
|
||||||
<string>Ctrl+N</string>
|
<string>Ctrl+N</string>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
<action name="actionInternet_Game" >
|
<action name="actionInternet_Game">
|
||||||
<property name="icon" >
|
<property name="icon">
|
||||||
<iconset resource="resources/pokerth.qrc" >
|
<iconset resource="resources/pokerth.qrc">
|
||||||
<normaloff>:/gfx/swbuttoninternetgame.png</normaloff>:/gfx/swbuttoninternetgame.png</iconset>
|
<normaloff>:/gfx/swbuttoninternetgame.png</normaloff>:/gfx/swbuttoninternetgame.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="text" >
|
<property name="text">
|
||||||
<string>Internet Game ...</string>
|
<string>Internet Game ...</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="shortcut" >
|
<property name="shortcut">
|
||||||
<string>Ctrl+I</string>
|
<string>Ctrl+I</string>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
<action name="actionAbout_PokerTH" >
|
<action name="actionAbout_PokerTH">
|
||||||
<property name="text" >
|
<property name="text">
|
||||||
<string>About PokerTH</string>
|
<string>About PokerTH</string>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
<action name="actionConfigure_PokerTH" >
|
<action name="actionConfigure_PokerTH">
|
||||||
<property name="icon" >
|
<property name="icon">
|
||||||
<iconset resource="resources/pokerth.qrc" >
|
<iconset resource="resources/pokerth.qrc">
|
||||||
<normaloff>:/gfx/systemsettings.png</normaloff>:/gfx/systemsettings.png</iconset>
|
<normaloff>:/gfx/systemsettings.png</normaloff>:/gfx/systemsettings.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="text" >
|
<property name="text">
|
||||||
<string>Configure PokerTH ...</string>
|
<string>Configure PokerTH ...</string>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
<action name="actionQuit" >
|
<action name="actionQuit">
|
||||||
<property name="icon" >
|
<property name="icon">
|
||||||
<iconset resource="resources/pokerth.qrc" >
|
<iconset resource="resources/pokerth.qrc">
|
||||||
<normaloff>:/gfx/application_exit.png</normaloff>:/gfx/application_exit.png</iconset>
|
<normaloff>:/gfx/application_exit.png</normaloff>:/gfx/application_exit.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="text" >
|
<property name="text">
|
||||||
<string>Quit</string>
|
<string>Quit</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="shortcut" >
|
<property name="shortcut">
|
||||||
<string>Ctrl+Q</string>
|
<string>Ctrl+Q</string>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
<action name="actionCreate_Network_Game" >
|
<action name="actionCreate_Network_Game">
|
||||||
<property name="icon" >
|
<property name="icon">
|
||||||
<iconset resource="resources/pokerth.qrc" >
|
<iconset resource="resources/pokerth.qrc">
|
||||||
<normaloff>:/gfx/swbuttoncreatenetworkgame.png</normaloff>:/gfx/swbuttoncreatenetworkgame.png</iconset>
|
<normaloff>:/gfx/swbuttoncreatenetworkgame.png</normaloff>:/gfx/swbuttoncreatenetworkgame.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="text" >
|
<property name="text">
|
||||||
<string>Create Network Game ...</string>
|
<string>Create Network Game ...</string>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
<action name="actionJoin_Network_Game" >
|
<action name="actionJoin_Network_Game">
|
||||||
<property name="icon" >
|
<property name="icon">
|
||||||
<iconset resource="resources/pokerth.qrc" >
|
<iconset resource="resources/pokerth.qrc">
|
||||||
<normaloff>:/gfx/swbuttonjoinnetworkgame.png</normaloff>:/gfx/swbuttonjoinnetworkgame.png</iconset>
|
<normaloff>:/gfx/swbuttonjoinnetworkgame.png</normaloff>:/gfx/swbuttonjoinnetworkgame.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="text" >
|
<property name="text">
|
||||||
<string>Join Network Game ...</string>
|
<string>Join Network Game ...</string>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
</widget>
|
</widget>
|
||||||
<resources>
|
<resources>
|
||||||
<include location="resources/pokerth.qrc" />
|
<include location="resources/pokerth.qrc"/>
|
||||||
</resources>
|
</resources>
|
||||||
<connections>
|
<connections>
|
||||||
<connection>
|
<connection>
|
||||||
@@ -282,11 +283,11 @@
|
|||||||
<receiver>startWindow</receiver>
|
<receiver>startWindow</receiver>
|
||||||
<slot>close()</slot>
|
<slot>close()</slot>
|
||||||
<hints>
|
<hints>
|
||||||
<hint type="sourcelabel" >
|
<hint type="sourcelabel">
|
||||||
<x>-1</x>
|
<x>-1</x>
|
||||||
<y>-1</y>
|
<y>-1</y>
|
||||||
</hint>
|
</hint>
|
||||||
<hint type="destinationlabel" >
|
<hint type="destinationlabel">
|
||||||
<x>221</x>
|
<x>221</x>
|
||||||
<y>168</y>
|
<y>168</y>
|
||||||
</hint>
|
</hint>
|
||||||
|
|||||||
@@ -0,0 +1,82 @@
|
|||||||
|
/***************************************************************************
|
||||||
|
* Copyright (C) 2006 by Felix Hammer *
|
||||||
|
* f.hammer@web.de *
|
||||||
|
* *
|
||||||
|
* This program is free software; you can redistribute it and/or modify *
|
||||||
|
* it under the terms of the GNU General Public License as published by *
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or *
|
||||||
|
* (at your option) any later version. *
|
||||||
|
* *
|
||||||
|
* This program is distributed in the hope that it will be useful, *
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||||
|
* GNU General Public License for more details. *
|
||||||
|
* *
|
||||||
|
* You should have received a copy of the GNU General Public License *
|
||||||
|
* along with this program; if not, write to the *
|
||||||
|
* Free Software Foundation, Inc., *
|
||||||
|
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||||
|
***************************************************************************/
|
||||||
|
#include "carddeckstylereader.h"
|
||||||
|
#include <iostream>
|
||||||
|
#include <sstream>
|
||||||
|
#include <cstdlib>
|
||||||
|
#include <fstream>
|
||||||
|
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
CardDeckStyleReader::CardDeckStyleReader(ConfigFile *c, gameTableImpl *w) : myConfig(c), myW(w), fallBack(0)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
CardDeckStyleReader::~CardDeckStyleReader()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void CardDeckStyleReader::readStyleFile(QString file) {
|
||||||
|
|
||||||
|
string tinyFileName;
|
||||||
|
|
||||||
|
//if style file failed --> default style fallback
|
||||||
|
if(QFile(file).exists()) {
|
||||||
|
currentFileName = QFile(file).fileName();
|
||||||
|
tinyFileName = currentFileName.toUtf8().constData();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
currentFileName = QFile(QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str())+"/gfx/cards/default/defaultdeckstyle.xml").fileName();
|
||||||
|
tinyFileName = currentFileName.toUtf8().constData();
|
||||||
|
fallBack = 1;
|
||||||
|
}
|
||||||
|
QFileInfo info(currentFileName);
|
||||||
|
currentFileDir = info.absolutePath();
|
||||||
|
|
||||||
|
//start reading the file and fill vars
|
||||||
|
string tempString1("");
|
||||||
|
TiXmlDocument doc(tinyFileName);
|
||||||
|
|
||||||
|
if(doc.LoadFile()) {
|
||||||
|
TiXmlHandle docHandle( &doc );
|
||||||
|
|
||||||
|
TiXmlElement* itemsList = docHandle.FirstChild( "PokerTH" ).FirstChild( "CardDeck" ).FirstChild().ToElement();
|
||||||
|
for( ; itemsList; itemsList=itemsList->NextSiblingElement()) {
|
||||||
|
const char *tmpStr1 = itemsList->Attribute("value");
|
||||||
|
if (tmpStr1) {
|
||||||
|
tempString1 = tmpStr1;
|
||||||
|
|
||||||
|
if(itemsList->ValueStr() == "StyleDescription") { StyleDescription = QString::fromUtf8(tempString1.c_str()); }
|
||||||
|
else if (itemsList->ValueStr() == "Preview") { Preview = QString::fromUtf8(tempString1.c_str()); }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
else { qDebug() << "could not load card deck file: " << tinyFileName.c_str(); }
|
||||||
|
}
|
||||||
|
|
||||||
|
QString CardDeckStyleReader::getPreview()
|
||||||
|
{
|
||||||
|
return QString(currentFileDir+"/"+Preview);
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,58 @@
|
|||||||
|
/***************************************************************************
|
||||||
|
* Copyright (C) 2009 by Felix Hammer *
|
||||||
|
* f.hammer@web.de *
|
||||||
|
* *
|
||||||
|
* This program is free software; you can redistribute it and/or modify *
|
||||||
|
* it under the terms of the GNU General Public License as published by *
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or *
|
||||||
|
* (at your option) any later version. *
|
||||||
|
* *
|
||||||
|
* This program is distributed in the hope that it will be useful, *
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||||
|
* GNU General Public License for more details. *
|
||||||
|
* *
|
||||||
|
* You should have received a copy of the GNU General Public License *
|
||||||
|
* along with this program; if not, write to the *
|
||||||
|
* Free Software Foundation, Inc., *
|
||||||
|
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||||
|
***************************************************************************/
|
||||||
|
#ifndef CARDDECKSTYLEREADER_H
|
||||||
|
#define CARDDECKSTYLEREADER_H
|
||||||
|
|
||||||
|
#include "tinyxml.h"
|
||||||
|
#include "gametableimpl.h"
|
||||||
|
#include "configfile.h"
|
||||||
|
#include <string>
|
||||||
|
#include <QtCore>
|
||||||
|
#include <QtGui>
|
||||||
|
|
||||||
|
class CardDeckStyleReader : public QObject {
|
||||||
|
Q_OBJECT
|
||||||
|
public:
|
||||||
|
CardDeckStyleReader(ConfigFile *c, gameTableImpl *w =0 );
|
||||||
|
~CardDeckStyleReader();
|
||||||
|
|
||||||
|
void readStyleFile(QString);
|
||||||
|
|
||||||
|
QString getStyleDescription() const { return StyleDescription; }
|
||||||
|
QString getCurrentFileName() const { return currentFileName; }
|
||||||
|
QString getPreview();
|
||||||
|
|
||||||
|
bool getFallBack() const { return fallBack; }
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
QString StyleDescription;
|
||||||
|
QString Preview;
|
||||||
|
|
||||||
|
QString currentFileName;
|
||||||
|
QString currentFileDir;
|
||||||
|
|
||||||
|
ConfigFile *myConfig;
|
||||||
|
gameTableImpl *myW;
|
||||||
|
|
||||||
|
bool fallBack;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -41,10 +41,7 @@ public:
|
|||||||
QString getCurrentFileName() const { return currentFileName; }
|
QString getCurrentFileName() const { return currentFileName; }
|
||||||
QString getPreview();
|
QString getPreview();
|
||||||
|
|
||||||
bool getFallBack() const { return fallBack; }
|
bool getFallBack() const { return fallBack; }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user