// SPDX-FileCopyrightText: 2026 Filip Leonarski, Paul Scherrer Institute // SPDX-License-Identifier: GPL-3.0-only #include "JFJochSettingsWindow.h" #include JFJochSettingsWindow::JFJochSettingsWindow(const SpotFindingSettings &spot, const IndexingSettings &indexing, const AzimuthalIntegrationSettings &azint, const BraggIntegrationSettings &bragg, const ScalingSettings &scaling, QWidget *parent) : JFJochHelperWindow(parent) { setWindowTitle("Processing settings"); // Reuse the existing spot/index + azimuthal windows: build them (kept hidden) and lift their // content into tabs, so all their existing widgets, logic and signals keep working. m_processing = new JFJochViewerProcessingWindow(spot, indexing, this); m_azint = new JFJochAzIntWindow(azint, this); m_bragg = new JFJochBraggIntegrationPanel(bragg, this); m_scaling = new JFJochScalingPanel(scaling, this); auto *tabs = new QTabWidget(this); tabs->addTab(m_processing->TakeSpotFindingPage(), "Spot finding"); tabs->addTab(m_processing->TakeIndexingPage(), "Indexing"); tabs->addTab(m_azint->takeCentralWidget(), "Azimuthal"); tabs->addTab(m_bragg, "Bragg integration"); tabs->addTab(m_scaling, "Scaling"); setCentralWidget(tabs); m_processing->hide(); // the emptied shells stay alive only to drive their signals m_azint->hide(); connect(m_processing, &JFJochViewerProcessingWindow::settingsChanged, this, &JFJochSettingsWindow::spotFindingChanged); connect(m_azint, &JFJochAzIntWindow::settingsChanged, this, &JFJochSettingsWindow::azintChanged); connect(m_bragg, &JFJochBraggIntegrationPanel::settingsChanged, this, &JFJochSettingsWindow::braggChanged); connect(m_scaling, &JFJochScalingPanel::settingsChanged, this, &JFJochSettingsWindow::scalingChanged); } void JFJochSettingsWindow::datasetLoaded(std::shared_ptr in_dataset) { m_processing->setUnitCellKnown(in_dataset && in_dataset->experiment.GetUnitCell().has_value()); }