diff options
| author | Tofu Linden <tofu.linden@lindenlab.com> | 2010-03-03 11:26:25 +0000 |
|---|---|---|
| committer | Tofu Linden <tofu.linden@lindenlab.com> | 2010-03-03 11:26:25 +0000 |
| commit | 6ecec59fda7d248d2640cb0a4fd95276604755a9 (patch) | |
| tree | 063583a1f9f7441356814be5891e6a7bcc61b9d4 /indra/newview/llnotificationtiphandler.cpp | |
| parent | 1eff2a33b1fab8ebe757ce30b36dc71df5b58cb9 (diff) | |
| parent | 5777dfaae6268dffee83d7a457c024b1a89f81ff (diff) | |
Merge from viewer-2-0
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(); |
