Kodi Community Forum

Full Version: Default control for static lists weirdness
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Rewriting the home screen for Alaska HD I thought I'd use this feature so I could reduce the number of buttons/lists the previous version used for the submenus - accessed by pressing Up or Down from the main control.

So I've used a single list for each panel (group) and because some of them have items (ie Recently Added) that I want to be available by scrolling up from the default control (ie Movies) I've added
<defaultcontrol [COLOR="red"]always="true">9</defaultcontrol>[/COLOR] - where item 9 is the main control and items 1-8 are the recently added items.

This worked fine during testing until I restarted XBMC and for some reason the visible conditions attached to items 1-8 (ie <visible>!IsEmpty(Window.Property(LatestMovie.1.Title))</visible>) mess the default control up when the home screen first loads resulting in the top most recently added movie gaining focus (id=1) but a refresh or entering and exiting any window fixes it.

I can supply code if needed, thanks.
maybe because the window.properties() haven't been set yet at startup?
which would result in an empty container, so defaultcontrol fails.

..just thinking out loud
Hitcher Wrote:Rewriting the home screen for Alaska HD I thought I'd use this feature so I could reduce the number of buttons/lists the previous version used for the submenus - accessed by pressing Up or Down from the main control.

So I've used a single list for each panel (group) and because some of them have items (ie Recently Added) that I want to be available by scrolling up from the default control (ie Movies) I've added
<defaultcontrol [COLOR="red"]always="true">9</defaultcontrol>[/COLOR] - where item 9 is the main control and items 1-8 are the recently added items.

This worked fine during testing until I restarted XBMC and for some reason the visible conditions attached to items 1-8 (ie <visible>!IsEmpty(Window.Property(LatestMovie.1.Title))</visible>) mess the default control up when the home screen first loads resulting in the top most recently added movie gaining focus (id=1) but a refresh or entering and exiting any window fixes it.

I can supply code if needed, thanks.

I did not know this existed so I used <onload> with control.move in similar situation.
ronie Wrote:maybe because the window.properties() haven't been set yet at startup?
which would result in an empty container, so defaultcontrol fails.

..just thinking out loud

I think it's definitely something to do with that but as you can see from this video they initially get the correct focus and then, I assume when the properties are filled, they just revert back to the first item in the list.

http://youtu.be/qbsHvZ-JWRY
@Hitcher,
mind sharing Your .xmls?
PMed.
Any thoughts pieh?

Thanks.
Seems like the updating of items in the list doesn't refocus on the correct item. i.e. initially item number 1 (id 9) has focus as it's the only one visible. After the rest become visible, item number 1 (id 1 maybe?) has focus.

Solution is making sure focused item stays focused (if still available) during static item update.

@pieh: you on it?
jmarshall Wrote:Seems like the updating of items in the list doesn't refocus on the correct item. i.e. initially item number 1 (id 9) has focus as it's the only one visible. After the rest become visible, item number 1 (id 1 maybe?) has focus.

Yes, that's exactly what's happening.

I could remove the visible conditions but then if they were empty the user would be cycling through 'N/A' labels which I'd rather like to avoid.

Thanks.
Yeah, I have fixed it locally (got it on my github in static_selection branch). Just need some quality time with pc instead of phone to close this issue.

---edit
and fixed in ffdb63df
Works a treat. Big Grin

Thanks.
Is <defaultcontrol> supposed to work for grouplist?
pecinko Wrote:Is <defaultcontrol> supposed to work for grouplist?

No, but it would be more than welcome.

In fact I'd like to request focusposition be added to grouplists to make them even more flexible.
I haven't updated in a few weeks but using 12-Sep-2012 nightly this is broken.

I'll try and pinpoint it tomorrow.

Thanks.
Working - XBMCSetup-20120908-3aa82b8-master.exe 08-Sep-2012 10:29

Broken - XBMCSetup-20120909-74be277-master.exe 09-Sep-2012 10:33

Thanks.
Pages: 1 2