mainwindow --> gametable

This commit is contained in:
doitux
2008-05-05 07:46:19 +00:00
parent 4b04aedc3f
commit f2defd033d
59 changed files with 14825 additions and 7600 deletions
@@ -22,7 +22,7 @@
#include <gamedata.h>
#include "createinternetgamedialogimpl.h"
#include "sdlplayer.h"
#include "mainwindowimpl.h"
#include "gametableimpl.h"
class Session;
class ConfigFile;
@@ -45,7 +45,7 @@ public:
void setSession(Session *session);
Session& getSession() { return *mySession; }
void setMyW ( mainWindowImpl* theValue ) { myW = theValue; }
void setMyW ( gameTableImpl* theValue ) { myW = theValue; }
public slots:
@@ -71,7 +71,7 @@ public slots:
void setCurrentGameName ( const QString& theValue ) { currentGameName = theValue; }
QString getCurrentGameName() const { return currentGameName; }
mainWindowImpl* getMyW() const { return myW; }
gameTableImpl* getMyW() const { return myW; }
void checkPlayerQuantity();
void joinedNetworkGame(unsigned, QString, int);
@@ -105,7 +105,7 @@ public slots:
private:
mainWindowImpl* myW;
gameTableImpl* myW;
ConfigFile *myConfig;
Session *mySession;
createInternetGameDialogImpl *myCreateInternetGameDialog;
@@ -1,6 +1,6 @@
<ui version="4.0" >
<class>mainWindow</class>
<widget class="QMainWindow" name="mainWindow" >
<class>gameTable</class>
<widget class="QMainWindow" name="gameTable" >
<property name="geometry" >
<rect>
<x>0</x>
@@ -25,6 +25,14 @@
<string>PokerTH 0.6-beta - The Open-Source Texas Holdem Engine</string>
</property>
<widget class="QWidget" name="centralwidget" >
<property name="geometry" >
<rect>
<x>0</x>
<y>28</y>
<width>1000</width>
<height>631</height>
</rect>
</property>
<layout class="QVBoxLayout" >
<item>
<layout class="QHBoxLayout" >
@@ -33,7 +41,7 @@
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" >
<property name="sizeHint" stdset="0" >
<size>
<width>40</width>
<height>20</height>
@@ -48,7 +56,7 @@
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" >
<property name="sizeHint" stdset="0" >
<size>
<width>221</width>
<height>36</height>
@@ -89,22 +97,10 @@
<enum>QFrame::Raised</enum>
</property>
<layout class="QGridLayout" >
<property name="leftMargin" >
<property name="margin" >
<number>0</number>
</property>
<property name="topMargin" >
<number>0</number>
</property>
<property name="rightMargin" >
<number>0</number>
</property>
<property name="bottomMargin" >
<number>0</number>
</property>
<property name="horizontalSpacing" >
<number>0</number>
</property>
<property name="verticalSpacing" >
<property name="spacing" >
<number>0</number>
</property>
<item row="1" column="0" >
@@ -132,22 +128,10 @@
<enum>QFrame::Raised</enum>
</property>
<layout class="QGridLayout" >
<property name="leftMargin" >
<property name="margin" >
<number>0</number>
</property>
<property name="topMargin" >
<number>0</number>
</property>
<property name="rightMargin" >
<number>0</number>
</property>
<property name="bottomMargin" >
<number>0</number>
</property>
<property name="horizontalSpacing" >
<number>0</number>
</property>
<property name="verticalSpacing" >
<property name="spacing" >
<number>0</number>
</property>
<item row="0" column="0" >
@@ -269,7 +253,7 @@
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" >
<property name="sizeHint" stdset="0" >
<size>
<width>221</width>
<height>36</height>
@@ -287,7 +271,7 @@
<property name="sizeType" >
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" >
<property name="sizeHint" stdset="0" >
<size>
<width>40</width>
<height>20</height>
@@ -324,22 +308,10 @@
</rect>
</property>
<layout class="QGridLayout" >
<property name="leftMargin" >
<property name="margin" >
<number>0</number>
</property>
<property name="topMargin" >
<number>0</number>
</property>
<property name="rightMargin" >
<number>0</number>
</property>
<property name="bottomMargin" >
<number>0</number>
</property>
<property name="horizontalSpacing" >
<number>0</number>
</property>
<property name="verticalSpacing" >
<property name="spacing" >
<number>0</number>
</property>
<item row="1" column="0" >
@@ -377,22 +349,10 @@
</rect>
</property>
<layout class="QGridLayout" >
<property name="leftMargin" >
<property name="margin" >
<number>0</number>
</property>
<property name="topMargin" >
<number>0</number>
</property>
<property name="rightMargin" >
<number>0</number>
</property>
<property name="bottomMargin" >
<number>0</number>
</property>
<property name="horizontalSpacing" >
<number>0</number>
</property>
<property name="verticalSpacing" >
<property name="spacing" >
<number>0</number>
</property>
<item row="0" column="0" >
@@ -514,7 +474,7 @@
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" >
<property name="sizeHint" stdset="0" >
<size>
<width>151</width>
<height>90</height>
@@ -529,7 +489,7 @@
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" >
<property name="sizeHint" stdset="0" >
<size>
<width>40</width>
<height>20</height>
@@ -624,22 +584,10 @@
</rect>
</property>
<layout class="QGridLayout" >
<property name="leftMargin" >
<property name="margin" >
<number>0</number>
</property>
<property name="topMargin" >
<number>0</number>
</property>
<property name="rightMargin" >
<number>0</number>
</property>
<property name="bottomMargin" >
<number>0</number>
</property>
<property name="horizontalSpacing" >
<number>0</number>
</property>
<property name="verticalSpacing" >
<property name="spacing" >
<number>0</number>
</property>
<item row="1" column="0" >
@@ -677,22 +625,10 @@
</rect>
</property>
<layout class="QGridLayout" >
<property name="leftMargin" >
<property name="margin" >
<number>0</number>
</property>
<property name="topMargin" >
<number>0</number>
</property>
<property name="rightMargin" >
<number>0</number>
</property>
<property name="bottomMargin" >
<number>0</number>
</property>
<property name="horizontalSpacing" >
<number>0</number>
</property>
<property name="verticalSpacing" >
<property name="spacing" >
<number>0</number>
</property>
<item row="0" column="0" >
@@ -756,7 +692,7 @@
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" >
<property name="sizeHint" stdset="0" >
<size>
<width>21</width>
<height>81</height>
@@ -771,7 +707,7 @@
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" >
<property name="sizeHint" stdset="0" >
<size>
<width>40</width>
<height>20</height>
@@ -786,7 +722,7 @@
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" >
<property name="sizeHint" stdset="0" >
<size>
<width>20</width>
<height>40</height>
@@ -821,22 +757,10 @@
</rect>
</property>
<layout class="QGridLayout" >
<property name="leftMargin" >
<property name="margin" >
<number>0</number>
</property>
<property name="topMargin" >
<number>0</number>
</property>
<property name="rightMargin" >
<number>0</number>
</property>
<property name="bottomMargin" >
<number>0</number>
</property>
<property name="horizontalSpacing" >
<number>0</number>
</property>
<property name="verticalSpacing" >
<property name="spacing" >
<number>0</number>
</property>
<item row="1" column="0" >
@@ -874,22 +798,10 @@
</rect>
</property>
<layout class="QGridLayout" >
<property name="leftMargin" >
<property name="margin" >
<number>0</number>
</property>
<property name="topMargin" >
<number>0</number>
</property>
<property name="rightMargin" >
<number>0</number>
</property>
<property name="bottomMargin" >
<number>0</number>
</property>
<property name="horizontalSpacing" >
<number>0</number>
</property>
<property name="verticalSpacing" >
<property name="spacing" >
<number>0</number>
</property>
<item row="0" column="0" >
@@ -1011,7 +923,7 @@
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" >
<property name="sizeHint" stdset="0" >
<size>
<width>20</width>
<height>40</height>
@@ -1026,7 +938,7 @@
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" >
<property name="sizeHint" stdset="0" >
<size>
<width>40</width>
<height>20</height>
@@ -1041,16 +953,7 @@
<property name="spacing" >
<number>0</number>
</property>
<property name="leftMargin" >
<number>0</number>
</property>
<property name="topMargin" >
<number>0</number>
</property>
<property name="rightMargin" >
<number>0</number>
</property>
<property name="bottomMargin" >
<property name="margin" >
<number>0</number>
</property>
<item>
@@ -1058,16 +961,7 @@
<property name="spacing" >
<number>6</number>
</property>
<property name="leftMargin" >
<number>0</number>
</property>
<property name="topMargin" >
<number>0</number>
</property>
<property name="rightMargin" >
<number>0</number>
</property>
<property name="bottomMargin" >
<property name="margin" >
<number>0</number>
</property>
<item>
@@ -1097,22 +991,10 @@
</rect>
</property>
<layout class="QGridLayout" >
<property name="leftMargin" >
<property name="margin" >
<number>0</number>
</property>
<property name="topMargin" >
<number>0</number>
</property>
<property name="rightMargin" >
<number>0</number>
</property>
<property name="bottomMargin" >
<number>0</number>
</property>
<property name="horizontalSpacing" >
<number>0</number>
</property>
<property name="verticalSpacing" >
<property name="spacing" >
<number>0</number>
</property>
<item row="0" column="0" >
@@ -1137,22 +1019,10 @@
</rect>
</property>
<layout class="QGridLayout" >
<property name="leftMargin" >
<property name="margin" >
<number>0</number>
</property>
<property name="topMargin" >
<number>0</number>
</property>
<property name="rightMargin" >
<number>0</number>
</property>
<property name="bottomMargin" >
<number>0</number>
</property>
<property name="horizontalSpacing" >
<number>0</number>
</property>
<property name="verticalSpacing" >
<property name="spacing" >
<number>0</number>
</property>
<item row="1" column="0" >
@@ -1289,7 +1159,7 @@
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" >
<property name="sizeHint" stdset="0" >
<size>
<width>40</width>
<height>20</height>
@@ -1339,22 +1209,10 @@
</size>
</property>
<layout class="QGridLayout" >
<property name="leftMargin" >
<property name="margin" >
<number>0</number>
</property>
<property name="topMargin" >
<number>0</number>
</property>
<property name="rightMargin" >
<number>0</number>
</property>
<property name="bottomMargin" >
<number>0</number>
</property>
<property name="horizontalSpacing" >
<number>0</number>
</property>
<property name="verticalSpacing" >
<property name="spacing" >
<number>0</number>
</property>
<item row="0" column="0" >
@@ -1395,22 +1253,10 @@
</rect>
</property>
<layout class="QGridLayout" >
<property name="leftMargin" >
<property name="margin" >
<number>0</number>
</property>
<property name="topMargin" >
<number>0</number>
</property>
<property name="rightMargin" >
<number>0</number>
</property>
<property name="bottomMargin" >
<number>0</number>
</property>
<property name="horizontalSpacing" >
<number>0</number>
</property>
<property name="verticalSpacing" >
<property name="spacing" >
<number>0</number>
</property>
<item row="0" column="0" >
@@ -1418,16 +1264,7 @@
<property name="spacing" >
<number>0</number>
</property>
<property name="leftMargin" >
<number>0</number>
</property>
<property name="topMargin" >
<number>0</number>
</property>
<property name="rightMargin" >
<number>0</number>
</property>
<property name="bottomMargin" >
<property name="margin" >
<number>0</number>
</property>
<item>
@@ -1442,22 +1279,10 @@
</item>
<item>
<layout class="QGridLayout" >
<property name="leftMargin" >
<property name="margin" >
<number>0</number>
</property>
<property name="topMargin" >
<number>0</number>
</property>
<property name="rightMargin" >
<number>0</number>
</property>
<property name="bottomMargin" >
<number>0</number>
</property>
<property name="horizontalSpacing" >
<number>0</number>
</property>
<property name="verticalSpacing" >
<property name="spacing" >
<number>0</number>
</property>
<item row="1" column="1" >
@@ -1655,7 +1480,7 @@
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" >
<property name="sizeHint" stdset="0" >
<size>
<width>40</width>
<height>20</height>
@@ -1668,16 +1493,7 @@
<property name="spacing" >
<number>6</number>
</property>
<property name="leftMargin" >
<number>0</number>
</property>
<property name="topMargin" >
<number>0</number>
</property>
<property name="rightMargin" >
<number>0</number>
</property>
<property name="bottomMargin" >
<property name="margin" >
<number>0</number>
</property>
<item>
@@ -1707,22 +1523,10 @@
</rect>
</property>
<layout class="QGridLayout" >
<property name="leftMargin" >
<property name="margin" >
<number>0</number>
</property>
<property name="topMargin" >
<number>0</number>
</property>
<property name="rightMargin" >
<number>0</number>
</property>
<property name="bottomMargin" >
<number>0</number>
</property>
<property name="horizontalSpacing" >
<number>0</number>
</property>
<property name="verticalSpacing" >
<property name="spacing" >
<number>0</number>
</property>
<item row="1" column="0" >
@@ -1760,22 +1564,10 @@
</rect>
</property>
<layout class="QGridLayout" >
<property name="leftMargin" >
<property name="margin" >
<number>0</number>
</property>
<property name="topMargin" >
<number>0</number>
</property>
<property name="rightMargin" >
<number>0</number>
</property>
<property name="bottomMargin" >
<number>0</number>
</property>
<property name="horizontalSpacing" >
<number>0</number>
</property>
<property name="verticalSpacing" >
<property name="spacing" >
<number>0</number>
</property>
<item row="0" column="0" >
@@ -1909,16 +1701,7 @@
<property name="spacing" >
<number>0</number>
</property>
<property name="leftMargin" >
<number>0</number>
</property>
<property name="topMargin" >
<number>0</number>
</property>
<property name="rightMargin" >
<number>0</number>
</property>
<property name="bottomMargin" >
<property name="margin" >
<number>0</number>
</property>
<item>
@@ -1929,7 +1712,7 @@
<property name="sizeType" >
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" >
<property name="sizeHint" stdset="0" >
<size>
<width>260</width>
<height>0</height>
@@ -1945,7 +1728,7 @@
<property name="sizeType" >
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" >
<property name="sizeHint" stdset="0" >
<size>
<width>0</width>
<height>0</height>
@@ -1968,22 +1751,10 @@
</size>
</property>
<layout class="QGridLayout" >
<property name="leftMargin" >
<property name="margin" >
<number>6</number>
</property>
<property name="topMargin" >
<number>6</number>
</property>
<property name="rightMargin" >
<number>6</number>
</property>
<property name="bottomMargin" >
<number>6</number>
</property>
<property name="horizontalSpacing" >
<number>1</number>
</property>
<property name="verticalSpacing" >
<property name="spacing" >
<number>1</number>
</property>
<item row="0" column="0" >
@@ -1995,26 +1766,22 @@
<number>0</number>
</property>
<widget class="QWidget" name="tab_Hands" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>240</width>
<height>153</height>
</rect>
</property>
<attribute name="title" >
<string>Hands</string>
</attribute>
<layout class="QGridLayout" >
<property name="leftMargin" >
<property name="margin" >
<number>0</number>
</property>
<property name="topMargin" >
<number>0</number>
</property>
<property name="rightMargin" >
<number>0</number>
</property>
<property name="bottomMargin" >
<number>0</number>
</property>
<property name="horizontalSpacing" >
<number>0</number>
</property>
<property name="verticalSpacing" >
<property name="spacing" >
<number>0</number>
</property>
<item row="0" column="0" >
@@ -2027,26 +1794,22 @@
</layout>
</widget>
<widget class="QWidget" name="tab_Chat" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>960</width>
<height>480</height>
</rect>
</property>
<attribute name="title" >
<string>Chat</string>
</attribute>
<layout class="QGridLayout" >
<property name="leftMargin" >
<property name="margin" >
<number>0</number>
</property>
<property name="topMargin" >
<number>0</number>
</property>
<property name="rightMargin" >
<number>0</number>
</property>
<property name="bottomMargin" >
<number>0</number>
</property>
<property name="horizontalSpacing" >
<number>0</number>
</property>
<property name="verticalSpacing" >
<property name="spacing" >
<number>0</number>
</property>
<item row="0" column="0" >
@@ -2082,7 +1845,7 @@
<property name="sizeType" >
<enum>QSizePolicy::MinimumExpanding</enum>
</property>
<property name="sizeHint" >
<property name="sizeHint" stdset="0" >
<size>
<width>41</width>
<height>197</height>
@@ -2097,7 +1860,7 @@
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" >
<property name="sizeHint" stdset="0" >
<size>
<width>321</width>
<height>20</height>
@@ -2168,7 +1931,7 @@
<property name="sizeType" >
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" >
<property name="sizeHint" stdset="0" >
<size>
<width>5</width>
<height>20</height>
@@ -2206,7 +1969,7 @@
<property name="sizeType" >
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" >
<property name="sizeHint" stdset="0" >
<size>
<width>5</width>
<height>20</height>
@@ -2224,7 +1987,7 @@
<property name="sizeType" >
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" >
<property name="sizeHint" stdset="0" >
<size>
<width>20</width>
<height>28</height>
@@ -2250,22 +2013,10 @@
<enum>QFrame::Raised</enum>
</property>
<layout class="QGridLayout" >
<property name="leftMargin" >
<property name="margin" >
<number>0</number>
</property>
<property name="topMargin" >
<number>0</number>
</property>
<property name="rightMargin" >
<number>0</number>
</property>
<property name="bottomMargin" >
<number>0</number>
</property>
<property name="horizontalSpacing" >
<number>0</number>
</property>
<property name="verticalSpacing" >
<property name="spacing" >
<number>0</number>
</property>
<item row="1" column="0" >
@@ -2336,7 +2087,7 @@
<property name="sizeType" >
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" >
<property name="sizeHint" stdset="0" >
<size>
<width>13</width>
<height>20</height>
@@ -2514,7 +2265,7 @@
<property name="sizeType" >
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" >
<property name="sizeHint" stdset="0" >
<size>
<width>13</width>
<height>20</height>
@@ -2612,7 +2363,7 @@
<property name="sizeType" >
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" >
<property name="sizeHint" stdset="0" >
<size>
<width>140</width>
<height>0</height>
@@ -2717,7 +2468,7 @@
<property name="sizeType" >
<enum>QSizePolicy::MinimumExpanding</enum>
</property>
<property name="sizeHint" >
<property name="sizeHint" stdset="0" >
<size>
<width>31</width>
<height>197</height>
@@ -2730,16 +2481,7 @@
<property name="spacing" >
<number>0</number>
</property>
<property name="leftMargin" >
<number>0</number>
</property>
<property name="topMargin" >
<number>0</number>
</property>
<property name="rightMargin" >
<number>0</number>
</property>
<property name="bottomMargin" >
<property name="margin" >
<number>0</number>
</property>
<item>
@@ -2750,7 +2492,7 @@
<property name="sizeType" >
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" >
<property name="sizeHint" stdset="0" >
<size>
<width>260</width>
<height>0</height>
@@ -2766,7 +2508,7 @@
<property name="sizeType" >
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" >
<property name="sizeHint" stdset="0" >
<size>
<width>0</width>
<height>0</height>
@@ -2789,24 +2531,15 @@
</size>
</property>
<layout class="QGridLayout" >
<property name="leftMargin" >
<number>6</number>
</property>
<property name="topMargin" >
<number>6</number>
</property>
<property name="rightMargin" >
<number>6</number>
</property>
<property name="bottomMargin" >
<number>6</number>
</property>
<property name="horizontalSpacing" >
<number>1</number>
</property>
<property name="verticalSpacing" >
<number>2</number>
</property>
<property name="margin" >
<number>6</number>
</property>
<item row="0" column="0" >
<widget class="MyRightTabWidget" name="tabWidget_Right" >
<property name="focusPolicy" >
@@ -2816,26 +2549,22 @@
<number>0</number>
</property>
<widget class="QWidget" name="tab_Log" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>240</width>
<height>129</height>
</rect>
</property>
<attribute name="title" >
<string>Log</string>
</attribute>
<layout class="QGridLayout" >
<property name="leftMargin" >
<property name="margin" >
<number>0</number>
</property>
<property name="topMargin" >
<number>0</number>
</property>
<property name="rightMargin" >
<number>0</number>
</property>
<property name="bottomMargin" >
<number>0</number>
</property>
<property name="horizontalSpacing" >
<number>0</number>
</property>
<property name="verticalSpacing" >
<property name="spacing" >
<number>0</number>
</property>
<item row="0" column="0" >
@@ -2854,6 +2583,14 @@
</layout>
</widget>
<widget class="QWidget" name="tab_away" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>960</width>
<height>480</height>
</rect>
</property>
<attribute name="title" >
<string>Away</string>
</attribute>
@@ -2896,7 +2633,7 @@
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" >
<property name="sizeHint" stdset="0" >
<size>
<width>20</width>
<height>40</height>
@@ -2913,16 +2650,7 @@
<property name="spacing" >
<number>6</number>
</property>
<property name="leftMargin" >
<number>0</number>
</property>
<property name="topMargin" >
<number>0</number>
</property>
<property name="rightMargin" >
<number>0</number>
</property>
<property name="bottomMargin" >
<property name="margin" >
<number>0</number>
</property>
<item>
@@ -3253,7 +2981,16 @@
<addaction name="menuSpiel" />
<addaction name="menuView" />
</widget>
<widget class="QStatusBar" name="statusbar" />
<widget class="QStatusBar" name="statusbar" >
<property name="geometry" >
<rect>
<x>0</x>
<y>659</y>
<width>1000</width>
<height>21</height>
</rect>
</property>
</widget>
<action name="actionNewGame" >
<property name="text" >
<string>Start Local Game ...</string>
+110
View File
@@ -0,0 +1,110 @@
/***************************************************************************
* 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 "chat.h"
#include "gametableimpl.h"
#include "session.h"
#include "game.h"
#include "playerinterface.h"
#include "chattools.h"
#include "configfile.h"
using namespace std;
#define COMMAND_KICK_STR "/kick "
Chat::Chat(gameTableImpl* w, ConfigFile *c) : myW(w), myConfig(c)
{
myChatTools = new ChatTools(myW->lineEdit_ChatInput, myConfig, 2, myW->textBrowser_Chat);
}
Chat::~Chat()
{
delete myConfig;
myConfig = 0;
}
void Chat::sendMessage() {
//filter /kick command
if(myW->lineEdit_ChatInput->text().startsWith(COMMAND_KICK_STR)) {
QString playerToKick = myW->lineEdit_ChatInput->text();
playerToKick.remove(0, sizeof(COMMAND_KICK_STR) - 1);
myW->lineEdit_ChatInput->setText("");
if(myW->getSession().getClientGameInfo(myW->getSession().getClientCurrentGameId()).adminPlayerId == myW->getSession().getCurrentGame()->getSeatsList()->front()->getMyUniqueID()) {
if(playerToKick.toUtf8().constData() == myW->getSession().getCurrentGame()->getSeatsList()->front()->getMyName()) {
myW->textBrowser_Chat->append("<span style=\"color:#ff0000;\">"+tr("You cannot kick yourself!")+"</span>");
}
else {
myW->getSession().kickPlayer(playerToKick.toUtf8().constData());
}
}
else {
myW->textBrowser_Chat->append("<span style=\"color:#ff0000;\">"+tr("You cannot kick any player - You are not game admin!")+"</span>");
}
return;
}
fillChatLinesHistory(myW->lineEdit_ChatInput->text());
myW->getSession().sendChatMessage(myW->lineEdit_ChatInput->text().toUtf8().constData());
myW->lineEdit_ChatInput->setText("");
}
void Chat::receiveMessage(QString playerName, QString message) {
myChatTools->receiveMessage(playerName, message);
checkInvisible();
}
void Chat::checkInvisible() {
switch (myW->tabWidget_Left->currentIndex()) {
case 1: { myW->tabWidget_Left->stopBlinkChatTab();
myW->tabWidget_Left->showDefaultChatTab();
}
break;
default: { myW->tabWidget_Left->startBlinkChatTab(); }
}
}
void Chat::checkInputLength(QString string) {
if(string.toUtf8().length() > 120) myW->lineEdit_ChatInput->setMaxLength(string.length());
}
void Chat::clearNewGame() {
myW->textBrowser_Chat->clear();
}
void Chat::setPlayerNicksList(QStringList nickList) {
//fill playerNicksList for nick-autocompletition
myChatTools->setPlayerNicksList(nickList);
}
void Chat::fillChatLinesHistory(QString fillString) { myChatTools->fillChatLinesHistory(fillString); }
int Chat::getChatLinesHistorySize() { return myChatTools->getChatLinesHistorySize(); }
void Chat::showChatHistoryIndex(int index) { myChatTools->showChatHistoryIndex(index); }
void Chat::nickAutoCompletition() { myChatTools->nickAutoCompletition(); }
void Chat::setChatTextEdited() { myChatTools->setChatTextEdited(); }
+67
View File
@@ -0,0 +1,67 @@
/***************************************************************************
* 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 CHAT_H
#define CHAT_H
#include <string>
#include <QtCore>
class gameTableImpl;
class ChatTools;
class ConfigFile;
class Chat : public QObject
{
Q_OBJECT
public:
Chat(gameTableImpl*, ConfigFile *c);
~Chat();
public slots:
void sendMessage();
void receiveMessage(QString playerName, QString msg);
void checkInvisible();
void checkInputLength(QString);
void clearNewGame();
ChatTools* getMyChatTools() const { return myChatTools; }
void fillChatLinesHistory(QString fillString);
void showChatHistoryIndex(int index);
int getChatLinesHistorySize();
void nickAutoCompletition();
void setChatTextEdited();
void setPlayerNicksList(QStringList);
private:
gameTableImpl *myW;
ConfigFile *myConfig;
ChatTools *myChatTools;
friend class GuiWrapper;
};
#endif
File diff suppressed because it is too large Load Diff
+473
View File
@@ -0,0 +1,473 @@
/***************************************************************************
* 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 GAMETABLEIMPL_H
#define GAMETABLEIMPL_H
#include "ui_gametable.h"
#include "game_defs.h"
#include <string>
#include <boost/shared_ptr.hpp>
#include <QtGui>
#include <QtCore>
class Log;
class Chat;
class ConfigFile;
class Session;
class Game;
class GuiInterface;
class BoardInterface;
// class HandInterface;
class PlayerInterface;
class MyCardsPixmapLabel;
class MyAvatarLabel;
class newGameDialogImpl;
class settingsDialogImpl;
class selectAvatarDialogImpl;
class aboutPokerthImpl;
class joinNetworkGameDialogImpl;
class connectToServerDialogImpl;
class createNetworkGameDialogImpl;
class startNetworkGameDialogImpl;
class changeHumanPlayerNameDialogImpl;
class gameLobbyDialogImpl;
class timeoutMsgBoxImpl;
class QColor;
class SDLPlayer;
// class StyleSheetReader;
class gameTableImpl: public QMainWindow, public Ui::gameTable {
Q_OBJECT
public:
gameTableImpl(ConfigFile *c = 0, QMainWindow *parent = 0);
~gameTableImpl();
Session &getSession();
void setSession(boost::shared_ptr<Session> session);
void setLog(Log* l) { myLog = l; }
SDLPlayer* getMySDLPlayer() const { return mySDLPlayer; }
void setSpeeds();
signals:
void signalInitGui(int speed);
void signalShowClientDialog();
void signalRefreshSet();
void signalRefreshCash();
void signalRefreshAction(int =-1, int=-1);
void signalRefreshChangePlayer();
void signalRefreshPot();
void signalRefreshGroupbox(int =-1, int =-1);
void signalRefreshAll();
void signalRefreshPlayerName();
void signalRefreshButton();
void signalRefreshGameLabels(int);
void signalSetPlayerAvatar(int, QString);
void signalGuiUpdateDone();
void signalMeInAction();
void signalUpdateMyButtonsState();
void signalDisableMyButtons();
void signalStartTimeoutAnimation(int playerId, int timeoutSec);
void signalStopTimeoutAnimation(int playerId);
void signalDealBeRoCards(int myBeRoID);
void signalDealHoleCards();
void signalDealFlopCards0();
void signalDealTurnCards0();
void signalDealRiverCards0();
void signalNextPlayerAnimation();
void signalBeRoAnimation2(int);
void signalPreflopAnimation1();
void signalPreflopAnimation2();
void signalFlopAnimation1();
void signalFlopAnimation2();
void signalTurnAnimation1();
void signalTurnAnimation2();
void signalRiverAnimation1();
void signalRiverAnimation2();
void signalPostRiverAnimation1();
void signalPostRiverRunAnimation1();
void signalFlipHolecardsAllIn();
void signalNextRoundCleanGui();
void signalNetClientConnect(int actionID);
void signalNetClientGameInfo(int actionID);
void signalNetClientError(int errorID, int osErrorID);
void signalNetClientNotification(int notificationId);
void signalNetClientStatsUpdate(ServerStats stats);
void signalNetClientShowTimeoutDialog(int, unsigned);
void signalNetClientRemovedFromGame(int notificationId);
void signalNetServerError(int errorID, int osErrorID);
void signalNetClientSelfJoined(unsigned playerId, QString playerName, int rights);
void signalNetClientPlayerJoined(unsigned playerId, QString playerName, int rights);
void signalNetClientPlayerChanged(unsigned playerId, QString newPlayerName);
void signalNetClientPlayerLeft(unsigned playerId, QString playerName);
void signalNetClientNewGameAdmin(unsigned playerId, QString playerName);
void signalNetClientGameListNew(unsigned gameId);
void signalNetClientGameListRemove(unsigned gameId);
void signalNetClientGameListUpdateMode(unsigned gameId, int mode);
void signalNetClientGameListUpdateAdmin(unsigned gameId, unsigned adminPlayerId);
void signalNetClientGameListPlayerJoined(unsigned gameId, unsigned playerId);
void signalNetClientGameListPlayerLeft(unsigned gameId, unsigned playerId);
void signalNetClientGameStart(boost::shared_ptr<Game> game);
void signalNetClientChatMsg(QString nickName, QString msg);
void signalIrcConnect(QString server);
void signalIrcSelfJoined(QString nickName, QString channel);
void signalIrcPlayerJoined(QString nickName);
void signalIrcPlayerChanged(QString oldNick, QString newNick);
void signalIrcPlayerKicked(QString nickName, QString byWhom, QString reason);
void signalIrcPlayerLeft(QString nickName);
void signalIrcChatMessage(QString nickName, QString msg);
void signalIrcError(int errorCode);
void signalIrcServerError(int errorCode);
public slots:
void initGui(int speed);
void showClientDialog();
void showNetworkStartDialog();
void showLobbyDialog();
//refresh-Funktionen
void refreshSet();
void refreshCash();
void refreshAction(int =-1, int=-1);
void refreshChangePlayer();
void refreshPot();
void refreshGroupbox(int =-1, int =-1);
void refreshAll();
void refreshPlayerName();
QStringList getPlayerNicksList();
void refreshGameLabels(int);
void refreshButton();
void refreshPlayerAvatar();
void setPlayerAvatar(int myID, QString myAvatar);
void guiUpdateDone();
void waitForGuiUpdateDone();
// Karten-Funktionen
void dealHoleCards();
//Spieler-Funktionen
void provideMyActions(int mode = -1); //mode 0 == called from dealberocards
void meInAction();
void disableMyButtons();
void startTimeoutAnimation(int playerId, int timoutSec);
void stopTimeoutAnimation(int playerId);
void setGameSpeed(const int theValue) { guiGameSpeed = theValue; setSpeeds(); } // Achtung Faktor 10!!!
void callNewGameDialog() ;
void callAboutPokerthDialog();
void callSettingsDialog();
void callCreateNetworkGameDialog();
void callJoinNetworkGameDialog();
void callGameLobbyDialog();
void joinGameLobby();
void pushButtonBetRaiseClicked(bool checked);
void pushButtonCallCheckClicked(bool checked);
void pushButtonFoldClicked(bool checked);
void pushButtonAllInClicked(bool checked);
void myCallCheck();
void myFold();
void myCheck();
int getMyCallAmount();
int getBetRaisePushButtonValue();
int getMyBetAmount();
void myCall();
void mySet();
void myAllIn();
void myActionDone();
void dealBeRoCards(int);
void dealFlopCards0();
void dealFlopCards1();
void dealFlopCards2();
void dealFlopCards3();
void dealFlopCards4();
void dealFlopCards5();
void dealFlopCards6();
void dealTurnCards0();
void dealTurnCards1();
void dealTurnCards2();
void dealRiverCards0();
void dealRiverCards1();
void dealRiverCards2();
void nextPlayerAnimation();
void beRoAnimation2(int);
void preflopAnimation1();
void preflopAnimation1Action();
void preflopAnimation2();
void preflopAnimation2Action();
void flopAnimation1();
void flopAnimation1Action();
void flopAnimation2();
void flopAnimation2Action();
void turnAnimation1();
void turnAnimation1Action();
void turnAnimation2();
void turnAnimation2Action();
void riverAnimation1();
void riverAnimation1Action();
void riverAnimation2();
void riverAnimation2Action();
void postRiverAnimation1();
void postRiverAnimation1Action();
void postRiverRunAnimation1();
void postRiverRunAnimation2();
void postRiverRunAnimation2_flipHoleCards1();
void postRiverRunAnimation2_flipHoleCards2();
void postRiverRunAnimation3();
void postRiverRunAnimation4();
void postRiverRunAnimation5();
void postRiverRunAnimation6();
void blinkingStartButtonAnimationAction();
void flipHolecardsAllIn();
void showMyCards();
void handSwitchRounds();
void startNewHand();
void startNewLocalGame(newGameDialogImpl* =0);
void stopTimer();
void nextRoundCleanGui();
void breakButtonClicked();
void keyPressEvent ( QKeyEvent*);
bool eventFilter(QObject *obj, QEvent *event);
void switchChatWindow();
void switchHelpWindow();
void switchLogWindow();
void switchAwayWindow();
void switchFullscreen();
void paintStartSplash();
void sendChatMessage();
void checkChatInputLength(QString);
void tabSwitchAction();
void leaveCurrentNetworkGame();
void networkError(int, int);
void networkNotification(int);
void networkStart(boost::shared_ptr<Game> game);
// void closeEvent(QCloseEvent*);
void localGameModification();
void networkGameModification();
void mouseOverFlipCards(bool front);
void updateMyButtonsState(int mode = -1); //mode 0 == called from dealberocards
void uncheckMyButtons();
void resetMyButtonsCheckStateMemory();
void clearMyButtons();
void myButtonsCheckable(bool state);
void changePlayingMode();
void changeLineEditBetValue(int);
void lineEditBetValueChanged(QString);
void showMaximized ();
void quitPokerTH();
void showTimeoutDialog(int msgID, unsigned duration);
void hideTimeoutDialog();
// void paintEvent(QPaintEvent *);
private:
boost::shared_ptr<GuiInterface> myServerGuiInterface;
boost::shared_ptr<Session> mySession;
Log *myLog;
Chat *myChat;
ConfigFile *myConfig;
//Timer
QTimer *potDistributeTimer;
QTimer *timer;
QTimer *dealFlopCards0Timer;
QTimer *dealFlopCards1Timer;
QTimer *dealFlopCards2Timer;
QTimer *dealFlopCards3Timer;
QTimer *dealFlopCards4Timer;
QTimer *dealFlopCards5Timer;
QTimer *dealFlopCards6Timer;
QTimer *dealTurnCards0Timer;
QTimer *dealTurnCards1Timer;
QTimer *dealTurnCards2Timer;
QTimer *dealRiverCards0Timer;
QTimer *dealRiverCards1Timer;
QTimer *dealRiverCards2Timer;
QTimer *nextPlayerAnimationTimer;
QTimer *preflopAnimation1Timer;
QTimer *preflopAnimation2Timer;
QTimer *flopAnimation1Timer;
QTimer *flopAnimation2Timer;
QTimer *turnAnimation1Timer;
QTimer *turnAnimation2Timer;
QTimer *riverAnimation1Timer;
QTimer *riverAnimation2Timer;
QTimer *postRiverAnimation1Timer;
QTimer *postRiverRunAnimation1Timer;
QTimer *postRiverRunAnimation2Timer;
QTimer *postRiverRunAnimation2_flipHoleCards1Timer;
QTimer *postRiverRunAnimation2_flipHoleCards2Timer;
QTimer *postRiverRunAnimation3Timer;
QTimer *postRiverRunAnimation5Timer;
QTimer *postRiverRunAnimation6Timer;
QTimer *blinkingStartButtonAnimationTimer;
QWidget *userWidgetsArray[6];
QLabel *buttonLabelArray[MAX_NUMBER_OF_PLAYERS];
QLabel *cashLabelArray[MAX_NUMBER_OF_PLAYERS];
QLabel *cashTopLabelArray[MAX_NUMBER_OF_PLAYERS];
MySetLabel *setLabelArray[MAX_NUMBER_OF_PLAYERS];
QLabel *actionLabelArray[MAX_NUMBER_OF_PLAYERS];
QLabel *playerNameLabelArray[MAX_NUMBER_OF_PLAYERS];
MyAvatarLabel *playerAvatarLabelArray[MAX_NUMBER_OF_PLAYERS];
QGroupBox *groupBoxArray[MAX_NUMBER_OF_PLAYERS];
MyCardsPixmapLabel *boardCardsArray[5];
MyCardsPixmapLabel *holeCardsArray[MAX_NUMBER_OF_PLAYERS][2];
QPixmap *flipside;
//Dialoge
aboutPokerthImpl *myAboutPokerthDialog;
newGameDialogImpl *myNewGameDialog;
settingsDialogImpl *mySettingsDialog;
selectAvatarDialogImpl *mySelectAvatarDialog;
changeHumanPlayerNameDialogImpl *myChangeHumanPlayerNameDialog;
joinNetworkGameDialogImpl *myJoinNetworkGameDialog;
connectToServerDialogImpl *myConnectToServerDialog;
startNetworkGameDialogImpl *myStartNetworkGameDialog;
createNetworkGameDialogImpl *myCreateNetworkGameDialog;
gameLobbyDialogImpl *myGameLobbyDialog;
boost::shared_ptr<timeoutMsgBoxImpl> myTimeoutDialog;
//Sound
SDLPlayer *mySDLPlayer;
QString myAppDataPath;
int distributePotAnimCounter;
int playingMode;
QString font2String;
QString font1String;
//Speed
int guiGameSpeed;
int gameSpeed;
int dealCardsSpeed;
int preDealCardsSpeed;
int postDealCardsSpeed;
int AllInDealCardsSpeed;
int postRiverRunAnimationSpeed;
int winnerBlinkSpeed;
int newRoundSpeed;
int nextPlayerSpeed1;
int nextPlayerSpeed2;
int nextPlayerSpeed3;
int preflopNextPlayerSpeed;
int nextOpponentSpeed;
bool myActionIsBet;
bool myActionIsRaise;
bool pushButtonBetRaiseIsChecked;
bool pushButtonCallCheckIsChecked;
bool pushButtonFoldIsChecked;
bool pushButtonAllInIsChecked;
bool myButtonsAreCheckable;
bool breakAfterCurrentHand;
bool currentGameOver;
bool flipHolecardsAllInAlreadyDone;
bool betSliderChangedByInput;
QColor active;
QColor inactive;
QColor highlight;
// statistic testing
int statisticArray[15];
QSemaphore guiUpdateSemaphore;
int keyUpDownChatCounter;
int myLastPreActionBetValue;
// StyleSheetReader *myStyleSheetReader;
friend class GuiWrapper;
};
#endif
+1668
View File
File diff suppressed because it is too large Load Diff
+93
View File
@@ -0,0 +1,93 @@
/***************************************************************************
* 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 LOG_H
#define LOG_H
#include <string>
#include "configfile.h"
#include <QtCore>
class gameTableImpl;
class Log : public QObject
{
Q_OBJECT
public:
Log(gameTableImpl*, ConfigFile *c);
~Log();
public slots:
void logPlayerActionMsg(QString playerName, int action, int setValue);
void logNewGameHandMsg(int gameID, int handID);
void logNewBlindsSetsMsg(int sbSet, int bbSet, QString sbName, QString bbName);
void logPlayerWinsMsg(QString playerName, int pot, bool main);
void logPlayerSitsOut(QString playerName);
void logDealBoardCardsMsg(int roundID, int card1, int card2, int card3, int card4 = -1, int card5 = -1);
void logFlipHoleCardsMsg(QString playerName, int card1, int card2, int cardsValueInt = -1, QString showHas = "shows");
void logPlayerLeftMsg(QString playerName);
void logNewGameAdminMsg(QString playerName);
void logPlayerWinGame(QString playerName, int gameID);
void flushLogAtGame(int gameID);
void flushLogAtHand();
public:
QStringList translateCardsValueCode(int cardsValueCode);
QStringList translateCardCode(int cardCode);
QString determineHandName(int cardsValueInt);
void writeLogFileStream(QString string);
signals:
void signalLogPlayerActionMsg(QString playerName, int action, int setValue);
void signalLogNewGameHandMsg(int gameID, int handID);
void signalLogNewBlindsSetsMsg(int sbSet, int bbSet, QString sbName, QString bbName);
void signalLogPlayerWinsMsg(QString playerName, int pot, bool main);
void signalLogPlayerSitsOut(QString playerName);
void signalLogDealBoardCardsMsg(int roundID, int card1, int card2, int card3, int card4 = -1, int card5 = -1);
void signalLogFlipHoleCardsMsg(QString playerName, int card1, int card2, int cardsValueInt = -1, QString showHas = "shows");
void signalLogPlayerLeftMsg(QString playerName);
void signalLogNewGameAdminMsg(QString playerName);
void signalLogPlayerWinGame(QString playerName, int gameID);
void signalFlushLogAtGame(int gameID);
void signalFlushLogAtHand();
private:
int lastGameID;
gameTableImpl *myW;
ConfigFile *myConfig;
QTextStream stream;
QDir *myLogDir;
QFile *myLogFile;
QString logFileStreamString;
QString myAppDataPath;
friend class GuiWrapper;
};
#endif
+40
View File
@@ -0,0 +1,40 @@
//
// C++ Implementation: mycardspixmaplabel
//
// Description:
//
//
// Author: FThauer FHammer <f.thauer@web.de>, (C) 2007
//
// Copyright: See COPYING file that comes with this distribution
//
//
#include "mysetlabel.h"
#include "gametableimpl.h"
using namespace std;
MyAvatarLabel::MyAvatarLabel(QGroupBox* parent)
: QLabel(parent)
{
myContextMenu = new QMenu;
myContextMenu->addAction(tr("Vote for kick this user"));
}
MyAvatarLabel::~MyAvatarLabel()
{
}
void MyAvatarLabel::contextMenuEvent ( QContextMenuEvent * event ) {
// showContextMenu(event->globalPos());
}
void MyAvatarLabel::showContextMenu(const QPoint &pos) {
// myContextMenu->popup(pos);
}
+45
View File
@@ -0,0 +1,45 @@
//
// C++ Interface: mycardspixmaplabel
//
// Description:
//
//
// Author: FThauer FHammer <f.thauer@web.de>, (C) 2007
//
// Copyright: See COPYING file that comes with this distribution
//
//
#ifndef MYAVATARLABEL_H
#define MYAVATARLABEL_H
#include <iostream>
#include <QtGui>
#include <QtCore>
class gameTableImpl;
class MyAvatarLabel : public QLabel
{
Q_OBJECT
public:
MyAvatarLabel(QGroupBox*);
~MyAvatarLabel();
void setMyW ( gameTableImpl* theValue ) { myW = theValue; }
void contextMenuEvent ( QContextMenuEvent * event );
public slots:
void showContextMenu(const QPoint &pos);
private:
gameTableImpl *myW;
QMenu *myContextMenu;
};
#endif
+232
View File
@@ -0,0 +1,232 @@
//
// C++ Implementation: mycardspixmaplabel
//
// Description:
//
//
// Author: FThauer FHammer <f.thauer@web.de>, (C) 2007
//
// Copyright: See COPYING file that comes with this distribution
//
//
#include "mycardspixmaplabel.h"
#include "gametableimpl.h"
// using namespace std;
MyCardsPixmapLabel::MyCardsPixmapLabel(QFrame* parent)
: QLabel(parent), myW(NULL)
{
this->setMouseTracking(TRUE);
fadeOutAction = FALSE;
flipCardsAction1 = FALSE;
flipCardsAction2 = FALSE;
mousePress = FALSE;
fastFlipCardsFront = FALSE;
// rotationIntervall = 0.03;
isFlipside = FALSE;
fadeOutTimer = new QTimer;
connect(fadeOutTimer, SIGNAL(timeout()), this, SLOT(nextFadeOutFrame()));
flipCardsTimer = new QTimer;
connect(flipCardsTimer, SIGNAL(timeout()), this, SLOT(nextFlipCardsFrame()));
connect(this, SIGNAL(signalFastFlipCards(bool)), this, SLOT(fastFlipCards(bool)));
}
MyCardsPixmapLabel::~MyCardsPixmapLabel()
{
}
void MyCardsPixmapLabel::startFadeOut(int speed) {
frameOpacity = 0.0;
if(speed <= 4) { opacityRaiseInterval = 0.01; }
if(speed > 4 && speed <= 7) { opacityRaiseInterval = 0.02; }
if(speed > 7 && speed <= 10) { opacityRaiseInterval = 0.04; }
if(speed != 11) {
fadeOutAction = TRUE;
frameOpacity = 0.0;
fadeOutTimer->start(40);
}
}
void MyCardsPixmapLabel::nextFadeOutFrame() {
if (frameOpacity < 0.75) {
frameOpacity += opacityRaiseInterval;
update();
}
else {
fadeOutTimer->stop();
// fadeOutAction = FALSE;
}
}
void MyCardsPixmapLabel::startFlipCards(int speed, const QPixmap &frontPix, const QPixmap &flipsidePix) {
stopFlipCards = FALSE;
QLabel::setPixmap(frontPix);
frameFlipCardsAction1Size = 1.0;
frameFlipCardsAction2Size = 0.0;
front = frontPix.scaled(width(), height(), Qt::IgnoreAspectRatio, Qt::SmoothTransformation);;
flipside = flipsidePix.scaled(width(), height(), Qt::IgnoreAspectRatio, Qt::SmoothTransformation);;
if(speed <= 4) { flipCardsScaleIntervall = 0.1; }
if(speed > 4 && speed <= 6) { flipCardsScaleIntervall = 0.20; }
if(speed > 6 && speed <= 8) { flipCardsScaleIntervall = 0.25; }
if(speed > 8 && speed <= 10) { flipCardsScaleIntervall = 0.5; }
//
if(speed != 11) {
flipCardsAction1 = TRUE;
flipCardsTimer->start(40);
}
}
void MyCardsPixmapLabel::stopFlipCardsAnimation() {
flipCardsTimer->stop();
flipCardsAction1 = FALSE;
flipCardsAction2 = FALSE;
stopFlipCards = TRUE;
update();
}
void MyCardsPixmapLabel::nextFlipCardsFrame() {
if (frameFlipCardsAction1Size > 0.1 ) {
//erst flipside verkleinern
frameFlipCardsAction1Size -= flipCardsScaleIntervall;
update();
}
else {
if(flipCardsAction1) {
flipCardsAction1 = FALSE;
flipCardsAction2 = TRUE;
}
else {
//dann front vergrößern
if (frameFlipCardsAction2Size < 0.9 ) {
frameFlipCardsAction2Size += flipCardsScaleIntervall;
update();
}
else {
flipCardsAction2 = FALSE;
flipCardsTimer->stop();
}
}
}
}
void MyCardsPixmapLabel::setPixmap(const QPixmap &pic, const bool flipsideIs) {
QLabel::setPixmap(pic);
isFlipside = flipsideIs;
}
void MyCardsPixmapLabel::setFrontPixmap ( const QPixmap &pic ) {
myHiddenFront = pic.scaled(width(), height(), Qt::IgnoreAspectRatio, Qt::SmoothTransformation);;
}
void MyCardsPixmapLabel::paintEvent(QPaintEvent * event) {
if (!(flipCardsAction1 || flipCardsAction2)) {
QLabel::paintEvent(event);
}
if (fadeOutAction) {
QPainter painter(this);
// painter.setPen(QColor(74,131,83));
painter.setBrush(QColor(74,131,83));
// painter.setBrush(palette().color(QPalette::Background));
// painter.setBrush(QColor(0,0,0));
painter.setOpacity(frameOpacity);
// painter.drawRect(this->geometry());
if(objectName().contains("pixmapLabel_cardBoard"))
painter.drawRect(-1,-1,80,115);
else
painter.drawRect(-1,-1,81,112);
}
if (flipCardsAction1) {
QPainter painter2(this);
QPointF center(flipside.width()/2.0, flipside.height()/2.0);
painter2.translate(center);
painter2.scale(frameFlipCardsAction1Size ,1);
painter2.translate(-center);
painter2.drawPixmap(0,0, flipside);
}
if (flipCardsAction2) {
QPainter painter3(this);
QPointF center(front.width()/2.0, front.height()/2.0);
painter3.translate(center);
painter3.scale(frameFlipCardsAction2Size ,1);
painter3.translate(-center);
painter3.drawPixmap(0,0, front);
}
if (fastFlipCardsFront && !fadeOutAction && !flipCardsAction1 && !flipCardsAction2) {
if(objectName().contains("pixmapLabel_card0")) {
QPainter painter4(this);
painter4.drawPixmap(0,0, myHiddenFront);
}
}
}
void MyCardsPixmapLabel::fastFlipCards(bool front){
if (front) {
fastFlipCardsFront = TRUE;
update();
}
else {
fastFlipCardsFront = FALSE;
update();
}
}
void MyCardsPixmapLabel::mousePressEvent(QMouseEvent * event) {
if (!mousePress && objectName().contains("pixmapLabel_card0")) {
mousePress = TRUE;
myW->mouseOverFlipCards(TRUE);
}
QLabel::mousePressEvent(event);
}
void MyCardsPixmapLabel::mouseReleaseEvent(QMouseEvent * event) {
if (mousePress && objectName().contains("pixmapLabel_card0")) {
mousePress = FALSE;
myW->mouseOverFlipCards(FALSE);
}
QLabel::mouseReleaseEvent(event);
}
+93
View File
@@ -0,0 +1,93 @@
//
// C++ Interface: mycardspixmaplabel
//
// Description:
//
//
// Author: FThauer FHammer <f.thauer@web.de>, (C) 2007
//
// Copyright: See COPYING file that comes with this distribution
//
//
#ifndef MYCARDSPIXMAPLABEL_H
#define MYCARDSPIXMAPLABEL_H
#include <iostream>
#include <QtGui>
#include <QtCore>
class gameTableImpl;
class MyCardsPixmapLabel : public QLabel
{
Q_OBJECT
public:
MyCardsPixmapLabel(QFrame*);
~MyCardsPixmapLabel();
void setMyW ( gameTableImpl* theValue ) { myW = theValue; }
void setIsFlipside(bool theValue){ isFlipside = theValue;}
bool getIsFlipside() const{ return isFlipside;}
void setFadeOutAction(bool theValue) { fadeOutAction = theValue; }
bool getFadeOutAction() const { return fadeOutAction;}
void startFadeOut(int);
void startFlipCards(int, const QPixmap & , const QPixmap &);
void stopFlipCardsAnimation();
void paintEvent(QPaintEvent * event);
signals:
void signalFastFlipCards(bool);
public slots:
void setPixmap ( const QPixmap &, const bool );
void setFrontPixmap ( const QPixmap &);
void nextFadeOutFrame();
void nextFlipCardsFrame();
void fastFlipCards(bool front);
// void mouseMoveEvent ( QMouseEvent *);
void mousePressEvent ( QMouseEvent *);
void mouseReleaseEvent ( QMouseEvent *);
private:
gameTableImpl* myW;
qreal frameOpacity;
qreal opacityRaiseInterval;
qreal flipCardsScaleIntervall;
qreal frameFlipCardsAction1Size;
qreal frameFlipCardsAction2Size;
QTimer *fadeOutTimer;
QTimer *flipCardsTimer;
bool isFlipside;
bool fadeOutAction;
bool flipCardsAction1;
bool flipCardsAction2;
bool stopFlipCards;
bool mousePress;
bool fastFlipCardsFront;
QPixmap front;
QPixmap flipside;
QPixmap myHiddenFront;
friend class gameTableImpl;
};
#endif
+73
View File
@@ -0,0 +1,73 @@
//
// C++ Implementation: MyLeftTabWidget
//
// Description:
//
//
// Author: FThauer FHammer <f.thauer@web.de>, (C) 2007
//
// Copyright: See COPYING file that comes with this distribution
//
//
#include "mylefttabwidget.h"
// using namespace std;
MyLeftTabWidget::MyLeftTabWidget(QGroupBox *parent)
: QTabWidget(parent), chatBlinkTimer(0), myTabBar(0)
{
// fadeOutTimer = new QTimer;
// connect(flipCardsTimer, SIGNAL(timeout()), this, SLOT(nextFlipCardsFrame()));
myTabBar = this->tabBar();
chatBlinkTimer = new QTimer;
connect(chatBlinkTimer, SIGNAL(timeout()), this, SLOT( blinkChatTab() ));
this->setStyleSheet("QTabWidget::pane { border: 2px solid #286400; border-radius: 2px; background-color: #145300; } QTabWidget::tab-bar { left: 5px; } ");
#ifdef _WIN32
QString font1String("font-family: \"Arial\";");
int paddingTop = 1;
int paddingSide = 7;
#else
#ifdef __APPLE__
QString font1String("font-family: \"Lucida Grande\";");
int paddingTop = 1;
int paddingSide = 9;
#else
QString font1String("font-family: \"Nimbus Sans L\";");
int paddingTop = 0;
int paddingSide = 9;
#endif
#endif
QTabBar *myTabBar = this->tabBar();
myTabBar->setStyleSheet("QTabBar::tab{ "+ font1String +" font-size: 11px; color: #99D500; background-color: #145300; border: 2px solid #286400; border-bottom-color: #286400; border-top-left-radius: 4px; border-top-right-radius: 4px; padding-top: "+QString::number(paddingTop,10)+"px; padding-left:"+QString::number(paddingSide,10)+"px; padding-right:"+QString::number(paddingSide,10)+"px;} QTabBar::tab:selected, QTabBar::tab:hover { background-color: #145300; padding-top: "+QString::number(paddingTop,10)+"px; padding-left:"+QString::number(paddingSide,10)+"px; padding-right:"+QString::number(paddingSide,10)+"px;} QTabBar::tab:selected { border-color: #286400; border-bottom-color: #145300; padding-top: "+QString::number(paddingTop,10)+"px; padding-left:"+QString::number(paddingSide,10)+"px; padding-right:"+QString::number(paddingSide,10)+"px;} QTabBar::tab:!selected { margin-top: 2px; padding-top: "+QString::number(paddingTop,10)+"px; padding-left:"+QString::number(paddingSide,10)+"px; padding-right:"+QString::number(paddingSide,10)+"px;} QTabBar::tab:selected { margin-left: -4px; margin-right: -4px; padding-top: "+QString::number(paddingTop,10)+"px; padding-left:"+QString::number(paddingSide,10)+"px; padding-right:"+QString::number(paddingSide,10)+"px;} QTabBar::tab:first:selected { margin-left: 0; padding-top: "+QString::number(paddingTop,10)+"px; padding-left:"+QString::number(paddingSide,10)+"px; padding-right:"+QString::number(paddingSide,10)+"px;} QTabBar::tab:last:selected { margin-right: 0; padding-top: "+QString::number(paddingTop,10)+"px; padding-left:"+QString::number(paddingSide,10)+"px; padding-right:"+QString::number(paddingSide,10)+"px;} QTabBar::tab:only-one { margin: 0; } QTabBar::tab:disabled { font-size: 11px; font-weight: 900; color: #144D03; background-color: #144D03; border-left-color: #255704; border-right-color: #255704; border-top-color: #255704; }");
}
MyLeftTabWidget::~MyLeftTabWidget()
{
}
void MyLeftTabWidget::startBlinkChatTab() { chatBlinkTimer->start(500); }
void MyLeftTabWidget::stopBlinkChatTab() { chatBlinkTimer->stop(); }
void MyLeftTabWidget::showDefaultChatTab() { myTabBar->setTabTextColor(1, QColor(240,240,240)); }
void MyLeftTabWidget::disableTab(int tabIndex, bool yesNo) { myTabBar->setTabEnabled(tabIndex, !yesNo); }
void MyLeftTabWidget::blinkChatTab() {
if(myTabBar->tabTextColor(1).red() == 240) myTabBar->setTabTextColor(1, QColor(113,162,0));
else myTabBar->setTabTextColor(1, QColor(240,240,240));
}
void MyLeftTabWidget::paintEvent(QPaintEvent * event) {
QTabWidget::paintEvent(event);
}
+45
View File
@@ -0,0 +1,45 @@
//
// C++ Interface: MyLeftTabWidget
//
// Description:
//
//
// Author: FThauer FHammer <f.thauer@web.de>, (C) 2007
//
// Copyright: See COPYING file that comes with this distribution
//
//
#ifndef MYLEFTTABWIDGET_H
#define MYLEFTTABWIDGET_H
#include <QtGui>
#include <QtCore>
class MyLeftTabWidget : public QTabWidget
{
Q_OBJECT
public:
MyLeftTabWidget(QGroupBox*);
~MyLeftTabWidget();
void paintEvent(QPaintEvent * event);
void startBlinkChatTab();
void stopBlinkChatTab();
void showDefaultChatTab();
void disableTab(int tabIndex, bool yesNO);
public slots:
void blinkChatTab();
private:
QTimer *chatBlinkTimer;
QTabBar *myTabBar;
};
#endif
+72
View File
@@ -0,0 +1,72 @@
//
// C++ Implementation: MyRightTabWidget
//
// Description:
//
//
// Author: FThauer FHammer <f.thauer@web.de>, (C) 2007
//
// Copyright: See COPYING file that comes with this distribution
//
//
#include "myrighttabwidget.h"
#include <iostream>
using namespace std;
MyRightTabWidget::MyRightTabWidget(QGroupBox *parent)
: QTabWidget(parent), myTabBar(0)
{
// fadeOutTimer = new QTimer;
// connect(flipCardsTimer, SIGNAL(timeout()), this, SLOT(nextFlipCardsFrame()));
myTabBar = this->tabBar();
// chatBlinkTimer = new QTimer;
// connect(chatBlinkTimer, SIGNAL(timeout()), this, SLOT( blinkChatTab() ));
this->setStyleSheet("QTabWidget::pane { border: 2px solid #286400; border-radius: 2px; background-color: #145300; } QTabWidget::tab-bar { left: 5px; } ");
#ifdef _WIN32
QString font1String("font-family: \"Arial\";");
int paddingTop = 1;
int paddingSide = 7;
#else
#ifdef __APPLE__
QString font1String("font-family: \"Lucida Grande\";");
int paddingTop = 1;
int paddingSide = 9;
#else
QString font1String("font-family: \"Nimbus Sans L\";");
int paddingTop = 0;
int paddingSide = 9;
#endif
#endif
QTabBar *myTabBar = this->tabBar();
myTabBar->setStyleSheet("QTabBar::tab{ "+ font1String +" font-size: 11px; color: #99D500; background-color: #145300; border: 2px solid #286400; border-bottom-color: #286400; border-top-left-radius: 4px; border-top-right-radius: 4px; padding-top: "+QString::number(paddingTop,10)+"px; padding-left:"+QString::number(paddingSide,10)+"px; padding-right:"+QString::number(paddingSide,10)+"px;} QTabBar::tab:selected, QTabBar::tab:hover { background-color: #145300; padding-top: "+QString::number(paddingTop,10)+"px; padding-left:"+QString::number(paddingSide,10)+"px; padding-right:"+QString::number(paddingSide,10)+"px;} QTabBar::tab:selected { border-color: #286400; border-bottom-color: #145300; padding-top: "+QString::number(paddingTop,10)+"px; padding-left:"+QString::number(paddingSide,10)+"px; padding-right:"+QString::number(paddingSide,10)+"px;} QTabBar::tab:!selected { margin-top: 2px; padding-top: "+QString::number(paddingTop,10)+"px; padding-left:"+QString::number(paddingSide,10)+"px; padding-right:"+QString::number(paddingSide,10)+"px;} QTabBar::tab:selected { margin-left: -4px; margin-right: -4px; padding-top: "+QString::number(paddingTop,10)+"px; padding-left:"+QString::number(paddingSide,10)+"px; padding-right:"+QString::number(paddingSide,10)+"px;} QTabBar::tab:first:selected { margin-left: 0; padding-top: "+QString::number(paddingTop,10)+"px; padding-left:"+QString::number(paddingSide,10)+"px; padding-right:"+QString::number(paddingSide,10)+"px;} QTabBar::tab:last:selected { margin-right: 0; padding-top: "+QString::number(paddingTop,10)+"px; padding-left:"+QString::number(paddingSide,10)+"px; padding-right:"+QString::number(paddingSide,10)+"px;} QTabBar::tab:only-one { margin: 0; } QTabBar::tab:disabled { font-size: 11px; font-weight: 900; color: #144D03; background-color: #144D03; border-left-color: #255704; border-right-color: #255704; border-top-color: #255704; }");
}
MyRightTabWidget::~MyRightTabWidget()
{
}
// // void MyRightTabWidget::startBlinkChatTab() { chatBlinkTimer->start(500); }
// void MyRightTabWidget::stopBlinkChatTab() { chatBlinkTimer->stop(); }
// void MyRightTabWidget::showDefaultChatTab() { myTabBar->setTabTextColor(1, QColor(240,240,240)); }
// void MyRightTabWidget::blinkChatTab() {
//
// if(myTabBar->tabTextColor(1).red() == 240) myTabBar->setTabTextColor(1, QColor(113,162,0));
// else myTabBar->setTabTextColor(1, QColor(240,240,240));
// }
void MyRightTabWidget::paintEvent(QPaintEvent * event) {
QTabWidget::paintEvent(event);
}
+43
View File
@@ -0,0 +1,43 @@
//
// C++ Interface: MyRightTabWidget
//
// Description:
//
//
// Author: FThauer FHammer <f.thauer@web.de>, (C) 2007
//
// Copyright: See COPYING file that comes with this distribution
//
//
#ifndef MYRIGHTTABWIDGET_H
#define MYRIGHTTABWIDGET_H
#include <QtGui>
#include <QtCore>
class MyRightTabWidget : public QTabWidget
{
Q_OBJECT
public:
MyRightTabWidget(QGroupBox*);
~MyRightTabWidget();
void paintEvent(QPaintEvent * event);
// void startBlinkChatTab();
// void stopBlinkChatTab();
// void showDefaultChatTab();
public slots:
// void blinkChatTab();
private:
// QTimer *chatBlinkTimer;
QTabBar *myTabBar;
};
#endif
+127
View File
@@ -0,0 +1,127 @@
//
// C++ Implementation: mycardspixmaplabel
//
// Description:
//
//
// Author: FThauer FHammer <f.thauer@web.de>, (C) 2007
//
// Copyright: See COPYING file that comes with this distribution
//
//
#include "mysetlabel.h"
#include "gametableimpl.h"
using namespace std;
MySetLabel::MySetLabel(QGroupBox* parent)
: QLabel(parent), timeOutAnimation(FALSE), timeOutValue(0), timeOutFrame(0), waitFrames(0), timerIntervall(0), isBeep(0), isBeepPlayed(0)
{
timeOutAnimationTimer = new QTimer;
connect(timeOutAnimationTimer, SIGNAL(timeout()), this, SLOT(nextTimeOutAnimationFrame()));
}
MySetLabel::~MySetLabel()
{
}
void MySetLabel::startTimeOutAnimation(int secs, bool beep) {
isBeepPlayed = FALSE;
isBeep = beep;
timeOutValue = secs;
timeOutFrame = 1;
timeOutAnimationWidth = 118;
int preTimerIntervall = ((timeOutValue-3) * 1000)/timeOutAnimationWidth;
timerIntervall = preTimerIntervall;
//save gfx ressources and never play more the 10 pps
while(timerIntervall < 100) {
if(secs <= 9 && secs >= 6) {
//fix inaccuracies caused by integer division
timerIntervall = timerIntervall + preTimerIntervall + 5;
}
else {
timerIntervall = timerIntervall + preTimerIntervall;
}
}
waitFrames = 3000/timerIntervall;
//start the real timer
realTimer.reset();
realTimer.start();
// std::cout << timerIntervall << endl;
timeOutAnimation = TRUE;
timeOutAnimationTimer->start(timerIntervall);
}
void MySetLabel::startTimeOutAnimationNow() {
timeOutAnimation = TRUE;
timeOutAnimationTimer->start(83);
}
void MySetLabel::stopTimeOutAnimation() {
// timeOutAnimationKickOnTimer->stop();
timeOutAnimationTimer->stop();
timeOutAnimation = FALSE;
update();
}
void MySetLabel::nextTimeOutAnimationFrame() {
if(timeOutAnimationWidth >=0) {
if(timeOutFrame > waitFrames) {
//play beep after waitFrames one time
if(isBeep && !isBeepPlayed) {
myW->getMySDLPlayer()->playSound("yourturn",0);
isBeepPlayed = TRUE;
}
//save gfx ressources and never play more the 10 pps
unsigned int realTimerValue = realTimer.elapsed().total_milliseconds();
timeOutAnimationWidth = 118-(((realTimerValue-3000)*118)/((timeOutValue-3)*1000));
}
timeOutFrame++;
update();
}
else {
stopTimeOutAnimation();
// no callback is called here.
// the server initiates any action required.
}
}
void MySetLabel::paintEvent(QPaintEvent * event) {
if(!timeOutAnimation || timeOutFrame <= waitFrames) {
QLabel::paintEvent(event);
}
if(timeOutAnimation && timeOutFrame > waitFrames) {
QPainter painter(this);
QLinearGradient linearGrad(QPointF(0, 10), QPointF(113, 10));
linearGrad.setColorAt(0, Qt::red);
linearGrad.setColorAt(0.5, Qt::yellow);
linearGrad.setColorAt(1, Qt::green);
painter.setBrush(linearGrad);
painter.setPen(QColor(0,0,0));
painter.drawRect(0,6,timeOutAnimationWidth-1,8);
}
}
+70
View File
@@ -0,0 +1,70 @@
//
// C++ Interface: mycardspixmaplabel
//
// Description:
//
//
// Author: FThauer FHammer <f.thauer@web.de>, (C) 2007
//
// Copyright: See COPYING file that comes with this distribution
//
//
#ifndef MYSETLABEL_H
#define MYSETLABEL_H
#include <iostream>
#include <QtGui>
#include <QtCore>
#include <third_party/boost/timers.hpp>
#include "sdlplayer.h"
class gameTableImpl;
class MySetLabel : public QLabel
{
Q_OBJECT
public:
MySetLabel(QGroupBox*);
~MySetLabel();
void setMyW ( gameTableImpl* theValue ) { myW = theValue; }
void startTimeOutAnimation(int secs, bool beep);
void stopTimeOutAnimation();
void paintEvent(QPaintEvent * event);
public slots:
void startTimeOutAnimationNow();
void nextTimeOutAnimationFrame();
private:
gameTableImpl *myW;
QTimer *timeOutAnimationTimer;
QTimer *timeOutAnimationKickOnTimer;
// boost::shared_ptr<SDLPlayer> mySDLPlayer;
boost::timers::portable::microsec_timer realTimer;
bool timeOutAnimation;
int timeOutAnimationWidth;
int timeOutValue;
int timeOutFrame;
int waitFrames;
int decreaseWidthIntervall;
int timerIntervall;
bool isBeep;
bool isBeepPlayed;
};
#endif
+48
View File
@@ -0,0 +1,48 @@
//
// C++ Implementation: mycardspixmaplabel
//
// Description:
//
//
// Author: FThauer FHammer <f.thauer@web.de>, (C) 2007
//
// Copyright: See COPYING file that comes with this distribution
//
//
#include "mysetlabel.h"
#include "gametableimpl.h"
using namespace std;
MyStatusLabel::MyStatusLabel(QFrame* parent)
: QLabel(parent) {
mousePress = FALSE;
}
MyStatusLabel::~MyStatusLabel()
{
}
void MyStatusLabel::mousePressEvent(QMouseEvent * event) {
if (!mousePress && objectName().contains("textLabel_Status0")) {
mousePress = TRUE;
myW->mouseOverFlipCards(TRUE);
}
QLabel::mousePressEvent(event);
}
void MyStatusLabel::mouseReleaseEvent(QMouseEvent * event) {
if (mousePress && objectName().contains("textLabel_Status0")) {
mousePress = FALSE;
myW->mouseOverFlipCards(FALSE);
}
QLabel::mouseReleaseEvent(event);
}
+44
View File
@@ -0,0 +1,44 @@
//
// C++ Interface: mycardspixmaplabel
//
// Description:
//
//
// Author: FThauer FHammer <f.thauer@web.de>, (C) 2007
//
// Copyright: See COPYING file that comes with this distribution
//
//
#ifndef MYSTATUSLABEL_H
#define MYSTATUSLABEL_H
#include <iostream>
#include <QtGui>
#include <QtCore>
class gameTableImpl;
class MyStatusLabel : public QLabel
{
Q_OBJECT
public:
MyStatusLabel(QFrame*);
~MyStatusLabel();
void setMyW ( gameTableImpl* theValue ) { myW = theValue; }
void mousePressEvent ( QMouseEvent *);
void mouseReleaseEvent ( QMouseEvent *);
private:
gameTableImpl *myW;
bool mousePress;
};
#endif
+282
View File
@@ -0,0 +1,282 @@
/***************************************************************************
* 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 "startsplash.h"
#include "configfile.h"
#include "gametableimpl.h"
StartSplash::StartSplash(gameTableImpl *parent, ConfigFile *c)
: QSplashScreen(parent), myW(parent), myConfig(c)
{
myAppDataPath = QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str());
logo = myAppDataPath+"gfx/gui/misc/logoChip3D.png";
frameNo = 52;
opacityCounter = 13;
opacity = 1.0;
QTimer *timer = new QTimer;
connect(timer, SIGNAL(timeout()), this, SLOT(nextAnimationFrame()));
timer->start(40);
}
StartSplash::~StartSplash()
{
}
void StartSplash::nextAnimationFrame() {
++frameNo;
update();
}
void StartSplash::paintEvent(QPaintEvent * /*event*/) {
QPainter painter(this);
#ifdef _WIN32
QFont welcomeFont;
welcomeFont.setFamily("Times New Roman");
welcomeFont.setPixelSize(42);
#else
#ifdef __APPLE__
QFont welcomeFont;
welcomeFont.setFamily("Century Schoolbook L");
welcomeFont.setPixelSize(42);
#else
QFont welcomeFont;
welcomeFont.setFamily("Century Schoolbook L");
welcomeFont.setPixelSize(35);
#endif
#endif
#ifdef __APPLE__
QFont haveFont;
haveFont.setFamily("Century Schoolbook L");
haveFont.setPixelSize(24);
#else
QFont haveFont;
haveFont.setFamily("Century Schoolbook L");
haveFont.setPixelSize(24);
#endif
QFont versionFont;
versionFont.setFamily("Nimbus Sans L");
versionFont.setPixelSize(12);
if(frameNo >= 52 && frameNo < 55) {
painter.setBrush(QColor(35,71,0));
painter.drawRect(0,0,399,249);
}
if(frameNo >= 55 && frameNo < 57) {
painter.setBrush(QColor(35,71,0));
painter.drawRect(0,0,399,249);
painter.setRenderHint(QPainter::Antialiasing, TRUE);
painter.setFont(welcomeFont);
painter.setPen(QColor(255,255,255));
painter.drawText(48,27,300,45,4,"W");
}
if(frameNo >= 57 && frameNo < 59) {
painter.setBrush(QColor(35,71,0));
painter.drawRect(0,0,399,249);
painter.setRenderHint(QPainter::Antialiasing, TRUE);
painter.setFont(welcomeFont);
painter.setPen(QColor(255,255,255));
painter.drawText(48,27,300,45,4,"We");
}
if(frameNo >= 59 && frameNo < 61) {
painter.setBrush(QColor(35,71,0));
painter.drawRect(0,0,399,249);
painter.setRenderHint(QPainter::Antialiasing, TRUE);
painter.setFont(welcomeFont);
painter.setPen(QColor(255,255,255));
painter.drawText(48,27,300,45,4,"Wel");
}
if(frameNo >= 61 && frameNo < 63) {
painter.setBrush(QColor(35,71,0));
painter.drawRect(0,0,399,249);
painter.setRenderHint(QPainter::Antialiasing, TRUE);
painter.setFont(welcomeFont);
painter.setPen(QColor(255,255,255));
painter.drawText(48,27,300,45,4,"Welc");
}
if(frameNo >= 63 && frameNo < 65) {
painter.setBrush(QColor(35,71,0));
painter.drawRect(0,0,399,249);
painter.setRenderHint(QPainter::Antialiasing, TRUE);
painter.setFont(welcomeFont);
painter.setPen(QColor(255,255,255));
painter.drawText(48,27,300,45,4,"Welco");
}
if(frameNo >= 65 && frameNo < 67) {
painter.setBrush(QColor(35,71,0));
painter.drawRect(0,0,399,249);
painter.setRenderHint(QPainter::Antialiasing, TRUE);
painter.setFont(welcomeFont);
painter.setPen(QColor(255,255,255));
painter.drawText(48,27,300,45,4,"Welcom");
}
if(frameNo >= 67 && frameNo < 72) {
painter.setBrush(QColor(35,71,0));
painter.drawRect(0,0,399,249);
painter.setRenderHint(QPainter::Antialiasing, TRUE);
painter.setFont(welcomeFont);
painter.setPen(QColor(255,255,255));
painter.drawText(48,27,300,45,4,"Welcome");
}
if(frameNo >= 72 && frameNo < 74) {
painter.setBrush(QColor(35,71,0));
painter.drawRect(0,0,399,249);
painter.setRenderHint(QPainter::Antialiasing, TRUE);
painter.setFont(welcomeFont);
painter.setPen(QColor(255,255,255));
painter.drawText(48,27,300,45,4,"Welcome t");
}
if(frameNo >= 74 && frameNo < 79 ) {
painter.setBrush(QColor(35,71,0));
painter.drawRect(0,0,399,249);
painter.setRenderHint(QPainter::Antialiasing, TRUE);
painter.setFont(welcomeFont);
painter.setPen(QColor(255,255,255));
painter.drawText(48,27,300,45,4,"Welcome to");
}
if(frameNo >= 79 && frameNo < 91) {
//
painter.setBrush(QColor(35,71,0));
painter.drawRect(0,0,399,249);
painter.setRenderHint(QPainter::Antialiasing, TRUE);
painter.setFont(welcomeFont);
painter.setPen(QColor(255,255,255));
painter.drawText(48,27,300,45,4,"Welcome to");
--opacityCounter;
// std::cout << opacity << " " << opacityCounter << "\n";
opacity = 1.0/opacityCounter;
// std::cout << opacity << "\n";
painter.setOpacity(opacity);
painter.drawPixmap(150,85,100,100,logo);
}
if(frameNo >= 91 && frameNo < 106) {
//
painter.setBrush(QColor(35,71,0));
painter.drawRect(0,0,399,249);
painter.setRenderHint(QPainter::Antialiasing, TRUE);
painter.setFont(welcomeFont);
painter.setPen(QColor(255,255,255));
painter.drawText(48,27,300,45,4,"Welcome to");
painter.drawPixmap(150,85,100,100,logo);
}
if(frameNo >= 106 && frameNo < 136) {
//
painter.setBrush(QColor(35,71,0));
painter.drawRect(0,0,399,249);
painter.setRenderHint(QPainter::Antialiasing, TRUE);
painter.setFont(welcomeFont);
painter.setPen(QColor(255,255,255));
painter.drawText(48,27,300,45,4,"Welcome to");
painter.drawPixmap(150,85,100,100,logo);
painter.setFont(haveFont);
painter.setPen(QColor(255,255,255));
painter.drawText(3,190,390,40,4,"Have a lot of fun!");
}
if(frameNo >= 136 && frameNo < 190) {
//
painter.setBrush(QColor(35,71,0));
painter.drawRect(0,0,399,249);
painter.setRenderHint(QPainter::Antialiasing, TRUE);
painter.setFont(welcomeFont);
painter.setPen(QColor(255,255,255));
painter.drawText(48,27,300,45,4,"Welcome to");
painter.drawPixmap(150,85,100,100,logo);
painter.setFont(haveFont);
painter.setPen(QColor(255,255,255));
painter.drawText(3,190,390,40,4,"Have a lot of fun! ;-)");
}
//even draw version number
painter.setOpacity(1.0);
painter.setFont(versionFont);
painter.setPen(QColor(153,213,0));
painter.drawText(309,227,100,20,4,QString("Version %1").arg(POKERTH_BETA_RELEASE_STRING));
painter.setOpacity(opacity);
if(frameNo >=190) {
this->close();
}
}
+47
View File
@@ -0,0 +1,47 @@
//
// C++ Interface: startsplash
//
// Description:
//
//
// Author: FThauer FHammer <f.thauer@web.de>, (C) 2007
//
// Copyright: See COPYING file that comes with this distribution
//
//
#ifndef STARTSPLASH_H
#define STARTSPLASH_H
#include <QtGui>
#include <QtCore>
class gameTableImpl;
class ConfigFile;
class StartSplash : public QSplashScreen
{
Q_OBJECT
public:
StartSplash(gameTableImpl *, ConfigFile*);
~StartSplash();
int frameNo;
int opacityCounter;
qreal opacity;
void paintEvent(QPaintEvent * event);
public slots:
void nextAnimationFrame();
private:
gameTableImpl *myW;
QString myAppDataPath;
QPixmap logo;
ConfigFile *myConfig;
};
#endif
+2 -2
View File
@@ -22,7 +22,7 @@
#include "session.h"
#include "log.h"
#include "chat.h"
#include "mainwindowimpl.h"
#include "gametableimpl.h"
#include "configfile.h"
using namespace std;
@@ -32,7 +32,7 @@ GuiWrapper::GuiWrapper(ConfigFile *c) : myLog(0), myW(0), myConfig(c)
{
myW = new mainWindowImpl(myConfig);
myW = new gameTableImpl(myConfig);
myW->show();
myLog = new Log(myW, myConfig);
}
+2 -2
View File
@@ -25,7 +25,7 @@
#include <string>
class Session;
class mainWindowImpl;
class gameTableImpl;
class Log;
class Chat;
class ConfigFile;
@@ -144,7 +144,7 @@ private:
Log *myLog;
Chat *myChat;
mainWindowImpl *myW;
gameTableImpl *myW;
ConfigFile *myConfig;
};
@@ -25,7 +25,7 @@
#include <QtGui>
#include <QtCore>
#include "sdlplayer.h"
#include "mainwindowimpl.h"
#include "gametableimpl.h"
class Session;
class ConfigFile;
@@ -40,7 +40,7 @@ public:
public slots:
void setMyW ( mainWindowImpl* theValue ) { myW = theValue; }
void setMyW ( gameTableImpl* theValue ) { myW = theValue; }
void startGame();
@@ -72,7 +72,7 @@ public slots:
private:
mainWindowImpl* myW;
gameTableImpl* myW;
int maxPlayerNumber;
int keyUpDownChatCounter;
unsigned myPlayerId;