From 4374babe26dec7410205eb3a0c06f5ccf8fe2c44 Mon Sep 17 00:00:00 2001 From: leonarski_f Date: Sat, 11 Jul 2026 10:06:04 +0200 Subject: [PATCH] viewer: add a Browse button to the processing output prefix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The output prefix was a plain text field; add a 'Browse…' button that opens a file dialog to pick the output location. The chosen name is treated as a prefix (the _process.h5 / .mtz / .cif suffixes are appended), so a trailing extension is dropped, and the result is stored with native separators. Co-Authored-By: Claude Opus 4.8 --- viewer/windows/JFJochProcessingJobsWindow.cpp | 21 ++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/viewer/windows/JFJochProcessingJobsWindow.cpp b/viewer/windows/JFJochProcessingJobsWindow.cpp index 73bb0a80..375809a2 100644 --- a/viewer/windows/JFJochProcessingJobsWindow.cpp +++ b/viewer/windows/JFJochProcessingJobsWindow.cpp @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include @@ -157,6 +158,24 @@ int JFJochProcessingJobsWindow::askJob(const ReprocessingInputs &inputs, JobSpec QStringLiteral("%1/%2_run%3").arg(fi.absolutePath(), stem).arg(job_counter_ + 1)); auto *prefix = new QLineEdit(default_prefix, &dlg); + // "Browse…" opens a file dialog to choose where the outputs go. The chosen name is used as a prefix + // (suffixes like _process.h5 / .cif are appended), so drop a trailing extension. + auto *browse = new QPushButton("Browse…", &dlg); + connect(browse, &QPushButton::clicked, &dlg, [&dlg, prefix] { + const QString sel = QFileDialog::getSaveFileName(&dlg, "Output file prefix", prefix->text(), + "All Files (*)", nullptr, + QFileDialog::DontConfirmOverwrite); + if (sel.isEmpty()) + return; + const QFileInfo pf(sel); + prefix->setText(QDir::toNativeSeparators(pf.dir().filePath(pf.completeBaseName()))); + }); + auto *prefixRow = new QWidget(&dlg); + auto *prefixRowLayout = new QHBoxLayout(prefixRow); + prefixRowLayout->setContentsMargins(0, 0, 0, 0); + prefixRowLayout->addWidget(prefix); + prefixRowLayout->addWidget(browse); + // Rotation-vs-stills mode (rotation indexing + partiality + rot3d) is set in the settings panel via // "Process as stills"; the dialog only collects run options. Scaling applies to MX full analysis. auto *scaling = new QCheckBox("Scale && merge", &dlg); @@ -169,7 +188,7 @@ int JFJochProcessingJobsWindow::askJob(const ReprocessingInputs &inputs, JobSpec form->addRow("Threads", threads); form->addRow(save_h5); form->addRow(save_merged); - form->addRow("Output prefix", prefix); + form->addRow("Output prefix", prefixRow); form->addRow(scaling); int result = 0;