Ticket #6662 (closed patch: fixed)
Opened 3 years ago
Last modified 22 months ago
ComboBoxSetting breaks with "labels" and read/write configuration
| Reported by: | mythtv@… | Owned by: | ijr |
|---|---|---|---|
| Priority: | minor | Milestone: | unknown |
| Component: | MythTV - General | Version: | unknown |
| Severity: | medium | Keywords: | ComboBoxSetting |
| Cc: | Ticket locked: | no |
Description
The ComboBoxSetting? class derives from SelectSetting? class. The SelectSetting? class contains "labels" and "values". This system allows for the "labels" to be shown in the user interface and the "values" to be used in the code. Whilst many settings use the same data for both "value" and "label" it is sometimes useful for them to be different.
The ComboBoxSetting? class displays a list of possible choices. It can also be flagged to allow for the entry of a free form string. In this mode the QComboBox::editTextChanged() signal is connected to the SelectSetting::setValue(). However, the strings contained within the 'QComboBox' may the "labels" and not the "values", resulting in SelectSetting::setValue() being called with incorrect data.
The side effect of this is that erroneous ("value", "value") entries are inserted into the list of options for every ("label", "value") entry originally present. The behaviour is further complicated by the fact that QComboBox::editTextChanged() is emitted whenever the text in the QComboBox changes, this includes merely switching between pre-defined options.
Attachments
Change History
comment:2 in reply to: ↑ 1 Changed 3 years ago by mythtv@…
Replying to sphery <mtdean@thirdcontact.com>:
kind of a dup of #4853 , except #4853 changed (one identified) affected setting whereas this patch changes the widget design/requirements
Not really, this addresses problems when the ComboBoxSetting's _rw parameter is set to true
comment:3 Changed 2 years ago by mdean
- Status changed from new to closed
- Resolution set to fixed
(In [23803]) Fixes #6662. Fixes editable comboboxes.
Since [17978], every time the user changed the text in the combobox (for each keystroke entered), a new entry was added to the combobox list of values. This change ensures that there's only one entry in the box corresponding to the user-edited content. Thanks to mythtv at dadeos for the patch.
Unfortunately, this changes a low-level header, so a lot of recompilation will be required, though a reconfigure shouldn't be necessary.
