This commit is contained in:
doitux
2007-08-26 12:45:37 +00:00
parent 87941c632a
commit f8a10f33b7
4 changed files with 315 additions and 198 deletions
@@ -32,6 +32,7 @@ createInternetGameDialogImpl::createInternetGameDialogImpl(QWidget *parent, Conf
connect( pushButton_cancel, SIGNAL( clicked() ), this, SLOT( cancel() ) );
connect( pushButton_createGame, SIGNAL( clicked() ), this, SLOT( createGame() ) );
connect( checkBox_Password, SIGNAL( toggled(bool) ), this, SLOT( clearGamePassword(bool)) );
//temporarely unused until ai is enabled in network
// label_5->hide();
// spinBox_gameSpeed->hide();
@@ -83,3 +84,8 @@ void createInternetGameDialogImpl::keyPressEvent ( QKeyEvent * event ) {
if (event->key() == 16777220) { pushButton_createGame->click(); } //ENTER
}
void createInternetGameDialogImpl::clearGamePassword(bool clear) {
if(!clear) { lineEdit_Password->clear(); }
}
@@ -42,6 +42,8 @@ public slots:
void fillFormular();
void showDialog();
void keyPressEvent ( QKeyEvent * event );
void clearGamePassword(bool);
private:
ConfigFile *myConfig;
+294 -198
View File
@@ -5,8 +5,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>730</width>
<height>584</height>
<width>683</width>
<height>567</height>
</rect>
</property>
<property name="windowTitle" >
@@ -19,30 +19,304 @@
<property name="spacing" >
<number>6</number>
</property>
<item row="3" column="2" >
<widget class="Line" name="line_2" >
<property name="orientation" >
<enum>Qt::Vertical</enum>
<item row="2" column="0" >
<layout class="QGridLayout" >
<property name="margin" >
<number>0</number>
</property>
</widget>
<property name="spacing" >
<number>6</number>
</property>
<item row="1" column="0" >
<widget class="QGroupBox" name="groupBox" >
<property name="title" >
<string>Lobby-Chat</string>
</property>
<layout class="QGridLayout" >
<property name="margin" >
<number>7</number>
</property>
<property name="spacing" >
<number>0</number>
</property>
<item row="0" column="0" >
<widget class="QTextBrowser" name="textBrowser_ChatDisplay" />
</item>
<item row="1" column="0" >
<widget class="QLineEdit" name="lineEdit_ChatInput" />
</item>
</layout>
</widget>
</item>
<item row="0" column="0" >
<widget class="Line" name="line" >
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="1" column="1" >
<layout class="QHBoxLayout" >
<property name="margin" >
<number>0</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item>
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType" >
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" >
<size>
<width>2</width>
<height>238</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="Line" name="line_2" >
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</item>
<item row="3" column="1" >
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType" >
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" >
<item row="0" column="0" >
<widget class="QTreeWidget" name="treeWidget_GameList" >
<property name="minimumSize" >
<size>
<width>1</width>
<height>20</height>
<width>400</width>
<height>0</height>
</size>
</property>
</spacer>
<column>
<property name="text" >
<string>Game</string>
</property>
</column>
<column>
<property name="text" >
<string>Player</string>
</property>
</column>
<column>
<property name="text" >
<string>Private</string>
</property>
</column>
</widget>
</item>
<item row="1" column="0" colspan="3" >
<item rowspan="3" row="0" column="1" >
<widget class="QGroupBox" name="groupBox_GameInfo" >
<property name="enabled" >
<bool>false</bool>
</property>
<property name="title" >
<string>Game Info</string>
</property>
<layout class="QGridLayout" >
<property name="margin" >
<number>9</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item row="3" column="0" >
<spacer>
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" >
<size>
<width>125</width>
<height>71</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="0" >
<widget class="QTreeWidget" name="treeWidget" >
<property name="minimumSize" >
<size>
<width>221</width>
<height>0</height>
</size>
</property>
<column>
<property name="text" >
<string>Connected Players</string>
</property>
</column>
</widget>
</item>
<item row="1" column="0" >
<layout class="QHBoxLayout" >
<property name="margin" >
<number>0</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item>
<spacer>
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType" >
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" >
<size>
<width>16</width>
<height>27</height>
</size>
</property>
</spacer>
</item>
<item>
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" >
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="pushButton_StartGame" >
<property name="text" >
<string>Start Game</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButton_Kick" >
<property name="text" >
<string>Kick</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="4" column="0" >
<widget class="QPushButton" name="pushButton_Leave" >
<property name="text" >
<string>Leave</string>
</property>
</widget>
</item>
<item row="2" column="0" >
<layout class="QGridLayout" >
<property name="margin" >
<number>0</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item row="3" column="0" >
<widget class="QLabel" name="label_5" >
<property name="text" >
<string>&lt;html>&lt;head>&lt;meta name="qrichtext" content="1" />&lt;style type="text/css">
p, li { white-space: pre-wrap; }
&lt;/style>&lt;/head>&lt;body style=" font-family:'Nimbus Sans L'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">&lt;span style=" font-weight:600;">Hands to raise small blind:&lt;/span>&lt;/p>&lt;/body>&lt;/html></string>
</property>
</widget>
</item>
<item row="2" column="1" >
<widget class="QLabel" name="label_SmallBlind" >
<property name="alignment" >
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="0" column="0" >
<widget class="QLabel" name="label_7" >
<property name="text" >
<string>&lt;html>&lt;head>&lt;meta name="qrichtext" content="1" />&lt;style type="text/css">
p, li { white-space: pre-wrap; }
&lt;/style>&lt;/head>&lt;body style=" font-family:'Nimbus Sans L'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">&lt;span style=" font-weight:600;">Maximum number of players:&lt;/span>&lt;/p>&lt;/body>&lt;/html></string>
</property>
</widget>
</item>
<item row="2" column="0" >
<widget class="QLabel" name="label_3" >
<property name="text" >
<string>&lt;html>&lt;head>&lt;meta name="qrichtext" content="1" />&lt;style type="text/css">
p, li { white-space: pre-wrap; }
&lt;/style>&lt;/head>&lt;body style=" font-family:'Nimbus Sans L'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">&lt;span style=" font-weight:600;">Small Blind:&lt;/span>&lt;/p>&lt;/body>&lt;/html></string>
</property>
</widget>
</item>
<item row="1" column="1" >
<widget class="QLabel" name="label_StartCash" >
<property name="alignment" >
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="0" column="1" >
<widget class="QLabel" name="label_MaximumNumberOfPlayers" >
<property name="alignment" >
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="3" column="1" >
<widget class="QLabel" name="label_HandsToRaiseSmallBlind" >
<property name="alignment" >
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="1" column="0" >
<widget class="QLabel" name="label" >
<property name="text" >
<string>&lt;html>&lt;head>&lt;meta name="qrichtext" content="1" />&lt;style type="text/css">
p, li { white-space: pre-wrap; }
&lt;/style>&lt;/head>&lt;body style=" font-family:'Nimbus Sans L'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">&lt;span style=" font-weight:600;">Start Cash:&lt;/span>&lt;/p>&lt;/body>&lt;/html></string>
</property>
</widget>
</item>
<item row="4" column="0" >
<widget class="QLabel" name="label_2" >
<property name="text" >
<string>&lt;html>&lt;head>&lt;meta name="qrichtext" content="1" />&lt;style type="text/css">
p, li { white-space: pre-wrap; }
&lt;/style>&lt;/head>&lt;body style=" font-family:'Nimbus Sans L'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">&lt;span style=" font-weight:600;">Timeout for player action (sec):&lt;/span>&lt;/p>&lt;/body>&lt;/html></string>
</property>
</widget>
</item>
<item row="4" column="1" >
<widget class="QLabel" name="label_TimeoutForPlayerAction" >
<property name="alignment" >
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>
<item row="1" column="0" >
<layout class="QHBoxLayout" >
<property name="margin" >
<number>0</number>
@@ -79,184 +353,6 @@
</item>
</layout>
</item>
<item row="0" column="0" colspan="3" >
<widget class="QTreeWidget" name="treeWidget_GameList" >
<column>
<property name="text" >
<string>Game</string>
</property>
</column>
<column>
<property name="text" >
<string>Player</string>
</property>
</column>
</widget>
</item>
<item rowspan="4" row="0" column="3" >
<widget class="QGroupBox" name="groupBox_2" >
<property name="title" >
<string>Game Info</string>
</property>
<layout class="QGridLayout" >
<property name="margin" >
<number>9</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item row="3" column="1" >
<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="2" column="0" colspan="2" >
<layout class="QGridLayout" >
<property name="margin" >
<number>0</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item row="1" column="1" >
<widget class="QLabel" name="label_4" >
<property name="text" >
<string>TextLabel</string>
</property>
</widget>
</item>
<item row="2" column="1" >
<widget class="QLabel" name="label_6" >
<property name="text" >
<string>TextLabel</string>
</property>
</widget>
</item>
<item row="2" column="0" >
<widget class="QLabel" name="label_5" >
<property name="text" >
<string>&lt;html>&lt;head>&lt;meta name="qrichtext" content="1" />&lt;style type="text/css">
p, li { white-space: pre-wrap; }
&lt;/style>&lt;/head>&lt;body style=" font-family:'Nimbus Sans L'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">&lt;span style=" font-weight:600;">Hands to raise small blind:&lt;/span>&lt;/p>&lt;/body>&lt;/html></string>
</property>
</widget>
</item>
<item row="1" column="0" >
<widget class="QLabel" name="label_3" >
<property name="text" >
<string>&lt;html>&lt;head>&lt;meta name="qrichtext" content="1" />&lt;style type="text/css">
p, li { white-space: pre-wrap; }
&lt;/style>&lt;/head>&lt;body style=" font-family:'Nimbus Sans L'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">&lt;span style=" font-weight:600;">Small Blind:&lt;/span>&lt;/p>&lt;/body>&lt;/html></string>
</property>
</widget>
</item>
<item row="0" column="0" >
<widget class="QLabel" name="label" >
<property name="text" >
<string>&lt;html>&lt;head>&lt;meta name="qrichtext" content="1" />&lt;style type="text/css">
p, li { white-space: pre-wrap; }
&lt;/style>&lt;/head>&lt;body style=" font-family:'Nimbus Sans L'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">&lt;span style=" font-weight:600;">Start Cash:&lt;/span>&lt;/p>&lt;/body>&lt;/html></string>
</property>
</widget>
</item>
<item row="0" column="1" >
<widget class="QLabel" name="label_2" >
<property name="text" >
<string>TextLabel</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="1" column="0" >
<spacer>
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType" >
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" >
<size>
<width>20</width>
<height>10</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="0" colspan="2" >
<widget class="QTreeWidget" name="treeWidget" >
<property name="minimumSize" >
<size>
<width>221</width>
<height>0</height>
</size>
</property>
<column>
<property name="text" >
<string>In Game</string>
</property>
</column>
</widget>
</item>
</layout>
</widget>
</item>
<item row="3" column="0" >
<widget class="QGroupBox" name="groupBox" >
<property name="title" >
<string>Lobby-Chat</string>
</property>
<layout class="QGridLayout" >
<property name="margin" >
<number>7</number>
</property>
<property name="spacing" >
<number>0</number>
</property>
<item row="0" column="0" >
<widget class="QTextBrowser" name="textBrowser_ChatDisplay" />
</item>
<item row="1" column="0" >
<widget class="QLineEdit" name="lineEdit_ChatInput" />
</item>
</layout>
</widget>
</item>
<item row="2" column="0" >
<widget class="Line" name="line" >
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="2" column="1" colspan="2" >
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType" >
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" >
<size>
<width>20</width>
<height>10</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<tabstops>
@@ -24,6 +24,16 @@ gameLobbyDialogImpl::gameLobbyDialogImpl(QWidget *parent, ConfigFile *c)
connect( treeWidget_GameList, SIGNAL( itemClicked ( QTreeWidgetItem*, int) ), this, SLOT( gameSelected(QTreeWidgetItem*, int) ) );
pushButton_JoinGame->setEnabled(false);
pushButton_Leave->hide();
pushButton_Kick->hide();
pushButton_StartGame->hide();
treeWidget_GameList->setColumnWidth(0,250);
treeWidget_GameList->setColumnWidth(1,75);
treeWidget_GameList->setColumnWidth(2,70);
}
void gameLobbyDialogImpl::exec()
@@ -87,6 +97,9 @@ void gameLobbyDialogImpl::gameSelected(QTreeWidgetItem* item, int)
pushButton_JoinGame->setEnabled(true);
currentGameName = item->text(0);
groupBox_GameInfo->setEnabled(TRUE);
groupBox_GameInfo->setTitle("Game Info - " + item->text(0));
}
void gameLobbyDialogImpl::addGame(QString gameName)