Accessing ListItem Info from ContextMenu
#1
From MyVideoNav.xml when bringing up the context menu on a List Item I can return any of the Info Labels with out any problems eg ListItem.DBTYPE and ListItem.DBID

However from a List control on the Homepage Home.xml when bringing up the context menu all the ListItem Info Labels are empty Sad

Is this a bug? Is there a way to get the Info Labels?
Reply
#2
Its because Home uses dynamic content containers as opposed to the fixed folderpath of a Library window which makes the focused listitem properties available to dialogs. It's the same reason why you can't use things like Container.Content() or Container.PluginCategory on the Home screen.

There's no way to get the labels from the skin side unless you set them to window properties first.
Reply
#3
Quote:Its because Home uses dynamic content containers as opposed to the fixed folderpath of a Library window which makes the focused listitem properties available to dialogs.

In that case then why can I call DialogVideoInfo.xml from a list item on the home page and all the info labels are available?
Reply
#4
(2020-05-02, 20:50)roidy Wrote: From MyVideoNav.xml when bringing up the context menu on a List Item I can return any of the Info Labels with out any problems eg ListItem.DBTYPE and ListItem.DBID

However from a List control on the Homepage Home.xml when bringing up the context menu all the ListItem Info Labels are empty Sad

Is this a bug? Is there a way to get the Info Labels?

What are you trying to achieve/do within the contextual Menu from Home Window ?
Skins                                                                                        
Reply
#5
I'm trying to add an Artwork Beef context menu item for home screen widget list items using:-

Code:
RunScript(script.artwork.beef, mode=gui, mediatype=$INFO[ListItem.DBTYPE], dbid=$INFO[ListItem.DBID]) 

So I need DBID and DBTYPE for the list item, but list item info labels don't get passed to DialogContextMenu.xml from the home screen.
Reply
#6
(2020-05-03, 09:24)roidy Wrote: I'm trying to add an Artwork Beef context menu item for home screen widget list items using:-

Code:
RunScript(script.artwork.beef, mode=gui, mediatype=$INFO[ListItem.DBTYPE], dbid=$INFO[ListItem.DBID]) 

So I need DBID and DBTYPE for the list item, but list item info labels don't get passed to DialogContextMenu.xml from the home screen.
Ah., OK . Than i think best method is using Jurialmonkey's Approach (set property to fetch infolabels, to use them elsewhere)


Or if you didnt like set Custom Props, you can try to set an 'onclick action chain' in for your custom contextualmenu button

e.g.
<oncklick>dialog.close</onclick>
<oncklick>set.focus(?)</onclick>
<oncklick>run.script(?)</onclick> - may within Alarm clock
Skins                                                                                        
Reply
#7
Create a context menu addon, example:
https://github.com/sualfred/context.embu...r/addon.py

Another approach is:
https://github.com/sualfred/script.metad...context.py

The listitem information is stored in sys once you are in the context menu.
Code:

    listitem = sys.listitem.getVideoInfoTag()
    dbid = listitem.getDbId()
    dbtype = listitem.getMediaType()

Once you have a dbid and dbtype you can call the DB for everything
Embuary | Skin | Helper | Info | Repo | GitHub
Reply
#8
@sualfred  @mardukL  Thanks guys, I'll have a play around with both methods.
Reply
#9
(2020-05-03, 08:39)roidy Wrote:
Quote:Its because Home uses dynamic content containers as opposed to the fixed folderpath of a Library window which makes the focused listitem properties available to dialogs.

In that case then why can I call DialogVideoInfo.xml from a list item on the home page and all the info labels are available?
Info dialog has special code handling to repopulate the labels when called from a dynamic list to mimic the mynav window environment.

Originally you couldn't use info dialog on widget items at all. That's only been possible since v16

You used to have to mimic the info dialog by making a fake dialog as a hidden group on home screen and then set a property oninfo to unhide it. And shortly before that, you couldn't even use oninfo - it had to be something like onup.
Reply
#10
Thanks for the explanation.
Reply
 
Thread Rating:
  • 0 Vote(s) - 0 Average



Logout Mark Read Team Forum Stats Members Help
Accessing ListItem Info from ContextMenu00
This forum uses Lukasz Tkacz MyBB addons.