From 4643e1008371882190c7dcc3dfcec12d6008152b Mon Sep 17 00:00:00 2001 From: Robert Ancell Date: Fri, 8 Feb 2013 11:38:17 +1300 Subject: Only show indicator if Bluetooth adapter present --- src/indicator-bluetooth.vala | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/indicator-bluetooth.vala') diff --git a/src/indicator-bluetooth.vala b/src/indicator-bluetooth.vala index 4f3aef8..bfbbc9f 100644 --- a/src/indicator-bluetooth.vala +++ b/src/indicator-bluetooth.vala @@ -26,6 +26,9 @@ public class BluetoothIndicator : Indicator.Object var menu_client = menu.get_client (); menu_client.add_type_handler_full ("x-canonical-switch", new_switch_cb); + + /* Hide until ready */ + set_visible (false); } private bool new_switch_cb (Dbusmenu.Menuitem newitem, Dbusmenu.Menuitem parent, Dbusmenu.Client client) @@ -80,6 +83,7 @@ public class BluetoothIndicator : Indicator.Object private void server_properties_changed_cb () { + set_visible (proxy.visible); Indicator.image_helper_update (image, proxy.icon_name); accessible_description = proxy.accessible_description; } @@ -122,6 +126,7 @@ public class Switch : Ido.SwitchMenuItem [DBus (name = "com.canonical.indicator.bluetooth.service")] public interface BluetoothService : DBusProxy { + public abstract bool visible { owned get; } public abstract string icon_name { owned get; } public abstract string accessible_description { owned get; } } -- cgit v1.2.3