From 8507423eb5b7acaf1089fdaa4fc57cdca554abeb Mon Sep 17 00:00:00 2001 From: Conor Curran Date: Tue, 1 Feb 2011 12:24:38 -0600 Subject: the title on the player menu item can now be dynamically changed using the Identity prop on the root MPRIS interface --- src/title-menu-item.vala | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'src/title-menu-item.vala') diff --git a/src/title-menu-item.vala b/src/title-menu-item.vala index 6ed24d8..fd81f65 100644 --- a/src/title-menu-item.vala +++ b/src/title-menu-item.vala @@ -26,8 +26,12 @@ public class TitleMenuitem : PlayerItem public TitleMenuitem(PlayerController parent) { Object(item_type: MENUITEM_TYPE, owner: parent); - this.property_set(MENUITEM_NAME, parent.app_info.get_name()); - this.property_set(MENUITEM_ICON, parent.icon_name); + } + + construct + { + this.property_set(MENUITEM_NAME, this.owner.app_info.get_name()); + this.property_set(MENUITEM_ICON, this.owner.icon_name); this.property_set_bool(MENUITEM_RUNNING, false); } @@ -42,6 +46,12 @@ public class TitleMenuitem : PlayerItem } } + public void alter_label (string new_title) + { + if (new_title != null) return; + this.property_set(MENUITEM_NAME, new_title); + } + public void toggle_active_triangle(bool update) { this.property_set_bool(MENUITEM_RUNNING, update); -- cgit v1.2.3