From f7ca11b202e442e759cca86a70d9c6d027e82e76 Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Fri, 11 Oct 2013 08:38:51 -0500 Subject: if /dev/rfkill doesn't exist or isn't writable, then try to handle bluetooth toggles simply by toggling bluez Adapters' Powered property --- src/profile.vala | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'src/profile.vala') diff --git a/src/profile.vala b/src/profile.vala index c32e46b..584af56 100644 --- a/src/profile.vala +++ b/src/profile.vala @@ -123,16 +123,16 @@ class Profile: Object { var action = new SimpleAction.stateful ("bluetooth-enabled", null, - !bluetooth.blocked); + bluetooth.enabled); action.activate.connect (() => action.change_state (!action.get_state().get_boolean())); action.change_state.connect ((action, requestedValue) - => bluetooth.try_set_blocked (!requestedValue.get_boolean())); + => bluetooth.try_set_enabled (requestedValue.get_boolean())); - bluetooth.notify["blocked"].connect (() - => action.set_state (!bluetooth.blocked)); + bluetooth.notify["enabled"].connect (() + => action.set_state (bluetooth.enabled)); return action; } @@ -144,12 +144,9 @@ class Profile: Object protected Variant action_state_for_root () { - var blocked = bluetooth.blocked; - var powered = bluetooth.powered; - string a11y; string icon_name; - if (powered && !blocked) + if (bluetooth.enabled) { a11y = "Bluetooth (on)"; icon_name = "bluetooth-active"; -- cgit v1.2.3