Hi,
Is it possible to remove context menu items such as 'Go to root' within a plugin?
f3ar007
Remove ContextMenuItems?
f3ar007
Member Posts: 57 Joined: Apr 2009 Reputation: 0 |
|
| find quote |
rwparris2
Team-XBMC Python Developer Posts: 1,341 Joined: Jan 2008 Reputation: 2 Location: US |
2009-06-02 04:57
Post: #2
Always read the XBMC online-manual, FAQ and search and search the forum before posting. For troubleshooting and bug reporting please read how to submit a proper bug report. If you're interested in writing addons for xbmc, read docs and how-to for plugins and scripts ||| http://code.google.com/p/xbmc-addons/ |
| find quote |
jingai
Skilled Skinner Posts: 888 Joined: Mar 2010 Reputation: 8 |
2012-02-16 20:40
Post: #3
Sorry to dredge up such an old thread, but it seemed an appropriate place to ask this:
Is it possible to remove some, but not all, of the existing context menu items? And if not, is it possible to re-add a default item? Can I get at the built-in string for "Add-on Settings" button for instance so I can re-add it? I could add my own string in strings.xml but I'd rather use the existing one if possible for consistency. -j |
| find quote |
jmarshall
Team-XBMC Developer Posts: 24,570 Joined: Oct 2003 Reputation: 138 |
2012-02-17 00:53
Post: #4
Nope - it's all or nothing.
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. ![]() |
| find quote |
sphere
Posting Freak Joined: Jul 2009 Reputation: 36 Location: Germany |
2012-02-17 13:37
Post: #5
jmarshall Wrote:Nope - it's all or nothing. I also noticed that. Would a feature request (at least re-adding "Add to favourites") have a chance? regards, sphere My GitHub. My Addons: HD-Trailers.net | Shoutcast 2 | Apple Itunes Podcasts | Radio | MyVideo.de | Nasa | The Big Pictures | Collegehumor | WhatTheMovie | 4Players | Wimp.com | HWClips.com | TheHollywoodReporter | XBMC Log Uploader | Rofl.to | MyZen.tv | Dump.com | Disclose.tv | Dokumonster.de | Netzkino.de |
| find quote |
jingai
Skilled Skinner Posts: 888 Joined: Mar 2010 Reputation: 8 |
2012-02-17 16:05
Post: #6
sphere Wrote:I also noticed that. Would a feature request (at least re-adding "Add to favourites") have a chance? Curious about that myself. I basically have a ticket out for this here, but it could probably be worded in a more generic fashion. FWIW, I achieved what I wanted in my own plugin like so: Code: commands.append((xbmc.getLocalizedString(1045), "XBMC.RunPlugin(\""+BASE_URL+"?action=settings\")",))String 1045 is "Add-on settings" and in my action handler for "settings" it calls xbmcplugin.openSettings(). This works, but it'd be nice to be able to add it back using the default handler and without hardcoding the string ID. The thing is, a great majority of the default context menu items really don't apply to most addons. The all-or-nothing approach means most of us are probably going to go for "nothing," and that has the potential to ruin UI consistency between plugins and between the plugin and XBMC itself. -j
(This post was last modified: 2012-02-17 16:07 by jingai.)
|
| find quote |
jmarshall
Team-XBMC Developer Posts: 24,570 Joined: Oct 2003 Reputation: 138 |
2012-02-17 22:47
Post: #7
Agreed that it's not ideal - basically the design of this was never considered in any detail - it was popped in as-is without too much thought to satisfy a particular use case back in the days when we were more carefree about what and how we exposed stuff to python.
![]() Currently how the context menu works is before it's shown we run through and add buttons if they make sense according to the internal rules. I propose we change this so that instead what happens is each view has it's default buttons, and then a routine runs which filters out the ones that don't make sense (and possible adds in some extras). This could then be done by the plugin if the plugin wishes to do so. XBMC then displays the menu. If it's a plugin-specific action, it calls back into the plugin to do it's thing (as is done already). We "just" have to determine a suitable manner to do this (we probably need a nicer way to pass stuff from XBMC to the plugin - using a single string URL is really nasty). 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. ![]() |
| find quote |
jingai
Skilled Skinner Posts: 888 Joined: Mar 2010 Reputation: 8 |
2012-02-18 21:16
Post: #8
jmarshall Wrote:Agreed that it's not ideal - basically the design of this was never considered in any detail - it was popped in as-is without too much thought to satisfy a particular use case back in the days when we were more carefree about what and how we exposed stuff to python. Certainly not trying to complain too much. UI consistency is, IMHO, a big thing though. Addons have gained so much in popularity that anything we can do to make them feel like an integral part of XBMC is a good thing. jmarshall Wrote:Currently how the context menu works is before it's shown we run through and add buttons if they make sense according to the internal rules. I propose we change this so that instead what happens is each view has it's default buttons, and then a routine runs which filters out the ones that don't make sense (and possible adds in some extras). This could then be done by the plugin if the plugin wishes to do so. Calling back to the plugin with a single-string URL is a bit ugly, but it's not a show-stopper at the moment I don't think. I'm not entirely sure how the filter should work, though. I suppose it could be as simple as a bit mask with some constants defined (e.g., CONTEXT_MENU_SLIDESHOW)? Seems like the easy way to do it anyway, but you know more about the internals than I do ![]() -j |
| find quote |
jingai
Skilled Skinner Posts: 888 Joined: Mar 2010 Reputation: 8 |
2012-03-04 05:02
Post: #9
How can I currently recreate the "Picture information" (string id 13406) and "Start slideshow here" (string id 13422) context menu items from within my plugin?
-j |
| find quote |
jingai
Skilled Skinner Posts: 888 Joined: Mar 2010 Reputation: 8 |
2012-03-10 00:28
Post: #10
I managed to somewhat recreate the "Start slideshow from here" context menu item with:
Code: commands.append((xbmc.getLocalizedString(13422), "XBMC.SendClick(6)",))That works, but doesn't start it from "here;" instead, it starts it from the first image in the current list. As for "Picture information," I'm still clueless how to get at this via an add-on. Is there a way to access or reproduce these two functions from within an add-on? -j |
| find quote |

![[Image: badge.gif]](http://www.ohloh.net/projects/9132/badge.gif)

Search
Help