aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Ancell <robert.ancell@canonical.com>2013-02-08 11:20:53 +1300
committerRobert Ancell <robert.ancell@canonical.com>2013-02-08 11:20:53 +1300
commit0166a12eefbd48e40ffe3354994462eea45461f0 (patch)
tree61207dac2abd2c97bb3e769eb47b629f9a51da22
parentb4ead8b4ab91eeaa50393e92eeedb43cd08ec98b (diff)
downloadayatana-indicator-bluetooth-0166a12eefbd48e40ffe3354994462eea45461f0.tar.gz
ayatana-indicator-bluetooth-0166a12eefbd48e40ffe3354994462eea45461f0.tar.bz2
ayatana-indicator-bluetooth-0166a12eefbd48e40ffe3354994462eea45461f0.zip
Add "Set Up New Device" menu item
-rw-r--r--NEWS4
-rw-r--r--src/indicator-bluetooth-service.vala26
2 files changed, 25 insertions, 5 deletions
diff --git a/NEWS b/NEWS
index 0864265..cbbdc82 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,7 @@
+Overview of changes in indicator-bluetooth 0.0.6
+
+ * Add "Set Up New Device" menu item
+
Overview of changes in indicator-bluetooth 0.0.5
* Add license file
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