summaryrefslogtreecommitdiff
path: root/indra/newview/llnotificationgrouphandler.cpp
diff options
context:
space:
mode:
authorRichard Linden <none@none>2012-04-26 14:39:52 -0700
committerRichard Linden <none@none>2012-04-26 14:39:52 -0700
commita0bb55adc6ff26595f20bed12cb6f1565011e246 (patch)
treecbd25e29777ad9921b2fee2bd0b4d349caa4da61 /indra/newview/llnotificationgrouphandler.cpp
parentd6569db3520f7e0ce2d93febb6f4e26b48c08a3d (diff)
parentdb316f830df45e1b0229ebcbdb5feedc5eb23913 (diff)
merge with viewer-release
Diffstat (limited to 'indra/newview/llnotificationgrouphandler.cpp')
-rw-r--r--indra/newview/llnotificationgrouphandler.cpp59
1 files changed, 16 insertions, 43 deletions
diff --git a/indra/newview/llnotificationgrouphandler.cpp b/indra/newview/llnotificationgrouphandler.cpp
index ad51389241..50db4737ce 100644
--- a/indra/newview/llnotificationgrouphandler.cpp
+++ b/indra/newview/llnotificationgrouphandler.cpp
@@ -37,15 +37,13 @@
using namespace LLNotificationsUI;
//--------------------------------------------------------------------------
-LLGroupHandler::LLGroupHandler(e_notification_type type, const LLSD& id)
+LLGroupHandler::LLGroupHandler()
+: LLSysHandler("Group Notifications", "groupnotify")
{
- mType = type;
-
// Getting a Channel for our notifications
LLScreenChannel* channel = LLChannelManager::getInstance()->createNotificationChannel();
if(channel)
- {
- channel->setOnRejectToastCallback(boost::bind(&LLGroupHandler::onRejectToast, this, _1));
+ channel->addOnRejectToastCallback(boost::bind(&LLGroupHandler::onRejectToast, this, _1));
mChannel = channel->getHandle();
}
}
@@ -64,68 +62,43 @@ void LLGroupHandler::initChannel()
}
//--------------------------------------------------------------------------
-bool LLGroupHandler::processNotification(const LLSD& notify)
+bool LLGroupHandler::processNotification(const LLNotificationPtr& notification)
{
if(mChannel.isDead())
{
return false;
}
- LLNotificationPtr notification = LLNotifications::instance().find(notify["id"].asUUID());
-
- if(!notification)
- return false;
-
// arrange a channel on a screen
if(!mChannel.get()->getVisible())
{
initChannel();
}
- if(notify["sigtype"].asString() == "add" || notify["sigtype"].asString() == "change")
- {
- LLHandlerUtil::logGroupNoticeToIMGroup(notification);
+ LLHandlerUtil::logGroupNoticeToIMGroup(notification);
- LLPanel* notify_box = new LLToastGroupNotifyPanel(notification);
- LLToast::Params p;
- p.notif_id = notification->getID();
- p.notification = notification;
- p.panel = notify_box;
- p.on_delete_toast = boost::bind(&LLGroupHandler::onDeleteToast, this, _1);
+ LLPanel* notify_box = new LLToastGroupNotifyPanel(notification);
+ LLToast::Params p;
+ p.notif_id = notification->getID();
+ p.notification = notification;
+ p.panel = notify_box;
+ p.on_delete_toast = boost::bind(&LLGroupHandler::onDeleteToast, this, _1);
- LLScreenChannel* channel = dynamic_cast<LLScreenChannel*>(mChannel.get());
- if(channel)
- channel->addToast(p);
+ LLScreenChannel* channel = dynamic_cast<LLScreenChannel*>(mChannel.get());
+ if(channel)
+ channel->addToast(p);
- // send a signal to the counter manager
- mNewNotificationSignal();
+ LLGroupActions::refresh_notices();
- LLGroupActions::refresh_notices();
- }
- else if (notify["sigtype"].asString() == "delete")
- {
- mChannel.get()->killToastByNotificationID(notification->getID());
- }
return false;
}
//--------------------------------------------------------------------------
-void LLGroupHandler::onDeleteToast(LLToast* toast)
-{
- // send a signal to the counter manager
- mDelNotificationSignal();
-
- // 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());
-}
-
-//--------------------------------------------------------------------------
void LLGroupHandler::onRejectToast(LLUUID& id)
{
LLNotificationPtr notification = LLNotifications::instance().find(id);
- if (notification && LLNotificationManager::getInstance()->getHandlerForNotification(notification->getType()) == this)
+ if (notification && mItems.find(notification) != mItems.end())
{
LLNotifications::instance().cancel(notification);
}