From 4105ae946707947e469793364e07adde7993cffe Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales <gilbert@lindenlab.com> Date: Mon, 26 Nov 2012 19:12:04 -0800 Subject: [PATCH] CHUI-529: Post code review changes. When showing a floater using LLFloater::showInstance() instead of setVisibleAndFrontmost(). Also made setVisibleAndFrontmost() public since both setVisible and setFrontmost are public functions. --- indra/llui/llfloater.h | 2 +- indra/newview/llfloaterimnearbychathandler.cpp | 8 +------- indra/newview/llimview.cpp | 8 +------- 3 files changed, 3 insertions(+), 15 deletions(-) diff --git a/indra/llui/llfloater.h b/indra/llui/llfloater.h index a657538eb7c..9ad566a1a1e 100644 --- a/indra/llui/llfloater.h +++ b/indra/llui/llfloater.h @@ -302,6 +302,7 @@ class LLFloater : public LLPanel, public LLInstanceTracker<LLFloater> /*virtual*/ void handleVisibilityChange ( BOOL new_visibility ); // do not override void setFrontmost(BOOL take_focus = TRUE); + virtual void setVisibleAndFrontmost(BOOL take_focus=TRUE); // Defaults to false. virtual BOOL canSaveAs() const { return FALSE; } @@ -373,7 +374,6 @@ class LLFloater : public LLPanel, public LLInstanceTracker<LLFloater> void setInstanceName(const std::string& name); virtual void bringToFront(S32 x, S32 y); - virtual void setVisibleAndFrontmost(BOOL take_focus=TRUE); void setExpandedRect(const LLRect& rect) { mExpandedRect = rect; } // size when not minimized const LLRect& getExpandedRect() const { return mExpandedRect; } diff --git a/indra/newview/llfloaterimnearbychathandler.cpp b/indra/newview/llfloaterimnearbychathandler.cpp index 2d8a6d46fe7..d9c461e8360 100644 --- a/indra/newview/llfloaterimnearbychathandler.cpp +++ b/indra/newview/llfloaterimnearbychathandler.cpp @@ -622,13 +622,7 @@ void LLFloaterIMNearbyChatHandler::processChat(const LLChat& chat_msg, //Will show Conversations floater when chat preference is set else if(gSavedSettings.getString("NotificationNearbyChatOptions") == "openconversations") { - LLFloaterIMContainer * floaterIMContainer = LLFloaterIMContainer::getInstance(); - - if(floaterIMContainer) - { - floaterIMContainer->setVisible(TRUE); - floaterIMContainer->setFrontmost(TRUE); - } + LLFloaterReg::showInstance("im_container"); } } diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index fc6be2cd979..581043a3d0f 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -191,13 +191,7 @@ void on_new_message(const LLSD& msg) } else if("openconversations" == action) { - LLFloaterIMContainer * floaterIMContainer = LLFloaterIMContainer::getInstance(); - - if(floaterIMContainer) - { - floaterIMContainer->setVisible(TRUE); - floaterIMContainer->setFrontmost(TRUE); - } + LLFloaterReg::showInstance("im_container"); } } -- GitLab