This commit is contained in:
doitux
2007-01-21 14:20:15 +00:00
parent 45c447c380
commit 019ca62194
7 changed files with 51 additions and 65 deletions
+22 -22
View File
@@ -34,21 +34,21 @@ settingsDialogImpl::settingsDialogImpl(QWidget *parent, const char *name)
bool ok=TRUE;
//Player Nicks
lineEdit_humanPlayerName->setText(config.readConfig("myname", "Human Player"));
lineEdit_Opponent1Name->setText(config.readConfig("opponent1name", "Player 1"));
lineEdit_Opponent2Name->setText(config.readConfig("opponent2name", "Player 2"));
lineEdit_Opponent3Name->setText(config.readConfig("opponent3name", "Player 3"));
lineEdit_Opponent4Name->setText(config.readConfig("opponent4name", "Player 4"));
// lineEdit_humanPlayerName->setText(config.readConfig("myname", "Human Player"));
// lineEdit_Opponent1Name->setText(config.readConfig("opponent1name", "Player 1"));
// lineEdit_Opponent2Name->setText(config.readConfig("opponent2name", "Player 2"));
// lineEdit_Opponent3Name->setText(config.readConfig("opponent3name", "Player 3"));
// lineEdit_Opponent4Name->setText(config.readConfig("opponent4name", "Player 4"));
//Game Settings
spinBox_quantityPlayers->setValue(config.readConfig("numberofplayers", "5").toInt(&ok,10));
spinBox_startCash->setValue(config.readConfig("startcash", "2000").toInt(&ok,10));
spinBox_smallBlind->setValue(config.readConfig("smallblind", "10").toInt(&ok,10));
spinBox_gameSpeed->setValue(config.readConfig("gamespeed", "4").toInt(&ok,10));
checkBox_showGameSettingsDialogOnNewGame->setChecked(config.readConfig("showgamesettingsdialogonnewgame", "1").toInt(&ok,10));
// spinBox_quantityPlayers->setValue(config.readConfig("numberofplayers", "5").toInt(&ok,10));
// spinBox_startCash->setValue(config.readConfig("startcash", "2000").toInt(&ok,10));
// spinBox_smallBlind->setValue(config.readConfig("smallblind", "10").toInt(&ok,10));
// spinBox_gameSpeed->setValue(config.readConfig("gamespeed", "4").toInt(&ok,10));
// checkBox_showGameSettingsDialogOnNewGame->setChecked(config.readConfig("showgamesettingsdialogonnewgame", "1").toInt(&ok,10));
//Interface
checkBox_showToolbox->setChecked(config.readConfig("showtoolbox", "1").toInt(&ok,10));
// checkBox_showToolbox->setChecked(config.readConfig("showtoolbox", "1").toInt(&ok,10));
connect( buttonBox, SIGNAL( accepted() ), this, SLOT( isAccepted() ) );
@@ -62,20 +62,20 @@ void settingsDialogImpl::isAccepted() {
ConfigFile config;
//Player Nicks
config.writeConfig("myname", lineEdit_humanPlayerName->text());
config.writeConfig("opponent1name", lineEdit_Opponent1Name->text());
config.writeConfig("opponent2name", lineEdit_Opponent2Name->text());
config.writeConfig("opponent3name", lineEdit_Opponent3Name->text());
config.writeConfig("opponent4name", lineEdit_Opponent4Name->text());
// config.writeConfig("myname", lineEdit_humanPlayerName->text());
// config.writeConfig("opponent1name", lineEdit_Opponent1Name->text());
// config.writeConfig("opponent2name", lineEdit_Opponent2Name->text());
// config.writeConfig("opponent3name", lineEdit_Opponent3Name->text());
// config.writeConfig("opponent4name", lineEdit_Opponent4Name->text());
//Game Settings
config.writeConfig("numberofplayers", QString::number(spinBox_quantityPlayers->value(),10));
config.writeConfig("startcash", QString::number(spinBox_startCash->value(),10));
config.writeConfig("smallblind", QString::number(spinBox_smallBlind->value(),10));
config.writeConfig("gamespeed", QString::number(spinBox_gameSpeed->value(),10));
config.writeConfig("showgamesettingsdialogonnewgame", QString::number(checkBox_showGameSettingsDialogOnNewGame->isChecked(),10));
// config.writeConfig("numberofplayers", QString::number(spinBox_quantityPlayers->value(),10));
// config.writeConfig("startcash", QString::number(spinBox_startCash->value(),10));
// config.writeConfig("smallblind", QString::number(spinBox_smallBlind->value(),10));
// config.writeConfig("gamespeed", QString::number(spinBox_gameSpeed->value(),10));
// config.writeConfig("showgamesettingsdialogonnewgame", QString::number(checkBox_showGameSettingsDialogOnNewGame->isChecked(),10));
//Interface
config.writeConfig("showtoolbox", QString::number(checkBox_showToolbox->isChecked(),10));
// config.writeConfig("showtoolbox", QString::number(checkBox_showToolbox->isChecked(),10));
}