From d8ea018ffcb44dea20232f2e09b0690aae1d5414 Mon Sep 17 00:00:00 2001 From: doitux Date: Wed, 24 Mar 2010 22:21:18 +0000 Subject: [PATCH] GUI: new game types and game name fields in settings and createinternetgame dialogs --- src/config/configfile.cpp | 5 +- src/gui/qt/createinternetgamedialog.ui | 289 +++++++++++------- .../createinternetgamedialogimpl.cpp | 3 +- .../gamelobbydialog/gamelobbydialogimpl.cpp | 2 +- src/gui/qt/resources/pokerth.qrc | 1 + src/gui/qt/resources/registered.png | Bin 0 -> 726 bytes src/gui/qt/settingsdialog.ui | 216 +++++++++---- .../qt/settingsdialog/settingsdialogimpl.cpp | 8 +- 8 files changed, 334 insertions(+), 190 deletions(-) create mode 100644 src/gui/qt/resources/registered.png diff --git a/src/config/configfile.cpp b/src/config/configfile.cpp index 40e17a37..d5f57830 100644 --- a/src/config/configfile.cpp +++ b/src/config/configfile.cpp @@ -48,7 +48,7 @@ ConfigFile::ConfigFile(char *argv0, bool readonly) : noWriteAccess(readonly) myQtToolsInterface = CreateQtToolsWrapper(); // !!!! Revisionsnummer der Configdefaults !!!!! - configRev = 79; + configRev = 81; //standard defaults logOnOffDefault = "1"; @@ -210,7 +210,8 @@ ConfigFile::ConfigFile(char *argv0, bool readonly) : noWriteAccess(readonly) configList.push_back(ConfigInfo("AvatarServerAddress", CONFIG_TYPE_STRING, "")); configList.push_back(ConfigInfo("UseInternetGamePassword", CONFIG_TYPE_INT, "0")); configList.push_back(ConfigInfo("InternetGamePassword", CONFIG_TYPE_STRING, "")); - configList.push_back(ConfigInfo("InternetGameRankingMode", CONFIG_TYPE_INT, "0")); + configList.push_back(ConfigInfo("InternetGameType", CONFIG_TYPE_INT, "0")); + configList.push_back(ConfigInfo("InternetGameName", CONFIG_TYPE_STRING, "My Online Game")); configList.push_back(ConfigInfo("UseLobbyChat", CONFIG_TYPE_INT, "1")); configList.push_back(ConfigInfo("UseAdminIRC", CONFIG_TYPE_INT, "0")); configList.push_back(ConfigInfo("AdminIRCServerAddress", CONFIG_TYPE_STRING, "chat.freenode.net")); diff --git a/src/gui/qt/createinternetgamedialog.ui b/src/gui/qt/createinternetgamedialog.ui index 72971737..39718df9 100644 --- a/src/gui/qt/createinternetgamedialog.ui +++ b/src/gui/qt/createinternetgamedialog.ui @@ -6,111 +6,92 @@ 0 0 - 284 - 342 + 303 + 390 Create Internet Game - - - 9 - - - 6 - + Internet Game Settings - - - - - Maximum number of players: - - - spinBox_quantityPlayers - - + + + + + + + Default game name: + + + + + + + - - - - 2 - - - 10 - - - 10 - - - - - - - Start Cash: - - - spinBox_startCash - - - - - - - - - - $ - - - 1000 - - - 1000000 - - - 50 - - - 2000 - - - - - - - Blinds - - - - 0 - - - + + + + + + Game type: + + + + + + + + 0 + 0 + + + - Use saved blinds settings + Standard - - true + + + :/gfx/player_play.png:/gfx/player_play.png - - - - + + - Change blinds settings ... + Registered players only - - - - + + + :/gfx/registered.png:/gfx/registered.png + + + + + Invited players only + + + + :/gfx/list_add_user.png:/gfx/list_add_user.png + + + + + Ranking game + + + + :/gfx/cup.png:/gfx/cup.png + + + + + - + 6 @@ -142,6 +123,97 @@ + + + Qt::Horizontal + + + + + + + Maximum number of players: + + + spinBox_quantityPlayers + + + + + + + 2 + + + 10 + + + 10 + + + + + + + Start Cash: + + + spinBox_startCash + + + + + + + + + + $ + + + 1000 + + + 1000000 + + + 50 + + + 2000 + + + + + + + Blinds + + + + 0 + + + + + Use saved blinds settings + + + true + + + + + + + Change blinds settings ... + + + + + + + @@ -157,17 +229,7 @@ - - - - Delay between hands: - - - spinBox_netDelayBetweenHands - - - - + s @@ -183,7 +245,17 @@ - + + + + Delay between hands: + + + spinBox_netDelayBetweenHands + + + + @@ -205,23 +277,6 @@ - - - - This game will affect players ranking level - - - This game will affect players ranking level - - - Ranking game mode - - - - :/gfx/cup.png:/gfx/cup.png - - - diff --git a/src/gui/qt/createinternetgamedialog/createinternetgamedialogimpl.cpp b/src/gui/qt/createinternetgamedialog/createinternetgamedialogimpl.cpp index 396f7385..a680966b 100644 --- a/src/gui/qt/createinternetgamedialog/createinternetgamedialogimpl.cpp +++ b/src/gui/qt/createinternetgamedialog/createinternetgamedialogimpl.cpp @@ -99,7 +99,8 @@ void createInternetGameDialogImpl::fillFormular() { myChangeCompleteBlindsDialog->spinBox_afterThisAlwaysRaiseValue->setValue(myConfig->readConfigInt("NetAfterMBAlwaysRaiseValue")); myChangeCompleteBlindsDialog->radioButton_afterThisStayAtLastBlind->setChecked(myConfig->readConfigInt("NetAfterMBStayAtLastBlind")); - checkBox_rankingMode->setChecked(myConfig->readConfigInt("InternetGameRankingMode")); + comboBox_gameType->setCurrentIndex(myConfig->readConfigInt("InternetGameType")); + lineEdit_gameName->setText(QString::fromUtf8(myConfig->readConfigString("InternetGameName").c_str())); } void createInternetGameDialogImpl::showDialog() { diff --git a/src/gui/qt/gamelobbydialog/gamelobbydialogimpl.cpp b/src/gui/qt/gamelobbydialog/gamelobbydialogimpl.cpp index 773825d5..3f4bd40f 100644 --- a/src/gui/qt/gamelobbydialog/gamelobbydialogimpl.cpp +++ b/src/gui/qt/gamelobbydialog/gamelobbydialogimpl.cpp @@ -582,7 +582,7 @@ void gameLobbyDialogImpl::clearDialog() pushButton_joinAnyGame->setEnabled(false); QStringList headerList; - headerList << tr("Game") << tr("Players") << tr("State") << tr("R") << tr("P"); + headerList << tr("Game") << tr("Players") << tr("State") << tr("T") << tr("P"); myGameListModel->setHorizontalHeaderLabels(headerList); treeView_GameList->setColumnWidth(0,220); treeView_GameList->setColumnWidth(1,65); diff --git a/src/gui/qt/resources/pokerth.qrc b/src/gui/qt/resources/pokerth.qrc index 8a4a02fe..5d8b9907 100644 --- a/src/gui/qt/resources/pokerth.qrc +++ b/src/gui/qt/resources/pokerth.qrc @@ -35,5 +35,6 @@ fill-color.png lock.png cup.png + registered.png diff --git a/src/gui/qt/resources/registered.png b/src/gui/qt/resources/registered.png new file mode 100644 index 0000000000000000000000000000000000000000..84e345d22430175e80c4ea1f1f17e6790649ee35 GIT binary patch literal 726 zcmV;{0xA88P)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L00!&;00!&<9(6c100007bV*G`2iOY{ z7a2C-AH01400LG?L_t(|+KrK2NK3O( zt1}KT&;|T(yOCwtC`po#_0k7ph9JvdOL^V;h3l;{2P{)smPaJXL|`(R!U9vMn@q;+ zw^z~I)5VRZcy?}fbNa00YRQt%#X%S&(MZ=zpTpfZ^$5qeH`waqS#O@X&Ms zw`tRn7yOwXN}hd>GX8`M)jn289%?QISxBuwU-kf#VSyA%jF1G>A++hoT)FFEUQwwo zQP5J$P~{x}4q!3nf{-NOa}u0>i0#f8pNHMtJT-@T(?Mned04GhfF)xm>J5w%nu5@m zs~QJ+*X_i1bdD|CavAj%l9rZ+#bN; - + QLabel { font-weight: bold; } @@ -1464,14 +1464,14 @@ p, li { white-space: pre-wrap; } - + Qt::Horizontal - + <html><head><meta name="qrichtext" content="1" /><style type="text/css"> @@ -1484,19 +1484,13 @@ p, li { white-space: pre-wrap; } - + Internet Server - - 5 - - - 5 - - + Automatic Server Configuration URL @@ -1524,7 +1518,7 @@ p, li { white-space: pre-wrap; } - + @@ -1598,47 +1592,148 @@ p, li { white-space: pre-wrap; } + + + + + + Use IPv6 + + + + + + + <a href="http://en.wikipedia.org/wiki/Ipv6">What is this?</a> + + + true + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Use SCTP + + + + + + + <a href="http://en.wikipedia.org/wiki/Stream_Control_Transmission_Protocol">What is this?</a> + + + true + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + - - - - Use IPv6 - - - - - - - <a href="http://en.wikipedia.org/wiki/Ipv6">What is this?</a> - - - true - - - - - - - Use SCTP - - - - - - - <a href="http://en.wikipedia.org/wiki/Stream_Control_Transmission_Protocol">What is this?</a> - - - true - - - - + + + + + + Default game name: + + + + + + + + + + + + + + Default game type: + + + + + + + + 0 + 0 + + + + + Standard + + + + :/gfx/player_play.png:/gfx/player_play.png + + + + + Registered players only + + + + :/gfx/registered.png:/gfx/registered.png + + + + + Invited players only + + + + :/gfx/list_add_user.png:/gfx/list_add_user.png + + + + + Ranking game + + + + :/gfx/cup.png:/gfx/cup.png + + + + + + + 0 @@ -1666,7 +1761,14 @@ p, li { white-space: pre-wrap; } - + + + + Show lobby chat + + + + Qt::Vertical @@ -1679,24 +1781,6 @@ p, li { white-space: pre-wrap; } - - - - Show lobby chat - - - - - - - Use ranking mode (this game will affect players online ranking level) - - - - :/gfx/cup.png:/gfx/cup.png - - - diff --git a/src/gui/qt/settingsdialog/settingsdialogimpl.cpp b/src/gui/qt/settingsdialog/settingsdialogimpl.cpp index 98d7a7da..6009ee60 100644 --- a/src/gui/qt/settingsdialog/settingsdialogimpl.cpp +++ b/src/gui/qt/settingsdialog/settingsdialogimpl.cpp @@ -208,7 +208,8 @@ void settingsDialogImpl::exec() { lineEdit_InternetGamePassword->setText(QString::fromUtf8(myConfig->readConfigString("InternetGamePassword").c_str())); } checkBox_UseLobbyChat->setChecked(myConfig->readConfigInt("UseLobbyChat")); - checkBox_InternetGameRankingMode->setChecked(myConfig->readConfigInt("InternetGameRankingMode")); + comboBox_internetGameType->setCurrentIndex(myConfig->readConfigInt("InternetGameType")); + lineEdit_internetGameName->setText(QString::fromUtf8(myConfig->readConfigString("InternetGameName").c_str())); //Interface comboBox_switchLanguage->setCurrentIndex(comboBox_switchLanguage->findData(QString::fromUtf8(myConfig->readConfigString("Language").c_str()).section('_', 0, 0))); @@ -528,8 +529,9 @@ void settingsDialogImpl::isAccepted() { myConfig->writeConfigInt("UseInternetGamePassword", checkBox_UseInternetGamePassword->isChecked()); myConfig->writeConfigString("InternetGamePassword", lineEdit_InternetGamePassword->text().toUtf8().constData()); myConfig->writeConfigInt("UseLobbyChat", checkBox_UseLobbyChat->isChecked()); - myConfig->writeConfigInt("InternetGameRankingMode", checkBox_InternetGameRankingMode->isChecked()); - + myConfig->writeConfigInt("InternetGameType", comboBox_internetGameType->currentIndex()); + myConfig->writeConfigString("InternetGameName", lineEdit_internetGameName->text().toUtf8().constData()); + // Interface myConfig->writeConfigString("Language", comboBox_switchLanguage->itemData(comboBox_switchLanguage->currentIndex()).toString().toUtf8().constData()); myConfig->writeConfigInt("ShowLeftToolBox", checkBox_showLeftToolbox->isChecked());