aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorConor Curran <conor.curran@canonical.com>2010-05-20 12:58:15 +0100
committerConor Curran <conor.curran@canonical.com>2010-05-20 12:58:15 +0100
commit8e2bd9c87d812a07caaa2c5aba0bbf819b445e56 (patch)
treec46f56b11f4f8edc16d91325931b14d7f4040494
parent19eed06d9ad20121a17a6824297312f2b5ea8a7c (diff)
downloadayatana-indicator-sound-8e2bd9c87d812a07caaa2c5aba0bbf819b445e56.tar.gz
ayatana-indicator-sound-8e2bd9c87d812a07caaa2c5aba0bbf819b445e56.tar.bz2
ayatana-indicator-sound-8e2bd9c87d812a07caaa2c5aba0bbf819b445e56.zip
registered clients now add menuitems to the menu - the bullet trace is complete
-rw-r--r--src/music-bridge.vala23
1 files changed, 16 insertions, 7 deletions
diff --git a/src/music-bridge.vala b/src/music-bridge.vala
index 1cadc36..e0900ba 100644
--- a/src/music-bridge.vala
+++ b/src/music-bridge.vala
@@ -1,16 +1,19 @@
using Indicate;
using DbusmenuGlib;
using DbusmenuMenuitem;
+//using Gee;
public class BridgeServer : GLib.Object
{
private Listener listener;
- private RhythmboxController rb;
- private DbusmenuMenuitem root_menu;
-
+ private DbusmenuMenuitem root_menu;
+ //private HashMap<string, DbusmenuMenuitem> registered_clients;
+
public BridgeServer()
{
+ //registered_clients = new HashMap<string, DbusmenuMenuitem> ();
+ root_menu = null;
listener = Listener.ref_default();
listener.indicator_added.connect(on_indicator_added);
listener.indicator_removed.connect(on_indicator_removed);
@@ -48,11 +51,17 @@ public class BridgeServer : GLib.Object
if (type.contains("music") == false) {
debug("server is of no interest, it is not an music server");
return;
- } else {
+ }
+ else {
debug("client of type %s has registered with us", type);
- if (type.contains("rhythmbox") == true) {
- rb = new RhythmboxController();
- }
+ if (root_menu != null){
+ debug("Just about to create the registration menu item");
+ DbusmenuMenuitem client_item = new DbusmenuMenuitem();
+ string client_name = type.split(".")[1];
+ client_item.property_set(DBUSMENU_MENUITEM_PROP_LABEL, client_name.concat(" is registered"));
+ //registered_clients.set(client_name, client_item);
+ root_menu.child_append(client_item);
+ }
}
}