From f06b305d9fe72b6972a2ab0d6047b792fa2706cd Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Wed, 28 May 2014 16:16:09 -0700 Subject: ACME-1471 WIP [VWR] Merge multiple Exp Perm dialogs into one merged multiple experience toasts into a single one reviewed by Cho --- indra/newview/llnotificationscripthandler.cpp | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) (limited to 'indra/newview/llnotificationscripthandler.cpp') diff --git a/indra/newview/llnotificationscripthandler.cpp b/indra/newview/llnotificationscripthandler.cpp index a3b15931c6..65b1d5f95f 100755 --- a/indra/newview/llnotificationscripthandler.cpp +++ b/indra/newview/llnotificationscripthandler.cpp @@ -116,18 +116,28 @@ bool LLScriptHandler::processNotification(const LLNotificationPtr& notification) return false; } +void LLScriptHandler::onChange( LLNotificationPtr notification ) +{ + LLScreenChannel* channel = dynamic_cast(mChannel.get()); + if (channel) + { + LLToastPanel* notify_box = LLToastPanel::buidPanelFromNotification(notification); + channel->modifyToastByNotificationID(notification->getID(), notify_box); + + } +} 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()); } +} //-------------------------------------------------------------------------- -- cgit v1.2.3 From e143ceb9db4ed716716580d098791cb18b1d5ac1 Mon Sep 17 00:00:00 2001 From: Cho Date: Thu, 29 May 2014 03:04:19 +0100 Subject: Added inelegant fix for ACME-1471 to pop up the old notification with each new notification --- indra/newview/llnotificationscripthandler.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'indra/newview/llnotificationscripthandler.cpp') diff --git a/indra/newview/llnotificationscripthandler.cpp b/indra/newview/llnotificationscripthandler.cpp index 65b1d5f95f..267d3ac092 100755 --- a/indra/newview/llnotificationscripthandler.cpp +++ b/indra/newview/llnotificationscripthandler.cpp @@ -122,8 +122,21 @@ void LLScriptHandler::onChange( LLNotificationPtr notification ) if (channel) { LLToastPanel* notify_box = LLToastPanel::buidPanelFromNotification(notification); - channel->modifyToastByNotificationID(notification->getID(), notify_box); + + 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; + } + channel->removeToastByNotificationID(notification->getID()); + channel->addToast(p); } } -- cgit v1.2.3 From 6e74c0de6aed31bc4c27fca1b14e7ab8ef301d34 Mon Sep 17 00:00:00 2001 From: Cho Date: Thu, 29 May 2014 03:53:43 +0100 Subject: Streamlined previous fix for ACME-1471 --- indra/newview/llnotificationscripthandler.cpp | 60 ++++++++++++--------------- 1 file changed, 26 insertions(+), 34 deletions(-) (limited to 'indra/newview/llnotificationscripthandler.cpp') diff --git a/indra/newview/llnotificationscripthandler.cpp b/indra/newview/llnotificationscripthandler.cpp index 267d3ac092..7acb2f9e90 100755 --- a/indra/newview/llnotificationscripthandler.cpp +++ b/indra/newview/llnotificationscripthandler.cpp @@ -67,6 +67,30 @@ void LLScriptHandler::initChannel() mChannel.get()->init(channel_right_bound - channel_width, channel_right_bound); } +//-------------------------------------------------------------------------- +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(mChannel.get()); + if(channel) + { + channel->addToast(p); + } +} + //-------------------------------------------------------------------------- bool LLScriptHandler::processNotification(const LLNotificationPtr& notification) { @@ -92,25 +116,7 @@ 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(mChannel.get()); - if(channel) - { - channel->addToast(p); - } + addToastWithNotification(notification); } return false; @@ -121,22 +127,8 @@ void LLScriptHandler::onChange( LLNotificationPtr notification ) LLScreenChannel* channel = dynamic_cast(mChannel.get()); if (channel) { - 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; - } - channel->removeToastByNotificationID(notification->getID()); - channel->addToast(p); + addToastWithNotification(notification); } } -- cgit v1.2.3