Example #1
0
    def load_feescales(self):
        self.loading = True
        self.text_editors = []
        self.feescale_parsers = OrderedDict()
        for ix, filepath in self.feescale_handler.local_files:
            fp = FeescaleParser(filepath, ix)
            try:
                fp.parse_file()
            except:
                message = u"%s '%s'"% (_("unable to parse file"), filepath)
                self.advise(message, 2)
                LOGGER.exception(message)

            editor = XMLEditor()
            editor.editor_settings()
            editor.textChanged.connect(self.text_changed)
            editor.editing_finished.connect(self.te_editing_finished)
            editor.cursorPositionChanged.connect(self.cursor_position_changed)

            title = fp.label_text
            self.feescale_parsers[title] = fp
            self.text_editors.append(editor)

            self.tab_widget.addTab(editor, title)

        self.loading = False
Example #2
0
    def load_feescales(self):
        self.loading = True
        self.text_editors = []
        self.feescale_parsers = OrderedDict()
        for ix, filepath in self.feescale_handler.local_files:
            fp = FeescaleParser(filepath, ix)
            try:
                fp.parse_file()
            except:
                message = u"%s '%s'" % (_("unable to parse file"), filepath)
                self.advise(message, 2)
                LOGGER.exception(message)

            editor = XMLEditor()
            editor.editor_settings()
            editor.textChanged.connect(self.text_changed)
            editor.editing_finished.connect(self.te_editing_finished)
            editor.cursorPositionChanged.connect(self.cursor_position_changed)

            title = fp.label_text
            self.feescale_parsers[title] = fp
            self.text_editors.append(editor)

            self.tab_widget.addTab(editor, title)

        self.loading = False
Example #3
0
    def load_feescale_from_filepath(self, ix, filepath):
        fp = FeescaleParser(filepath, ix)
        try:
            fp.parse_file()
        except:
            message = u"%s '%s'" % (_("unable to parse file"), filepath)
            self.advise(message, 2)
            LOGGER.exception(message)

        editor = XMLEditor()
        editor.editor_settings()
        editor.textChanged.connect(self.text_changed)
        editor.editing_finished.connect(self.te_editing_finished)
        editor.cursorPositionChanged.connect(self.cursor_position_changed)

        title = fp.label_text
        self.feescale_parsers[title] = fp
        self.text_editors.append(editor)

        self.tab_widget.addTab(editor, title)
        tooltip = "%s\n%s" % (fp.tablename, fp.description)
        LOGGER.debug("setting tab tool tip %s", tooltip.replace("\n", " "))
        self.tab_widget.setTabToolTip(ix, tooltip)
Example #4
0
    def load_feescale_from_filepath(self, ix, filepath):
        fp = FeescaleParser(filepath, ix)
        try:
            fp.parse_file()
        except:
            message = u"%s '%s'" % (_("unable to parse file"), filepath)
            self.advise(message, 2)
            LOGGER.exception(message)

        editor = XMLEditor()
        editor.editor_settings()
        editor.textChanged.connect(self.text_changed)
        editor.editing_finished.connect(self.te_editing_finished)
        editor.cursorPositionChanged.connect(self.cursor_position_changed)

        title = fp.label_text
        self.feescale_parsers[title] = fp
        self.text_editors.append(editor)

        self.tab_widget.addTab(editor, title)
        tooltip = "%s\n%s" % (fp.tablename, fp.description)
        LOGGER.debug("setting tab tool tip %s", tooltip.replace("\n", " "))
        self.tab_widget.setTabToolTip(ix, tooltip)