Exiting Plugin
#1
As I have put loads of directory shortcuts in easynews plugin lets say your 15 pages in deep and you click the shortcut to go back to main menu for people to exit plugin they would have to click back constantly to go back to the start to exit


so i wanted to assign a listed item to click to exit


i have tried this as a function but does not work

Code:
def sys_exit():
    exit=sys.exit()
    return exit


is there another way ?
Reply
#2
Maybe when you go back to the main menu call Container.Update with the replace argument ->
http://wiki.xbmc.org/index.php?title=Lis..._Functions

you would do something like -
Code:
xbmc.executebuiltin("XBMC.Container.Update(path,replace)")
Reply
#3
works like a charm

thank you
Reply
#4
This works well but when exiting the plugin it takes you back out of the video addon listings and to the listing that shows 'Files, Video Add-ons"

Anyone know the path to set to so that when you exit the plugin you are back to video addon listings?
Reply
#5
i know but i refuse to tell you. this is NOT the task of a plugin.
Reply
#6
i found the answer eldorado but i wont post on this site
Reply
#7
heh, just post it.. addons://sources/<type>

Reply
#8
at first i found the keymap for home

Code:
xbmc.executebuiltin("XBMC.ActivateWindow(Home)")

but couldnt get back into plugin unless i went into another plugin then back into mine

instead done this and works great

Code:
def EXIT():
        xbmc.executebuiltin("XBMC.Container.Update(path,replace)")
        xbmc.executebuiltin("XBMC.ActivateWindow(Home)")
Reply
#9
(2012-09-07, 11:54)spiff Wrote: heh, just post it.. addons://sources/<type>

That did the trick Smile

Just wondering why you are against using this method?
Reply
#10
a plugin is a virtual file system entry, not a script. it should do nothing but act like a directory/file. The whole point of the ReplaceListing parameter to endOfDirectory is to solve this problem, i.e., don't push each page as a separate entry in the directory history.
Reply
#11
Hey folks - sorry to dig up an old thread.

My plugin (a music chooser) - needs to exit and drop back to the calling window, which was my script (a music player - basically a windows that controls an external to xbmc audio player).

At the moment, if the user goes 'back' (i.e. backspace) out of the plugin - it goes back to the programs menu, - which is confusing as they then don't know how to get back to the player window - but if they 'exit' out of the plugin (i.e. escape) - it correctly drops back to the calling window.

Any ideas on a good way to fix this??
Addons I wrote &/or maintain:
OzWeather (Australian BOM weather) | Check Previous Episode | Playback Resumer | Unpause Jumpback | XSqueezeDisplay | (Legacy - XSqueeze & XZen)
Sorry, no help w/out a *full debug log*.
Reply
#12
Maybe listen for the action of the back space key?
Reply
#13
How do you listen for an action in a plugin? I thought those were inherited methods from WindowXML? Isn't the plug in just run at display time and by the time you see it, it's already exit-ed?
Addons I wrote &/or maintain:
OzWeather (Australian BOM weather) | Check Previous Episode | Playback Resumer | Unpause Jumpback | XSqueezeDisplay | (Legacy - XSqueeze & XZen)
Sorry, no help w/out a *full debug log*.
Reply
#14
on my phone so I'll have to give you psuedo code

Get the current window id and use it to create a reference to the window. Use that to set it's on action.
Reply
#15
Getting the window id is easy enough but I normally overload the methods in the WindowXML class def - how any hits on how I can do it from just a reference (windowid)?
Addons I wrote &/or maintain:
OzWeather (Australian BOM weather) | Check Previous Episode | Playback Resumer | Unpause Jumpback | XSqueezeDisplay | (Legacy - XSqueeze & XZen)
Sorry, no help w/out a *full debug log*.
Reply

Logout Mark Read Team Forum Stats Members Help
Exiting Plugin0