diff options
author | Robert Ancell <robert.ancell@canonical.com> | 2012-10-11 18:30:05 +1300 |
---|---|---|
committer | Robert Ancell <robert.ancell@canonical.com> | 2012-10-11 18:30:05 +1300 |
commit | 8e5d7ea526a3d61e8b5ea95041893adbbca427b0 (patch) | |
tree | 1d7146b0b2053c161903f47a783e8b295317891b /src | |
parent | 072e04865a83f46449b3f8b9f766c54294b0474d (diff) | |
download | ayatana-indicator-bluetooth-8e5d7ea526a3d61e8b5ea95041893adbbca427b0.tar.gz ayatana-indicator-bluetooth-8e5d7ea526a3d61e8b5ea95041893adbbca427b0.tar.bz2 ayatana-indicator-bluetooth-8e5d7ea526a3d61e8b5ea95041893adbbca427b0.zip |
Fix visible toggle
Diffstat (limited to 'src')
-rw-r--r-- | src/bluez.vala | 4 | ||||
-rw-r--r-- | src/indicator-bluetooth.vala | 4 |
2 files changed, 7 insertions, 1 deletions
diff --git a/src/bluez.vala b/src/bluez.vala index 0a5a393..976c1ce 100644 --- a/src/bluez.vala +++ b/src/bluez.vala @@ -48,6 +48,7 @@ public class BluezAdapter : Object get { return _discoverable; } set { + _discoverable = value; proxy.set_property ("Discoverable", new Variant.boolean (value)); } } @@ -79,7 +80,10 @@ public class BluezAdapter : Object { stderr.printf ("%s %s=%s\n", path, name, value.print (false)); if (name == "Discoverable" && value.is_of_type (VariantType.BOOLEAN)) + { _discoverable = value.get_boolean (); + notify_property ("discoverable"); + } } private void device_created_cb (string path) diff --git a/src/indicator-bluetooth.vala b/src/indicator-bluetooth.vala index 952613e..fd09738 100644 --- a/src/indicator-bluetooth.vala +++ b/src/indicator-bluetooth.vala @@ -51,7 +51,9 @@ public class BluetoothIndicator : AppIndicator.Indicator menu.append (enable_item); visible_item = new Gtk.CheckMenuItem.with_label (_("Visible")); - visible_item.activate.connect (() => { bluez.default_adapter.discoverable = true; }); // FIXME: Make rw + visible_item.active = bluez.default_adapter.discoverable; + bluez.default_adapter.notify["discoverable"].connect (() => { visible_item.active = bluez.default_adapter.discoverable; }); + visible_item.activate.connect (() => { bluez.default_adapter.discoverable = visible_item.active; }); menu.append (visible_item); devices_separator = new Gtk.SeparatorMenuItem (); |