viewer: add a Browse button to the processing output prefix
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 <noreply@anthropic.com>
This commit is contained in:
@@ -13,6 +13,7 @@
|
||||
#include <QDateTime>
|
||||
#include <QDialog>
|
||||
#include <QDir>
|
||||
#include <QFileDialog>
|
||||
#include <QFont>
|
||||
#include <QIcon>
|
||||
#include <QDialogButtonBox>
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user