This commit is contained in:
@@ -33,7 +33,7 @@ QString ConfigFile::readConfig(QString varName, QString defaultvalue)
|
|||||||
{
|
{
|
||||||
|
|
||||||
QDir configDir;
|
QDir configDir;
|
||||||
configDir.setPath(QDir::home().absPath()+"/.pokerth/config/");
|
configDir.setPath(QDir::home().absPath()+"/.pokerth/");
|
||||||
|
|
||||||
QFile configFile (configDir.absPath()+"/pokerth.conf");
|
QFile configFile (configDir.absPath()+"/pokerth.conf");
|
||||||
|
|
||||||
@@ -48,13 +48,14 @@ QString ConfigFile::readConfig(QString varName, QString defaultvalue)
|
|||||||
stream << "\n";
|
stream << "\n";
|
||||||
stream << "numberofplayers=5\n";
|
stream << "numberofplayers=5\n";
|
||||||
stream << "startcash=2000\n";
|
stream << "startcash=2000\n";
|
||||||
stream << "smallblind=2000\n";
|
stream << "smallblind=10\n";
|
||||||
stream << "gamespeed=4\n";
|
stream << "gamespeed=4\n";
|
||||||
|
stream << "showgamesettingsdialogonnewgame=1\n";
|
||||||
stream << "myname=Human Player\n";
|
stream << "myname=Human Player\n";
|
||||||
stream << "player1=Player 1\n";
|
stream << "oppponent1name=Player 1\n";
|
||||||
stream << "player2=Player 2\n";
|
stream << "oppponent2name=Player 2\n";
|
||||||
stream << "player3=Player 3\n";
|
stream << "oppponent3name=Player 3\n";
|
||||||
stream << "player4=Player 4\n";
|
stream << "oppponent4name=Player 4\n";
|
||||||
configFile.close();
|
configFile.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -116,7 +117,7 @@ QString ConfigFile::readConfig(QString varName, QString defaultvalue)
|
|||||||
void ConfigFile::writeConfig(QString setVarName, QString setVarCont)
|
void ConfigFile::writeConfig(QString setVarName, QString setVarCont)
|
||||||
{
|
{
|
||||||
QDir configDir;
|
QDir configDir;
|
||||||
configDir.setPath(QDir::home().absPath()+"/.pokerth/config/");
|
configDir.setPath(QDir::home().absPath()+"/.pokerth/");
|
||||||
QFile configFile (configDir.absPath()+"/pokerth.conf");
|
QFile configFile (configDir.absPath()+"/pokerth.conf");
|
||||||
|
|
||||||
QStringList lines;
|
QStringList lines;
|
||||||
|
|||||||
@@ -51,6 +51,14 @@ mainWindowImpl::mainWindowImpl(QMainWindow *parent, const char *name)
|
|||||||
QFont tmpFont("Nimbus Sans L",9);
|
QFont tmpFont("Nimbus Sans L",9);
|
||||||
QApplication::setFont(tmpFont);
|
QApplication::setFont(tmpFont);
|
||||||
|
|
||||||
|
// Programmverzeichnis erstellen
|
||||||
|
QDir progDir1;
|
||||||
|
QDir progDir2;
|
||||||
|
progDir1.setPath(QDir::home().absPath()+"/.pokerth/");
|
||||||
|
|
||||||
|
if ( !progDir1.exists() ) { progDir1.mkdir(progDir1.absPath()); }
|
||||||
|
|
||||||
|
|
||||||
setupUi(this);
|
setupUi(this);
|
||||||
|
|
||||||
int i;
|
int i;
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
#include "newgamedialogimpl.h"
|
#include "newgamedialogimpl.h"
|
||||||
|
#include "configfile.h"
|
||||||
|
|
||||||
newGameDialogImpl::newGameDialogImpl(QWidget *parent, const char *name)
|
newGameDialogImpl::newGameDialogImpl(QWidget *parent, const char *name)
|
||||||
: QDialog(parent, name)
|
: QDialog(parent, name)
|
||||||
@@ -25,5 +26,17 @@ newGameDialogImpl::newGameDialogImpl(QWidget *parent, const char *name)
|
|||||||
|
|
||||||
setupUi(this);
|
setupUi(this);
|
||||||
|
|
||||||
|
//Formulare Füllen
|
||||||
|
ConfigFile config;
|
||||||
|
|
||||||
|
bool ok=TRUE;
|
||||||
|
|
||||||
|
//Game Settings
|
||||||
|
spinBox_quantityPlayers->setValue(config.readConfig("numberofplayers", "5").toInt(&ok,10));
|
||||||
|
spinBox_startCash->setValue(config.readConfig("startcash", "2000").toInt(&ok,10));
|
||||||
|
spinBox_smallBlind->setValue(config.readConfig("smallblind", "10").toInt(&ok,10));
|
||||||
|
spinBox_gameSpeed->setValue(config.readConfig("gamespeed", "4").toInt(&ok,10));
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+310
-338
@@ -12,349 +12,321 @@
|
|||||||
<property name="windowTitle" >
|
<property name="windowTitle" >
|
||||||
<string>PokerTH - Settings</string>
|
<string>PokerTH - Settings</string>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QListWidget" name="listWidget" >
|
<layout class="QGridLayout" >
|
||||||
<property name="geometry" >
|
<property name="margin" >
|
||||||
<rect>
|
<number>9</number>
|
||||||
<x>9</x>
|
|
||||||
<y>9</y>
|
|
||||||
<width>150</width>
|
|
||||||
<height>279</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
</property>
|
||||||
<property name="maximumSize" >
|
<property name="spacing" >
|
||||||
<size>
|
<number>6</number>
|
||||||
<width>150</width>
|
|
||||||
<height>16777215</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
</property>
|
||||||
<item>
|
<item row="2" column="0" colspan="2" >
|
||||||
<property name="text" >
|
<widget class="QDialogButtonBox" name="buttonBox" >
|
||||||
<string>Game Settings</string>
|
<property name="orientation" >
|
||||||
</property>
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="standardButtons" >
|
||||||
|
<set>QDialogButtonBox::Cancel|QDialogButtonBox::NoButton|QDialogButtonBox::Ok</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item row="0" column="0" >
|
||||||
<property name="text" >
|
<widget class="QListWidget" name="listWidget" >
|
||||||
<string>Log</string>
|
<property name="maximumSize" >
|
||||||
</property>
|
<size>
|
||||||
|
<width>150</width>
|
||||||
|
<height>16777215</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<item>
|
||||||
|
<property name="text" >
|
||||||
|
<string>Game Settings</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text" >
|
||||||
|
<string>Log</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text" >
|
||||||
|
<string>Player Nicks</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item row="0" column="1" >
|
||||||
<property name="text" >
|
<widget class="QStackedWidget" name="stackedWidget" >
|
||||||
<string>Player Nicks</string>
|
<property name="currentIndex" >
|
||||||
</property>
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<widget class="QWidget" name="page" >
|
||||||
|
<layout class="QGridLayout" >
|
||||||
|
<property name="margin" >
|
||||||
|
<number>9</number>
|
||||||
|
</property>
|
||||||
|
<property name="spacing" >
|
||||||
|
<number>6</number>
|
||||||
|
</property>
|
||||||
|
<item row="7" column="0" >
|
||||||
|
<spacer>
|
||||||
|
<property name="orientation" >
|
||||||
|
<enum>Qt::Vertical</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" >
|
||||||
|
<size>
|
||||||
|
<width>20</width>
|
||||||
|
<height>40</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item row="6" column="0" colspan="2" >
|
||||||
|
<widget class="QCheckBox" name="checkBox_showGameSettingsDialogOnNewGame" >
|
||||||
|
<property name="text" >
|
||||||
|
<string>show game settings dialog on every new game</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="3" column="0" >
|
||||||
|
<widget class="QLabel" name="label_2" >
|
||||||
|
<property name="text" >
|
||||||
|
<string>Start Cash</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="4" column="1" >
|
||||||
|
<widget class="QSpinBox" name="spinBox_smallBlind" >
|
||||||
|
<property name="maximum" >
|
||||||
|
<number>500</number>
|
||||||
|
</property>
|
||||||
|
<property name="minimum" >
|
||||||
|
<number>5</number>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="5" column="0" >
|
||||||
|
<widget class="QLabel" name="label" >
|
||||||
|
<property name="text" >
|
||||||
|
<string>Game-Speed</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="3" column="1" >
|
||||||
|
<widget class="QSpinBox" name="spinBox_startCash" >
|
||||||
|
<property name="maximum" >
|
||||||
|
<number>5000</number>
|
||||||
|
</property>
|
||||||
|
<property name="minimum" >
|
||||||
|
<number>1000</number>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="4" column="0" >
|
||||||
|
<widget class="QLabel" name="label_3" >
|
||||||
|
<property name="text" >
|
||||||
|
<string>Small Blind</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="5" column="1" >
|
||||||
|
<widget class="QSpinBox" name="spinBox_gameSpeed" >
|
||||||
|
<property name="maximum" >
|
||||||
|
<number>11</number>
|
||||||
|
</property>
|
||||||
|
<property name="minimum" >
|
||||||
|
<number>1</number>
|
||||||
|
</property>
|
||||||
|
<property name="singleStep" >
|
||||||
|
<number>1</number>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="1" >
|
||||||
|
<widget class="QSpinBox" name="spinBox_quantityPlayers" >
|
||||||
|
<property name="maximum" >
|
||||||
|
<number>5</number>
|
||||||
|
</property>
|
||||||
|
<property name="minimum" >
|
||||||
|
<number>2</number>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="0" >
|
||||||
|
<widget class="QLabel" name="label_4" >
|
||||||
|
<property name="text" >
|
||||||
|
<string>Number of Players</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="0" colspan="2" >
|
||||||
|
<widget class="Line" name="line_3" >
|
||||||
|
<property name="orientation" >
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="0" colspan="2" >
|
||||||
|
<widget class="QLabel" name="label_5" >
|
||||||
|
<property name="font" >
|
||||||
|
<font>
|
||||||
|
<weight>75</weight>
|
||||||
|
<bold>true</bold>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
|
<property name="text" >
|
||||||
|
<string>Game Settings</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
<widget class="QWidget" name="page_3" >
|
||||||
|
<layout class="QGridLayout" >
|
||||||
|
<property name="margin" >
|
||||||
|
<number>9</number>
|
||||||
|
</property>
|
||||||
|
<property name="spacing" >
|
||||||
|
<number>6</number>
|
||||||
|
</property>
|
||||||
|
<item row="2" column="0" >
|
||||||
|
<spacer>
|
||||||
|
<property name="orientation" >
|
||||||
|
<enum>Qt::Vertical</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" >
|
||||||
|
<size>
|
||||||
|
<width>20</width>
|
||||||
|
<height>40</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="0" >
|
||||||
|
<widget class="Line" name="line_2" >
|
||||||
|
<property name="orientation" >
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="0" >
|
||||||
|
<widget class="QLabel" name="label_6" >
|
||||||
|
<property name="font" >
|
||||||
|
<font>
|
||||||
|
<weight>75</weight>
|
||||||
|
<bold>true</bold>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
|
<property name="text" >
|
||||||
|
<string>Log Settings</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
<widget class="QWidget" name="page_4" >
|
||||||
|
<layout class="QGridLayout" >
|
||||||
|
<property name="margin" >
|
||||||
|
<number>9</number>
|
||||||
|
</property>
|
||||||
|
<property name="spacing" >
|
||||||
|
<number>6</number>
|
||||||
|
</property>
|
||||||
|
<item row="0" column="0" colspan="2" >
|
||||||
|
<widget class="QLabel" name="label_7" >
|
||||||
|
<property name="font" >
|
||||||
|
<font>
|
||||||
|
<weight>75</weight>
|
||||||
|
<bold>true</bold>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
|
<property name="text" >
|
||||||
|
<string>Player Nicks</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="7" column="0" colspan="2" >
|
||||||
|
<spacer>
|
||||||
|
<property name="orientation" >
|
||||||
|
<enum>Qt::Vertical</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" >
|
||||||
|
<size>
|
||||||
|
<width>295</width>
|
||||||
|
<height>51</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="0" >
|
||||||
|
<widget class="QLabel" name="label_8" >
|
||||||
|
<property name="text" >
|
||||||
|
<string>Human Player:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="4" column="0" >
|
||||||
|
<widget class="QLabel" name="label_10" >
|
||||||
|
<property name="text" >
|
||||||
|
<string>Opponent 2:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="6" column="0" >
|
||||||
|
<widget class="QLabel" name="label_12" >
|
||||||
|
<property name="text" >
|
||||||
|
<string>Opponent 4:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="5" column="0" >
|
||||||
|
<widget class="QLabel" name="label_11" >
|
||||||
|
<property name="text" >
|
||||||
|
<string>Opponent 3:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="3" column="0" >
|
||||||
|
<widget class="QLabel" name="label_9" >
|
||||||
|
<property name="text" >
|
||||||
|
<string>Opponent 1:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="6" column="1" >
|
||||||
|
<widget class="QLineEdit" name="lineEdit_Opponent4Name" />
|
||||||
|
</item>
|
||||||
|
<item row="5" column="1" >
|
||||||
|
<widget class="QLineEdit" name="lineEdit_Opponent3Name" />
|
||||||
|
</item>
|
||||||
|
<item row="4" column="1" >
|
||||||
|
<widget class="QLineEdit" name="lineEdit_Opponent2Name" />
|
||||||
|
</item>
|
||||||
|
<item row="3" column="1" >
|
||||||
|
<widget class="QLineEdit" name="lineEdit_Opponent1Name" />
|
||||||
|
</item>
|
||||||
|
<item row="2" column="1" >
|
||||||
|
<widget class="QLineEdit" name="lineEdit_humanPlayerName" />
|
||||||
|
</item>
|
||||||
|
<item row="1" column="0" colspan="2" >
|
||||||
|
<widget class="Line" name="line_4" >
|
||||||
|
<property name="orientation" >
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
<widget class="QWidget" name="page_2" />
|
||||||
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</widget>
|
<item row="1" column="0" colspan="2" >
|
||||||
<widget class="Line" name="line" >
|
<widget class="Line" name="line" >
|
||||||
<property name="geometry" >
|
<property name="orientation" >
|
||||||
<rect>
|
<enum>Qt::Horizontal</enum>
|
||||||
<x>9</x>
|
|
||||||
<y>294</y>
|
|
||||||
<width>469</width>
|
|
||||||
<height>16</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="orientation" >
|
|
||||||
<enum>Qt::Horizontal</enum>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
<widget class="QDialogButtonBox" name="buttonBox" >
|
|
||||||
<property name="geometry" >
|
|
||||||
<rect>
|
|
||||||
<x>9</x>
|
|
||||||
<y>303</y>
|
|
||||||
<width>469</width>
|
|
||||||
<height>27</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="orientation" >
|
|
||||||
<enum>Qt::Horizontal</enum>
|
|
||||||
</property>
|
|
||||||
<property name="standardButtons" >
|
|
||||||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::NoButton|QDialogButtonBox::Ok</set>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
<widget class="QStackedWidget" name="stackedWidget" >
|
|
||||||
<property name="geometry" >
|
|
||||||
<rect>
|
|
||||||
<x>165</x>
|
|
||||||
<y>9</y>
|
|
||||||
<width>313</width>
|
|
||||||
<height>256</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="currentIndex" >
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<widget class="QWidget" name="page" >
|
|
||||||
<layout class="QGridLayout" >
|
|
||||||
<property name="margin" >
|
|
||||||
<number>9</number>
|
|
||||||
</property>
|
</property>
|
||||||
<property name="spacing" >
|
</widget>
|
||||||
<number>6</number>
|
</item>
|
||||||
</property>
|
</layout>
|
||||||
<item row="7" column="0" >
|
|
||||||
<spacer>
|
|
||||||
<property name="orientation" >
|
|
||||||
<enum>Qt::Vertical</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" >
|
|
||||||
<size>
|
|
||||||
<width>20</width>
|
|
||||||
<height>40</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
<item row="6" column="0" colspan="2" >
|
|
||||||
<widget class="QCheckBox" name="checkBox" >
|
|
||||||
<property name="text" >
|
|
||||||
<string>show game settings dialog on every new game</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="3" column="0" >
|
|
||||||
<widget class="QLabel" name="label_2" >
|
|
||||||
<property name="text" >
|
|
||||||
<string>Start Cash</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="4" column="1" >
|
|
||||||
<widget class="QSpinBox" name="spinBox_smallBlind" >
|
|
||||||
<property name="maximum" >
|
|
||||||
<number>500</number>
|
|
||||||
</property>
|
|
||||||
<property name="minimum" >
|
|
||||||
<number>5</number>
|
|
||||||
</property>
|
|
||||||
<property name="value" >
|
|
||||||
<number>10</number>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="5" column="0" >
|
|
||||||
<widget class="QLabel" name="label" >
|
|
||||||
<property name="text" >
|
|
||||||
<string>Game-Speed</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="3" column="1" >
|
|
||||||
<widget class="QSpinBox" name="spinBox_startCash" >
|
|
||||||
<property name="maximum" >
|
|
||||||
<number>5000</number>
|
|
||||||
</property>
|
|
||||||
<property name="minimum" >
|
|
||||||
<number>1000</number>
|
|
||||||
</property>
|
|
||||||
<property name="value" >
|
|
||||||
<number>2000</number>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="4" column="0" >
|
|
||||||
<widget class="QLabel" name="label_3" >
|
|
||||||
<property name="text" >
|
|
||||||
<string>Small Blind</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="5" column="1" >
|
|
||||||
<widget class="QSpinBox" name="spinBox_gameSpeed" >
|
|
||||||
<property name="maximum" >
|
|
||||||
<number>11</number>
|
|
||||||
</property>
|
|
||||||
<property name="minimum" >
|
|
||||||
<number>1</number>
|
|
||||||
</property>
|
|
||||||
<property name="singleStep" >
|
|
||||||
<number>1</number>
|
|
||||||
</property>
|
|
||||||
<property name="value" >
|
|
||||||
<number>4</number>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="2" column="1" >
|
|
||||||
<widget class="QSpinBox" name="spinBox_quantityPlayers" >
|
|
||||||
<property name="maximum" >
|
|
||||||
<number>5</number>
|
|
||||||
</property>
|
|
||||||
<property name="minimum" >
|
|
||||||
<number>2</number>
|
|
||||||
</property>
|
|
||||||
<property name="value" >
|
|
||||||
<number>5</number>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="2" column="0" >
|
|
||||||
<widget class="QLabel" name="label_4" >
|
|
||||||
<property name="text" >
|
|
||||||
<string>Number of Players</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="0" colspan="2" >
|
|
||||||
<widget class="Line" name="line_3" >
|
|
||||||
<property name="orientation" >
|
|
||||||
<enum>Qt::Horizontal</enum>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="0" colspan="2" >
|
|
||||||
<widget class="QLabel" name="label_5" >
|
|
||||||
<property name="font" >
|
|
||||||
<font>
|
|
||||||
<weight>75</weight>
|
|
||||||
<bold>true</bold>
|
|
||||||
</font>
|
|
||||||
</property>
|
|
||||||
<property name="text" >
|
|
||||||
<string>Default Game Settings</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
<widget class="QWidget" name="page_3" >
|
|
||||||
<layout class="QGridLayout" >
|
|
||||||
<property name="margin" >
|
|
||||||
<number>9</number>
|
|
||||||
</property>
|
|
||||||
<property name="spacing" >
|
|
||||||
<number>6</number>
|
|
||||||
</property>
|
|
||||||
<item row="2" column="0" >
|
|
||||||
<spacer>
|
|
||||||
<property name="orientation" >
|
|
||||||
<enum>Qt::Vertical</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" >
|
|
||||||
<size>
|
|
||||||
<width>20</width>
|
|
||||||
<height>40</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="0" >
|
|
||||||
<widget class="Line" name="line_2" >
|
|
||||||
<property name="orientation" >
|
|
||||||
<enum>Qt::Horizontal</enum>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="0" >
|
|
||||||
<widget class="QLabel" name="label_6" >
|
|
||||||
<property name="font" >
|
|
||||||
<font>
|
|
||||||
<weight>75</weight>
|
|
||||||
<bold>true</bold>
|
|
||||||
</font>
|
|
||||||
</property>
|
|
||||||
<property name="text" >
|
|
||||||
<string>Log Settings</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
<widget class="QWidget" name="page_4" >
|
|
||||||
<layout class="QGridLayout" >
|
|
||||||
<property name="margin" >
|
|
||||||
<number>9</number>
|
|
||||||
</property>
|
|
||||||
<property name="spacing" >
|
|
||||||
<number>6</number>
|
|
||||||
</property>
|
|
||||||
<item row="0" column="0" colspan="2" >
|
|
||||||
<widget class="QLabel" name="label_7" >
|
|
||||||
<property name="font" >
|
|
||||||
<font>
|
|
||||||
<weight>75</weight>
|
|
||||||
<bold>true</bold>
|
|
||||||
</font>
|
|
||||||
</property>
|
|
||||||
<property name="text" >
|
|
||||||
<string>Player Nicks</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="7" column="0" colspan="2" >
|
|
||||||
<spacer>
|
|
||||||
<property name="orientation" >
|
|
||||||
<enum>Qt::Vertical</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" >
|
|
||||||
<size>
|
|
||||||
<width>295</width>
|
|
||||||
<height>51</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
<item row="2" column="0" >
|
|
||||||
<widget class="QLabel" name="label_8" >
|
|
||||||
<property name="text" >
|
|
||||||
<string>Human Player:</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="4" column="0" >
|
|
||||||
<widget class="QLabel" name="label_10" >
|
|
||||||
<property name="text" >
|
|
||||||
<string>Opponent 2:</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="6" column="0" >
|
|
||||||
<widget class="QLabel" name="label_12" >
|
|
||||||
<property name="text" >
|
|
||||||
<string>Opponent 4:</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="5" column="0" >
|
|
||||||
<widget class="QLabel" name="label_11" >
|
|
||||||
<property name="text" >
|
|
||||||
<string>Opponent 3:</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="3" column="0" >
|
|
||||||
<widget class="QLabel" name="label_9" >
|
|
||||||
<property name="text" >
|
|
||||||
<string>Opponent 1:</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="6" column="1" >
|
|
||||||
<widget class="QLineEdit" name="lineEdit_3" />
|
|
||||||
</item>
|
|
||||||
<item row="5" column="1" >
|
|
||||||
<widget class="QLineEdit" name="lineEdit_5" />
|
|
||||||
</item>
|
|
||||||
<item row="4" column="1" >
|
|
||||||
<widget class="QLineEdit" name="lineEdit_4" />
|
|
||||||
</item>
|
|
||||||
<item row="3" column="1" >
|
|
||||||
<widget class="QLineEdit" name="lineEdit_2" />
|
|
||||||
</item>
|
|
||||||
<item row="2" column="1" >
|
|
||||||
<widget class="QLineEdit" name="lineEdit" />
|
|
||||||
</item>
|
|
||||||
<item row="1" column="0" colspan="2" >
|
|
||||||
<widget class="Line" name="line_4" >
|
|
||||||
<property name="orientation" >
|
|
||||||
<enum>Qt::Horizontal</enum>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
<widget class="QWidget" name="page_2" />
|
|
||||||
</widget>
|
|
||||||
</widget>
|
</widget>
|
||||||
<resources/>
|
<resources/>
|
||||||
<connections>
|
<connections>
|
||||||
@@ -362,7 +334,7 @@
|
|||||||
<sender>buttonBox</sender>
|
<sender>buttonBox</sender>
|
||||||
<signal>accepted()</signal>
|
<signal>accepted()</signal>
|
||||||
<receiver>settingsDialog</receiver>
|
<receiver>settingsDialog</receiver>
|
||||||
<slot>accept()</slot>
|
<slot>hide()</slot>
|
||||||
<hints>
|
<hints>
|
||||||
<hint type="sourcelabel" >
|
<hint type="sourcelabel" >
|
||||||
<x>227</x>
|
<x>227</x>
|
||||||
|
|||||||
@@ -18,6 +18,9 @@
|
|||||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
#include "settingsdialogimpl.h"
|
#include "settingsdialogimpl.h"
|
||||||
|
#include "configfile.h"
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
|
|
||||||
settingsDialogImpl::settingsDialogImpl(QWidget *parent, const char *name)
|
settingsDialogImpl::settingsDialogImpl(QWidget *parent, const char *name)
|
||||||
: QDialog(parent, name)
|
: QDialog(parent, name)
|
||||||
@@ -25,4 +28,50 @@ settingsDialogImpl::settingsDialogImpl(QWidget *parent, const char *name)
|
|||||||
|
|
||||||
setupUi(this);
|
setupUi(this);
|
||||||
|
|
||||||
|
//Formulare Füllen
|
||||||
|
ConfigFile config;
|
||||||
|
|
||||||
|
bool ok=TRUE;
|
||||||
|
|
||||||
|
//Player Nicks
|
||||||
|
lineEdit_humanPlayerName->setText(config.readConfig("myname", "Human Player"));
|
||||||
|
lineEdit_Opponent1Name->setText(config.readConfig("oppponent1name", "Player 1"));
|
||||||
|
lineEdit_Opponent2Name->setText(config.readConfig("oppponent2name", "Player 2"));
|
||||||
|
lineEdit_Opponent3Name->setText(config.readConfig("oppponent3name", "Player 3"));
|
||||||
|
lineEdit_Opponent4Name->setText(config.readConfig("oppponent4name", "Player 4"));
|
||||||
|
|
||||||
|
//Game Settings
|
||||||
|
spinBox_quantityPlayers->setValue(config.readConfig("numberofplayers", "5").toInt(&ok,10));
|
||||||
|
spinBox_startCash->setValue(config.readConfig("startcash", "2000").toInt(&ok,10));
|
||||||
|
spinBox_smallBlind->setValue(config.readConfig("smallblind", "10").toInt(&ok,10));
|
||||||
|
spinBox_gameSpeed->setValue(config.readConfig("gamespeed", "4").toInt(&ok,10));
|
||||||
|
checkBox_showGameSettingsDialogOnNewGame->setChecked(config.readConfig("showgamesettingsdialogonnewgame", "1").toInt(&ok,10));
|
||||||
|
|
||||||
|
|
||||||
|
connect( buttonBox, SIGNAL( accepted() ), this, SLOT( accept() ) );
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void settingsDialogImpl::accept() {
|
||||||
|
|
||||||
|
std::cout << "wursst" << "\n";
|
||||||
|
|
||||||
|
//Daten speichern
|
||||||
|
ConfigFile config;
|
||||||
|
|
||||||
|
//Player Nicks
|
||||||
|
config.writeConfig("myname", lineEdit_humanPlayerName->text());
|
||||||
|
config.writeConfig("oppponent1name", lineEdit_Opponent1Name->text());
|
||||||
|
config.writeConfig("oppponent2name", lineEdit_Opponent2Name->text());
|
||||||
|
config.writeConfig("oppponent3name", lineEdit_Opponent3Name->text());
|
||||||
|
config.writeConfig("oppponent4name", lineEdit_Opponent4Name->text());
|
||||||
|
|
||||||
|
//Game Settings
|
||||||
|
config.writeConfig("numberofplayers", QString::number(spinBox_quantityPlayers->value(),10));
|
||||||
|
config.writeConfig("startcash", QString::number(spinBox_startCash->value(),10));
|
||||||
|
config.writeConfig("smallblind", QString::number(spinBox_smallBlind->value(),10));
|
||||||
|
config.writeConfig("gamespeed", QString::number(spinBox_gameSpeed->value(),10));
|
||||||
|
config.writeConfig("showgamesettingsdialogonnewgame", QString::number(checkBox_showGameSettingsDialogOnNewGame->isChecked(),10));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,6 +27,10 @@ class settingsDialogImpl: public QDialog, public Ui::settingsDialog {
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
settingsDialogImpl(QWidget *parent = 0, const char *name = 0);
|
settingsDialogImpl(QWidget *parent = 0, const char *name = 0);
|
||||||
|
|
||||||
|
public slots:
|
||||||
|
|
||||||
|
void accept();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user