WIP Busy spinner on script load
#1
Exclamation 
Hello,

I've a script plugin that takes some times to be loaded.

I would like to have a busy spinner for example the busydialog.xml to be displayed before the load of the plugin.

I've tried with these xml

PHP Code:
<onclick>ActivateWindow(8018)</onclick>
<
onclick>RunScript("script.quasar.shop",13)</onclick

so first I open the busy spinner with the id 8018 and after I call the script.
All works well but unfortunately when I close the script and his window I'm not able to close the window 8018.


For example with:

PHP Code:
def onInit(self):
        
        
addon_log(self._debug'onInit')
        
self.setFocus(self.getControl(9103))
        
xbmc.executebuiltin("Dialog.Close(8018)"

from inside the python script


Obviously I could not open the window 8018 from inside script because it have the same delay of the script itself.

Is there a better way to have a sort of visible preloader?
The problem arises on raspberry PI because of the low resources of the system, on my desktop I do not need a preloader.


Thanks for the help

Paolo
IPTV/digital signage Software developer

www.mattiolopaolo.com
in3aqk.blogspot.it
Reply
#2
It's strange that no one has suggestions on this argument
IPTV/digital signage Software developer

www.mattiolopaolo.com
in3aqk.blogspot.it
Reply
#3
start and stop the busydialog inside the script with

Code:
xbmc.executebuiltin("ActivateWindow(busydialog)")

... do the stuff which takes time

xbmc.executebuiltin("Dialog.Close(busydialog)")



works here.
Donate: https://kodi.tv/contribute/donate (foundation), 146Gr48FqHM7TPB9q33HHv6uWpgQqdz1yk (BTC personal)
Estuary: Kodis new default skin - ExtendedInfo Script - KodiDevKit
Reply
#4
Thanks Phil for the suggestion, but this solution does not work for me.
Mi problem is the load time of the script itself.
In a skin menu I've a call to open the script script.quasar.shop.

PHP Code:
<onclick>RunScript("script.quasar.shop",13)</onclick


The script takes 6 second to load on the first load, and about 2 seconds to load when I activate it again.
This appens only on Raspberry PI, on my desktop the script loads immediately.

A should develop a solution that shows a spinner in those 6 / 2 seconds.
Obviously this solution could non be put inside the script itself.


(2014-09-26, 23:38)phil65 Wrote: start and stop the busydialog inside the script with

Code:
xbmc.executebuiltin("ActivateWindow(busydialog)")

... do the stuff which takes time

xbmc.executebuiltin("Dialog.Close(busydialog)")



works here.
IPTV/digital signage Software developer

www.mattiolopaolo.com
in3aqk.blogspot.it
Reply
#5
Could someone help me on this problem?
IPTV/digital signage Software developer

www.mattiolopaolo.com
in3aqk.blogspot.it
Reply
#6
Is all your code in default.py? default.py gets compiled on every launch.
If default.py imports other python modules they get compiled to a .pyc (or .pyo) just once, so only the first load is slow and futures loads are faster.

So, for faster launching make default.py as small as possible and put all the python code in an imported file.
Reply
#7
Many thanks popcornmix for the suggestion, a was not aware of this behaviour of the kodi/python scripts.
I'll try immediately this solution.

Ciao Paolo
IPTV/digital signage Software developer

www.mattiolopaolo.com
in3aqk.blogspot.it
Reply

Logout Mark Read Team Forum Stats Members Help
Busy spinner on script load1