summaryrefslogtreecommitdiff
path: root/indra/newview/llnotificationtiphandler.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llnotificationtiphandler.cpp')
-rw-r--r--indra/newview/llnotificationtiphandler.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/indra/newview/llnotificationtiphandler.cpp b/indra/newview/llnotificationtiphandler.cpp
index fb0891c4c5..e397cfa046 100644
--- a/indra/newview/llnotificationtiphandler.cpp
+++ b/indra/newview/llnotificationtiphandler.cpp
@@ -46,11 +46,12 @@ LLTipHandler::LLTipHandler(e_notification_type type, const LLSD& id)
mType = type;
// Getting a Channel for our notifications
- mChannel = LLChannelManager::getInstance()->createNotificationChannel();
-
- LLScreenChannel* channel = dynamic_cast<LLScreenChannel*>(mChannel);
+ LLScreenChannel* channel = LLChannelManager::getInstance()->createNotificationChannel();
if(channel)
+ {
channel->setOnRejectToastCallback(boost::bind(&LLTipHandler::onRejectToast, this, _1));
+ mChannel = channel->getHandle();
+ }
}
//--------------------------------------------------------------------------
@@ -63,13 +64,13 @@ void LLTipHandler::initChannel()
{
S32 channel_right_bound = gViewerWindow->getWorldViewRectScaled().mRight - gSavedSettings.getS32("NotificationChannelRightMargin");
S32 channel_width = gSavedSettings.getS32("NotifyBoxWidth");
- mChannel->init(channel_right_bound - channel_width, channel_right_bound);
+ mChannel.get()->init(channel_right_bound - channel_width, channel_right_bound);
}
//--------------------------------------------------------------------------
bool LLTipHandler::processNotification(const LLSD& notify)
{
- if(!mChannel)
+ if(mChannel.isDead())
{
return false;
}
@@ -80,7 +81,7 @@ bool LLTipHandler::processNotification(const LLSD& notify)
return false;
// arrange a channel on a screen
- if(!mChannel->getVisible())
+ if(!mChannel.get()->getVisible())
{
initChannel();
}
@@ -137,13 +138,13 @@ bool LLTipHandler::processNotification(const LLSD& notify)
removeExclusiveNotifications(notification);
- LLScreenChannel* channel = dynamic_cast<LLScreenChannel*>(mChannel);
+ LLScreenChannel* channel = dynamic_cast<LLScreenChannel*>(mChannel.get());
if(channel)
channel->addToast(p);
}
else if (notify["sigtype"].asString() == "delete")
{
- mChannel->killToastByNotificationID(notification->getID());
+ mChannel.get()->killToastByNotificationID(notification->getID());
}
return false;
}