summaryrefslogtreecommitdiff
path: root/indra/newview/llpanelvoicedevicesettings.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llpanelvoicedevicesettings.cpp')
-rw-r--r--indra/newview/llpanelvoicedevicesettings.cpp27
1 files changed, 25 insertions, 2 deletions
diff --git a/indra/newview/llpanelvoicedevicesettings.cpp b/indra/newview/llpanelvoicedevicesettings.cpp
index 28631e2b7b..5e1cf801b9 100644
--- a/indra/newview/llpanelvoicedevicesettings.cpp
+++ b/indra/newview/llpanelvoicedevicesettings.cpp
@@ -70,11 +70,14 @@ BOOL LLPanelVoiceDeviceSettings::postBuild()
mCtrlInputDevices = getChild<LLComboBox>("voice_input_device");
mCtrlOutputDevices = getChild<LLComboBox>("voice_output_device");
+ mRetryBtn = getChild<LLButton>("retry_btn");
mCtrlInputDevices->setCommitCallback(
boost::bind(&LLPanelVoiceDeviceSettings::onCommitInputDevice, this));
mCtrlOutputDevices->setCommitCallback(
boost::bind(&LLPanelVoiceDeviceSettings::onCommitOutputDevice, this));
+ mRetryBtn->setCommitCallback(
+ boost::bind(&LLPanelVoiceDeviceSettings::onCommitRetry, this));
mLocalizedDeviceNames[DEFAULT_DEVICE] = getString("default_text");
mLocalizedDeviceNames["No Device"] = getString("name_no_device");
@@ -108,11 +111,25 @@ void LLPanelVoiceDeviceSettings::draw()
// let user know that volume indicator is not yet available
bool is_in_tuning_mode = LLVoiceClient::getInstance()->inTuningMode();
- getChildView("wait_text")->setVisible( !is_in_tuning_mode && mUseTuningMode);
+ bool voice_enabled = LLVoiceClient::getInstance()->voiceEnabled();
+ if (voice_enabled)
+ {
+ getChildView("wait_text")->setVisible( !is_in_tuning_mode && mUseTuningMode);
+ getChildView("muted_text")->setVisible(FALSE);
+ mRetryBtn->setVisible(FALSE);
+ }
+ else
+ {
+ getChildView("wait_text")->setVisible(FALSE);
+ getChildView("muted_text")->setVisible(TRUE);
+
+ static LLCachedControl<bool> voice_enabled(gSavedSettings, "EnableVoiceChat");
+ mRetryBtn->setVisible(!voice_enabled || LLVoiceClient::isMutedVoiceInstance());
+ }
LLPanel::draw();
- if (is_in_tuning_mode)
+ if (is_in_tuning_mode && voice_enabled)
{
const S32 num_bars = 5;
F32 voice_power = LLVoiceClient::getInstance()->tuningGetEnergy() / LLVoiceClient::OVERDRIVEN_POWER_LEVEL;
@@ -339,3 +356,9 @@ void LLPanelVoiceDeviceSettings::onInputDevicesClicked()
{
LLVoiceClient::getInstance()->refreshDeviceLists(false); // fill in the pop up menus again if needed.
}
+
+void LLPanelVoiceDeviceSettings::onCommitRetry()
+{
+ gSavedSettings.setBOOL("EnableVoiceChat", TRUE);
+ LLVoiceClient::unmuteVoiceInstance();
+}