summaryrefslogtreecommitdiff
path: root/indra/llui
diff options
context:
space:
mode:
authordolphin <dolphin@lindenlab.com>2014-05-20 10:06:34 -0700
committerdolphin <dolphin@lindenlab.com>2014-05-20 10:06:34 -0700
commit0d5727814b5038b9deb3a635b9b0bd1e048763a3 (patch)
tree6c6d301c260c00457690c57e6b0dfac05c497622 /indra/llui
parent0481494c2df074d2b548d6b80e595a208a2848c3 (diff)
parent998bdf10cc738ee9799d985af80bbb8c51ef2054 (diff)
Merge
Diffstat (limited to 'indra/llui')
-rwxr-xr-xindra/llui/llnotifications.cpp32
-rwxr-xr-xindra/llui/llnotifications.h4
-rwxr-xr-xindra/llui/llnotificationtemplate.h1
3 files changed, 36 insertions, 1 deletions
diff --git a/indra/llui/llnotifications.cpp b/indra/llui/llnotifications.cpp
index 025cd81d92..f4ad4a12db 100755
--- a/indra/llui/llnotifications.cpp
+++ b/indra/llui/llnotifications.cpp
@@ -678,7 +678,7 @@ void LLNotification::respond(const LLSD& response)
// and then call it
functor(asLLSD(), response);
}
- else
+ else if (mCombinedNotifications.empty())
{
// no registered responder
return;
@@ -700,6 +700,14 @@ void LLNotification::respond(const LLSD& response)
}
}
+ for (std::vector<LLNotificationPtr>::const_iterator it = mCombinedNotifications.begin(); it != mCombinedNotifications.end(); ++it)
+ {
+ if ((*it))
+ {
+ (*it)->respond(response);
+ }
+ }
+
update();
}
@@ -1321,6 +1329,28 @@ bool LLNotifications::failedUniquenessTest(const LLSD& payload)
}
}
break;
+ case LLNotification::COMBINE_WITH_NEW:
+ // Add to the existing unique notification with the data from this particular instance...
+ // This guarantees that duplicate notifications will be collapsed to the one
+ // most recently triggered
+ for (LLNotificationMap::iterator existing_it = mUniqueNotifications.find(pNotif->getName());
+ existing_it != mUniqueNotifications.end();
+ ++existing_it)
+ {
+ LLNotificationPtr existing_notification = existing_it->second;
+ if (pNotif != existing_notification
+ && pNotif->isEquivalentTo(existing_notification))
+ {
+ // copy the notifications from the newest instance into the oldest
+ existing_notification->mCombinedNotifications.push_back(pNotif);
+ existing_notification->mCombinedNotifications.insert(existing_notification->mCombinedNotifications.end(),
+ pNotif->mCombinedNotifications.begin(), pNotif->mCombinedNotifications.end());
+
+ // pop up again
+ existing_notification->update();
+ }
+ }
+ break;
case LLNotification::KEEP_OLD:
break;
case LLNotification::CANCEL_OLD:
diff --git a/indra/llui/llnotifications.h b/indra/llui/llnotifications.h
index b0e8553a49..0bd7e934ea 100755
--- a/indra/llui/llnotifications.h
+++ b/indra/llui/llnotifications.h
@@ -413,6 +413,9 @@ private:
using the same mechanism.
*/
bool mTemporaryResponder;
+
+ // keep track of other notifications combined with COMBINE_WITH_NEW
+ std::vector<LLNotificationPtr> mCombinedNotifications;
void init(const std::string& template_name, const LLSD& form_elements);
@@ -559,6 +562,7 @@ public:
typedef enum e_combine_behavior
{
REPLACE_WITH_NEW,
+ COMBINE_WITH_NEW,
KEEP_OLD,
CANCEL_OLD
diff --git a/indra/llui/llnotificationtemplate.h b/indra/llui/llnotificationtemplate.h
index 0315ddbea8..c23fc53763 100755
--- a/indra/llui/llnotificationtemplate.h
+++ b/indra/llui/llnotificationtemplate.h
@@ -43,6 +43,7 @@ struct LLNotificationTemplate
static void declareValues()
{
declare("replace_with_new", LLNotification::REPLACE_WITH_NEW);
+ declare("combine_with_new", LLNotification::COMBINE_WITH_NEW);
declare("keep_old", LLNotification::KEEP_OLD);
declare("cancel_old", LLNotification::CANCEL_OLD);
}