| 216 | } |
| 217 | |
| 218 | void SettingsDialog::validateEditPythonPath() |
| 219 | { |
| 220 | const auto pythonPath = mUI->mEditPythonPath->text(); |
| 221 | if (pythonPath.isEmpty()) { |
| 222 | mUI->mEditPythonPath->setStyleSheet(""); |
| 223 | mUI->mPythonPathWarning->hide(); |
| 224 | return; |
| 225 | } |
| 226 | |
| 227 | QFileInfo pythonPathInfo(pythonPath); |
| 228 | if (!pythonPathInfo.exists() || |
| 229 | !pythonPathInfo.isFile() || |
| 230 | !pythonPathInfo.isExecutable()) { |
| 231 | mUI->mEditPythonPath->setStyleSheet("QLineEdit {border: 1px solid red}"); |
| 232 | mUI->mPythonPathWarning->setText(tr("The executable file \"%1\" is not available").arg(pythonPath)); |
| 233 | mUI->mPythonPathWarning->show(); |
| 234 | } else { |
| 235 | mUI->mEditPythonPath->setStyleSheet(""); |
| 236 | mUI->mPythonPathWarning->hide(); |
| 237 | } |
| 238 | } |
| 239 | |
| 240 | void SettingsDialog::addApplication() |
| 241 | { |