Modify

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

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

Change History

Changed 3 years ago by mythtv@…

comment:1 follow-up: ↓ 2 Changed 3 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 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

Changed 2 years ago by mythtv@…

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.

comment:4 Changed 22 months ago by mdean

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

View

Add a comment

Modify Ticket

Action
as closed
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.