Exemplo n.º 1
0
    def _makeDirWidgets(self):
        lbl = QtWidgets.QLabel("Test Root")
        lbl.setToolTip(
            "Input a python module path or an absolute dir path in the lineEdit for the tests."
        )
        self._rootDirLE = rootpathedit.RootPathEdit(self)
        self._rootDirLE.rootPathChanged.connect(self._switchToTestRootPath)
        self._rootDirLE.rootDirPicked.connect(self._onBrowseTestsRootDir)
        self._rootDirLE.topDirPicked.connect(self._onBrowseTopDir)
        self._rootDirLE.saveCurrentDirSettings.connect(
            self._onSaveCurrentDirSettings)
        self._rootDirLE.loadSavedDirPair.connect(self._loadSavedDirPair)
        self._rootDirLE.deleteCurrentDirSettings.connect(
            self._onDeleteCurrentDirSettings)

        self._panelVisBtn = uiutils.makeIconButton(self._panelStateIconSet[-1],
                                                   self)
        self._panelVisBtn.setToolTip(
            "Switch the test tree view and the log browser visibility.")
        self._panelVisBtn.clicked.connect(self._onPanelVisButtonClicked)
        self._makeRunnerConfigButton()

        self._dirLayout.addWidget(lbl)
        self._dirLayout.addWidget(self._rootDirLE)
        self._dirLayout.addWidget(self._panelVisBtn)
        self._dirLayout.addWidget(self._runnerConfigBtn)

        self._updateDirUI()
Exemplo n.º 2
0
    def __init__(self, parent=None):
        QtWidgets.QDialog.__init__(self, parent)
        self.setWindowTitle("{} Preference".format(constants.APP_NAME))

        self._mainLayout = uiutils.makeMainLayout(self)
        self._formLayout = uiutils.makeMinorLayout(QtWidgets.QFormLayout)
        self._mainLayout.addLayout(self._formLayout)
        self._formLayout.setLabelAlignment(QtCore.Qt.AlignRight)

        # Code viewing config
        self._codeEditorLE = QtWidgets.QLineEdit(self)
        editorSetting = gotocode.CodeLineVisitor.config()
        self._codeEditorLE.setText(editorSetting)
        self._codeEditorLE.editingFinished.connect(
            self._onCodeEditorEditFinished)
        self._codeEditorLE.setPlaceholderText(
            "Example: pargram $file -argToLine $line")
        self._codeEditorLE.setToolTip(
            "Input the command to jump to the code at the line. \n"
            "$file is the placeholder for file path, $line is the line number."
        )
        _annoText = QtWidgets.QLabel("Default: {}".format(
            constants.CONFIG_KEY_CODE_EDITOR_DEFAULT))
        _annoText.setEnabled(False)

        self._formLayout.addRow("Go To Code Line", self._codeEditorLE)
        self._formLayout.addRow("", _annoText)

        self.setMinimumWidth(400)
        self.setMinimumHeight(100)

        self.destroyed.connect(self._onDialogDeleted)
Exemplo n.º 3
0
    def _makeLogBrowserTopWidgets(self, layout):
        _console = QtWidgets.QLabel("Log Browser")

        self._logSearchLE = btnLineEdit.InlineButtonLineEdit(
            withClearButton=True, parent=self)
        self._logSearchLE.setToolTip(
            "Enter to search next keyword in the log browser, ctrl+Enter to search backward."
        )
        self._logSearchLE.setPlaceholderText("Input to search")
        self._logSearchLE.returnPressed.connect(self._applyLoggingSearchText)

        self._wholeWordBtn = uiutils.makeIconButton(self._wholeWordIcon)
        self._wholeWordBtn.setCheckable(True)
        self._logSearchLE.addButton("wholeWord", self._wholeWordBtn)

        self._sensitiveBtn = uiutils.makeIconButton(self._caseSensitiveIcon)
        self._sensitiveBtn.setCheckable(True)
        self._logSearchLE.addButton("caseSensitive", self._sensitiveBtn)

        self._clearLogBtn = uiutils.makeIconButton(self._clearLogIcon, self)
        self._clearLogBtn.setToolTip("Clear the log browser logging.")
        self._clearLogBtn.clicked.connect(self._logBrowser.clear)

        layout.addWidget(_console, 0)
        layout.addStretch(1)
        layout.addWidget(self._logSearchLE, 0)
        layout.addWidget(self._clearLogBtn, 0)