示例#1
0
    def __init__(self, filePath):
        super(LayoutTabbedEditor, self).__init__(layout_compatibility.manager, filePath)

        self.requiresProject = True

        self.visual = visual.VisualEditing(self)
        self.addTab(self.visual, "Visual")

        self.code = code.CodeEditing(self)
        self.addTab(self.code, "Code")

        # Layout Previewer is not actually an edit mode, you can't edit the layout from it,
        # however for everything to work smoothly we do push edit mode changes to it to the
        # undo stack.
        #
        # TODO: This could be improved at least a little bit if 2 consecutive edit mode changes
        #       looked like this: A->Preview, Preview->C.  We could simply turn this into A->C,
        #       and if A = C it would eat the undo command entirely.
        self.previewer = preview.LayoutPreviewer(self)
        self.addTab(self.previewer, "Live Preview")

        self.tabWidget = self

        # set the toolbar icon size according to the setting and subscribe to it
        self.tbIconSizeEntry = settings.getEntry("global/ui/toolbar_icon_size")
        self.updateToolbarSize(self.tbIconSizeEntry.value)
        self.tbIconSizeCallback = lambda value: self.updateToolbarSize(value)
        self.tbIconSizeEntry.subscribe(self.tbIconSizeCallback)
示例#2
0
    def __init__(self, filePath):
        super(LayoutTabbedEditor, self).__init__(layout_compatibility.manager,
                                                 filePath)

        self.requiresProject = True

        self.visual = visual.VisualEditing(self)
        self.addTab(self.visual, "Visual")

        self.code = code.CodeEditing(self)
        self.addTab(self.code, "Code")

        # Layout Previewer is not actually an edit mode, you can't edit the layout from it,
        # however for everything to work smoothly we do push edit mode changes to it to the
        # undo stack.
        #
        # TODO: This could be improved at least a little bit if 2 consecutive edit mode changes
        #       looked like this: A->Preview, Preview->C.  We could simply turn this into A->C,
        #       and if A = C it would eat the undo command entirely.
        self.previewer = preview.LayoutPreviewer(self)
        self.addTab(self.previewer, "Live Preview")

        self.tabWidget = self

        # set the toolbar icon size according to the setting and subscribe to it
        self.tbIconSizeEntry = settings.getEntry("global/ui/toolbar_icon_size")
        self.updateToolbarSize(self.tbIconSizeEntry.value)
        self.tbIconSizeCallback = lambda value: self.updateToolbarSize(value)
        self.tbIconSizeEntry.subscribe(self.tbIconSizeCallback)
示例#3
0
    def __init__(self, argv, debug=False):
        super(Application, self).__init__(argv)

        logging.basicConfig()

        if debug:
            # set debug logging
            logging.getLogger().setLevel(logging.DEBUG)

        if version.DEVELOPER_MODE:
            #print "hi devolopper!"
            # print info about developer's mode to possibly prevent it being
            # forgotten about when releasing
            logging.info(
                "Developer's mode enabled - recompiling all .ui files...")

            # in case we are in the developer's mode,
            # lets compile all UI files to ensure they are up to date
            from ceed import compileuifiles
            compileuifiles.main()

            logging.debug("All .ui files recompiled!")

        from ceed import settings
        self.qsettings = QSettings("Iromy", "UIromy Editor")
        self.settings = settings.Settings(self.qsettings)
        # download all values from the persistence store
        self.settings.download()

        showSplash = settings.getEntry("global/app/show_splash").value
        if showSplash:
            self.splash = SplashScreen()
            self.splash.show()

            # this ensures that the splash screen is shown on all platforms
            self.processEvents()

        self.setOrganizationName("Iromy")
        self.setOrganizationDomain("Iromy.com")
        self.setApplicationName("UIromY Editor")
        self.setApplicationVersion(version.CEED)

        # (we potentially have to compile all UI files first before this is imported,
        # otherwise out of date compiled .py layouts might be used!)
        from ceed import mainwindow

        self.mainWindow = mainwindow.MainWindow(self)
        self.mainWindow.show()
        self.mainWindow.raise_()
        if showSplash:
            self.splash.finish(self.mainWindow)

        # import error after UI files have been recompiled
        # - Truncate exception log, if it exists.
        from ceed import error

        self.errorHandler = error.ErrorHandler(self.mainWindow)
        self.errorHandler.installExceptionHook()
示例#4
0
    def __init__(self, argv, debug = False):
        super(Application, self).__init__(argv)

        logging.basicConfig()

        if debug:
            # set debug logging
            logging.getLogger().setLevel(logging.DEBUG)

        if version.DEVELOPER_MODE:
            # print info about developer's mode to possibly prevent it being
            # forgotten about when releasing
            logging.info("Developer's mode enabled - recompiling all .ui files...")

            # in case we are in the developer's mode,
            # lets compile all UI files to ensure they are up to date
            from ceed import compileuifiles
            compileuifiles.main()

            logging.debug("All .ui files recompiled!")

        from ceed import settings
        self.qsettings = QSettings("CEGUI", "CEED")
        self.settings = settings.Settings(self.qsettings)
        # download all values from the persistence store
        self.settings.download()

        showSplash = settings.getEntry("global/app/show_splash").value
        if showSplash:
            self.splash = SplashScreen()
            self.splash.show()

            # this ensures that the splash screen is shown on all platforms
            self.processEvents()

        self.setOrganizationName("CEGUI")
        self.setOrganizationDomain("cegui.org.uk")
        self.setApplicationName("CEED - CEGUI editor")
        self.setApplicationVersion(version.CEED)

        # (we potentially have to compile all UI files first before this is imported,
        # otherwise out of date compiled .py layouts might be used!)
        from ceed import mainwindow

        self.mainWindow = mainwindow.MainWindow(self)
        self.mainWindow.show()
        self.mainWindow.raise_()
        if showSplash:
            self.splash.finish(self.mainWindow)

        # import error after UI files have been recompiled
        # - Truncate exception log, if it exists.
        from ceed import error

        self.errorHandler = error.ErrorHandler(self.mainWindow)
        self.errorHandler.installExceptionHook()
示例#5
0
    def __init__(self, filePath):
        super(ImagesetTabbedEditor, self).__init__(imageset_compatibility.manager, filePath)

        self.visual = visual.VisualEditing(self)
        self.addTab(self.visual, "Visual")

        self.code = code.CodeEditing(self)
        self.addTab(self.code, "Code")

        self.tabWidget = self

        # set the toolbar icon size according to the setting and subscribe to it
        self.tbIconSizeEntry = settings.getEntry("global/ui/toolbar_icon_size")
        self.updateToolbarSize(self.tbIconSizeEntry.value)
        self.tbIconSizeCallback = lambda value: self.updateToolbarSize(value)
        self.tbIconSizeEntry.subscribe(self.tbIconSizeCallback)
示例#6
0
    def __init__(self, filePath):
        super(ImagesetTabbedEditor,
              self).__init__(imageset_compatibility.manager, filePath)

        self.visual = visual.VisualEditing(self)
        self.addTab(self.visual, "Visual")

        self.code = code.CodeEditing(self)
        self.addTab(self.code, "Code")

        self.tabWidget = self

        # set the toolbar icon size according to the setting and subscribe to it
        self.tbIconSizeEntry = settings.getEntry("global/ui/toolbar_icon_size")
        self.updateToolbarSize(self.tbIconSizeEntry.value)
        self.tbIconSizeCallback = lambda value: self.updateToolbarSize(value)
        self.tbIconSizeEntry.subscribe(self.tbIconSizeCallback)
示例#7
0
    def __init__(self, filePath):
        super(LookNFeelTabbedEditor,
              self).__init__(looknfeel_compatibility.manager, filePath)

        messages.warning(
            None, self, "LookNFeel Editor is experimental!",
            "This part of CEED is not considered to be ready for "
            "production. You have been warned. If everything "
            "breaks you get to keep the pieces!",
            "looknfeel_editor_experimental")

        self.editorIDString = self.getEditorIDStringPrefix() + str(id(self))

        self.requiresProject = True

        # The name of the widget we are targeting for editing
        self.targetWidgetLook = ""

        self.visual = visual.LookNFeelVisualEditing(self)
        self.addTab(self.visual, "Visual")

        self.code = code.CodeEditing(self)
        self.addTab(self.code, "Code")

        self.nameMappingsOfOwnedWidgetLooks = []

        # Look n' Feel Previewer is not actually an edit mode, you can't edit the Look n' Feel from it,
        # however for everything to work smoothly we do push edit mode changes to it to the
        # undo stack.
        #
        # TODO: This could be improved at least a little bit if 2 consecutive edit mode changes
        #       looked like this: A->Preview, Preview->C.  We could simply turn this into A->C,
        #       and if A = C it would eat the undo command entirely.
        self.previewer = preview.LookNFeelPreviewer(self)
        self.addTab(self.previewer, "Live Preview")

        self.tabWidget = self

        # set the toolbar icon size according to the setting and subscribe to it
        self.tbIconSizeEntry = settings.getEntry("global/ui/toolbar_icon_size")
        self.updateToolbarSize(self.tbIconSizeEntry.value)
        self.tbIconSizeCallback = lambda value: self.updateToolbarSize(value)
        self.tbIconSizeEntry.subscribe(self.tbIconSizeCallback)
示例#8
0
    def __init__(self, filePath):
        super(LookNFeelTabbedEditor, self).__init__(looknfeel_compatibility.manager, filePath)

        messages.warning(None, self, "LookNFeel Editor is experimental!",
                         "This part of CEED is not considered to be ready for "
                         "production. You have been warned. If everything "
                         "breaks you get to keep the pieces!",
                         "looknfeel_editor_experimental")

        self.editorIDString = self.getEditorIDStringPrefix() + str(id(self))

        self.requiresProject = True

        # The name of the widget we are targeting for editing
        self.targetWidgetLook = ""

        self.visual = visual.LookNFeelVisualEditing(self)
        self.addTab(self.visual, "Visual")

        self.code = code.CodeEditing(self)
        self.addTab(self.code, "Code")

        self.nameMappingsOfOwnedWidgetLooks = []

        # Look n' Feel Previewer is not actually an edit mode, you can't edit the Look n' Feel from it,
        # however for everything to work smoothly we do push edit mode changes to it to the
        # undo stack.
        #
        # TODO: This could be improved at least a little bit if 2 consecutive edit mode changes
        #       looked like this: A->Preview, Preview->C.  We could simply turn this into A->C,
        #       and if A = C it would eat the undo command entirely.
        self.previewer = preview.LookNFeelPreviewer(self)
        self.addTab(self.previewer, "Live Preview")

        self.tabWidget = self

        # set the toolbar icon size according to the setting and subscribe to it
        self.tbIconSizeEntry = settings.getEntry("global/ui/toolbar_icon_size")
        self.updateToolbarSize(self.tbIconSizeEntry.value)
        self.tbIconSizeCallback = lambda value: self.updateToolbarSize(value)
        self.tbIconSizeEntry.subscribe(self.tbIconSizeCallback)