PDA

View Full Version : Progress bar in python (no focus)


stanley87
2008-09-17, 10:24
Hi,

For my XinBox script, i would like to start a new thread for checking emails and have it update a progress bar while the user can still do various other things (like you can in XBMC when updating library etc).

Any ideas?

Temhil
2008-09-26, 01:06
Hi stanley87,

First of all, thanks for your script.
Concerning your problem, I have currently working on something similar, except what I wanted to do was download in background but displaying a progress bar to the user without blocking him (as you so xbmcgui dialogprogress block the user while it is open).
I extracted the code from the script I am currently developing and created a module xbmcguiExtension.py which include (for the moment) 2 classes:
- backProgressBar: which is the class in charge of displaying the progress bar on your main window
- guiCtrl which is used by backProgressBar for UI locking/unlocking, that means you will need to use in your UI the locking/unlocking of guiCtrl instead of lock/unlock provided by xbmcgui.

I have also included an example with the to type of progress bar, xbmcgui progressbar and backProgressBar.

It is far to be finished (at list the full module) but for those class, it is pretty completed and look pretty well for me.

The only issue I see, it XBMC (on my XBOX) doesn't like too much to do 2 things at the same time.

Here is the link where to get the library: http://passion-xbmc.org/developpement/xbmcguiextension-une-extension-a-xbmcgui/?action=dlattach;attach=876

If you have any comments or see any ways to improve this library, do not hesitate.

stanley87
2008-09-30, 02:49
Great!
I will give it ago :-D

Nuka1195
2008-09-30, 03:13
maybe i misunderstand?

there is a progressbar control (not a dialog). you can make your own dialog or put it on your main window.

Temhil
2008-09-30, 07:17
Yes, that is the purpose of the script I included.
Mostly you need to create few contol in you window, and pass them as paramter to the class I have written.
After that you need to call on it an update, and that's it. The only thing that is important is to use the other class to lock the UI since the progress bar class will unlock it if necessary.
It is not perfect and can be improve, but it works, but it is a Python module not a xbmclib.
You can try to run the example in order to see what it looks it if you want.

Nuka1195
2008-09-30, 15:11
why don't you just use the progress control? xbmcgui.ControlProgress()

pydocs link in my signature

Temhil
2008-09-30, 16:54
I think it is because I am still pretty with Python and XBMC and I never notice this class before.
Shame on me! I will try it, thanks Nuka1195.

stanley87
2008-10-02, 00:15
ahh, i missed that!
I'll just use that then!
:D