def __init__(self, parser, parent=None):
        QtGui.QWidget.__init__(self, parent)
        self.parser = parser
        label = QtGui.QLabel(parser.detailed_label_text)
        self.xml_editor = XMLEditor()

        layout = QtGui.QVBoxLayout(self)
        layout.addWidget(label)
        layout.addWidget(self.xml_editor)
class CompareWidget(QtGui.QWidget):
    def __init__(self, parser, parent=None):
        QtGui.QWidget.__init__(self, parent)
        self.parser = parser
        label = QtGui.QLabel(parser.detailed_label_text)
        self.xml_editor = XMLEditor()

        layout = QtGui.QVBoxLayout(self)
        layout.addWidget(label)
        layout.addWidget(self.xml_editor)

    def set_item_id(self, item_id):
        node = self.parser.itemnode_from_id(item_id, ignore_prefix=True)
        if node:
            self.xml_editor.setText(re.sub("\t", "", node.toxml()))
        else:
            self.xml_editor.setText(_("No Match Found"))
class CompareWidget(QtWidgets.QWidget):
    def __init__(self, parser, parent=None):
        QtWidgets.QWidget.__init__(self, parent)
        self.parser = parser
        label = QtWidgets.QLabel(parser.detailed_label_text)
        self.xml_editor = XMLEditor()

        layout = QtWidgets.QVBoxLayout(self)
        layout.addWidget(label)
        layout.addWidget(self.xml_editor)

    def set_item_id(self, item_id):
        node = self.parser.itemnode_from_id(item_id, ignore_prefix=True)
        if node:
            self.xml_editor.setText(re.sub("\t", "", node.toxml()))
        else:
            self.xml_editor.setText(_("No Match Found"))
    def __init__(self, parser, parent=None):
        QtWidgets.QWidget.__init__(self, parent)
        self.parser = parser
        label = QtWidgets.QLabel(parser.detailed_label_text)
        self.xml_editor = XMLEditor()

        layout = QtWidgets.QVBoxLayout(self)
        layout.addWidget(label)
        layout.addWidget(self.xml_editor)
Пример #5
0
    def load_phrasebooks(self):
        self.loading = True
        while self.tab_widget.count():
            self.tab_widget.removeTab(0)
        for editor in self.text_editors:
            editor.setParent(None)
        self.text_editors = []
        for book in PHRASEBOOKS.get_all_books():
            editor = XMLEditor(self)
            editor.editor_settings()
            editor.setText(book.xml)
            editor.db_index = book.ix
            editor.textChanged.connect(self.text_changed)
            editor.cursorPositionChanged.connect(self.cursor_position_changed)

            if book.ix == 0:
                title = _("Global Phrasebook")
            else:
                title = localsettings.ops[book.ix]
            self.text_editors.append(editor)

            self.tab_widget.addTab(editor, title)

        self.loading = False
Пример #6
0
    def load_phrasebooks(self):
        self.loading = True
        while self.tab_widget.count():
            self.tab_widget.removeTab(0)
        for editor in self.text_editors:
            editor.setParent(None)
        self.text_editors = []
        for book in PHRASEBOOKS.get_all_books():
            editor = XMLEditor(self)
            editor.editor_settings()
            editor.setText(book.xml)
            editor.db_index = book.ix
            editor.textChanged.connect(self.text_changed)
            editor.cursorPositionChanged.connect(self.cursor_position_changed)

            if book.ix == 0:
                title = _("Global Phrasebook")
            else:
                title = localsettings.ops[book.ix]
            self.text_editors.append(editor)

            self.tab_widget.addTab(editor, title)

        self.loading = False