aboutsummaryrefslogtreecommitdiff
path: root/src/player-controller.vala
diff options
context:
space:
mode:
authorConor Curran <conor.curran@canonical.com>2010-12-10 13:02:16 +0000
committerConor Curran <conor.curran@canonical.com>2010-12-10 13:02:16 +0000
commitf3b321919e3390f3d3af2eea33ad71611616ce61 (patch)
treec63a7bb63a3eeb2d2a63e5ce472a0e1fad7d9e80 /src/player-controller.vala
parenta964487e2fcd11946b5f95ab36b20cbd1bea4a57 (diff)
downloadayatana-indicator-sound-f3b321919e3390f3d3af2eea33ad71611616ce61.tar.gz
ayatana-indicator-sound-f3b321919e3390f3d3af2eea33ad71611616ce61.tar.bz2
ayatana-indicator-sound-f3b321919e3390f3d3af2eea33ad71611616ce61.zip
playlist widget population
Diffstat (limited to 'src/player-controller.vala')
-rw-r--r--src/player-controller.vala20
1 files changed, 15 insertions, 5 deletions
diff --git a/src/player-controller.vala b/src/player-controller.vala
index b9e275f..450ecd6 100644
--- a/src/player-controller.vala
+++ b/src/player-controller.vala
@@ -141,6 +141,10 @@ public class PlayerController : GLib.Object
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);
+ this.custom_items[widget_order.PLAYLISTS].property_set_bool ( MENUITEM_PROP_ENABLED,
+ true );
}
private void construct_widgets()
@@ -160,12 +164,18 @@ public class PlayerController : GLib.Object
TransportMenuitem transport_item = new TransportMenuitem(this);
this.custom_items.add(transport_item);
- // Playlist item
+ // Playlist item
PlaylistsMenuitem playlist_menuitem = new PlaylistsMenuitem(this);
this.custom_items.add(playlist_menuitem);
foreach(PlayerItem item in this.custom_items){
- root_menu.child_add_position(item, this.menu_offset + this.custom_items.index_of(item));
+ if (this.custom_items.index_of(item) != 4) {
+ root_menu.child_add_position(item, this.menu_offset + this.custom_items.index_of(item));
+ }
+ else{
+ PlaylistsMenuitem playlists_menuitem = item as PlaylistsMenuitem;
+ root_menu.child_add_position(playlists_menuitem.root_item, this.menu_offset + this.custom_items.index_of(item));
+ }
}
}
@@ -188,11 +198,11 @@ public class PlayerController : GLib.Object
if(this.mpris_bridge.connected() == true){
this.update_state(state.CONNECTED);
TitleMenuitem title = this.custom_items[widget_order.TITLE] as TitleMenuitem;
- title.toggle_active_triangle(true);
- this.mpris_bridge.initial_update();
+ title.toggle_active_triangle(true);
+ this.mpris_bridge.initial_update();
}
else{
this.update_state(state.DISCONNECTED);
}
- }
+ }
}