How to change view for a folder

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
captainloc Offline
Junior Member
Posts: 9
Joined: Feb 2012
Reputation: 0
Post: #1
Hi,

I'm starting development on a XBMC plugin and i was wondering how to change the default view directly from my plugin code ?
I found a way to change the sort method but nothing about the view. I would like to make the Thumbnail view the default for every folder of my script.

Thanks a lot
find quote
jmarshall Offline
Team-XBMC Developer
Posts: 24,523
Joined: Oct 2003
Reputation: 138
Post: #2
You can't. All you can do is set the content type. The view to show is then up to the skin.

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: badge.gif]
find quote
sphere Offline
Posting Freak
Posts: 781
Joined: Jul 2009
Reputation: 33
Location: Germany
Post: #3
jmarshall Wrote:You can't. All you can do is set the content type. The view to show is then up to the skin.

I'm sorry, but you can. Sure - its not a nice way, but it is possible and some plugins (youtube for example) are using it.

They are doing it with something like
Code:
xbmc.executebuiltin('Container.SetViewMode(500)')
after the addDirectoryItems-call but before the endOfDirectory-call.

The videmode-ids are declared in the skins - 500 is thumbnail view in most skins.

I hope there will be a cleaner way in the future *g*

regards,
sphere
find quote
jmarshall Offline
Team-XBMC Developer
Posts: 24,523
Joined: Oct 2003
Reputation: 138
Post: #4
There won't be a cleaner way to do that, no. There will be better content setting (essentially finer grained) capabilities, so that the skin can react much better to choose the correct view mode.

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: badge.gif]
find quote
sphere Offline
Posting Freak
Posts: 781
Joined: Jul 2009
Reputation: 33
Location: Germany
Post: #5
Sounds promising.
That's what I wanted to say with "nicer way" Smile

regards,
sphere
find quote
captainloc Offline
Junior Member
Posts: 9
Joined: Feb 2012
Reputation: 0
Post: #6
Thanks a lot for your help Smile
find quote