viewer: write processing output next to the input file

The New-job dialog seeded the output prefix from QFileInfo::completeBaseName(),
which drops the directory, so _process.h5/.cif/.mtz landed in the viewer's
working directory (wherever it was installed) instead of beside the dataset.
Seed it with the input file's absolute directory instead; the field stays
editable. Relies on the trusted output-path support so the absolute prefix is
accepted by the writer.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-07-11 09:40:28 +02:00
co-authored by Claude Opus 4.8
parent 8858951419
commit 343af8deed
@@ -12,6 +12,7 @@
#include <QComboBox>
#include <QDateTime>
#include <QDialog>
#include <QDir>
#include <QFont>
#include <QIcon>
#include <QDialogButtonBox>
@@ -140,8 +141,14 @@ int JFJochProcessingJobsWindow::askJob(const ReprocessingInputs &inputs, JobSpec
auto *save = new QCheckBox("Save _process.h5", &dlg);
save->setChecked(true);
const QString stem = QFileInfo(inputs.file).completeBaseName().remove(QStringLiteral("_master"));
auto *prefix = new QLineEdit(QStringLiteral("%1_run%2").arg(stem).arg(job_counter_ + 1), &dlg);
// Default the output next to the input file, not the viewer's working directory (the viewer starts
// wherever it was installed). This is an absolute path; Rugnux writes it via the trusted setter,
// and toNativeSeparators keeps a UNC/Windows path openable afterwards.
const QFileInfo fi(inputs.file);
const QString stem = fi.completeBaseName().remove(QStringLiteral("_master"));
const QString default_prefix = QDir::toNativeSeparators(
QStringLiteral("%1/%2_run%3").arg(fi.absolutePath(), stem).arg(job_counter_ + 1));
auto *prefix = new QLineEdit(default_prefix, &dlg);
// 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.