PDA

View Full Version : Favorites, a replacement for DialogSubmenu.xml


Asteron
2007-01-09, 04:52
Currently DialogSubmenu.xml exists in the skin directly and must be editted manually to add favorite scripts, xbes, etc.

While the Submenu Editor Script helps somewhat, this is really something that belongs in UserData as opposed to the skin. I recommend for this field to be replaced with a list referenced in the skin which is populated by entries in Q:\UserData\favorites.xml

An 'Add to favorites' command is added to the context menu of items in My Scripts, My Programs, My Music, My Videos, and My Pictures. If the item has already been added the command is instead 'Remove from Favorites'.

While the DialogSubmenu is open, the context menu on each favorite contains

'Move up'
'Move Down'
'Edit Favorite'
'Remove Favorite'
'Add Favorite' (opens Browse)

sCAPe
2007-01-09, 16:13
I like that idea. Sounds good.

kraqh3d
2007-01-09, 16:32
i've actually considered something like this in the past, but slightly different from what you're describing. instead of replacing the dialog submenu, i was thinking of a new "favorites" media window which references saved favorites from a file. the items could be anything item type -- a python script, video file, music file, an image, a lastfm path, etc. the context menu in the other windows would have an "add to favorites" option which would add the item to the favorites list.

in fact, building a favorites window like any other media window would be rather trivial at this point. extending dialogsubmenu wouldnt be. (and a distinct advantage of using a media window would be that it would inherit all the list and thumb panel types.)

Gamester17
2007-01-09, 19:07
Kind of off-topic but for scripts, wouldn't the "My Scripts" idea (with that script section treated just like games and application in My Programs, with a auto-scan/update database) be a good start? http://xbmc.org/forum/showthread.php?t=13514

kraqh3d
2007-01-09, 21:14
i would say thats entirely different than a "my favorites" window.

spiff
2007-01-09, 22:16
if this is done i definitely think kraqh's approach is the best.

Asteron
2007-01-09, 22:35
Now that we have default.py support I think the scripts window is alright...
Kraq3d's version is pretty good. Though I think that people would want to order their favorites in the same way people organize bookmarks in a browser.

kraqh3d
2007-01-09, 22:37
ordering would be static using the order in the file, with a way to reoder like how the now playing window works. (move up, move down, etc).

jmarshall
2007-01-10, 01:26
How would the thumbnailing (in particular) know what type of source it was - are we just assuming based on file extension, or would the favourites file have a tag/indicator of type?

If it was an xml file, then this would be trivial to list the contents (directory class) but some extra stuff (specific to what filetype it is) would need to be added. I'm also thinking about this, as I've done a bit of work on getting "Set Thumb" as a global option. The tricky bit is getting it to work correctly for the various different types of media, which use different thumb caching/finding routines.

Any ideas?

Cheers,
Jonathan

kraqh3d
2007-01-10, 02:09
i had assumed the filetype would determine which thumb system to use for the item. the only filetypes which are duplicated between windows are playlists which should only inherit an image from a matching tbn. and when "adding to favorites", xbmc would force finding a thumb if one wasnt already present to populate the cache.

but you are probably right in that there's likely some generally unused field in the fileitem class that we could use to store the media type, which would make this even easier.

jmarshall
2007-01-10, 02:54
We have m_contentType now I think that should be able to handle it.

I'll see if I can tidy up my thumbnail setting stuff for at least some of the views and get it committed as a starting point.

Cheers,
Jonathan

kraqh3d
2007-01-10, 03:32
cool... my first thought was another database to store the favorites but using an xml file allows advanced users to more easily manually add items.

jmarshall
2007-01-10, 03:51
Yeah - and it's not likely that they'll have that many. We can easily extend it to a filesystem based approach later if necessary (eg a folder for favourites, with .lnk items in it or something)

stanley87
2007-01-14, 03:08
Maybe a feature so when you are in scripts and have a script highlighted, pressing the black button or another button, brings up a little menu where you can then choose to add this script to the submenu. This would eliminate the cause for editing the submenu.xml file.

Yes?

Stanley87

kraqh3d
2007-01-14, 23:50
If its going to be built into the system, it'll be likely be done as via a Favorites window. It allows more possibilities.