close busydialog on ESC
#1
Rainbow 
I want to display busy dialog then do some thing when finished then close the busy dialog.
I do it like this:
PHP Code:
xbmc.executebuiltin('ActivateWindow(busydialog)')
#Do something....
xbmc.executebuiltin('Dialog.Close(busydialog,true)'

That is working but what I want now is that if user presses ESC on busy dialog and I am still doing my stuffs then end the work and animation both.
As it happens normally in xbmc and in any gui application.
How can I do that?

Thanks for help in advance.
Reply
#2
How can we do this in python addon/script?
Reply
#3
If the progress of your
PHP Code:
#Do something.... 
can be measured in a numeric value, then you can use DialogProgress instead. It has a method to determine if it has been closed by a user.
Otherwise, I think, you need to create a Window/WindowDialog instance, then run your
PHP Code:
xbmc.executebuiltin('ActivateWindow(busydialog)')
#Do something....
xbmc.executebuiltin('Dialog.Close(busydialog,true)'
in a separate thread. And the Window/WindowDialog instance needs to signal somehow to your "Do something" thread if ESC has been pressed.
Reply
#4
Thanks for answer, Roman
Reply

Logout Mark Read Team Forum Stats Members Help
close busydialog on ESC0