New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[addons] extend context menu system #7544
Conversation
fb7e99c
to
9861cf2
Compare
@tamland nice addition, thx! |
|
||
if (StringUtils::IsNaturalNumber(m_label)) | ||
{ | ||
return m_addon->GetString(boost::lexical_cast<int>(m_label.c_str())); |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
wouldn't it make sense to rename the two files instead of delete/add? |
@MartijnKaijser: git automatically detects a rename but only if the content of the files are similar. Once they differ too much they are not detected as renames anymore. Will review this later. |
@phil65 It uses the same visibility conditions as everything else so if something like like that was added to GUIInfoManager it'll be available here too. |
Would it make sense to split the CContextMenuItem into an additional Apart from the minors I've commented on I couldn't spot anything wrong. And thanks for adding backwards compatibility. |
@Montellese Yeah, that's what I originally started with, but it got very messy. |
d647b12
to
5d64d4b
Compare
I've updated the sorting part to simply only sort the two internal menus. That means items in submenus from addons will be kept in the original order, while item in the internal ones will not. (A possible extension is to allow submenus to specify sorting or no sorting). I don't think it makes sense, from a users perspective, to sort the root menu in any other way. |
@mkortstiege Could you do a xcode sync? |
Thanks! |
6d567a8
to
4316062
Compare
jenkins build this please |
4316062
to
b2dfa4e
Compare
jenkins build this please |
[addons] extend context menu system
This extends the context menu functionality as discussed in the original PR, by allowing addons to:
This deprecates the old xml definition. In the new scheme, definition must start with a
<menu id="menu-id">
element which defines menu the following elements should be added to. Addons using the old<item>
can be ported by wrapping it in a<menu id="kodi.core.main">
and moving thelibrary
attribute to the<item>
element.The new preferred way of adding a single top-level menu item is as follows:
Furthermore, menus may contain multiple nested menus an items. Example: creating a sub-menu with two items:
Similar to the two core menus
kodi.core.main
andkodi.core.manage
, menus may be shared or conditionally extend by other addons. For example, if two addons definesusing the same id, the two items will show in the same shared sub-menu.
TODO: VS/xcode files