From 94e406157d0b133d51b5dbb95aab296b46eae10e Mon Sep 17 00:00:00 2001 From: Richard Nelson Date: Mon, 16 Aug 2010 14:59:29 -0700 Subject: added ability to cancel all notifications with a given name --- indra/llui/llnotifications.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'indra/llui/llnotifications.cpp') diff --git a/indra/llui/llnotifications.cpp b/indra/llui/llnotifications.cpp index 7fa3c2cf65..2da8f1eb1b 100644 --- a/indra/llui/llnotifications.cpp +++ b/indra/llui/llnotifications.cpp @@ -1423,6 +1423,21 @@ void LLNotifications::cancel(LLNotificationPtr pNotif) updateItem(LLSD().with("sigtype", "delete").with("id", pNotif->id()), pNotif); } +void LLNotifications::cancelByName(const std::string& name) +{ + for (LLNotificationSet::iterator it=mItems.begin(), end_it = mItems.end(), next_it = it; + it != end_it; + it = next_it, ++next_it) + { + LLNotificationPtr pNotif = *it; + if (pNotif->getName() == name) + { + pNotif->cancel(); + updateItem(LLSD().with("sigtype", "delete").with("id", pNotif->id()), pNotif); + } + } +} + void LLNotifications::update(const LLNotificationPtr pNotif) { LLNotificationSet::iterator it=mItems.find(pNotif); -- cgit v1.2.3 From 3aa8148ed94bcf495784efe51ad9d466d566868d Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Wed, 18 Aug 2010 12:16:29 -0700 Subject: fix for occasional crash when dismissing hint --- indra/llui/llnotifications.cpp | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'indra/llui/llnotifications.cpp') diff --git a/indra/llui/llnotifications.cpp b/indra/llui/llnotifications.cpp index 2da8f1eb1b..7cc6e8e8f6 100644 --- a/indra/llui/llnotifications.cpp +++ b/indra/llui/llnotifications.cpp @@ -1425,17 +1425,26 @@ void LLNotifications::cancel(LLNotificationPtr pNotif) void LLNotifications::cancelByName(const std::string& name) { - for (LLNotificationSet::iterator it=mItems.begin(), end_it = mItems.end(), next_it = it; + std::vector notifs_to_cancel; + for (LLNotificationSet::iterator it=mItems.begin(), end_it = mItems.end(); it != end_it; - it = next_it, ++next_it) + ++it) { LLNotificationPtr pNotif = *it; if (pNotif->getName() == name) { - pNotif->cancel(); - updateItem(LLSD().with("sigtype", "delete").with("id", pNotif->id()), pNotif); + notifs_to_cancel.push_back(pNotif); } } + + for (std::vector::iterator it = notifs_to_cancel.begin(), end_it = notifs_to_cancel.end(); + it != end_it; + ++it) + { + LLNotificationPtr pNotif = *it; + pNotif->cancel(); + updateItem(LLSD().with("sigtype", "delete").with("id", pNotif->id()), pNotif); + } } void LLNotifications::update(const LLNotificationPtr pNotif) -- cgit v1.2.3 From 1ad5663463721c4bca6ca8e91b9894226e999cca Mon Sep 17 00:00:00 2001 From: Richard Nelson Date: Tue, 14 Sep 2010 10:53:05 -0700 Subject: converted notifications.xml to paramblock parsing for easier reuse and extension --- indra/llui/llnotifications.cpp | 654 ++++++++++++++++++++++++++++------------- 1 file changed, 446 insertions(+), 208 deletions(-) (limited to 'indra/llui/llnotifications.cpp') diff --git a/indra/llui/llnotifications.cpp b/indra/llui/llnotifications.cpp index 7dba53e746..3baf8d4f7b 100644 --- a/indra/llui/llnotifications.cpp +++ b/indra/llui/llnotifications.cpp @@ -44,6 +44,229 @@ const std::string NOTIFICATION_PERSIST_VERSION = "0.93"; +void NotificationPriorityValues::declareValues() +{ + declare("low", NOTIFICATION_PRIORITY_LOW); + declare("normal", NOTIFICATION_PRIORITY_NORMAL); + declare("high", NOTIFICATION_PRIORITY_HIGH); + declare("critical", NOTIFICATION_PRIORITY_CRITICAL); +} + + +namespace LLNotificationTemplateParams +{ + using namespace LLInitParam; + + struct GlobalString : public Block + { + Mandatory name, + value; + + GlobalString() + : name("name"), + value("value") + {} + }; + + struct UniquenessContext : public Block + { + Mandatory key; + + UniquenessContext() + : key("key") + {} + + }; + + struct UniquenessConstraint : public Block + { + Multiple contexts; + + UniquenessConstraint() + : contexts("context") + {} + }; + + struct FormElementBase : public Block + { + Mandatory name; + FormElementBase() + : name("name") + {} + }; + + struct FormIgnore : public Block + { + Optional text; + Optional save_option; + + FormIgnore() + : text("text"), + save_option("save_option", false) + {} + }; + + struct FormButton : public Block + { + Mandatory index; + Mandatory text; + Optional ignore; + Optional is_default; + + FormButton() + : index("index"), + text("text"), + ignore("ignore"), + is_default("default") + {} + }; + + struct FormInput : public Block + { + Mandatory type; + Optional width; + + FormInput() + : type("type"), + width("width", 0) + {} + }; + + struct FormElement : public Choice + { + Alternative button; + Alternative input; + + FormElement() + : button("button"), + input("input") + {} + }; + + struct Form : public Block
+ { + Optional name; + Optional ignore; + Multiple form_elements; + + Form() + : name("form"), + ignore("ignore"), + form_elements("") + {} + }; + + // Templates are used to define common form types, such as OK/Cancel dialogs, etc. + + struct Template : public Block