diff options
author | Robert Ancell <robert.ancell@canonical.com> | 2013-02-08 11:38:17 +1300 |
---|---|---|
committer | Robert Ancell <robert.ancell@canonical.com> | 2013-02-08 11:38:17 +1300 |
commit | 4643e1008371882190c7dcc3dfcec12d6008152b (patch) | |
tree | fbcba4433b70d39879389a7b95cb6a31cf33ff41 /src/indicator-bluetooth.vala | |
parent | 0166a12eefbd48e40ffe3354994462eea45461f0 (diff) | |
download | ayatana-indicator-bluetooth-4643e1008371882190c7dcc3dfcec12d6008152b.tar.gz ayatana-indicator-bluetooth-4643e1008371882190c7dcc3dfcec12d6008152b.tar.bz2 ayatana-indicator-bluetooth-4643e1008371882190c7dcc3dfcec12d6008152b.zip |
Only show indicator if Bluetooth adapter present
Diffstat (limited to 'src/indicator-bluetooth.vala')
-rw-r--r-- | src/indicator-bluetooth.vala | 5 |
1 files changed, 5 insertions, 0 deletions
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; } } |