From 935b3326254f75af876b6c9aeb1648ac3a9802cf Mon Sep 17 00:00:00 2001 From: "maxim@mnikolenko" Date: Fri, 7 Dec 2012 15:03:32 +0200 Subject: CHUI-427 FIXED Voice button is added to Conversations floater. --- indra/newview/llfloaterimcontainer.cpp | 13 +++++++++++++ indra/newview/llfloaterimcontainer.h | 2 ++ indra/newview/llfloaterimsessiontab.cpp | 3 ++- .../newview/skins/default/xui/en/floater_im_container.xml | 15 ++++++++++++++- 4 files changed, 31 insertions(+), 2 deletions(-) (limited to 'indra') diff --git a/indra/newview/llfloaterimcontainer.cpp b/indra/newview/llfloaterimcontainer.cpp index b8a37da3fa..bd99e88a9d 100644 --- a/indra/newview/llfloaterimcontainer.cpp +++ b/indra/newview/llfloaterimcontainer.cpp @@ -206,6 +206,7 @@ BOOL LLFloaterIMContainer::postBuild() mExpandCollapseBtn->setClickedCallback(boost::bind(&LLFloaterIMContainer::onExpandCollapseButtonClicked, this)); mStubCollapseBtn = getChild("stub_collapse_btn"); mStubCollapseBtn->setClickedCallback(boost::bind(&LLFloaterIMContainer::onStubCollapseButtonClicked, this)); + getChild("speak_btn")->setClickedCallback(boost::bind(&LLFloaterIMContainer::onSpeakButtonClicked, this)); childSetAction("add_btn", boost::bind(&LLFloaterIMContainer::onAddButtonClicked, this)); @@ -341,6 +342,11 @@ void LLFloaterIMContainer::onStubCollapseButtonClicked() collapseMessagesPane(true); } +void LLFloaterIMContainer::onSpeakButtonClicked() +{ + LLAgent::toggleMicrophone("speak"); + updateSpeakBtnState(); +} void LLFloaterIMContainer::onExpandCollapseButtonClicked() { if (mConversationsPane->isCollapsed() && mMessagesPane->isCollapsed() @@ -1672,6 +1678,13 @@ void LLFloaterIMContainer::reSelectConversation() } } +void LLFloaterIMContainer::updateSpeakBtnState() +{ + LLButton* mSpeakBtn = getChild("speak_btn"); + mSpeakBtn->setToggleState(LLVoiceClient::getInstance()->getUserPTTState()); + mSpeakBtn->setEnabled(LLAgent::isActionAllowed("speak")); +} + void LLFloaterIMContainer::flashConversationItemWidget(const LLUUID& session_id, bool is_flashes) { //Finds the conversation line item to flash using the session_id diff --git a/indra/newview/llfloaterimcontainer.h b/indra/newview/llfloaterimcontainer.h index c9987bffe8..92985c036a 100644 --- a/indra/newview/llfloaterimcontainer.h +++ b/indra/newview/llfloaterimcontainer.h @@ -117,6 +117,7 @@ private: void onExpandCollapseButtonClicked(); void onStubCollapseButtonClicked(); void processParticipantsStyleUpdate(); + void onSpeakButtonClicked(); void collapseConversationsPane(bool collapse); @@ -172,6 +173,7 @@ public: void setTimeNow(const LLUUID& session_id, const LLUUID& participant_id); void setNearbyDistances(); void reSelectConversation(); + void updateSpeakBtnState(); void flashConversationItemWidget(const LLUUID& session_id, bool is_flashes); private: diff --git a/indra/newview/llfloaterimsessiontab.cpp b/indra/newview/llfloaterimsessiontab.cpp index b50b8c2d32..0567ea3d8a 100644 --- a/indra/newview/llfloaterimsessiontab.cpp +++ b/indra/newview/llfloaterimsessiontab.cpp @@ -698,7 +698,8 @@ void LLFloaterIMSessionTab::updateCallBtnState(bool callIsActive) voiceButton->setToolTip( callIsActive? getString("end_call_button_tooltip") : getString("start_call_button_tooltip")); - enableDisableCallBtn(); + LLFloaterIMContainer::getInstance()->updateSpeakBtnState(); + enableDisableCallBtn(); } diff --git a/indra/newview/skins/default/xui/en/floater_im_container.xml b/indra/newview/skins/default/xui/en/floater_im_container.xml index 152c897120..a3648f3c9d 100644 --- a/indra/newview/skins/default/xui/en/floater_im_container.xml +++ b/indra/newview/skins/default/xui/en/floater_im_container.xml @@ -73,13 +73,26 @@ image_hover_unselected="Toolbar_Middle_Over" image_overlay="Conv_toolbar_plus" image_selected="Toolbar_Middle_Selected" - image_unselected="Toolbar_Middle_Off" + image_unselected="Toolbar_Middle_Off" layout="topleft" top="5" left_pad="4" name="add_btn" tool_tip="Start a new conversation" width="31"/> +