From e77848f95b301bdb6e08a342ffa79b9d45c7228a 2017-12-07 08:41:25 From: Thibaud Rabillard Date: 2017-12-07 08:41:25 Subject: [PATCH] New class to manage actions in the visualization --- diff --git a/gui/include/Visualization/VisualizationActionManager.h b/gui/include/Visualization/VisualizationActionManager.h new file mode 100644 index 0000000..cd2255f --- /dev/null +++ b/gui/include/Visualization/VisualizationActionManager.h @@ -0,0 +1,12 @@ +#ifndef SCIQLOP_VISUALIZATIONACTIONMANAGER_H +#define SCIQLOP_VISUALIZATIONACTIONMANAGER_H + + +class VisualizationActionManager { +public: + VisualizationActionManager(); + + void installSelectionZoneActions(); +}; + +#endif // SCIQLOP_VISUALIZATIONACTIONMANAGER_H diff --git a/gui/meson.build b/gui/meson.build index 94921b9..747a2fd 100644 --- a/gui/meson.build +++ b/gui/meson.build @@ -87,7 +87,8 @@ gui_sources = [ 'src/Visualization/VisualizationSelectionZoneItem.cpp', 'src/Visualization/VisualizationSelectionZoneManager.cpp', 'src/Visualization/SelectionZoneAction.cpp', - 'src/Visualization/ActionsGuiController.cpp' + 'src/Visualization/ActionsGuiController.cpp', + 'src/Visualization/VisualizationActionManager.cpp' ] gui_inc = include_directories(['include']) diff --git a/gui/src/Visualization/VisualizationActionManager.cpp b/gui/src/Visualization/VisualizationActionManager.cpp new file mode 100644 index 0000000..aa109eb --- /dev/null +++ b/gui/src/Visualization/VisualizationActionManager.cpp @@ -0,0 +1,14 @@ +#include "Visualization/VisualizationActionManager.h" + +#include +#include + +VisualizationActionManager::VisualizationActionManager() {} + +void VisualizationActionManager::installSelectionZoneActions() +{ + auto &actionController = sqpApp->actionsGuiController(); + actionController.addSectionZoneAction("Remove Selected Zone(s)", [](auto &zone) {}); + actionController.addSectionZoneAction("Align Left", [](auto &zone) {}); + actionController.addSectionZoneAction("Align Right", [](auto &zone) {}); +} diff --git a/gui/src/Visualization/VisualizationWidget.cpp b/gui/src/Visualization/VisualizationWidget.cpp index 0905d1d..d7be09f 100644 --- a/gui/src/Visualization/VisualizationWidget.cpp +++ b/gui/src/Visualization/VisualizationWidget.cpp @@ -1,5 +1,6 @@ #include "Visualization/VisualizationWidget.h" #include "Visualization/IVisualizationWidgetVisitor.h" +#include "Visualization/VisualizationActionManager.h" #include "Visualization/VisualizationGraphWidget.h" #include "Visualization/VisualizationSelectionZoneManager.h" #include "Visualization/VisualizationTabWidget.h" @@ -23,6 +24,7 @@ Q_LOGGING_CATEGORY(LOG_VisualizationWidget, "VisualizationWidget") struct VisualizationWidget::VisualizationWidgetPrivate { std::unique_ptr m_ZoneSelectionManager = nullptr; + VisualizationActionManager m_ActionManager; VisualizationWidgetPrivate() : m_ZoneSelectionManager(std::make_unique()) @@ -86,6 +88,8 @@ VisualizationWidget::VisualizationWidget(QWidget *parent) sqpApp->dragDropGuiController().addDragDropTabBar(ui->tabWidget->tabBar()); + impl->m_ActionManager.installSelectionZoneActions(); + // Adds default tab addTabView(); }