Skip to content

Commit fe5f43c

Browse files
authored
BluetoothPage: use daemon for enabled state (#99)
1 parent d90a60d commit fe5f43c

2 files changed

Lines changed: 25 additions & 15 deletions

File tree

data/sharing.metainfo.xml.in

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,17 @@
3131
<update_contact>contact_at_elementary.io</update_contact>
3232

3333
<releases>
34+
<release version="8.0.3" date="2026-01-29" urgency="medium">
35+
<description>
36+
<ul>
37+
<li>Updated translations</li>
38+
</ul>
39+
</description>
40+
<issues>
41+
<issue url="https://github.com/elementary/settings-sharing/issues/98">"Sharing" option - system settings - shuts down when I try to open it</issue>
42+
</issues>
43+
</release>
44+
3445
<release version="8.0.2" date="2025-07-29" urgency="medium">
3546
<description>
3647
<ul>

src/Widgets/BluetoothPage.vala

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66
public class Sharing.Widgets.BluetoothPage : Switchboard.SettingsPage {
77
private GLib.Settings daemon_settings;
8-
private GLib.Settings panel_settings;
98

109
public BluetoothPage () {
1110
Object (activatable: true);
@@ -37,11 +36,9 @@ public class Sharing.Widgets.BluetoothPage : Switchboard.SettingsPage {
3736
daemon_settings.bind ("sharing", status_switch, "active", NO_SENSITIVITY);
3837
daemon_settings.bind ("confirm-accept-files", accept_switch, "active", DEFAULT);
3938

40-
panel_settings = new GLib.Settings ("io.elementary.desktop.wingpanel.bluetooth");
41-
4239
set_service_state ();
4340

44-
panel_settings.changed ["bluetooth-enabled"].connect (() => {
41+
daemon_settings.changed ["enabled"].connect (() => {
4542
set_service_state ();
4643
});
4744

@@ -56,20 +53,22 @@ public class Sharing.Widgets.BluetoothPage : Switchboard.SettingsPage {
5653
}
5754

5855
private void set_service_state () {
59-
if (panel_settings.get_boolean ("bluetooth-enabled")) {
60-
if (daemon_settings.get_boolean ("sharing")) {
61-
description = _("While enabled, Bluetooth devices can send files to Downloads.");
62-
status = _("Enabled");
63-
status_type = SUCCESS;
64-
} else {
65-
description = _("While disabled, Bluetooth devices can not send files to Downloads.");
66-
status = _("Disabled");
67-
status_type = OFFLINE;
68-
}
69-
} else {
56+
if (!daemon_settings.get_boolean ("enabled")) {
7057
description = _("The Bluetooth device is either disconnected or disabled. Check Bluetooth settings and try again.");
7158
status_type = ERROR;
7259
status = _("Not Available");
60+
61+
return;
62+
}
63+
64+
if (daemon_settings.get_boolean ("sharing")) {
65+
description = _("While enabled, Bluetooth devices can send files to Downloads.");
66+
status = _("Enabled");
67+
status_type = SUCCESS;
68+
} else {
69+
description = _("While disabled, Bluetooth devices can not send files to Downloads.");
70+
status = _("Disabled");
71+
status_type = OFFLINE;
7372
}
7473
}
7574
}

0 commit comments

Comments
 (0)