summaryrefslogtreecommitdiff
path: root/indra/llui/llnotifications.cpp
diff options
context:
space:
mode:
authorRichard Linden <none@none>2010-10-05 14:31:07 -0700
committerRichard Linden <none@none>2010-10-05 14:31:07 -0700
commitff81c6c529ce2c7216ee2cd5aa60b7a232792fec (patch)
treea6a5a795f9e0ed6bf00ae8e79510c0d50ecff735 /indra/llui/llnotifications.cpp
parent3081f89744ab527af4c843bdf898654d4ba87b57 (diff)
changed format of notification_visibility rules to be cleaner
Diffstat (limited to 'indra/llui/llnotifications.cpp')
-rw-r--r--indra/llui/llnotifications.cpp45
1 files changed, 27 insertions, 18 deletions
diff --git a/indra/llui/llnotifications.cpp b/indra/llui/llnotifications.cpp
index 92fa6ada54..c41c19216c 100644
--- a/indra/llui/llnotifications.cpp
+++ b/indra/llui/llnotifications.cpp
@@ -431,13 +431,30 @@ LLNotificationTemplate::LLNotificationTemplate(const LLNotificationTemplate::Par
mForm = LLNotificationFormPtr(new LLNotificationForm(p.name, p.form_ref.form));
}
-LLNotificationVisibilityRule::LLNotificationVisibilityRule(const LLNotificationVisibilityRule::Params &p)
-: mVisible(p.visible),
- mResponse(p.response),
- mType(p.type),
- mTag(p.tag),
- mName(p.name)
+LLNotificationVisibilityRule::LLNotificationVisibilityRule(const LLNotificationVisibilityRule::Rule &p)
{
+ if (p.show.isChosen())
+ {
+ mType = p.show.type;
+ mTag = p.show.tag;
+ mName = p.show.name;
+ mVisible = true;
+ }
+ else if (p.hide.isChosen())
+ {
+ mType = p.hide.type;
+ mTag = p.hide.tag;
+ mName = p.hide.name;
+ mVisible = false;
+ }
+ else if (p.respond.isChosen())
+ {
+ mType = p.respond.type;
+ mTag = p.respond.tag;
+ mName = p.respond.name;
+ mVisible = false;
+ mResponse = p.respond.response;
+ }
}
LLNotification::LLNotification(const LLNotification::Params& p) :
@@ -1465,18 +1482,9 @@ bool LLNotifications::loadVisibilityRules()
const std::string xml_filename = "notification_visibility.xml";
std::string full_filename = gDirUtilp->findSkinnedFilename(LLUI::getXUIPaths().front(), xml_filename);
- LLXMLNodePtr root;
- BOOL success = LLUICtrlFactory::getLayeredXMLNode(xml_filename, root);
-
- if (!success || root.isNull() || !root->hasName( "notification_visibility" ))
- {
- llerrs << "Problem reading UI Notification Visibility Rules file: " << full_filename << llendl;
- return false;
- }
-
LLNotificationVisibilityRule::Rules params;
- LLXUIParser parser;
- parser.readXUI(root, params, full_filename);
+ LLSimpleXUIParser parser;
+ parser.readXUI(full_filename, params);
if(!params.validateBlock())
{
@@ -1486,7 +1494,8 @@ bool LLNotifications::loadVisibilityRules()
mVisibilityRules.clear();
- for(LLInitParam::ParamIterator<LLNotificationVisibilityRule::Params>::iterator it = params.rules.begin(), end_it = params.rules.end();
+ for(LLInitParam::ParamIterator<LLNotificationVisibilityRule::Rule>::iterator it = params.rules.begin(),
+ end_it = params.rules.end();
it != end_it;
++it)
{