aboutsummaryrefslogtreecommitdiff
path: root/src/player-controller.vala
diff options
context:
space:
mode:
authorKen VanDine <ken.vandine@canonical.com>2011-03-23 12:03:02 -0400
committerKen VanDine <ken.vandine@canonical.com>2011-03-23 12:03:02 -0400
commitf05dff9b5d6c5e921f3056c142068ea7f6f41486 (patch)
tree9be3a5ff03f17db4a06e56815ad68de4c588c1ec /src/player-controller.vala
parent7619eab48daaa739fb3418237c693b7b463182f0 (diff)
parentfb3a829f4bca4f16c51cb5305b941928296c52a7 (diff)
downloadayatana-indicator-sound-f05dff9b5d6c5e921f3056c142068ea7f6f41486.tar.gz
ayatana-indicator-sound-f05dff9b5d6c5e921f3056c142068ea7f6f41486.tar.bz2
ayatana-indicator-sound-f05dff9b5d6c5e921f3056c142068ea7f6f41486.zip
Import upstream version 0.6.5
Diffstat (limited to 'src/player-controller.vala')
-rw-r--r--src/player-controller.vala28
1 files changed, 17 insertions, 11 deletions
diff --git a/src/player-controller.vala b/src/player-controller.vala
index 3ce121e..20479d9 100644
--- a/src/player-controller.vala
+++ b/src/player-controller.vala
@@ -133,7 +133,8 @@ public class PlayerController : GLib.Object
public void hibernate()
{
update_state(PlayerController.state.OFFLINE);
- this.custom_items[widget_order.TRANSPORT].reset(TransportMenuitem.attributes_format());
+ TransportMenuitem transport = this.custom_items[widget_order.TRANSPORT] as TransportMenuitem;
+ transport.change_play_state (Transport.State.PAUSED);
this.custom_items[widget_order.METADATA].reset(MetadataMenuitem.attributes_format());
TitleMenuitem title = this.custom_items[widget_order.TITLE] as TitleMenuitem;
title.toggle_active_triangle(false);
@@ -143,20 +144,25 @@ 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,
+ this.custom_items[widget_order.METADATA].property_set_bool (MENUITEM_PROP_VISIBLE,
false);
- this.custom_items[widget_order.METADATA].property_set_bool(MENUITEM_PROP_VISIBLE,
- false);
- playlists_menuitem.root_item.property_set_bool ( MENUITEM_PROP_VISIBLE,
- false );
+ playlists_menuitem.root_item.property_set_bool (MENUITEM_PROP_VISIBLE,
+ false );
+ this.custom_items[widget_order.TRANSPORT].property_set_bool (MENUITEM_PROP_VISIBLE,
+ this.app_info.get_id() == "banshee.desktop");
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.METADATA].property_set_bool (MENUITEM_PROP_VISIBLE,
+ this.custom_items[widget_order.METADATA].populated(MetadataMenuitem.attributes_format()));
+ if (this.app_info.get_id() == "banshee.desktop"){
+ TransportMenuitem transport = this.custom_items[widget_order.TRANSPORT] as TransportMenuitem;
+ transport.handle_cached_action();
+ }
+ else{
+ this.custom_items[widget_order.TRANSPORT].property_set_bool (MENUITEM_PROP_VISIBLE,
+ true);
+ }
playlists_menuitem.root_item.property_set_bool ( MENUITEM_PROP_VISIBLE,
this.use_playlists );
}