diff options
author | Conor Curran <conor.curran@canonical.com> | 2011-06-15 08:48:54 +0200 |
---|---|---|
committer | Conor Curran <conor.curran@canonical.com> | 2011-06-15 08:48:54 +0200 |
commit | 1677228ec606dd8d2e7eadccfff77a1703fdb727 (patch) | |
tree | 09e435494c9fd603bf502f3f88e26d25a667cbd3 /src/mpris2-controller.vala | |
parent | bf2c6d9d1f7ac8897c76b8917f4feaeff54816d6 (diff) | |
parent | d72fb000fdf8c8a65abb214d1e6e67c7d31b4dbb (diff) | |
download | ayatana-indicator-sound-1677228ec606dd8d2e7eadccfff77a1703fdb727.tar.gz ayatana-indicator-sound-1677228ec606dd8d2e7eadccfff77a1703fdb727.tar.bz2 ayatana-indicator-sound-1677228ec606dd8d2e7eadccfff77a1703fdb727.zip |
merge metadata widget and title widget
Diffstat (limited to 'src/mpris2-controller.vala')
-rw-r--r-- | src/mpris2-controller.vala | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/src/mpris2-controller.vala b/src/mpris2-controller.vala index 04ceb88..2975066 100644 --- a/src/mpris2-controller.vala +++ b/src/mpris2-controller.vala @@ -83,13 +83,16 @@ public class Mpris2Controller : GLib.Object } Variant? meta_v = changed_properties.lookup("Metadata"); if(meta_v != null){ - GLib.HashTable<string, Variant?> changed_updates = clean_metadata(); + GLib.HashTable<string, Variant?> changed_updates = clean_metadata(); PlayerItem metadata = this.owner.custom_items[PlayerController.widget_order.METADATA]; - metadata.reset ( MetadataMenuitem.attributes_format()); + metadata.reset (MetadataMenuitem.relevant_attributes_for_ui()); metadata.update ( changed_updates, - MetadataMenuitem.attributes_format()); - metadata.property_set_bool ( MENUITEM_PROP_VISIBLE, - metadata.populated(MetadataMenuitem.attributes_format())); + MetadataMenuitem.relevant_attributes_for_ui()); + MetadataMenuitem md = this.owner.custom_items[PlayerController.widget_order.METADATA] as MetadataMenuitem; + bool collapsing = !metadata.populated(MetadataMenuitem.relevant_attributes_for_ui()); + md.should_collapse(collapsing); + + debug ("Should metadata collapse %s", collapsing.to_string()); } Variant? playlist_v = changed_properties.lookup("ActivePlaylist"); if ( playlist_v != null && this.owner.use_playlists == true ){ @@ -109,8 +112,8 @@ public class Mpris2Controller : GLib.Object } Variant? identity_v = changed_properties.lookup("Identity"); if (identity_v != null){ - TitleMenuitem title = this.owner.custom_items[PlayerController.widget_order.TITLE] as TitleMenuitem; - title.alter_label (this.mpris2_root.Identity); + MetadataMenuitem md = this.owner.custom_items[PlayerController.widget_order.METADATA] as MetadataMenuitem; + md.alter_label (this.mpris2_root.Identity); } } @@ -162,8 +165,8 @@ public class Mpris2Controller : GLib.Object update = determine_play_state (this.player.PlaybackStatus); } if (this.mpris2_root.Identity != null){ - TitleMenuitem title = this.owner.custom_items[PlayerController.widget_order.TITLE] as TitleMenuitem; - title.alter_label (this.mpris2_root.Identity); + MetadataMenuitem md = this.owner.custom_items[PlayerController.widget_order.METADATA] as MetadataMenuitem; + md.alter_label (this.mpris2_root.Identity); } (this.owner.custom_items[PlayerController.widget_order.TRANSPORT] as TransportMenuitem).change_play_state (update); GLib.HashTable<string, Value?>? cleaned_metadata = this.clean_metadata(); |