diff options
author | Oz Linden <oz@lindenlab.com> | 2015-07-09 12:30:57 -0400 |
---|---|---|
committer | Oz Linden <oz@lindenlab.com> | 2015-07-09 12:30:57 -0400 |
commit | c2f9c5ac8189b8076d51711c3be09dfbe309e22b (patch) | |
tree | 0c0a469645c77c62ff0456d2230cb6b2c3e996c0 /indra/newview/llnotificationscripthandler.cpp | |
parent | c91205c47627e46369d3a2e183de7a4157c051a8 (diff) | |
parent | 4aa64b99dbe6cafdccf0c25501feaef5ba3445c4 (diff) |
merge changes for 3.8.0-release
Diffstat (limited to 'indra/newview/llnotificationscripthandler.cpp')
-rwxr-xr-x | indra/newview/llnotificationscripthandler.cpp | 69 |
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()); + } +} //-------------------------------------------------------------------------- |