diff options
Diffstat (limited to 'src/profile.vala')
-rw-r--r-- | src/profile.vala | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/profile.vala b/src/profile.vala index 767a5cd..c52481f 100644 --- a/src/profile.vala +++ b/src/profile.vala @@ -123,14 +123,11 @@ class Profile: Object protected Action create_enabled_action (Bluetooth bluetooth) { var action = new SimpleAction.stateful ("bluetooth-enabled", - null, + VariantType.BOOLEAN, new Variant.boolean (bluetooth.enabled)); - action.activate.connect (() - => action.change_state (new Variant.boolean (!action.get_state().get_boolean()))); - - action.change_state.connect ((action, requestedValue) - => bluetooth.try_set_enabled (requestedValue.get_boolean())); + action.activate.connect ((action, state) + => bluetooth.try_set_enabled (state.get_boolean())); bluetooth.notify["enabled"].connect (() => action.set_state (new Variant.boolean (bluetooth.enabled))); @@ -170,6 +167,7 @@ class Profile: Object builder.add ("{sv}", "accessible-desc", new Variant.string (a11y)); builder.add ("{sv}", "icon", icon.serialize()); builder.add ("{sv}", "title", new Variant.string (_("Bluetooth"))); + return builder.end (); } } |