From e096bdc7ed5ab61ea097019bbfe6d96a27042a56 Mon Sep 17 00:00:00 2001 From: Alexei Arabadji Date: Thu, 22 Apr 2010 09:26:48 +0300 Subject: fixed EXT-6936 Avoid using LLToastNotifyPanel class for tip toasts. * renamed class LLOnlineStatusToast to LLPanelOnlineStatus; * updated method LLToastPanel::buidPanelFromNotification to provide building all kinds of tip toast panels; * updated method LLTipHandler::processNotification to avoid using LLToastNotifyPanel; reviewed by Vadim Savchuk at https://codereview.productengine.com/secondlife/r/286/ --HG-- branch : product-engine --- indra/newview/llnotificationtiphandler.cpp | 55 +----------------------------- 1 file changed, 1 insertion(+), 54 deletions(-) (limited to 'indra/newview/llnotificationtiphandler.cpp') diff --git a/indra/newview/llnotificationtiphandler.cpp b/indra/newview/llnotificationtiphandler.cpp index e528f871af..df6f04b6ea 100644 --- a/indra/newview/llnotificationtiphandler.cpp +++ b/indra/newview/llnotificationtiphandler.cpp @@ -45,38 +45,6 @@ using namespace LLNotificationsUI; -class LLOnlineStatusToast : public LLPanelTipToast -{ -public: - - struct Params - { - LLNotificationPtr notification; - LLUUID avatar_id; - std::string message; - - Params() {} - }; - - LLOnlineStatusToast(Params& p) : LLPanelTipToast(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 3 in case of a very long name - snapToMessageHeight(getChild("message"), 3); - } -}; - //-------------------------------------------------------------------------- LLTipHandler::LLTipHandler(e_notification_type type, const LLSD& id) { @@ -157,28 +125,7 @@ bool LLTipHandler::processNotification(const LLSD& notify) return true; } - LLToastPanel* notify_box = NULL; - // TODO: this should be implemented in LLToastPanel::buidPanelFromNotification - 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 = LLToastPanel::buidPanelFromNotification(notification); - } - - // TODO: this if statement should be removed after modification of - // LLToastPanel::buidPanelFromNotification() to allow create generic tip panel - // for all tip notifications except FriendOnline and FriendOffline - if (notify_box == NULL) - { - notify_box = new LLToastNotifyPanel(notification); - } + LLToastPanel* notify_box = LLToastPanel::buidPanelFromNotification(notification); LLToast::Params p; p.notif_id = notification->getID(); -- cgit v1.2.3