Opening an information screen
#1
Hello,

is it possible to create a similar screen / window to the what I can open when I click in my video library on "Movie Information"?
I haven't found a viable way yet.

1. Problem:
I added a contextMenuItem, to the corresponding ListItem.
Code:
listitem.addContextMenuItems([('Information', 'ActivateWindow(movieinformation)'),], False)
However, I can't find a way to execute code in my addon.py, since the item only can execute internal XBMC commands. Is there a way to execute my code on click of the button?

2. Problem:
I don't know how to create a Window looking like the move information window, I haven't found any good documentation on this. Is it even possible?

Thanks for any help!
Reply
#2
You were close. What you want is:
Code:
listitem.addContextMenuItems([('Show Information', 'XBMC.Action(Info)',),], False)
Reply
#3
Thanks a lot, but unfortunately it doesn't open anything.

This is my ListItem creation:

Code:
def forgeListItem(game):
    listitem = xbmcgui.ListItem(game.game_name)
    if game.hours_played > 0:
        listitem.setLabel2("Hours played: %d" % game.hours_played)
    if game.artwork_logo[0]:
        file_path_png = game.artwork_logo[0]
        listitem.setIconImage(file_path_png)
        listitem.setThumbnailImage(file_path_png)
    if addon.getSetting("artwork_usefanart") == "true":
        if game.artwork_promo[0]:
            listitem.setProperty("Fanart_Image", game.artwork_promo[0])
    listitem.setInfo("video", {"title": game.game_name, "year": 2009})
    listitem.addContextMenuItems([('Game Information', 'XBMC.Action(Info)',),], False)
    return listitem

I've set some demo info and added the context menu, but it doesn't open the info screen
Reply
#4
Ahhh ok, looks like you need to call xbmcplugin.setContent() so that it knows what version of the info dialog to display. Just call this some time before calling endOfDirectory()

Code:
xbmcplugin.setContent( handle=int( sys.argv[ 1 ] ), content="movies" )
Reply
#5
Hmm. Weird. Doesn't open anything either.
Also there isn't anything in the log.

Edit: Wrong. I've found something weird in the log:

Code:
19:18:57 T:4804   DEBUG: CApplication::ExecuteXBMCAction : Translating RunAddon($INFO[Skin.String(HomeProgramTile1.Path)])
19:18:57 T:4804   DEBUG: CApplication::ExecuteXBMCAction : To RunAddon(plugin.programs.steambmcdev)
Reply

Logout Mark Read Team Forum Stats Members Help
Opening an information screen0