From 9ee82a05c5b1cde12017b82b1d176cc154bf3610 Mon Sep 17 00:00:00 2001 From: doitux Date: Tue, 27 Mar 2012 09:38:45 +0000 Subject: [PATCH] implementing: make raise-blind sound optional (#127) --- src/config/configfile.cpp | 3 ++- src/gui/qt/settingsdialog.ui | 11 +++++++++-- .../qt/settingsdialog/settingsdialogimpl.cpp | 2 ++ src/gui/qt/sound/soundevents.cpp | 18 ++++++++++-------- 4 files changed, 23 insertions(+), 11 deletions(-) diff --git a/src/config/configfile.cpp b/src/config/configfile.cpp index a9bd070e..b559ba33 100644 --- a/src/config/configfile.cpp +++ b/src/config/configfile.cpp @@ -50,7 +50,7 @@ ConfigFile::ConfigFile(char *argv0, bool readonly) : noWriteAccess(readonly) myConfigState = OK; // !!!! Revisionsnummer der Configdefaults !!!!! - configRev = 96; + configRev = 97; //standard defaults logOnOffDefault = "1"; @@ -160,6 +160,7 @@ ConfigFile::ConfigFile(char *argv0, bool readonly) : noWriteAccess(readonly) configList.push_back(ConfigInfo("PlayGameActions", CONFIG_TYPE_INT, "1")); configList.push_back(ConfigInfo("PlayLobbyChatNotification", CONFIG_TYPE_INT, "1")); configList.push_back(ConfigInfo("PlayNetworkGameNotification", CONFIG_TYPE_INT, "1")); + configList.push_back(ConfigInfo("PlayBlindRaiseNotification", CONFIG_TYPE_INT, "1")); configList.push_back(ConfigInfo("NumberOfPlayers", CONFIG_TYPE_INT, "10")); configList.push_back(ConfigInfo("StartCash", CONFIG_TYPE_INT, "5000")); configList.push_back(ConfigInfo("FirstSmallBlind", CONFIG_TYPE_INT, "10")); diff --git a/src/gui/qt/settingsdialog.ui b/src/gui/qt/settingsdialog.ui index 7a121673..9f0f73a9 100644 --- a/src/gui/qt/settingsdialog.ui +++ b/src/gui/qt/settingsdialog.ui @@ -790,14 +790,14 @@ p, li { white-space: pre-wrap; } - + Play lobby chat notifications - + Play network/internet game notifications like "player joined the game" @@ -807,6 +807,13 @@ p, li { white-space: pre-wrap; } + + + + Play blind raise notification + + + diff --git a/src/gui/qt/settingsdialog/settingsdialogimpl.cpp b/src/gui/qt/settingsdialog/settingsdialogimpl.cpp index de69f7b7..95a6d5c9 100644 --- a/src/gui/qt/settingsdialog/settingsdialogimpl.cpp +++ b/src/gui/qt/settingsdialog/settingsdialogimpl.cpp @@ -478,6 +478,7 @@ void settingsDialogImpl::prepareDialog() checkBox_playGameActions->setChecked(myConfig->readConfigInt("PlayGameActions")); checkBox_playLobbyChatNotification->setChecked(myConfig->readConfigInt("PlayLobbyChatNotification")); checkBox_playNetworkGameNotification->setChecked(myConfig->readConfigInt("PlayNetworkGameNotification")); + checkBox_playBlindRaiseSound->setChecked(myConfig->readConfigInt("PlayBlindRaiseNotification")); //Log groupBox_logOnOff->setChecked(myConfig->readConfigInt("LogOnOff")); @@ -745,6 +746,7 @@ void settingsDialogImpl::isAccepted() myConfig->writeConfigInt("PlayGameActions", checkBox_playGameActions->isChecked()); myConfig->writeConfigInt("PlayLobbyChatNotification", checkBox_playLobbyChatNotification->isChecked()); myConfig->writeConfigInt("PlayNetworkGameNotification", checkBox_playNetworkGameNotification->isChecked()); + myConfig->writeConfigInt("PlayBlindRaiseNotification", checkBox_playBlindRaiseSound->isChecked()); // Log myConfig->writeConfigInt("LogOnOff", groupBox_logOnOff->isChecked()); diff --git a/src/gui/qt/sound/soundevents.cpp b/src/gui/qt/sound/soundevents.cpp index 3bb3eab0..88221ce9 100644 --- a/src/gui/qt/sound/soundevents.cpp +++ b/src/gui/qt/sound/soundevents.cpp @@ -27,14 +27,16 @@ void SoundEvents::blindsWereSet(int sB) lastSBValue = sB; ++lastSBLevel; - if(lastSBLevel == 1 || lastSBLevel == 2) { - mySDLPlayer->playSound("blinds_raises_level1", 0); - } - if(lastSBLevel == 3 || lastSBLevel == 4) { - mySDLPlayer->playSound("blinds_raises_level2", 0); - } - if(lastSBLevel >= 5) { - mySDLPlayer->playSound("blinds_raises_level3", 0); + if(myConfig->readConfigInt("PlayBlindRaiseNotification")) { + if(lastSBLevel == 1 || lastSBLevel == 2) { + mySDLPlayer->playSound("blinds_raises_level1", 0); + } + if(lastSBLevel == 3 || lastSBLevel == 4) { + mySDLPlayer->playSound("blinds_raises_level2", 0); + } + if(lastSBLevel >= 5) { + mySDLPlayer->playSound("blinds_raises_level3", 0); + } } } }