summaryrefslogtreecommitdiff
path: root/indra/newview/llnotificationscripthandler.cpp
diff options
context:
space:
mode:
authorBrad Payne (Vir Linden) <vir@lindenlab.com>2012-05-02 13:00:59 -0400
committerBrad Payne (Vir Linden) <vir@lindenlab.com>2012-05-02 13:00:59 -0400
commit678864e4ed497de7d17e02fa79b93be54379a5b8 (patch)
treef946f0f5ffc116d2ba9c9ada237eb70594966ee6 /indra/newview/llnotificationscripthandler.cpp
parent78fec489b53434a8ac8f9c0a8e72fd883067ce42 (diff)
parentd6569db3520f7e0ce2d93febb6f4e26b48c08a3d (diff)
merge viewer-release to drano
Diffstat (limited to 'indra/newview/llnotificationscripthandler.cpp')
-rw-r--r--indra/newview/llnotificationscripthandler.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/indra/newview/llnotificationscripthandler.cpp b/indra/newview/llnotificationscripthandler.cpp
index bbb4d03768..995915206b 100644
--- a/indra/newview/llnotificationscripthandler.cpp
+++ b/indra/newview/llnotificationscripthandler.cpp
@@ -47,13 +47,13 @@ LLScriptHandler::LLScriptHandler(e_notification_type type, const LLSD& id)
mType = type;
// Getting a Channel for our notifications
- mChannel = LLChannelManager::getInstance()->createNotificationChannel();
- mChannel->setControlHovering(true);
-
- LLScreenChannel* channel = dynamic_cast<LLScreenChannel*>(mChannel);
+ LLScreenChannel* channel = LLChannelManager::getInstance()->createNotificationChannel();
if(channel)
+ {
+ channel->setControlHovering(true);
channel->setOnRejectToastCallback(boost::bind(&LLScriptHandler::onRejectToast, this, _1));
-
+ mChannel = channel->getHandle();
+ }
}
//--------------------------------------------------------------------------
@@ -66,13 +66,13 @@ void LLScriptHandler::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 LLScriptHandler::processNotification(const LLSD& notify)
{
- if(!mChannel)
+ if(mChannel.isDead())
{
return false;
}
@@ -83,7 +83,7 @@ bool LLScriptHandler::processNotification(const LLSD& notify)
return false;
// arrange a channel on a screen
- if(!mChannel->getVisible())
+ if(!mChannel.get()->getVisible())
{
initChannel();
}
@@ -109,7 +109,7 @@ bool LLScriptHandler::processNotification(const LLSD& notify)
p.panel = notify_box;
p.on_delete_toast = boost::bind(&LLScriptHandler::onDeleteToast, this, _1);
- LLScreenChannel* channel = dynamic_cast<LLScreenChannel*>(mChannel);
+ LLScreenChannel* channel = dynamic_cast<LLScreenChannel*>(mChannel.get());
if(channel)
{
channel->addToast(p);
@@ -127,7 +127,7 @@ bool LLScriptHandler::processNotification(const LLSD& notify)
}
else
{
- mChannel->killToastByNotificationID(notification->getID());
+ mChannel.get()->killToastByNotificationID(notification->getID());
}
}
return false;