* @brief Opens a file dialog to select the executable for Launch mode. */
| 360 | * @brief Opens a file dialog to select the executable for Launch mode. |
| 361 | */ |
| 362 | void IO::Drivers::Process::browseExecutable() |
| 363 | { |
| 364 | const auto start = m_executable.isEmpty() |
| 365 | ? QStandardPaths::writableLocation(QStandardPaths::HomeLocation) |
| 366 | : QFileInfo(m_executable).absolutePath(); |
| 367 | |
| 368 | auto* dialog = new QFileDialog(qApp->activeWindow(), tr("Select Executable"), start); |
| 369 | |
| 370 | dialog->setFileMode(QFileDialog::ExistingFile); |
| 371 | dialog->setAttribute(Qt::WA_DeleteOnClose); |
| 372 | |
| 373 | connect(dialog, &QFileDialog::fileSelected, this, [this](const QString& path) { |
| 374 | if (path.isEmpty()) |
| 375 | return; |
| 376 | |
| 377 | QMetaObject::invokeMethod(this, [this, path]() { setExecutable(path); }, Qt::QueuedConnection); |
| 378 | }); |
| 379 | |
| 380 | dialog->open(); |
| 381 | } |
| 382 | |
| 383 | /** |
| 384 | * @brief Opens a folder dialog to select the working directory for Launch mode. |
nothing calls this directly
no test coverage detected