Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions data/gschema.xml

This file was deleted.

6 changes: 0 additions & 6 deletions data/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,3 @@ i18n.merge_file(
install: true,
install_dir: datadir / 'metainfo'
)

install_data(
'gschema.xml',
rename: 'io.elementary.desktop.wingpanel.bluetooth.gschema.xml',
install_dir: datadir / 'glib-2.0' / 'schemas'
)
11 changes: 2 additions & 9 deletions src/Services/Manager.vala
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public class BluetoothIndicator.Services.ObjectManager : Object {
public bool is_connected {get; private set; default = false; }

construct {
settings = new Settings ("io.elementary.desktop.wingpanel.bluetooth");
settings = new Settings ("io.elementary.desktop.bluetooth");
create_manager.begin ();
}

Expand All @@ -53,13 +53,6 @@ public class BluetoothIndicator.Services.ObjectManager : Object {
object_manager.object_removed.connect ((object) => {
object.get_interfaces ().foreach ((iface) => on_interface_removed (object, iface));
});

settings.changed["bluetooth-enabled"].connect (() => {
var enabled = settings.get_boolean ("bluetooth-enabled");
if (enabled != this.is_powered) {
set_state_from_settings.begin ();
}
});
} catch (Error e) {
critical (e.message);
}
Expand Down Expand Up @@ -230,7 +223,7 @@ public class BluetoothIndicator.Services.ObjectManager : Object {
}

public async void set_state_from_settings () {
yield set_global_state (settings.get_boolean ("bluetooth-enabled"));
yield set_global_state (settings.get_boolean ("enabled"));
}

public static bool compare_devices (Device device, Device other) {
Expand Down
4 changes: 2 additions & 2 deletions src/Widgets/DisplayWidget.vala
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ public class BluetoothIndicator.Widgets.DisplayWidget : Granite.Bin {
};
gesture_click.pressed.connect (() => {
object_manager.settings.set_boolean (
"bluetooth-enabled",
!object_manager.settings.get_boolean ("bluetooth-enabled")
"enabled",
!object_manager.settings.get_boolean ("enabled")
);
});

Expand Down
11 changes: 2 additions & 9 deletions src/Widgets/PopoverWidget.vala
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,7 @@ public class BluetoothIndicator.Widgets.PopoverWidget : Gtk.Box {
construct {
orientation = VERTICAL;

main_switch = new Granite.SwitchModelButton (_("Bluetooth")) {
active = object_manager.get_global_state ()
};
main_switch = new Granite.SwitchModelButton (_("Bluetooth"));
main_switch.add_css_class (Granite.STYLE_CLASS_H4_LABEL);

devices_list = new Gtk.ListBox ();
Expand Down Expand Up @@ -73,18 +71,13 @@ public class BluetoothIndicator.Widgets.PopoverWidget : Gtk.Box {
append (show_settings_button);
}

main_switch.active = object_manager.get_global_state ();

update_ui_state (object_manager.get_global_state ());

devices_list.row_activated.connect ((row) => {
((Widgets.Device) row).toggle_device.begin ();
});

main_switch.notify["active"].connect (() => {
warning ("main switch toggle - active %s", main_switch.active.to_string ());
object_manager.settings.set_boolean ("bluetooth-enabled", main_switch.active);
});
object_manager.settings.bind ("enabled", main_switch, "active", DEFAULT);

show_settings_button.clicked.connect (() => {
try {
Expand Down
Loading