summaryrefslogtreecommitdiff
path: root/indra/newview/llnotificationscripthandler.cpp
diff options
context:
space:
mode:
authorOz Linden <oz@lindenlab.com>2015-07-10 09:12:54 -0400
committerOz Linden <oz@lindenlab.com>2015-07-10 09:12:54 -0400
commit66bf21c32d64422f9fdc56161acc83b53923735b (patch)
treebdd1e565308fb97d7b8b2c97f9cd16489a1b285d /indra/newview/llnotificationscripthandler.cpp
parentdc5960d3930efa482b7de205fc9b8d08785da4c8 (diff)
parent657944cda7228ba824239d94b270160ac0460934 (diff)
merge up to 3.8.0-release (and fix for unit tests with a proxy enabled)'
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());
+ }
+}
//--------------------------------------------------------------------------