Opened 15 years ago

Closed 14 years ago

Last modified 14 years ago

#6662 closed patch (fixed)

ComboBoxSetting breaks with "labels" and read/write configuration

Reported by: mythtv@… Owned by: Isaac Richards
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 (2)

combosetting_labels_r20746.patch (3.2 KB) - added by mythtv@… 15 years ago.
combosetting_labels_r23492.patch (3.2 KB) - added by mythtv@… 14 years ago.

Download all attachments as: .zip

Change History (6)

Changed 15 years ago by mythtv@…

comment:1 Changed 15 years ago by sphery <mtdean@…>

kind of a dup of #4853 , except #4853 changed (one identified) affected setting whereas this patch changes the widget design/requirements

comment:2 in reply to:  1 Changed 15 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

Changed 14 years ago by mythtv@…

comment:3 Changed 14 years ago by sphery

Resolution: fixed
Status: newclosed

(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.

comment:4 Changed 14 years ago by sphery

(In [25639]) Fix some breakage in comboboxes populated item by item caused by [23803] using a patch by Daniel K. Refs #6662, Refs #8726, Refs #8729, Refs #8730.

Note: See TracTickets for help on using tickets.