summaryrefslogtreecommitdiff
path: root/indra/llui/llnotifications.cpp
diff options
context:
space:
mode:
authorDmitry Zaporozhan <dzaporozhan@productengine.com>2010-03-15 18:06:04 +0200
committerDmitry Zaporozhan <dzaporozhan@productengine.com>2010-03-15 18:06:04 +0200
commitfee3752311907c774b595246f1dbb93ef5b8cd53 (patch)
treee1302bebfa7cc4524cdf6f2e366c75b8f9c77c9f /indra/llui/llnotifications.cpp
parent95883cbb5395458fde452097f224a17a2da07568 (diff)
Implemented normal task EXT-5905 - Resolving offers.
Added functionality to make Toasts accept multiple user inputs(clicks on option buttons). --HG-- branch : product-engine
Diffstat (limited to 'indra/llui/llnotifications.cpp')
-rw-r--r--indra/llui/llnotifications.cpp25
1 files changed, 22 insertions, 3 deletions
diff --git a/indra/llui/llnotifications.cpp b/indra/llui/llnotifications.cpp
index 5816cef6af..7b8970a153 100644
--- a/indra/llui/llnotifications.cpp
+++ b/indra/llui/llnotifications.cpp
@@ -402,7 +402,8 @@ LLNotification::LLNotification(const LLNotification::Params& p) :
mRespondedTo(false),
mPriority(p.priority),
mCancelled(false),
- mIgnored(false)
+ mIgnored(false),
+ mResponderObj(NULL)
{
if (p.functor.name.isChosen())
{
@@ -416,6 +417,11 @@ LLNotification::LLNotification(const LLNotification::Params& p) :
mTemporaryResponder = true;
}
+ if(p.responder.isProvided())
+ {
+ mResponderObj = p.responder;
+ }
+
mId.generate();
init(p.name, p.form_elements);
}
@@ -425,7 +431,8 @@ LLNotification::LLNotification(const LLSD& sd) :
mTemporaryResponder(false),
mRespondedTo(false),
mCancelled(false),
- mIgnored(false)
+ mIgnored(false),
+ mResponderObj(NULL)
{
mId.generate();
mSubstitutions = sd["substitutions"];
@@ -563,7 +570,9 @@ void LLNotification::respond(const LLSD& response)
// and then call it
functor(asLLSD(), response);
- if (mTemporaryResponder)
+ bool is_resusable = getPayload()["reusable"].asBoolean();
+
+ if (mTemporaryResponder && !is_resusable)
{
LLNotificationFunctorRegistry::instance().unregisterFunctor(mResponseFunctorName);
mResponseFunctorName = "";
@@ -597,6 +606,16 @@ void LLNotification::setResponseFunctor(std::string const &responseFunctorName)
mTemporaryResponder = false;
}
+void LLNotification::setResponseFunctor(const LLNotificationFunctorRegistry::ResponseFunctor& cb)
+{
+ if(mTemporaryResponder)
+ {
+ LLNotificationFunctorRegistry::instance().unregisterFunctor(mResponseFunctorName);
+ }
+
+ LLNotificationFunctorRegistry::instance().registerFunctor(mResponseFunctorName, cb);
+}
+
bool LLNotification::payloadContainsAll(const std::vector<std::string>& required_fields) const
{
for(std::vector<std::string>::const_iterator required_fields_it = required_fields.begin();