diff options
Diffstat (limited to 'src/player-controller.vala')
-rw-r--r-- | src/player-controller.vala | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/player-controller.vala b/src/player-controller.vala index 48416b9..f824d6f 100644 --- a/src/player-controller.vala +++ b/src/player-controller.vala @@ -60,13 +60,14 @@ public class PlayerController : GLib.Object this.menu_offset = offset; construct_widgets(); establish_mpris_connection(); - update_layout(); + this.update_layout(); } public void update_state(state new_state) { debug("update_state - player controller %s : new state %i", this.name, new_state); this.current_state = new_state; + //this.update_layout(); } public void activate() @@ -125,10 +126,12 @@ public class PlayerController : GLib.Object } } - private void update_layout() + public void update_layout() { bool visibility = true; - if(this.current_state != state.CONNECTED){ + MetadataMenuitem meta_item = this.custom_items[widget_order.METADATA] as MetadataMenuitem; + if(this.current_state != state.CONNECTED /*|| + meta_item.not_populated()*/){ visibility = false; } debug("about the set the visibility on both the transport and metadata widget to %s", visibility.to_string()); @@ -136,8 +139,8 @@ public class PlayerController : GLib.Object this.custom_items[widget_order.SCRUB].property_set_bool(MENUITEM_PROP_VISIBLE, visibility); this.custom_items[widget_order.METADATA].property_set_bool(MENUITEM_PROP_VISIBLE, visibility); // DEBUG - if(this.mpris_adaptor == null){ - warning("Why is the mpris object null"); + if(visibility == false){ + warning("Update layout of client %s is setting widgets to invisibile!", this.name); } } |