2016-07-30, 23:42
Hello,
I am trying to display context menu (when you press C or right mouse) only on items from database. So I am using conditional visibility.
I.e. under "pictures" i have my database of pictures (Photos) and 2 more thumbs - "Picture Addons" and "Add Pictures...". My goal is to display addon menu only for items from database, not these Kodi buttons.
In addon.xml I have like:
My code checks if the window is Window.IsActive(10002) - pictures and if it has media and if it is Folder... but the MENU is still displayed for "Picture Addons" and "Add Pictures..." - where it is useless because these are not folders or database items.
I tried by checking "Container.FolderPath" , "ListItem.Label " etc checking with "String.IsEqual" etc but nothing seems to work. In Python script, I am able to get ListItem.Label for these items, but not from addon.xml...
Any clue how to prevent my submenu displaying for this 2 items?
Thanx!
D.
I am trying to display context menu (when you press C or right mouse) only on items from database. So I am using conditional visibility.
I.e. under "pictures" i have my database of pictures (Photos) and 2 more thumbs - "Picture Addons" and "Add Pictures...". My goal is to display addon menu only for items from database, not these Kodi buttons.
In addon.xml I have like:
Code:
<extension point="kodi.context.item">
<menu id="kodi.core.main">
<menu>
<label>Main menu</label>
<item library="menu_1.py">
<label>Menu1</label>
<visible>Window.IsActive(10002) + Window.IsMedia + ListItem.IsFolder</visible>
</item>
<item library="menu_2.py">
<label>Menu2</label>
<visible>Window.IsActive(10002) + Window.IsMedia + ListItem.IsFolder</visible>
</item>
</menu>
</menu>
</extension>
My code checks if the window is Window.IsActive(10002) - pictures and if it has media and if it is Folder... but the MENU is still displayed for "Picture Addons" and "Add Pictures..." - where it is useless because these are not folders or database items.
I tried by checking "Container.FolderPath" , "ListItem.Label " etc checking with "String.IsEqual" etc but nothing seems to work. In Python script, I am able to get ListItem.Label for these items, but not from addon.xml...
Any clue how to prevent my submenu displaying for this 2 items?
Thanx!
D.