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
meow-7.2.2
Mike Antipov 2009-11-26 11:39:59 +02:00
parent 4c81e7a85c
commit e0717c6aac
7 changed files with 28 additions and 48 deletions

View File

@ -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

View File

@ -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();

View File

@ -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);
}

View File

@ -86,8 +86,6 @@ protected:
void onMouseDown_SpeakBtn();
void onMouseUp_SpeakBtn();
void onClick_ShowBtn();
private:
LLButton* mSpeakBtn;
LLButton* mShowBtn;

View File

@ -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>);

View File

@ -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"

View File

@ -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"