Build Packages / Create release (push) Successful in 18s
Build Packages / build:rugnux:aarch64 (cross) (push) Successful in 7m41s
Build Packages / build:rugnux-tgz (x86_64) (push) Successful in 8m36s
Build Packages / build:viewer-tgz:cpu (push) Successful in 10m51s
Build Packages / build:viewer-tgz:cuda (push) Successful in 11m28s
Build Packages / build:rpm (rocky9_nocuda) (push) Successful in 15m37s
Build Packages / build:rpm (rocky8_nocuda) (push) Successful in 15m40s
Build Packages / build:windows:nocuda (push) Successful in 16m50s
Build Packages / build:windows:cuda (push) Successful in 19m6s
Build Packages / HDF5 consumer tests (DIALS, XDS) (push) Successful in 23m20s
Build Packages / build:rpm (ubuntu2204_nocuda) (push) Successful in 15m57s
Build Packages / build:rugnux:windows (push) Successful in 10m23s
Build Packages / build:rpm (ubuntu2404_nocuda) (push) Successful in 19m21s
Build Packages / Generate python client (push) Successful in 48s
Build Packages / build:rpm (rocky8_sls9) (push) Successful in 19m11s
Build Packages / Build documentation (push) Successful in 1m23s
Build Packages / build:rpm (rocky9_sls9) (push) Successful in 19m36s
Build Packages / build:rpm (rocky8) (push) Successful in 17m45s
Build Packages / build:rpm (rocky9) (push) Successful in 19m12s
Build Packages / build:rpm (ubuntu2404) (push) Successful in 14m20s
Build Packages / build:rpm (ubuntu2204) (push) Successful in 15m11s
Build Packages / Unit tests (push) Successful in 1h42m33s
Two things a beamline user did every session by hand. The browser's default root now resolves JUNGFRAUJOCH_DATA_ROOT, then the root last used, then - for an SLS account, which is eNNNNN against a pNNNNN group - /sls/mx/data/pNNNNN/raw, then home. The environment variable stays the general mechanism and keeps precedence; the account rule is there because it needs nothing rolled out to benefit from it. Both go through DefaultRoot(), so a reset resolves them the same way a first run does. A dataset opened from the File menu or over D-Bus now expands and selects itself in the browser when it lies inside the current root. Containment is tested on resolved paths, so a sibling directory sharing a prefix is not inside it. Neither says anything when it does not apply: an account that is not a beamline one, a directory that is not there, a dataset outside the root - each is a bare return, because for everyone who is not at this one facility the condition should be invisible. Following never writes the root, so the location the user chose is still the location they get back. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011GxZqDiFP3KqriBhNdcR56
55 lines
2.1 KiB
C++
55 lines
2.1 KiB
C++
// SPDX-FileCopyrightText: 2026 Filip Leonarski, Paul Scherrer Institute <filip.leonarski@psi.ch>
|
|
// SPDX-License-Identifier: GPL-3.0-only
|
|
|
|
#pragma once
|
|
|
|
#include <QWidget>
|
|
#include <QFileSystemModel>
|
|
#include <QSortFilterProxyModel>
|
|
|
|
class QLineEdit;
|
|
class QTreeView;
|
|
class QModelIndex;
|
|
|
|
// Left-side dock alternative to the Processing (reprocessing settings) panel: a directory tree rooted at a
|
|
// configurable data root, filtered down to subdirectories and *_master.h5 / *_process.h5 / *.cbf
|
|
// files, for browsing to and opening a dataset without caring about reprocessing. Backed by QFileSystemModel,
|
|
// which only lists a directory once it is expanded - so a root with hundreds of sibling directories
|
|
// (e.g. an SLS beamline's /sls/mx/data/) costs one readdir at each level actually opened, never a
|
|
// recursive scan of the whole tree.
|
|
class JFJochViewerFileBrowser : public QWidget {
|
|
Q_OBJECT
|
|
|
|
QLineEdit *root_edit_;
|
|
QLineEdit *filter_edit_;
|
|
QTreeView *tree_;
|
|
QFileSystemModel *model_;
|
|
QSortFilterProxyModel *proxy_;
|
|
|
|
void SetRoot(const QString &path);
|
|
[[nodiscard]] static QString DefaultRoot();
|
|
// An SLS account eNNNNN browses its proposal group's raw data, which is pNNNNN with the
|
|
// same five digits; empty for any other user name, on any platform.
|
|
[[nodiscard]] static QString SlsDataRoot(const QString &user);
|
|
|
|
public slots:
|
|
// "Reset all settings to defaults": back to the root a fresh start would pick.
|
|
void ResetToDefaultRoot();
|
|
|
|
private slots:
|
|
void onBrowseClicked();
|
|
void onRootEditingFinished();
|
|
void onDoubleClicked(const QModelIndex &index);
|
|
|
|
signals:
|
|
// Mirrors JFJochViewerMenu::fileOpenSelected, so the window wires it to LoadFile the same way.
|
|
void openDataset(const QString &filename, qint64 image_number, qint64 summation, bool retry);
|
|
|
|
public:
|
|
explicit JFJochViewerFileBrowser(QWidget *parent = nullptr);
|
|
|
|
// A dataset opened elsewhere (menu, D-Bus) and lying inside the current root moves the tree's
|
|
// selection to it; one outside the root leaves the browser exactly as it was.
|
|
void FollowPath(const QString &path);
|
|
};
|