From a4a62597ca2303d0dd606169119efa6a96178283 Mon Sep 17 00:00:00 2001 From: doitux Date: Sat, 25 Aug 2007 20:34:41 +0000 Subject: [PATCH] add internetgamesettings --- src/config/configfile.cpp | 6 + src/gui/qt/createinternetgamedialog.ui | 3 + src/gui/qt/settingsdialog.ui | 128 +++++++++++++----- .../qt/settingsdialog/settingsdialogimpl.cpp | 16 ++- 4 files changed, 116 insertions(+), 37 deletions(-) diff --git a/src/config/configfile.cpp b/src/config/configfile.cpp index e482b34e..f67d96ea 100644 --- a/src/config/configfile.cpp +++ b/src/config/configfile.cpp @@ -169,6 +169,12 @@ ConfigFile::ConfigFile(int argc, char **argv) : noWriteAccess(0) configList.push_back(ConfigInfo("ServerUseIpv6", CONFIG_TYPE_INT, "0")); configList.push_back(ConfigInfo("ServerUseSctp", CONFIG_TYPE_INT, "0")); configList.push_back(ConfigInfo("ServerPort", CONFIG_TYPE_INT, "7234")); + configList.push_back(ConfigInfo("InternetServerAddress", CONFIG_TYPE_STRING, "pokerth.dyndns.org")); + configList.push_back(ConfigInfo("InternetServerPort", CONFIG_TYPE_INT, "7234")); + configList.push_back(ConfigInfo("InternetServerUseIpv6", CONFIG_TYPE_INT, "0")); + configList.push_back(ConfigInfo("InternetServerUseSctp", CONFIG_TYPE_INT, "0")); + configList.push_back(ConfigInfo("UseInternetGamePassword", CONFIG_TYPE_INT, "0")); + configList.push_back(ConfigInfo("InternetGamePassword", CONFIG_TYPE_STRING, "")); configList.push_back(ConfigInfo("MyName", CONFIG_TYPE_STRING, "Human Player")); configList.push_back(ConfigInfo("MyAvatar", CONFIG_TYPE_STRING, "")); configList.push_back(ConfigInfo("Opponent1Name", CONFIG_TYPE_STRING, "Player 1")); diff --git a/src/gui/qt/createinternetgamedialog.ui b/src/gui/qt/createinternetgamedialog.ui index fb98c9a9..c1367437 100644 --- a/src/gui/qt/createinternetgamedialog.ui +++ b/src/gui/qt/createinternetgamedialog.ui @@ -168,6 +168,9 @@ false + + QLineEdit::Password + diff --git a/src/gui/qt/settingsdialog.ui b/src/gui/qt/settingsdialog.ui index add7187c..4c34a6d2 100644 --- a/src/gui/qt/settingsdialog.ui +++ b/src/gui/qt/settingsdialog.ui @@ -764,7 +764,7 @@ p, li { white-space: pre-wrap; } 6 - + Qt::Vertical @@ -777,6 +777,26 @@ p, li { white-space: pre-wrap; } + + + + <html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Nimbus Sans L'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-style:italic;">Note: Default </span><span style=" font-weight:600; font-style:italic;">Game Settings</span><span style=" font-style:italic;"> like "</span>Maximum number of players", "<span style=" font-style:italic;">Start Cash" and "Small Blind" will be used </span><span style=" font-weight:600; font-style:italic;">from Network Game Settings.</span></p></body></html> + + + true + + + + + + + Qt::Horizontal + + + @@ -821,9 +841,6 @@ p, li { white-space: pre-wrap; } 60 - - QLineEdit::Password - @@ -879,6 +896,33 @@ p, li { white-space: pre-wrap; } + + + + 0 + + + 6 + + + + + Use password for private game: + + + + + + + false + + + QLineEdit::Password + + + + + @@ -892,25 +936,21 @@ p, li { white-space: pre-wrap; } - - + + - Qt::Horizontal + Qt::Vertical - - - - - - <html><head><meta name="qrichtext" content="1" /><style type="text/css"> -p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'Nimbus Sans L'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-style:italic;">Note: </span><span style=" font-weight:600; font-style:italic;">Game Settings</span><span style=" font-style:italic;"> like "</span>Maximum number of players", "<span style=" font-style:italic;">Start Cash" and "Small Blind" will be used </span><span style=" font-weight:600; font-style:italic;">from Network Game Settings.</span></p></body></html> + + QSizePolicy::Fixed - - true + + + 20 + 10 + - + @@ -2271,6 +2311,23 @@ p, li { white-space: pre-wrap; } + + + + Qt::Horizontal + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::NoButton|QDialogButtonBox::Ok + + + @@ -2322,23 +2379,6 @@ p, li { white-space: pre-wrap; } - - - - Qt::Horizontal - - - QDialogButtonBox::Cancel|QDialogButtonBox::NoButton|QDialogButtonBox::Ok - - - - - - - Qt::Horizontal - - - @@ -2489,5 +2529,21 @@ p, li { white-space: pre-wrap; } + + checkBox_UseInternetGamePassword + toggled(bool) + lineEdit_InternetGamePassword + setEnabled(bool) + + + 294 + 299 + + + 462 + 300 + + + diff --git a/src/gui/qt/settingsdialog/settingsdialogimpl.cpp b/src/gui/qt/settingsdialog/settingsdialogimpl.cpp index cfff53fd..635f996b 100644 --- a/src/gui/qt/settingsdialog/settingsdialogimpl.cpp +++ b/src/gui/qt/settingsdialog/settingsdialogimpl.cpp @@ -118,7 +118,13 @@ void settingsDialogImpl::exec() { checkBox_useIpv6->setChecked(myConfig->readConfigInt("ServerUseIpv6")); checkBox_useSctp->setChecked(myConfig->readConfigInt("ServerUseSctp")); - + //Internet Game Settings + lineEdit_InternetServerAddress->setText(QString::fromUtf8(myConfig->readConfigString("InternetServerAddress").c_str())); + spinBox_InternetServerPort->setValue(myConfig->readConfigInt("InternetServerPort")); + checkBox_InternetServerUseIpv6->setChecked(myConfig->readConfigInt("InternetServerUseIpv6")); + checkBox_InternetServerUseSctp->setChecked(myConfig->readConfigInt("InternetServerUseSctp")); + checkBox_UseInternetGamePassword->setChecked(myConfig->readConfigInt("UseInternetGamePassword")); + lineEdit_InternetGamePassword->setText(QString::fromUtf8(myConfig->readConfigString("InternetGamePassword").c_str())); //Interface checkBox_showLeftToolbox->setChecked(myConfig->readConfigInt("ShowLeftToolBox")); @@ -200,6 +206,14 @@ void settingsDialogImpl::isAccepted() { myConfig->writeConfigString("ServerPassword", lineEdit_serverPassword->text().toUtf8().constData()); myConfig->writeConfigInt("ServerUseIpv6", checkBox_useIpv6->isChecked()); myConfig->writeConfigInt("ServerUseSctp", checkBox_useSctp->isChecked()); + + //Internet Game Settings + myConfig->writeConfigString("InternetServerAddress", lineEdit_InternetServerAddress->text().toUtf8().constData()); + myConfig->writeConfigInt("InternetServerPort", spinBox_InternetServerPort->value()); + myConfig->writeConfigInt("InternetServerUseIpv6", checkBox_InternetServerUseIpv6->isChecked()); + myConfig->writeConfigInt("InternetServerUseSctp", checkBox_InternetServerUseSctp->isChecked()); + myConfig->writeConfigInt("UseInternetGamePassword", checkBox_UseInternetGamePassword->isChecked()); + myConfig->writeConfigString("InternetGamePassword", lineEdit_InternetGamePassword->text().toUtf8().constData()); // Interface myConfig->writeConfigInt("ShowLeftToolBox", checkBox_showLeftToolbox->isChecked());