From f748cb5cff733b5b09ec9d7a1ae2ed26e1222fcd Mon Sep 17 00:00:00 2001
From: Joachim Wuttke <j.wuttke@fz-juelich.de>
Date: Mon, 20 Nov 2023 19:58:00 +0100
Subject: [PATCH] rename class and sources GUI/View/Setup/ProjectionsToolbar ->
 GUI/View/Setup/ProjectionsToolpanel

---
 GUI/View/Frame/Plot2DWithProjectionFrame.cpp  | 12 ++++----
 GUI/View/Frame/Plot2DWithProjectionFrame.h    |  4 +--
 ...nsToolbar.cpp => ProjectionsToolpanel.cpp} | 28 +++++++++----------
 ...ctionsToolbar.h => ProjectionsToolpanel.h} | 14 +++++-----
 4 files changed, 29 insertions(+), 29 deletions(-)
 rename GUI/View/Setup/{ProjectionsToolbar.cpp => ProjectionsToolpanel.cpp} (84%)
 rename GUI/View/Setup/{ProjectionsToolbar.h => ProjectionsToolpanel.h} (78%)

diff --git a/GUI/View/Frame/Plot2DWithProjectionFrame.cpp b/GUI/View/Frame/Plot2DWithProjectionFrame.cpp
index a76f5a31796..2d044cee05c 100644
--- a/GUI/View/Frame/Plot2DWithProjectionFrame.cpp
+++ b/GUI/View/Frame/Plot2DWithProjectionFrame.cpp
@@ -19,7 +19,7 @@
 #include "GUI/View/Canvas/ProjectionsEditorCanvas.h"
 #include "GUI/View/Canvas/ProjectionsWidget.h"
 #include "GUI/View/Setup/ProjectionActions.h"
-#include "GUI/View/Setup/ProjectionsToolbar.h"
+#include "GUI/View/Setup/ProjectionsToolpanel.h"
 #include "GUI/View/Setup/Scale2DEditor.h"
 #include <QBoxLayout>
 #include <QSplitter>
@@ -27,7 +27,7 @@
 Plot2DWithProjectionFrame::Plot2DWithProjectionFrame(QWidget* parent)
     : DataAccessWidget(parent)
     , m_editorActions(new ProjectionActions(this))
-    , m_toolbar(new ProjectionsToolbar(m_editorActions))
+    , m_toolbar(new ProjectionsToolpanel(m_editorActions))
     , m_projectionsCanvas(new ProjectionsEditorCanvas)
     , m_projectionsWidget(new ProjectionsWidget)
     , m_propertyPanel(new Scale2DEditor(this))
@@ -102,16 +102,16 @@ void Plot2DWithProjectionFrame::setup_connections()
             [this]() { m_propertyPanel->setHidden(!m_propertyPanel->isHidden()); });
 
     // selection/drawing activity is propagated from Toolbar to graphics scene
-    connect(m_toolbar, &ProjectionsToolbar::activityChanged, m_projectionsCanvas,
+    connect(m_toolbar, &ProjectionsToolpanel::activityChanged, m_projectionsCanvas,
             &ProjectionsEditorCanvas::onActivityChanged, Qt::UniqueConnection);
 
     // selection/drawing activity is propagated from Toolbar to Projections Widget
-    connect(m_toolbar, &ProjectionsToolbar::activityChanged, m_projectionsWidget,
+    connect(m_toolbar, &ProjectionsToolpanel::activityChanged, m_projectionsWidget,
             &ProjectionsWidget::onActivityChanged, Qt::UniqueConnection);
 
     // click on projections tab is propagated to tool bar
     connect(m_projectionsWidget, &ProjectionsWidget::changeActivityRequest, m_toolbar,
-            &ProjectionsToolbar::onProjectionTabChange, Qt::UniqueConnection);
+            &ProjectionsToolpanel::onProjectionTabChange, Qt::UniqueConnection);
 
     // Delete request is propagated from canvas to actions
     connect(m_projectionsCanvas, &ProjectionsEditorCanvas::deleteSelectedRequest, m_editorActions,
@@ -123,7 +123,7 @@ void Plot2DWithProjectionFrame::setup_connections()
 
     // space bar push (request for zoom mode) is propagated from graphics view to Toolbar
     connect(m_projectionsCanvas, &ProjectionsEditorCanvas::changeActivityRequest, m_toolbar,
-            &ProjectionsToolbar::onChangeActivityRequest, Qt::UniqueConnection);
+            &ProjectionsToolpanel::onChangeActivityRequest, Qt::UniqueConnection);
 
     // ColorMap margins changed, canvas -> projection widget
     connect(m_projectionsCanvas, &ProjectionsEditorCanvas::marginsChanged, m_projectionsWidget,
diff --git a/GUI/View/Frame/Plot2DWithProjectionFrame.h b/GUI/View/Frame/Plot2DWithProjectionFrame.h
index 9f06be5d2a5..f6cafce3458 100644
--- a/GUI/View/Frame/Plot2DWithProjectionFrame.h
+++ b/GUI/View/Frame/Plot2DWithProjectionFrame.h
@@ -20,7 +20,7 @@
 class Scale2DEditor;
 class ProjectionActions;
 class ProjectionsEditorCanvas;
-class ProjectionsToolbar;
+class ProjectionsToolpanel;
 class ProjectionsWidget;
 
 //! Main widget to embed projections editor for Data2DItem.
@@ -41,7 +41,7 @@ private:
     void setup_connections();
 
     ProjectionActions* m_editorActions;
-    ProjectionsToolbar* m_toolbar;                //! main tool bar with buttons at the right
+    ProjectionsToolpanel* m_toolbar;              //! main tool bar with buttons at the right
     ProjectionsEditorCanvas* m_projectionsCanvas; //! canvas with color map at the top
     ProjectionsWidget* m_projectionsWidget;       //! bottom widget to draw projections plot
     Scale2DEditor* m_propertyPanel;               //! panel at the right with properties
diff --git a/GUI/View/Setup/ProjectionsToolbar.cpp b/GUI/View/Setup/ProjectionsToolpanel.cpp
similarity index 84%
rename from GUI/View/Setup/ProjectionsToolbar.cpp
rename to GUI/View/Setup/ProjectionsToolpanel.cpp
index bb0cee01571..661d5330fde 100644
--- a/GUI/View/Setup/ProjectionsToolbar.cpp
+++ b/GUI/View/Setup/ProjectionsToolpanel.cpp
@@ -2,8 +2,8 @@
 //
 //  BornAgain: simulate and fit reflection and scattering
 //
-//! @file      GUI/View/Setup/ProjectionsToolbar.cpp
-//! @brief     Implements class ProjectionsToolbar.
+//! @file      GUI/View/Setup/ProjectionsToolpanel.cpp
+//! @brief     Implements class ProjectionsToolpanel.
 //!
 //! @homepage  http://www.bornagainproject.org
 //! @license   GNU General Public License v3 or higher (see COPYING)
@@ -12,7 +12,7 @@
 //
 //  ************************************************************************************************
 
-#include "GUI/View/Setup/ProjectionsToolbar.h"
+#include "GUI/View/Setup/ProjectionsToolpanel.h"
 #include "GUI/View/Setup/ProjectionActions.h"
 #include "GUI/View/Tool/mainwindow_constants.h"
 #include <QButtonGroup>
@@ -37,7 +37,7 @@ const QString vertical_mode_tooltip =
 
 } // namespace
 
-ProjectionsToolbar::ProjectionsToolbar(ProjectionActions* editorActions, QWidget* parent)
+ProjectionsToolpanel::ProjectionsToolpanel(ProjectionActions* editorActions, QWidget* parent)
     : QToolBar(parent)
     , m_editorActions(editorActions)
     , m_activityButtonGroup(new QButtonGroup(this))
@@ -50,12 +50,12 @@ ProjectionsToolbar::ProjectionsToolbar(ProjectionActions* editorActions, QWidget
     setup_extratools_group();
 
     connect(m_activityButtonGroup, &QButtonGroup::idClicked, this,
-            &ProjectionsToolbar::onActivityGroupChange);
+            &ProjectionsToolpanel::onActivityGroupChange);
 
     m_previousActivity = currentActivity();
 }
 
-void ProjectionsToolbar::onChangeActivityRequest(MaskEditorFlags::Activity value)
+void ProjectionsToolpanel::onChangeActivityRequest(MaskEditorFlags::Activity value)
 {
     if (value == MaskEditorFlags::PREVIOUS_MODE)
         setCurrentActivity(m_previousActivity);
@@ -68,19 +68,19 @@ void ProjectionsToolbar::onChangeActivityRequest(MaskEditorFlags::Activity value
 
 //! Change activity only if current activity is one of drawing mode (horizontal, vertical
 //! projections drawing).
-void ProjectionsToolbar::onProjectionTabChange(MaskEditorFlags::Activity value)
+void ProjectionsToolpanel::onProjectionTabChange(MaskEditorFlags::Activity value)
 {
     if (currentActivity() == MaskEditorFlags::HORIZONTAL_LINE_MODE
         || currentActivity() == MaskEditorFlags::VERTICAL_LINE_MODE)
         onChangeActivityRequest(value);
 }
 
-void ProjectionsToolbar::onActivityGroupChange(int)
+void ProjectionsToolpanel::onActivityGroupChange(int)
 {
     emit activityChanged(currentActivity());
 }
 
-void ProjectionsToolbar::setup_selection_group()
+void ProjectionsToolpanel::setup_selection_group()
 {
     auto* panButton = new QToolButton(this);
     panButton->setIcon(QIcon(":/images/hand-right.svg"));
@@ -108,7 +108,7 @@ void ProjectionsToolbar::setup_selection_group()
     m_activityButtonGroup->addButton(selectionButton, MaskEditorFlags::SELECTION_MODE);
 }
 
-void ProjectionsToolbar::setup_shapes_group()
+void ProjectionsToolpanel::setup_shapes_group()
 {
     auto* horizontalLineButton = new QToolButton(this);
     horizontalLineButton->setIcon(QIcon(":/images/maskeditor_horizontalline.svg"));
@@ -128,7 +128,7 @@ void ProjectionsToolbar::setup_shapes_group()
     add_separator();
 }
 
-void ProjectionsToolbar::setup_extratools_group()
+void ProjectionsToolpanel::setup_extratools_group()
 {
     auto* saveButton = new QToolButton(this);
     saveButton->setIcon(QIcon(":/images/maskeditor_save.svg"));
@@ -137,19 +137,19 @@ void ProjectionsToolbar::setup_extratools_group()
     connect(saveButton, &QToolButton::clicked, m_editorActions, &ProjectionActions::onSaveAction);
 }
 
-void ProjectionsToolbar::add_separator()
+void ProjectionsToolpanel::add_separator()
 {
     addWidget(new QLabel(" "));
     addSeparator();
     addWidget(new QLabel(" "));
 }
 
-MaskEditorFlags::Activity ProjectionsToolbar::currentActivity() const
+MaskEditorFlags::Activity ProjectionsToolpanel::currentActivity() const
 {
     return MaskEditorFlags::EActivityType(m_activityButtonGroup->checkedId());
 }
 
-void ProjectionsToolbar::setCurrentActivity(MaskEditorFlags::Activity value)
+void ProjectionsToolpanel::setCurrentActivity(MaskEditorFlags::Activity value)
 {
     int button_index = static_cast<int>(value);
     m_activityButtonGroup->button(button_index)->setChecked(true);
diff --git a/GUI/View/Setup/ProjectionsToolbar.h b/GUI/View/Setup/ProjectionsToolpanel.h
similarity index 78%
rename from GUI/View/Setup/ProjectionsToolbar.h
rename to GUI/View/Setup/ProjectionsToolpanel.h
index 2fc7993b25f..c7c9f14ba4b 100644
--- a/GUI/View/Setup/ProjectionsToolbar.h
+++ b/GUI/View/Setup/ProjectionsToolpanel.h
@@ -2,8 +2,8 @@
 //
 //  BornAgain: simulate and fit reflection and scattering
 //
-//! @file      GUI/View/Setup/ProjectionsToolbar.h
-//! @brief     Defines class ProjectionsToolbar.
+//! @file      GUI/View/Setup/ProjectionsToolpanel.h
+//! @brief     Defines class ProjectionsToolpanel.
 //!
 //! @homepage  http://www.bornagainproject.org
 //! @license   GNU General Public License v3 or higher (see COPYING)
@@ -12,8 +12,8 @@
 //
 //  ************************************************************************************************
 
-#ifndef BORNAGAIN_GUI_VIEW_SETUP_PROJECTIONSTOOLBAR_H
-#define BORNAGAIN_GUI_VIEW_SETUP_PROJECTIONSTOOLBAR_H
+#ifndef BORNAGAIN_GUI_VIEW_SETUP_PROJECTIONSTOOLPANEL_H
+#define BORNAGAIN_GUI_VIEW_SETUP_PROJECTIONSTOOLPANEL_H
 
 #include "GUI/View/Scene/MaskEditorFlags.h"
 #include <QToolBar>
@@ -24,10 +24,10 @@ class QButtonGroup;
 //! Toolbar with projections buttons (horizontal projections, vertical projections, select, zoom)
 //! located at the right-hand side of ProjectionsEditor (part of JobProjectionsWidget).
 
-class ProjectionsToolbar : public QToolBar {
+class ProjectionsToolpanel : public QToolBar {
     Q_OBJECT
 public:
-    ProjectionsToolbar(ProjectionActions* editorActions, QWidget* parent = nullptr);
+    ProjectionsToolpanel(ProjectionActions* editorActions, QWidget* parent = nullptr);
 
 public slots:
     void onChangeActivityRequest(MaskEditorFlags::Activity value);
@@ -52,4 +52,4 @@ private:
     MaskEditorFlags::Activity m_previousActivity;
 };
 
-#endif // BORNAGAIN_GUI_VIEW_SETUP_PROJECTIONSTOOLBAR_H
+#endif // BORNAGAIN_GUI_VIEW_SETUP_PROJECTIONSTOOLPANEL_H
-- 
GitLab