diff options
author | Nat Goodspeed <nat@lindenlab.com> | 2024-05-15 16:15:46 -0400 |
---|---|---|
committer | Nat Goodspeed <nat@lindenlab.com> | 2024-05-15 16:15:46 -0400 |
commit | 1b5f0590ce45ce6e540d266a8902af5839885cfb (patch) | |
tree | f923407fc28fb2f046ac451976a02490ab15787e /indra/newview/llinspecttoast.cpp | |
parent | f822193974af363fa4bb0208dc02848be6c983a2 (diff) | |
parent | e7eced3c87310b15ac20cc3cd470d67686104a14 (diff) |
Merge commit 'e7eced3' into nat/releaseos for whitespace fix.
Diffstat (limited to 'indra/newview/llinspecttoast.cpp')
-rw-r--r-- | indra/newview/llinspecttoast.cpp | 140 |
1 files changed, 70 insertions, 70 deletions
diff --git a/indra/newview/llinspecttoast.cpp b/indra/newview/llinspecttoast.cpp index 6f93a78ca6..0104714a16 100644 --- a/indra/newview/llinspecttoast.cpp +++ b/indra/newview/llinspecttoast.cpp @@ -1,25 +1,25 @@ -/** +/** * @file llinspecttoast.cpp * @brief Toast inspector implementation. * * $LicenseInfo:firstyear=2003&license=viewerlgpl$ * Second Life Viewer Source Code * Copyright (C) 2010, Linden Research, Inc. - * + * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; * version 2.1 of the License only. - * + * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. - * + * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * + * * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ @@ -42,85 +42,85 @@ class LLInspectToast: public LLInspect { public: - LLInspectToast(const LLSD& notification_idl); - virtual ~LLInspectToast(); + LLInspectToast(const LLSD& notification_idl); + virtual ~LLInspectToast(); - /*virtual*/ void onOpen(const LLSD& notification_id); - /*virtual*/ BOOL handleToolTip(S32 x, S32 y, MASK mask); + /*virtual*/ void onOpen(const LLSD& notification_id); + /*virtual*/ BOOL handleToolTip(S32 x, S32 y, MASK mask); /*virtual*/ void deleteAllChildren(); - /*virtual*/ void removeChild(LLView* child); + /*virtual*/ void removeChild(LLView* child); private: - void onToastDestroy(LLToast * toast); + void onToastDestroy(LLToast * toast); - boost::signals2::scoped_connection mConnection; - LLPanel* mPanel; - LLScreenChannel* mScreenChannel; + boost::signals2::scoped_connection mConnection; + LLPanel* mPanel; + LLScreenChannel* mScreenChannel; }; LLInspectToast::LLInspectToast(const LLSD& notification_id) : - LLInspect(LLSD()), mPanel(NULL) + LLInspect(LLSD()), mPanel(NULL) { - LLScreenChannelBase* channel = LLChannelManager::getInstance()->findChannelByID( - LLUUID(gSavedSettings.getString("NotificationChannelUUID"))); - mScreenChannel = dynamic_cast<LLScreenChannel*>(channel); - if(NULL == mScreenChannel) - { - LL_WARNS() << "Could not get requested screen channel." << LL_ENDL; - return; - } - - LLTransientFloaterMgr::getInstance()->addControlView(this); + LLScreenChannelBase* channel = LLChannelManager::getInstance()->findChannelByID( + LLUUID(gSavedSettings.getString("NotificationChannelUUID"))); + mScreenChannel = dynamic_cast<LLScreenChannel*>(channel); + if(NULL == mScreenChannel) + { + LL_WARNS() << "Could not get requested screen channel." << LL_ENDL; + return; + } + + LLTransientFloaterMgr::getInstance()->addControlView(this); } LLInspectToast::~LLInspectToast() { - LLTransientFloaterMgr::getInstance()->removeControlView(this); + LLTransientFloaterMgr::getInstance()->removeControlView(this); - mConnection.disconnect(); + mConnection.disconnect(); } // virtual void LLInspectToast::onOpen(const LLSD& notification_id) { - LLInspect::onOpen(notification_id); - LLToast* toast = mScreenChannel->getToastByNotificationID(notification_id); - if (toast == NULL) - { - LL_WARNS() << "Could not get requested toast from screen channel." << LL_ENDL; - return; - } - mConnection = toast->setOnToastDestroyedCallback(boost::bind(&LLInspectToast::onToastDestroy, this, _1)); - - LLPanel * panel = toast->getPanel(); - if (panel == NULL) - { - LL_WARNS() << "Could not get toast's panel." << LL_ENDL; - return; - } - panel->setVisible(TRUE); - panel->setMouseOpaque(FALSE); - if(mPanel != NULL && mPanel->getParent() == this) - { - LLInspect::removeChild(mPanel); - } - addChild(panel); - panel->setFocus(TRUE); - mPanel = panel; - - - LLRect panel_rect; - panel_rect = panel->getRect(); - reshape(panel_rect.getWidth(), panel_rect.getHeight()); - - LLInspect::repositionInspector(notification_id); + LLInspect::onOpen(notification_id); + LLToast* toast = mScreenChannel->getToastByNotificationID(notification_id); + if (toast == NULL) + { + LL_WARNS() << "Could not get requested toast from screen channel." << LL_ENDL; + return; + } + mConnection = toast->setOnToastDestroyedCallback(boost::bind(&LLInspectToast::onToastDestroy, this, _1)); + + LLPanel * panel = toast->getPanel(); + if (panel == NULL) + { + LL_WARNS() << "Could not get toast's panel." << LL_ENDL; + return; + } + panel->setVisible(TRUE); + panel->setMouseOpaque(FALSE); + if(mPanel != NULL && mPanel->getParent() == this) + { + LLInspect::removeChild(mPanel); + } + addChild(panel); + panel->setFocus(TRUE); + mPanel = panel; + + + LLRect panel_rect; + panel_rect = panel->getRect(); + reshape(panel_rect.getWidth(), panel_rect.getHeight()); + + LLInspect::repositionInspector(notification_id); } // virtual BOOL LLInspectToast::handleToolTip(S32 x, S32 y, MASK mask) { - // We don't like the way LLInspect handles tooltips - // (black tooltips look weird), - // so force using the default implementation (STORM-511). - return LLFloater::handleToolTip(x, y, mask); + // We don't like the way LLInspect handles tooltips + // (black tooltips look weird), + // so force using the default implementation (STORM-511). + return LLFloater::handleToolTip(x, y, mask); } void LLInspectToast::deleteAllChildren() @@ -132,21 +132,21 @@ void LLInspectToast::deleteAllChildren() // virtual void LLInspectToast::removeChild(LLView* child) { - if (mPanel == child) - { - mPanel = NULL; - } - LLInspect::removeChild(child); + if (mPanel == child) + { + mPanel = NULL; + } + LLInspect::removeChild(child); } void LLInspectToast::onToastDestroy(LLToast * toast) { - closeFloater(false); + closeFloater(false); } void LLNotificationsUI::registerFloater() { - LLFloaterReg::add("inspect_toast", "inspect_toast.xml", - &LLFloaterReg::build<LLInspectToast>); + LLFloaterReg::add("inspect_toast", "inspect_toast.xml", + &LLFloaterReg::build<LLInspectToast>); } |