From 3039663148b0adc64220964b10cad595e5137cc0 Mon Sep 17 00:00:00 2001
From: Leyla Farazha <leyla@lindenlab.com>
Date: Mon, 9 May 2011 15:10:56 -0700
Subject: [PATCH] EXP-802 Add a check box to enable/disable voice chat.

---
 indra/newview/llbottomtray.cpp                | 11 +++++++---
 indra/newview/llfloatersounddevices.cpp       |  2 +-
 .../default/xui/en/floater_sound_devices.xml  | 21 ++++++++++++++++++-
 .../skins/minimal/xui/en/panel_bottomtray.xml |  2 +-
 4 files changed, 30 insertions(+), 6 deletions(-)

diff --git a/indra/newview/llbottomtray.cpp b/indra/newview/llbottomtray.cpp
index c72cdfd1dca..f51552aae52 100644
--- a/indra/newview/llbottomtray.cpp
+++ b/indra/newview/llbottomtray.cpp
@@ -559,7 +559,7 @@ BOOL LLBottomTray::postBuild()
 	else
 	{
 		LLTransientFloaterMgr::getInstance()->addControlView(getChild<LLButton>("speak_btn"));
-		LLTransientFloaterMgr::getInstance()->addControlView(getChild<LLButton>("speak_flyout_btn"));
+		LLTransientFloaterMgr::getInstance()->addControlView(getChild<LLButton>("flyout_btn"));
 	}
 
 
@@ -1591,7 +1591,7 @@ void LLBottomTray::initResizeStateContainers()
 // because it resets chatbar's width according to resize logic.
 void LLBottomTray::initButtonsVisibility()
 {
-	setVisibleAndFitWidths(RS_BUTTON_SPEAK, gSavedSettings.getBOOL("EnableVoiceChat"));
+	setVisibleAndFitWidths(RS_BUTTON_SPEAK, gSavedSettings.getBOOL("EnableVoiceChat") || !mSpeakBtn );
 	setVisibleAndFitWidths(RS_BUTTON_GESTURES, gSavedSettings.getBOOL("ShowGestureButton"));
 	setVisibleAndFitWidths(RS_BUTTON_MOVEMENT, gSavedSettings.getBOOL("ShowMoveButton"));
 	setVisibleAndFitWidths(RS_BUTTON_CAMERA, gSavedSettings.getBOOL("ShowCameraButton"));
@@ -1605,7 +1605,12 @@ void LLBottomTray::initButtonsVisibility()
 
 void LLBottomTray::setButtonsControlsAndListeners()
 {
-	gSavedSettings.getControl("EnableVoiceChat")->getSignal()->connect(boost::bind(&LLBottomTray::toggleShowButton, RS_BUTTON_SPEAK, _2));
+	// always show the speak panel if using the basic skin
+	if (mSpeakBtn)
+	{
+		gSavedSettings.getControl("EnableVoiceChat")->getSignal()->connect(boost::bind(&LLBottomTray::toggleShowButton, RS_BUTTON_SPEAK, _2));
+	}	
+
 	gSavedSettings.getControl("ShowGestureButton")->getSignal()->connect(boost::bind(&LLBottomTray::toggleShowButton, RS_BUTTON_GESTURES, _2));
 	gSavedSettings.getControl("ShowMoveButton")->getSignal()->connect(boost::bind(&LLBottomTray::toggleShowButton, RS_BUTTON_MOVEMENT, _2));
 	gSavedSettings.getControl("ShowCameraButton")->getSignal()->connect(boost::bind(&LLBottomTray::toggleShowButton, RS_BUTTON_CAMERA, _2));
diff --git a/indra/newview/llfloatersounddevices.cpp b/indra/newview/llfloatersounddevices.cpp
index 3903b9b0154..9fe7c7f9dd8 100644
--- a/indra/newview/llfloatersounddevices.cpp
+++ b/indra/newview/llfloatersounddevices.cpp
@@ -56,7 +56,7 @@ BOOL LLFloaterSoundDevices::postBuild()
 {
 	LLTransientDockableFloater::postBuild();
 		
-	LLView *anchor_panel = LLBottomTray::getInstance()->getChild<LLView>("speak_flyout_btn");
+	LLView *anchor_panel = LLBottomTray::getInstance()->getChild<LLView>("flyout_btn");
 	setDockControl(new LLDockControl(anchor_panel, this, getDockTongue(), LLDockControl::TOP));
 
 	setIsChrome(TRUE);
diff --git a/indra/newview/skins/default/xui/en/floater_sound_devices.xml b/indra/newview/skins/default/xui/en/floater_sound_devices.xml
index c7c7a05af2b..304987c3d59 100644
--- a/indra/newview/skins/default/xui/en/floater_sound_devices.xml
+++ b/indra/newview/skins/default/xui/en/floater_sound_devices.xml
@@ -11,7 +11,7 @@
  save_rect="true"
  single_instance="true"
  bevel_style="in"
- height="140"
+ height="164"
  layout="topleft"
  name="floater_sound_devices"
  title="Sound Devices"
@@ -25,4 +25,23 @@
     left="2"
     top="26"
     class="panel_voice_device_settings"/>
+  <text
+    name="voice_label"
+    top="136"
+    left="12"
+    height="14"
+    width="80"
+    layout="topleft"
+    >Voice Chat</text>
+  <check_box
+    layout="topleft"
+    control_name="EnableVoiceChat"
+    follows="bottom|left"
+    top="138"
+    left="80"
+    name="enable_voice"
+    width="100"
+    height="14"
+    label="Enabled"
+    />
 </floater>
diff --git a/indra/newview/skins/minimal/xui/en/panel_bottomtray.xml b/indra/newview/skins/minimal/xui/en/panel_bottomtray.xml
index 237af61717b..d722c54081a 100644
--- a/indra/newview/skins/minimal/xui/en/panel_bottomtray.xml
+++ b/indra/newview/skins/minimal/xui/en/panel_bottomtray.xml
@@ -115,7 +115,7 @@
         top="5"
      left="0"
      height="23"
-     name="speak_flyout_btn"
+     name="flyout_btn"
      label=""
      tab_stop="false"
      tool_tip="Change your sound preferences"
-- 
GitLab