From cf9b03167ed12086acbd74b97404b082f8e018a8 Mon Sep 17 00:00:00 2001 From: Conor Curran Date: Mon, 31 Jan 2011 13:14:47 -0600 Subject: players in menu now dynamically controllable from new dbus api --- src/player-controller.vala | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/player-controller.vala') diff --git a/src/player-controller.vala b/src/player-controller.vala index 024b88b..d24eaa0 100644 --- a/src/player-controller.vala +++ b/src/player-controller.vala @@ -119,10 +119,10 @@ public class PlayerController : GLib.Object this.determine_state(); } - public void vanish() + public void remove_from_menu() { - foreach(Dbusmenu.Menuitem item in this.custom_items){ - root_menu.child_delete(item); + foreach(PlayerItem item in this.custom_items){ + this.root_menu.child_delete(item); } } @@ -180,7 +180,7 @@ public class PlayerController : GLib.Object foreach(PlayerItem item in this.custom_items){ if (this.custom_items.index_of(item) != 4) { - root_menu.child_add_position(item, this.menu_offset + this.custom_items.index_of(item)); + root_menu.child_add_position(item, this.menu_offset + this.custom_items.index_of(item)); } else{ PlaylistsMenuitem playlists_menuitem = item as PlaylistsMenuitem; @@ -188,7 +188,7 @@ public class PlayerController : GLib.Object } } } - + private void determine_state() { if(this.mpris_bridge.connected() == true){ -- cgit v1.2.3 From 43b7e22a13692edbba02c987975747a069881814 Mon Sep 17 00:00:00 2001 From: Conor Curran Date: Mon, 31 Jan 2011 19:33:46 -0600 Subject: moved builder and iter to the stack in blacklist method --- src/player-controller.vala | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/player-controller.vala') diff --git a/src/player-controller.vala b/src/player-controller.vala index d24eaa0..3ce121e 100644 --- a/src/player-controller.vala +++ b/src/player-controller.vala @@ -124,6 +124,10 @@ public class PlayerController : GLib.Object foreach(PlayerItem item in this.custom_items){ this.root_menu.child_delete(item); } + if (this.use_playlists == true){ + PlaylistsMenuitem playlists_menuitem = this.custom_items[widget_order.PLAYLISTS] as PlaylistsMenuitem; + this.root_menu.child_delete (playlists_menuitem.root_item); + } } public void hibernate() -- cgit v1.2.3