From cddd6679bb75f834f9812cac573ac5b5ce46d5bc Mon Sep 17 00:00:00 2001 From: "Joachim Wuttke (h)" <j.wuttke@fz-juelich.de> Date: Fri, 17 Nov 2023 22:21:16 +0100 Subject: [PATCH] ctd --- GUI/View/Data/RealDataPresenter.cpp | 8 +++---- .../MaskEditingFrame.cpp} | 22 +++++++++---------- .../MaskEditingFrame.h} | 14 ++++++------ .../SpecularFrame.cpp} | 16 +++++++------- .../SpecularFrame.h} | 14 ++++++------ GUI/View/Job/JobResultsPresenter.cpp | 4 ++-- 6 files changed, 39 insertions(+), 39 deletions(-) rename GUI/View/{Data/RealDataMaskWidget.cpp => Frame/MaskEditingFrame.cpp} (89%) rename GUI/View/{Data/RealDataMaskWidget.h => Frame/MaskEditingFrame.h} (75%) rename GUI/View/{PlotSpecular/SpecularDataWidget.cpp => Frame/SpecularFrame.cpp} (79%) rename GUI/View/{PlotSpecular/SpecularDataWidget.h => Frame/SpecularFrame.h} (71%) diff --git a/GUI/View/Data/RealDataPresenter.cpp b/GUI/View/Data/RealDataPresenter.cpp index 3ed22dcfb5e..e9857a23474 100644 --- a/GUI/View/Data/RealDataPresenter.cpp +++ b/GUI/View/Data/RealDataPresenter.cpp @@ -15,18 +15,18 @@ #include "GUI/View/Data/RealDataPresenter.h" #include "Base/Util/Assert.h" #include "GUI/Model/Device/DatafileItem.h" -#include "GUI/View/Data/RealDataMaskWidget.h" +#include "GUI/View/Frame/MaskEditingFrame.h" #include "GUI/View/Frame/Plot2+ProjnFrame.h" #include "GUI/View/Frame/Plot2DFrame.h" -#include "GUI/View/PlotSpecular/SpecularDataWidget.h" +#include "GUI/View/Frame/SpecularFrame.h" RealDataPresenter::RealDataPresenter(QWidget* parent) : ItemComboWidget(parent) { registerWidget("Heat Map", create_new<Plot2DFrame>); registerWidget("Projections", create_new<Plot2DWithProjectionFrame>); - registerWidget("Mask Editor", create_new<RealDataMaskWidget>); - registerWidget("Reflectometry (Graph only)", create_new<SpecularDataWidget>); + registerWidget("Mask Editor", create_new<MaskEditingFrame>); + registerWidget("Reflectometry (Graph only)", create_new<SpecularFrame>); } QString RealDataPresenter::itemPresentation() const diff --git a/GUI/View/Data/RealDataMaskWidget.cpp b/GUI/View/Frame/MaskEditingFrame.cpp similarity index 89% rename from GUI/View/Data/RealDataMaskWidget.cpp rename to GUI/View/Frame/MaskEditingFrame.cpp index e8697a3e8f7..ac89506a9bd 100644 --- a/GUI/View/Data/RealDataMaskWidget.cpp +++ b/GUI/View/Frame/MaskEditingFrame.cpp @@ -2,8 +2,8 @@ // // BornAgain: simulate and fit reflection and scattering // -//! @file GUI/View/Data/RealDataMaskWidget.cpp -//! @brief Implements class RealDataMaskWidget. +//! @file GUI/View/Frame/MaskEditingFrame.cpp +//! @brief Implements class MaskEditingFrame. //! //! @homepage http://www.bornagainproject.org //! @license GNU General Public License v3 or higher (see COPYING) @@ -12,7 +12,7 @@ // // ************************************************************************************************ -#include "GUI/View/Data/RealDataMaskWidget.h" +#include "GUI/View/Frame/MaskEditingFrame.h" #include "GUI/Model/Data/Data2DItem.h" #include "GUI/Model/Mask/MaskContainerModel.h" #include "GUI/Model/Mask/MaskItems.h" @@ -23,7 +23,7 @@ #include "GUI/View/Setup/MaskEditorPropertyPanel.h" #include <QSplitter> -RealDataMaskWidget::RealDataMaskWidget(QWidget* parent) +MaskEditingFrame::MaskEditingFrame(QWidget* parent) : DataAccessWidget(parent) , m_editorActions(new MaskEditorActions(this)) , m_editorPropertyPanel(new MaskEditorPropertyPanel) @@ -56,7 +56,7 @@ RealDataMaskWidget::RealDataMaskWidget(QWidget* parent) // tool panel request is propagated from editorActions to this MaskEditor connect(m_editorActions, &MaskEditorActions::propertyPanelRequest, this, - &RealDataMaskWidget::onPropertyPanelRequest); + &MaskEditingFrame::onPropertyPanelRequest); // save plot request is propagated from editorActions to graphics scene connect(m_editorActions, &MaskEditorActions::savePlotRequest, m_editorCanvas, @@ -91,7 +91,7 @@ RealDataMaskWidget::RealDataMaskWidget(QWidget* parent) m_editorActions, &MaskEditorActions::onItemContextMenuRequest); } -void RealDataMaskWidget::setJobOrDatafileItem(QObject* job_or_real_item) +void MaskEditingFrame::setJobOrDatafileItem(QObject* job_or_real_item) { setBaseItem(job_or_real_item); m_editorPropertyPanel->setJobOrDatafileItem(job_or_real_item); @@ -99,31 +99,31 @@ void RealDataMaskWidget::setJobOrDatafileItem(QObject* job_or_real_item) } //! shows/hides right panel with properties -void RealDataMaskWidget::onPropertyPanelRequest() +void MaskEditingFrame::onPropertyPanelRequest() { m_editorPropertyPanel->setPanelHidden(!m_editorPropertyPanel->isHidden()); } //! Returns list of actions intended for styled toolbar (on the top). -QList<QAction*> RealDataMaskWidget::actionList() +QList<QAction*> MaskEditingFrame::actionList() { return m_editorActions->topToolbarActions(); } -void RealDataMaskWidget::showEvent(QShowEvent*) +void MaskEditingFrame::showEvent(QShowEvent*) { if (currentData2DItem()) setContextMW(); } -void RealDataMaskWidget::hideEvent(QHideEvent*) +void MaskEditingFrame::hideEvent(QHideEvent*) { m_editorPropertyPanel->resetContextMPP(); m_editorCanvas->resetContextMEC(); } -void RealDataMaskWidget::setContextMW() +void MaskEditingFrame::setContextMW() { ASSERT(currentData2DItem()); diff --git a/GUI/View/Data/RealDataMaskWidget.h b/GUI/View/Frame/MaskEditingFrame.h similarity index 75% rename from GUI/View/Data/RealDataMaskWidget.h rename to GUI/View/Frame/MaskEditingFrame.h index fadc24d9281..1bcb30611f9 100644 --- a/GUI/View/Data/RealDataMaskWidget.h +++ b/GUI/View/Frame/MaskEditingFrame.h @@ -2,8 +2,8 @@ // // BornAgain: simulate and fit reflection and scattering // -//! @file GUI/View/Data/RealDataMaskWidget.h -//! @brief Defines class RealDataMaskWidget. +//! @file GUI/View/Frame/MaskEditingFrame.h +//! @brief Defines class MaskEditingFrame. //! //! @homepage http://www.bornagainproject.org //! @license GNU General Public License v3 or higher (see COPYING) @@ -12,8 +12,8 @@ // // ************************************************************************************************ -#ifndef BORNAGAIN_GUI_VIEW_DATA_REALDATAMASKWIDGET_H -#define BORNAGAIN_GUI_VIEW_DATA_REALDATAMASKWIDGET_H +#ifndef BORNAGAIN_GUI_VIEW_FRAME_MASKEDITINGFRAME_H +#define BORNAGAIN_GUI_VIEW_FRAME_MASKEDITINGFRAME_H #include "GUI/View/Access/DataAccessWidget.h" @@ -23,10 +23,10 @@ class MaskEditorPropertyPanel; //! Mask editing for DatafileItem on DataView. -class RealDataMaskWidget : public DataAccessWidget { +class MaskEditingFrame : public DataAccessWidget { Q_OBJECT public: - RealDataMaskWidget(QWidget* parent = nullptr); + MaskEditingFrame(QWidget* parent = nullptr); void setJobOrDatafileItem(QObject* job_or_real_item) override; @@ -43,4 +43,4 @@ private: MaskEditorCanvas* m_editorCanvas; }; -#endif // BORNAGAIN_GUI_VIEW_DATA_REALDATAMASKWIDGET_H +#endif // BORNAGAIN_GUI_VIEW_FRAME_MASKEDITINGFRAME_H diff --git a/GUI/View/PlotSpecular/SpecularDataWidget.cpp b/GUI/View/Frame/SpecularFrame.cpp similarity index 79% rename from GUI/View/PlotSpecular/SpecularDataWidget.cpp rename to GUI/View/Frame/SpecularFrame.cpp index 3d354ae388c..0ea2a2b6ae6 100644 --- a/GUI/View/PlotSpecular/SpecularDataWidget.cpp +++ b/GUI/View/Frame/SpecularFrame.cpp @@ -2,8 +2,8 @@ // // BornAgain: simulate and fit reflection and scattering // -//! @file GUI/View/PlotSpecular/SpecularDataWidget.cpp -//! @brief Implements class SpecularDataWidget. +//! @file GUI/View/Frame/SpecularFrame.cpp +//! @brief Implements class SpecularFrame. //! //! @homepage http://www.bornagainproject.org //! @license GNU General Public License v3 or higher (see COPYING) @@ -12,7 +12,7 @@ // // ************************************************************************************************ -#include "GUI/View/PlotSpecular/SpecularDataWidget.h" +#include "GUI/View/Frame/SpecularFrame.h" #include "GUI/Model/Data/Data1DItem.h" #include "GUI/Support/Util/ActionFactory.h" #include "GUI/View/PlotSpecular/SpecularDataCanvas.h" @@ -20,7 +20,7 @@ #include <QBoxLayout> #include <QMenu> -SpecularDataWidget::SpecularDataWidget(QWidget* parent) +SpecularFrame::SpecularFrame(QWidget* parent) : DataAccessWidget(parent) , m_specular_canvas(new SpecularDataCanvas) , m_propertyWidget(new SpecularDataPropertyWidget(this)) @@ -34,7 +34,7 @@ SpecularDataWidget::SpecularDataWidget(QWidget* parent) hlayout->addWidget(m_propertyWidget); connect(m_specular_canvas, &SpecularDataCanvas::customContextMenuRequested, this, - &SpecularDataWidget::onContextMenuRequest); + &SpecularFrame::onContextMenuRequest); m_togglePropertiesAction = ActionFactory::createTogglePropertiesPanelAction(this, m_propertyWidget); @@ -42,19 +42,19 @@ SpecularDataWidget::SpecularDataWidget(QWidget* parent) m_propertyWidget->setVisible(false); } -void SpecularDataWidget::setJobOrDatafileItem(QObject* job_or_real_Item) +void SpecularFrame::setJobOrDatafileItem(QObject* job_or_real_Item) { setBaseItem(job_or_real_Item); m_specular_canvas->setJobOrDatafileItem(job_or_real_Item); m_propertyWidget->setJobOrDatafileItem(job_or_real_Item); } -QList<QAction*> SpecularDataWidget::actionList() +QList<QAction*> SpecularFrame::actionList() { return m_specular_canvas->actionList() + QList<QAction*>{m_togglePropertiesAction}; } -void SpecularDataWidget::onContextMenuRequest(const QPoint& point) +void SpecularFrame::onContextMenuRequest(const QPoint& point) { QMenu menu; for (auto* action : actionList()) diff --git a/GUI/View/PlotSpecular/SpecularDataWidget.h b/GUI/View/Frame/SpecularFrame.h similarity index 71% rename from GUI/View/PlotSpecular/SpecularDataWidget.h rename to GUI/View/Frame/SpecularFrame.h index bbd5de24e5d..1523842b63c 100644 --- a/GUI/View/PlotSpecular/SpecularDataWidget.h +++ b/GUI/View/Frame/SpecularFrame.h @@ -2,8 +2,8 @@ // // BornAgain: simulate and fit reflection and scattering // -//! @file GUI/View/PlotSpecular/SpecularDataWidget.h -//! @brief Defines class SpecularDataWidget. +//! @file GUI/View/Frame/SpecularFrame.h +//! @brief Defines class SpecularFrame. //! //! @homepage http://www.bornagainproject.org //! @license GNU General Public License v3 or higher (see COPYING) @@ -12,18 +12,18 @@ // // ************************************************************************************************ -#ifndef BORNAGAIN_GUI_VIEW_PLOTSPECULAR_SPECULARDATAWIDGET_H -#define BORNAGAIN_GUI_VIEW_PLOTSPECULAR_SPECULARDATAWIDGET_H +#ifndef BORNAGAIN_GUI_VIEW_FRAME_SPECULARFRAME_H +#define BORNAGAIN_GUI_VIEW_FRAME_SPECULARFRAME_H #include "GUI/View/Access/DataAccessWidget.h" class SpecularDataCanvas; class SpecularDataPropertyWidget; -class SpecularDataWidget : public DataAccessWidget { +class SpecularFrame : public DataAccessWidget { Q_OBJECT public: - SpecularDataWidget(QWidget* parent = nullptr); + SpecularFrame(QWidget* parent = nullptr); void setJobOrDatafileItem(QObject* job_or_real_Item) override; @@ -38,4 +38,4 @@ private: QAction* m_togglePropertiesAction; }; -#endif // BORNAGAIN_GUI_VIEW_PLOTSPECULAR_SPECULARDATAWIDGET_H +#endif // BORNAGAIN_GUI_VIEW_FRAME_SPECULARFRAME_H diff --git a/GUI/View/Job/JobResultsPresenter.cpp b/GUI/View/Job/JobResultsPresenter.cpp index fd0a7ed5803..bbae05feb1f 100644 --- a/GUI/View/Job/JobResultsPresenter.cpp +++ b/GUI/View/Job/JobResultsPresenter.cpp @@ -16,10 +16,10 @@ #include "GUI/Model/Job/JobItem.h" #include "GUI/View/Frame/Plot2+ProjnFrame.h" #include "GUI/View/Frame/Plot2DFrame.h" +#include "GUI/View/Frame/SpecularFrame.h" #include "GUI/View/Job/JobViewActivities.h" #include "GUI/View/PlotComparison/Fitpair1DWidget.h" #include "GUI/View/PlotComparison/Fitpair2DWidget.h" -#include "GUI/View/PlotSpecular/SpecularDataWidget.h" namespace { @@ -53,7 +53,7 @@ JobResultsPresenter::JobResultsPresenter(QWidget* parent) registerWidget("Projections", create_new<Plot2DWithProjectionFrame>); registerWidget("Fit 1D Data", create_new<Fitpair1DWidget>); registerWidget("Fit 2D Data", create_new<Fitpair2DWidget>); - registerWidget("Reflectometry", create_new<SpecularDataWidget>); + registerWidget("Reflectometry", create_new<SpecularFrame>); setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); setMinimumSize(220, 200); -- GitLab