-
Notifications
You must be signed in to change notification settings - Fork 15
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
Favorites #9
Open
DragonWin
wants to merge
8
commits into
t0mm0:master
Choose a base branch
from
DragonWin:Favorites
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Favorites #9
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
lets you create a context menu by creating an object that you can use with add_video_item, add_item, add_music_item, to have extra menu's show when a user right clicks on a directory or a movie / song. args: menuname (str): The name that will be shown in your menu scriptargs (str): a list of arguments will be passed back to the addon in sys.argv[2] the form of: mode=mymode&type=53&displaylist=1 kwargs: newlist (Bol): Default False, If you want to replace the current movie / dir list shown on the screen set this to True. If you only want the user to stay on the same screen, set this to False or omit. contextmenuobj (tuple): is an existing object that has already been returned by this function. Passing the existing tuple, will stack the menu's you create, allowing you to create multiple menu items. Returns: a tuple conforming to the listitem.addContextMenuItems() Modified add_item, add_video_item, add_music_item, add_dir to handle the context item.
New functions are: create_favorite, save_favorite, del_favorite, show_favorites, dict_to_string, string_to_dict, create_contextmenu
… to MenuContext class, and adjusted code and documentation. There is still a few issues: cm = ContextMenu(addon.url) should be cm = ContextMenu(addon) Find a way around parsing the ContextMenu obj to addon.show_favorite(cm) Find a way not to pass a query string around base64 encrypted to avoid clashes with existing args. Need to remvoe a few # comments in the code.
…code it. Changed init to receive the addon object instead of the addon.url
Removed debug printing
…cm module to be passed to it. Moved the cotext and add_dir / add_item to the addon instead of t0mm0.common.addon
Fixed an urlencode failure in common.addon where it would fail if the content were unicode.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is the first attempt at making the menu-contexts available to the addon coder. It is fully documented with the changes, and the test addon has been updated to reflect the new functionality.
Feedback is appreciated.