DialogProgress - different behavior Win vs Linux
#1
Question 
I have some strange behavior differences between my ubuntu 10.1 and win7 10.1 xbmc when showing progress dialogs in my nzbs addon in development.

Code:
addurl = SABNZBD.addurl(nzb, nzbname)
        progressDialog = xbmcgui.DialogProgress()
        progressDialog.create('NZBS', 'Sending request to SABnzbd')
        if "ok" in addurl:
            progressDialog.update(0, 'Request to SABnzbd succeeded', 'waiting for nzb download')
            seconds = 0
            while not SABNZBD.nzo_id(nzbname):
                time.sleep(1)
                seconds += 1
                label = str(seconds) + " seconds"
                progressDialog.update(0, 'Request to SABnzbd succeeded', 'waiting for nzb download', label)

In win7 the dialog will show 4 lines with the seconds "ticking" on the last line. In the ubuntu-10.04 the last line with seconds is covered by a string stating "Huh items 0" just like when loading a new directory.

The real problems happen when I close the dialog and try to create a new directory item, xbmc just hangs with a "Working..." notification. Only kill -9 works and the debug shows nothing after the progressDialog.close() action is done

Code:
...
    progressDialog.close()
    xurl = "%s?mode=%s" % (sys.argv[0],MODE_PLAY)
    item = xbmcgui.ListItem(movieFile[0], iconImage='', thumbnailImage='')
    item.setInfo(type="Video", infoLabels={ "Title": movieFile[0]})
    url = (xurl + "&filepath=" + filepath + "&file=" + urllib.quote_plus(file) + "&folder=" + urllib.quote_plus(folder) +
                "&filename=" + urllib.quote_plus(movieFile[0]) + "&nzoid=" + str(sab_nzo_id) + "&nzoidhistory=" + str(sab_nzo_id_history))
    item.setPath(url)
    isfolder = False
    item.setProperty("IsPlayable", "true")
    cm = []
    if sab_nzo_id_history:
        cm_url_repair = sys.argv[0] + '?' + "mode=repair" + "&nzoidhistory=" + str(sab_nzo_id_history) + "&folder=" + urllib.quote_plus(folder)
        cm.append(("Repair" , "XBMC.RunPlugin(%s)" % (cm_url_repair)))
    cm_url_delete = sys.argv[0] + '?' + "mode=delete" + "&nzoid=" + str(sab_nzo_id) + "&nzoidhistory=" + str(sab_nzo_id_history) + "&folder=" + urllib.quote_plus(folder)
    cm.append(("Delete" , "XBMC.RunPlugin(%s)" % (cm_url_delete)))
    item.addContextMenuItems(cm, replaceItems=True)
    return xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item, isFolder=isfolder)


looking at the python documentation for DialogProgress "*Note, If percent == 0, the progressbar will be hidden." also doesn't seem to be honored.

Anyone got any ideas on what could be wrong and also any pointers to where in the source code on github I could find the latest python documentation/code?
Reply
#2
Realized I had a DialogProgress.close() happening before a DialogProgress.update. Works on windows and crashes linux...

The next problem is the UI part where the dialog shows seconds as described in the code above.
On Win the seconds are shown while on linux the line is covered by "Retrieved 0 items". Seems like its different behavior for loading folders where the linux version shows a progress dialog of items to display while not on windows. Or could it be that the "Retrieved items" dialog gets closed on win and not on linux?
Reply
#3
It could be a timing issue perhaps - if you're running a plugin then XBMC will throw up the progress dialog for ... progress. This is where the "Retrieved 0 items" is coming from.

Depending on the timing (i.e. how fast XBMC throws it up compared to how fast your plugin throws it up) will probably depend on whether XBMC is filling the progress dialog or you are.

Unless you absolutely need the progress dialog up for some reason, there's no need to use it in your plugin.

Cheers,
Jonathan
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#4
The strange thing is the difference between linux and windows.
The intended function is to show the progress of a nzb download and subsequent rars. This takes a while and i think its important to inform the user of the progress. Dont know any other way...
Reply
#5
try using this :
http://passion-xbmc.org/addons/?Page=Vie...gaddonscan
Reply
#6
The issue seems to be ubuntu 10.04 and 10.10. Did a fresh install on a new computer and it works as intended... sigh..
Reply

Logout Mark Read Team Forum Stats Members Help
DialogProgress - different behavior Win vs Linux0