Fix #8176 (Expose configuration dialog for a plugin via API)

This commit is contained in:
Kovid Goyal 2011-01-06 09:58:54 -07:00
parent 691838b2b2
commit 3e1a531444
2 changed files with 7 additions and 0 deletions

View File

@ -36,6 +36,11 @@ class InterfaceAction(QObject):
self.gui.iactions['Save To Disk'] self.gui.iactions['Save To Disk']
To access the actual plugin, use the :attr:`interface_action_base_plugin`
attribute, this attribute only becomes available after the plugin has been
initialized. Useful if you want to use methods from the plugin class like
do_user_config().
The QAction specified by :attr:`action_spec` is automatically create and The QAction specified by :attr:`action_spec` is automatically create and
made available as ``self.qaction``. made available as ``self.qaction``.
@ -83,6 +88,7 @@ class InterfaceAction(QObject):
self.setObjectName(self.name) self.setObjectName(self.name)
self.gui = parent self.gui = parent
self.site_customization = site_customization self.site_customization = site_customization
self.interface_action_base_plugin = None
def do_genesis(self): def do_genesis(self):
self.Dispatcher = partial(Dispatcher, parent=self) self.Dispatcher = partial(Dispatcher, parent=self)

View File

@ -105,6 +105,7 @@ class Main(MainWindow, MainWindowMixin, DeviceMixin, EmailMixin, # {{{
for action in interface_actions(): for action in interface_actions():
ac = action.load_actual_plugin(self) ac = action.load_actual_plugin(self)
ac.plugin_path = action.plugin_path ac.plugin_path = action.plugin_path
ac.interface_action_base_plugin = action
if ac.name in acmap: if ac.name in acmap:
if ac.priority >= acmap[ac.name].priority: if ac.priority >= acmap[ac.name].priority:
acmap[ac.name] = ac acmap[ac.name] = ac