aboutsummaryrefslogtreecommitdiff
path: root/src/playlists-menu-item.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/playlists-menu-item.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/playlists-menu-item.vala')
-rw-r--r--src/playlists-menu-item.vala29
1 files changed, 25 insertions, 4 deletions
diff --git a/src/playlists-menu-item.vala b/src/playlists-menu-item.vala
index 8106600..4b81e48 100644
--- a/src/playlists-menu-item.vala
+++ b/src/playlists-menu-item.vala
@@ -23,18 +23,39 @@ using Gee;
public class PlaylistsMenuitem : PlayerItem
{
+
+ public Menuitem root_item;
public PlaylistsMenuitem ( PlayerController parent )
{
Object ( item_type: MENUITEM_TYPE, owner: parent );
}
+ construct{
+ this.property_set ( MENUITEM_PROP_LABEL, "Choose Playlist");
+ this.root_item = new Menuitem();
+ this.root_item.property_set ( MENUITEM_PROP_LABEL, "Choose Playlist" );
+ }
- public void update (PlaylistDetails[] playlists)
+ public new void update (PlaylistDetails[] playlists)
{
- foreach ( PlaylistDetail detail in playlists ){
-
+ foreach ( PlaylistDetails detail in playlists ){
+ Dbusmenu.Menuitem menuitem = new Menuitem();
+ menuitem.property_set (MENUITEM_PROP_LABEL, detail.name);
+ menuitem.property_set (MENUITEM_PROP_ICON_NAME, "source-smart-playlist");
+ menuitem.property_set_bool (MENUITEM_PROP_VISIBLE, true);
+ menuitem.property_set_bool (MENUITEM_PROP_ENABLED, true);
+
+ menuitem.item_activated.connect(() => {
+ submenu_item_activated (menuitem.id );});
+
+ this.root_item.child_append( menuitem );
}
}
-
+
+ private void submenu_item_activated (int menu_item_id)
+ {
+ debug("item %i was activated", menu_item_id);
+ }
+
public static HashSet<string> attributes_format()
{
HashSet<string> attrs = new HashSet<string>();