diff options
author | Chuck Linden <chuck@lindenlab.com> | 2010-02-19 14:32:55 -0500 |
---|---|---|
committer | Chuck Linden <chuck@lindenlab.com> | 2010-02-19 14:32:55 -0500 |
commit | 9aee0cfa716736659af777c9fccd60b8618dc9d4 (patch) | |
tree | bd6f329c88fc27fb697f6660d9eb51bcb14b9585 /indra/newview/llnotificationtiphandler.cpp | |
parent | cd9a2a6a4ab8d1d989110908a3702ba34d1f6168 (diff) | |
parent | 65f8b95ae8e93c3b946e43eea89bcb631723ca6c (diff) |
Automated merge with file:///Users/chuck/Documents/hg/viewer-hotfix
Diffstat (limited to 'indra/newview/llnotificationtiphandler.cpp')
-rw-r--r-- | indra/newview/llnotificationtiphandler.cpp | 45 |
1 files changed, 44 insertions, 1 deletions
diff --git a/indra/newview/llnotificationtiphandler.cpp b/indra/newview/llnotificationtiphandler.cpp index 83a2215ac6..be76959d07 100644 --- a/indra/newview/llnotificationtiphandler.cpp +++ b/indra/newview/llnotificationtiphandler.cpp @@ -43,6 +43,37 @@ using namespace LLNotificationsUI; +class LLOnlineStatusToast : public LLToastPanel +{ +public: + + struct Params + { + LLNotificationPtr notification; + LLUUID avatar_id; + std::string message; + + Params() {} + }; + + LLOnlineStatusToast(Params& p) : LLToastPanel(p.notification) + { + LLUICtrlFactory::getInstance()->buildPanel(this, "panel_online_status_toast.xml"); + + childSetValue("avatar_icon", p.avatar_id); + childSetValue("message", p.message); + + if (p.notification->getPayload().has("respond_on_mousedown") + && p.notification->getPayload()["respond_on_mousedown"] ) + { + setMouseDownCallback(boost::bind(&LLNotification::respond, p.notification, + p.notification->getResponseTemplate())); + } + + // set line max count to 2 in case of a very long name + snapToMessageHeight(getChild<LLTextBox>("message"), 2); + } +}; //-------------------------------------------------------------------------- LLTipHandler::LLTipHandler(e_notification_type type, const LLSD& id) @@ -114,7 +145,19 @@ bool LLTipHandler::processNotification(const LLSD& notify) LLHandlerUtil::spawnIMSession(name, from_id); } - LLToastNotifyPanel* notify_box = new LLToastNotifyPanel(notification); + LLToastPanel* notify_box = NULL; + if("FriendOffline" == notification->getName() || "FriendOnline" == notification->getName()) + { + LLOnlineStatusToast::Params p; + p.notification = notification; + p.message = notification->getMessage(); + p.avatar_id = notification->getPayload()["FROM_ID"]; + notify_box = new LLOnlineStatusToast(p); + } + else + { + notify_box = new LLToastNotifyPanel(notification); + } LLToast::Params p; p.notif_id = notification->getID(); |