summaryrefslogtreecommitdiff
path: root/indra/newview/llpanelvoicedevicesettings.cpp
diff options
context:
space:
mode:
authorJonathan "Geenz" Goodman <geenz@lindenlab.com>2025-12-03 11:50:32 -0500
committerGitHub <noreply@github.com>2025-12-03 11:50:32 -0500
commitbf347d15804c27348c84a55ab763f89b718e8aac (patch)
treea112d8ef3e65581fb1fae03a093a75637d134756 /indra/newview/llpanelvoicedevicesettings.cpp
parentaec7bf19ebffd9d6b60c68e31de723eabd6aa98a (diff)
parentad6008a5880dff8691f5fce56b7fbfc5ea8b1626 (diff)
Merge pull request #4853 from secondlife/release/2025.08
Release/2025.08
Diffstat (limited to 'indra/newview/llpanelvoicedevicesettings.cpp')
-rw-r--r--indra/newview/llpanelvoicedevicesettings.cpp29
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);
}
}