2013-02-14, 17:50
This post is more about my ideas I had once my PR ( https://github.com/xbmc/xbmc/pull/1654) be merged in, which are related to http://forum.xbmc.org/showthread.php?tid=154474&page=3. Since I can't post there, I will do that here. It's mostly technical stuff going on in the background.
Back when I started work on the context addons stuff I thought about how to clean up the context menu in ordner to make space for new addons. Of course I forgot about it, but "git branch" just reminded me that I started work on it ( 5 LOC's, so nothing to show)
Now to my idea:
Here is as an example of the context items I get on a tv show:
So, there are 2 items I never use (I'm sure everyone has one or two of them).
So my idea was, when working on the context addons, to make an IGUIContextItem interface that gets implemented by the addons items (as done in this PR) and later by the core ones too.
The main benefit (that's related to the above forum thread) would be that we could just show all those core context items in the addon browser alongside the actual python ones and allow the user to disable core items he doesn't want.
(Also moving settings that specify the context menu behaviour into their respective "core" addon-settings and clear up advanced- and Guisettings - given those settings exist, not sure about that)
There are also some other benefits beside that (not directly related to that forum discussion):
Back when I started work on the context addons stuff I thought about how to clean up the context menu in ordner to make space for new addons. Of course I forgot about it, but "git branch" just reminded me that I started work on it ( 5 LOC's, so nothing to show)
Now to my idea:
Here is as an example of the context items I get on a tv show:
- "Queue" - used sometimes
- "Play" - never used, i have an OK Button on my remote
- "Play from here" - used a lot
- "Episode-Information" - !never! used as i have an info button on my remote
- "Mark as unwatched" -rarely used
- "Rename" - rarely used
- "Remove from db" - rarely used
- "Update DB" - used
- "currently playing" - since i used it alot, i mapped it to the screen of my logitech remote, so never used right now.
So, there are 2 items I never use (I'm sure everyone has one or two of them).
So my idea was, when working on the context addons, to make an IGUIContextItem interface that gets implemented by the addons items (as done in this PR) and later by the core ones too.
The main benefit (that's related to the above forum thread) would be that we could just show all those core context items in the addon browser alongside the actual python ones and allow the user to disable core items he doesn't want.
(Also moving settings that specify the context menu behaviour into their respective "core" addon-settings and clear up advanced- and Guisettings - given those settings exist, not sure about that)
There are also some other benefits beside that (not directly related to that forum discussion):
- Remove code duplication
- right now every context item has a (sometimes complicated) if() to decide if it is visible and the same if() again before execution. This duplication could be removed with such a refactor.
- The same context items are implemented differently in different sections (music vs. video). Perhabs we could unify them.
- right now every context item has a (sometimes complicated) if() to decide if it is visible and the same if() again before execution. This duplication could be removed with such a refactor.
- All context items would than be handled by the GUIContextMenuManager. It would then be very easy to expose a json function à la "GetVisibleContextItems". Would be nice for the andoid/ios remotes. instead of openind the context menu on the tv screen (and the need to use the annoying on screen up/down buttons) you could just select the context item you want on your touch device
- This might also help in doing sth about this:
Quote:"5.3 Missing context-Menu commands
from: http://forum.xbmc.org/showthread.php?tid=154805
Plugins can add commands to the context menu. They can also clear all original items while adding new items. But they can't clear and add some original items back because not all are available, e.g. "Add to favourites"."