Files
Jungfraujoch/viewer/JFJochViewerMenu.h
T
leonarski_fandClaude Opus 4.8 f5a146d212 viewer: Phase 1a — dockable shell with saved perspectives
Make the layout reconfigurable, the foundation for the redesign:

- The diffraction image becomes the central widget; the right-hand side panel
  is now a dockable "Inspector" (QDockWidget, right area).
- Every dock and toolbar gets a stable objectName so QMainWindow saveState /
  restoreState round-trips. Dataset-info docks are numbered uniquely.
- Persist geometry + dock state to QSettings on close and restore on launch,
  so the user's arrangement resumes.
- New "View" menu with Image / Processing perspectives (show/hide the bottom
  plots + jobs panel) and "Reset layout" (back to the as-built arrangement,
  captured at startup).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-23 16:26:15 +02:00

60 lines
1.8 KiB
C++

// SPDX-FileCopyrightText: 2025 Filip Leonarski, Paul Scherrer Institute <filip.leonarski@psi.ch>
// SPDX-License-Identifier: GPL-3.0-only
#pragma once
#include <QMenuBar>
#include "windows/JFJochHelperWindow.h"
class JFJochLicenseWindow;
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;
JFJochLicenseWindow *licenseWindow = 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);
signals:
void fileOpenSelected(const QString &filename, qint64 image_number, qint64 summation, bool retry);
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();
private slots:
void aboutSelected();
void licensesSelected();
void quitSelected();
void openSelected();
void openHttpSelected();
void closeSelected();
void saveUserMaskAsTiffSelected();
void uploadUserMaskAction();
private:
void openLoadUserMaskTiff(bool replace);
};