The viewer reads what rugnux reads: HDF5 files with a /metadata panel table, Cheetah CXI single-panel stacks and LCLS-I XTC streams, by their content as the raw sweeps are. The open dialog takes several files; they are one dataset (as on rugnux's command line), and a CrystFEL geometry file among them is their module geometry. The images are shown in detector units, at the geometry the files state. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015CeEGgpKdfkCTJb3YNMJcu
89 lines
3.4 KiB
C++
89 lines
3.4 KiB
C++
// SPDX-FileCopyrightText: 2025 Filip Leonarski, Paul Scherrer Institute <filip.leonarski@psi.ch>
|
|
// SPDX-License-Identifier: GPL-3.0-only
|
|
|
|
#pragma once
|
|
|
|
#include <QActionGroup>
|
|
#include <QFont>
|
|
#include <QMenuBar>
|
|
|
|
#include "windows/JFJochHelperWindow.h"
|
|
|
|
class JFJochLicenseWindow;
|
|
class JFJochMouseShortcutsWindow;
|
|
class JFJochAcknowledgementWindow;
|
|
class QDockWidget;
|
|
|
|
class JFJochViewerMenu : public QMenuBar {
|
|
Q_OBJECT
|
|
QAction *toggleImageWindowAction = nullptr;
|
|
QAction *toggleMetadataWindowAction = nullptr;
|
|
QAction *toggleSpotWindowAction = nullptr;
|
|
QAction *toggleReflectionWindowAction = nullptr;
|
|
QAction *toggleProcessingWindowAction = nullptr;
|
|
QAction *toggleCalibrationWindowAction = nullptr;
|
|
|
|
QMenu *windowMenu = nullptr;
|
|
QMenu *viewMenu = nullptr;
|
|
QAction *viewTogglesAnchor = nullptr; // View-menu toggles owned elsewhere go before this
|
|
QActionGroup *fontZoomGroup = nullptr;
|
|
QFont baseFont; // the font the desktop handed us; the zoom is a multiple of it
|
|
int fontZoom = 100; // per cent: 100, 125 or 150
|
|
JFJochLicenseWindow *licenseWindow = nullptr;
|
|
JFJochMouseShortcutsWindow *mouseShortcutsWindow = nullptr;
|
|
JFJochAcknowledgementWindow *acknowledgementWindow = nullptr;
|
|
public:
|
|
explicit JFJochViewerMenu(QWidget *parent = nullptr);
|
|
~JFJochViewerMenu() override = default;
|
|
|
|
void AddWindowEntry(JFJochHelperWindow *window, const QString &name);
|
|
// Adds a dock's show/hide toggle to the Window menu (for docked panels).
|
|
void AddDockEntry(QDockWidget *dock, const QString &name);
|
|
// Adds a checkable action owned by another widget (e.g. a toolbar) to the View menu.
|
|
void AddViewToggle(QAction *action);
|
|
// Back to 100 %, for "Reset all settings to defaults".
|
|
void ResetFontZoom();
|
|
// 100, 125 or 150 per cent; also reachable from the display toolbar's size buttons.
|
|
void SetFontZoom(int percent);
|
|
[[nodiscard]] int FontZoom() const { return fontZoom; }
|
|
|
|
public slots:
|
|
void openSelected(); // also reachable from the toolbar's open-dataset button
|
|
void openHttpSelected(); // also reachable from the toolbar's HTTP-sync button
|
|
void setHttpToken(const QString &token); // pre-fills the token field of the HTTP dialog
|
|
|
|
signals:
|
|
void fileOpenSelected(const QString &filename, qint64 image_number, qint64 summation, bool retry);
|
|
// Emitted just before fileOpenSelected when the open dialog gave the files of one dataset.
|
|
void fileListSelected(const QStringList &files);
|
|
void httpTokenSelected(const QString &token); // emitted before fileOpenSelected for an HTTP URL
|
|
void fileCloseSelected();
|
|
|
|
void saveUserMaskTiffSelected(const QString &filename);
|
|
void loadUserMaskTiffSelected(const QString &filename, bool replace);
|
|
void uploadUserMaskSelected();
|
|
void clearUserMaskSelected();
|
|
void openDatasetInfo();
|
|
|
|
void imageLayoutSelected();
|
|
void processingLayoutSelected();
|
|
void resetLayoutSelected();
|
|
void resetSettingsSelected();
|
|
void fontZoomChanged(int percent);
|
|
|
|
private slots:
|
|
void aboutSelected();
|
|
void licensesSelected();
|
|
void mouseShortcutsSelected();
|
|
void acknowledgementsSelected();
|
|
void quitSelected();
|
|
void closeSelected();
|
|
|
|
void saveUserMaskAsTiffSelected();
|
|
void uploadUserMaskAction();
|
|
|
|
private:
|
|
QString http_token;
|
|
void openLoadUserMaskTiff(bool replace);
|
|
};
|