aboutsummaryrefslogtreecommitdiff
path: root/src/indicator-bluetooth.vala
diff options
context:
space:
mode:
authorRobert Ancell <robert.ancell@canonical.com>2013-02-11 20:25:30 +0000
committerTarmac <>2013-02-11 20:25:30 +0000
commitc3b9103a6e36220e11fbb55cc6849ee91fdf658d (patch)
tree1e801ad7456601423af6ed45f60f7478f4a976ff /src/indicator-bluetooth.vala
parentb4ead8b4ab91eeaa50393e92eeedb43cd08ec98b (diff)
parent5ab20c16591d13dff5cf3b41f98ae46bfd6e2fa2 (diff)
downloadayatana-indicator-bluetooth-c3b9103a6e36220e11fbb55cc6849ee91fdf658d.tar.gz
ayatana-indicator-bluetooth-c3b9103a6e36220e11fbb55cc6849ee91fdf658d.tar.bz2
ayatana-indicator-bluetooth-c3b9103a6e36220e11fbb55cc6849ee91fdf658d.zip
Support existing gsettings key to disable indicator. Fixes: https://bugs.launchpad.net/bugs/1115394.
Approved by Mathieu Trudel-Lapierre.
Diffstat (limited to 'src/indicator-bluetooth.vala')
-rw-r--r--src/indicator-bluetooth.vala5
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; }
}