Kodi Community Forum
Exiting Plugin - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32)
+--- Forum: Add-ons (https://forum.kodi.tv/forumdisplay.php?fid=26)
+--- Thread: Exiting Plugin (/showthread.php?tid=139813)

Pages: 1 2


Exiting Plugin - mikey1234 - 2012-09-05

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 ?


RE: Exiting Plugin - divingmule - 2012-09-05

Maybe when you go back to the main menu call Container.Update with the replace argument ->
http://wiki.xbmc.org/index.php?title=List_of_Built_In_Functions

you would do something like -
Code:
xbmc.executebuiltin("XBMC.Container.Update(path,replace)")



RE: Exiting Plugin - mikey1234 - 2012-09-05

works like a charm

thank you


RE: Exiting Plugin - Eldorado - 2012-09-06

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?



RE: Exiting Plugin - spiff - 2012-09-06

i know but i refuse to tell you. this is NOT the task of a plugin.


RE: Exiting Plugin - mikey1234 - 2012-09-07

i found the answer eldorado but i wont post on this site


RE: Exiting Plugin - spiff - 2012-09-07

heh, just post it.. addons://sources/<type>




RE: Exiting Plugin - mikey1234 - 2012-09-07

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)")



RE: Exiting Plugin - Eldorado - 2012-09-07

(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?


RE: Exiting Plugin - spiff - 2012-09-07

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.


RE: Exiting Plugin - bossanova808 - 2013-03-19

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??


RE: Exiting Plugin - Bstrdsmkr - 2013-03-19

Maybe listen for the action of the back space key?


RE: Exiting Plugin - bossanova808 - 2013-03-19

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?


RE: Exiting Plugin - Bstrdsmkr - 2013-03-19

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.


RE: Exiting Plugin - bossanova808 - 2013-03-20

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)?