Access to context menu of DirectoryObject?

As per title, is there anyway for me to add an item to a DirectoryObjects context menu, that will call a specified function?

Context menus are not accessible via the plugin framework anymore. Back in the days of the v1 framework, that was possible but, since v1 is soon to be deprecated and v1 channels don't seem to work with most clients, you should probably ignore it.

What I have done in several plugins instead is to make use of PopupDirectoryObjects.

eg.

def MyMenu():
  oc = ObjectContainer()
  oc.add(PopupDirectoryObject(key=Callback(MyContextMenu, value=value), title=title, ...))
  ...
  return oc

def MyContextMenu(value):
  oc = ObjectContainer()
  oc.add(DirectoryObject(key=MyContextFunction, value=value), title=title, ...)
  ...
  return oc

...

I use that fairly extensively in the Sickbeard and CouchPotato plugins. Feel free to check them out on GitHub.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.