コード例 #1
0
ファイル: guiCP.py プロジェクト: bopopescu/zeugs-svn
    def __init__(self, appString):
        self.app = Application(appString)
        self.settings = self.app.settings
        slot("%s-closeMainWindow" % appString, self.slot_tidy)
        self.cp = ControlPanel(self.settings)

        self.init()
コード例 #2
0
ファイル: guiEditor.py プロジェクト: bopopescu/zeugs-svn
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()
コード例 #3
0
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()
コード例 #4
0
class GuiPrint():
    """There may be only one instance of this class, because of the
    slot declarations.
    """
    def __init__(self, appString, file=None):
        self.app = Application(appString)
        self.settings = self.app.settings

        slot("%s-closeMainWindow" % appString, self.slot_tidy)

        # Prepare the print handler
        self.pView = PrintView()

        self.init(file)

    def init(self, file):
        """Subsequent invocations of the print application start by
        reinitializing the print handler here.
        """
        self.gui = GuiWidget(self.settings)
        self.app.init(self.gui)

        # Set up the print gui
        self.pView.init(self.gui, file)

    def run(self):
        self.app.run()

    def slot_tidy(self, arg):
        """Stuff to do when the program quits
        """
        if self.pView.printer:
            self.pView.printer.abort()
コード例 #5
0
class GuiPrint():
    """There may be only one instance of this class, because of the
    slot declarations.
    """
    def __init__(self, appString, file=None):
        self.app = Application(appString)
        self.settings = self.app.settings

        slot("%s-closeMainWindow" % appString, self.slot_tidy)

        # Prepare the print handler
        self.pView = PrintView()

        self.init(file)

    def init(self, file):
        """Subsequent invocations of the print application start by
        reinitializing the print handler here.
        """
        self.gui = GuiWidget(self.settings)
        self.app.init(self.gui)

        # Set up the print gui
        self.pView.init(self.gui, file)

    def run(self):
        self.app.run()

    def slot_tidy(self, arg):
        """Stuff to do when the program quits
        """
        if self.pView.printer:
            self.pView.printer.abort()
コード例 #6
0
ファイル: guiSync.py プロジェクト: BackupTheBerlios/zeugs-svn
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()
コード例 #7
0
ファイル: guiConfigEd.py プロジェクト: bopopescu/zeugs-svn
class GuiConfigEd:
    """There may be only one instance of this class, because of the
    slot declarations.
    """
    def __init__(self, appString):
        self.app = Application(appString)
        self.settings = self.app.settings
        slot("%s-closeMainWindow" % appString, self.slot_tidy)
        self.cfed = ConfigEd(self.settings)

        self.init()

    def init(self):
        self.gui = GuiWidget(self.settings)
        self.gui.show()
        self.app.init(self.gui)
        self.gui.setup()
        self.cfed.init(self.gui)

    def run(self):
        self.app.run()

    def slot_tidy(self, arg):
        """Stuff to do when the program quits
        """
        self.cfed.save()
        signal("ced_done")

    def getSourcePath(self):
        return self.cfed.sourcePath

    def getErrorCount(self):
        return self.cfed.errorCount
コード例 #8
0
ファイル: dbInit.py プロジェクト: BackupTheBerlios/zeugs-svn
def setup():
    # Initialize graphical interface, note that the same settings
    # group as the control panel is used.
    global app, gui
    app = Application("cp")

    gui = GuiDbInit(intro, go)
    app.run()
コード例 #9
0
def setup():
    # Initialize graphical interface, note that the same settings
    # group as the control panel is used.
    global app, gui
    app = Application("cp")

    gui = GuiDbInit(intro, go)
    app.run()
コード例 #10
0
    def __init__(self, appString, user):
        self.app = Application(appString)
        self.settings = self.app.settings

        self.gui = GuiWidget(self.settings)
        #slot("%s-closeMainWindow" % appString, self.slot_tidy)

        self.app.init(self.gui)
        self.gui.init(user)
コード例 #11
0
    def __init__(self, appString, file=None):
        self.app = Application(appString)
        self.settings = self.app.settings

        slot("%s-closeMainWindow" % appString, self.slot_tidy)

        # Prepare the print handler
        self.pView = PrintView()

        self.init(file)
コード例 #12
0
class GuiGetApplication:
    def __init__(self, appString):
        self.app = Application(appString)

        self.settings = self.app.settings
        self.gui = GuiWidget(self.settings)

        self.app.init(self.gui)

    def run(self):
        self.app.run()
コード例 #13
0
ファイル: guiCP.py プロジェクト: BackupTheBerlios/zeugs-svn
    def __init__(self, appString):
        self.app = Application(appString)
        self.settings = self.app.settings
        slot("%s-closeMainWindow" % appString, self.slot_tidy)
        self.cp = ControlPanel(self.settings)

        self.init()
コード例 #14
0
    def __init__(self, appString):
        self.app = Application(appString)

        self.settings = self.app.settings
        self.gui = GuiWidget(self.settings)

        self.app.init(self.gui)
コード例 #15
0
ファイル: guiCP.py プロジェクト: bopopescu/zeugs-svn
class GuiCP:
    """There may be only one instance of this class, because of the
    slot declarations.
    """
    def __init__(self, appString):
        self.app = Application(appString)
        self.settings = self.app.settings
        slot("%s-closeMainWindow" % appString, self.slot_tidy)
        self.cp = ControlPanel(self.settings)

        self.init()

    def init(self):
        self.db = None

        self.gui = GuiWidget(self.settings)
        self.gui.show()
        c0 = self.gui.cursor()
        self.gui.setCursor(QtGui.QCursor(QtCore.Qt.BusyCursor))

        # Connect to control database
        connectData = getConnectInfo(self.settings, ADMIN)
        if not connectData:
            return
        db = DB(connectData)
        self.gui.setCursor(c0)
        if not db.isOpen():
            error(_("Couldn't open control database"))
            return  # actually error shouldn't return
        self.db = db

        self.app.init(self.gui)

        # set up lists of available databases, admins, users, etc.
        # and initialize the main module
        self.cp.init(self.gui, self.db)

    def run(self):
        if self.db:
            self.app.run()

    def slot_tidy(self, arg):
        """Stuff to do when the program quits
        """
        if self.db:
            self.db.close()
コード例 #16
0
ファイル: guiCP.py プロジェクト: BackupTheBerlios/zeugs-svn
class GuiCP:
    """There may be only one instance of this class, because of the
    slot declarations.
    """
    def __init__(self, appString):
        self.app = Application(appString)
        self.settings = self.app.settings
        slot("%s-closeMainWindow" % appString, self.slot_tidy)
        self.cp = ControlPanel(self.settings)

        self.init()

    def init(self):
        self.db = None

        self.gui = GuiWidget(self.settings)
        self.gui.show()
        c0 = self.gui.cursor()
        self.gui.setCursor(QtGui.QCursor(QtCore.Qt.BusyCursor))

        # Connect to control database
        connectData = getConnectInfo(self.settings, ADMIN)
        if not connectData:
            return
        db = DB(connectData)
        self.gui.setCursor(c0)
        if not db.isOpen():
            error(_("Couldn't open control database"))
            return # actually error shouldn't return
        self.db = db

        self.app.init(self.gui)

        # set up lists of available databases, admins, users, etc.
        # and initialize the main module
        self.cp.init(self.gui, self.db)

    def run(self):
        if self.db:
            self.app.run()

    def slot_tidy(self, arg):
        """Stuff to do when the program quits
        """
        if self.db:
            self.db.close()
コード例 #17
0
class GuiConnectInfo:
    def __init__(self, appString, user):
        self.app = Application(appString)
        self.settings = self.app.settings

        self.gui = GuiWidget(self.settings)
        #slot("%s-closeMainWindow" % appString, self.slot_tidy)

        self.app.init(self.gui)
        self.gui.init(user)

    def run(self):
        if not self.gui.exec_():
            return None

        return { u"host" : self.gui.host, u"user" : self.gui.dbuser,
                u"pw" : self.gui.pw, u"db" : CONTROLDB }
コード例 #18
0
    def __init__(self, appString, user):
        self.app = Application(appString)
        self.settings = self.app.settings

        self.gui = GuiWidget(self.settings)
        #slot("%s-closeMainWindow" % appString, self.slot_tidy)

        self.app.init(self.gui)
        self.gui.init(user)
コード例 #19
0
    def __init__(self, appString, file=None):
        self.app = Application(appString)
        self.settings = self.app.settings

        slot("%s-closeMainWindow" % appString, self.slot_tidy)

        # Prepare the print handler
        self.pView = PrintView()

        self.init(file)
コード例 #20
0
ファイル: guiEditor.py プロジェクト: bopopescu/zeugs-svn
    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)
コード例 #21
0
class GuiConnectInfo:
    def __init__(self, appString, user):
        self.app = Application(appString)
        self.settings = self.app.settings

        self.gui = GuiWidget(self.settings)
        #slot("%s-closeMainWindow" % appString, self.slot_tidy)

        self.app.init(self.gui)
        self.gui.init(user)

    def run(self):
        if not self.gui.exec_():
            return None

        return {
            u"host": self.gui.host,
            u"user": self.gui.dbuser,
            u"pw": self.gui.pw,
            u"db": CONTROLDB
        }
コード例 #22
0
    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)
コード例 #23
0
ファイル: guiSync.py プロジェクト: BackupTheBerlios/zeugs-svn
 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)