How to call plugin settings menu?

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
BigBellyBilly Offline
Skilled Python Coder
Posts: 900
Joined: Feb 2005
Reputation: 2
Location: UK
Post: #1
Is there a way to manually calling a Plugins settings menu, as thou it was selected it from the contextmenu 'Plugin settings'

xbmc window name of contextmenu calling DialogContextMenu.xml

Calling the following pulls up an empty dialog:

Code:
xbmc.executebuiltin("xbmc.ActivateWindow(contextmenu,%s)" % sys.argv[0])

Why? Well incase some essential setting (such as username/password) is incomplete (ie first run) and I'd like the settings menu to be shown and completed before cotinuing with normal Plugin processing.

Can it be done?

thanks
BBB

My Addons (myTV, T3CH Upgrader, DVDProfiler, BBCPodRadio, Comics, Football, GoogleReader, reeplay.it, Metacritic, Phonebin, FileViewer,SVN Repo Installer (contributor)) available at Box.net
find quote
spiff Offline
Retired Developer
Posts: 12,386
Joined: Nov 2003
Post: #2
no, but this surely makes sense.

i did up a diff in the blind, monitor progress @ trac ticket #5904
find quote
BigBellyBilly Offline
Skilled Python Coder
Posts: 900
Joined: Feb 2005
Reputation: 2
Location: UK
Post: #3
I come up with a work around, that is:

Plugin starts and if essential settings check fails, show an OK dialog asking user to select Plugin Settings from the context menu.

It then exits back to the Video Plugins page.

From there the user can highlight the Plugin which enables the ContextMenu / Plugin Settings option - I didnt realise this was available outside of the Plugin running.


So, that seems to work, but it would still be nice to do what my orig post questioned.

cheers
BBB

My Addons (myTV, T3CH Upgrader, DVDProfiler, BBCPodRadio, Comics, Football, GoogleReader, reeplay.it, Metacritic, Phonebin, FileViewer,SVN Repo Installer (contributor)) available at Box.net
find quote
Nuka1195 Offline
Skilled Python Coder
Posts: 3,910
Joined: Dec 2004
Reputation: 18
Post: #4
http://trac.xbmc.org/ticket/5905

edit: damn spiff your fast. i thought a python method would be better.

OT: can you look at some of the other tickets i posted and comment?

For python coding questions first see http://mirrors.xbmc.org/docs/python-docs/
(This post was last modified: 2009-02-12 17:47 by Nuka1195.)
find quote
spiff Offline
Retired Developer
Posts: 12,386
Joined: Nov 2003
Post: #5
sure nuka, sorry, don't be put off by the long response time i'm just knee deep in work these days. so i do things in the blind while waiting for computations Wink
find quote
BigBellyBilly Offline
Skilled Python Coder
Posts: 900
Joined: Feb 2005
Reputation: 2
Location: UK
Post: #6
so we now have two approaches:

1) spiffs new builtin 'showpluginsettings'
- Do we have to pass a filename to this or does it discover the settings.xml itself?

2) nuka's new Plugin func xbmcplugin.openSettings(sys.argv[0])
- This finds settings.xml - presumably this is the preferred call?

thanks for such quick mods.

My Addons (myTV, T3CH Upgrader, DVDProfiler, BBCPodRadio, Comics, Football, GoogleReader, reeplay.it, Metacritic, Phonebin, FileViewer,SVN Repo Installer (contributor)) available at Box.net
find quote
spiff Offline
Retired Developer
Posts: 12,386
Joined: Nov 2003
Post: #7
nuka's is most handy for your particular use.
mine is more general in nature, i.e. it is callable outside plugins (but thus needs to be passed a path ala
Quote:showpluginsettings(plugin://video/foobar/)

if nobody comes up with a scenario where this generality would be handy, i'd go with nuka's diff
find quote
rwparris2 Offline
Team-XBMC Python Developer
Posts: 1,333
Joined: Jan 2008
Reputation: 2
Location: US
Post: #8
spiff Wrote:nuka's is most handy for your particular use.
mine is more general in nature, i.e. it is callable outside plugins (but thus needs to be passed a path ala

if nobody comes up with a scenario where this generality would be handy, i'd go with nuka's diff

if there is ever built-in manager for addons (as in something in c++, instead of a seperate script), it would be convenient to be able to mess with the settings from inside of said manager.
If this is done though it would make sense to be more generalized to grab skin and scripts (if it ever gets it) settings as well.

that said, I'd prefer Nuka's solution for the question at hand

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
Nuka1195 Offline
Skilled Python Coder
Posts: 3,910
Joined: Dec 2004
Reputation: 18
Post: #9
both, no reason not to have both.

edit: i have mine needing a passed path also. will look into not needing that. just ass u me d it needed to be like that.

For python coding questions first see http://mirrors.xbmc.org/docs/python-docs/
find quote
Nuka1195 Offline
Skilled Python Coder
Posts: 3,910
Joined: Dec 2004
Reputation: 18
Post: #10
@spiff, are you getting the trac emails? both patches are done and work.

For python coding questions first see http://mirrors.xbmc.org/docs/python-docs/
find quote
Nuka1195 Offline
Skilled Python Coder
Posts: 3,910
Joined: Dec 2004
Reputation: 18
Post: #11
bump, not sure if you want to name it showSettings() to match yours or not.

For python coding questions first see http://mirrors.xbmc.org/docs/python-docs/
find quote
Nuka1195 Offline
Skilled Python Coder
Posts: 3,910
Joined: Dec 2004
Reputation: 18
Post: #12
bueller? bueller? bueller?

For python coding questions first see http://mirrors.xbmc.org/docs/python-docs/
find quote
spiff Offline
Retired Developer
Posts: 12,386
Joined: Nov 2003
Post: #13
now in svn. sorry for the delay, but as i explained i'm buried in work these days
find quote
Nuka1195 Offline
Skilled Python Coder
Posts: 3,910
Joined: Dec 2004
Reputation: 18
Post: #14
thanks, i should have put a smiley Smile was just teasing.

about the other 9504, i'm trying to think if you use the weather patch. maybe putting them under plugin://weather/. would your version be useful for calling weather settings from the skin?

we really could use script settings, which i may work on later.

For python coding questions first see http://mirrors.xbmc.org/docs/python-docs/
find quote
spiff Offline
Retired Developer
Posts: 12,386
Joined: Nov 2003
Post: #15
yes, my version would mean plugin settings from skin
find quote
Post Reply