From cb3b9ba6af57aed4c21ec24cb5523d2a52798117 Mon Sep 17 00:00:00 2001 From: Ansariel Date: Mon, 23 Feb 2015 20:22:50 +0100 Subject: [PATCH] On a second thought: Partially revert last commit because this actually makes sense if IMs are shown in separate floaters which are LLTransientDockableFloater and would be closed if the user tries to change the voice volume --- indra/newview/fsfloatervoicecontrols.cpp | 4 +++- indra/newview/fsfloatervoicecontrols.h | 7 ++++-- indra/newview/lltoolbarview.cpp | 28 ++++++++++++------------ 3 files changed, 22 insertions(+), 17 deletions(-) diff --git a/indra/newview/fsfloatervoicecontrols.cpp b/indra/newview/fsfloatervoicecontrols.cpp index f761e7090c..bf882363c5 100644 --- a/indra/newview/fsfloatervoicecontrols.cpp +++ b/indra/newview/fsfloatervoicecontrols.cpp @@ -101,7 +101,7 @@ static void* create_non_avatar_caller(void*) LLVoiceChannel* FSFloaterVoiceControls::sCurrentVoiceChannel = NULL; FSFloaterVoiceControls::FSFloaterVoiceControls(const LLSD& key) -: LLFloater(key) +: LLTransientDockableFloater(NULL, false, key) , mSpeakerManager(NULL) , mParticipants(NULL) , mAvatarList(NULL) @@ -119,6 +119,7 @@ FSFloaterVoiceControls::FSFloaterVoiceControls(const LLSD& key) mFactoryMap["non_avatar_caller"] = LLCallbackMap(create_non_avatar_caller, NULL); LLVoiceClient::instance().addObserver(this); + LLTransientFloaterMgr::getInstance()->addControlView(this); // update the agent's name if display name setting change LLAvatarNameCache::addUseDisplayNamesCallback(boost::bind(&FSFloaterVoiceControls::updateAgentModeratorState, this)); @@ -141,6 +142,7 @@ FSFloaterVoiceControls::~FSFloaterVoiceControls() { LLVoiceClient::getInstance()->removeObserver(this); } + LLTransientFloaterMgr::getInstance()->removeControlView(this); } // virtual diff --git a/indra/newview/fsfloatervoicecontrols.h b/indra/newview/fsfloatervoicecontrols.h index e1d76e98a7..31843b181f 100644 --- a/indra/newview/fsfloatervoicecontrols.h +++ b/indra/newview/fsfloatervoicecontrols.h @@ -30,7 +30,7 @@ #ifndef FS_FLOATERVOICECONTROLS_H #define FS_FLOATERVOICECONTROLS_H -#include "llfloater.h" +#include "lltransientdockablefloater.h" #include "llvoicechannel.h" #include "llvoiceclient.h" @@ -55,7 +55,7 @@ class LLSliderCtrl; * When the Resident is engaged in any chat except Nearby Chat, the Voice Control Panel * also provides a 'Leave Call' button to allow the Resident to leave that voice channel. */ -class FSFloaterVoiceControls : public LLFloater, LLVoiceClientParticipantObserver +class FSFloaterVoiceControls : public LLTransientDockableFloater, LLVoiceClientParticipantObserver { public: @@ -291,6 +291,9 @@ private: */ static LLVoiceChannel* sCurrentVoiceChannel; + /* virtual */ + LLTransientFloaterMgr::ETransientGroup getGroup() { return LLTransientFloaterMgr::IM; } + boost::signals2::connection mVoiceChannelStateChangeConnection; }; diff --git a/indra/newview/lltoolbarview.cpp b/indra/newview/lltoolbarview.cpp index fec145af70..adc08e069d 100755 --- a/indra/newview/lltoolbarview.cpp +++ b/indra/newview/lltoolbarview.cpp @@ -539,14 +539,14 @@ void LLToolBarView::onToolBarButtonAdded(LLView* button) } } } - // Nearby Voices isn't a TransientDockableFloater and the button doesn't exist in V3 anymore - //else if (button->getName() == "voice") - //{ - // // Add the "Voice controls" button as a control view in LLTransientFloaterMgr - // // to prevent hiding the transient IM floater upon pressing "Voice controls". - // LLTransientFloaterMgr::getInstance()->addControlView(button); - //} - // + // Do not remove in case they get removed by LL! We need this for standalone + // IM floaters. + else if (button->getName() == "voice") + { + // Add the "Voice controls" button as a control view in LLTransientFloaterMgr + // to prevent hiding the transient IM floater upon pressing "Voice controls". + LLTransientFloaterMgr::getInstance()->addControlView(button); + } // Dockable QuickPrefs floater else if (button->getName() == "quickprefs" && !FSCommon::isLegacySkin()) { @@ -591,12 +591,12 @@ void LLToolBarView::onToolBarButtonRemoved(LLView* button) dock_control->setDock(NULL); } } - // Nearby Voices isn't a TransientDockableFloater and the button doesn't exist in V3 anymore - //else if (button->getName() == "voice") - //{ - // LLTransientFloaterMgr::getInstance()->removeControlView(button); - //} - // + // Do not remove in case they get removed by LL! We need this for standalone + // IM floaters. + else if (button->getName() == "voice") + { + LLTransientFloaterMgr::getInstance()->removeControlView(button); + } // Dockable QuickPrefs floater else if (button->getName() == "quickprefs" && !FSCommon::isLegacySkin()) {