summaryrefslogtreecommitdiff
path: root/indra/newview/llfloaterpreference.cpp
diff options
context:
space:
mode:
authorBrad Payne (Vir Linden) <vir@lindenlab.com>2023-01-24 20:15:43 +0000
committerBrad Payne (Vir Linden) <vir@lindenlab.com>2023-01-24 20:15:43 +0000
commit3375e1a7b518eb40eb1814ced745266ce3a54ce7 (patch)
treef2b1281ec664e72615d11c6bd35a944d8897fa50 /indra/newview/llfloaterpreference.cpp
parentce5ac93883b71b6abf8cffa35204541e257c6b02 (diff)
parent111fc04e5df60e1d509b9ec80a1340bab4383cce (diff)
Merge branch 'DRTVWR-567' of ssh://github.com/secondlife/viewer into DRTVWR-567
Diffstat (limited to 'indra/newview/llfloaterpreference.cpp')
-rw-r--r--indra/newview/llfloaterpreference.cpp49
1 files changed, 49 insertions, 0 deletions
diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp
index 273810e8d4..6909ad513d 100644
--- a/indra/newview/llfloaterpreference.cpp
+++ b/indra/newview/llfloaterpreference.cpp
@@ -512,6 +512,7 @@ void LLFloaterPreference::saveSettings()
if (panel)
panel->saveSettings();
}
+ saveIgnoredNotifications();
}
void LLFloaterPreference::apply()
@@ -628,6 +629,8 @@ void LLFloaterPreference::cancel()
gSavedSettings.setString("PresetGraphicActive", mSavedGraphicsPreset);
LLPresetsManager::getInstance()->triggerChangeSignal();
}
+
+ restoreIgnoredNotifications();
}
void LLFloaterPreference::onOpen(const LLSD& key)
@@ -1505,6 +1508,10 @@ void LLFloaterPreference::onClickEnablePopup()
}
buildPopupLists();
+ if (!mFilterEdit->getText().empty())
+ {
+ filterIgnorableNotifications();
+ }
}
void LLFloaterPreference::onClickDisablePopup()
@@ -1520,6 +1527,10 @@ void LLFloaterPreference::onClickDisablePopup()
}
buildPopupLists();
+ if (!mFilterEdit->getText().empty())
+ {
+ filterIgnorableNotifications();
+ }
}
void LLFloaterPreference::resetAllIgnored()
@@ -3545,11 +3556,24 @@ void LLFloaterPreference::onUpdateFilterTerm(bool force)
return;
mSearchData->mRootTab->hightlightAndHide( seachValue );
+ filterIgnorableNotifications();
+
LLTabContainer *pRoot = getChild< LLTabContainer >( "pref core" );
if( pRoot )
pRoot->selectFirstTab();
}
+void LLFloaterPreference::filterIgnorableNotifications()
+{
+ bool visible = getChildRef<LLScrollListCtrl>("enabled_popups").highlightMatchingItems(mFilterEdit->getValue());
+ visible |= getChildRef<LLScrollListCtrl>("disabled_popups").highlightMatchingItems(mFilterEdit->getValue());
+
+ if (visible)
+ {
+ getChildRef<LLTabContainer>("pref core").setTabVisibility( getChild<LLPanel>("msgs"), true );
+ }
+}
+
void collectChildren( LLView const *aView, ll::prefs::PanelDataPtr aParentPanel, ll::prefs::TabContainerDataPtr aParentTabContainer )
{
if( !aView )
@@ -3638,3 +3662,28 @@ void LLFloaterPreference::collectSearchableItems()
}
mSearchDataDirty = false;
}
+
+void LLFloaterPreference::saveIgnoredNotifications()
+{
+ for (LLNotifications::TemplateMap::const_iterator iter = LLNotifications::instance().templatesBegin();
+ iter != LLNotifications::instance().templatesEnd();
+ ++iter)
+ {
+ LLNotificationTemplatePtr templatep = iter->second;
+ LLNotificationFormPtr formp = templatep->mForm;
+
+ LLNotificationForm::EIgnoreType ignore = formp->getIgnoreType();
+ if (ignore <= LLNotificationForm::IGNORE_NO)
+ continue;
+
+ mIgnorableNotifs[templatep->mName] = !formp->getIgnored();
+ }
+}
+
+void LLFloaterPreference::restoreIgnoredNotifications()
+{
+ for (std::map<std::string, bool>::iterator it = mIgnorableNotifs.begin(); it != mIgnorableNotifs.end(); ++it)
+ {
+ LLUI::getInstance()->mSettingGroups["ignores"]->setBOOL(it->first, it->second);
+ }
+}