diff options
Diffstat (limited to 'indra/newview/llnearbychat.cpp')
-rw-r--r-- | indra/newview/llnearbychat.cpp | 100 |
1 files changed, 27 insertions, 73 deletions
diff --git a/indra/newview/llnearbychat.cpp b/indra/newview/llnearbychat.cpp index 03ebc344f1..a7303ad035 100644 --- a/indra/newview/llnearbychat.cpp +++ b/indra/newview/llnearbychat.cpp @@ -32,8 +32,9 @@ #include "llrootview.h" //#include "llchatitemscontainerctrl.h" #include "lliconctrl.h" -#include "llsidetray.h" +#include "llfloatersidepanelcontainer.h" #include "llfocusmgr.h" +#include "lllogchat.h" #include "llresizebar.h" #include "llresizehandle.h" #include "llmenugl.h" @@ -50,21 +51,18 @@ #include "lldraghandle.h" -#include "llbottomtray.h" #include "llnearbychatbar.h" #include "llfloaterreg.h" #include "lltrans.h" static const S32 RESIZE_BAR_THICKNESS = 3; -LLNearbyChat::LLNearbyChat(const LLSD& key) - : LLDockableFloater(NULL, false, false, key) - ,mChatHistory(NULL) -{ - -} -LLNearbyChat::~LLNearbyChat() +static LLRegisterPanelClassWrapper<LLNearbyChat> t_panel_nearby_chat("panel_nearby_chat"); + +LLNearbyChat::LLNearbyChat(const LLNearbyChat::Params& p) +: LLPanel(p), + mChatHistory(NULL) { } @@ -86,54 +84,12 @@ BOOL LLNearbyChat::postBuild() mChatHistory = getChild<LLChatHistory>("chat_history"); - if(!LLDockableFloater::postBuild()) + if(!LLPanel::postBuild()) return false; - - if (getDockControl() == NULL) - { - setDockControl(new LLDockControl( - LLBottomTray::getInstance()->getNearbyChatBar(), this, - getDockTongue(), LLDockControl::TOP, boost::bind(&LLNearbyChat::getAllowedRect, this, _1))); - } - - //fix for EXT-4621 - //chrome="true" prevents floater from stilling capture - setIsChrome(true); - //chrome="true" hides floater caption - if (mDragHandle) - mDragHandle->setTitleVisible(TRUE); - + return true; } - -void LLNearbyChat::applySavedVariables() -{ - if (mRectControl.size() > 1) - { - const LLRect& rect = LLFloater::getControlGroup()->getRect(mRectControl); - if(!rect.isEmpty() && rect.isValid()) - { - reshape(rect.getWidth(), rect.getHeight()); - setRect(rect); - } - } - - - if(!LLFloater::getControlGroup()->controlExists(mDocStateControl)) - { - setDocked(true); - } - else - { - if (mDocStateControl.size() > 1) - { - bool dockState = LLFloater::getControlGroup()->getBOOL(mDocStateControl); - setDocked(dockState); - } - } -} - std::string appendTime() { time_t utc_time; @@ -203,7 +159,7 @@ void LLNearbyChat::onNearbySpeakers() { LLSD param; param["people_panel_tab_name"] = "nearby_panel"; - LLSideTray::getInstance()->showPanel("panel_people",param); + LLFloaterSidePanelContainer::showPanel("people", "panel_people", param); } @@ -218,30 +174,26 @@ bool LLNearbyChat::onNearbyChatCheckContextMenuItem(const LLSD& userdata) return false; } -void LLNearbyChat::setVisible(BOOL visible) +void LLNearbyChat::removeScreenChat() { - if(visible) + LLNotificationsUI::LLScreenChannelBase* chat_channel = LLNotificationsUI::LLChannelManager::getInstance()->findChannelByID(LLUUID(gSavedSettings.getString("NearByChatChannelUUID"))); + if(chat_channel) { - LLNotificationsUI::LLScreenChannelBase* chat_channel = LLNotificationsUI::LLChannelManager::getInstance()->findChannelByID(LLUUID(gSavedSettings.getString("NearByChatChannelUUID"))); - if(chat_channel) - { - chat_channel->removeToastsFromChannel(); - } + chat_channel->removeToastsFromChannel(); } - - LLDockableFloater::setVisible(visible); } -void LLNearbyChat::onOpen(const LLSD& key ) +void LLNearbyChat::setVisible(BOOL visible) { - LLDockableFloater::onOpen(key); -} + if(visible) + { + removeScreenChat(); + } -void LLNearbyChat::setRect (const LLRect &rect) -{ - LLDockableFloater::setRect(rect); + LLPanel::setVisible(visible); } + void LLNearbyChat::getAllowedRect(LLRect& rect) { rect = gViewerWindow->getWorldViewRectScaled(); @@ -263,7 +215,8 @@ void LLNearbyChat::updateChatHistoryStyle() //static void LLNearbyChat::processChatHistoryStyleUpdate(const LLSD& newvalue) { - LLNearbyChat* nearby_chat = LLFloaterReg::getTypedInstance<LLNearbyChat>("nearby_chat", LLSD()); + LLFloater* chat_bar = LLFloaterReg::getInstance("chat_bar"); + LLNearbyChat* nearby_chat = chat_bar->findChild<LLNearbyChat>("nearby_chat"); if(nearby_chat) nearby_chat->updateChatHistoryStyle(); } @@ -339,7 +292,8 @@ void LLNearbyChat::loadHistory() //static LLNearbyChat* LLNearbyChat::getInstance() { - return LLFloaterReg::getTypedInstance<LLNearbyChat>("nearby_chat", LLSD()); + LLFloater* chat_bar = LLFloaterReg::getInstance("chat_bar"); + return chat_bar->findChild<LLNearbyChat>("nearby_chat"); } //////////////////////////////////////////////////////////////////////////////// @@ -367,7 +321,7 @@ BOOL LLNearbyChat::handleMouseDown(S32 x, S32 y, MASK mask) if(mChatHistory) mChatHistory->setFocus(TRUE); - return LLDockableFloater::handleMouseDown(x, y, mask); + return LLPanel::handleMouseDown(x, y, mask); } void LLNearbyChat::draw() @@ -380,5 +334,5 @@ void LLNearbyChat::draw() setTransparencyType(hasFocus() ? TT_ACTIVE : TT_INACTIVE); } - LLDockableFloater::draw(); + LLPanel::draw(); } |