diff --git a/indra/newview/app_settings/settings_ascent.xml b/indra/newview/app_settings/settings_ascent.xml index 41207d047..3f72a33fe 100644 --- a/indra/newview/app_settings/settings_ascent.xml +++ b/indra/newview/app_settings/settings_ascent.xml @@ -785,6 +785,17 @@ Value 1 + SinguShowMutedLocal + + Comment + Show muted chat in local chat + Persist + 1 + Type + Boolean + Value + 0 + UseWebProfiles Comment diff --git a/indra/newview/llfloaterchat.cpp b/indra/newview/llfloaterchat.cpp index 8c8159927..14236655b 100644 --- a/indra/newview/llfloaterchat.cpp +++ b/indra/newview/llfloaterchat.cpp @@ -93,11 +93,9 @@ LLFloaterChat::LLFloaterChat(const LLSD& seed) // do not automatically open singleton floaters (as result of getInstance()) LLUICtrlFactory::getInstance()->buildFloater(this, "floater_chat_history.xml", &getFactoryMap(), /*no_open =*/false); - LLTextEditor* history_editor_with_mute = getChild("Chat History Editor with mute"); - getChild("show mutes")->setCommitCallback(boost::bind(&LLFloaterChat::onClickToggleShowMute, this, _2, getChild("Chat History Editor"), history_editor_with_mute)); - history_editor_with_mute->setVisible(false); - getChild("chat_history_open")->setCommitCallback(boost::bind(show_log_browser, "chat", "chat")); - getChildView("translate chat")->setEnabled(LLTranslate::isTranslationConfigured()); + LLComboBox* combo = getChild("history_combo"); + combo->setCommitCallback(boost::bind(&LLFloaterChat::onFlyout, this, combo, _2)); + adjustDynamics(combo, true); } LLFloaterChat::~LLFloaterChat() @@ -337,18 +335,36 @@ void LLFloaterChat::setHistoryCursorAndScrollToEnd() } } - -//static -void LLFloaterChat::onClickToggleShowMute(bool show_mute, LLTextEditor* history_editor, LLTextEditor* history_editor_with_mute) +void LLFloaterChat::adjustDynamics(LLComboBox* combo, bool init) { - history_editor->setVisible(!show_mute); - history_editor_with_mute->setVisible(show_mute); - (show_mute ? history_editor_with_mute : history_editor)->setCursorAndScrollToEnd(); + bool translate(gSavedSettings.getBOOL("TranslateChat")); + bool muted(gSavedSettings.getBOOL("SinguShowMutedLocal")); + if (!init) + { + combo->remove(getString(translate ? "translate off" : "translate on")); + combo->remove(getString(muted ? "show muted text" : "hide muted text")); + } + + combo->add(getString(muted ? "hide muted text" : "show muted text"), 1); + if (LLTranslate::isTranslationConfigured()) + combo->add(getString(translate ? "translate on" : "translate off"), 2); } -void LLFloaterChat::showTranslationCheckbox(bool show) +void LLFloaterChat::onFlyout(LLComboBox* ctrl, const LLSD& val) { - getChildView("translate chat")->setEnabled(show); + if (val.isUndefined()) + show_log_browser("chat", "chat"); + else + { + LLControlVariable* control(gSavedSettings.getControl(val.asInteger() == 1 ? "SinguShowMutedLocal" : "TranslateChat")); + control->set(!control->get()); + adjustDynamics(ctrl); + } +} + +void LLFloaterChat::showTranslationCheckbox() +{ + adjustDynamics(getChild("history_combo")); } // Put a line of chat in all the right places diff --git a/indra/newview/llfloaterchat.h b/indra/newview/llfloaterchat.h index 7ff153c11..c15a5d24d 100644 --- a/indra/newview/llfloaterchat.h +++ b/indra/newview/llfloaterchat.h @@ -70,9 +70,10 @@ public: static void triggerAlerts(const std::string& text); - void onClickToggleShowMute(bool show_mute, class LLTextEditor* history_editor, LLTextEditor* history_editor_with_mute); + void adjustDynamics(class LLComboBox* combo, bool init = false); + void onFlyout(LLComboBox* ctrl, const LLSD& val); static void chatFromLogFile(LLLogChat::ELogLineType type, std::string line, void* userdata); - void showTranslationCheckbox(bool show); + void showTranslationCheckbox(); static void loadHistory(); static void* createSpeakersPanel(void* data); static void* createChatPanel(void* data); diff --git a/indra/newview/llpaneltranslationsettings.cpp b/indra/newview/llpaneltranslationsettings.cpp index 5fd8a220a..c9419d610 100644 --- a/indra/newview/llpaneltranslationsettings.cpp +++ b/indra/newview/llpaneltranslationsettings.cpp @@ -315,6 +315,6 @@ void LLPanelTranslationSettings::apply() gSavedSettings.setString("TranslationService", getSelectedService()); gSavedSettings.setString("BingTranslateAPIKey", getEnteredBingKey()); gSavedSettings.setString("GoogleTranslateAPIKey", getEnteredGoogleKey()); - LLFloaterChat::getInstance()->showTranslationCheckbox(LLTranslate::isTranslationConfigured()); + LLFloaterChat::getInstance()->showTranslationCheckbox(); } diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index 4a75bc8fc..45609976b 100644 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -1328,7 +1328,7 @@ void LLViewerRegion::setSimulatorFeatures(const LLSD& sim_features) std::stringstream str; LLSDSerialize::toPrettyXML(sim_features, str); - LL_DEBUGS("SimFeatures") << "\n" << str.str() << LL_ENDL; + LL_DEBUGS("SimFeatures") << '\n' << str.str() << LL_ENDL; mSimulatorFeatures = sim_features; mFeaturesReceived = true; diff --git a/indra/newview/skins/default/xui/de/floater_chat_history.xml b/indra/newview/skins/default/xui/de/floater_chat_history.xml index 947af1926..f45d7679d 100644 --- a/indra/newview/skins/default/xui/de/floater_chat_history.xml +++ b/indra/newview/skins/default/xui/de/floater_chat_history.xml @@ -14,9 +14,6 @@ Gesten - - -