Fix ValueError when displaying touch gestures with addon-registered plain string modes (#20579)
closes #20561
Summary of the issue:
When availableTouchModes was changed from list[str] to list[TouchMode] in 2026.2, TouchInputGesture.getDisplayTextForIdentifier() was left calling TouchMode(mode) unconditionally to resolve the display label for the gesture source. This raises ValueError for any plain string mode registered by an add-on, crashing the Input Gestures dialog whenever such an add-on is installed.
Description of user facing changes:
Description of developer facing changes:
TouchInputGesture.getDisplayTextForIdentifier() now falls back to the plain string value when TouchMode(mode) raises ValueError, allowing add-ons that append plain strings to availableTouchModes to coexist with the TouchMode enum without crashing the Input Gestures dialog.
Description of development approach:
A try/except ValueError block wraps the TouchMode(mode) call. If the lookup succeeds the enum member's displayString is used as before; if it fails the plain string is used directly as the mode label.