diff options
author | Mike Antipov <mantipov@productengine.com> | 2009-11-26 11:39:59 +0200 |
---|---|---|
committer | Mike Antipov <mantipov@productengine.com> | 2009-11-26 11:39:59 +0200 |
commit | e0717c6aac140c840e6ca614afd39b6d95d46329 (patch) | |
tree | fcede7b2fe3d12457dd1600280a9e6b6e2c9d231 /indra | |
parent | 4c81e7a85c3fe69f16ac3996df732627dda8533a (diff) |
Work on major sub-task EXT-2790 (Complete Voice Control Panel (floater) started by Lynx (LLVoiceControlPanel))
-- made Voice Control Panel dockable to speak panel
-- move button toggle state processing from the code to xml
--HG--
branch : product-engine
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/llcallfloater.cpp | 15 | ||||
-rw-r--r-- | indra/newview/llcallfloater.h | 6 | ||||
-rw-r--r-- | indra/newview/llspeakbutton.cpp | 41 | ||||
-rw-r--r-- | indra/newview/llspeakbutton.h | 2 | ||||
-rw-r--r-- | indra/newview/llviewerfloaterreg.cpp | 2 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/floater_voice_controls.xml | 2 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/panel_bottomtray.xml | 8 |
7 files changed, 28 insertions, 48 deletions
diff --git a/indra/newview/llcallfloater.cpp b/indra/newview/llcallfloater.cpp index eaa048f5aa..2c77933b68 100644 --- a/indra/newview/llcallfloater.cpp +++ b/indra/newview/llcallfloater.cpp @@ -36,17 +36,18 @@ #include "llcallfloater.h" #include "llavatarlist.h" +#include "llbottomtray.h" #include "llparticipantlist.h" #include "llspeakers.h" -LLCallFloater::LLCallFloater() -: LLFloater(LLSD()) +LLCallFloater::LLCallFloater(const LLSD& key) +: LLDockableFloater(NULL, key) , mSpeakerManager(NULL) , mPaticipants(NULL) , mAvatarList(NULL) { - LLUICtrlFactory::getInstance()->buildFloater(this, "floater_voice_controls.xml", NULL); + } LLCallFloater::~LLCallFloater() @@ -58,12 +59,18 @@ LLCallFloater::~LLCallFloater() // virtual BOOL LLCallFloater::postBuild() { - LLFloater::postBuild(); + LLDockableFloater::postBuild(); mAvatarList = getChild<LLAvatarList>("speakers_list"); mSpeakerManager = LLLocalSpeakerMgr::getInstance(); mPaticipants = new LLParticipantList(mSpeakerManager, mAvatarList); + LLView *anchor_panel = LLBottomTray::getInstance()->getChild<LLView>("speak_panel"); + + setDockControl(new LLDockControl( + anchor_panel, this, + getDockTongue(), LLDockControl::TOP)); + return TRUE; } //EOF diff --git a/indra/newview/llcallfloater.h b/indra/newview/llcallfloater.h index f1afddb1cc..8c4a204943 100644 --- a/indra/newview/llcallfloater.h +++ b/indra/newview/llcallfloater.h @@ -34,7 +34,7 @@ #ifndef LL_LLCALLFLOATER_H #define LL_LLCALLFLOATER_H -#include "llfloater.h" +#include "lldockablefloater.h" class LLAvatarList; class LLParticipantList; @@ -51,10 +51,10 @@ class LLSpeakerMgr; * When the Resident is engaged in Group Voice Chat, the Voice Control Panel also provides an * 'End Call' button to allow the Resident to leave that voice channel. */ -class LLCallFloater : public LLFloater +class LLCallFloater : public LLDockableFloater { public: - LLCallFloater(); + LLCallFloater(const LLSD& key); ~LLCallFloater(); /*virtual*/ BOOL postBuild(); diff --git a/indra/newview/llspeakbutton.cpp b/indra/newview/llspeakbutton.cpp index 9562d7828c..5edc4804ca 100644 --- a/indra/newview/llspeakbutton.cpp +++ b/indra/newview/llspeakbutton.cpp @@ -33,6 +33,7 @@ #include "llviewerprecompiledheaders.h" // must be first include #include "llbutton.h" +#include "llfloaterreg.h" #include "llagent.h" #include "llbottomtray.h" @@ -95,8 +96,8 @@ LLSpeakButton::LLSpeakButton(const Params& p) addChild(mShowBtn); LLTransientFloaterMgr::getInstance()->addControlView(mShowBtn); - mShowBtn->setClickedCallback(boost::bind(&LLSpeakButton::onClick_ShowBtn, this)); - mShowBtn->setToggleState(FALSE); +// mShowBtn->setClickedCallback(boost::bind(&LLSpeakButton::onClick_ShowBtn, this)); +// mShowBtn->setToggleState(FALSE); static const S32 MONITOR_RIGHT_PAD = 2; @@ -168,39 +169,3 @@ void LLSpeakButton::onMouseUp_SpeakBtn() gVoiceClient->inputUserControlState(down); } -void LLSpeakButton::onClick_ShowBtn() -{ - if(!mShowBtn->getToggleState()) - { - if (!mPrivateCallPanel.isDead()) - { - LLFloater* instance = mPrivateCallPanel.get(); - instance->onClickClose(instance); - } - mShowBtn->setToggleState(FALSE); - return; - } - - S32 x = mSpeakBtn->getRect().mLeft; - S32 y = 0; - - localPointToScreen(x, y, &x, &y); - - LLCallFloater* instance = new LLCallFloater; - mPrivateCallPanel = instance->getHandle(); - - // *TODO: mantipov: why we are adding this floater to Root View? It is in FloaterView by default - getRootView()->addChild(instance); - - y = LLBottomTray::getInstance()->getRect().getHeight() + instance->getRect().getHeight(); - - LLRect rect; - rect.setLeftTopAndSize(x, y, instance->getRect().getWidth(), instance->getRect().getHeight()); - instance->setRect(rect); - - instance->setVisible(TRUE); - instance->setFrontmost(TRUE); - - mShowBtn->setToggleState(TRUE); -} - diff --git a/indra/newview/llspeakbutton.h b/indra/newview/llspeakbutton.h index 33f7c9fa28..6660b50240 100644 --- a/indra/newview/llspeakbutton.h +++ b/indra/newview/llspeakbutton.h @@ -86,8 +86,6 @@ protected: void onMouseDown_SpeakBtn(); void onMouseUp_SpeakBtn(); - void onClick_ShowBtn(); - private: LLButton* mSpeakBtn; LLButton* mShowBtn; diff --git a/indra/newview/llviewerfloaterreg.cpp b/indra/newview/llviewerfloaterreg.cpp index 642df92379..29151f2038 100644 --- a/indra/newview/llviewerfloaterreg.cpp +++ b/indra/newview/llviewerfloaterreg.cpp @@ -38,6 +38,7 @@ #include "llviewerfloaterreg.h" #include "llcompilequeue.h" +#include "llcallfloater.h" #include "llfloaterabout.h" #include "llfloateractivespeakers.h" #include "llfloateranimpreview.h" @@ -248,6 +249,7 @@ void LLViewerFloaterReg::registerFloaters() LLFloaterReg::add("upload_sound", "floater_sound_preview.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterSoundPreview>, "upload"); LLFloaterReg::add("voice_call", "floater_call.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterCall>); + LLFloaterReg::add("voice_controls", "floater_voice_controls.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLCallFloater>); LLFloaterReg::add("whitelist_entry", "floater_whitelist_entry.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterWhiteListEntry>); LLFloaterReg::add("world_map", "floater_world_map.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterWorldMap>); diff --git a/indra/newview/skins/default/xui/en/floater_voice_controls.xml b/indra/newview/skins/default/xui/en/floater_voice_controls.xml index 82b4372a4b..b718cc40fe 100644 --- a/indra/newview/skins/default/xui/en/floater_voice_controls.xml +++ b/indra/newview/skins/default/xui/en/floater_voice_controls.xml @@ -5,6 +5,8 @@ layout="topleft" name="floater_voice_controls" title="Voice Controls" + save_visibility="true" + single_instance="true" width="282"> <panel bevel_style="in" diff --git a/indra/newview/skins/default/xui/en/panel_bottomtray.xml b/indra/newview/skins/default/xui/en/panel_bottomtray.xml index da8006d545..ec3f7ea7c5 100644 --- a/indra/newview/skins/default/xui/en/panel_bottomtray.xml +++ b/indra/newview/skins/default/xui/en/panel_bottomtray.xml @@ -72,7 +72,13 @@ left="0" name="talk" top="4" - width="100" /> + width="100"> + <show_button> + <show_button.init_callback + function="Button.SetDockableFloaterToggle" + parameter="voice_controls" /> + </show_button> + </talk_button> </layout_panel> <icon auto_resize="false" |