summaryrefslogtreecommitdiff
path: root/indra/newview/llnotificationscripthandler.cpp
diff options
context:
space:
mode:
authorBrad Payne (Vir Linden) <vir@lindenlab.com>2015-08-11 16:55:34 -0400
committerBrad Payne (Vir Linden) <vir@lindenlab.com>2015-08-11 16:55:34 -0400
commit47093f6e52741f36fcc782cb52e54baf9f6e3acf (patch)
tree86b5d6fe9cd8dfbd5a9e36dab09c71f9de099cb3 /indra/newview/llnotificationscripthandler.cpp
parentd822d0e96bb69374f49fef8a827a042474deda8d (diff)
parent310ec101dfd2c69ecc1a51d0a3a8ea12d5fdaf7a (diff)
merge
Diffstat (limited to 'indra/newview/llnotificationscripthandler.cpp')
-rwxr-xr-xindra/newview/llnotificationscripthandler.cpp69
1 files changed, 42 insertions, 27 deletions
diff --git a/indra/newview/llnotificationscripthandler.cpp b/indra/newview/llnotificationscripthandler.cpp
index a3b15931c6..7acb2f9e90 100755
--- a/indra/newview/llnotificationscripthandler.cpp
+++ b/indra/newview/llnotificationscripthandler.cpp
@@ -68,6 +68,30 @@ void LLScriptHandler::initChannel()
}
//--------------------------------------------------------------------------
+void LLScriptHandler::addToastWithNotification(const LLNotificationPtr& notification)
+{
+ LLToastPanel* notify_box = LLToastPanel::buidPanelFromNotification(notification);
+
+ LLToast::Params p;
+ p.notif_id = notification->getID();
+ p.notification = notification;
+ p.panel = notify_box;
+ p.on_delete_toast = boost::bind(&LLScriptHandler::onDeleteToast, this, _1);
+ if(gAgent.isDoNotDisturb())
+ {
+ p.force_show = notification->getName() == "SystemMessage"
+ || notification->getName() == "GodMessage"
+ || notification->getPriority() >= NOTIFICATION_PRIORITY_HIGH;
+ }
+
+ LLScreenChannel* channel = dynamic_cast<LLScreenChannel*>(mChannel.get());
+ if(channel)
+ {
+ channel->addToast(p);
+ }
+}
+
+//--------------------------------------------------------------------------
bool LLScriptHandler::processNotification(const LLNotificationPtr& notification)
{
if(mChannel.isDead())
@@ -92,42 +116,33 @@ bool LLScriptHandler::processNotification(const LLNotificationPtr& notification)
}
else if (notification->canShowToast())
{
- LLToastPanel* notify_box = LLToastPanel::buidPanelFromNotification(notification);
-
- LLToast::Params p;
- p.notif_id = notification->getID();
- p.notification = notification;
- p.panel = notify_box;
- p.on_delete_toast = boost::bind(&LLScriptHandler::onDeleteToast, this, _1);
- if(gAgent.isDoNotDisturb())
- {
- p.force_show = notification->getName() == "SystemMessage"
- || notification->getName() == "GodMessage"
- || notification->getPriority() >= NOTIFICATION_PRIORITY_HIGH;
- }
-
- LLScreenChannel* channel = dynamic_cast<LLScreenChannel*>(mChannel.get());
- if(channel)
- {
- channel->addToast(p);
- }
+ addToastWithNotification(notification);
}
return false;
}
+void LLScriptHandler::onChange( LLNotificationPtr notification )
+{
+ LLScreenChannel* channel = dynamic_cast<LLScreenChannel*>(mChannel.get());
+ if (channel)
+ {
+ channel->removeToastByNotificationID(notification->getID());
+ addToastWithNotification(notification);
+ }
+}
void LLScriptHandler::onDelete( LLNotificationPtr notification )
- {
+{
if(notification->hasFormElements() && !notification->canShowToast())
- {
- LLScriptFloaterManager::getInstance()->onRemoveNotification(notification->getID());
- }
- else
- {
- mChannel.get()->removeToastByNotificationID(notification->getID());
- }
+ {
+ LLScriptFloaterManager::getInstance()->onRemoveNotification(notification->getID());
}
+ else
+ {
+ mChannel.get()->removeToastByNotificationID(notification->getID());
+ }
+}
//--------------------------------------------------------------------------