def start(): # See if a client database file has been passed on the command line filepath = None if (len(sys.argv) > 1): f = sys.argv[1] if f.endswith(".zgn"): filepath = f # Initialize graphical interface gui = GuiSync("sync", filepath) # enter event loop gui.run()
def slot_gotProg(prog): if (prog == "setup"): from dbInit import setup setup() return elif (prog == "control"): from guiCP import GuiCP # Initialize graphical interface gui = GuiCP("cp") elif (prog == "edit"): from guiEditor import GuiEditor # Initialize graphical interface gui = GuiEditor("editor") elif (prog == "sync"): from guiSync import GuiSync # See if a client database file has been passed on the command line filepath = None if (len(sys.argv) > 2): f = sys.argv[2] if f.endswith(".zgn"): filepath = f # Initialize graphical interface gui = GuiSync("sync", filepath) elif (prog == "print"): from guiPrint import GuiPrint # Initialize graphical interface gui = GuiPrint("print") elif (prog == "cfged"): from guiConfigEd import GuiConfigEd # Initialize graphical interface gui = GuiConfigEd("cfged") else: return # enter event loop gui.run()
def slot_sync(self, arg): """Synchronize the present database file with the master database. """ if not self.db: warning(_("No database file open")) return self.slot_pupilChanged(-1) # save current report filename = self.db.descriptor self.db.close() if self.syncHandler: self.syncHandler.init(filename) else: self.syncHandler = GuiSync("sync", filename) # The sync dialog needs to be modal! self.syncHandler.run() #When finished: self.slot_open(False)