From cdd9c57b2c9f02167e78322e5631822b0cd0521b Mon Sep 17 00:00:00 2001 From: Mike Antipov Date: Wed, 25 Nov 2009 13:44:53 +0200 Subject: Work on major sub-task EXT-2790 (Complete Voice Control Panel (floater) started by Lynx (LLVoiceControlPanel)) -- Replaced LLVoiceControlPanel with LLCallFloater in Speak button implementation --HG-- branch : product-engine --- indra/newview/llspeakbutton.cpp | 48 ++++++++++++++++------------------------- 1 file changed, 19 insertions(+), 29 deletions(-) (limited to 'indra/newview/llspeakbutton.cpp') diff --git a/indra/newview/llspeakbutton.cpp b/indra/newview/llspeakbutton.cpp index 54f776ca6a..9562d7828c 100644 --- a/indra/newview/llspeakbutton.cpp +++ b/indra/newview/llspeakbutton.cpp @@ -32,19 +32,13 @@ #include "llviewerprecompiledheaders.h" // must be first include +#include "llbutton.h" + #include "llagent.h" #include "llbottomtray.h" -#include "llfloaterreg.h" -#include "llvoiceclient.h" -#include "llvoicecontrolpanel.h" -#include "lltransientfloatermgr.h" - -#include "llavatariconctrl.h" -#include "llbutton.h" -#include "llpanel.h" -#include "lltextbox.h" +#include "llcallfloater.h" #include "lloutputmonitorctrl.h" -#include "llgroupmgr.h" +#include "lltransientfloatermgr.h" #include "llspeakbutton.h" @@ -72,7 +66,6 @@ void LLSpeakButton::draw() LLSpeakButton::LLSpeakButton(const Params& p) : LLUICtrl(p) -, mPrivateCallPanel(NULL) , mOutputMonitor(NULL) , mSpeakBtn(NULL) , mShowBtn(NULL) @@ -179,9 +172,11 @@ void LLSpeakButton::onClick_ShowBtn() { if(!mShowBtn->getToggleState()) { - mPrivateCallPanel->onClickClose(mPrivateCallPanel); - delete mPrivateCallPanel; - mPrivateCallPanel = NULL; + if (!mPrivateCallPanel.isDead()) + { + LLFloater* instance = mPrivateCallPanel.get(); + instance->onClickClose(instance); + } mShowBtn->setToggleState(FALSE); return; } @@ -191,25 +186,20 @@ void LLSpeakButton::onClick_ShowBtn() localPointToScreen(x, y, &x, &y); - mPrivateCallPanel = new LLVoiceControlPanel; - getRootView()->addChild(mPrivateCallPanel); - - y = LLBottomTray::getInstance()->getRect().getHeight() + mPrivateCallPanel->getRect().getHeight(); + LLCallFloater* instance = new LLCallFloater; + mPrivateCallPanel = instance->getHandle(); - LLRect rect; - rect.setLeftTopAndSize(x, y, mPrivateCallPanel->getRect().getWidth(), mPrivateCallPanel->getRect().getHeight()); - mPrivateCallPanel->setRect(rect); + // *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(); - LLAvatarListItem* item = new LLAvatarListItem(); - item->showLastInteractionTime(false); - item->showInfoBtn(true); - item->showSpeakingIndicator(true); - item->reshape(mPrivateCallPanel->getRect().getWidth(), item->getRect().getHeight(), FALSE); + LLRect rect; + rect.setLeftTopAndSize(x, y, instance->getRect().getWidth(), instance->getRect().getHeight()); + instance->setRect(rect); - mPrivateCallPanel->addItem(item); - mPrivateCallPanel->setVisible(TRUE); - mPrivateCallPanel->setFrontmost(TRUE); + instance->setVisible(TRUE); + instance->setFrontmost(TRUE); mShowBtn->setToggleState(TRUE); } -- cgit v1.2.3 From e0717c6aac140c840e6ca614afd39b6d95d46329 Mon Sep 17 00:00:00 2001 From: Mike Antipov Date: Thu, 26 Nov 2009 11:39:59 +0200 Subject: 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 --- indra/newview/llspeakbutton.cpp | 41 +++-------------------------------------- 1 file changed, 3 insertions(+), 38 deletions(-) (limited to 'indra/newview/llspeakbutton.cpp') 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); -} - -- cgit v1.2.3