From 8264a61692cd5dca174a4236b0f9ce37d3549dac Mon Sep 17 00:00:00 2001 From: doitux Date: Mon, 1 Jul 2013 10:29:07 +0200 Subject: [PATCH] implement: Option to disable emoticons in the chat (#172) --- src/config/configfile.cpp | 3 +- src/gui/qt/chattools/chattools.cpp | 4 +- .../qt/gui_800x480/settingsdialog_800x480.ui | 9 +- src/gui/qt/settingsdialog.ui | 351 ++++++++++-------- .../qt/settingsdialog/settingsdialogimpl.cpp | 3 + 5 files changed, 207 insertions(+), 163 deletions(-) diff --git a/src/config/configfile.cpp b/src/config/configfile.cpp index a3f72f6a..9c0b18e9 100644 --- a/src/config/configfile.cpp +++ b/src/config/configfile.cpp @@ -64,7 +64,7 @@ ConfigFile::ConfigFile(char *argv0, bool readonly) : noWriteAccess(readonly) myConfigState = OK; // !!!! Revisionsnummer der Configdefaults !!!!! - configRev = 99; + configRev = 100; //standard defaults logOnOffDefault = "1"; @@ -162,6 +162,7 @@ ConfigFile::ConfigFile(char *argv0, bool readonly) : noWriteAccess(readonly) configList.push_back(ConfigInfo("DisableSplashScreenOnStartup", CONFIG_TYPE_INT, "0")); configList.push_back(ConfigInfo("AccidentallyCallBlocker", CONFIG_TYPE_INT, "1")); configList.push_back(ConfigInfo("DontHideAvatarsOfIgnored", CONFIG_TYPE_INT, "0")); + configList.push_back(ConfigInfo("DisableChatEmoticons", CONFIG_TYPE_INT, "0")); configList.push_back(ConfigInfo("AntiPeekMode", CONFIG_TYPE_INT, "0")); configList.push_back(ConfigInfo("AlternateFKeysUserActionMode", CONFIG_TYPE_INT, "0")); configList.push_back(ConfigInfo("EnableBetInputFocusSwitch", CONFIG_TYPE_INT, "0")); diff --git a/src/gui/qt/chattools/chattools.cpp b/src/gui/qt/chattools/chattools.cpp index 0d61c736..7781ab6a 100644 --- a/src/gui/qt/chattools/chattools.cpp +++ b/src/gui/qt/chattools/chattools.cpp @@ -167,7 +167,9 @@ void ChatTools::receiveMessage(QString playerName, QString message, bool pm) if(!nickFoundOnIgnoreList) { - tempMsg = checkForEmotes(tempMsg); + if(!myConfig->readConfigInt("DisableChatEmoticons")) { + tempMsg = checkForEmotes(tempMsg); + } if(message.indexOf(QString("/me "))==0) { myTextBrowser->append(tempMsg.replace("/me ","*"+playerName+" ")+""); diff --git a/src/gui/qt/gui_800x480/settingsdialog_800x480.ui b/src/gui/qt/gui_800x480/settingsdialog_800x480.ui index d992d688..80b45ad0 100644 --- a/src/gui/qt/gui_800x480/settingsdialog_800x480.ui +++ b/src/gui/qt/gui_800x480/settingsdialog_800x480.ui @@ -320,6 +320,13 @@ + + + Disable emoticons in the chat + + + + Qt::Vertical @@ -327,7 +334,7 @@ 20 - 178 + 146 diff --git a/src/gui/qt/settingsdialog.ui b/src/gui/qt/settingsdialog.ui index f36a74a6..a6626c07 100644 --- a/src/gui/qt/settingsdialog.ui +++ b/src/gui/qt/settingsdialog.ui @@ -156,159 +156,198 @@ - - - - - Language: - - - comboBox_switchLanguage - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - - Show right toolbox - - - - - - - Show fade-out animation for non-winning cards - - - - - - - Reverse order of F-Keys (F1 - F4) - - - - - - - Show buttons for small blind and big blind - - - - - - - Don't translate poker strings like check, call, raise from game table style - - - - - - - Show cards chance monitor - - - - - - - Show own cards only on mouse click - - - - - - - Show flip-card animation - - - - - - - Show left toolbox - - - - - - - Disable splashscreen on startup - - - - - - - - - Network / Internet Game + + + 0 - - - - - Switch keyboard focus to bet-input-field if it's your turn - - - - - - - Show country flag in the corner of avatar - - - - - - - Activate the "accidentally call after big raise" blocker - - - - - - - Do not hide avatars of players which are on the ignore list - - - - + + + Common + + + + + + + + Language: + + + comboBox_switchLanguage + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + Show right toolbox + + + + + + + Show fade-out animation for non-winning cards + + + + + + + Reverse order of F-Keys (F1 - F4) + + + + + + + Show buttons for small blind and big blind + + + + + + + Don't translate poker strings like check, call, raise from game table style + + + + + + + Show cards chance monitor + + + + + + + Show own cards only on mouse click + + + + + + + Show flip-card animation + + + + + + + Show left toolbox + + + + + + + Disable splashscreen on startup + + + + + + + + + Qt::Vertical + + + + 20 + 85 + + + + + + + + + Network / Internet Game + + + + + + Qt::Vertical + + + + 20 + 221 + + + + + + + + Show country flag in the corner of avatar + + + + + + + Show lobby chat + + + + + + + Switch keyboard focus to bet-input-field if it's your turn + + + + + + + Activate the "accidentally call after big raise" blocker + + + + + + + Do not hide avatars of players which are on the ignore list + + + + + + + Disable emoticons in the chat + + + + + - - - - Qt::Vertical - - - - 400 - 111 - - - - @@ -1846,14 +1885,7 @@ p, li { white-space: pre-wrap; } - - - - Show lobby chat - - - - + Qt::Vertical @@ -1866,7 +1898,7 @@ p, li { white-space: pre-wrap; } - + Automatically leave the table after the game finished @@ -3984,7 +4016,6 @@ p, li { white-space: pre-wrap; } comboBox_internetGameType checkBox_UseInternetGamePassword lineEdit_InternetGamePassword - checkBox_UseLobbyChat treeWidget_internetGameIgnoredPlayers pushButton_internetGameRemoveIgnoredPlayer pushButton_HumanPlayerAvatar diff --git a/src/gui/qt/settingsdialog/settingsdialogimpl.cpp b/src/gui/qt/settingsdialog/settingsdialogimpl.cpp index f4dfdd20..6bedb319 100644 --- a/src/gui/qt/settingsdialog/settingsdialogimpl.cpp +++ b/src/gui/qt/settingsdialog/settingsdialogimpl.cpp @@ -292,6 +292,7 @@ void settingsDialogImpl::prepareDialog() checkBox_disableSplashscreen->setChecked(myConfig->readConfigInt("DisableSplashScreenOnStartup")); checkBox_enableAccidentallyCallBlocker->setChecked(myConfig->readConfigInt("AccidentallyCallBlocker")); checkBox_dontHideAvatarsOfIgnored->setChecked(myConfig->readConfigInt("DontHideAvatarsOfIgnored")); + checkBox_disableChatEmoticons->setChecked(myConfig->readConfigInt("DisableChatEmoticons")); //S t y l e @@ -740,6 +741,8 @@ void settingsDialogImpl::isAccepted() myConfig->writeConfigInt("EnableBetInputFocusSwitch", checkBox_enableBetInputFocusSwitch->isChecked()); myConfig->writeConfigInt("AccidentallyCallBlocker", checkBox_enableAccidentallyCallBlocker->isChecked()); myConfig->writeConfigInt("DontHideAvatarsOfIgnored", checkBox_dontHideAvatarsOfIgnored->isChecked()); + myConfig->writeConfigInt("DisableChatEmoticons", checkBox_disableChatEmoticons->isChecked()); + myConfig->writeConfigInt("FlipsideTux", radioButton_flipsideTux->isChecked()); myConfig->writeConfigInt("FlipsideOwn", radioButton_flipsideOwn->isChecked());