How do I make replaceItems work?
#1
I try the following:
Code:
menuentry = xbmcgui.ListItem(str(track.number).rjust(2, "0") + " " +
                             liststring + " - " + track.title,
                             iconImage=iconimage[0])
menuentry.addContextMenuItems([('Queue item', 'To be replaced'),
                               ('Play item', 'To be replaced'),
                               ('Add to favorites', 'To be replaced'),
                               #('Add-on settings', 'To be replaced'),
                               ('Go to root', 'ActivateWindow(WINDOW_MUSIC)'),
                               ('Settings', 'ActivateWindow(WINDOW_SETTINGS_MENU')],
                             replaceItems=True)
But still I see all items in the context menu - Kodi's default entries as well as mine trying to replace the default entries. Anything I have overseen?[/code]
Reply
#2
Longshot as I am noob: could it be {} instead of () ?

And welcome! :-)
Reply
#3
i think its (), but can you try ending your last tuple with comma?
('Settings', 'ActivateWindow(WINDOW_SETTINGS_MENU'),]
Reply
#4
Torben, thank you. The example in the documentation has round braces () for the tuples and square braces [] for the list. Which one would you try to replace?

yocoldrain, you are right. That's what they did in the example. Still it didn't help me... :/

I also tried in xbmcplugin.addDirectoryItem (that would be the next line) isFolder = True and isFolder = False, but it didn't make a difference.

What else could I try?
Reply
#5
Naah, it was a long shot and in hindsight when reading your first post some more.. not wise.
I wonder if you need to add the items you want to replace? Perhaps with empty "actions"?

Edit: Well not according to the docs: http://mirrors.kodi.tv/docs/python-docs/...tMenuItems

Looks like another bug?
Reply
#6
Information 
I tried 'real' actions, but still it didn't work. And doing that I found a missing brace (after WINDOW_SETTINGS_MENU), but adding it didn't help neither.

'another' bug? Are there more? (Just doing my first steps in add-on developing
Reply
#7
I domt know about the bugs, but I do find alot of "oh that, well thats not possible".
Reply

Logout Mark Read Team Forum Stats Members Help
How do I make replaceItems work?0