Silent Run - disabling the "Working" prompt
#1
Hello All,

I have a Python script I'm using for active playlist manipulation while the playlist is being executed. Some of this execution requires wait/sleep commands to allow playback for predetermined lengths of time on given files (start at bookmark one, stop at bookmark two).

I've got the script working, but I unfortunately have one "wart" in the result. My Aeon Nox skin is showing me a "working" message/prompt the entire time that the Python script is executing the "sleep" command. it shows the same thing if I apply a loop to check for bookmark status during that time period.

I am not sure if this is skin-specific...I'm thinking it is not.

Does anyone have a Python object/command sequence that will hide the "working" prompt while the Python script is executing?
Reply
#2
This will close the working dialog

Code:
if xbmc.getCondVisibility('Window.IsActive(busydialog)') == 1:
    xbmc.executebuiltin('Dialog.Close(busydialog)')

However, depending upon you code you might have to put it in a while loop and possibly run in a separate thread to your playback thread, or maybe set up a Kodi service that does it all the time, eg

Code:
# service.py
import xbmc
import xbmcgui

while (not xbmc.abortRequested):
    xbmc.sleep(100)
        if xbmc.getCondVisibility('Window.IsActive(busydialog)') == 1:
            xbmc.executebuiltin('Dialog.Close(busydialog)')

And you could add a window property that you set during the running of your script, eg

Code:
# service.py

import xbmc
import xbmcgui

while (not xbmc.abortRequested):
    xbmc.sleep(100)
    if xbmcgui.Window(10000).getProperty('MYSCRIPT_RUNNING') == 'true':
        if xbmc.getCondVisibility('Window.IsActive(busydialog)') == 1:
            xbmc.executebuiltin('Dialog.Close(busydialog)')


# then in your main script

xbmcgui.Window(10000).setProperty('MYSCRIPT_RUNNING', 'true')

# your script

xbmcgui.Window(10000).clearProperty('MYSCRIPT_RUNNING')
Reply
#3
Very nice, didn't know about that command

Could Dialog.Close() also be used to close the 'Opening Stream' dialog box? In urlresolver I would like to return to using a progress bar dialog, but on some OS's this causes a crash due to the original 'Opening Stream' dialog already being open
Reply
#4
(2015-10-08, 15:48)Eldorado Wrote: Very nice, didn't know about that command

Could Dialog.Close() also be used to close the 'Opening Stream' dialog box? In urlresolver I would like to return to using a progress bar dialog, but on some OS's this causes a crash due to the original 'Opening Stream' dialog already being open

Hi mate, fancy meeting you here Smile

That dialog is the progressdialog - so give that a whirl


Failing that, the following will close all dialogs, which will definitely close the 'Opening Stream' dialog for you

Code:
xbmc.executebuiltin('Dialog.Close(all, true)')
Reply
#5
(2015-10-08, 21:37)spoyser Wrote:
(2015-10-08, 15:48)Eldorado Wrote: Very nice, didn't know about that command

Could Dialog.Close() also be used to close the 'Opening Stream' dialog box? In urlresolver I would like to return to using a progress bar dialog, but on some OS's this causes a crash due to the original 'Opening Stream' dialog already being open

Hi mate, fancy meeting you here Smile

That dialog is the progressdialog - so give that a whirl


Failing that, the following will close all dialogs, which will definitely close the 'Opening Stream' dialog for you

Code:
xbmc.executebuiltin('Dialog.Close(all, true)')

Why hello there good sir Smile

Thanks, hopefully this works.. a bit annoying trying to get this to work, though issue only seems to be on Linux, so hopefully have better luck with this one!

Using the 'all' option closes the Kodi default box as well as my own which we try to launch right after this command.. odd behavior
Reply
#6
(2015-10-09, 15:42)Eldorado Wrote:
(2015-10-08, 21:37)spoyser Wrote:
(2015-10-08, 15:48)Eldorado Wrote: Very nice, didn't know about that command

Could Dialog.Close() also be used to close the 'Opening Stream' dialog box? In urlresolver I would like to return to using a progress bar dialog, but on some OS's this causes a crash due to the original 'Opening Stream' dialog already being open

Hi mate, fancy meeting you here Smile

That dialog is the progressdialog - so give that a whirl


Failing that, the following will close all dialogs, which will definitely close the 'Opening Stream' dialog for you

Code:
xbmc.executebuiltin('Dialog.Close(all, true)')

Why hello there good sir Smile

Thanks, hopefully this works.. a bit annoying trying to get this to work, though issue only seems to be on Linux, so hopefully have better luck with this one!

Using the 'all' option closes the Kodi default box as well as my own which we try to launch right after this command.. odd behavior

Have you tried a sleep after the close and before you launch your window?
Reply

Logout Mark Read Team Forum Stats Members Help
Silent Run - disabling the "Working" prompt0