Пример #1
0
    def __init__(self, parent):
        QWidget.__init__(self, parent)

        box = QGroupBox(tm.main.py_search_paths, self)
        self.pypath = QPlainTextEdit(box)
        self.pypath.setPlainText(os.pathsep.join(appconfig.get("sys.path", [])))

        layout = QVBoxLayout(self)
        layout.addWidget(box)

        box_layout = QVBoxLayout(box)
        box_layout.addWidget(self.pypath)

        box = QGroupBox(tm.main.settings_common_file_paths, self)

        self.part4_path = FileBrowseButton(box, appconfig.get("cfg://part4", ""))
        self.pcardl_path = FileBrowseButton(box, appconfig.get("cfg://pca_rdl", ""))
        self.p7tpl_path = FileBrowseButton(box, appconfig.get("cfg://p7tpl", ""))

        grid = QGridLayout(box)
        grid.addWidget(QLabel(self.msg_part4, self), 0, 0)
        grid.addWidget(self.part4_path, 0, 1)
        grid.addWidget(QLabel(self.msg_pcardl, self), 1, 0)
        grid.addWidget(self.pcardl_path, 1, 1)
        grid.addWidget(QLabel(self.msg_p7tpl, self), 2, 0)
        grid.addWidget(self.p7tpl_path, 2, 1)

        layout.addWidget(box)
Пример #2
0
    def __init__(self, parent):
        QWidget.__init__(self, parent)

        box = QGroupBox(tm.main.py_search_paths, self)
        self.pypath = QPlainTextEdit(box)
        self.pypath.setPlainText(os.pathsep.join(appconfig.get('sys.path',
                                                               [])))

        layout = QVBoxLayout(self)
        layout.addWidget(box)

        box_layout = QVBoxLayout(box)
        box_layout.addWidget(self.pypath)

        box = QGroupBox(tm.main.settings_common_file_paths, self)

        self.part4_path = FileBrowseButton(box,
                                           appconfig.get('cfg://part4', ''))
        self.pcardl_path = FileBrowseButton(box,
                                            appconfig.get('cfg://pca_rdl', ''))
        self.p7tpl_path = FileBrowseButton(box,
                                           appconfig.get('cfg://p7tpl', ''))

        grid = QGridLayout(box)
        grid.addWidget(QLabel(self.msg_part4, self), 0, 0)
        grid.addWidget(self.part4_path, 0, 1)
        grid.addWidget(QLabel(self.msg_pcardl, self), 1, 0)
        grid.addWidget(self.pcardl_path, 1, 1)
        grid.addWidget(QLabel(self.msg_p7tpl, self), 2, 0)
        grid.addWidget(self.p7tpl_path, 2, 1)

        layout.addWidget(box)
Пример #3
0
    def Apply(self):
        extensions_dict = appconfig.get("extensions", {})
        changed = False

        for i in xrange(self.extensions.count()):
            item = self.extensions.item(i)
            name = item.text()
            checked = item.checkState() == Qt.Checked
            if extensions_dict[name] != checked:
                changed = True
                extensions_dict[name] = checked

        if tm._get_languages()[self.languages.currentIndex()][0] != appconfig.get("language", "en"):
            appconfig["language"] = tm._get_languages()[self.languages.currentIndex()][0]
            changed = True

        appconfig.SaveSettings()
        return changed
Пример #4
0
    def Apply(self):
        extensions_dict = appconfig.get('extensions', {})
        changed = False

        for i in xrange(self.extensions.count()):
            item = self.extensions.item(i)
            name = item.text()
            checked = item.checkState() == Qt.Checked
            if extensions_dict[name] != checked:
                changed = True
                extensions_dict[name] = checked

        if tm._get_languages()[self.languages.currentIndex(
        )][0] != appconfig.get('language', 'en'):
            appconfig['language'] = tm._get_languages()[
                self.languages.currentIndex()][0]
            changed = True

        appconfig.SaveSettings()
        return changed
Пример #5
0
    def __init__(self, parent):
        QWidget.__init__(self, parent)

        box = QGroupBox(tm.main.settings_enabled_extensions, self)

        extensions_dict = appconfig.get("extensions", {})

        self.extensions = QListWidget(self)

        for k, v in extensions_dict.iteritems():
            item = QListWidgetItem(k, self.extensions)

            if v:
                item.setCheckState(Qt.Checked)
            else:
                item.setCheckState(Qt.Unchecked)

            self.extensions.addItem(item)

        layout = QVBoxLayout(self)

        layout.addWidget(box)
        layout_box = QVBoxLayout(box)
        layout_box.addWidget(self.extensions)

        self.languages = QComboBox(self)
        current_lang = appconfig.get("language", "en")
        for code, lang in tm._get_languages():
            self.languages.addItem(QIcon(), lang)
            if code == current_lang:
                self.languages.setCurrentIndex(self.languages.count() - 1)

        grid = QGridLayout()
        grid.addWidget(QLabel(tm.main.language, self), 0, 0)
        grid.addWidget(self.languages, 0, 1)

        layout.addLayout(grid)
Пример #6
0
    def __init__(self, parent):
        QWidget.__init__(self, parent)

        box = QGroupBox(tm.main.settings_enabled_extensions, self)

        extensions_dict = appconfig.get('extensions', {})

        self.extensions = QListWidget(self)

        for k, v in extensions_dict.iteritems():
            item = QListWidgetItem(k, self.extensions)

            if v:
                item.setCheckState(Qt.Checked)
            else:
                item.setCheckState(Qt.Unchecked)

            self.extensions.addItem(item)

        layout = QVBoxLayout(self)

        layout.addWidget(box)
        layout_box = QVBoxLayout(box)
        layout_box.addWidget(self.extensions)

        self.languages = QComboBox(self)
        current_lang = appconfig.get('language', 'en')
        for code, lang in tm._get_languages():
            self.languages.addItem(QIcon(), lang)
            if code == current_lang:
                self.languages.setCurrentIndex(self.languages.count() - 1)

        grid = QGridLayout()
        grid.addWidget(QLabel(tm.main.language, self), 0, 0)
        grid.addWidget(self.languages, 0, 1)

        layout.addLayout(grid)