aboutsummaryrefslogtreecommitdiff
path: root/src/profile.vala
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2013-10-15 16:12:42 +0000
committerTarmac <>2013-10-15 16:12:42 +0000
commit08f4099365f311c4f94ce348902382987adc8f56 (patch)
treefe4e36dd816d0a4a1977132b9ac14cb26b3594fc /src/profile.vala
parent5fb78027ee730e151d8307623ed0ffcfbac024f5 (diff)
parent73cc5b06408e95c0401cb3cd3c2249f9376f2606 (diff)
downloadayatana-indicator-bluetooth-08f4099365f311c4f94ce348902382987adc8f56.tar.gz
ayatana-indicator-bluetooth-08f4099365f311c4f94ce348902382987adc8f56.tar.bz2
ayatana-indicator-bluetooth-08f4099365f311c4f94ce348902382987adc8f56.zip
When the user chooses to toggle bluetooth on or off, if /dev/rfkill isn't available, fall back to toggling org.bluez.Adapter's Powered property. Fixes: https://bugs.launchpad.net/bugs/1230275, https://bugs.launchpad.net/bugs/1236249.
Approved by Ted Gould, PS Jenkins bot.
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";