aboutsummaryrefslogtreecommitdiff
path: root/src/player-controller.vala
diff options
context:
space:
mode:
authorConor Curran <conor.curran@canonical.com>2011-06-06 21:52:44 +0200
committerConor Curran <conor.curran@canonical.com>2011-06-06 21:52:44 +0200
commit4fc554dc87e61f4fa7c605236da86d05781f7496 (patch)
tree9dc5bf393e5fd21da4ebaeecfb3655aa491516b4 /src/player-controller.vala
parent0681190881ea7e9cca176bd69ec00f2393c3ee56 (diff)
downloadayatana-indicator-sound-4fc554dc87e61f4fa7c605236da86d05781f7496.tar.gz
ayatana-indicator-sound-4fc554dc87e61f4fa7c605236da86d05781f7496.tar.bz2
ayatana-indicator-sound-4fc554dc87e61f4fa7c605236da86d05781f7496.zip
track specific items now appears when asked via the com.canonical.indicators.sound dbus interface
Diffstat (limited to 'src/player-controller.vala')
-rw-r--r--src/player-controller.vala20
1 files changed, 12 insertions, 8 deletions
diff --git a/src/player-controller.vala b/src/player-controller.vala
index 4689a42..8a7bda5 100644
--- a/src/player-controller.vala
+++ b/src/player-controller.vala
@@ -109,10 +109,10 @@ public class PlayerController : GLib.Object
public void enable_track_specific_items()
{
- this.custom_items[widget_order.TRACK_SPECIFIC].property_set_bool (MENUITEM_PROP_VISIBLE,
- true);
- this.custom_items[widget_order.TRACK_SPECIFIC].property_set_bool (MENUITEM_PROP_ENABLED,
- true);
+ debug ("enable_track_specific_items");
+ TrackSpecificMenuitem menuitem = this.custom_items[widget_order.TRACK_SPECIFIC] as TrackSpecificMenuitem;
+ menuitem.root_item.property_set_bool (MENUITEM_PROP_VISIBLE, true);
+ menuitem.root_item.property_set_bool (MENUITEM_PROP_ENABLED, true);
}
private void establish_mpris_connection()
@@ -202,12 +202,16 @@ public class PlayerController : GLib.Object
this.custom_items.add(playlist_menuitem);
foreach(PlayerItem item in this.custom_items){
- if (this.custom_items.index_of(item) != 5) {
- root_menu.child_add_position(item, this.menu_offset + this.custom_items.index_of(item));
+ if (this.custom_items.index_of(item) == 5) {
+ PlaylistsMenuitem playlists_menuitem = item as PlaylistsMenuitem;
+ root_menu.child_add_position(playlists_menuitem.root_item, this.menu_offset + this.custom_items.index_of(item));
}
+ else if (this.custom_items.index_of(item) == 4) {
+ TrackSpecificMenuitem trackspecific_menuitem = item as TrackSpecificMenuitem;
+ root_menu.child_add_position(trackspecific_menuitem.root_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));
+ root_menu.child_add_position(item, this.menu_offset + this.custom_items.index_of(item));
}
}
}