diff options
Diffstat (limited to 'src/player-controller.vala')
-rw-r--r-- | src/player-controller.vala | 28 |
1 files changed, 9 insertions, 19 deletions
diff --git a/src/player-controller.vala b/src/player-controller.vala index adefb65..3ce121e 100644 --- a/src/player-controller.vala +++ b/src/player-controller.vala @@ -119,10 +119,14 @@ 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); + } + 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); } } @@ -180,7 +184,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,21 +192,7 @@ public class PlayerController : GLib.Object } } } - - private static string format_player_name(owned string app_info_name) - { - string result = app_info_name.down().strip(); - var tokens = result.split(" "); - if(tokens.length > 1){ - result = tokens[0]; - } - if(result.length > 1){ - result = result.up(1).concat(result.slice(1, result.length)); - } - debug("PlayerController->format_player_name - : %s", result); - return result; - } - + private void determine_state() { if(this.mpris_bridge.connected() == true){ |