From 13a6077b780117be0fa3a054426d139ca1d35df9 Mon Sep 17 00:00:00 2001 From: Dmitry Zaporozhan Date: Fri, 20 Nov 2009 19:17:38 +0200 Subject: Implemented normal task EXT-2081 - Object IM chiclets art needs to be hooked up to LLDialog chiclets. Implemented LLDialog(LLScriptFloater) and Script Chiclets. --HG-- branch : product-engine --- indra/newview/llnotificationscripthandler.cpp | 51 +++++++++++++++++++-------- 1 file changed, 36 insertions(+), 15 deletions(-) (limited to 'indra/newview/llnotificationscripthandler.cpp') diff --git a/indra/newview/llnotificationscripthandler.cpp b/indra/newview/llnotificationscripthandler.cpp index 70b86e8b97..84a8191375 100644 --- a/indra/newview/llnotificationscripthandler.cpp +++ b/indra/newview/llnotificationscripthandler.cpp @@ -38,6 +38,7 @@ #include "llviewercontrol.h" #include "llviewerwindow.h" #include "llnotificationmanager.h" +#include "llscriptfloater.h" using namespace LLNotificationsUI; @@ -90,25 +91,37 @@ bool LLScriptHandler::processNotification(const LLSD& notify) if(notify["sigtype"].asString() == "add" || notify["sigtype"].asString() == "change") { - LLToastNotifyPanel* notify_box = new LLToastNotifyPanel(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); - - LLScreenChannel* channel = dynamic_cast(mChannel); - if(channel) - channel->addToast(p); - - // send a signal to the counter manager - mNewNotificationSignal(); - + if("ScriptDialog" == notification->getName() || "ScriptDialogGroup" == notification->getName()) + { + LLScriptFloaterManager::getInstance()->onAddNotification(notification->getID()); + } + else + { + LLToastNotifyPanel* notify_box = new LLToastNotifyPanel(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); + + LLScreenChannel* channel = dynamic_cast(mChannel); + if(channel) + { + channel->addToast(p); + } + + // send a signal to the counter manager + mNewNotificationSignal(); + } } else if (notify["sigtype"].asString() == "delete") { mChannel->killToastByNotificationID(notification->getID()); + if("ScriptDialog" == notification->getName()) + { + LLScriptFloaterManager::getInstance()->removeNotification(notification->getID()); + } } return true; } @@ -123,6 +136,14 @@ void LLScriptHandler::onDeleteToast(LLToast* toast) // send a signal to a listener to let him perform some action // in this case listener is a SysWellWindow and it will remove a corresponding item from its list mNotificationIDSignal(toast->getNotificationID()); + + LLNotificationPtr notification = LLNotifications::getInstance()->find(toast->getNotificationID()); + + if( notification && ("ScriptDialog" == notification->getName() + || "ScriptDialogGroup" == notification->getName()) ) + { + LLScriptFloaterManager::getInstance()->onRemoveNotification(notification->getID()); + } } //-------------------------------------------------------------------------- -- cgit v1.2.3 From 9d64bf132e27739dedeca17a1d952655c6b52ac3 Mon Sep 17 00:00:00 2001 From: Dmitry Zaporozhan Date: Fri, 20 Nov 2009 19:23:22 +0200 Subject: Update for normal task EXT-2081 - Object IM chiclets art needs to be hooked up to LLDialog chiclets. Fixed function names. --HG-- branch : product-engine --- indra/newview/llnotificationscripthandler.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llnotificationscripthandler.cpp') diff --git a/indra/newview/llnotificationscripthandler.cpp b/indra/newview/llnotificationscripthandler.cpp index 84a8191375..6cd5ee8f43 100644 --- a/indra/newview/llnotificationscripthandler.cpp +++ b/indra/newview/llnotificationscripthandler.cpp @@ -120,7 +120,7 @@ bool LLScriptHandler::processNotification(const LLSD& notify) mChannel->killToastByNotificationID(notification->getID()); if("ScriptDialog" == notification->getName()) { - LLScriptFloaterManager::getInstance()->removeNotification(notification->getID()); + LLScriptFloaterManager::getInstance()->onRemoveNotification(notification->getID()); } } return true; -- cgit v1.2.3 From 9f0dbcf4c0c6c8621c377fd7f9e417aa76acd836 Mon Sep 17 00:00:00 2001 From: Dmitry Zaporozhan Date: Mon, 23 Nov 2009 15:50:49 +0200 Subject: Update for task EXT-2081 - Object IM chiclets art needs to be hooked up to LLDialog chiclets. Cleaned code, added comments. --HG-- branch : product-engine --- indra/newview/llnotificationscripthandler.cpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'indra/newview/llnotificationscripthandler.cpp') diff --git a/indra/newview/llnotificationscripthandler.cpp b/indra/newview/llnotificationscripthandler.cpp index 2cac86cc0b..f01f2e4441 100644 --- a/indra/newview/llnotificationscripthandler.cpp +++ b/indra/newview/llnotificationscripthandler.cpp @@ -42,6 +42,9 @@ using namespace LLNotificationsUI; +static const std::string SCRIPT_DIALOG ("ScriptDialog"); +static const std::string SCRIPT_DIALOG_GROUP ("ScriptDialogGroup"); + //-------------------------------------------------------------------------- LLScriptHandler::LLScriptHandler(e_notification_type type, const LLSD& id) { @@ -91,7 +94,7 @@ bool LLScriptHandler::processNotification(const LLSD& notify) if(notify["sigtype"].asString() == "add" || notify["sigtype"].asString() == "change") { - if("ScriptDialog" == notification->getName() || "ScriptDialogGroup" == notification->getName()) + if(SCRIPT_DIALOG == notification->getName() || SCRIPT_DIALOG_GROUP == notification->getName()) { LLScriptFloaterManager::getInstance()->onAddNotification(notification->getID()); } @@ -117,11 +120,14 @@ bool LLScriptHandler::processNotification(const LLSD& notify) } else if (notify["sigtype"].asString() == "delete") { - mChannel->killToastByNotificationID(notification->getID()); - if("ScriptDialog" == notification->getName()) + if(SCRIPT_DIALOG == notification->getName() || SCRIPT_DIALOG_GROUP == notification->getName()) { LLScriptFloaterManager::getInstance()->onRemoveNotification(notification->getID()); } + else + { + mChannel->killToastByNotificationID(notification->getID()); + } } return true; } @@ -139,8 +145,8 @@ void LLScriptHandler::onDeleteToast(LLToast* toast) LLNotificationPtr notification = LLNotifications::getInstance()->find(toast->getNotificationID()); - if( notification && ("ScriptDialog" == notification->getName() - || "ScriptDialogGroup" == notification->getName()) ) + if( notification && + (SCRIPT_DIALOG == notification->getName() || SCRIPT_DIALOG_GROUP == notification->getName()) ) { LLScriptFloaterManager::getInstance()->onRemoveNotification(notification->getID()); } -- cgit v1.2.3