2017-07-12, 10:23
hi
my purpose is to give the user to hint whatever stuff has happened on myaddon but my code is quite "time inconsistent" and asynchronous, sometimes the time between notification is too short sometimes fairly long enough.
easiest way to achive this is to use, xbmcgui.Dialog().notification() but, when the time between 2 different notification is too short, the notifications are queued and spammed to the ui. I want to close the previous dialog whenever new one pops up or some just in time behaviour like that. See below code for simulation.
if you execute the code above, you will see notifications are spammed to the user. Is there any way to achieve this using some trick? Or do i have to create my custom xbmcgui.WindowDailog ?
thanks
my purpose is to give the user to hint whatever stuff has happened on myaddon but my code is quite "time inconsistent" and asynchronous, sometimes the time between notification is too short sometimes fairly long enough.
easiest way to achive this is to use, xbmcgui.Dialog().notification() but, when the time between 2 different notification is too short, the notifications are queued and spammed to the ui. I want to close the previous dialog whenever new one pops up or some just in time behaviour like that. See below code for simulation.
PHP Code:
import xbmc
import xbmcgui
import time
dialog = xbmcgui.Dialog()
for i in range(30):
time.sleep(0.5)
xbmc.executebuiltin('Dialog.Close(10107,true)') # does not close previous notification
xbmc.executebuiltin('Dialog.Close(all,true)') # does not close previous notification
dialog.notification('Test', str(i), sound=False)
if you execute the code above, you will see notifications are spammed to the user. Is there any way to achieve this using some trick? Or do i have to create my custom xbmcgui.WindowDailog ?
thanks