2011-03-24, 10:36
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.
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 " 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
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?
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 " 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?