Quote:
Originally Posted by kovidgoyal
Easiest way is to store your actions in a dict in your plugin keyed by the unique name.
|
Hi, Kovid.
Thanks for the reply.
But how would I call them? I don't see anything callable.
Here is a real example:
Plugin name: Skoob Sync
Modules: main.py, ui.py.
In the ui.py, we have a lot of actions created. Like this:
Code:
# Add/remove books
self.add_to_skoob = cm(self.m, _('&Add book'),
image='add_to_skoob.png',
tooltip=_('Add book to Skoob, on Reading shelf'),
triggered=partial(self.tools.update_status, sync_option='add_to_skoob', shelf=None),
unique_name='SkoobSync_Add')
self.remove_from_skoob = cm(self.m, _('&Remove book'),
image='remove_from_skoob.png',
tooltip=_('Remove book from your shelves on Skoob'),
triggered=partial(self.tools.update_status, sync_option='remove_from_skoob', shelf=None),
unique_name='SkoobSync_Remove')
self.m.addSeparator()
Their unique names are: 'SkoobSync_Add' and 'SkoobSync_Remove'.
Now, how would I call them from main.py?