From b5b86ab8b8ff488917ef5f254713d3b4191285fe Mon Sep 17 00:00:00 2001 From: Daniel Pavel Date: Tue, 4 Dec 2012 15:59:35 +0200 Subject: [PATCH] more reliable pairing window --- app/ui/action.py | 2 +- app/ui/main_window.py | 6 +++--- app/ui/pair_window.py | 12 +++++------- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/app/ui/action.py b/app/ui/action.py index a4d43dc6..2786eb46 100644 --- a/app/ui/action.py +++ b/app/ui/action.py @@ -108,4 +108,4 @@ def _unpair_device(action, frame): ui.error(window, 'Unpairing failed', 'Failed to unpair device\n%s .' % device.name) def unpair(frame): - return _action('remove', 'Unpair', _unpair_device, frame) + return _action('edit-delete', 'Unpair', _unpair_device, frame) diff --git a/app/ui/main_window.py b/app/ui/main_window.py index c352337e..67b8c9dc 100644 --- a/app/ui/main_window.py +++ b/app/ui/main_window.py @@ -8,7 +8,7 @@ import ui from logitech.unifying_receiver import status as _status -_RECEIVER_ICON_SIZE = Gtk.IconSize.BUTTON +_RECEIVER_ICON_SIZE = Gtk.IconSize.LARGE_TOOLBAR _DEVICE_ICON_SIZE = Gtk.IconSize.DIALOG _STATUS_ICON_SIZE = Gtk.IconSize.LARGE_TOOLBAR _PLACEHOLDER = '~' @@ -32,7 +32,7 @@ def _make_receiver_box(name): label.set_name('label') label.set_alignment(0, 0.5) - pairing_icon = Gtk.Image.new_from_icon_name('network-wireless', Gtk.IconSize.MENU) + pairing_icon = Gtk.Image.new_from_icon_name('network-wireless', _RECEIVER_ICON_SIZE) pairing_icon.set_name('pairing-icon') pairing_icon.set_tooltip_text('The pairing lock is open.') pairing_icon._tick = 0 @@ -40,7 +40,7 @@ def _make_receiver_box(name): toolbar = Gtk.Toolbar() toolbar.set_name('toolbar') toolbar.set_style(Gtk.ToolbarStyle.ICONS) - toolbar.set_icon_size(Gtk.IconSize.MENU) + toolbar.set_icon_size(_RECEIVER_ICON_SIZE - 1) toolbar.set_show_arrow(False) hbox = Gtk.HBox(homogeneous=False, spacing=8) diff --git a/app/ui/pair_window.py b/app/ui/pair_window.py index 62d83391..170e22ed 100644 --- a/app/ui/pair_window.py +++ b/app/ui/pair_window.py @@ -91,7 +91,7 @@ def _prepare(assistant, page, receiver): assert receiver.status.get(_status.ERROR) is None spinner = page.get_children()[-1] spinner.start() - GObject.timeout_add(500, _check_lock_state, assistant, receiver) + GObject.timeout_add(2000, _check_lock_state, assistant, receiver) assistant.set_page_complete(page, True) else: GObject.idle_add(_pairing_failed, assistant, receiver, 'the pairing lock did not open') @@ -147,17 +147,15 @@ def _pairing_succeeded(assistant, receiver, device): device_label = Gtk.Label() device_label.set_markup('' + device.name + '') device_label.set_alignment(0.5, 0) - page.pack_start(device_label, False, False, 0) + page.pack_start(device_label, True, True, 0) if device.status.get('encrypted') == False: hbox = Gtk.HBox(False, 8) hbox.pack_start(Gtk.Image.new_from_icon_name('dialog-warning', Gtk.IconSize.MENU), False, False, 0) hbox.pack_start(Gtk.Label('The wireless link is not encrypted!'), False, False, 0) - halign = Gtk.Alignment.new(0.5, 0, 0, 0) - halign.add(hbox) - page.pack_start(halign, False, False, 0) - - page.pack_start(Gtk.Label(), True, True, 0) + hbox.set_property('expand', False) + hbox.set_property('halign', Gtk.Align.CENTER) + page.pack_start(hbox, False, False, 0) page.show_all()