33 from python_qt_binding.QtCore
import qCritical, QEvent, QObject, qWarning, Slot
40 """Handler for directly passing invocations between the framework and one `Plugin` instance.""" 42 def __init__(self, parent, main_window, instance_id,
43 application_context, container_manager, argv):
44 super(PluginHandlerDirect, self).
__init__(
45 parent, main_window, instance_id, application_context, container_manager, argv)
46 self.setObjectName(
'PluginHandlerDirect')
50 def load(self, plugin_provider, callback=None):
52 super(PluginHandlerDirect, self).
load(plugin_provider, callback)
56 if hasattr(self.
_plugin,
'has_configuration'):
64 if exception
is None and hasattr(self.
_plugin,
'installEventFilter'):
66 self.
_plugin.installEventFilter(self)
70 if event.type() == QEvent.DeferredDelete:
75 return QObject.eventFilter(self, watched, event)
78 if hasattr(self.
_plugin,
'removeEventFilter'):
79 self.
_plugin.removeEventFilter(self)
81 if hasattr(self.
_plugin,
'deleteLater'):
85 if hasattr(self.
_plugin,
'shutdown_plugin'):
90 'PluginHandlerDirect._shutdown_plugin() plugin "%s" raised an ' 91 'exception:\n%s' % (str(self.
_instance_id), traceback.format_exc()))
105 if hasattr(self.
_plugin,
'save_settings'):
106 plugin_settings_plugin = plugin_settings.get_settings(
'plugin')
107 instance_settings_plugin = instance_settings.get_settings(
'plugin')
112 'PluginHandlerDirect._save_settings() plugin "%s" raised an exception:\n%s' %
117 if hasattr(self.
_plugin,
'restore_settings'):
118 plugin_settings_plugin = plugin_settings.get_settings(
'plugin')
119 instance_settings_plugin = instance_settings.get_settings(
'plugin')
124 'PluginHandlerDirect._restore_settings() plugin "%s" raised an exception:\n%s' %
132 qWarning(
'PluginHandlerDirect.add_widget() widget "%s" already added' %
142 qWarning(
'PluginHandlerDirect.add_toolbar() toolbar "%s" already added' %
143 toolbar.objectName())
def add_toolbar(self, toolbar)
def eventFilter(self, watched, event)
def unload(self, callback=None)
def _emit_close_plugin(self)
def _restore_settings(self, plugin_settings, instance_settings)
def _add_toolbar(self, toolbar)
def emit_shutdown_plugin_completed(self)
_plugin_has_configuration
def _delete_widget(self, widget)
def save_settings(self, plugin_settings, instance_settings, callback=None)
def __init__(self, parent, main_window, instance_id, application_context, container_manager, argv)
def shutdown_plugin(self, callback)
def _emit_load_completed(self, exception=None)
def _save_settings(self, plugin_settings, instance_settings)
def emit_restore_settings_completed(self)
def restore_settings(self, plugin_settings, instance_settings, callback=None)
def _shutdown_plugin(self)
def _emit_unload_completed(self)
def _update_title_bars(self)
def _emit_load_completed(self, exception=None)
def load(self, plugin_provider, callback=None)
def _emit_reload_signal(self)
def _create_dock_widget(self)
def emit_save_settings_completed(self)
def add_widget(self, widget)
def _add_dock_widget(self, dock_widget, widget)