diff options
| author | Tofu Linden <tofu.linden@lindenlab.com> | 2010-03-05 11:13:26 +0000 |
|---|---|---|
| committer | Tofu Linden <tofu.linden@lindenlab.com> | 2010-03-05 11:13:26 +0000 |
| commit | f1a4dc710d3978a96bb05482643df0960f6e8fd4 (patch) | |
| tree | bd6dc85cc4c06329c09510e318b58cc8dfa1df5d /indra/newview/llnotificationtiphandler.cpp | |
| parent | 6ecec59fda7d248d2640cb0a4fd95276604755a9 (diff) | |
| parent | a5c202dcfd1eb8240e1f03d3a9d42a360b41bab2 (diff) | |
merge from viewer-2-0
Diffstat (limited to 'indra/newview/llnotificationtiphandler.cpp')
| -rw-r--r-- | indra/newview/llnotificationtiphandler.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/indra/newview/llnotificationtiphandler.cpp b/indra/newview/llnotificationtiphandler.cpp index be76959d07..4e2c5085ed 100644 --- a/indra/newview/llnotificationtiphandler.cpp +++ b/indra/newview/llnotificationtiphandler.cpp @@ -40,6 +40,7 @@ #include "lltoastnotifypanel.h" #include "llviewercontrol.h" #include "llviewerwindow.h" +#include "llnotificationmanager.h" using namespace LLNotificationsUI; @@ -82,6 +83,10 @@ LLTipHandler::LLTipHandler(e_notification_type type, const LLSD& id) // Getting a Channel for our notifications mChannel = LLChannelManager::getInstance()->createNotificationChannel(); + + LLScreenChannel* channel = dynamic_cast<LLScreenChannel*>(mChannel); + if(channel) + channel->setOnRejectToastCallback(boost::bind(&LLTipHandler::onRejectToast, this, _1)); } //-------------------------------------------------------------------------- @@ -167,6 +172,8 @@ bool LLTipHandler::processNotification(const LLSD& notify) p.is_tip = true; p.can_be_stored = false; + removeExclusiveNotifications(notification); + LLScreenChannel* channel = dynamic_cast<LLScreenChannel*>(mChannel); if(channel) channel->addToast(p); @@ -185,4 +192,14 @@ void LLTipHandler::onDeleteToast(LLToast* toast) //-------------------------------------------------------------------------- +void LLTipHandler::onRejectToast(const LLUUID& id) +{ + LLNotificationPtr notification = LLNotifications::instance().find(id); + if (notification + && LLNotificationManager::getInstance()->getHandlerForNotification( + notification->getType()) == this) + { + LLNotifications::instance().cancel(notification); + } +} |
