From fcccf7d3b32410703cb86991c9942cb6ebe613f1 Mon Sep 17 00:00:00 2001 From: Ansariel Date: Tue, 25 Oct 2016 11:39:53 +0200 Subject: [PATCH] Key alert settings are per-account - disable them in preferences until logged in --- indra/llui/lluictrl.h | 6 ++++++ indra/newview/llfloaterpreference.cpp | 12 ++++++++++++ .../skins/default/xui/en/panel_preferences_chat.xml | 13 +++++++++++++ 3 files changed, 31 insertions(+) diff --git a/indra/llui/lluictrl.h b/indra/llui/lluictrl.h index 61739143f8..deab7fc6ee 100644 --- a/indra/llui/lluictrl.h +++ b/indra/llui/lluictrl.h @@ -186,6 +186,12 @@ public: virtual void setControlName(const std::string& control, LLView *context = NULL); LLControlVariable* getControlVariable() { return mControlVariable; } + // Accessors for other ControlVariables + LLControlVariable* getEnabledControlVariable() { return mEnabledControlVariable; } + LLControlVariable* getDisabledControlVariable() { return mDisabledControlVariable; } + LLControlVariable* getMakeVisibleControlVariable() { return mMakeVisibleControlVariable; } + LLControlVariable* getMakeInvisibleControlVariable() { return mMakeInvisibleControlVariable; } + // void setEnabledControlVariable(LLControlVariable* control); void setDisabledControlVariable(LLControlVariable* control); diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index 881927a7ed..dde02fda55 100644 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -1081,6 +1081,18 @@ void LLFloaterPreference::onOpen(const LLSD& key) // FIRE-17630: Properly disable per-account settings backup list getChildView("restore_per_account_disable_cover")->setVisible(FALSE); + + // Keyword settings are per-account; enable after logging in + LLPanel* keyword_panel = getChild("ChatKeywordAlerts"); + for (child_list_t::const_iterator iter = keyword_panel->getChildList()->begin(); + iter != keyword_panel->getChildList()->end(); ++iter) + { + LLUICtrl* child = static_cast(*iter); + LLControlVariable* enabled_control = child->getEnabledControlVariable(); + BOOL enabled = !enabled_control || enabled_control->getValue().asBoolean(); + child->setEnabled(enabled); + } + // } gAgent.sendAgentUserInfoRequest(); diff --git a/indra/newview/skins/default/xui/en/panel_preferences_chat.xml b/indra/newview/skins/default/xui/en/panel_preferences_chat.xml index 7d9d670ca0..43e04d2cf1 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_chat.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_chat.xml @@ -1744,6 +1744,7 @@ name="ChatKeywordAlerts">