aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMike Gabriel <mike.gabriel@das-netzwerkteam.de>2022-09-05 12:53:04 +0200
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2022-09-05 12:53:04 +0200
commit26e135ab10dbf995c171243f1f4803b8f12f4469 (patch)
treed055bb139d87b78273a7715e9c81ab7780834e6f /src
parent710c133e9453201e4a3a4f7e18fe5aed899eba85 (diff)
parent19530d5638bd3d012c57a47ef2be92b8b5231970 (diff)
downloadayatana-indicator-bluetooth-26e135ab10dbf995c171243f1f4803b8f12f4469.tar.gz
ayatana-indicator-bluetooth-26e135ab10dbf995c171243f1f4803b8f12f4469.tar.bz2
ayatana-indicator-bluetooth-26e135ab10dbf995c171243f1f4803b8f12f4469.zip
Merge branch 'tari01-pr/hide-icon-if-no-adapter'
Attributes GH PR #44: https://github.com/AyatanaIndicators/ayatana-indicator-bluetooth/pull/44
Diffstat (limited to 'src')
-rw-r--r--src/desktop.vala7
-rw-r--r--src/profile.vala11
2 files changed, 15 insertions, 3 deletions
diff --git a/src/desktop.vala b/src/desktop.vala
index c70d49a..b7b48fd 100644
--- a/src/desktop.vala
+++ b/src/desktop.vala
@@ -1,6 +1,6 @@
/*
* Copyright 2013 Canonical Ltd.
- * Copyright 2021 Robert Tari
+ * Copyright 2021-2022 Robert Tari
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -80,6 +80,11 @@ class Desktop: Profile
bluetooth.notify["supported"].connect (() => update_visibility());
update_visibility ();
}
+ else
+ {
+ bluetooth.notify["supported"].connect (() => update_root_action_state());
+ update_root_action_state();
+ }
// when devices change, rebuild our device section
bluetooth.devices_changed.connect (()=> {
diff --git a/src/profile.vala b/src/profile.vala
index eb7d067..be7863e 100644
--- a/src/profile.vala
+++ b/src/profile.vala
@@ -1,5 +1,6 @@
/*
* Copyright 2013 Canonical Ltd.
+ * Copyright 2022 Robert Tari
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -15,6 +16,7 @@
*
* Authors:
* Charles Kerr <charles.kerr@canonical.com>
+ * Robert Tari <robert@tari.in>
*/
class Profile: Object
@@ -167,8 +169,13 @@ class Profile: Object
var icon = new ThemedIcon.with_default_fallbacks (icon_name);
var builder = new VariantBuilder (new VariantType ("a{sv}"));
builder.add ("{sv}", "visible", new Variant.boolean (visible));
- builder.add ("{sv}", "accessible-desc", new Variant.string (a11y));
- builder.add ("{sv}", "icon", icon.serialize());
+
+ if (bluetooth.supported && visible)
+ {
+ builder.add ("{sv}", "accessible-desc", new Variant.string (a11y));
+ builder.add ("{sv}", "icon", icon.serialize());
+ }
+
builder.add ("{sv}", "title", new Variant.string (_("Bluetooth")));
builder.add ("{sv}", "tooltip", new Variant.string (_("Bluetooth status & device connections")));