From 7fe79a703e1c22253f05b9d4484ef2e23d6421f7 Mon Sep 17 00:00:00 2001 From: Daniel Pavel Date: Sat, 8 Dec 2012 01:54:08 +0200 Subject: [PATCH] fixed creation of device settings controls --- app/ui/config_panel.py | 9 +++++---- app/ui/main_window.py | 6 +++--- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/app/ui/config_panel.py b/app/ui/config_panel.py index b3eb7455..23a93073 100644 --- a/app/ui/config_panel.py +++ b/app/ui/config_panel.py @@ -29,6 +29,7 @@ def _process_apply_queue(): while True: task = _apply_queue.get() + assert isinstance(task, tuple) if task[0] == 'write': _, setting, value, sbox = task GObject.idle_add(_write_start, sbox) @@ -106,7 +107,7 @@ def _add_settings(box, device): else: 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(spinner, 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.show_all() - spinner.set_visible(False) + spinner.start() # the first read will stop it failed.set_visible(False) box.pack_start(sbox, False, False, 0) yield sbox @@ -166,8 +167,8 @@ def update(frame): items = box.get_children() if not items: if device.status: - items = _add_settings(box, device) - assert len(device.settings) == len(list(items)) + items = list(_add_settings(box, device)) + assert len(device.settings) == len(items) force_read = True else: # don't bother adding settings for offline devices, diff --git a/app/ui/main_window.py b/app/ui/main_window.py index 5f3c33a5..0d372219 100644 --- a/app/ui/main_window.py +++ b/app/ui/main_window.py @@ -226,9 +226,9 @@ def _make_device_box(index): unpair = Gtk.Button('Unpair') unpair.set_image(Gtk.Image.new_from_icon_name('edit-delete', Gtk.IconSize.BUTTON)) unpair.connect('clicked', ui.action._unpair_device, frame) - # unpair.set_property('margin-top', 12) - unpair.set_property('margin-left', 104) - unpair.set_property('margin-right', 104) + unpair.set_property('margin-left', 106) + unpair.set_property('margin-right', 106) + unpair.set_property('can-focus', False) # exclude from tab-navigation vbox.pack_end(unpair, False, False, 0) vbox.show_all()