diff options
author | Conor Curran <conor.curran@canonical.com> | 2010-12-20 18:02:50 +0000 |
---|---|---|
committer | Conor Curran <conor.curran@canonical.com> | 2010-12-20 18:02:50 +0000 |
commit | c8c7681e7b9e2995d29fa58c931aa09e451c4fee (patch) | |
tree | c54f0645733e095503381cd153e76c303f7fc641 /src | |
parent | bc927c2284c55ca8a30146ae905a76aa08f26fa1 (diff) | |
download | ayatana-indicator-sound-c8c7681e7b9e2995d29fa58c931aa09e451c4fee.tar.gz ayatana-indicator-sound-c8c7681e7b9e2995d29fa58c931aa09e451c4fee.tar.bz2 ayatana-indicator-sound-c8c7681e7b9e2995d29fa58c931aa09e451c4fee.zip |
playlists working
Diffstat (limited to 'src')
-rw-r--r-- | src/mpris2-controller.vala | 2 | ||||
-rw-r--r-- | src/mpris2-interfaces.vala | 1 | ||||
-rw-r--r-- | src/player-controller.vala | 10 |
3 files changed, 8 insertions, 5 deletions
diff --git a/src/mpris2-controller.vala b/src/mpris2-controller.vala index 4990b38..35dc4e4 100644 --- a/src/mpris2-controller.vala +++ b/src/mpris2-controller.vala @@ -100,7 +100,7 @@ public class Mpris2Controller : GLib.Object } } - public bool playlist_support() + public bool playlists_support_exist() { if (this.playlists == null) return false; uint32? count = this.playlists.PlaylistCount; diff --git a/src/mpris2-interfaces.vala b/src/mpris2-interfaces.vala index a731de8..88610e6 100644 --- a/src/mpris2-interfaces.vala +++ b/src/mpris2-interfaces.vala @@ -50,6 +50,7 @@ public struct PlaylistDetails{ public string name; public string icon_path; } + // Active playlist property container public struct ActivePlaylistContainer{ public bool valid; diff --git a/src/player-controller.vala b/src/player-controller.vala index 24fd090..638c44d 100644 --- a/src/player-controller.vala +++ b/src/player-controller.vala @@ -131,21 +131,23 @@ public class PlayerController : GLib.Object public void update_layout() { + PlaylistsMenuitem playlists_menuitem = this.custom_items[widget_order.PLAYLISTS] as PlaylistsMenuitem; + if(this.current_state != state.CONNECTED){ this.custom_items[widget_order.TRANSPORT].property_set_bool(MENUITEM_PROP_VISIBLE, false); this.custom_items[widget_order.METADATA].property_set_bool(MENUITEM_PROP_VISIBLE, false); - this.custom_items[widget_order.PLAYLISTS].property_set_bool ( MENUITEM_PROP_ENABLED, - false ); + playlists_menuitem.root_item.property_set_bool ( MENUITEM_PROP_VISIBLE, + false ); return; } this.custom_items[widget_order.METADATA].property_set_bool(MENUITEM_PROP_VISIBLE, this.custom_items[widget_order.METADATA].populated(MetadataMenuitem.attributes_format())); this.custom_items[widget_order.TRANSPORT].property_set_bool(MENUITEM_PROP_VISIBLE, true); - this.custom_items[widget_order.PLAYLISTS].property_set_bool(MENUITEM_PROP_VISIBLE, - true); + playlists_menuitem.root_item.property_set_bool ( MENUITEM_PROP_VISIBLE, + this.mpris_bridge.playlists_support_exist() ); } private void construct_widgets() |