class GuiSync(): """There may be only one instance of this class, because of the slot declarations. """ def __init__(self, appString, filepath=None): self.app = Application(appString) self.settings = self.app.settings slot("%s-closeMainWindow" % appString, self.slot_tidy) self.sp = SyncPanel(self.settings) self.init(filepath) def init(self, filepath=None): self.gui = GuiWidget(self.settings) self.app.init(self.gui) self.sp.init(self.gui, filepath) def run(self): if self.sp and self.sp.filepath: #self.app.run() self.gui.exec_() def slot_tidy(self, arg): """Stuff to do when the program quits """ if self.sp: self.sp.disconnect() self.sp.closeFile()
def __init__(self, appString, filepath=None): self.app = Application(appString) self.settings = self.app.settings slot("%s-closeMainWindow" % appString, self.slot_tidy) self.sp = SyncPanel(self.settings) self.init(filepath)