2011-11-18, 17:55
Sorry for being absent, but some one at the company decided that "sure we can build a fully redundant 2-factor authentication solution with fail-over between Europe, US, and Asia, and we can do it within a month. Unfortunately the software that was decided upon did not support "virtualization" and no one had taken into account the added security that must be in place for such a service, so I have been working between 50 and 70 hours a week since I disappeared, and I don't see much (if any) time to work on the resolver this year or Q1 next year.
Favorite branch:
This was originally thought of as being an easy way to add favorites / delete favorites etc, and not a full manipulation of the contextmenu. In hind sight it might have been better to have made it more flexible.
newlist definition:
This should properly have been called some thing different, now that you mention it, I can see how confusing the naming is. It's not the contextmenu list it refers to, but the items currently being shown on the xbmc screen (such as movies / songs).
True = Execute code and update the list of movies / songs shown on the screen
False = Execute code but do not update of the list shown on the page
You are right, it's not possible in the current code to call other XBMC.functions than the Container.Update and XBMC.RunPlugin. For the favorites the Container.Update is used when a favorite is deleted, and RunPlugin is used when they are being added.
Yes you are right it should be added to any directory or video/music item.
I hope this have given you some of the answers you were looking for. Again as I mentioned before this is the first time I actually have coded any thing in python, so I'm fairly sure the code can be optimized / simplified.
Eldorado Wrote:Well I took a look in Dragonwin's context menu stuff, and I have questions.. hopefully he shows up again!
I'm probably not going to be able to explain this properly.. but I'll give it a go
In his helper function used to create a contextmenu list object, what is done limits what kind of menu items you can create, I'm also confused on the purpose of 'newlist'
If newlist=True then you are creating a menu item with a function of 'XBMC.Container.Update' ... I'm not sure what this does or the use, I assumed it refreshed your current list (?)
If newlist=False then you create one with a xbmc.RunPlugin which so far for me is the most common type I've been using... eg. calling mine or another addon with a set of query strings (see my test meta addon how I do meta refresh and watched status)
Going in I would have assumed that newlist meant that the menu items will replace the standard menu items xbmc gives... but doesn't seem to be the case and I don't see a way in his code to turn that option on - very good chance that I'm missing something
Favorite branch:
This was originally thought of as being an easy way to add favorites / delete favorites etc, and not a full manipulation of the contextmenu. In hind sight it might have been better to have made it more flexible.
newlist definition:
This should properly have been called some thing different, now that you mention it, I can see how confusing the naming is. It's not the contextmenu list it refers to, but the items currently being shown on the xbmc screen (such as movies / songs).
True = Execute code and update the list of movies / songs shown on the screen
False = Execute code but do not update of the list shown on the page
Eldorado Wrote:To replace the context menu you do this:
Code:listitem.addContextMenuItems(contextmenuobj, replaceItems=True)
But.. what if I want to do a different function that is not XBMC.RunPluggin or xbmc.Container.Update? Doesn't look like I can..
eg. In Icefilms to add an item to display the Info screen:
Code:contextMenuItems.append(('Show Information', 'XBMC.Action(Info)'))
You are right, it's not possible in the current code to call other XBMC.functions than the Container.Update and XBMC.RunPlugin. For the favorites the Container.Update is used when a favorite is deleted, and RunPlugin is used when they are being added.
Eldorado Wrote:So.. it would be nice if Dragonwin could come back to help out on this, if not then I think it might be best to drop the helper function and just let a list item get passed into add_directory() and add_video_item() along with a boolean for replaceitems
Contextmenu support should be on any directory or video/music item
eg.
Code:def add_directory(self, queries, title, img='', fanart='',
total_items=0, is_folder=True, contextmenuobj='', contextreplace=False):
...
...
if contextmenuobj:
listitem.addContextMenuItems(contextmenuobj, replaceItems=contextreplace)
Yes you are right it should be added to any directory or video/music item.
I hope this have given you some of the answers you were looking for. Again as I mentioned before this is the first time I actually have coded any thing in python, so I'm fairly sure the code can be optimized / simplified.