Key alert settings are per-account - disable them in preferences until logged in

meow-7.2.2
Ansariel 2016-10-25 11:39:53 +02:00
parent 6595c1ed1d
commit fcccf7d3b3
3 changed files with 31 additions and 0 deletions

View File

@ -186,6 +186,12 @@ public:
virtual void setControlName(const std::string& control, LLView *context = NULL);
LLControlVariable* getControlVariable() { return mControlVariable; }
// <FS:Ansariel> Accessors for other ControlVariables
LLControlVariable* getEnabledControlVariable() { return mEnabledControlVariable; }
LLControlVariable* getDisabledControlVariable() { return mDisabledControlVariable; }
LLControlVariable* getMakeVisibleControlVariable() { return mMakeVisibleControlVariable; }
LLControlVariable* getMakeInvisibleControlVariable() { return mMakeInvisibleControlVariable; }
// </FS:Ansariel>
void setEnabledControlVariable(LLControlVariable* control);
void setDisabledControlVariable(LLControlVariable* control);

View File

@ -1081,6 +1081,18 @@ void LLFloaterPreference::onOpen(const LLSD& key)
// <FS:Ansariel> FIRE-17630: Properly disable per-account settings backup list
getChildView("restore_per_account_disable_cover")->setVisible(FALSE);
// <FS:Ansariel> Keyword settings are per-account; enable after logging in
LLPanel* keyword_panel = getChild<LLPanel>("ChatKeywordAlerts");
for (child_list_t::const_iterator iter = keyword_panel->getChildList()->begin();
iter != keyword_panel->getChildList()->end(); ++iter)
{
LLUICtrl* child = static_cast<LLUICtrl*>(*iter);
LLControlVariable* enabled_control = child->getEnabledControlVariable();
BOOL enabled = !enabled_control || enabled_control->getValue().asBoolean();
child->setEnabled(enabled);
}
// </FS:Ansariel>
}
gAgent.sendAgentUserInfoRequest();

View File

@ -1744,6 +1744,7 @@
name="ChatKeywordAlerts">
<check_box
enabled="false"
layout="topleft"
follows="left|top"
top="5"
@ -1754,6 +1755,7 @@
name="FSKeywordOn"
label="Enable Keyword Alerts"/>
<check_box
enabled="false"
enabled_control="FSKeywordOn"
layout="topleft"
follows="left|top"
@ -1765,6 +1767,7 @@
name="FSKeywordInChat"
label="Look for Keywords In Local Chat"/>
<check_box
enabled="false"
enabled_control="FSKeywordOn"
layout="topleft"
follows="left|top"
@ -1776,6 +1779,7 @@
name="FSKeywordInIM"
label="Look for Keywords In IMs and Group Chat"/>
<check_box
enabled="false"
enabled_control="FSKeywordOn"
layout="topleft"
follows="left|top"
@ -1787,6 +1791,7 @@
name="FSKeywordSpeakersName"
label="Check sender's name for keywords"/>
<check_box
enabled="false"
enabled_control="FSKeywordOn"
layout="topleft"
follows="left|top"
@ -1798,6 +1803,7 @@
name="FSKeywordCaseSensitive"
label="All Keywords are case-sensitive"/>
<check_box
enabled="false"
enabled_control="FSKeywordOn"
layout="topleft"
follows="left|top"
@ -1819,6 +1825,7 @@
Keywords (separated by commas):
</text>
<text_editor
enabled="false"
border_visible="true"
bg_readonly_color="MouseGray"
enabled_control="FSKeywordOn"
@ -1836,6 +1843,7 @@
word_wrap="true"/>
<check_box
enabled="false"
enabled_control="FSKeywordOn"
layout="topleft"
follows="left|top"
@ -1848,6 +1856,7 @@
label="Enable Color Alert"/>
<color_swatch
enabled="false"
enabled_control="FSKeywordOn"
control_name="FSKeywordColor"
border.border_thickness="0"
@ -1862,6 +1871,7 @@
tool_tip="Click to open color picker"/>
<check_box
enabled="false"
enabled_control="FSKeywordOn"
layout="topleft"
follows="left|top"
@ -1884,6 +1894,7 @@
Alert Sound UUID:
</text>
<line_editor
enabled="false"
enabled_control="PlayModeUISndFSKeywordSound"
follows="left|top"
left_pad="5"
@ -1893,6 +1904,7 @@
control_name="UISndFSKeywordSound"
width="250"/>
<button
enabled="false"
enabled_control="PlayModeUISndFSKeywordSound"
follows="left|top"
name="Prev_UISndFSKeywordSound"
@ -1908,6 +1920,7 @@
parameter="UISndFSKeywordSound"/>
</button>
<button
enabled="false"
enabled_control="PlayModeUISndFSKeywordSound"
follows="left|top"
name="Def_UISndFSKeywordSound"