diff options
author | Ken VanDine <ken.vandine@canonical.com> | 2011-06-16 17:21:27 -0400 |
---|---|---|
committer | Bazaar Package Importer <james.westby@ubuntu.com> | 2011-06-16 17:21:27 -0400 |
commit | a16822cf5cf1435e10e34850affcac24687da130 (patch) | |
tree | 1aa03a50675abd7110676e6aee3d3dac69f44254 /src/player-controller.vala | |
parent | 7a20a205c496bed5d7c779ff60a5730b55b60060 (diff) | |
parent | 2ada6ebcaa4d92f1e1374c8ad7564c720e5930b2 (diff) | |
download | ayatana-indicator-sound-a16822cf5cf1435e10e34850affcac24687da130.tar.gz ayatana-indicator-sound-a16822cf5cf1435e10e34850affcac24687da130.tar.bz2 ayatana-indicator-sound-a16822cf5cf1435e10e34850affcac24687da130.zip |
* New upstream release.
- "Sound Preferences..." should be "Sound Settings" (LP: #785571)
- Not obvious what track info menu item does (LP: #699899)
* debian/patches/lp_750823.patch
- Dropped patch, merged upstream
* debian/control
- Updated standards version to 3.9.2
- Cleaned up description to quiet lintian
Diffstat (limited to 'src/player-controller.vala')
-rw-r--r-- | src/player-controller.vala | 43 |
1 files changed, 20 insertions, 23 deletions
diff --git a/src/player-controller.vala b/src/player-controller.vala index 20479d9..a08f692 100644 --- a/src/player-controller.vala +++ b/src/player-controller.vala @@ -23,11 +23,10 @@ using Gee; public class PlayerController : GLib.Object { - public const int WIDGET_QUANTITY = 5; + public const int WIDGET_QUANTITY = 4; public static enum widget_order{ SEPARATOR, - TITLE, METADATA, TRANSPORT, PLAYLISTS @@ -71,6 +70,7 @@ public class PlayerController : GLib.Object this.construct_widgets(); this.establish_mpris_connection(); this.update_layout(); + debug ("New player controller for %s with icon name %s", this.app_info.get_name(), this.icon_name); } public void update_state(state new_state) @@ -111,10 +111,10 @@ public class PlayerController : GLib.Object if(this.current_state != state.READY || this.dbus_name == null ){ debug("establish_mpris_connection - Not ready to connect"); return; - } + } debug ( " establish mpris connection - use playlists value = %s ", this.use_playlists.to_string() ); - + this.mpris_bridge = new Mpris2Controller(this); this.determine_state(); } @@ -135,26 +135,27 @@ public class PlayerController : GLib.Object update_state(PlayerController.state.OFFLINE); 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); + this.custom_items[widget_order.METADATA].reset(MetadataMenuitem.relevant_attributes_for_ui()); + MetadataMenuitem md = this.custom_items[widget_order.METADATA] as MetadataMenuitem; + md.toggle_active_triangle (false); this.mpris_bridge = null; } public void update_layout() - { + { + debug ("a call to update layout"); PlaylistsMenuitem playlists_menuitem = this.custom_items[widget_order.PLAYLISTS] as PlaylistsMenuitem; + MetadataMenuitem metadata_menuitem = this.custom_items[widget_order.METADATA] as MetadataMenuitem; if(this.current_state != state.CONNECTED){ - this.custom_items[widget_order.METADATA].property_set_bool (MENUITEM_PROP_VISIBLE, - false); + // TODO + metadata_menuitem.should_collapse (true); 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())); + metadata_menuitem.should_collapse (!this.custom_items[widget_order.METADATA].populated (MetadataMenuitem.relevant_attributes_for_ui()) ); if (this.app_info.get_id() == "banshee.desktop"){ TransportMenuitem transport = this.custom_items[widget_order.TRANSPORT] as TransportMenuitem; transport.handle_cached_action(); @@ -172,12 +173,8 @@ public class PlayerController : GLib.Object // Separator item this.custom_items.add(new PlayerItem(CLIENT_TYPES_SEPARATOR)); - // Title item - TitleMenuitem title_menu_item = new TitleMenuitem(this); - this.custom_items.add(title_menu_item); - // Metadata item - MetadataMenuitem metadata_item = new MetadataMenuitem(); + MetadataMenuitem metadata_item = new MetadataMenuitem(this); this.custom_items.add(metadata_item); // Transport item @@ -189,12 +186,12 @@ 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) != 4) { - root_menu.child_add_position(item, this.menu_offset + this.custom_items.index_of(item)); + if (this.custom_items.index_of(item) == 3) { + 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{ - 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)); } } } @@ -203,8 +200,8 @@ 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); + MetadataMenuitem md = this.custom_items[widget_order.METADATA] as MetadataMenuitem; + md.toggle_active_triangle(true); this.mpris_bridge.initial_update(); } else{ |