From 343af8deedb4cb9a211da30918413e39bc7743d0 Mon Sep 17 00:00:00 2001 From: leonarski_f Date: Sat, 11 Jul 2026 09:40:28 +0200 Subject: [PATCH] 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 --- viewer/windows/JFJochProcessingJobsWindow.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/viewer/windows/JFJochProcessingJobsWindow.cpp b/viewer/windows/JFJochProcessingJobsWindow.cpp index f6e56d2e..8bf569ae 100644 --- a/viewer/windows/JFJochProcessingJobsWindow.cpp +++ b/viewer/windows/JFJochProcessingJobsWindow.cpp @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include @@ -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.