settings gui added

This commit is contained in:
doitux
2007-01-17 01:22:55 +00:00
parent 46888b1277
commit 997af59e67
7 changed files with 375 additions and 1 deletions
+4 -1
View File
@@ -8,10 +8,12 @@ TARGET.files += bin/*
TARGET.path = /usr/bin/
FORMS += mainwindow.ui \
aboutpokerth.ui \
newgamedialog.ui
newgamedialog.ui \
settingsdialog.ui
HEADERS += mainwindowimpl.h \
newgamedialogimpl.h \
aboutpokerthimpl.h \
settingsdialogimpl.h \
log.h \
guiinterface.h \
guiwrapper.h \
@@ -40,6 +42,7 @@ SOURCES += pokerth.cpp \
mainwindowimpl.cpp \
newgamedialogimpl.cpp \
aboutpokerthimpl.cpp \
settingsdialogimpl.cpp \
log.cpp \
guiinterface.cpp \
guiwrapper.cpp \
+6
View File
@@ -4114,6 +4114,7 @@
<string>Game</string>
</property>
<addaction name="actionNewGame" />
<addaction name="actionSettings" />
<addaction name="actionAboutPokerth" />
<addaction name="actionQuit" />
</widget>
@@ -4135,6 +4136,11 @@
<string>About PokerTH ...</string>
</property>
</action>
<action name="actionSettings" >
<property name="text" >
<string>Settings ...</string>
</property>
</action>
</widget>
<customwidgets>
<customwidget>
+7
View File
@@ -21,6 +21,7 @@
#include "newgamedialogimpl.h"
#include "aboutpokerthimpl.h"
#include "settingsdialogimpl.h"
#include "handinterface.h"
#include "playerinterface.h"
@@ -155,6 +156,7 @@ mainWindowImpl::mainWindowImpl(QMainWindow *parent, const char *name)
connect( actionNewGame, SIGNAL( activated() ), this, SLOT( callNewGameDialog() ) );
connect( actionAboutPokerth, SIGNAL( activated() ), this, SLOT( callAboutPokerthDialog() ) );
connect( actionSettings, SIGNAL( activated() ), this, SLOT( callSettingsDialog() ) );
connect( actionQuit, SIGNAL( activated() ), qApp, SLOT( quit() ) );
connect( pushButton_raise, SIGNAL( clicked() ), this, SLOT( myRaise() ) );
@@ -218,6 +220,11 @@ void mainWindowImpl::callAboutPokerthDialog() {
v->exec();
}
void mainWindowImpl::callSettingsDialog() {
settingsDialogImpl *v = new settingsDialogImpl();
v->exec();
}
void mainWindowImpl::setGame(Game *g) { actualGame = g; }
+1
View File
@@ -89,6 +89,7 @@ public slots:
void callNewGameDialog() ;
void callAboutPokerthDialog();
void callSettingsDialog();
void myFold();
void myCheck();
void myCall();
+297
View File
@@ -0,0 +1,297 @@
<ui version="4.0" >
<class>settingsDialog</class>
<widget class="QDialog" name="settingsDialog" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>487</width>
<height>339</height>
</rect>
</property>
<property name="windowTitle" >
<string>PokerTH - Settings</string>
</property>
<layout class="QGridLayout" >
<property name="margin" >
<number>9</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item row="0" column="1" >
<widget class="QStackedWidget" name="stackedWidget" >
<property name="currentIndex" >
<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" >
<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" />
<widget class="QWidget" name="page_2" />
</widget>
</item>
<item row="0" column="0" >
<widget class="QListWidget" name="listWidget" >
<property name="maximumSize" >
<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>
</widget>
</item>
<item row="1" column="0" colspan="2" >
<widget class="Line" name="line" >
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</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>
<resources/>
<connections>
<connection>
<sender>buttonBox</sender>
<signal>accepted()</signal>
<receiver>settingsDialog</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel" >
<x>227</x>
<y>316</y>
</hint>
<hint type="destinationlabel" >
<x>157</x>
<y>274</y>
</hint>
</hints>
</connection>
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
<receiver>settingsDialog</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel" >
<x>295</x>
<y>322</y>
</hint>
<hint type="destinationlabel" >
<x>286</x>
<y>274</y>
</hint>
</hints>
</connection>
<connection>
<sender>listWidget</sender>
<signal>currentRowChanged(int)</signal>
<receiver>stackedWidget</receiver>
<slot>setCurrentIndex(int)</slot>
<hints>
<hint type="sourcelabel" >
<x>127</x>
<y>60</y>
</hint>
<hint type="destinationlabel" >
<x>281</x>
<y>85</y>
</hint>
</hints>
</connection>
</connections>
</ui>
+28
View File
@@ -0,0 +1,28 @@
/***************************************************************************
* Copyright (C) 2006 by FThauer FHammer *
* f.thauer@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 "settingsdialogimpl.h"
settingsDialogImpl::settingsDialogImpl(QWidget *parent, const char *name)
: QDialog(parent, name)
{
setupUi(this);
}
+32
View File
@@ -0,0 +1,32 @@
/***************************************************************************
* Copyright (C) 2006 by FThauer FHammer *
* f.thauer@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 SETTINGSDIALOGIMPL_H
#define SETTINGSDIALOGIMPL_H
#include "ui_settingsdialog.h"
class settingsDialogImpl: public QDialog, public Ui::settingsDialog {
Q_OBJECT
public:
settingsDialogImpl(QWidget *parent = 0, const char *name = 0);
};
#endif