gui: correctly show initial value for choice settings

This commit is contained in:
Peter F. Patel-Schneider 2020-07-15 12:33:03 -04:00
parent 90cc629f26
commit bc6b1de472
2 changed files with 2 additions and 2 deletions

View File

@ -656,7 +656,7 @@ class ChoicesValidator(object):
def __init__(self, choices, bytes_count=None, read_skip_bytes_count=None, write_prefix_bytes=b'', **_ignore):
assert choices is not None
assert isinstance(choices, _NamedInts)
assert len(choices) > 2
assert len(choices) > 1
self.choices = choices
self.needs_current_value = False

View File

@ -242,7 +242,7 @@ def _update_setting_item(sbox, value, is_online=True):
if isinstance(control, Gtk.Switch):
control.set_active(value)
elif isinstance(control, Gtk.ComboBoxText):
control.set_active_id(str(value))
control.set_active_id(str(int(value)))
elif isinstance(control, Gtk.Scale):
control.set_value(int(value))
elif isinstance(control, Gtk.HBox):