fixed creation of device settings controls
This commit is contained in:
parent
80c36a02a9
commit
7fe79a703e
|
@ -29,6 +29,7 @@ def _process_apply_queue():
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
task = _apply_queue.get()
|
task = _apply_queue.get()
|
||||||
|
assert isinstance(task, tuple)
|
||||||
if task[0] == 'write':
|
if task[0] == 'write':
|
||||||
_, setting, value, sbox = task
|
_, setting, value, sbox = task
|
||||||
GObject.idle_add(_write_start, sbox)
|
GObject.idle_add(_write_start, sbox)
|
||||||
|
@ -106,7 +107,7 @@ def _add_settings(box, device):
|
||||||
else:
|
else:
|
||||||
raise NotImplemented
|
raise NotImplemented
|
||||||
|
|
||||||
# control.set_size_request(50, 20)
|
control.set_sensitive(False) # the first read will enable it
|
||||||
sbox.pack_end(control, False, False, 0)
|
sbox.pack_end(control, False, False, 0)
|
||||||
sbox.pack_end(spinner, False, False, 0)
|
sbox.pack_end(spinner, False, False, 0)
|
||||||
sbox.pack_end(failed, False, False, 0)
|
sbox.pack_end(failed, False, False, 0)
|
||||||
|
@ -115,7 +116,7 @@ def _add_settings(box, device):
|
||||||
sbox.set_tooltip_text(s.description)
|
sbox.set_tooltip_text(s.description)
|
||||||
|
|
||||||
sbox.show_all()
|
sbox.show_all()
|
||||||
spinner.set_visible(False)
|
spinner.start() # the first read will stop it
|
||||||
failed.set_visible(False)
|
failed.set_visible(False)
|
||||||
box.pack_start(sbox, False, False, 0)
|
box.pack_start(sbox, False, False, 0)
|
||||||
yield sbox
|
yield sbox
|
||||||
|
@ -166,8 +167,8 @@ def update(frame):
|
||||||
items = box.get_children()
|
items = box.get_children()
|
||||||
if not items:
|
if not items:
|
||||||
if device.status:
|
if device.status:
|
||||||
items = _add_settings(box, device)
|
items = list(_add_settings(box, device))
|
||||||
assert len(device.settings) == len(list(items))
|
assert len(device.settings) == len(items)
|
||||||
force_read = True
|
force_read = True
|
||||||
else:
|
else:
|
||||||
# don't bother adding settings for offline devices,
|
# don't bother adding settings for offline devices,
|
||||||
|
|
|
@ -226,9 +226,9 @@ def _make_device_box(index):
|
||||||
unpair = Gtk.Button('Unpair')
|
unpair = Gtk.Button('Unpair')
|
||||||
unpair.set_image(Gtk.Image.new_from_icon_name('edit-delete', Gtk.IconSize.BUTTON))
|
unpair.set_image(Gtk.Image.new_from_icon_name('edit-delete', Gtk.IconSize.BUTTON))
|
||||||
unpair.connect('clicked', ui.action._unpair_device, frame)
|
unpair.connect('clicked', ui.action._unpair_device, frame)
|
||||||
# unpair.set_property('margin-top', 12)
|
unpair.set_property('margin-left', 106)
|
||||||
unpair.set_property('margin-left', 104)
|
unpair.set_property('margin-right', 106)
|
||||||
unpair.set_property('margin-right', 104)
|
unpair.set_property('can-focus', False) # exclude from tab-navigation
|
||||||
vbox.pack_end(unpair, False, False, 0)
|
vbox.pack_end(unpair, False, False, 0)
|
||||||
|
|
||||||
vbox.show_all()
|
vbox.show_all()
|
||||||
|
|
Loading…
Reference in New Issue