From 143f4d9b5628bd901b486530879b9d1a750ce7d3 2019-03-01 15:53:48 From: Alexis Jeandet Date: 2019-03-01 15:53:48 Subject: [PATCH] Updated Meson build definitions Signed-off-by: Alexis Jeandet --- diff --git a/app/src/MainWindow.cpp b/app/src/MainWindow.cpp index da44097..dacf81f 100644 --- a/app/src/MainWindow.cpp +++ b/app/src/MainWindow.cpp @@ -23,7 +23,7 @@ #include "ui_MainWindow.h" #include -#include +//#include #include #include #include diff --git a/core b/core index 0093c73..24f31ec 160000 --- a/core +++ b/core @@ -1 +1 @@ -Subproject commit 0093c733b640e07ebeaf204c1ed1279db095aa9f +Subproject commit 24f31ec545d2e177fc2212ecdb457e01533b6fbb diff --git a/gui/include/Catalogue/CatalogueActionManager.h b/gui/include/Catalogue/CatalogueActionManager.h deleted file mode 100644 index 75afa31..0000000 --- a/gui/include/Catalogue/CatalogueActionManager.h +++ /dev/null @@ -1,20 +0,0 @@ -#ifndef SCIQLOP_CATALOGUEACTIONMANAGER_H -#define SCIQLOP_CATALOGUEACTIONMANAGER_H - -#include - -class CatalogueExplorer; - -class CatalogueActionManager { -public: - CatalogueActionManager(CatalogueExplorer *catalogueExplorer); - - void installSelectionZoneActions(); - void refreshCreateInCatalogueAction(); - -private: - class CatalogueActionManagerPrivate; - spimpl::unique_impl_ptr impl; -}; - -#endif // SCIQLOP_CATALOGUEACTIONMANAGER_H diff --git a/gui/include/Catalogue/CatalogueEventsModel.h b/gui/include/Catalogue/CatalogueEventsModel.h deleted file mode 100644 index a92eb45..0000000 --- a/gui/include/Catalogue/CatalogueEventsModel.h +++ /dev/null @@ -1,85 +0,0 @@ -#ifndef SCIQLOP_CATALOGUEEVENTSMODEL_H -#define SCIQLOP_CATALOGUEEVENTSMODEL_H - -#include -#include -#include -#include -#include - -#include - -Q_DECLARE_LOGGING_CATEGORY(LOG_CatalogueEventsModel) - -class CatalogueEventsModel : public QAbstractItemModel -{ - Q_OBJECT - -signals: - void modelSorted(); - -public: - CatalogueEventsModel(QObject* parent = nullptr); - - enum class Column - { - Name, - TStart, - TEnd, - Tags, - Product, - Validation, - NbColumn - }; - - void setSourceCatalogues(const QVector>& catalogues); - void setEvents(const std::vector& events); - void addEvent(const std::shared_ptr& event); - void removeEvent(const std::shared_ptr& event); - std::vector events() const; - - enum class ItemType - { - Root, - Event, - EventProduct - }; - ItemType itemTypeOf(const QModelIndex& index) const; - CatalogueController::Event_ptr getEvent(const QModelIndex& index) const; - CatalogueController::Event_ptr getParentEvent(const QModelIndex& index) const; - std::optional getEventProduct(const QModelIndex& index) const; - - /// Refresh the data for the specified event - void refreshEvent( - const CatalogueController::Event_ptr& event, bool refreshEventProducts = false); - - /// Returns a QModelIndex which represent the specified event - QModelIndex indexOf(const CatalogueController::Event_ptr& event) const; - - /// Marks a change flag on the specified event to allow sorting on the validation column - void setEventHasChanges(const std::shared_ptr& event, bool hasChanges); - - /// Returns true if the specified event has unsaved changes - bool eventsHasChanges(const std::shared_ptr& event) const; - - // Model - QModelIndex index(int row, int column, const QModelIndex& parent = QModelIndex()) const; - QModelIndex parent(const QModelIndex& index) const; - int rowCount(const QModelIndex& parent = QModelIndex()) const override; - int columnCount(const QModelIndex& parent = QModelIndex()) const override; - Qt::ItemFlags flags(const QModelIndex& index) const override; - QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override; - QVariant headerData( - int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override; - void sort(int column, Qt::SortOrder order = Qt::AscendingOrder) override; - - Qt::DropActions supportedDragActions() const override; - QStringList mimeTypes() const override; - QMimeData* mimeData(const QModelIndexList& indexes) const override; - -private: - class CatalogueEventsModelPrivate; - spimpl::unique_impl_ptr impl; -}; - -#endif // SCIQLOP_CATALOGUEEVENTSMODEL_H diff --git a/gui/include/Catalogue/CatalogueEventsWidget.h b/gui/include/Catalogue/CatalogueEventsWidget.h deleted file mode 100644 index d9b6307..0000000 --- a/gui/include/Catalogue/CatalogueEventsWidget.h +++ /dev/null @@ -1,72 +0,0 @@ -#ifndef SCIQLOP_CATALOGUEEVENTSWIDGET_H -#define SCIQLOP_CATALOGUEEVENTSWIDGET_H - -#include -#include -#include - -class DBCatalogue; -class DBEvent; -class DBEventProduct; -class VisualizationWidget; -class VisualizationSelectionZoneItem; - -namespace Ui { -class CatalogueEventsWidget; -} - -Q_DECLARE_LOGGING_CATEGORY(LOG_CatalogueEventsWidget) - -class CatalogueEventsWidget : public QWidget { - Q_OBJECT - -signals: - void eventsSelected(const QVector > &event); - void eventsRemoved(const QVector > &event); - void eventProductsSelected( - const QVector, std::shared_ptr > > - &eventproducts); - void selectionCleared(); - void selectionZoneAdded(const std::shared_ptr &event, const QString &productId, - VisualizationSelectionZoneItem *selectionZone); - - void eventCataloguesModified(const QVector > &catalogues); - -public: - explicit CatalogueEventsWidget(QWidget *parent = 0); - virtual ~CatalogueEventsWidget(); - - void setVisualizationWidget(VisualizationWidget *visualization); - - void addEvent(const std::shared_ptr &event); - void setEventChanges(const std::shared_ptr &event, bool hasChanges); - void setEventsChanges(const std::shared_ptr &event, bool hasChanges); - - QVector > displayedCatalogues() const; - bool isAllEventsDisplayed() const; - bool isEventDisplayed(const std::shared_ptr &event) const; - - void refreshEvent(const std::shared_ptr &event); - -public slots: - void populateWithCatalogues(const QVector > &catalogues); - void populateWithAllEvents(); - void clear(); - void refresh(); - - // QWidget interface -protected: - void keyPressEvent(QKeyEvent *event); - - -private: - Ui::CatalogueEventsWidget *ui; - - class CatalogueEventsWidgetPrivate; - spimpl::unique_impl_ptr impl; - -private slots: - void emitSelection(); -}; - -#endif // SCIQLOP_CATALOGUEEVENTSWIDGET_H diff --git a/gui/include/Catalogue/CatalogueExplorer.h b/gui/include/Catalogue/CatalogueExplorer.h deleted file mode 100644 index 079fd15..0000000 --- a/gui/include/Catalogue/CatalogueExplorer.h +++ /dev/null @@ -1,43 +0,0 @@ -#ifndef SCIQLOP_CATALOGUEEXPLORER_H -#define SCIQLOP_CATALOGUEEXPLORER_H - -#include -#include - -namespace Ui { -class CatalogueExplorer; -} - -class CatalogueEventsWidget; -class CatalogueSideBarWidget; - -class VisualizationWidget; -class VisualizationSelectionZoneItem; - -class DBEvent; - - -class CatalogueExplorer : public QDialog { - Q_OBJECT - -public: - explicit CatalogueExplorer(QWidget *parent = 0); - virtual ~CatalogueExplorer(); - - void setVisualizationWidget(VisualizationWidget *visualization); - - CatalogueEventsWidget &eventsWidget() const; - CatalogueSideBarWidget &sideBarWidget() const; - - void clearSelectionZones(); - void addSelectionZoneItem(const std::shared_ptr &event, const QString &productId, - VisualizationSelectionZoneItem *selectionZone); - -private: - Ui::CatalogueExplorer *ui; - - class CatalogueExplorerPrivate; - spimpl::unique_impl_ptr impl; -}; - -#endif // SCIQLOP_CATALOGUEEXPLORER_H diff --git a/gui/include/Catalogue/CatalogueExplorerHelper.h b/gui/include/Catalogue/CatalogueExplorerHelper.h deleted file mode 100644 index 037901c..0000000 --- a/gui/include/Catalogue/CatalogueExplorerHelper.h +++ /dev/null @@ -1,13 +0,0 @@ -#ifndef SCIQLOP_CATALOGUEEXPLORERHELPER_H -#define SCIQLOP_CATALOGUEEXPLORERHELPER_H - -#include - -#include - -struct CatalogueExplorerHelper { - static QWidget *buildValidationWidget(QWidget *parent, std::function save, - std::function discard); -}; - -#endif // SCIQLOP_CATALOGUEEXPLORERHELPER_H diff --git a/gui/include/Catalogue/CatalogueInspectorWidget.h b/gui/include/Catalogue/CatalogueInspectorWidget.h deleted file mode 100644 index 1bef099..0000000 --- a/gui/include/Catalogue/CatalogueInspectorWidget.h +++ /dev/null @@ -1,51 +0,0 @@ -#ifndef SCIQLOP_CATALOGUEINSPECTORWIDGET_H -#define SCIQLOP_CATALOGUEINSPECTORWIDGET_H - -#include -#include -#include - -namespace Ui { -class CatalogueInspectorWidget; -} - -class DBCatalogue; -class DBEvent; -class DBEventProduct; - -class CatalogueInspectorWidget : public QWidget { - Q_OBJECT - -signals: - void catalogueUpdated(const std::shared_ptr &catalogue); - void eventUpdated(const std::shared_ptr &event); - void eventProductUpdated(const std::shared_ptr &event, - const std::shared_ptr &eventProduct); - -public: - explicit CatalogueInspectorWidget(QWidget *parent = 0); - virtual ~CatalogueInspectorWidget(); - - /// Enum matching the pages inside the stacked widget - enum class Page { Empty, CatalogueProperties, EventProperties }; - - Page currentPage() const; - - void setEvent(const std::shared_ptr &event); - void setEventProduct(const std::shared_ptr &event, - const std::shared_ptr &eventProduct); - void setCatalogue(const std::shared_ptr &catalogue); - - void refresh(); - -public slots: - void showPage(Page page); - -private: - Ui::CatalogueInspectorWidget *ui; - - class CatalogueInspectorWidgetPrivate; - spimpl::unique_impl_ptr impl; -}; - -#endif // SCIQLOP_CATALOGUEINSPECTORWIDGET_H diff --git a/gui/include/Catalogue/CatalogueSideBarWidget.h b/gui/include/Catalogue/CatalogueSideBarWidget.h deleted file mode 100644 index 73acaf5..0000000 --- a/gui/include/Catalogue/CatalogueSideBarWidget.h +++ /dev/null @@ -1,57 +0,0 @@ -#ifndef SCIQLOP_CATALOGUESIDEBARWIDGET_H -#define SCIQLOP_CATALOGUESIDEBARWIDGET_H - -#include -#include -#include -#include - -class CatalogueAbstractTreeItem; -class DBCatalogue; - -namespace Ui { -class CatalogueSideBarWidget; -} - -Q_DECLARE_LOGGING_CATEGORY(LOG_CatalogueSideBarWidget) - -class CatalogueSideBarWidget : public QWidget { - Q_OBJECT - -signals: - void catalogueSelected(const QVector > &catalogues); - void databaseSelected(const QStringList &databases); - void allEventsSelected(); - void trashSelected(); - void selectionCleared(); - void catalogueSaved(const std::shared_ptr &catalogue); - void catalogueListChanged(); - -public: - explicit CatalogueSideBarWidget(QWidget *parent = 0); - virtual ~CatalogueSideBarWidget(); - - CatalogueAbstractTreeItem *addCatalogue(const std::shared_ptr &catalogue, - const QString &repository); - void setCatalogueChanges(const std::shared_ptr &catalogue, bool hasChanges); - - QVector > getCatalogues(const QString &repository) const; - - // QWidget interface -protected: - void keyPressEvent(QKeyEvent *event); - -private slots: - void emitSelection(); - -private: - Ui::CatalogueSideBarWidget *ui; - - class CatalogueSideBarWidgetPrivate; - spimpl::unique_impl_ptr impl; - -private slots: - void onContextMenuRequested(const QPoint &pos); -}; - -#endif // SCIQLOP_CATALOGUESIDEBARWIDGET_H diff --git a/gui/include/Catalogue/CatalogueTreeItems/CatalogueAbstractTreeItem.h b/gui/include/Catalogue/CatalogueTreeItems/CatalogueAbstractTreeItem.h deleted file mode 100644 index 0135a5b..0000000 --- a/gui/include/Catalogue/CatalogueTreeItems/CatalogueAbstractTreeItem.h +++ /dev/null @@ -1,36 +0,0 @@ -#ifndef SCIQLOP_CATALOGUEABSTRACTTREEITEM_H -#define SCIQLOP_CATALOGUEABSTRACTTREEITEM_H - -#include -#include -#include - -class QMimeData; - -class CatalogueAbstractTreeItem { -public: - constexpr static const int DEFAULT_TYPE = -1; - - CatalogueAbstractTreeItem(int type = DEFAULT_TYPE); - virtual ~CatalogueAbstractTreeItem(); - - void addChild(CatalogueAbstractTreeItem *child); - void removeChild(CatalogueAbstractTreeItem *child); - QVector children() const; - CatalogueAbstractTreeItem *parent() const; - - int type() const; - QString text(int column = 0) const; - - virtual QVariant data(int column, int role) const; - virtual Qt::ItemFlags flags(int column) const; - virtual bool setData(int column, int role, const QVariant &value); - virtual bool canDropMimeData(const QMimeData *data, Qt::DropAction action); - virtual bool dropMimeData(const QMimeData *data, Qt::DropAction action); - -private: - class CatalogueAbstractTreeItemPrivate; - spimpl::unique_impl_ptr impl; -}; - -#endif // SCIQLOP_CATALOGUEABSTRACTTREEITEM_H diff --git a/gui/include/Catalogue/CatalogueTreeItems/CatalogueTextTreeItem.h b/gui/include/Catalogue/CatalogueTreeItems/CatalogueTextTreeItem.h deleted file mode 100644 index fc345c8..0000000 --- a/gui/include/Catalogue/CatalogueTreeItems/CatalogueTextTreeItem.h +++ /dev/null @@ -1,23 +0,0 @@ -#ifndef SCIQLOP_CATALOGUETEXTTREEITEM_H -#define SCIQLOP_CATALOGUETEXTTREEITEM_H - -#include -#include - -class CatalogueTextTreeItem : public CatalogueAbstractTreeItem { -public: - CatalogueTextTreeItem(const QIcon &icon, const QString &text, int type); - - QVariant data(int column, int role) const override; - Qt::ItemFlags flags(int column) const override; - - QString text() const; - - void setEnabled(bool value); - -private: - class CatalogueTextTreeItemPrivate; - spimpl::unique_impl_ptr impl; -}; - -#endif // SCIQLOP_CATALOGUETEXTTREEITEM_H diff --git a/gui/include/Catalogue/CatalogueTreeItems/CatalogueTreeItem.h b/gui/include/Catalogue/CatalogueTreeItems/CatalogueTreeItem.h deleted file mode 100644 index d072aea..0000000 --- a/gui/include/Catalogue/CatalogueTreeItems/CatalogueTreeItem.h +++ /dev/null @@ -1,29 +0,0 @@ -#ifndef SCIQLOP_CATALOGUETREEITEM_H -#define SCIQLOP_CATALOGUETREEITEM_H - -#include -#include - -class DBCatalogue; - - -class CatalogueTreeItem : public CatalogueAbstractTreeItem { -public: - CatalogueTreeItem(std::shared_ptr catalogue, const QIcon &icon, int type); - - QVariant data(int column, int role) const override; - bool setData(int column, int role, const QVariant &value) override; - Qt::ItemFlags flags(int column) const override; - bool canDropMimeData(const QMimeData *data, Qt::DropAction action) override; - bool dropMimeData(const QMimeData *data, Qt::DropAction action) override; - - /// Returns the catalogue represented by the item - std::shared_ptr catalogue() const; - void replaceCatalogue(const std::shared_ptr &catalogue); - -private: - class CatalogueTreeItemPrivate; - spimpl::unique_impl_ptr impl; -}; - -#endif // SCIQLOP_CATALOGUETREEITEM_H diff --git a/gui/include/Catalogue/CatalogueTreeModel.h b/gui/include/Catalogue/CatalogueTreeModel.h deleted file mode 100644 index c526657..0000000 --- a/gui/include/Catalogue/CatalogueTreeModel.h +++ /dev/null @@ -1,59 +0,0 @@ -#ifndef SCIQLOP_CATALOGUETREEMODEL_H -#define SCIQLOP_CATALOGUETREEMODEL_H - -#include -#include - -class CatalogueAbstractTreeItem; - -/** - * @brief Model to display catalogue items based on QTreeWidgetItem - * @warning Do not use the method QTreeWidgetItem::treeWidget for an item added to this model or the - * application will crash - */ -class CatalogueTreeModel : public QAbstractItemModel { - Q_OBJECT - -signals: - void itemRenamed(const QModelIndex &index); - void itemDropped(const QModelIndex &parentIndex, const QMimeData *data, Qt::DropAction action); - -public: - CatalogueTreeModel(QObject *parent = nullptr); - - enum class Column { Name, Validation, Count }; - - QModelIndex addTopLevelItem(CatalogueAbstractTreeItem *item); - QVector topLevelItems() const; - - void addChildItem(CatalogueAbstractTreeItem *child, const QModelIndex &parentIndex); - void removeChildItem(CatalogueAbstractTreeItem *child, const QModelIndex &parentIndex); - /// Refresh the data for the specified index - void refresh(const QModelIndex &index); - - CatalogueAbstractTreeItem *item(const QModelIndex &index) const; - QModelIndex indexOf(CatalogueAbstractTreeItem *item, int column = 0) const; - - // model - QModelIndex index(int row, int column, - const QModelIndex &parent = QModelIndex()) const override; - QModelIndex parent(const QModelIndex &index) const override; - int rowCount(const QModelIndex &parent) const override; - int columnCount(const QModelIndex &parent) const override; - Qt::ItemFlags flags(const QModelIndex &index) const override; - QVariant data(const QModelIndex &index, int role) const override; - bool setData(const QModelIndex &index, const QVariant &value, int role) override; - - bool canDropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, - const QModelIndex &parent) const override; - bool dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, - const QModelIndex &parent) override; - Qt::DropActions supportedDropActions() const; - QStringList mimeTypes() const; - -private: - class CatalogueTreeModelPrivate; - spimpl::unique_impl_ptr impl; -}; - -#endif // CATALOGUETREEMODEL_H diff --git a/gui/meson.build b/gui/meson.build index 8d996dc..21fdd77 100644 --- a/gui/meson.build +++ b/gui/meson.build @@ -1,54 +1,82 @@ gui_moc_headers = [ - 'include/DataSource/DataSourceWidget.h', - 'include/Settings/SqpSettingsDialog.h', - 'include/Settings/SqpSettingsGeneralWidget.h', - 'include/SidePane/SqpSidePane.h', - 'include/SqpApplication.h', - 'include/DragAndDrop/DragDropScroller.h', - 'include/DragAndDrop/DragDropTabSwitcher.h', - 'include/TimeWidget/TimeWidget.h', - 'include/Variable/VariableInspectorWidget.h', - 'include/Variable/RenameVariableDialog.h', - 'include/Visualization/qcustomplot.h', - 'include/Visualization/VisualizationGraphWidget.h', - 'include/Visualization/VisualizationTabWidget.h', - 'include/Visualization/VisualizationWidget.h', - 'include/Visualization/VisualizationZoneWidget.h', - 'include/Visualization/VisualizationDragDropContainer.h', - 'include/Visualization/VisualizationDragWidget.h', - 'include/Visualization/ColorScaleEditor.h', - 'include/Visualization/VisualizationSelectionZoneItem.h', - 'include/Actions/SelectionZoneAction.h', - 'include/Visualization/VisualizationMultiZoneSelectionDialog.h', - 'include/Catalogue/CatalogueExplorer.h', - 'include/Catalogue/CatalogueEventsWidget.h', - 'include/Catalogue/CatalogueSideBarWidget.h', - 'include/Catalogue/CatalogueInspectorWidget.h', - 'include/Catalogue/CatalogueEventsModel.h', - 'include/Catalogue/CatalogueTreeModel.h', - 'include/Actions/FilteringAction.h' + './include/Common/VisualizationDef.h', + './include/Common/ColorUtils.h', + './include/DragAndDrop/DragDropGuiController.h', + './include/DragAndDrop/DragDropTabSwitcher.h', + './include/DragAndDrop/DragDropScroller.h', + './include/Settings/SqpSettingsDialog.h', + './include/Settings/SqpSettingsGeneralWidget.h', + './include/DataSource/DataSourceTreeWidgetHelper.h', + './include/DataSource/DataSourceTreeWidget.h', + './include/DataSource/DataSourceTreeWidgetItem.h', + './include/DataSource/DataSourceWidget.h', + './include/Catalogue2/repositoriestreeview.h', + './include/Catalogue2/browser.h', + './include/Catalogue2/eventeditor.h', + './include/Catalogue2/eventsmodel.h', + './include/Catalogue2/eventstreeview.h', + './include/Catalogue2/repositoriesmodel.h', + './include/TimeWidget/TimeWidget.h', + './include/SqpApplication.h', + './include/SidePane/SqpSidePane.h', + './include/Variable/RenameVariableDialog.h', + './include/Variable/VariableInspectorWidget.h', + './include/Variable/VariableInspectorTableView.h', + './include/Variable/VariableMenuHeaderWidget.h', + './include/Visualization/VisualizationDragWidget.h', + './include/Visualization/VisualizationZoneWidget.h', + './include/Visualization/operations/GenerateVariableMenuOperation.h', + './include/Visualization/operations/RescaleAxeOperation.h', + './include/Visualization/operations/RemoveVariableOperation.h', + './include/Visualization/operations/MenuBuilder.h', + './include/Visualization/operations/FindVariableOperation.h', + './include/Visualization/VisualizationDefs.h', + './include/Visualization/IVisualizationWidgetVisitor.h', + './include/Visualization/SqpColorScale.h', + './include/Visualization/VisualizationGraphRenderingDelegate.h', + './include/Visualization/VisualizationGraphWidget.h', + './include/Visualization/MacScrollBarStyle.h', + './include/Visualization/IVisualizationWidget.h', + './include/Visualization/qcustomplot.h', + './include/Visualization/IGraphSynchronizer.h', + './include/Visualization/QCPColorMapIterator.h', + './include/Visualization/VisualizationActionManager.h', + './include/Visualization/VisualizationTabWidget.h', + './include/Visualization/IVariableContainer.h', + './include/Visualization/AxisRenderingUtils.h', + './include/Visualization/VisualizationMultiZoneSelectionDialog.h', + './include/Visualization/VisualizationCursorItem.h', + './include/Visualization/VisualizationWidget.h', + './include/Visualization/PlottablesRenderingUtils.h', + './include/Visualization/VisualizationSelectionZoneManager.h', + './include/Visualization/QCustomPlotSynchronizer.h', + './include/Visualization/VisualizationSelectionZoneItem.h', + './include/Visualization/VisualizationDragDropContainer.h', + './include/Visualization/ColorScaleEditor.h', + './include/Visualization/VisualizationGraphHelper.h', + './include/Actions/ActionsGuiController.h', + './include/Actions/FilteringAction.h', + './include/Actions/SelectionZoneAction.h' ] gui_ui_files = [ - 'ui/DataSource/DataSourceWidget.ui', - 'ui/Settings/SqpSettingsDialog.ui', - 'ui/Settings/SqpSettingsGeneralWidget.ui', - 'ui/SidePane/SqpSidePane.ui', - 'ui/TimeWidget/TimeWidget.ui', - 'ui/Variable/VariableInspectorWidget.ui', - 'ui/Variable/RenameVariableDialog.ui', - 'ui/Variable/VariableMenuHeaderWidget.ui', - 'ui/Visualization/VisualizationGraphWidget.ui', - 'ui/Visualization/VisualizationTabWidget.ui', - 'ui/Visualization/VisualizationWidget.ui', - 'ui/Visualization/VisualizationZoneWidget.ui', - 'ui/Visualization/ColorScaleEditor.ui', - 'ui/Visualization/VisualizationMultiZoneSelectionDialog.ui', - 'ui/Catalogue/CatalogueExplorer.ui', - 'ui/Catalogue/CatalogueEventsWidget.ui', - 'ui/Catalogue/CatalogueSideBarWidget.ui', - 'ui/Catalogue/CatalogueInspectorWidget.ui' + './ui/Settings/SqpSettingsGeneralWidget.ui', + './ui/Settings/SqpSettingsDialog.ui', + './ui/DataSource/DataSourceWidget.ui', + './ui/Catalogue2/browser.ui', + './ui/Catalogue2/eventeditor.ui', + './ui/TimeWidget/TimeWidget.ui', + './ui/SidePane/SqpSidePane.ui', + './ui/Variable/RenameVariableDialog.ui', + './ui/Variable/VariableInspectorWidget.ui', + './ui/Variable/VariableMenuHeaderWidget.ui', + './ui/Visualization/ColorScaleEditor.ui', + './ui/Visualization/VisualizationZoneWidget.ui', + './ui/Visualization/VisualizationMultiZoneSelectionDialog.ui', + './ui/Visualization/VisualizationGraphWidget.ui', + './ui/Visualization/VisualizationWidget.ui', + './ui/Visualization/VisualizationTabWidget.ui' ] gui_qresources = ['resources/sqpguiresources.qrc'] @@ -67,64 +95,59 @@ gui_moc_files = qt5.preprocess(moc_headers : gui_moc_headers, ui_files : gui_ui_files) gui_sources = [ - 'src/SqpApplication.cpp', - 'src/DragAndDrop/DragDropGuiController.cpp', - 'src/DragAndDrop/DragDropScroller.cpp', - 'src/DragAndDrop/DragDropTabSwitcher.cpp', - 'src/Common/ColorUtils.cpp', - 'src/Common/VisualizationDef.cpp', - 'src/DataSource/DataSourceTreeWidgetItem.cpp', - 'src/DataSource/DataSourceTreeWidgetHelper.cpp', - 'src/DataSource/DataSourceWidget.cpp', - 'src/DataSource/DataSourceTreeWidget.cpp', - 'src/Settings/SqpSettingsDialog.cpp', - 'src/Settings/SqpSettingsGeneralWidget.cpp', - 'src/SidePane/SqpSidePane.cpp', - 'src/TimeWidget/TimeWidget.cpp', - 'src/Variable/VariableInspectorWidget.cpp', - 'src/Variable/VariableInspectorTableView.cpp', - 'src/Variable/VariableMenuHeaderWidget.cpp', - 'src/Variable/RenameVariableDialog.cpp', - 'src/Visualization/VisualizationGraphHelper.cpp', - 'src/Visualization/VisualizationGraphRenderingDelegate.cpp', - 'src/Visualization/VisualizationGraphWidget.cpp', - 'src/Visualization/VisualizationTabWidget.cpp', - 'src/Visualization/VisualizationWidget.cpp', - 'src/Visualization/VisualizationZoneWidget.cpp', - 'src/Visualization/qcustomplot.cpp', - 'src/Visualization/QCustomPlotSynchronizer.cpp', - 'src/Visualization/operations/FindVariableOperation.cpp', - 'src/Visualization/operations/GenerateVariableMenuOperation.cpp', - 'src/Visualization/operations/MenuBuilder.cpp', - 'src/Visualization/operations/RemoveVariableOperation.cpp', - 'src/Visualization/operations/RescaleAxeOperation.cpp', - 'src/Visualization/VisualizationDragDropContainer.cpp', - 'src/Visualization/VisualizationDragWidget.cpp', - 'src/Visualization/AxisRenderingUtils.cpp', - 'src/Visualization/PlottablesRenderingUtils.cpp', - 'src/Visualization/MacScrollBarStyle.cpp', - 'src/Visualization/VisualizationCursorItem.cpp', - 'src/Visualization/ColorScaleEditor.cpp', - 'src/Visualization/SqpColorScale.cpp', - 'src/Visualization/QCPColorMapIterator.cpp', - 'src/Visualization/VisualizationSelectionZoneItem.cpp', - 'src/Visualization/VisualizationSelectionZoneManager.cpp', - 'src/Actions/SelectionZoneAction.cpp', - 'src/Actions/ActionsGuiController.cpp', - 'src/Actions/FilteringAction.cpp', - 'src/Visualization/VisualizationActionManager.cpp', - 'src/Visualization/VisualizationMultiZoneSelectionDialog.cpp', - 'src/Catalogue/CatalogueExplorer.cpp', - 'src/Catalogue/CatalogueEventsWidget.cpp', - 'src/Catalogue/CatalogueSideBarWidget.cpp', - 'src/Catalogue/CatalogueInspectorWidget.cpp', - 'src/Catalogue/CatalogueTreeItems/CatalogueAbstractTreeItem.cpp', - 'src/Catalogue/CatalogueTreeItems/CatalogueTreeItem.cpp', - 'src/Catalogue/CatalogueTreeItems/CatalogueTextTreeItem.cpp', - 'src/Catalogue/CatalogueEventsModel.cpp', - 'src/Catalogue/CatalogueExplorerHelper.cpp', - 'src/Catalogue/CatalogueActionManager.cpp', - 'src/Catalogue/CatalogueTreeModel.cpp' + './src/Common/ColorUtils.cpp', + './src/Common/VisualizationDef.cpp', + './src/SqpApplication.cpp', + './src/DragAndDrop/DragDropTabSwitcher.cpp', + './src/DragAndDrop/DragDropScroller.cpp', + './src/DragAndDrop/DragDropGuiController.cpp', + './src/Settings/SqpSettingsGeneralWidget.cpp', + './src/Settings/SqpSettingsDialog.cpp', + './src/DataSource/DataSourceTreeWidgetItem.cpp', + './src/DataSource/DataSourceTreeWidgetHelper.cpp', + './src/DataSource/DataSourceWidget.cpp', + './src/DataSource/DataSourceTreeWidget.cpp', + './src/Catalogue2/eventstreeview.cpp', + './src/Catalogue2/eventeditor.cpp', + './src/Catalogue2/repositoriestreeview.cpp', + './src/Catalogue2/browser.cpp', + './src/Catalogue2/eventsmodel.cpp', + './src/Catalogue2/repositoriesmodel.cpp', + './src/TimeWidget/TimeWidget.cpp', + './src/SidePane/SqpSidePane.cpp', + './src/Variable/VariableInspectorTableView.cpp', + './src/Variable/VariableInspectorWidget.cpp', + './src/Variable/RenameVariableDialog.cpp', + './src/Variable/VariableMenuHeaderWidget.cpp', + './src/Visualization/VisualizationGraphWidget.cpp', + './src/Visualization/PlottablesRenderingUtils.cpp', + './src/Visualization/AxisRenderingUtils.cpp', + './src/Visualization/VisualizationWidget.cpp', + './src/Visualization/qcustomplot.cpp', + './src/Visualization/VisualizationDragWidget.cpp', + './src/Visualization/VisualizationActionManager.cpp', + './src/Visualization/MacScrollBarStyle.cpp', + './src/Visualization/VisualizationSelectionZoneManager.cpp', + './src/Visualization/operations/FindVariableOperation.cpp', + './src/Visualization/operations/RescaleAxeOperation.cpp', + './src/Visualization/operations/MenuBuilder.cpp', + './src/Visualization/operations/GenerateVariableMenuOperation.cpp', + './src/Visualization/operations/RemoveVariableOperation.cpp', + './src/Visualization/VisualizationSelectionZoneItem.cpp', + './src/Visualization/VisualizationCursorItem.cpp', + './src/Visualization/QCPColorMapIterator.cpp', + './src/Visualization/QCustomPlotSynchronizer.cpp', + './src/Visualization/ColorScaleEditor.cpp', + './src/Visualization/VisualizationMultiZoneSelectionDialog.cpp', + './src/Visualization/VisualizationTabWidget.cpp', + './src/Visualization/VisualizationGraphHelper.cpp', + './src/Visualization/VisualizationGraphRenderingDelegate.cpp', + './src/Visualization/VisualizationDragDropContainer.cpp', + './src/Visualization/VisualizationZoneWidget.cpp', + './src/Visualization/SqpColorScale.cpp', + './src/Actions/FilteringAction.cpp', + './src/Actions/SelectionZoneAction.cpp', + './src/Actions/ActionsGuiController.cpp', ] gui_inc = include_directories(['include', 'include/Visualization']) diff --git a/gui/src/Catalogue/CatalogueActionManager.cpp b/gui/src/Catalogue/CatalogueActionManager.cpp deleted file mode 100644 index 6d99052..0000000 --- a/gui/src/Catalogue/CatalogueActionManager.cpp +++ /dev/null @@ -1,190 +0,0 @@ -#include "Catalogue/CatalogueActionManager.h" - -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -//#include -//#include -//#include -//#include - -#include -#include - -#include -#include -#include -#include -#include -#include - -const auto CATALOGUE_MENU_NAME = QObject::tr("Catalogues"); -const auto CATALOGUE_CREATE_EVENT_MENU_NAME = QObject::tr("New Event..."); - -const auto DEFAULT_EVENT_NAME = QObject::tr("Event"); -const auto DEFAULT_CATALOGUE_NAME = QObject::tr("Catalogue"); - -struct CatalogueActionManager::CatalogueActionManagerPrivate -{ - - CatalogueExplorer* m_CatalogueExplorer = nullptr; - QVector> m_CreateInCatalogueActions; - - CatalogueActionManagerPrivate(CatalogueExplorer* catalogueExplorer) - : m_CatalogueExplorer(catalogueExplorer) - { - } - - void createEventFromZones(const QString& eventName, - const QVector& zones, - const CatalogueController::Catalogue_ptr& catalogue = nullptr) - { - auto event = CatalogueController::make_event_ptr(); - event->name = eventName.toStdString(); - - // std::list productList; - for (auto zone : zones) - { - auto graph = zone->parentGraphWidget(); - for (auto var : graph->variables()) - { - - auto eventProduct = CatalogueController::Product_t(); - auto productId - = var->metadata().value(DataSourceItem::ID_DATA_KEY, "UnknownID").toString(); - - auto zoneRange = zone->range(); - eventProduct.startTime = zoneRange.m_TStart; - eventProduct.stopTime = zoneRange.m_TEnd; - - eventProduct.name = productId.toStdString(); - event->products.push_back(std::move(eventProduct)); - } - } - - sqpApp->catalogueController().add(event); - - - if (catalogue) - { - catalogue->add(event); - // TODO use notifications - // this shouldn't know GUI stuff and care about which widget to update - // sqpApp->catalogueController().updateCatalogue(catalogue); - // m_CatalogueExplorer->sideBarWidget().setCatalogueChanges(catalogue, true); - // if - // (m_CatalogueExplorer->eventsWidget().displayedCatalogues().contains(catalogue)) - // { - // m_CatalogueExplorer->eventsWidget().addEvent(event); - // m_CatalogueExplorer->eventsWidget().setEventChanges(event, true); - // } - } - else if (m_CatalogueExplorer->eventsWidget().isAllEventsDisplayed()) - { - // m_CatalogueExplorer->eventsWidget().addEvent(event); - // m_CatalogueExplorer->eventsWidget().setEventChanges(event, true); - } - } - - SelectionZoneAction::EnableFunction createEventEnableFuntion() const - { - return [](auto zones) { - // Checks that all variables in the zones doesn't refer to the same product - QSet usedDatasource; - for (auto zone : zones) - { - auto graph = zone->parentGraphWidget(); - auto variables = graph->variables(); - - for (auto var : variables) - { - auto datasourceId - = var->metadata().value(DataSourceItem::ID_DATA_KEY).toString(); - if (!usedDatasource.contains(datasourceId)) - { - usedDatasource.insert(datasourceId); - } - else - { - return false; - } - } - } - - return true; - }; - } -}; - -CatalogueActionManager::CatalogueActionManager(CatalogueExplorer* catalogueExplorer) - : impl { spimpl::make_unique_impl(catalogueExplorer) } -{ -} - -void CatalogueActionManager::installSelectionZoneActions() -{ - // auto &actionController = sqpApp->actionsGuiController(); - - // auto createEventAction = actionController.addSectionZoneAction( - // {CATALOGUE_MENU_NAME, CATALOGUE_CREATE_EVENT_MENU_NAME}, QObject::tr("Without - // Catalogue"), [this](auto zones) { impl->createEventFromZones(DEFAULT_EVENT_NAME, - // zones); }); - // createEventAction->setEnableFunction(impl->createEventEnableFuntion()); - // createEventAction->setAllowedFiltering(false); - - // auto createEventInNewCatalogueAction = actionController.addSectionZoneAction( - // {CATALOGUE_MENU_NAME, CATALOGUE_CREATE_EVENT_MENU_NAME}, QObject::tr("In New - // Catalogue"), [this](auto zones) { - - // auto newCatalogue = std::make_shared(); - // newCatalogue->setName(DEFAULT_CATALOGUE_NAME); - // sqpApp->catalogueController().addCatalogue(newCatalogue); - // impl->m_CatalogueExplorer->sideBarWidget().addCatalogue(newCatalogue, - // REPOSITORY_DEFAULT); - - // impl->createEventFromZones(DEFAULT_EVENT_NAME, zones, newCatalogue); - // }); - // createEventInNewCatalogueAction->setEnableFunction(impl->createEventEnableFuntion()); - // createEventInNewCatalogueAction->setAllowedFiltering(false); - - // refreshCreateInCatalogueAction(); - - // actionController.addFilterForMenu({CATALOGUE_MENU_NAME, - // CATALOGUE_CREATE_EVENT_MENU_NAME}); -} - -void CatalogueActionManager::refreshCreateInCatalogueAction() -{ - // auto& actionController = sqpApp->actionsGuiController(); - - // for (auto action : impl->m_CreateInCatalogueActions) - // { - // actionController.removeAction(action); - // } - // impl->m_CreateInCatalogueActions.clear(); - - // auto allCatalogues - // = impl->m_CatalogueExplorer->sideBarWidget().getCatalogues(REPOSITORY_DEFAULT); - - // for (auto catalogue : allCatalogues) - // { - // auto catalogueName = catalogue->getName(); - // auto createEventInCatalogueAction = actionController.addSectionZoneAction( - // { CATALOGUE_MENU_NAME, CATALOGUE_CREATE_EVENT_MENU_NAME }, - // QObject::tr("In \"").append(catalogueName).append("\""), [this, catalogue](auto - // zones) { - // impl->createEventFromZones(DEFAULT_EVENT_NAME, zones, catalogue); - // }); - // createEventInCatalogueAction->setEnableFunction(impl->createEventEnableFuntion()); - // impl->m_CreateInCatalogueActions << createEventInCatalogueAction; - // } -} diff --git a/gui/src/Catalogue/CatalogueEventsModel.cpp b/gui/src/Catalogue/CatalogueEventsModel.cpp deleted file mode 100644 index db27a73..0000000 --- a/gui/src/Catalogue/CatalogueEventsModel.cpp +++ /dev/null @@ -1,502 +0,0 @@ -#include "Catalogue/CatalogueEventsModel.h" - -#include -#include -#include -#include -#include -#include -#include