diff options
author | Charles Kerr <charles.kerr@canonical.com> | 2013-08-03 10:47:23 -0500 |
---|---|---|
committer | Charles Kerr <charles.kerr@canonical.com> | 2013-08-03 10:47:23 -0500 |
commit | 43059ed45ac41e1bf6172b3eec236ea086d81cda (patch) | |
tree | 729f113dabd2c0f8079a8479a99f4f9355cfba5a /src/service.vala | |
parent | dfd38e506145b8569611e5fb0eb8cb49eef1b7b2 (diff) | |
download | ayatana-indicator-bluetooth-43059ed45ac41e1bf6172b3eec236ea086d81cda.tar.gz ayatana-indicator-bluetooth-43059ed45ac41e1bf6172b3eec236ea086d81cda.tar.bz2 ayatana-indicator-bluetooth-43059ed45ac41e1bf6172b3eec236ea086d81cda.zip |
change the 'BluetoothMenu' superclass to 'Profile'
Diffstat (limited to 'src/service.vala')
-rw-r--r-- | src/service.vala | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/src/service.vala b/src/service.vala index 0f3d779..10f7f25 100644 --- a/src/service.vala +++ b/src/service.vala @@ -12,7 +12,7 @@ public class BluetoothIndicator { private MainLoop loop; private SimpleActionGroup actions; - private HashTable<string, BluetoothMenu> menus; + private HashTable<string,Profile> profiles; private DBusConnection bus; private Indicator.Service indicator_service; @@ -30,16 +30,13 @@ public class BluetoothIndicator public BluetoothIndicator (Bluetooth bluetooth) { - var phone = new PhoneMenu (bluetooth); - var desktop = new DesktopMenu (bluetooth); + profiles = new HashTable<string,Profile> (str_hash, str_equal); + profiles.insert ("phone", new Phone (bluetooth)); + profiles.insert ("desktop", new Desktop (bluetooth)); - this.menus = new HashTable<string, BluetoothMenu> (str_hash, str_equal); - this.menus.insert ("phone", phone); - this.menus.insert ("desktop", desktop); - - this.actions = new SimpleActionGroup (); - phone.add_actions_to_group (this.actions); - desktop.add_actions_to_group (this.actions); + actions = new SimpleActionGroup (); + foreach (Profile profile in profiles.get_values()) + profile.add_actions_to_group (actions); } private void init_for_bus (DBusConnection bus) @@ -178,7 +175,7 @@ public class BluetoothIndicator critical ("%s", e.message); } - this.menus.@foreach ( (profile, menu) => menu.export (connection, @"/com/canonical/indicator/bluetooth/$profile")); + this.profiles.@foreach ((name,profile) => profile.export_menu (connection, @"/com/canonical/indicator/bluetooth/$name")); } void on_name_lost (DBusConnection connection, string name) @@ -358,6 +355,7 @@ private class BluetoothMenuItem : Dbusmenu.Menuitem { for (var i = 0; uuids[i] != null; i++) { +message ("alias %s uuid #%d: %s", alias, i, uuids[i]); if (uuids[i] == "OBEXObjectPush") can_send = true; if (uuids[i] == "OBEXFileTransfer") |