2010-10-05, 16:52
I have the following test addon:
When I go into it it lists one item "The test option" just as I'd expect. However when I select the test option it does not update the list. It does display the dialog, so I know it correctly parsed the argument, "test", and executed the code:
but the list displayed didn't change i.e. it didn't show "You selected the test option". Do I have to do something to reset the list once I've entered the plugin so I can update it?
JR
Code:
import xbmcplugin
import xbmcgui
_thisPlugin = int(sys.argv[1])
_thisPluginName = "plugin.script.test"
cmd = sys.argv[2].replace("?", "")
if cmd == "test":
xbmcgui.Dialog().ok("Test", "You selected the test option")
listItem = xbmcgui.ListItem("You selected the test option")
xbmcplugin.addDirectoryItem(_thisPlugin,"plugin://plugin.script.test", listItem)
else:
listItem = xbmcgui.ListItem("The test option")
xbmcplugin.addDirectoryItem(_thisPlugin,"plugin://plugin.script.test?test", listItem)
xbmcplugin.endOfDirectory(_thisPlugin)
When I go into it it lists one item "The test option" just as I'd expect. However when I select the test option it does not update the list. It does display the dialog, so I know it correctly parsed the argument, "test", and executed the code:
Code:
listItem = xbmcgui.ListItem("You selected the test option")
xbmcplugin.addDirectoryItem(_thisPlugin,"plugin://plugin.script.test", listItem)
but the list displayed didn't change i.e. it didn't show "You selected the test option". Do I have to do something to reset the list once I've entered the plugin so I can update it?
JR