diff options
author | andreykproductengine <akleshchev@productengine.com> | 2015-07-02 16:26:17 +0300 |
---|---|---|
committer | andreykproductengine <akleshchev@productengine.com> | 2015-07-02 16:26:17 +0300 |
commit | 8e2ec992d0bc937f72f6a1e96592f32798daac29 (patch) | |
tree | b106227140e23c7ff66e7ac15c85877394a0b580 /indra/newview/llnotificationscripthandler.cpp | |
parent | 79f1e2178828a3e7c1738d8e0682d795aeb240bf (diff) | |
parent | 4aa64b99dbe6cafdccf0c25501feaef5ba3445c4 (diff) |
Merge downstream code and become version 3.8.1
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()); + } +} //-------------------------------------------------------------------------- |