* @brief Opens a folder dialog to select the working directory for Launch mode. */
| 384 | * @brief Opens a folder dialog to select the working directory for Launch mode. |
| 385 | */ |
| 386 | void IO::Drivers::Process::browseWorkingDir() |
| 387 | { |
| 388 | const auto start = m_workingDir.isEmpty() |
| 389 | ? QStandardPaths::writableLocation(QStandardPaths::HomeLocation) |
| 390 | : m_workingDir; |
| 391 | |
| 392 | auto* dialog = new QFileDialog(qApp->activeWindow(), tr("Select Working Directory"), start); |
| 393 | |
| 394 | dialog->setFileMode(QFileDialog::Directory); |
| 395 | dialog->setOption(QFileDialog::ShowDirsOnly, true); |
| 396 | dialog->setAttribute(Qt::WA_DeleteOnClose); |
| 397 | |
| 398 | connect(dialog, &QFileDialog::fileSelected, this, [this](const QString& path) { |
| 399 | if (path.isEmpty()) |
| 400 | return; |
| 401 | |
| 402 | QMetaObject::invokeMethod(this, [this, path]() { setWorkingDir(path); }, Qt::QueuedConnection); |
| 403 | }); |
| 404 | |
| 405 | dialog->open(); |
| 406 | } |
| 407 | |
| 408 | /** |
| 409 | * @brief Opens a file dialog to select the named pipe / FIFO path. |
nothing calls this directly
no test coverage detected