aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/bluez.vala4
-rw-r--r--src/indicator-bluetooth.vala4
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 ();