コード例 #1
0
 def _reset_stylesheet(self):
     """ Resets stylesheet"""
     self.setFont(QtGui.QFont(self._font_family,
                              self._font_size + self._zoom_level))
     p = self.palette()
     p.setColor(QtGui.QPalette.Base, self.background)
     p.setColor(QtGui.QPalette.Text, self.foreground)
     p.setColor(QtGui.QPalette.Highlight, self.selection_background)
     p.setColor(QtGui.QPalette.HighlightedText, self.selection_foreground)
     if QtWidgets.QApplication.instance().styleSheet() or (
             hasattr(self, '_flg_stylesheet') and
             platform.system() == 'Windows'):
         # on windows, if the application once had a stylesheet, we must
         # keep on using a stylesheet otherwise strange colors appear
         # see https://github.com/OpenCobolIDE/OpenCobolIDE/issues/65
         self._flg_stylesheet = True
         self.setStyleSheet('''QPlainTextEdit
         {
             background-color: %s;
             color: %s;
         }
         ''' % (self.background.name(), self.foreground.name()))
     else:
         # on linux/osx we just have to set an empty stylesheet to cancel
         # any previous stylesheet and still keep a correct style for
         # scrollbars
         self.setStyleSheet('')
     self.setPalette(p)
     self.repaint()
コード例 #2
0
ファイル: about.py プロジェクト: crazyrafa/OpenCobolIDE
    def __init__(self, parent=None):
        super().__init__(parent)
        self.setupUi(self)
        self.checkBoxVerbose.setChecked(Settings().verbose)
        self.tabWidget.setCurrentIndex(0)
        self.tbwVersions.setColumnCount(1)
        self.tbwVersions.setRowCount(len(self.HEADERS))
        self.tbwVersions.setVerticalHeaderLabels(self.HEADERS)
        self.tbwVersions.setHorizontalHeaderLabels(['Version'])
        self.tbwVersions.verticalHeader().setStretchLastSection(False)
        self.labelMain.setText(self.labelMain.text() % __version__)
        self.setMinimumWidth(640)
        self.setMinimumHeight(480)
        self.setWindowIcon(
            QtGui.QIcon.fromTheme(
                'help-about',
                QtGui.QIcon(':/ide-icons/rc/dialog-information.png')))
        try:
            import qdarkstyle
        except ImportError:
            qdarkstyle_version = 'Not installed'
        else:
            qdarkstyle_version = qdarkstyle.__version__
        versions = [
            GnuCobolCompiler().get_version(), QtCore.QT_VERSION_STR,
            QtCore.PYQT_VERSION_STR, pyqode.core.__version__,
            pyqode.cobol.__version__, pygments.__version__, qdarkstyle_version
        ]
        for i, version in enumerate(versions):
            item = QtWidgets.QTableWidgetItem(version)
            self.tbwVersions.setItem(i, 0, item)
        with open(logger.get_path(), 'r') as f:
            self.textEditLog.setText(f.read())
        self.checkBoxVerbose.toggled.connect(self._on_verbose_toggled)

        self.edit_compiler_infos.setFont(QtGui.QFont(Settings().font, 9))

        # from pyqode.core._forms.pyqode_core_rc
        QtGui.QFontDatabase.addApplicationFont(
            ':/fonts/rc/SourceCodePro-Regular.ttf')
        QtGui.QFontDatabase.addApplicationFont(
            ':/fonts/rc/SourceCodePro-Bold.ttf')

        template = '''cobc --info
============

%(cobc_infos)s

cobcrun --runtime-env
=====================

%(cobcrun_infos)s
'''

        gnucobol_infos = template % {
            'cobc_infos': GnuCobolCompiler.get_cobc_infos(),
            'cobcrun_infos': GnuCobolCompiler.get_cobcrun_infos()
        }
        self.edit_compiler_infos.setPlainText(gnucobol_infos)
コード例 #3
0
ファイル: right_margin.py プロジェクト: zwadar/pyqode.core
 def _paint_margin(self, event):
     """ Paints the right margin after editor paint event. """
     font = QtGui.QFont(self.editor.font_name,
                        self.editor.font_size + self.editor.zoom_level)
     metrics = QtGui.QFontMetricsF(font)
     pos = self._margin_pos
     offset = self.editor.contentOffset().x() + \
         self.editor.document().documentMargin()
     x80 = round(metrics.width(' ') * pos) + offset
     painter = QtGui.QPainter(self.editor.viewport())
     painter.setPen(self._pen)
     painter.drawLine(x80, 0, x80, 2**16)
コード例 #4
0
    def __init__(self, parent=None):
        super().__init__(parent)
        self.setupUi(self)
        self.tabWidget.setCurrentIndex(0)
        self.tbwVersions.setColumnCount(1)
        self.tbwVersions.setRowCount(len(self.HEADERS))
        self.tbwVersions.setVerticalHeaderLabels(self.HEADERS)
        self.tbwVersions.setHorizontalHeaderLabels(['Version'])
        self.tbwVersions.verticalHeader().setStretchLastSection(False)
        self.labelMain.setText(self.labelMain.text() % __version__)
        self.setMinimumWidth(640)
        self.setMinimumHeight(480)
        self.setWindowIcon(
            QtGui.QIcon.fromTheme(
                'help-about',
                QtGui.QIcon(':/ide-icons/rc/dialog-information.png')))

        for i, (name, version) in enumerate(
                sorted(list(DlgAbout.get_runtime_env().items()),
                       key=lambda x: x[0])):
            item = QtWidgets.QTableWidgetItem(name)
            self.tbwVersions.setVerticalHeaderItem(i, item)
            item = QtWidgets.QTableWidgetItem(version)
            self.tbwVersions.setItem(i, 0, item)
        try:
            with open(logger.get_path(), 'r') as f:
                self.textEditLog.setPlainText('\n'.join(
                    f.read().splitlines()[-1000:]))
        except FileNotFoundError:
            self.textEditLog.setPlainText('')

        self.edit_compiler_infos.setFont(QtGui.QFont(Settings().font, 9))

        # from pyqode.core._forms.pyqode_core_rc
        QtGui.QFontDatabase.addApplicationFont(
            ':/fonts/rc/SourceCodePro-Regular.ttf')
        QtGui.QFontDatabase.addApplicationFont(
            ':/fonts/rc/SourceCodePro-Bold.ttf')

        self.edit_compiler_infos.setPlainText(DlgAbout.get_cobc_runtime_env())

        try:
            name = LEVEL_NAMES[Settings().log_level]
        except KeyError:
            name = 'INFO'
        self.combo_log_level.setCurrentText(name)
        self.combo_log_level.currentIndexChanged.connect(
            self._on_log_level_changed)

        self.bt_clear_logs.clicked.connect(self._clear_logs)
コード例 #5
0
 def _paint_margins(self, event):
     """ Paints the right margin after editor paint event. """
     font = QtGui.QFont(self.editor.font_name,
                        self.editor.font_size + self.editor.zoom_level)
     metrics = QtGui.QFontMetricsF(font)
     painter = QtGui.QPainter(self.editor.viewport())
     for pos, pen in zip(self._positions, self._pens):
         if pos < 0:
             # margin not visible
             continue
         offset = self.editor.contentOffset().x() + \
             self.editor.document().documentMargin()
         x_pos = round(metrics.width(' ') * pos) + offset
         painter.setPen(pen)
         painter.drawLine(x_pos, 0, x_pos, 2**16)
コード例 #6
0
    def _reset_stylesheet(self):
        """ Resets stylesheet"""
        self.setFont(
            QtGui.QFont(self._font_family, self._font_size + self._zoom_level))
        flg_stylesheet = hasattr(self, '_flg_stylesheet')
        if QtWidgets.QApplication.instance().styleSheet() or flg_stylesheet:
            self._flg_stylesheet = True
            self.setStyleSheet('''QPlainTextEdit
            {
                background-color: %s;
                color: %s;
                font-size: %spx;
            }
            ''' % (self.background.name(), self.foreground.name(),
                   self._font_size + self._zoom_level))
            # On Window, if the application once had a stylesheet, we must
            # keep on using a stylesheet otherwise strange colors appear
            # see https://github.com/OpenCobolIDE/OpenCobolIDE/issues/65
            # Also happen on plasma 5
            # try:
            #     plasma = os.environ['DESKTOP_SESSION'] == 'plasma'
            # except KeyError:
            #     plasma = False
            # if sys.platform == 'win32' or plasma:
            #     self.setStyleSheet('''QPlainTextEdit
            #     {
            #         background-color: %s;
            #         color: %s;
            #     }
            #     ''' % (self.background.name(), self.foreground.name()))
            # else:
            #     # on linux/osx we just have to set an empty stylesheet to
            #     # cancel any previous stylesheet and still keep a correct
            #     # style for scrollbars
            #     self.setStyleSheet('')

        else:
            p = self.palette()
            p.setColor(QtGui.QPalette.Base, self.background)
            p.setColor(QtGui.QPalette.Text, self.foreground)
            p.setColor(QtGui.QPalette.Highlight, self.selection_background)
            p.setColor(QtGui.QPalette.HighlightedText,
                       self.selection_foreground)
            self.setPalette(p)
        self.repaint()
コード例 #7
0
    def setupUi(self, Dialog):
        Dialog.setObjectName("Dialog")
        Dialog.resize(997, 536)
        self.gridLayout = QtWidgets.QGridLayout(Dialog)
        self.gridLayout.setObjectName("gridLayout")
        self.plainTextEdit = QtWidgets.QPlainTextEdit(Dialog)
        font = QtGui.QFont()
        font.setFamily("Monospace")
        self.plainTextEdit.setFont(font)
        self.plainTextEdit.setObjectName("plainTextEdit")
        self.gridLayout.addWidget(self.plainTextEdit, 0, 0, 1, 1)
        self.buttonBox = QtWidgets.QDialogButtonBox(Dialog)
        self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
        self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Close)
        self.buttonBox.setObjectName("buttonBox")
        self.gridLayout.addWidget(self.buttonBox, 1, 0, 1, 1)

        self.retranslateUi(Dialog)
        self.buttonBox.accepted.connect(Dialog.accept)
        self.buttonBox.rejected.connect(Dialog.reject)
        QtCore.QMetaObject.connectSlotsByName(Dialog)
コード例 #8
0
ファイル: termWidget.py プロジェクト: pocean2001/uPyIDE
 def __init__(self, parent=None):
     '''
     Constructor
     '''
     super(self.__class__, self).__init__(parent)
     self.setFont(
         QtGui.QFont({
             'win32': 'Consolas',
             'linux': 'Monospace',
             'darwin': 'Andale Mono'
         }.get(sys.platform, 'Courier'), 10))
     self.setFocusPolicy(QtCore.Qt.ClickFocus)
     self.setStyleSheet("background-color : black; color : #cccccc;")
     self._workers = []
     self._serial = None
     self._thread = None
     self._stream = pyte.Stream()
     self._vt = pyte.Screen(80, 24)
     self._stream.attach(self._vt)
     self._workers.append(self._processText)
     self._stop = threading.Event()
コード例 #9
0
ファイル: code_edit.py プロジェクト: ltfish/pyqodeng.core
 def _reset_stylesheet(self):
     """ Resets stylesheet"""
     # This function is called very often during initialization, which
     # impacts performance. This is a hack to avoid this.
     self.setFont(QtGui.QFont(self._font_family,
                              self._font_size + self._zoom_level))
     flg_stylesheet = hasattr(self, '_flg_stylesheet')
     if QtWidgets.QApplication.instance().styleSheet() or flg_stylesheet:
         self._flg_stylesheet = True
         # On Window, if the application once had a stylesheet, we must
         # keep on using a stylesheet otherwise strange colors appear
         # see https://github.com/OpenCobolIDE/OpenCobolIDE/issues/65
         # Also happen on plasma 5
         try:
             plasma = os.environ['DESKTOP_SESSION'] == 'plasma'
         except KeyError:
             plasma = False
         if sys.platform == 'win32' or plasma:
             self.setStyleSheet('''QPlainTextEdit
             {
                 background-color: %s;
                 color: %s;
             }
             ''' % (self.background.name(), self.foreground.name()))
         else:
             # on linux/osx we just have to set an empty stylesheet to
             # cancel any previous stylesheet and still keep a correct
             # style for scrollbars
             self.setStyleSheet('')
     else:
         p = self.palette()
         p.setColor(QtGui.QPalette.Base, self.background)
         p.setColor(QtGui.QPalette.Text, self.foreground)
         p.setColor(QtGui.QPalette.Highlight,
                    self.selection_background)
         p.setColor(QtGui.QPalette.HighlightedText,
                    self.selection_foreground)
         self.setPalette(p)
     self.repaint()
コード例 #10
0
    def reset(self, all_tabs=False):
        settings = Settings()
        # Editor
        if self.tabWidget.currentIndex() == 0 or all_tabs:
            self.cb_cursor_pos_in_bytes.setChecked(
                settings.show_cursor_pos_in_bytes)
            self.checkBoxShowErrors.setChecked(settings.show_errors)
            self.checkBoxViewLineNumber.setChecked(settings.display_lines)
            self.checkBoxHighlightCurrentLine.setChecked(
                settings.highlight_caret)
            self.checkBoxHighlightWhitespaces.setChecked(
                settings.show_whitespaces)
            self.spinBoxEditorTabLen.setValue(settings.tab_len)
            self.checkBoxEditorAutoIndent.setChecked(
                settings.enable_autoindent)
            self.spinBoxEditorCCTriggerLen.setValue(
                settings.code_completion_trigger_len)
            self.rbLowerCaseKwds.setChecked(settings.lower_case_keywords)
            self.rbUpperCaseKwds.setChecked(not settings.lower_case_keywords)
            self.lineEditCommentIndicator.setText(settings.comment_indicator)
            self.checkBoxSmartBackspace.setChecked(
                settings.enable_smart_backspace)
            self.checkBoxAutodetectEOL.setChecked(settings.autodetect_eol)
            self.comboBoxPreferredEOL.setCurrentIndex(settings.preferred_eol)
            self.comboCcFilterMode.setCurrentIndex(
                settings.completion_filter_mode)
            for pos, spin_box, color, picker in zip(
                    settings.margin_positions, self._margin_spin_boxes,
                    settings.margin_colors, self._margin_color_pickers):
                spin_box.setValue(pos + 1)
                picker.color = QtGui.QColor(color)
        # Style
        if self.tabWidget.currentIndex() == 1 or all_tabs:
            rb = (self.radioButtonColorDark
                  if settings.dark_style else self.radioButtonColorWhite)
            rb.setChecked(True)
            index = self.comboBoxIconTheme.findText(QtGui.QIcon.themeName())
            if index != -1:
                self.comboBoxIconTheme.setCurrentIndex(index)
            self.fontComboBox.setCurrentFont(QtGui.QFont(settings.font))
            self.spinBoxFontSize.setValue(settings.font_size)
            self.listWidgetColorSchemes.clear()
            current_index = None
            self.listWidgetColorSchemes.clear()
            for style in PYGMENTS_STYLES:
                self.listWidgetColorSchemes.addItem(style)
                if style == settings.color_scheme:
                    current_index = self.listWidgetColorSchemes.count() - 1
            if current_index:
                self.listWidgetColorSchemes.setCurrentRow(current_index)
        # Run
        if self.tabWidget.currentIndex() == 3 or all_tabs:
            self.checkBoxRunExtTerm.setChecked(settings.external_terminal)
            self.lineEditRunTerm.setVisible(sys.platform != 'win32')
            self.lbl_external_terminal_command.setVisible(
                sys.platform != 'win32')
            self.lineEditRunTerm.setEnabled(settings.external_terminal)
            self.lineEditRunTerm.setText(settings.external_terminal_command)
            self.tw_run_env.clearContents()
            self.tw_run_env.setRowCount(0)
            for key, value in Settings().run_environemnt.items():
                index = self.tw_run_env.rowCount()
                self.tw_run_env.insertRow(index)
                self.tw_run_env.setItem(index, 0,
                                        QtWidgets.QTableWidgetItem(key))
                self.tw_run_env.setItem(index, 1,
                                        QtWidgets.QTableWidgetItem(value))
            self.edit_working_dir.setText(settings.working_dir)
        # compiler
        if self.tabWidget.currentIndex() == 2 or all_tabs:
            self.cbAutoDetectSublmodules.setChecked(
                Settings().autodetect_submodules)
            self.cb_copy_runtime_dlls.setVisible(sys.platform == 'win32')
            self.cb_copy_runtime_dlls.setChecked(Settings().copy_runtime_dlls)
            self.lineEditOutputDirectory.setText(Settings().output_directory)
            self.lineEditCobcExts.setText(';'.join(Settings().cobc_extensions))
            self.checkBoxFreeFormat.setChecked(settings.free_format)
            self.comboBoxStandard.setCurrentIndex(int(settings.cobol_standard))
            self.lineEditCompilerPath.setText(settings.compiler_path)
            flags = Settings().compiler_flags
            self.cb_debugging_line.setChecked(
                self.cb_debugging_line.text() in flags)
            self.cb_ftrace.setChecked(
                self.cb_ftrace.text().replace('&', '') in flags)
            self.cb_ftraceall.setChecked(
                self.cb_ftraceall.text().replace('&', '') in flags)
            self.cb_g.setChecked(self.cb_g.text().replace('&', '') in flags)
            self.cb_static.setChecked(
                self.cb_static.text().replace('&', '') in flags)
            self.cb_debug.setChecked(
                self.cb_debug.text().replace('&', '') in flags)
            self.cb_w.setChecked(self.cb_w.text().replace('&', '') in flags)
            self.cb_wall.setChecked(
                self.cb_wall.text().replace('&', '') in flags)
            for v in self.flags_in_checkbox:
                try:
                    flags.remove(v)
                except ValueError:
                    pass
            self.lineEditLibs.setText(settings.libraries)
            self.listWidgetLibPaths.addItems([
                pth for pth in settings.library_search_path.split(';') if pth
            ])
            self.listWidgetCopyPaths.addItems(
                [pth for pth in settings.copybook_paths.split(';') if pth])
            self.le_compiler_flags.setText(' '.join(flags))
            if system.windows:
                self.lineEditVCVARS.setText(settings.vcvarsall)
                self.combo_arch.setCurrentIndex(1 if settings.vcvarsall_arch ==
                                                'x64' else 0)
            self.PATH.setText(settings.path)
            self.cbPATH.setChecked(settings.path_enabled)
            self.COB_CONFIG_DIR.setText(settings.cob_config_dir)
            self.cbCOB_CONFIG_DIR.setChecked(settings.cob_config_dir_enabled)
            self.COB_COPY_DIR.setText(settings.cob_copy_dir)
            self.cbCOB_COPY_DIR.setChecked(settings.cob_copy_dir_enabled)
            self.COB_INCLUDE_PATH.setText(settings.cob_include_path)
            self.cbCOB_INCLUDE_PATH.setChecked(
                settings.cob_include_path_enabled)
            self.COB_LIB_PATH.setText(settings.cob_lib_path)
            self.cbCOB_LIB_PATH.setChecked(settings.cob_lib_path_enabled)

        # SQL Cobol
        if self.tabWidget.currentIndex() == 4 or all_tabs:
            self.lineEditDbpreExts.setText(';'.join(
                Settings().dbpre_extensions))
            self.lineEditDbpre.setText(settings.dbpre)
            self.lineEditDbpreFramework.setText(settings.dbpre_framework)
            self.lineEditCobmysqlapi.setText(settings.cobmysqlapi)
            self.lineEditDBHOST.setText(settings.dbhost)
            self.lineEditDBUSER.setText(settings.dbuser)
            self.lineEditDBPASSWD.setText(settings.dbpasswd)
            self.lineEditDBNAME.setText(settings.dbname)
            self.lineEditDBPORT.setText(settings.dbport)
            self.lineEditDBSOCKET.setText(settings.dbsocket)
            self.labelDbpreVersion.setText(compilers.DbpreCompiler(
            ).get_version() if Settings().dbpre != '' else '')
            self.lineEditESQLOC.setText(settings.esqloc)
            self.lineEditesqlOcExts.setText(';'.join(
                Settings().esqloc_extensions))
コード例 #11
0
    def setupUi(self, Dialog):
        Dialog.setObjectName("Dialog")
        Dialog.resize(404, 185)
        icon = QtGui.QIcon()
        icon.addPixmap(QtGui.QPixmap(":/icons/interpreter-venv.png"),
                       QtGui.QIcon.Normal, QtGui.QIcon.Off)
        Dialog.setWindowIcon(icon)
        self.gridLayout = QtWidgets.QGridLayout(Dialog)
        self.gridLayout.setObjectName("gridLayout")
        self.formLayout_2 = QtWidgets.QFormLayout()
        self.formLayout_2.setFieldGrowthPolicy(
            QtWidgets.QFormLayout.AllNonFixedFieldsGrow)
        self.formLayout_2.setObjectName("formLayout_2")
        self.label = QtWidgets.QLabel(Dialog)
        self.label.setObjectName("label")
        self.formLayout_2.setWidget(0, QtWidgets.QFormLayout.LabelRole,
                                    self.label)
        self.lineedit_name = QtWidgets.QLineEdit(Dialog)
        self.lineedit_name.setObjectName("lineedit_name")
        self.formLayout_2.setWidget(0, QtWidgets.QFormLayout.FieldRole,
                                    self.lineedit_name)
        self.label_2 = QtWidgets.QLabel(Dialog)
        self.label_2.setObjectName("label_2")
        self.formLayout_2.setWidget(1, QtWidgets.QFormLayout.LabelRole,
                                    self.label_2)
        self.dir_picker = FilePicker(Dialog)
        self.dir_picker.setObjectName("dir_picker")
        self.formLayout_2.setWidget(1, QtWidgets.QFormLayout.FieldRole,
                                    self.dir_picker)
        self.label_3 = QtWidgets.QLabel(Dialog)
        self.label_3.setObjectName("label_3")
        self.formLayout_2.setWidget(3, QtWidgets.QFormLayout.LabelRole,
                                    self.label_3)
        self.combo_interpreters = QtWidgets.QComboBox(Dialog)
        self.combo_interpreters.setObjectName("combo_interpreters")
        self.formLayout_2.setWidget(3, QtWidgets.QFormLayout.FieldRole,
                                    self.combo_interpreters)
        self.label_4 = QtWidgets.QLabel(Dialog)
        font = QtGui.QFont()
        font.setItalic(True)
        self.label_4.setFont(font)
        self.label_4.setObjectName("label_4")
        self.formLayout_2.setWidget(2, QtWidgets.QFormLayout.LabelRole,
                                    self.label_4)
        self.label_full_path = QtWidgets.QLabel(Dialog)
        font = QtGui.QFont()
        font.setItalic(True)
        self.label_full_path.setFont(font)
        self.label_full_path.setObjectName("label_full_path")
        self.formLayout_2.setWidget(2, QtWidgets.QFormLayout.FieldRole,
                                    self.label_full_path)
        self.gridLayout.addLayout(self.formLayout_2, 0, 0, 1, 1)
        self.buttonBox = QtWidgets.QDialogButtonBox(Dialog)
        self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
        self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Cancel
                                          | QtWidgets.QDialogButtonBox.Ok)
        self.buttonBox.setObjectName("buttonBox")
        self.gridLayout.addWidget(self.buttonBox, 3, 0, 1, 1)
        self.check_box_site_packages = QtWidgets.QCheckBox(Dialog)
        self.check_box_site_packages.setObjectName("check_box_site_packages")
        self.gridLayout.addWidget(self.check_box_site_packages, 1, 0, 1, 1)
        spacerItem = QtWidgets.QSpacerItem(20, 40,
                                           QtWidgets.QSizePolicy.Minimum,
                                           QtWidgets.QSizePolicy.Expanding)
        self.gridLayout.addItem(spacerItem, 2, 0, 1, 1)

        self.retranslateUi(Dialog)
        self.buttonBox.accepted.connect(Dialog.accept)
        self.buttonBox.rejected.connect(Dialog.reject)
        QtCore.QMetaObject.connectSlotsByName(Dialog)
コード例 #12
0
    def setupUi(self, Dialog):
        Dialog.setObjectName("Dialog")
        Dialog.resize(644, 619)
        icon = QtGui.QIcon.fromTheme("preferences-system")
        Dialog.setWindowIcon(icon)
        self.gridLayout_2 = QtWidgets.QGridLayout(Dialog)
        self.gridLayout_2.setContentsMargins(6, 6, 6, 6)
        self.gridLayout_2.setObjectName("gridLayout_2")
        self.widget = QtWidgets.QWidget(Dialog)
        self.widget.setStyleSheet("")
        self.widget.setObjectName("widget")
        self.widget_2 = QtWidgets.QGridLayout(self.widget)
        self.widget_2.setContentsMargins(0, 0, 0, 0)
        self.widget_2.setSpacing(0)
        self.widget_2.setObjectName("widget_2")
        self.tabWidget = QtWidgets.QTabWidget(self.widget)
        self.tabWidget.setStyleSheet("")
        self.tabWidget.setTabPosition(QtWidgets.QTabWidget.North)
        self.tabWidget.setTabShape(QtWidgets.QTabWidget.Rounded)
        self.tabWidget.setUsesScrollButtons(True)
        self.tabWidget.setDocumentMode(False)
        self.tabWidget.setObjectName("tabWidget")
        self.tabEditor = QtWidgets.QWidget()
        self.tabEditor.setObjectName("tabEditor")
        self.verticalLayout = QtWidgets.QVBoxLayout(self.tabEditor)
        self.verticalLayout.setObjectName("verticalLayout")
        self.groupBox_3 = QtWidgets.QGroupBox(self.tabEditor)
        self.groupBox_3.setObjectName("groupBox_3")
        self.formLayout = QtWidgets.QFormLayout(self.groupBox_3)
        self.formLayout.setObjectName("formLayout")
        self.label_10 = QtWidgets.QLabel(self.groupBox_3)
        self.label_10.setObjectName("label_10")
        self.formLayout.setWidget(0, QtWidgets.QFormLayout.LabelRole,
                                  self.label_10)
        self.checkBoxViewLineNumber = QtWidgets.QCheckBox(self.groupBox_3)
        self.checkBoxViewLineNumber.setText("")
        self.checkBoxViewLineNumber.setChecked(True)
        self.checkBoxViewLineNumber.setObjectName("checkBoxViewLineNumber")
        self.formLayout.setWidget(0, QtWidgets.QFormLayout.FieldRole,
                                  self.checkBoxViewLineNumber)
        self.label_11 = QtWidgets.QLabel(self.groupBox_3)
        self.label_11.setObjectName("label_11")
        self.formLayout.setWidget(1, QtWidgets.QFormLayout.LabelRole,
                                  self.label_11)
        self.checkBoxHighlightCurrentLine = QtWidgets.QCheckBox(
            self.groupBox_3)
        self.checkBoxHighlightCurrentLine.setText("")
        self.checkBoxHighlightCurrentLine.setChecked(True)
        self.checkBoxHighlightCurrentLine.setObjectName(
            "checkBoxHighlightCurrentLine")
        self.formLayout.setWidget(1, QtWidgets.QFormLayout.FieldRole,
                                  self.checkBoxHighlightCurrentLine)
        self.label_12 = QtWidgets.QLabel(self.groupBox_3)
        self.label_12.setObjectName("label_12")
        self.formLayout.setWidget(2, QtWidgets.QFormLayout.LabelRole,
                                  self.label_12)
        self.checkBoxHighlightWhitespaces = QtWidgets.QCheckBox(
            self.groupBox_3)
        self.checkBoxHighlightWhitespaces.setText("")
        self.checkBoxHighlightWhitespaces.setChecked(True)
        self.checkBoxHighlightWhitespaces.setObjectName(
            "checkBoxHighlightWhitespaces")
        self.formLayout.setWidget(2, QtWidgets.QFormLayout.FieldRole,
                                  self.checkBoxHighlightWhitespaces)
        self.label_13 = QtWidgets.QLabel(self.groupBox_3)
        self.label_13.setObjectName("label_13")
        self.formLayout.setWidget(3, QtWidgets.QFormLayout.LabelRole,
                                  self.label_13)
        self.checkBoxShowErrors = QtWidgets.QCheckBox(self.groupBox_3)
        self.checkBoxShowErrors.setText("")
        self.checkBoxShowErrors.setObjectName("checkBoxShowErrors")
        self.formLayout.setWidget(3, QtWidgets.QFormLayout.FieldRole,
                                  self.checkBoxShowErrors)
        self.verticalLayout.addWidget(self.groupBox_3)
        self.groupBox_2 = QtWidgets.QGroupBox(self.tabEditor)
        self.groupBox_2.setObjectName("groupBox_2")
        self.formLayout_2 = QtWidgets.QFormLayout(self.groupBox_2)
        self.formLayout_2.setObjectName("formLayout_2")
        self.label = QtWidgets.QLabel(self.groupBox_2)
        self.label.setObjectName("label")
        self.formLayout_2.setWidget(1, QtWidgets.QFormLayout.LabelRole,
                                    self.label)
        self.label_14 = QtWidgets.QLabel(self.groupBox_2)
        self.label_14.setText("")
        self.label_14.setObjectName("label_14")
        self.formLayout_2.setWidget(2, QtWidgets.QFormLayout.LabelRole,
                                    self.label_14)
        self.spinBoxEditorTabLen = QtWidgets.QSpinBox(self.groupBox_2)
        self.spinBoxEditorTabLen.setMaximum(99)
        self.spinBoxEditorTabLen.setProperty("value", 4)
        self.spinBoxEditorTabLen.setObjectName("spinBoxEditorTabLen")
        self.formLayout_2.setWidget(1, QtWidgets.QFormLayout.FieldRole,
                                    self.spinBoxEditorTabLen)
        self.checkBoxEditorAutoIndent = QtWidgets.QCheckBox(self.groupBox_2)
        self.checkBoxEditorAutoIndent.setChecked(True)
        self.checkBoxEditorAutoIndent.setObjectName("checkBoxEditorAutoIndent")
        self.formLayout_2.setWidget(2, QtWidgets.QFormLayout.FieldRole,
                                    self.checkBoxEditorAutoIndent)
        self.label_6 = QtWidgets.QLabel(self.groupBox_2)
        self.label_6.setText("")
        self.label_6.setObjectName("label_6")
        self.formLayout_2.setWidget(3, QtWidgets.QFormLayout.LabelRole,
                                    self.label_6)
        self.checkBoxSmartBackspace = QtWidgets.QCheckBox(self.groupBox_2)
        self.checkBoxSmartBackspace.setObjectName("checkBoxSmartBackspace")
        self.formLayout_2.setWidget(3, QtWidgets.QFormLayout.FieldRole,
                                    self.checkBoxSmartBackspace)
        self.verticalLayout.addWidget(self.groupBox_2)
        self.groupBox_4 = QtWidgets.QGroupBox(self.tabEditor)
        self.groupBox_4.setObjectName("groupBox_4")
        self.formLayout_4 = QtWidgets.QFormLayout(self.groupBox_4)
        self.formLayout_4.setObjectName("formLayout_4")
        self.label_2 = QtWidgets.QLabel(self.groupBox_4)
        self.label_2.setObjectName("label_2")
        self.formLayout_4.setWidget(1, QtWidgets.QFormLayout.LabelRole,
                                    self.label_2)
        self.spinBoxEditorCCTriggerLen = QtWidgets.QSpinBox(self.groupBox_4)
        self.spinBoxEditorCCTriggerLen.setProperty("value", 1)
        self.spinBoxEditorCCTriggerLen.setObjectName(
            "spinBoxEditorCCTriggerLen")
        self.formLayout_4.setWidget(1, QtWidgets.QFormLayout.FieldRole,
                                    self.spinBoxEditorCCTriggerLen)
        self.verticalLayout.addWidget(self.groupBox_4)
        self.groupBox = QtWidgets.QGroupBox(self.tabEditor)
        self.groupBox.setObjectName("groupBox")
        self.formLayout_7 = QtWidgets.QFormLayout(self.groupBox)
        self.formLayout_7.setObjectName("formLayout_7")
        self.label_7 = QtWidgets.QLabel(self.groupBox)
        self.label_7.setObjectName("label_7")
        self.formLayout_7.setWidget(0, QtWidgets.QFormLayout.LabelRole,
                                    self.label_7)
        self.lineEditCommentIndicator = QtWidgets.QLineEdit(self.groupBox)
        font = QtGui.QFont()
        font.setFamily("Monospace")
        self.lineEditCommentIndicator.setFont(font)
        self.lineEditCommentIndicator.setObjectName("lineEditCommentIndicator")
        self.formLayout_7.setWidget(0, QtWidgets.QFormLayout.FieldRole,
                                    self.lineEditCommentIndicator)
        self.verticalLayout.addWidget(self.groupBox)
        spacerItem = QtWidgets.QSpacerItem(20, 40,
                                           QtWidgets.QSizePolicy.Minimum,
                                           QtWidgets.QSizePolicy.Expanding)
        self.verticalLayout.addItem(spacerItem)
        icon = QtGui.QIcon()
        icon.addPixmap(QtGui.QPixmap(":/ide-icons/rc/cobol-mimetype.png"),
                       QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.tabWidget.addTab(self.tabEditor, icon, "")
        self.tabStyle = QtWidgets.QWidget()
        self.tabStyle.setObjectName("tabStyle")
        self.verticalLayout_3 = QtWidgets.QVBoxLayout(self.tabStyle)
        self.verticalLayout_3.setObjectName("verticalLayout_3")
        self.groupBox_5 = QtWidgets.QGroupBox(self.tabStyle)
        self.groupBox_5.setObjectName("groupBox_5")
        self.verticalLayout_2 = QtWidgets.QVBoxLayout(self.groupBox_5)
        self.verticalLayout_2.setObjectName("verticalLayout_2")
        self.horizontalLayout_3 = QtWidgets.QHBoxLayout()
        self.horizontalLayout_3.setObjectName("horizontalLayout_3")
        spacerItem1 = QtWidgets.QSpacerItem(40, 20,
                                            QtWidgets.QSizePolicy.Expanding,
                                            QtWidgets.QSizePolicy.Minimum)
        self.horizontalLayout_3.addItem(spacerItem1)
        self.radioButtonColorWhite = QtWidgets.QRadioButton(self.groupBox_5)
        self.radioButtonColorWhite.setChecked(True)
        self.radioButtonColorWhite.setObjectName("radioButtonColorWhite")
        self.horizontalLayout_3.addWidget(self.radioButtonColorWhite)
        self.radioButtonColorDark = QtWidgets.QRadioButton(self.groupBox_5)
        self.radioButtonColorDark.setObjectName("radioButtonColorDark")
        self.horizontalLayout_3.addWidget(self.radioButtonColorDark)
        spacerItem2 = QtWidgets.QSpacerItem(40, 20,
                                            QtWidgets.QSizePolicy.Expanding,
                                            QtWidgets.QSizePolicy.Minimum)
        self.horizontalLayout_3.addItem(spacerItem2)
        self.verticalLayout_2.addLayout(self.horizontalLayout_3)
        self.layoutIconTheme = QtWidgets.QFormLayout()
        self.layoutIconTheme.setContentsMargins(-1, 0, -1, -1)
        self.layoutIconTheme.setObjectName("layoutIconTheme")
        self.lblIconTheme = QtWidgets.QLabel(self.groupBox_5)
        self.lblIconTheme.setObjectName("lblIconTheme")
        self.layoutIconTheme.setWidget(0, QtWidgets.QFormLayout.LabelRole,
                                       self.lblIconTheme)
        self.comboBoxIconTheme = QtWidgets.QComboBox(self.groupBox_5)
        self.comboBoxIconTheme.setObjectName("comboBoxIconTheme")
        self.layoutIconTheme.setWidget(0, QtWidgets.QFormLayout.FieldRole,
                                       self.comboBoxIconTheme)
        self.verticalLayout_2.addLayout(self.layoutIconTheme)
        self.verticalLayout_3.addWidget(self.groupBox_5)
        self.groupBox_6 = QtWidgets.QGroupBox(self.tabStyle)
        self.groupBox_6.setObjectName("groupBox_6")
        self.formLayout_3 = QtWidgets.QFormLayout(self.groupBox_6)
        self.formLayout_3.setObjectName("formLayout_3")
        self.label_3 = QtWidgets.QLabel(self.groupBox_6)
        self.label_3.setObjectName("label_3")
        self.formLayout_3.setWidget(0, QtWidgets.QFormLayout.LabelRole,
                                    self.label_3)
        self.horizontalLayout_4 = QtWidgets.QHBoxLayout()
        self.horizontalLayout_4.setObjectName("horizontalLayout_4")
        self.fontComboBox = QtWidgets.QFontComboBox(self.groupBox_6)
        self.fontComboBox.setFontFilters(
            QtWidgets.QFontComboBox.MonospacedFonts)
        font = QtGui.QFont()
        font.setFamily("DejaVu Sans Mono")
        font.setPointSize(10)
        self.fontComboBox.setCurrentFont(font)
        self.fontComboBox.setObjectName("fontComboBox")
        self.horizontalLayout_4.addWidget(self.fontComboBox)
        self.formLayout_3.setLayout(0, QtWidgets.QFormLayout.FieldRole,
                                    self.horizontalLayout_4)
        self.label_4 = QtWidgets.QLabel(self.groupBox_6)
        self.label_4.setObjectName("label_4")
        self.formLayout_3.setWidget(1, QtWidgets.QFormLayout.LabelRole,
                                    self.label_4)
        self.horizontalLayout_5 = QtWidgets.QHBoxLayout()
        self.horizontalLayout_5.setObjectName("horizontalLayout_5")
        self.spinBoxFontSize = QtWidgets.QSpinBox(self.groupBox_6)
        self.spinBoxFontSize.setProperty("value", 10)
        self.spinBoxFontSize.setObjectName("spinBoxFontSize")
        self.horizontalLayout_5.addWidget(self.spinBoxFontSize)
        self.formLayout_3.setLayout(1, QtWidgets.QFormLayout.FieldRole,
                                    self.horizontalLayout_5)
        self.verticalLayout_3.addWidget(self.groupBox_6)
        self.groupBox_7 = QtWidgets.QGroupBox(self.tabStyle)
        self.groupBox_7.setObjectName("groupBox_7")
        self.gridLayout_4 = QtWidgets.QGridLayout(self.groupBox_7)
        self.gridLayout_4.setObjectName("gridLayout_4")
        self.listWidgetColorSchemes = QtWidgets.QListWidget(self.groupBox_7)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum,
                                           QtWidgets.QSizePolicy.Expanding)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            self.listWidgetColorSchemes.sizePolicy().hasHeightForWidth())
        self.listWidgetColorSchemes.setSizePolicy(sizePolicy)
        self.listWidgetColorSchemes.setObjectName("listWidgetColorSchemes")
        self.gridLayout_4.addWidget(self.listWidgetColorSchemes, 0, 0, 1, 1)
        self.plainTextEdit = CobolCodeEdit(self.groupBox_7)
        self.plainTextEdit.setObjectName("plainTextEdit")
        self.gridLayout_4.addWidget(self.plainTextEdit, 0, 1, 1, 1)
        self.verticalLayout_3.addWidget(self.groupBox_7)
        icon = QtGui.QIcon.fromTheme("applications-graphics")
        self.tabWidget.addTab(self.tabStyle, icon, "")
        self.tabCompiler = QtWidgets.QWidget()
        self.tabCompiler.setObjectName("tabCompiler")
        self.formLayout_6 = QtWidgets.QFormLayout(self.tabCompiler)
        self.formLayout_6.setFieldGrowthPolicy(
            QtWidgets.QFormLayout.AllNonFixedFieldsGrow)
        self.formLayout_6.setObjectName("formLayout_6")
        self.label_8 = QtWidgets.QLabel(self.tabCompiler)
        self.label_8.setObjectName("label_8")
        self.formLayout_6.setWidget(0, QtWidgets.QFormLayout.LabelRole,
                                    self.label_8)
        self.label_9 = QtWidgets.QLabel(self.tabCompiler)
        self.label_9.setObjectName("label_9")
        self.formLayout_6.setWidget(2, QtWidgets.QFormLayout.LabelRole,
                                    self.label_9)
        self.checkBoxFreeFormat = QtWidgets.QCheckBox(self.tabCompiler)
        self.checkBoxFreeFormat.setText("")
        self.checkBoxFreeFormat.setObjectName("checkBoxFreeFormat")
        self.formLayout_6.setWidget(2, QtWidgets.QFormLayout.FieldRole,
                                    self.checkBoxFreeFormat)
        self.label_15 = QtWidgets.QLabel(self.tabCompiler)
        self.label_15.setObjectName("label_15")
        self.formLayout_6.setWidget(3, QtWidgets.QFormLayout.LabelRole,
                                    self.label_15)
        self.verticalLayout_4 = QtWidgets.QVBoxLayout()
        self.verticalLayout_4.setObjectName("verticalLayout_4")
        self.cb_g = QtWidgets.QCheckBox(self.tabCompiler)
        self.cb_g.setObjectName("cb_g")
        self.verticalLayout_4.addWidget(self.cb_g)
        self.cb_ftrace = QtWidgets.QCheckBox(self.tabCompiler)
        self.cb_ftrace.setObjectName("cb_ftrace")
        self.verticalLayout_4.addWidget(self.cb_ftrace)
        self.cb_ftraceall = QtWidgets.QCheckBox(self.tabCompiler)
        self.cb_ftraceall.setObjectName("cb_ftraceall")
        self.verticalLayout_4.addWidget(self.cb_ftraceall)
        self.cb_debugging_line = QtWidgets.QCheckBox(self.tabCompiler)
        self.cb_debugging_line.setObjectName("cb_debugging_line")
        self.verticalLayout_4.addWidget(self.cb_debugging_line)
        self.cb_static = QtWidgets.QCheckBox(self.tabCompiler)
        self.cb_static.setObjectName("cb_static")
        self.verticalLayout_4.addWidget(self.cb_static)
        self.le_compiler_flags = QtWidgets.QLineEdit(self.tabCompiler)
        self.le_compiler_flags.setObjectName("le_compiler_flags")
        self.verticalLayout_4.addWidget(self.le_compiler_flags)
        self.formLayout_6.setLayout(3, QtWidgets.QFormLayout.FieldRole,
                                    self.verticalLayout_4)
        self.label_compiler_path = QtWidgets.QLabel(self.tabCompiler)
        self.label_compiler_path.setObjectName("label_compiler_path")
        self.formLayout_6.setWidget(4, QtWidgets.QFormLayout.LabelRole,
                                    self.label_compiler_path)
        self.checkBoxCustomPath = QtWidgets.QCheckBox(self.tabCompiler)
        self.checkBoxCustomPath.setText("")
        self.checkBoxCustomPath.setObjectName("checkBoxCustomPath")
        self.formLayout_6.setWidget(4, QtWidgets.QFormLayout.FieldRole,
                                    self.checkBoxCustomPath)
        self.lineEditCompilerPath = QtWidgets.QLineEdit(self.tabCompiler)
        self.lineEditCompilerPath.setObjectName("lineEditCompilerPath")
        self.formLayout_6.setWidget(5, QtWidgets.QFormLayout.FieldRole,
                                    self.lineEditCompilerPath)
        self.comboBoxStandard = QtWidgets.QComboBox(self.tabCompiler)
        self.comboBoxStandard.setObjectName("comboBoxStandard")
        self.comboBoxStandard.addItem("")
        self.comboBoxStandard.addItem("")
        self.comboBoxStandard.addItem("")
        self.comboBoxStandard.addItem("")
        self.comboBoxStandard.addItem("")
        self.comboBoxStandard.addItem("")
        self.comboBoxStandard.addItem("")
        self.formLayout_6.setWidget(0, QtWidgets.QFormLayout.FieldRole,
                                    self.comboBoxStandard)
        icon = QtGui.QIcon.fromTheme("exec")
        self.tabWidget.addTab(self.tabCompiler, icon, "")
        self.tabRun = QtWidgets.QWidget()
        self.tabRun.setObjectName("tabRun")
        self.formLayout_5 = QtWidgets.QFormLayout(self.tabRun)
        self.formLayout_5.setFieldGrowthPolicy(
            QtWidgets.QFormLayout.AllNonFixedFieldsGrow)
        self.formLayout_5.setObjectName("formLayout_5")
        self.label_5 = QtWidgets.QLabel(self.tabRun)
        self.label_5.setObjectName("label_5")
        self.formLayout_5.setWidget(0, QtWidgets.QFormLayout.LabelRole,
                                    self.label_5)
        self.checkBoxRunExtTerm = QtWidgets.QCheckBox(self.tabRun)
        self.checkBoxRunExtTerm.setText("")
        self.checkBoxRunExtTerm.setObjectName("checkBoxRunExtTerm")
        self.formLayout_5.setWidget(0, QtWidgets.QFormLayout.FieldRole,
                                    self.checkBoxRunExtTerm)
        self.lineEditRunTerm = QtWidgets.QLineEdit(self.tabRun)
        self.lineEditRunTerm.setObjectName("lineEditRunTerm")
        self.formLayout_5.setWidget(1, QtWidgets.QFormLayout.FieldRole,
                                    self.lineEditRunTerm)
        icon = QtGui.QIcon.fromTheme("media-playback-start")
        self.tabWidget.addTab(self.tabRun, icon, "")
        self.widget_2.addWidget(self.tabWidget, 0, 0, 1, 1)
        self.gridLayout_2.addWidget(self.widget, 0, 0, 1, 1)
        self.gridLayout_3 = QtWidgets.QGridLayout()
        self.gridLayout_3.setContentsMargins(9, 9, 9, 9)
        self.gridLayout_3.setObjectName("gridLayout_3")
        self.buttonBox = QtWidgets.QDialogButtonBox(Dialog)
        self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
        self.buttonBox.setStandardButtons(
            QtWidgets.QDialogButtonBox.Cancel | QtWidgets.QDialogButtonBox.Ok
            | QtWidgets.QDialogButtonBox.Reset
            | QtWidgets.QDialogButtonBox.RestoreDefaults)
        self.buttonBox.setObjectName("buttonBox")
        self.gridLayout_3.addWidget(self.buttonBox, 0, 0, 1, 1)
        self.gridLayout_2.addLayout(self.gridLayout_3, 2, 0, 1, 1)

        self.retranslateUi(Dialog)
        self.tabWidget.setCurrentIndex(0)
        self.buttonBox.accepted.connect(Dialog.accept)
        self.buttonBox.rejected.connect(Dialog.reject)
        QtCore.QMetaObject.connectSlotsByName(Dialog)
コード例 #13
0
 def reset(self, all_tabs=False):
     settings = Settings()
     # Editor
     if self.tabWidget.currentIndex() == 0 or all_tabs:
         self.checkBoxShowErrors.setChecked(settings.show_errors)
         self.checkBoxViewLineNumber.setChecked(settings.display_lines)
         self.checkBoxHighlightCurrentLine.setChecked(
             settings.highlight_caret)
         self.checkBoxHighlightWhitespaces.setChecked(
             settings.show_whitespaces)
         self.spinBoxEditorTabLen.setValue(settings.tab_len)
         self.checkBoxEditorAutoIndent.setChecked(
             settings.enable_autoindent)
         self.spinBoxEditorCCTriggerLen.setValue(
             settings.code_completion_trigger_len)
         self.lineEditCommentIndicator.setText(settings.comment_indicator)
         self.checkBoxSmartBackspace.setChecked(
             settings.enable_smart_backspace)
     # Style
     if self.tabWidget.currentIndex() == 1 or all_tabs:
         rb = (self.radioButtonColorDark if settings.dark_style else
               self.radioButtonColorWhite)
         rb.setChecked(True)
         index = self.comboBoxIconTheme.findText(settings.icon_theme)
         if index != -1:
             self.comboBoxIconTheme.setCurrentIndex(index)
         self.fontComboBox.setCurrentFont(QtGui.QFont(settings.font))
         self.spinBoxFontSize.setValue(settings.font_size)
         self.listWidgetColorSchemes.clear()
         current_index = None
         self.listWidgetColorSchemes.clear()
         for style in PYGMENTS_STYLES:
             self.listWidgetColorSchemes.addItem(style)
             if style == settings.color_scheme:
                 current_index = self.listWidgetColorSchemes.count() - 1
         if current_index:
             self.listWidgetColorSchemes.setCurrentRow(current_index)
     # Run
     if self.tabWidget.currentIndex() == 3 or all_tabs:
         self.checkBoxRunExtTerm.setChecked(settings.external_terminal)
         self.lineEditRunTerm.setVisible(sys.platform != 'win32')
         self.lineEditRunTerm.setEnabled(settings.external_terminal)
         self.lineEditRunTerm.setText(settings.external_terminal_command)
     # compiler
     if self.tabWidget.currentIndex() == 2 or all_tabs:
         self.checkBoxFreeFormat.setChecked(settings.free_format)
         self.comboBoxStandard.setCurrentIndex(
             int(settings.cobol_standard))
         self.checkBoxCustomPath.setChecked(
             settings.custom_compiler_path != system.which('cobc'))
         self.lineEditCompilerPath.setText(settings.custom_compiler_path)
         self.lineEditCompilerPath.setEnabled(
             self.checkBoxCustomPath.isChecked())
         flags = Settings().compiler_flags
         self.cb_debugging_line.setChecked(
             self.cb_debugging_line.text() in flags)
         self.cb_ftrace.setChecked(self.cb_ftrace.text() in flags)
         self.cb_ftraceall.setChecked(self.cb_ftraceall.text() in flags)
         self.cb_g.setChecked(self.cb_g.text() in flags)
         self.cb_static.setChecked(self.cb_static.text() in flags)
         for v in self.flags_in_checkbox:
             try:
                 flags.remove(v)
             except ValueError:
                 pass
         self.le_compiler_flags.setText(' '.join(flags))