Beispiel #1
0
 def getConfigData(self, newdb):
     """Prepare a configuration data source.
     Initially the configuration editor is started to ensure that
     the selected file is valid. When this is quitted, the
     resulting file can be used, so long as it was error-free.
     newdb is True when a new database is to be created, otherwise
     the current database is to be updated.
     """
     self.newdb = newdb
     if not self.configEd:
         self.configEd = GuiConfigEd("cfged")
     self.configEd.init()
     self.configEd.run()
     # Now wait until the editor has finished.
     # Actually, I would need the editor to be modal.
     # Maybe an alternative would be to disable the control panel until
     # a done signal is received:
     self.gui.setEnabled(False)
Beispiel #2
0
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()
Beispiel #3
0
def start():
    # Initialize graphical interface
    gui = GuiConfigEd("cfged")

    # enter event loop
    gui.run()