This commit is contained in:
doitux
2007-06-03 22:41:53 +00:00
parent 00e0bfb5cf
commit be90c8141a
7 changed files with 25 additions and 4 deletions
+2 -1
View File
@@ -49,7 +49,7 @@ ConfigFile::ConfigFile(int argc, char **argv) : noWriteAccess(0)
if(strcmp(argv[i], "--nowriteaccess") == 0) { noWriteAccess = 1; }
}
// !!!! Revisionsnummer der Configdefaults !!!!!
configRev = 24;
configRev = 25;
//standard defaults
logOnOffDefault = "1";
@@ -163,6 +163,7 @@ ConfigFile::ConfigFile(int argc, char **argv) : noWriteAccess(0)
configList.push_back(ConfigInfo("NetTimeOutPlayerAction", CONFIG_TYPE_INT, "20"));
configList.push_back(ConfigInfo("ServerPassword", CONFIG_TYPE_STRING, ""));
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("MyName", CONFIG_TYPE_STRING, "Human Player"));
configList.push_back(ConfigInfo("MyAvatar", CONFIG_TYPE_STRING, ""));
@@ -127,6 +127,12 @@ void joinNetworkGameDialogImpl::fillServerProfileList() {
profile->QueryIntAttribute("IsIpv6", &tempInt );
if( tempInt == 1 ) { isIpv6 = "yes"; }
item->setData(3, 0, QString::fromUtf8(isIpv6.c_str()));
string isSctp = "no";
int tempInt1 = 0;
profile->QueryIntAttribute("IsSctp", &tempInt1 );
if( tempInt1 == 1 ) { isSctp = "yes"; }
item->setData(4, 0, QString::fromUtf8(isSctp.c_str()));
treeWidget->addTopLevelItem(item);
}
@@ -159,6 +165,7 @@ void joinNetworkGameDialogImpl::itemFillForm (QTreeWidgetItem* item, int column)
lineEdit_password->setText(QString::fromUtf8(profile->Attribute("Password")));
spinBox_port->setValue(QString::fromUtf8(profile->Attribute("Port")).toInt(&toIntTrue, 10));
checkBox_ipv6->setChecked(QString::fromUtf8(profile->Attribute("IsIpv6")).toInt(&toIntTrue, 10));
checkBox_sctp->setChecked(QString::fromUtf8(profile->Attribute("IsSctp")).toInt(&toIntTrue, 10));
}
@@ -200,6 +207,7 @@ void joinNetworkGameDialogImpl::saveServerProfile() {
profile1->SetAttribute("Password", lineEdit_password->text().toUtf8().constData());
profile1->SetAttribute("Port", spinBox_port->value());
profile1->SetAttribute("IsIpv6", checkBox_ipv6->isChecked());
profile1->SetAttribute("IsSctp", checkBox_sctp->isChecked());
}
break;
case QMessageBox::No:
@@ -220,6 +228,7 @@ void joinNetworkGameDialogImpl::saveServerProfile() {
profile2->SetAttribute("Password", lineEdit_password->text().toUtf8().constData());
profile2->SetAttribute("Port", spinBox_port->value());
profile2->SetAttribute("IsIpv6", checkBox_ipv6->isChecked());
profile2->SetAttribute("IsSctp", checkBox_sctp->isChecked());
}
}
+3
View File
@@ -511,6 +511,9 @@ mainWindowImpl::mainWindowImpl(ConfigFile *c, QMainWindow *parent)
myWaitingForServerGameDialog = new waitForServerToStartGameDialogImpl(this);
myAboutPokerthDialog = new aboutPokerthImpl(this);
//dialog settings
// mySettingsDialog->checkBox_useSctp->setEnabled(mySession->hasSctp());
// myJoinNetworkGameDialog->checkBox_sctp->setEnabled(mySession->hasSctp());
// //ShortCuts
// QShortcut *quitPokerTHKeys = new QShortcut(QKeySequence(Qt::Key_Control + Qt::Key_Q), this);
+2 -2
View File
@@ -39,7 +39,7 @@
<item row="0" column="1" >
<widget class="QStackedWidget" name="stackedWidget" >
<property name="currentIndex" >
<number>3</number>
<number>0</number>
</property>
<widget class="QWidget" name="page" >
<layout class="QGridLayout" >
@@ -725,7 +725,7 @@ p, li { white-space: pre-wrap; }
<number>9</number>
</property>
<property name="spacing" >
<number>6</number>
<number>15</number>
</property>
<item row="1" column="2" >
<layout class="QGridLayout" >
@@ -109,6 +109,7 @@ void settingsDialogImpl::exec() {
spinBox_serverPort->setValue(myConfig->readConfigInt("ServerPort"));
lineEdit_serverPassword->setText(QString::fromUtf8(myConfig->readConfigString("ServerPassword").c_str()));
checkBox_useIpv6->setChecked(myConfig->readConfigInt("ServerUseIpv6"));
checkBox_useSctp->setChecked(myConfig->readConfigInt("ServerUseSctp"));
@@ -187,6 +188,7 @@ void settingsDialogImpl::isAccepted() {
myConfig->writeConfigInt("ServerPort", spinBox_serverPort->value());
myConfig->writeConfigString("ServerPassword", lineEdit_serverPassword->text().toUtf8().constData());
myConfig->writeConfigInt("ServerUseIpv6", checkBox_useIpv6->isChecked());
myConfig->writeConfigInt("ServerUseSctp", checkBox_useSctp->isChecked());
// Interface
myConfig->writeConfigInt("ShowLeftToolBox", checkBox_showLeftToolbox->isChecked());
+1 -1
View File
@@ -34,7 +34,7 @@
using namespace std;
Session::Session(GuiInterface *g, ConfigFile *c)
: currentGameID(0), myNetClient(0), myNetServer(0), myGui(g), myConfig(c)
: currentGameID(0), myNetClient(0), myNetServer(0), myGui(g), myConfig(c), thisHasSctp(0)
{
}
+6
View File
@@ -63,6 +63,10 @@ public:
bool isNetworkClientRunning() const; // TODO hack
void setHasSctp ( bool theValue ) { thisHasSctp = theValue; }
bool hasSctp() const { return thisHasSctp; }
private:
int currentGameID;
@@ -74,6 +78,8 @@ private:
GuiInterface *myGui;
ConfigFile *myConfig;
bool thisHasSctp;
};