diff options
author | Robert Ancell <robert.ancell@canonical.com> | 2013-02-08 11:20:53 +1300 |
---|---|---|
committer | Robert Ancell <robert.ancell@canonical.com> | 2013-02-08 11:20:53 +1300 |
commit | 0166a12eefbd48e40ffe3354994462eea45461f0 (patch) | |
tree | 61207dac2abd2c97bb3e769eb47b629f9a51da22 /src | |
parent | b4ead8b4ab91eeaa50393e92eeedb43cd08ec98b (diff) | |
download | ayatana-indicator-bluetooth-0166a12eefbd48e40ffe3354994462eea45461f0.tar.gz ayatana-indicator-bluetooth-0166a12eefbd48e40ffe3354994462eea45461f0.tar.bz2 ayatana-indicator-bluetooth-0166a12eefbd48e40ffe3354994462eea45461f0.zip |
Add "Set Up New Device" menu item
Diffstat (limited to 'src')
-rw-r--r-- | src/indicator-bluetooth-service.vala | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/src/indicator-bluetooth-service.vala b/src/indicator-bluetooth-service.vala index 63e634d..0348876 100644 --- a/src/indicator-bluetooth-service.vala +++ b/src/indicator-bluetooth-service.vala @@ -22,7 +22,6 @@ public class BluetoothIndicator private bool updating_visible = false; private Dbusmenu.Menuitem devices_separator; private List<BluetoothMenuItem> device_items; - private Dbusmenu.Menuitem settings_item; private Dbusmenu.Menuitem menu; public BluetoothIndicator () throws Error @@ -106,10 +105,15 @@ public class BluetoothIndicator sep.property_set (Dbusmenu.MENUITEM_PROP_TYPE, Dbusmenu.CLIENT_TYPES_SEPARATOR); menu.child_append (sep); - settings_item = new Dbusmenu.Menuitem (); - settings_item.property_set (Dbusmenu.MENUITEM_PROP_LABEL, _("Bluetooth Settings…")); - settings_item.item_activated.connect (() => { show_control_center ("bluetooth"); }); - menu.child_append (settings_item); + var item = new Dbusmenu.Menuitem (); + item.property_set (Dbusmenu.MENUITEM_PROP_LABEL, _("Set Up New Device…")); + item.item_activated.connect (() => { set_up_new_device (); }); + menu.child_append (item); + + item = new Dbusmenu.Menuitem (); + item.property_set (Dbusmenu.MENUITEM_PROP_LABEL, _("Bluetooth Settings…")); + item.item_activated.connect (() => { show_control_center ("bluetooth"); }); + menu.child_append (item); killswitch_state_changed_cb (killswitch.state); } @@ -334,6 +338,18 @@ private class BluetoothMenuItem : Dbusmenu.Menuitem } } +private void set_up_new_device () +{ + try + { + Process.spawn_command_line_async ("bluetooth-wizard"); + } + catch (GLib.SpawnError e) + { + warning ("Failed to open bluetooth-wizard: %s", e.message); + } +} + private void show_control_center (string panel) { try |