diff options
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/llpanelvoicedevicesettings.cpp | 27 | ||||
-rw-r--r-- | indra/newview/llpanelvoicedevicesettings.h | 2 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/panel_sound_devices.xml | 26 |
3 files changed, 51 insertions, 4 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(); +} diff --git a/indra/newview/llpanelvoicedevicesettings.h b/indra/newview/llpanelvoicedevicesettings.h index 355bc02b05..6b85d4e540 100644 --- a/indra/newview/llpanelvoicedevicesettings.h +++ b/indra/newview/llpanelvoicedevicesettings.h @@ -55,12 +55,14 @@ protected: void onCommitOutputDevice(); void onOutputDevicesClicked(); void onInputDevicesClicked(); + void onCommitRetry(); F32 mMicVolume; std::string mInputDevice; std::string mOutputDevice; class LLComboBox *mCtrlInputDevices; class LLComboBox *mCtrlOutputDevices; + class LLButton *mRetryBtn; BOOL mDevicesUpdated; bool mUseTuningMode; std::map<std::string, std::string> mLocalizedDeviceNames; diff --git a/indra/newview/skins/default/xui/en/panel_sound_devices.xml b/indra/newview/skins/default/xui/en/panel_sound_devices.xml index 3dbb7fb7fc..bcb38a46cc 100644 --- a/indra/newview/skins/default/xui/en/panel_sound_devices.xml +++ b/indra/newview/skins/default/xui/en/panel_sound_devices.xml @@ -122,7 +122,7 @@ layout="topleft" left_pad="5" name="wait_text" - top_delta="-1" + top_delta="2" width="110"> Please wait </text> @@ -132,7 +132,7 @@ layout="topleft" left_delta="0" name="bar0" - top_delta="-2" + top_delta="-5" width="20" /> <locate follows="right|top" @@ -166,4 +166,26 @@ name="bar4" top_delta="0" width="20" /> + <text + type="string" + name="muted_text" + text_color="EmphasisColor" + length="1" + follows="right|top" + height="18" + layout="topleft" + left_delta="-100" + top_delta="5" + width="70"> + Muted + </text> + <button + follows="right|top" + height="23" + image_overlay="Refresh_Off" + layout="topleft" + left_pad="1" + name="retry_btn" + top_delta="-5" + width="23" /> </panel>
\ No newline at end of file |