From 58627767fbd151587a843fd2397f1c293533664a Mon Sep 17 00:00:00 2001 From: Conor Curran Date: Thu, 9 Jun 2011 12:15:39 +0200 Subject: merged the title and metadata at the backend, now for the tricky UI work@ --- src/player-controller.vala | 29 ++++++++++++----------------- 1 file changed, 12 insertions(+), 17 deletions(-) (limited to 'src/player-controller.vala') diff --git a/src/player-controller.vala b/src/player-controller.vala index 20479d9..1ff8b08 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 @@ -111,10 +110,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(); } @@ -136,8 +135,8 @@ public class PlayerController : GLib.Object 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); + MetadataMenuitem md = this.custom_items[widget_order.METADATA] as MetadataMenuitem; + md.toggle_active_triangle(false); this.mpris_bridge = null; } @@ -172,12 +171,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 +184,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 +198,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{ -- cgit v1.2.3 From a406685399b46b4b2a62b8e580ce7beec2f875f4 Mon Sep 17 00:00:00 2001 From: Conor Curran Date: Thu, 9 Jun 2011 17:39:03 +0200 Subject: image is appearing inthe gutter hurray --- src/player-controller.vala | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/player-controller.vala') diff --git a/src/player-controller.vala b/src/player-controller.vala index 1ff8b08..a7c1424 100644 --- a/src/player-controller.vala +++ b/src/player-controller.vala @@ -70,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) @@ -144,8 +145,10 @@ public class PlayerController : GLib.Object { PlaylistsMenuitem playlists_menuitem = this.custom_items[widget_order.PLAYLISTS] as PlaylistsMenuitem; if(this.current_state != state.CONNECTED){ + // TODO + // For now just set the visibility to true so that I can figure out what todo here. this.custom_items[widget_order.METADATA].property_set_bool (MENUITEM_PROP_VISIBLE, - false); + true); playlists_menuitem.root_item.property_set_bool (MENUITEM_PROP_VISIBLE, false ); this.custom_items[widget_order.TRANSPORT].property_set_bool (MENUITEM_PROP_VISIBLE, -- cgit v1.2.3 From e0761ddf73f224b880adea3f226463eb7a996ec6 Mon Sep 17 00:00:00 2001 From: Conor Curran Date: Fri, 10 Jun 2011 11:38:54 +0200 Subject: label appearing dynamic resizing partially working --- src/player-controller.vala | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/player-controller.vala') diff --git a/src/player-controller.vala b/src/player-controller.vala index a7c1424..3722fff 100644 --- a/src/player-controller.vala +++ b/src/player-controller.vala @@ -144,19 +144,19 @@ public class PlayerController : GLib.Object public void 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){ // TODO - // For now just set the visibility to true so that I can figure out what todo here. - this.custom_items[widget_order.METADATA].property_set_bool (MENUITEM_PROP_VISIBLE, - true); + metadata_menuitem.collapse (); 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.expand (); + /*this.custom_items[widget_order.METADATA].property_set_bool (MENUITEM_PROP_VISIBLE, + this.custom_items[widget_order.METADATA].populated(MetadataMenuitem.attributes_format()));*/ if (this.app_info.get_id() == "banshee.desktop"){ TransportMenuitem transport = this.custom_items[widget_order.TRANSPORT] as TransportMenuitem; transport.handle_cached_action(); -- cgit v1.2.3 From ec14b8310dd5b02ed749c2cfade5c1a45ef00bac Mon Sep 17 00:00:00 2001 From: Conor Curran Date: Mon, 13 Jun 2011 12:04:15 +0200 Subject: number of bugs fixed, more to come --- src/player-controller.vala | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/player-controller.vala') diff --git a/src/player-controller.vala b/src/player-controller.vala index 3722fff..7e35d63 100644 --- a/src/player-controller.vala +++ b/src/player-controller.vala @@ -147,14 +147,14 @@ public class PlayerController : GLib.Object MetadataMenuitem metadata_menuitem = this.custom_items[widget_order.METADATA] as MetadataMenuitem; if(this.current_state != state.CONNECTED){ // TODO - metadata_menuitem.collapse (); + 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; } - metadata_menuitem.expand (); + metadata_menuitem.should_collapse (false); /*this.custom_items[widget_order.METADATA].property_set_bool (MENUITEM_PROP_VISIBLE, this.custom_items[widget_order.METADATA].populated(MetadataMenuitem.attributes_format()));*/ if (this.app_info.get_id() == "banshee.desktop"){ -- cgit v1.2.3 From 1f5e377b627ba6d170f0cf5fa30d4d1c5b502609 Mon Sep 17 00:00:00 2001 From: Conor Curran Date: Tue, 14 Jun 2011 12:59:16 +0200 Subject: widget reset now working nicely --- src/player-controller.vala | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/player-controller.vala') diff --git a/src/player-controller.vala b/src/player-controller.vala index 7e35d63..e8215cd 100644 --- a/src/player-controller.vala +++ b/src/player-controller.vala @@ -135,9 +135,9 @@ 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()); + 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); + md.toggle_active_triangle (false); this.mpris_bridge = null; } -- cgit v1.2.3 From 95fdfeacc7b13034ca71aac2fe2e42fef17de253 Mon Sep 17 00:00:00 2001 From: Conor Curran Date: Tue, 14 Jun 2011 13:17:25 +0200 Subject: spacing fixed --- src/player-controller.vala | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/player-controller.vala') diff --git a/src/player-controller.vala b/src/player-controller.vala index e8215cd..002af65 100644 --- a/src/player-controller.vala +++ b/src/player-controller.vala @@ -154,9 +154,7 @@ public class PlayerController : GLib.Object this.app_info.get_id() == "banshee.desktop"); return; } - metadata_menuitem.should_collapse (false); - /*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(); -- cgit v1.2.3 From 9ab1c1505226e7b384ebdaea1eca760d05bc803d Mon Sep 17 00:00:00 2001 From: Conor Curran Date: Thu, 16 Jun 2011 16:01:26 +0200 Subject: spacing issues resolved plus some unwanted prop set to invisible@ --- src/player-controller.vala | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/player-controller.vala') diff --git a/src/player-controller.vala b/src/player-controller.vala index 002af65..a08f692 100644 --- a/src/player-controller.vala +++ b/src/player-controller.vala @@ -142,7 +142,8 @@ public class PlayerController : GLib.Object } 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){ -- cgit v1.2.3