class GuiEditor: """There may be only one instance of this class, because of the slot declarations (in editorView.py and edit.py). At present there is no possibility of closing an editor and reopening it in the same process - the other files would need modifying. """ def __init__(self, appString): self.app = Application(appString) self.settings = self.app.settings self.gui = GuiWidget(self.settings, self.app.clipboard()) # Initialize the colour objects used by the editor coloursInit() self.app.init(self.gui) styleGroup = QtGui.QActionGroup(self.gui) styleGroup.addAction(self.gui.ui.action_styleN) styleGroup.addAction(self.gui.ui.action_styleS) styleGroup.addAction(self.gui.ui.action_styleSR) # Set up the editor gui self.edView = EditorView(self.gui) # Open a database and initialize the editor self.edView.slot_open(force=False) def run(self): if self.edView.db: self.app.run()
def __init__(self, appString): self.app = Application(appString) self.settings = self.app.settings self.gui = GuiWidget(self.settings, self.app.clipboard()) # Initialize the colour objects used by the editor coloursInit() self.app.init(self.gui) styleGroup = QtGui.QActionGroup(self.gui) styleGroup.addAction(self.gui.ui.action_styleN) styleGroup.addAction(self.gui.ui.action_styleS) styleGroup.addAction(self.gui.ui.action_styleSR) # Set up the editor gui self.edView = EditorView(self.gui) # Open a database and initialize the editor self.edView.slot_open(force=False)