diff options
author | Ken VanDine <ken.vandine@canonical.com> | 2011-06-16 21:40:42 -0400 |
---|---|---|
committer | Ken VanDine <ken.vandine@canonical.com> | 2011-06-16 21:40:42 -0400 |
commit | 2ada6ebcaa4d92f1e1374c8ad7564c720e5930b2 (patch) | |
tree | 1aa03a50675abd7110676e6aee3d3dac69f44254 /src/mpris2-controller.vala | |
parent | 306604f2426f7a1b7a4516566cb68e1d6c982998 (diff) | |
parent | b004f06319c37e63adee52cff5a6258e900ad8a2 (diff) | |
download | ayatana-indicator-sound-2ada6ebcaa4d92f1e1374c8ad7564c720e5930b2.tar.gz ayatana-indicator-sound-2ada6ebcaa4d92f1e1374c8ad7564c720e5930b2.tar.bz2 ayatana-indicator-sound-2ada6ebcaa4d92f1e1374c8ad7564c720e5930b2.zip |
releasing version 0.7.1-0ubuntu1
Diffstat (limited to 'src/mpris2-controller.vala')
-rw-r--r-- | src/mpris2-controller.vala | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/src/mpris2-controller.vala b/src/mpris2-controller.vala index 9a0c1a5..2975066 100644 --- a/src/mpris2-controller.vala +++ b/src/mpris2-controller.vala @@ -16,7 +16,6 @@ PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ - using Dbusmenu; using Transport; @@ -84,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 ){ @@ -110,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); } } @@ -163,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(); |