Add Own Flipside Option

This commit is contained in:
doitux
2007-01-28 23:33:48 +00:00
parent 20bb41240c
commit 34fd8aceef
8 changed files with 266 additions and 87 deletions
+9
View File
@@ -131,6 +131,15 @@ void ConfigFile::createDefaultConfig() {
TiXmlElement * confElement15 = new TiXmlElement( "ShowFadeOutCardsAnimation" );
config->LinkEndChild( confElement15 );
confElement15->SetAttribute("value", 1);
TiXmlElement * confElement16 = new TiXmlElement( "FlipsideTux" );
config->LinkEndChild( confElement16 );
confElement16->SetAttribute("value", 1);
TiXmlElement * confElement17 = new TiXmlElement( "FlipsideOwn" );
config->LinkEndChild( confElement17 );
confElement17->SetAttribute("value", 0);
TiXmlElement * confElement18 = new TiXmlElement( "FlipsideOwnFile" );
config->LinkEndChild( confElement18 );
confElement18->SetAttribute("value", "");
doc.SaveFile( configFileName );
+1
View File
@@ -1,6 +1,7 @@
<RCC>
<qresource prefix="/graphics" >
<file>cards/dealerbutton.png</file>
<file>graphics/fileopen16.png</file>
<file>graphics/logo-140-100.png</file>
</qresource>
<qresource prefix="/mycards" >
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

+43 -39
View File
@@ -49,7 +49,9 @@ using namespace std;
mainWindowImpl::mainWindowImpl(QMainWindow *parent, const char *name)
: QMainWindow(parent, name), actualGame(0), actualHand(0), mySession(0), maxQuantityPlayers(maxQuantityPlayersConst), gameSpeed(0), debugMode(0), breakAfterActualHand(FALSE)
{
{
int i;
// Schriftart laden
QFontDatabase::addApplicationFont ("src/gui/qt/fonts/n019003l.pfb");
QFont tmpFont("Nimbus Sans L",9);
@@ -67,110 +69,108 @@ mainWindowImpl::mainWindowImpl(QMainWindow *parent, const char *name)
setupUi(this);
//pixmapCardsLabel erstellen und ins Layout einfügen!
MyCardsPixmapLabel *pixmapLabel_cardBoard0 = new MyCardsPixmapLabel(frame_5);
pixmapLabel_cardBoard0 = new MyCardsPixmapLabel(frame_5);
pixmapLabel_cardBoard0->setObjectName(QString::fromUtf8("pixmapLabel_cardBoard0"));
pixmapLabel_cardBoard0->setMinimumSize(QSize(57, 80));
pixmapLabel_cardBoard0->setMaximumSize(QSize(57, 80));
gridLayout11->addWidget(pixmapLabel_cardBoard0, 0, 0, 1, 1);
MyCardsPixmapLabel *pixmapLabel_cardBoard1 = new MyCardsPixmapLabel(frame_5);
pixmapLabel_cardBoard1 = new MyCardsPixmapLabel(frame_5);
pixmapLabel_cardBoard1->setObjectName(QString::fromUtf8("pixmapLabel_cardBoard1"));
pixmapLabel_cardBoard1->setMinimumSize(QSize(57, 80));
pixmapLabel_cardBoard1->setMaximumSize(QSize(57, 80));
gridLayout11->addWidget(pixmapLabel_cardBoard1, 0, 1, 1, 1);
MyCardsPixmapLabel *pixmapLabel_cardBoard2 = new MyCardsPixmapLabel(frame_5);
pixmapLabel_cardBoard2 = new MyCardsPixmapLabel(frame_5);
pixmapLabel_cardBoard2->setObjectName(QString::fromUtf8("pixmapLabel_cardBoard2"));
pixmapLabel_cardBoard2->setMinimumSize(QSize(57, 80));
pixmapLabel_cardBoard2->setMaximumSize(QSize(57, 80));
gridLayout11->addWidget(pixmapLabel_cardBoard2, 0, 2, 1, 1);
MyCardsPixmapLabel *pixmapLabel_cardBoard3 = new MyCardsPixmapLabel(frame_5);
pixmapLabel_cardBoard3 = new MyCardsPixmapLabel(frame_5);
pixmapLabel_cardBoard3->setObjectName(QString::fromUtf8("pixmapLabel_cardBoard3"));
pixmapLabel_cardBoard3->setMinimumSize(QSize(57, 80));
pixmapLabel_cardBoard3->setMaximumSize(QSize(57, 80));
gridLayout11->addWidget(pixmapLabel_cardBoard3, 0, 3, 1, 1);
MyCardsPixmapLabel *pixmapLabel_cardBoard4 = new MyCardsPixmapLabel(frame_5);
pixmapLabel_cardBoard4 = new MyCardsPixmapLabel(frame_5);
pixmapLabel_cardBoard4->setObjectName(QString::fromUtf8("pixmapLabel_cardBoard4"));
pixmapLabel_cardBoard4->setMinimumSize(QSize(57, 80));
pixmapLabel_cardBoard4->setMaximumSize(QSize(57, 80));
gridLayout11->addWidget(pixmapLabel_cardBoard4, 0, 4, 1, 1);
MyCardsPixmapLabel *pixmapLabel_card0a = new MyCardsPixmapLabel(frame5);
pixmapLabel_card0a = new MyCardsPixmapLabel(frame5);
pixmapLabel_card0a->setObjectName(QString::fromUtf8("pixmapLabel_card0a"));
// QSizePolicy sizePolicy2(static_cast<QSizePolicy::Policy>(4), static_cast<QSizePolicy::Policy>(4));
// sizePolicy2.setHorizontalStretch(0);
// sizePolicy2.setVerticalStretch(0);
// sizePolicy2.setHeightForWidth(pixmapLabel_card0a->sizePolicy().hasHeightForWidth());
// pixmapLabel_card0a->setSizePolicy(sizePolicy2);
pixmapLabel_card0a->setMinimumSize(QSize(80, 112));
pixmapLabel_card0a->setMaximumSize(QSize(80, 112));
pixmapLabel_card0a->setScaledContents(true);
gridLayout2->addWidget(pixmapLabel_card0a, 0, 0, 1, 1);
MyCardsPixmapLabel *pixmapLabel_card0b = new MyCardsPixmapLabel(frame5);
pixmapLabel_card0b = new MyCardsPixmapLabel(frame5);
pixmapLabel_card0b->setObjectName(QString::fromUtf8("pixmapLabel_card0b"));
// QSizePolicy sizePolicy3(static_cast<QSizePolicy::Policy>(4), static_cast<QSizePolicy::Policy>(4));
// sizePolicy3.setHorizontalStretch(0);
// sizePolicy3.setVerticalStretch(0);
// sizePolicy3.setHeightForWidth(pixmapLabel_card0b->sizePolicy().hasHeightForWidth());
// pixmapLabel_card0b->setSizePolicy(sizePolicy3);
pixmapLabel_card0b->setMinimumSize(QSize(80, 112));
pixmapLabel_card0b->setMaximumSize(QSize(80, 112));
pixmapLabel_card0b->setScaledContents(true);
gridLayout2->addWidget(pixmapLabel_card0b, 0, 1, 1, 1);
MyCardsPixmapLabel *pixmapLabel_card1a = new MyCardsPixmapLabel(frame8_2_2_2_5);
pixmapLabel_card1a = new MyCardsPixmapLabel(frame8_2_2_2_5);
pixmapLabel_card1a->setObjectName(QString::fromUtf8("pixmapLabel_card1a"));
pixmapLabel_card1a->setMinimumSize(QSize(57, 80));
pixmapLabel_card1a->setMaximumSize(QSize(57, 80));
gridLayout18->addWidget(pixmapLabel_card1a, 0, 0, 1, 1);
MyCardsPixmapLabel *pixmapLabel_card1b = new MyCardsPixmapLabel(frame8_2_2_2_5);
pixmapLabel_card1b = new MyCardsPixmapLabel(frame8_2_2_2_5);
pixmapLabel_card1b->setObjectName(QString::fromUtf8("pixmapLabel_card1b"));
pixmapLabel_card1b->setMinimumSize(QSize(57, 80));
pixmapLabel_card1b->setMaximumSize(QSize(57, 80));
gridLayout18->addWidget(pixmapLabel_card1b, 0, 1, 1, 1);
MyCardsPixmapLabel *pixmapLabel_card2a = new MyCardsPixmapLabel(frame8_2_2_2_4);
pixmapLabel_card2a = new MyCardsPixmapLabel(frame8_2_2_2_4);
pixmapLabel_card2a->setObjectName(QString::fromUtf8("pixmapLabel_card2a"));
pixmapLabel_card2a->setMinimumSize(QSize(57, 80));
pixmapLabel_card2a->setMaximumSize(QSize(57, 80));
gridLayout24->addWidget(pixmapLabel_card2a, 0, 0, 1, 1);
MyCardsPixmapLabel *pixmapLabel_card2b = new MyCardsPixmapLabel(frame8_2_2_2_4);
pixmapLabel_card2b = new MyCardsPixmapLabel(frame8_2_2_2_4);
pixmapLabel_card2b->setObjectName(QString::fromUtf8("pixmapLabel_card2b"));
pixmapLabel_card2b->setMinimumSize(QSize(57, 80));
pixmapLabel_card2b->setMaximumSize(QSize(57, 80));
gridLayout24->addWidget(pixmapLabel_card2b, 0, 1, 1, 1);
MyCardsPixmapLabel *pixmapLabel_card3a = new MyCardsPixmapLabel(frame8_2_2_2_6);
pixmapLabel_card3a = new MyCardsPixmapLabel(frame8_2_2_2_6);
pixmapLabel_card3a->setObjectName(QString::fromUtf8("pixmapLabel_card3a"));
pixmapLabel_card3a->setMinimumSize(QSize(57, 80));
pixmapLabel_card3a->setMaximumSize(QSize(57, 80));
gridLayout30->addWidget(pixmapLabel_card3a, 0, 0, 1, 1);
MyCardsPixmapLabel *pixmapLabel_card3b = new MyCardsPixmapLabel(frame8_2_2_2_6);
pixmapLabel_card3b = new MyCardsPixmapLabel(frame8_2_2_2_6);
pixmapLabel_card3b->setObjectName(QString::fromUtf8("pixmapLabel_card3b"));
pixmapLabel_card3b->setMinimumSize(QSize(57, 80));
pixmapLabel_card3b->setMaximumSize(QSize(57, 80));
gridLayout30->addWidget(pixmapLabel_card3b, 0, 1, 1, 1);
MyCardsPixmapLabel *pixmapLabel_card4a = new MyCardsPixmapLabel(frame8_2_2_2_7);
pixmapLabel_card4a = new MyCardsPixmapLabel(frame8_2_2_2_7);
pixmapLabel_card4a->setObjectName(QString::fromUtf8("pixmapLabel_card4a"));
pixmapLabel_card4a->setMinimumSize(QSize(57, 80));
pixmapLabel_card4a->setMaximumSize(QSize(57, 80));
gridLayout36->addWidget(pixmapLabel_card4a, 0, 0, 1, 1);
MyCardsPixmapLabel *pixmapLabel_card4b = new MyCardsPixmapLabel(frame8_2_2_2_7);
pixmapLabel_card4b = new MyCardsPixmapLabel(frame8_2_2_2_7);
pixmapLabel_card4b->setObjectName(QString::fromUtf8("pixmapLabel_card4b"));
pixmapLabel_card4b->setMinimumSize(QSize(57, 80));
pixmapLabel_card4b->setMaximumSize(QSize(57, 80));
gridLayout36->addWidget(pixmapLabel_card4b, 0, 1, 1, 1);
//Flipside festlegen;
flipside = new QPixmap(":/othercards/cards/othercards/flipside.png");
if (myConfig->readConfigInt("FlipsideOwn",0) && myConfig->readConfigString("FlipsideOwnFile","") != "") {
QPixmap tmpFlipside(QString::fromStdString(myConfig->readConfigString("FlipsideOwnFile", "")));
flipside = new QPixmap(tmpFlipside.scaled(QSize(57, 80)));
}
else { flipside->load(":/othercards/cards/othercards/flipside.png"); }
int i;
//Toolbox verstecken?
if (!myConfig->readConfigInt("ShowToolBox", 1)) { groupBox_tools->hide(); }
@@ -503,6 +503,15 @@ void mainWindowImpl::callSettingsDialog() {
refreshPlayerName();
}
//Flipside refresh
if (myConfig->readConfigInt("FlipsideOwn",0) && myConfig->readConfigString("FlipsideOwnFile","") != "") {
QPixmap tmpFlipside(QString::fromStdString(myConfig->readConfigString("FlipsideOwnFile", "")));
flipside = new QPixmap(tmpFlipside.scaled(QSize(57, 80)));
}
else { flipside->load(":/othercards/cards/othercards/flipside.png"); }
pixmapLabel_card1b->repaint();
}
}
@@ -686,7 +695,6 @@ void mainWindowImpl::refreshPot() {
void mainWindowImpl::dealHoleCards() {
QPixmap flipside(":/othercards/cards/othercards/flipside.png");
QPixmap onePix(":/graphics/cards/1px.png");
//TempArrays
@@ -704,7 +712,7 @@ void mainWindowImpl::dealHoleCards() {
holeCardsArray[i][j]->setPixmap(tempCardsPixmapArray[j]);
}
else holeCardsArray[i][j]->setPixmap(flipside);
else holeCardsArray[i][j]->setPixmap(*flipside);
}
else {
@@ -742,16 +750,14 @@ void mainWindowImpl::dealFlopCards0() { dealFlopCards0Timer->start(dealCardsSpee
void mainWindowImpl::dealFlopCards1() {
QPixmap flipside(":/othercards/cards/othercards/flipside.png");
boardCardsArray[0]->setPixmap(flipside);
boardCardsArray[0]->setPixmap(*flipside);
dealFlopCards1Timer->start(dealCardsSpeed);
}
void mainWindowImpl::dealFlopCards2() {
QPixmap flipside(":/othercards/cards/othercards/flipside.png");
boardCardsArray[1]->setPixmap(flipside);
boardCardsArray[1]->setPixmap(*flipside);
dealFlopCards2Timer->start(dealCardsSpeed);
@@ -759,8 +765,8 @@ void mainWindowImpl::dealFlopCards2() {
void mainWindowImpl::dealFlopCards3() {
QPixmap flipside(":/othercards/cards/othercards/flipside.png");
boardCardsArray[2]->setPixmap(flipside);
boardCardsArray[2]->setPixmap(*flipside);
dealFlopCards3Timer->start(dealCardsSpeed);
@@ -812,8 +818,7 @@ void mainWindowImpl::dealTurnCards0() { dealTurnCards0Timer->start(dealCardsSpee
void mainWindowImpl::dealTurnCards1() {
QPixmap flipside(":/othercards/cards/othercards/flipside.png");
boardCardsArray[3]->setPixmap(flipside);
boardCardsArray[3]->setPixmap(*flipside);
dealTurnCards1Timer->start(dealCardsSpeed);
}
@@ -839,8 +844,7 @@ void mainWindowImpl::dealRiverCards0() { dealRiverCards0Timer->start(dealCardsSp
void mainWindowImpl::dealRiverCards1() {
QPixmap flipside(":/othercards/cards/othercards/flipside.png");
boardCardsArray[4]->setPixmap(flipside);
boardCardsArray[4]->setPixmap(*flipside);
// QTimer::singleShot(dealCardsSpeed, this, SLOT( dealRiverCards2() ));
dealRiverCards1Timer->start(dealCardsSpeed);
+18
View File
@@ -162,6 +162,22 @@ private:
Log *myLog;
ConfigFile *myConfig;
//MyPixmapCardsLabel
MyCardsPixmapLabel *pixmapLabel_cardBoard0;
MyCardsPixmapLabel *pixmapLabel_cardBoard1;
MyCardsPixmapLabel *pixmapLabel_cardBoard2;
MyCardsPixmapLabel *pixmapLabel_cardBoard3;
MyCardsPixmapLabel *pixmapLabel_cardBoard4;
MyCardsPixmapLabel *pixmapLabel_card0a;
MyCardsPixmapLabel *pixmapLabel_card0b;
MyCardsPixmapLabel *pixmapLabel_card1a;
MyCardsPixmapLabel *pixmapLabel_card1b;
MyCardsPixmapLabel *pixmapLabel_card2a;
MyCardsPixmapLabel *pixmapLabel_card2b;
MyCardsPixmapLabel *pixmapLabel_card3a;
MyCardsPixmapLabel *pixmapLabel_card3b;
MyCardsPixmapLabel *pixmapLabel_card4a;
MyCardsPixmapLabel *pixmapLabel_card4b;
//Timer
QTimer *potDistributeTimer;
QTimer *timer;
@@ -206,6 +222,8 @@ private:
MyCardsPixmapLabel *boardCardsArray[5];
MyCardsPixmapLabel *holeCardsArray[5][2];
QPixmap *flipside;
int maxQuantityPlayers;
int distributePotAnimCounter;
+171 -44
View File
@@ -5,8 +5,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>528</width>
<height>343</height>
<width>515</width>
<height>323</height>
</rect>
</property>
<property name="windowTitle" >
@@ -19,6 +19,16 @@
<property name="spacing" >
<number>6</number>
</property>
<item row="2" column="0" colspan="2" >
<widget class="QDialogButtonBox" name="buttonBox" >
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons" >
<set>QDialogButtonBox::Cancel|QDialogButtonBox::NoButton|QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
<item row="0" column="1" >
<widget class="QStackedWidget" name="stackedWidget" >
<property name="currentIndex" >
@@ -178,6 +188,67 @@
<number>6</number>
</property>
<item row="5" column="0" >
<widget class="QGroupBox" name="groupBox" >
<property name="title" >
<string>Flipside of Cards</string>
</property>
<layout class="QGridLayout" >
<property name="margin" >
<number>9</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item row="1" column="1" >
<widget class="QLineEdit" name="lineEdit_OwnFlipsideFilename" >
<property name="enabled" >
<bool>false</bool>
</property>
</widget>
</item>
<item row="1" column="0" >
<widget class="QRadioButton" name="radioButton_flipsideOwn" >
<property name="text" >
<string>Own Flipside Picture:</string>
</property>
</widget>
</item>
<item row="0" column="0" colspan="2" >
<widget class="QRadioButton" name="radioButton_flipsideTux" >
<property name="text" >
<string>Default (Tux)</string>
</property>
<property name="checked" >
<bool>true</bool>
</property>
</widget>
</item>
<item row="1" column="2" >
<widget class="QPushButton" name="pushButton_openFlipsidePicture" >
<property name="enabled" >
<bool>false</bool>
</property>
<property name="minimumSize" >
<size>
<width>27</width>
<height>22</height>
</size>
</property>
<property name="maximumSize" >
<size>
<width>27</width>
<height>22</height>
</size>
</property>
<property name="icon" >
<iconset resource="deck.qrc" >:/graphics/graphics/fileopen16.png</iconset>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="6" column="0" >
<spacer>
<property name="orientation" >
<enum>Qt::Vertical</enum>
@@ -190,34 +261,6 @@
</property>
</spacer>
</item>
<item row="4" column="0" >
<widget class="QCheckBox" name="checkBox_showFadeOutCardsAnimation" >
<property name="text" >
<string>Show Fade-Out Animation for Non-Winning Cards</string>
</property>
</widget>
</item>
<item row="3" column="0" >
<widget class="QCheckBox" name="checkBox_showToolbox" >
<property name="text" >
<string>Show Toolbox (F2 to switch on/off)</string>
</property>
</widget>
</item>
<item row="2" column="0" >
<widget class="QCheckBox" name="checkBox_showIntro" >
<property name="text" >
<string>Show Intro on Startup</string>
</property>
</widget>
</item>
<item row="1" column="0" >
<widget class="Line" name="line_5" >
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="0" column="0" >
<widget class="QLabel" name="label_13" >
<property name="font" >
@@ -231,6 +274,34 @@
</property>
</widget>
</item>
<item row="1" column="0" >
<widget class="Line" name="line_5" >
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="2" column="0" >
<widget class="QCheckBox" name="checkBox_showIntro" >
<property name="text" >
<string>Show Intro on Startup</string>
</property>
</widget>
</item>
<item row="3" column="0" >
<widget class="QCheckBox" name="checkBox_showToolbox" >
<property name="text" >
<string>Show Toolbox (F2 to switch on/off)</string>
</property>
</widget>
</item>
<item row="4" column="0" >
<widget class="QCheckBox" name="checkBox_showFadeOutCardsAnimation" >
<property name="text" >
<string>Show Fade-Out Animation for Non-Winning Cards</string>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="page_4" >
@@ -408,16 +479,6 @@
</property>
</widget>
</item>
<item row="2" column="0" colspan="2" >
<widget class="QDialogButtonBox" name="buttonBox" >
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons" >
<set>QDialogButtonBox::Cancel|QDialogButtonBox::NoButton|QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
</layout>
</widget>
<tabstops>
@@ -434,7 +495,9 @@
<tabstop>lineEdit_Opponent3Name</tabstop>
<tabstop>lineEdit_Opponent4Name</tabstop>
</tabstops>
<resources/>
<resources>
<include location="deck.qrc" />
</resources>
<connections>
<connection>
<sender>buttonBox</sender>
@@ -444,7 +507,7 @@
<hints>
<hint type="sourcelabel" >
<x>295</x>
<y>322</y>
<y>302</y>
</hint>
<hint type="destinationlabel" >
<x>286</x>
@@ -476,7 +539,7 @@
<hints>
<hint type="sourcelabel" >
<x>243</x>
<y>315</y>
<y>295</y>
</hint>
<hint type="destinationlabel" >
<x>243</x>
@@ -492,7 +555,7 @@
<hints>
<hint type="sourcelabel" >
<x>243</x>
<y>315</y>
<y>295</y>
</hint>
<hint type="destinationlabel" >
<x>243</x>
@@ -500,5 +563,69 @@
</hint>
</hints>
</connection>
<connection>
<sender>radioButton_flipsideTux</sender>
<signal>clicked(bool)</signal>
<receiver>lineEdit_OwnFlipsideFilename</receiver>
<slot>setDisabled(bool)</slot>
<hints>
<hint type="sourcelabel" >
<x>209</x>
<y>170</y>
</hint>
<hint type="destinationlabel" >
<x>353</x>
<y>205</y>
</hint>
</hints>
</connection>
<connection>
<sender>radioButton_flipsideOwn</sender>
<signal>clicked(bool)</signal>
<receiver>lineEdit_OwnFlipsideFilename</receiver>
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel" >
<x>220</x>
<y>210</y>
</hint>
<hint type="destinationlabel" >
<x>429</x>
<y>207</y>
</hint>
</hints>
</connection>
<connection>
<sender>radioButton_flipsideTux</sender>
<signal>clicked(bool)</signal>
<receiver>pushButton_openFlipsidePicture</receiver>
<slot>setDisabled(bool)</slot>
<hints>
<hint type="sourcelabel" >
<x>345</x>
<y>173</y>
</hint>
<hint type="destinationlabel" >
<x>474</x>
<y>194</y>
</hint>
</hints>
</connection>
<connection>
<sender>radioButton_flipsideOwn</sender>
<signal>clicked(bool)</signal>
<receiver>pushButton_openFlipsidePicture</receiver>
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel" >
<x>199</x>
<y>208</y>
</hint>
<hint type="destinationlabel" >
<x>463</x>
<y>201</y>
</hint>
</hints>
</connection>
</connections>
</ui>
+18
View File
@@ -53,6 +53,9 @@ settingsDialogImpl::settingsDialogImpl(QWidget *parent, const char *name)
checkBox_showToolbox->setChecked(myConfig.readConfigInt("ShowToolBox", 1));
checkBox_showIntro->setChecked(myConfig.readConfigInt("ShowIntro", 1));
checkBox_showFadeOutCardsAnimation->setChecked(myConfig.readConfigInt("ShowFadeOutCardsAnimation", 1));
radioButton_flipsideTux->setChecked(myConfig.readConfigInt("FlipsideTux", 1));
radioButton_flipsideOwn->setChecked(myConfig.readConfigInt("FlipsideOwn", 0));
lineEdit_OwnFlipsideFilename->setText(QString::fromStdString(myConfig.readConfigString("FlipsideOwnFile", "")));
connect( buttonBox, SIGNAL( accepted() ), this, SLOT( isAccepted() ) );
connect( lineEdit_humanPlayerName, SIGNAL( textChanged( const QString &) ), this, SLOT( playerNickChanged() ) );
@@ -60,6 +63,8 @@ settingsDialogImpl::settingsDialogImpl(QWidget *parent, const char *name)
connect( lineEdit_Opponent2Name, SIGNAL( textChanged(const QString &) ), this, SLOT( playerNickChanged() ) );
connect( lineEdit_Opponent3Name, SIGNAL( textChanged(const QString &) ), this, SLOT( playerNickChanged() ) );
connect( lineEdit_Opponent4Name, SIGNAL( textChanged(const QString &) ), this, SLOT( playerNickChanged() ) );
connect( pushButton_openFlipsidePicture, SIGNAL( clicked() ), this, SLOT( setFlipsidePicFileName()) );
}
@@ -89,5 +94,18 @@ void settingsDialogImpl::isAccepted() {
myConfig.writeConfigInt("ShowToolBox", checkBox_showToolbox->isChecked());
myConfig.writeConfigInt("ShowIntro", checkBox_showIntro->isChecked());
myConfig.writeConfigInt("ShowFadeOutCardsAnimation", checkBox_showFadeOutCardsAnimation->isChecked());
myConfig.writeConfigInt("FlipsideTux", radioButton_flipsideTux->isChecked());
myConfig.writeConfigInt("FlipsideOwn", radioButton_flipsideOwn->isChecked());
myConfig.writeConfigString("FlipsideOwnFile", lineEdit_OwnFlipsideFilename->text().toStdString());
}
void settingsDialogImpl::setFlipsidePicFileName()
{
QString fileName = QFileDialog::getOpenFileName(this, tr("Select your Flipside Picture"),
QDir::homePath(),
tr("Images (*.png *.xpm *.jpg)"));
if (!fileName.isEmpty())
lineEdit_OwnFlipsideFilename->setText(fileName);
}
+6 -4
View File
@@ -22,7 +22,8 @@
#include "ui_settingsdialog.h"
class QLineEdit;
#include <QtCore>
#include <QtGui>
class settingsDialogImpl: public QDialog, public Ui::settingsDialog {
@@ -30,16 +31,17 @@ Q_OBJECT
public:
settingsDialogImpl(QWidget *parent = 0, const char *name = 0);
void setPlayerNickIsChanged(bool theValue) { playerNickIsChanged = theValue; }
bool getPlayerNickIsChanged() const { return playerNickIsChanged; }
void setPlayerNickIsChanged(bool theValue){ playerNickIsChanged = theValue;}
bool getPlayerNickIsChanged() const{ return playerNickIsChanged;}
public slots:
void isAccepted();
void playerNickChanged() { setPlayerNickIsChanged(TRUE); };
void setFlipsidePicFileName();
private:
bool playerNickIsChanged;
};