From 93e877a5ce9208f37872614a5b4ee2fabc3cbf11 Mon Sep 17 00:00:00 2001 From: richard Date: Thu, 5 Nov 2009 15:36:59 -0800 Subject: LLSpeakButton now cleans up after itself by removing transientfloatermgr references --- indra/newview/llspeakbutton.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra/newview/llspeakbutton.cpp') diff --git a/indra/newview/llspeakbutton.cpp b/indra/newview/llspeakbutton.cpp index cd765b0338..0b9c81dcc1 100644 --- a/indra/newview/llspeakbutton.cpp +++ b/indra/newview/llspeakbutton.cpp @@ -120,6 +120,8 @@ LLSpeakButton::LLSpeakButton(const Params& p) LLSpeakButton::~LLSpeakButton() { + LLTransientFloaterMgr::getInstance()->removeControlView(mSpeakBtn); + LLTransientFloaterMgr::getInstance()->removeControlView(mShowBtn); } void LLSpeakButton::setSpeakBtnToggleState(bool state) -- cgit v1.2.3 From e9048b17792b91e6bf8a05692d859ea9c94011d6 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Mon, 9 Nov 2009 17:13:37 +0000 Subject: Central-source the authoritative state of mic openness. --- indra/newview/llspeakbutton.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'indra/newview/llspeakbutton.cpp') diff --git a/indra/newview/llspeakbutton.cpp b/indra/newview/llspeakbutton.cpp index cd765b0338..312d7050b9 100644 --- a/indra/newview/llspeakbutton.cpp +++ b/indra/newview/llspeakbutton.cpp @@ -62,6 +62,15 @@ LLSpeakButton::Params::Params() // See widgets/talk_button.xml } +void LLSpeakButton::draw() +{ + // gVoiceClient is the authoritative global source of info regarding our open-mic state, we merely reflect that state. + bool openmic = gVoiceClient->getUserPTTState(); + mSpeakBtn->setToggleState(openmic); + llinfos << "mic state " << int(openmic) << llendl; + LLUICtrl::draw(); +} + LLSpeakButton::LLSpeakButton(const Params& p) : LLUICtrl(p) , mPrivateCallPanel(NULL) -- cgit v1.2.3 From 8b9c031f596280f79d06f688c2f654d7ec07a7d0 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Mon, 9 Nov 2009 17:51:21 +0000 Subject: Smarter mildly-refactored voice-toggle state management. --- indra/newview/llspeakbutton.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'indra/newview/llspeakbutton.cpp') diff --git a/indra/newview/llspeakbutton.cpp b/indra/newview/llspeakbutton.cpp index 312d7050b9..b2c0fcdaf2 100644 --- a/indra/newview/llspeakbutton.cpp +++ b/indra/newview/llspeakbutton.cpp @@ -93,7 +93,8 @@ LLSpeakButton::LLSpeakButton(const Params& p) addChild(mSpeakBtn); LLTransientFloaterMgr::getInstance()->addControlView(mSpeakBtn); - mSpeakBtn->setClickedCallback(boost::bind(&LLSpeakButton::onClick_SpeakBtn, this)); + mSpeakBtn->setMouseDownCallback(boost::bind(&LLSpeakButton::onMouseDown_SpeakBtn, this)); + mSpeakBtn->setMouseUpCallback(boost::bind(&LLSpeakButton::onMouseUp_SpeakBtn, this)); mSpeakBtn->setToggleState(FALSE); LLButton::Params show_params = p.show_button; @@ -131,15 +132,15 @@ LLSpeakButton::~LLSpeakButton() { } -void LLSpeakButton::setSpeakBtnToggleState(bool state) +void LLSpeakButton::onMouseDown_SpeakBtn() { - mSpeakBtn->setToggleState(state); + bool down = true; + gVoiceClient->inputUserControlState(down); // this method knows/care about whether this translates into a toggle-to-talk or down-to-talk } - -void LLSpeakButton::onClick_SpeakBtn() +void LLSpeakButton::onMouseUp_SpeakBtn() { - bool speaking = mSpeakBtn->getToggleState(); - gVoiceClient->setUserPTTState(speaking); + bool down = false; + gVoiceClient->inputUserControlState(down); } void LLSpeakButton::onClick_ShowBtn() -- cgit v1.2.3 From 0777c177525c8ff2889e9cd5f06877de3c5f9f31 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Mon, 9 Nov 2009 17:54:40 +0000 Subject: remove debug spew. --- indra/newview/llspeakbutton.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'indra/newview/llspeakbutton.cpp') diff --git a/indra/newview/llspeakbutton.cpp b/indra/newview/llspeakbutton.cpp index b2c0fcdaf2..d441762fa6 100644 --- a/indra/newview/llspeakbutton.cpp +++ b/indra/newview/llspeakbutton.cpp @@ -67,7 +67,6 @@ void LLSpeakButton::draw() // gVoiceClient is the authoritative global source of info regarding our open-mic state, we merely reflect that state. bool openmic = gVoiceClient->getUserPTTState(); mSpeakBtn->setToggleState(openmic); - llinfos << "mic state " << int(openmic) << llendl; LLUICtrl::draw(); } -- cgit v1.2.3 From fb20a7281d8e5107f83e7439df054ccd3733d0c4 Mon Sep 17 00:00:00 2001 From: James Cook Date: Tue, 10 Nov 2009 17:12:07 -0800 Subject: EXT-2338 Move button tooltips to strings the viewer translation tool can parse. Also moved mSpeakBtn from llnearbychatbar to llbottomtray, because the bottom tray is its parent. --- indra/newview/llspeakbutton.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'indra/newview/llspeakbutton.cpp') diff --git a/indra/newview/llspeakbutton.cpp b/indra/newview/llspeakbutton.cpp index 57ea018f25..51d53b2674 100644 --- a/indra/newview/llspeakbutton.cpp +++ b/indra/newview/llspeakbutton.cpp @@ -133,6 +133,16 @@ LLSpeakButton::~LLSpeakButton() LLTransientFloaterMgr::getInstance()->removeControlView(mShowBtn); } +void LLSpeakButton::setSpeakToolTip(const std::string& msg) +{ + mSpeakBtn->setToolTip(msg); +} + +void LLSpeakButton::setShowToolTip(const std::string& msg) +{ + mShowBtn->setToolTip(msg); +} + void LLSpeakButton::onMouseDown_SpeakBtn() { bool down = true; -- cgit v1.2.3