aboutsummaryrefslogtreecommitdiff
path: root/src/profile.vala
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2013-10-11 08:38:51 -0500
committerCharles Kerr <charles.kerr@canonical.com>2013-10-11 08:38:51 -0500
commitf7ca11b202e442e759cca86a70d9c6d027e82e76 (patch)
tree144aabb1f6df9fa060bd4418fb26857d5055dc75 /src/profile.vala
parent3145f10632a3ce7ee33e8cdaa78401d7eb881f4e (diff)
downloadayatana-indicator-bluetooth-f7ca11b202e442e759cca86a70d9c6d027e82e76.tar.gz
ayatana-indicator-bluetooth-f7ca11b202e442e759cca86a70d9c6d027e82e76.tar.bz2
ayatana-indicator-bluetooth-f7ca11b202e442e759cca86a70d9c6d027e82e76.zip
if /dev/rfkill doesn't exist or isn't writable, then try to handle bluetooth toggles simply by toggling bluez Adapters' Powered property
Diffstat (limited to 'src/profile.vala')
-rw-r--r--src/profile.vala13
1 files changed, 5 insertions, 8 deletions
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";