How to force windowXML default list ?
#1
If a skinned script includes several of the list views (in id range 50 - 59) such as:

Code:
<include>CommonRootView</include>
<include>CommonListView</include>
<include>ThumbnailView</include>

and also has the list view changing button (id 2)

Is it possible to force a particular list view (ie 50)

I ask as I've a script that I'd like to force to CommonRootView on one screen but allow another screen (with its different list content) to be changeable.

ie.
First Screen - CommonRootView only
Change to
Second Screen - Allow any List view

Go back to First screen - force CommonRootView.

Another question:
How does a script implement an internal sort for standard Sort View button id = 3 & 4?

The log say 'windowXML: asc/dsc internal button not implemented' I'm not sure if the script is supposed to have a default callback func or is it saying that windowXML doesnt support it ?

Any help appreciated.

BBB
Retired from Add-on dev
Reply
#2
You can't force a viewmode, as it's up to the skinner as to what viewmodes do what. All you can do is setcontent on the items and hope the skinner does what you're asking them to.

As for the sort button - yes, it's unimplemented. A patch would be welcome on this front. Ideally you wouldn't have to do anything and it would just use the in-built sorting stuff (essentially you just specify the sortmode and XBMC sorts everything for you).

Cheers,
Jonathan
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#3
Quote:You can't force a viewmode, as it's up to the skinner as to what viewmodes do what. All you can do is setcontent on the items and hope the skinner does what you're asking them to.

I see what your saying, but as I'm writing the content to the same default windows list, the different view modes doesn't always make sense for each point in the script. Its not a real problem, just thought I might be able to force a particular list view.

Sort: Is that a patch you could put on your To_Do radar Wink

thanks for the reply.
BBB
Retired from Add-on dev
Reply
#4
As I say, you can specify the content type of the items and the skin will reduce (or increase) the viewmodes it wants to use for that content type. If we need more content types than that is something we may wish to consider.

And no, a sort patch isn't on my todo list - it's way too long already!

Cheers,
Jonathan
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#5
sort patch i had a quick (real quick) play.

it appears an addSortMethod() would need to be added.

i had it working for the first click, but after that it did not update. and the button never did show the current sort by name.

i may play with it later. it would be nice to have.
For python coding questions first see http://mirrors.xbmc.org/docs/python-docs/
Reply
#6
I've been looking at your suggestion of setContent() which should be fine for the plugin version.

In addition, I notice there are some functions (eg.setPluginCategory, setPluginCategory() and setPluginFanart) that don't appear in the online docs .

Is there an upto date doc of available commands?

I'm assuming the equiv of setContent in a script would be setInfo("video"...) and if I wish the view to kept to a simple list maybe setInfo("files"...) ?

thanks
Retired from Add-on dev
Reply
#7
thers a pydocs creator script in the addons svn
For python coding questions first see http://mirrors.xbmc.org/docs/python-docs/
Reply
#8
jmarshall, i seem to be stumped.

i traced a call to a plugin that does the addsortmethod() to see why the same method for a windowxml script wasn't working.

it calls CFileItemList::AddSortMethod() everytime the plugin calls it's addSortMethod() method. the script does this also, but...

the plugin then calls CGUIViewState::AddSortMethod() for each sort method the plugin added, but it does this three times. so if i added 6 sort methods [SIZE=2]
CGUIViewState::AddSortMethod() would be called 18 times.

i don't see a function to call after the script calls it's addsortmethod(0 to finalize them.

it seems a few calls are unnecessary, any tips.
[/SIZE]
For python coding questions first see http://mirrors.xbmc.org/docs/python-docs/
Reply
#9
You need to call CGUIMediaWindow::SortItems(items) on your list, and then update the display as needed, or perhaps FormatAndSort(items) which formats the items up and then sorts. You may have to alter SortItems, I'm not sure whether the python window deals with the viewstate stuff or not.

After that, you'll need

m_viewControl.SetItems(*m_vecItems);
UpdateButtons();

probably.

Cheers,
Jonathan
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply

Logout Mark Read Team Forum Stats Members Help
How to force windowXML default list ?0