settings updated (+sound categories, -engine versions)

This commit is contained in:
doitux
2007-09-30 20:22:38 +00:00
parent 24f8c6bf31
commit 0d06041857
5 changed files with 137 additions and 159 deletions
+5 -5
View File
@@ -55,7 +55,7 @@ ConfigFile::ConfigFile(int argc, char **argv) : noWriteAccess(0)
if(strcmp(argv[i], "--nowriteaccess") == 0) { noWriteAccess = 1; }
}
// !!!! Revisionsnummer der Configdefaults !!!!!
configRev = 42;
configRev = 44;
//standard defaults
logOnOffDefault = "1";
@@ -161,11 +161,13 @@ ConfigFile::ConfigFile(int argc, char **argv) : noWriteAccess(0)
configList.push_back(ConfigInfo("ShowBlindButtons", CONFIG_TYPE_INT, "1"));
configList.push_back(ConfigInfo("AntiPeekMode", CONFIG_TYPE_INT, "0"));
configList.push_back(ConfigInfo("AlternateFKeysUserActionMode", CONFIG_TYPE_INT, "0"));
configList.push_back(ConfigInfo("PlaySoundEffects", CONFIG_TYPE_INT, "1"));
configList.push_back(ConfigInfo("SoundVolume", CONFIG_TYPE_INT, "8"));
configList.push_back(ConfigInfo("FlipsideTux", CONFIG_TYPE_INT, "1"));
configList.push_back(ConfigInfo("FlipsideOwn", CONFIG_TYPE_INT, "0"));
configList.push_back(ConfigInfo("FlipsideOwnFile", CONFIG_TYPE_STRING, ""));
configList.push_back(ConfigInfo("PlaySoundEffects", CONFIG_TYPE_INT, "1"));
configList.push_back(ConfigInfo("SoundVolume", CONFIG_TYPE_INT, "8"));
configList.push_back(ConfigInfo("PlayGameActions", CONFIG_TYPE_INT, "1"));
configList.push_back(ConfigInfo("PlayLobbyChatNotification", CONFIG_TYPE_INT, "1"));
configList.push_back(ConfigInfo("NumberOfPlayers", CONFIG_TYPE_INT, "7"));
configList.push_back(ConfigInfo("StartCash", CONFIG_TYPE_INT, "3000"));
configList.push_back(ConfigInfo("FirstSmallBlind", CONFIG_TYPE_INT, "10"));
@@ -181,7 +183,6 @@ ConfigFile::ConfigFile(int argc, char **argv) : noWriteAccess(0)
configList.push_back(ConfigInfo("AfterMBAlwaysRaiseValue", CONFIG_TYPE_INT, "0"));
configList.push_back(ConfigInfo("AfterMBStayAtLastBlind", CONFIG_TYPE_INT, "0"));
configList.push_back(ConfigInfo("GameSpeed", CONFIG_TYPE_INT, "4"));
configList.push_back(ConfigInfo("EngineVersion", CONFIG_TYPE_INT, "0"));
configList.push_back(ConfigInfo("PauseBetweenHands", CONFIG_TYPE_INT, "0"));
configList.push_back(ConfigInfo("ShowGameSettingsDialogOnNewGame", CONFIG_TYPE_INT, "1"));
configList.push_back(ConfigInfo("NetNumberOfPlayers", CONFIG_TYPE_INT, "7"));
@@ -199,7 +200,6 @@ ConfigFile::ConfigFile(int argc, char **argv) : noWriteAccess(0)
configList.push_back(ConfigInfo("NetAfterMBAlwaysRaiseValue", CONFIG_TYPE_INT, "0"));
configList.push_back(ConfigInfo("NetAfterMBStayAtLastBlind", CONFIG_TYPE_INT, "0"));
configList.push_back(ConfigInfo("NetGameSpeed", CONFIG_TYPE_INT, "4"));
configList.push_back(ConfigInfo("NetEngineVersion", CONFIG_TYPE_INT, "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"));
@@ -118,7 +118,8 @@ void LobbyChat::displayMessage(QString playerName, QString message) {
QString tempMsg;
if(message.contains(QString::fromUtf8(myConfig->readConfigString("MyName").c_str()), Qt::CaseInsensitive)) {
tempMsg = QString("<b>"+message+"</b>");
myLobby->getMyW()->getMySDLPlayer()->playSound("lobbychatnotify",0);
if(myLobby->isVisible() && myConfig->readConfigInt("PlayLobbyChatNotification"))
myLobby->getMyW()->getMySDLPlayer()->playSound("lobbychatnotify",0);
}
else {
tempMsg = message;
+2 -1
View File
@@ -1419,7 +1419,8 @@ void mainWindowImpl::refreshAction(int playerID, int playerAction) {
actionLabelArray[playerID]->setPixmap(QPixmap(myAppDataPath +"gfx/gui/table/default/action_"+actionArray[playerAction]+".png"));
//play sounds if exist
mySDLPlayer->playSound(actionArray[playerAction].toStdString(), playerID);
if(myConfig->readConfigInt("PlayGameActions"))
mySDLPlayer->playSound(actionArray[playerAction].toStdString(), playerID);
}
if (playerAction == 1) { // FOLD
+116 -142
View File
@@ -280,99 +280,6 @@ p, li { white-space: pre-wrap; }
</widget>
<widget class="QWidget" name="page_6" >
<layout class="QGridLayout" >
<property name="leftMargin" >
<number>9</number>
</property>
<property name="topMargin" >
<number>9</number>
</property>
<property name="rightMargin" >
<number>9</number>
</property>
<property name="bottomMargin" >
<number>9</number>
</property>
<property name="horizontalSpacing" >
<number>6</number>
</property>
<property name="verticalSpacing" >
<number>6</number>
</property>
<item row="2" column="0" >
<widget class="QCheckBox" name="checkBox_playSoundEffects" >
<property name="text" >
<string>Play sound effects</string>
</property>
</widget>
</item>
<item row="3" column="0" >
<layout class="QHBoxLayout" >
<property name="spacing" >
<number>6</number>
</property>
<property name="leftMargin" >
<number>0</number>
</property>
<property name="topMargin" >
<number>0</number>
</property>
<property name="rightMargin" >
<number>0</number>
</property>
<property name="bottomMargin" >
<number>0</number>
</property>
<item>
<widget class="QLabel" name="label_25" >
<property name="text" >
<string>Sound Volume:</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_soundVolume" >
<property name="minimumSize" >
<size>
<width>20</width>
<height>0</height>
</size>
</property>
<property name="text" >
<string>10</string>
</property>
</widget>
</item>
<item>
<widget class="QSlider" name="horizontalSlider_soundVolume" >
<property name="minimum" >
<number>1</number>
</property>
<property name="maximum" >
<number>10</number>
</property>
<property name="value" >
<number>8</number>
</property>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
</layout>
</item>
<item row="4" column="0" >
<spacer>
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" >
<size>
<width>20</width>
<height>281</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="0" >
<widget class="QLabel" name="label_26" >
<property name="styleSheet" >
@@ -390,6 +297,115 @@ p, li { white-space: pre-wrap; }
</property>
</widget>
</item>
<item row="2" column="0" >
<widget class="QGroupBox" name="groupBox_playSoundEffects" >
<property name="title" >
<string>Play sound effects</string>
</property>
<property name="checkable" >
<bool>true</bool>
</property>
<property name="checked" >
<bool>true</bool>
</property>
<layout class="QGridLayout" >
<item row="0" column="0" >
<layout class="QHBoxLayout" >
<property name="spacing" >
<number>6</number>
</property>
<property name="leftMargin" >
<number>0</number>
</property>
<property name="topMargin" >
<number>0</number>
</property>
<property name="rightMargin" >
<number>0</number>
</property>
<property name="bottomMargin" >
<number>0</number>
</property>
<item>
<widget class="QLabel" name="label_25" >
<property name="text" >
<string>Sound Volume:</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_soundVolume" >
<property name="minimumSize" >
<size>
<width>20</width>
<height>0</height>
</size>
</property>
<property name="text" >
<string>10</string>
</property>
</widget>
</item>
<item>
<widget class="QSlider" name="horizontalSlider_soundVolume" >
<property name="minimum" >
<number>1</number>
</property>
<property name="maximum" >
<number>10</number>
</property>
<property name="value" >
<number>8</number>
</property>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
</layout>
</item>
<item row="1" column="0" >
<widget class="QGroupBox" name="groupBox_10" >
<property name="title" >
<string>Sound Categories </string>
</property>
<layout class="QGridLayout" >
<property name="topMargin" >
<number>0</number>
</property>
<item row="0" column="0" >
<widget class="QCheckBox" name="checkBox_playGameActions" >
<property name="text" >
<string>Play game actions sounds like "check", "call", "raise"</string>
</property>
</widget>
</item>
<item row="1" column="0" >
<widget class="QCheckBox" name="checkBox_playLobbyChatNotification" >
<property name="text" >
<string>Play notifications for lobby chat</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
</item>
<item row="3" column="0" >
<spacer>
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" >
<size>
<width>400</width>
<height>321</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<widget class="QWidget" name="page_2" >
@@ -639,40 +655,20 @@ p, li { white-space: pre-wrap; }
</layout>
</item>
<item row="7" column="0" >
<layout class="QHBoxLayout" >
<item>
<widget class="QLabel" name="label_17" >
<property name="text" >
<string>Engine Version:</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="comboBox_engineVersion" >
<item>
<property name="text" >
<string>0.4 (current)</string>
</property>
</item>
</widget>
</item>
</layout>
</item>
<item row="8" column="0" >
<widget class="QCheckBox" name="checkBox_pauseBetweenHands" >
<property name="text" >
<string>Pause between hands (press "start" button to go on)</string>
</property>
</widget>
</item>
<item row="9" column="0" >
<item row="8" column="0" >
<widget class="QCheckBox" name="checkBox_showGameSettingsDialogOnNewGame" >
<property name="text" >
<string>Show game settings dialog on every new game</string>
</property>
</widget>
</item>
<item row="10" column="0" >
<item row="9" column="0" >
<spacer>
<property name="orientation" >
<enum>Qt::Vertical</enum>
@@ -680,7 +676,7 @@ p, li { white-space: pre-wrap; }
<property name="sizeHint" >
<size>
<width>400</width>
<height>161</height>
<height>181</height>
</size>
</property>
</spacer>
@@ -928,26 +924,6 @@ p, li { white-space: pre-wrap; }
</layout>
</item>
<item row="7" column="0" >
<layout class="QHBoxLayout" >
<item>
<widget class="QLabel" name="label_18" >
<property name="text" >
<string>Engine Version for computer opponents:</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="comboBox_netEngineVersion" >
<item>
<property name="text" >
<string>0.4 (current)</string>
</property>
</item>
</widget>
</item>
</layout>
</item>
<item row="8" column="0" >
<layout class="QHBoxLayout" >
<item>
<widget class="QLabel" name="label_40" >
@@ -971,14 +947,14 @@ p, li { white-space: pre-wrap; }
</item>
</layout>
</item>
<item row="9" column="0" >
<item row="8" column="0" >
<widget class="Line" name="line_7" >
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="10" column="0" >
<item row="9" column="0" >
<widget class="QGroupBox" name="groupBox_2" >
<property name="title" >
<string>Network Server Settings</string>
@@ -1076,7 +1052,7 @@ p, li { white-space: pre-wrap; }
</layout>
</widget>
</item>
<item row="11" column="0" >
<item row="10" column="0" >
<spacer>
<property name="orientation" >
<enum>Qt::Vertical</enum>
@@ -1084,7 +1060,7 @@ p, li { white-space: pre-wrap; }
<property name="sizeHint" >
<size>
<width>400</width>
<height>16</height>
<height>41</height>
</size>
</property>
</spacer>
@@ -3022,14 +2998,12 @@ p, li { white-space: pre-wrap; }
<tabstop>spinBox_startCash</tabstop>
<tabstop>spinBox_firstSmallBlind</tabstop>
<tabstop>spinBox_gameSpeed</tabstop>
<tabstop>comboBox_engineVersion</tabstop>
<tabstop>checkBox_pauseBetweenHands</tabstop>
<tabstop>checkBox_showGameSettingsDialogOnNewGame</tabstop>
<tabstop>spinBox_netQuantityPlayers</tabstop>
<tabstop>spinBox_netStartCash</tabstop>
<tabstop>spinBox_netFirstSmallBlind</tabstop>
<tabstop>spinBox_netGameSpeed</tabstop>
<tabstop>comboBox_netEngineVersion</tabstop>
<tabstop>spinBox_netTimeOutPlayerAction</tabstop>
<tabstop>spinBox_serverPort</tabstop>
<tabstop>lineEdit_serverPassword</tabstop>
@@ -72,8 +72,6 @@ settingsDialogImpl::settingsDialogImpl(QWidget *parent, ConfigFile *c, selectAva
// label_36->hide();
// spinBox_netGameSpeed->hide();
//
// label_18->hide();
// comboBox_netEngineVersion->hide();
}
void settingsDialogImpl::exec() {
@@ -123,7 +121,6 @@ void settingsDialogImpl::exec() {
spinBox_gameSpeed->setValue(myConfig->readConfigInt("GameSpeed"));
checkBox_pauseBetweenHands->setChecked(myConfig->readConfigInt("PauseBetweenHands"));
checkBox_showGameSettingsDialogOnNewGame->setChecked(myConfig->readConfigInt("ShowGameSettingsDialogOnNewGame"));
comboBox_engineVersion->setCurrentIndex(myConfig->readConfigInt("EngineVersion"));
//Network Game Settings
spinBox_netQuantityPlayers->setValue(myConfig->readConfigInt("NetNumberOfPlayers"));
@@ -136,7 +133,6 @@ void settingsDialogImpl::exec() {
radioButton_netAlwaysDoubleBlinds->setChecked(myConfig->readConfigInt("NetAlwaysDoubleBlinds"));
radioButton_netManualBlindsOrder->setChecked(myConfig->readConfigInt("NetManualBlindsOrder"));
spinBox_netGameSpeed->setValue(myConfig->readConfigInt("NetGameSpeed"));
comboBox_netEngineVersion->setCurrentIndex(myConfig->readConfigInt("NetEngineVersion"));
spinBox_netTimeOutPlayerAction->setValue(myConfig->readConfigInt("NetTimeOutPlayerAction"));
spinBox_serverPort->setValue(myConfig->readConfigInt("ServerPort"));
lineEdit_serverPassword->setText(QString::fromUtf8(myConfig->readConfigString("ServerPassword").c_str()));
@@ -168,8 +164,6 @@ void settingsDialogImpl::exec() {
checkBox_showBlindButtons->setChecked(myConfig->readConfigInt("ShowBlindButtons"));
checkBox_antiPeekMode->setChecked(myConfig->readConfigInt("AntiPeekMode"));
checkBox_alternateFKeysUserActionMode->setChecked(myConfig->readConfigInt("AlternateFKeysUserActionMode"));
checkBox_playSoundEffects->setChecked(myConfig->readConfigInt("PlaySoundEffects"));
horizontalSlider_soundVolume->setValue(myConfig->readConfigInt("SoundVolume"));
radioButton_flipsideTux->setChecked(myConfig->readConfigInt("FlipsideTux"));
radioButton_flipsideOwn->setChecked(myConfig->readConfigInt("FlipsideOwn"));
if(radioButton_flipsideOwn->isChecked()) {
@@ -178,6 +172,12 @@ void settingsDialogImpl::exec() {
}
lineEdit_OwnFlipsideFilename->setText(QString::fromUtf8(myConfig->readConfigString("FlipsideOwnFile").c_str()));
//Sound
groupBox_playSoundEffects->setChecked(myConfig->readConfigInt("PlaySoundEffects"));
horizontalSlider_soundVolume->setValue(myConfig->readConfigInt("SoundVolume"));
checkBox_playGameActions->setChecked(myConfig->readConfigInt("PlayGameActions"));
checkBox_playLobbyChatNotification->setChecked(myConfig->readConfigInt("PlayLobbyChatNotification"));
//Log
groupBox_logOnOff->setChecked(myConfig->readConfigInt("LogOnOff"));
lineEdit_logDir->setText(QString::fromUtf8(myConfig->readConfigString("LogDir").c_str()));
@@ -244,7 +244,6 @@ void settingsDialogImpl::isAccepted() {
myConfig->writeConfigInt("AlwaysDoubleBlinds", radioButton_alwaysDoubleBlinds->isChecked());
myConfig->writeConfigInt("ManualBlindsOrder", radioButton_manualBlindsOrder->isChecked());
myConfig->writeConfigInt("GameSpeed", spinBox_gameSpeed->value());
myConfig->writeConfigInt("EngineVersion", comboBox_engineVersion->currentIndex());
myConfig->writeConfigInt("PauseBetweenHands", checkBox_pauseBetweenHands->isChecked());
myConfig->writeConfigInt("ShowGameSettingsDialogOnNewGame", checkBox_showGameSettingsDialogOnNewGame->isChecked());
@@ -259,7 +258,6 @@ void settingsDialogImpl::isAccepted() {
myConfig->writeConfigInt("NetAlwaysDoubleBlinds", radioButton_netAlwaysDoubleBlinds->isChecked());
myConfig->writeConfigInt("NetManualBlindsOrder", radioButton_netManualBlindsOrder->isChecked());
myConfig->writeConfigInt("NetGameSpeed", spinBox_netGameSpeed->value());
myConfig->writeConfigInt("NetEngineVersion", comboBox_netEngineVersion->currentIndex());
myConfig->writeConfigInt("NetTimeOutPlayerAction", spinBox_netTimeOutPlayerAction->value());
myConfig->writeConfigInt("ServerPort", spinBox_serverPort->value());
myConfig->writeConfigString("ServerPassword", lineEdit_serverPassword->text().toUtf8().constData());
@@ -289,8 +287,6 @@ void settingsDialogImpl::isAccepted() {
myConfig->writeConfigInt("ShowBlindButtons", checkBox_showBlindButtons->isChecked());
myConfig->writeConfigInt("AntiPeekMode", checkBox_antiPeekMode->isChecked());
myConfig->writeConfigInt("AlternateFKeysUserActionMode", checkBox_alternateFKeysUserActionMode->isChecked());
myConfig->writeConfigInt("PlaySoundEffects", checkBox_playSoundEffects->isChecked());
myConfig->writeConfigInt("SoundVolume", horizontalSlider_soundVolume->value());
myConfig->writeConfigInt("FlipsideTux", radioButton_flipsideTux->isChecked());
myConfig->writeConfigInt("FlipsideOwn", radioButton_flipsideOwn->isChecked());
@@ -304,6 +300,12 @@ void settingsDialogImpl::isAccepted() {
}
}
//Sound
myConfig->writeConfigInt("PlaySoundEffects", groupBox_playSoundEffects->isChecked());
myConfig->writeConfigInt("SoundVolume", horizontalSlider_soundVolume->value());
myConfig->writeConfigInt("PlayGameActions", checkBox_playGameActions->isChecked());
myConfig->writeConfigInt("PlayLobbyChatNotification", checkBox_playLobbyChatNotification->isChecked());
// Log
myConfig->writeConfigInt("LogOnOff", groupBox_logOnOff->isChecked());
if (myConfig->readConfigInt("LogOnOff")) {