def startEditNode(self, node_id: int): flogging.appLogger.debug('Edit node slot') if self.__executing: flogging.appLogger.debug('Flow is executing, don\'t allow edit') return node: flow.dag.OperationNode = self._operation_dag[node_id] if not self.__editor_widget: flogging.appLogger.debug('Creating new editor') if not node.operation.needsOptions(): msg_noeditor = QMessageBox() msg_noeditor.setWindowTitle(node.operation.name()) msg_noeditor.setInformativeText( '{:s}<hr>This operations require no options.'.format( node.operation.shortDescription())) msg_noeditor.setStandardButtons(QMessageBox.Ok) msg_noeditor.exec_() msg_noeditor.deleteLater() return # Set up editor self.__editor_widget = node.operation.getEditor() self.__editor_node_id = node.uid # Create the central widget and adds options if node.operation.needsOptions(): self.__editor_widget.setUpEditor() configureEditor(self.__editor_widget, node.operation, self._view) node.operation.injectEditor(self.__editor_widget) configureEditorOptions(self.__editor_widget, node.operation) # Connect editor signals to slots which handle accept/reject self.__editor_widget.accept.connect(self.onEditAccept) self.__editor_widget.reject.connect(self.cleanupEditor) # Show editor self.__editor_widget.move(self._view.rect().center()) self.__editor_widget.show() else: flogging.appLogger.debug('Editor already opened {}'.format( type(self.__editor_widget))) # If an editor is currently opened show it, instead of creating a new one self.__editor_widget.activateWindow() self.__editor_widget.raise_()
def with_parent(self): dialog = QMessageBox(self) dialog.deleteLater() dialog.exec_()