Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031 from .dock_widget_container import DockWidgetContainer
00032 from .plugin_handler import PluginHandler
00033
00034
00035 class PluginHandlerContainer(PluginHandler):
00036
00037 """Handler for creating a container."""
00038
00039 def __init__(self, parent, main_window, instance_id, application_context, container_manager):
00040 super(PluginHandlerContainer, self).__init__(parent, main_window, instance_id, application_context, container_manager)
00041 self.setObjectName('PluginHandlerContainer')
00042 self._container = None
00043
00044 def _load(self):
00045 self._container = DockWidgetContainer(self._container_manager, self._instance_id.serial_number)
00046 self._container.setObjectName(self._instance_id.tidy_str())
00047 title = self.tr('Container')
00048 if self._instance_id.serial_number > 1:
00049 title += ' (%d)' % self._instance_id.serial_number
00050 self._container.setWindowTitle(title)
00051 self._add_dock_widget_to_main_window(self._container)
00052 self._update_title_bar(self._container, True, True)
00053 self._widgets[self._container.main_window] = [self._container, None]
00054 self._container_manager.add_container(self._container)
00055 self._emit_load_completed()
00056
00057 def _shutdown_plugin(self):
00058 self._container_manager.move_container_children_to_parent(self._container)
00059 self._container_manager.remove_container(self._container)
00060 self.emit_shutdown_plugin_completed()
00061
00062 def _unload(self):
00063 self._container.deleteLater()
00064 self._container = None
00065 self._emit_unload_completed()
00066
00067 def _save_settings(self, plugin_settings, instance_settings):
00068 self.emit_save_settings_completed()
00069
00070 def _restore_settings(self, plugin_settings, instance_settings):
00071 self.emit_restore_settings_completed()
00072
00073 def _close_dock_widget(self, dock_widget):
00074 self._emit_close_plugin()