diff options
Diffstat (limited to 'indra/newview/llpanelvoicedevicesettings.cpp')
| -rw-r--r-- | indra/newview/llpanelvoicedevicesettings.cpp | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/indra/newview/llpanelvoicedevicesettings.cpp b/indra/newview/llpanelvoicedevicesettings.cpp index 60877494e7..d8d6bcf5fd 100644 --- a/indra/newview/llpanelvoicedevicesettings.cpp +++ b/indra/newview/llpanelvoicedevicesettings.cpp @@ -240,13 +240,38 @@ void LLPanelVoiceDeviceSettings::refresh() if(mCtrlInputDevices) { mCtrlInputDevices->removeall(); - mCtrlInputDevices->add(getLocalizedDeviceName(mInputDevice), mInputDevice, ADD_BOTTOM); + auto it = mLocalizedDeviceNames.find(mInputDevice); + if (it != mLocalizedDeviceNames.end()) + { + mCtrlInputDevices->add(getLocalizedDeviceName(mInputDevice), mInputDevice, ADD_BOTTOM); + } + else + { + // Display name generaly doesn't match value. + // Value is an id so it's not nessesary readable, + // might not even be valid (disconnected usb). + // Until we get the data, don't change the device, + // otherwise box might override the control. + // But show a readable placeholder. + // Combo is disabled so it's safe to show + // a placeholder. + mCtrlInputDevices->add(getString("device_not_loaded"), mInputDevice, ADD_BOTTOM); + } mCtrlInputDevices->setValue(mInputDevice); } if(mCtrlOutputDevices) { mCtrlOutputDevices->removeall(); - mCtrlOutputDevices->add(getLocalizedDeviceName(mOutputDevice), mOutputDevice, ADD_BOTTOM); + auto it = mLocalizedDeviceNames.find(mOutputDevice); + if (it != mLocalizedDeviceNames.end()) + { + mCtrlOutputDevices->add(getLocalizedDeviceName(mOutputDevice), mOutputDevice, ADD_BOTTOM); + } + else + { + // Don't change the device, only the label + mCtrlOutputDevices->add(getString("device_not_loaded"), mOutputDevice, ADD_BOTTOM); + } mCtrlOutputDevices->setValue(mOutputDevice); } } |
