summaryrefslogtreecommitdiff
path: root/indra/llui
diff options
context:
space:
mode:
authorandreykproductengine <andreykproductengine@lindenlab.com>2019-09-05 17:15:57 +0300
committerandreykproductengine <andreykproductengine@lindenlab.com>2019-09-05 17:15:57 +0300
commite29b3605c31e2e1cbbc932ce75b327f98b70f513 (patch)
tree6f6c3bd3aeb51935e270b2e281583fe4a48d7078 /indra/llui
parent611e0a2e38d624ed22270f2148323c320df5cc39 (diff)
SL-11315 Viewer asks to play media and retains selected choice
Diffstat (limited to 'indra/llui')
-rw-r--r--indra/llui/llnotifications.cpp17
-rw-r--r--indra/llui/llnotifications.h4
2 files changed, 14 insertions, 7 deletions
diff --git a/indra/llui/llnotifications.cpp b/indra/llui/llnotifications.cpp
index 7bafd711cb..2e6dc6731b 100644
--- a/indra/llui/llnotifications.cpp
+++ b/indra/llui/llnotifications.cpp
@@ -68,7 +68,8 @@ LLNotificationForm::FormIgnore::FormIgnore()
control("control"),
invert_control("invert_control", false),
save_option("save_option", false),
- session_only("session_only", false)
+ session_only("session_only", false),
+ checkbox_only("checkbox_only", false)
{}
LLNotificationForm::FormButton::FormButton()
@@ -195,9 +196,14 @@ LLNotificationForm::LLNotificationForm(const std::string& name, const LLNotifica
{
if (p.ignore.isProvided())
{
+ // For all cases but IGNORE_CHECKBOX_ONLY this is name for use in preferences
mIgnoreMsg = p.ignore.text;
- if (!p.ignore.save_option)
+ if (p.ignore.checkbox_only)
+ {
+ mIgnore = IGNORE_CHECKBOX_ONLY;
+ }
+ else if (!p.ignore.save_option)
{
mIgnore = p.ignore.session_only ? IGNORE_WITH_DEFAULT_RESPONSE_SESSION_ONLY : IGNORE_WITH_DEFAULT_RESPONSE;
}
@@ -214,7 +220,7 @@ LLNotificationForm::LLNotificationForm(const std::string& name, const LLNotifica
mIgnoreSetting = LLUI::sSettingGroups["config"]->getControl(p.ignore.control);
mInvertSetting = p.ignore.invert_control;
}
- else
+ else if (mIgnore > IGNORE_NO)
{
LLUI::sSettingGroups["ignores"]->declareBOOL(name, show_notification, "Show notification with this name", LLControlVariable::PERSIST_NONDFT);
mIgnoreSetting = LLUI::sSettingGroups["ignores"]->getControl(name);
@@ -388,13 +394,12 @@ LLControlVariablePtr LLNotificationForm::getIgnoreSetting()
bool LLNotificationForm::getIgnored()
{
bool show = true;
- if (mIgnore != LLNotificationForm::IGNORE_NO
+ if (mIgnore > LLNotificationForm::IGNORE_NO
&& mIgnoreSetting)
{
show = mIgnoreSetting->getValue().asBoolean();
if (mInvertSetting) show = !show;
}
-
return !show;
}
@@ -695,7 +700,7 @@ void LLNotification::respond(const LLSD& response)
mTemporaryResponder = false;
}
- if (mForm->getIgnoreType() != LLNotificationForm::IGNORE_NO)
+ if (mForm->getIgnoreType() > LLNotificationForm::IGNORE_NO)
{
mForm->setIgnored(mIgnored);
if (mIgnored && mForm->getIgnoreType() == LLNotificationForm::IGNORE_WITH_LAST_RESPONSE)
diff --git a/indra/llui/llnotifications.h b/indra/llui/llnotifications.h
index 1509446920..62cf41256b 100644
--- a/indra/llui/llnotifications.h
+++ b/indra/llui/llnotifications.h
@@ -180,6 +180,7 @@ public:
Optional<std::string> control;
Optional<bool> invert_control;
Optional<bool> session_only;
+ Optional<bool> checkbox_only;
FormIgnore();
};
@@ -232,7 +233,8 @@ public:
typedef enum e_ignore_type
{
- IGNORE_NO,
+ IGNORE_CHECKBOX_ONLY = -1, // ignore won't be handled, will set value/checkbox only
+ IGNORE_NO = 0,
IGNORE_WITH_DEFAULT_RESPONSE,
IGNORE_WITH_DEFAULT_RESPONSE_SESSION_ONLY,
IGNORE_WITH_LAST_RESPONSE,