def __init__(self, manager=None, parent=None): AbstractListener.__init__(self) Splitter.__init__(self, parent=parent) if manager is None: self._manager = ControlManager() else: self._manager = manager self.model = ControlModel(self._manager) self.view = ControlView() self.view.setModel(self.model) self.view.controlsSelected.connect(self.on_controls_selected) self.model.rowsInserted.connect(self.view.onRowsInserted) self.addWidget(self.view) self._i = 1 self._index = None self._widget_edit = None
def properties(self): dic = Splitter.properties(self) dic['applets'] = self._applets.keys() return dic
def set_properties(self, properties): applets = properties.get('applets', []) for name in applets: self.add_applet(name) # applet have to be loaded before to restore state Splitter.set_properties(self, properties)
def menu_actions(self): actions = Splitter.menu_actions(self) actions.append(self._action_add_applet) return actions
def __init__(self): Splitter.__init__(self) self._applets = {} self._action_add_applet = QtGui.QAction('Add applet', self) self._action_add_applet.triggered.connect(self._on_add_applet_triggered)