From 5b07bdc9238a09f2f1b661a40ca074f0c86b8349 Mon Sep 17 00:00:00 2001 From: Thomas Kroes Date: Wed, 18 Dec 2024 09:48:40 +0100 Subject: [PATCH] Some last housekeeping --- ManiVault/src/PluginFactory.h | 2 +- ManiVault/src/ViewPlugin.h | 2 +- .../actions/PluginLearningCenterAction.cpp | 19 ------------------- .../src/actions/PluginLearningCenterAction.h | 6 +----- .../TutorialPlugin/src/TutorialPlugin.cpp | 2 +- .../src/private/StartPageGetStartedWidget.cpp | 2 ++ .../ViewPluginLearningCenterOverlayWidget.cpp | 9 +++++---- 7 files changed, 11 insertions(+), 31 deletions(-) diff --git a/ManiVault/src/PluginFactory.h b/ManiVault/src/PluginFactory.h index 638917a0c..36959b427 100644 --- a/ManiVault/src/PluginFactory.h +++ b/ManiVault/src/PluginFactory.h @@ -200,7 +200,7 @@ class CORE_EXPORT PluginFactory : public QObject /** * Get plugin trigger actions given \p dataTypes - * @param datasetTypes Vector of input data types + * @param dataTypes Vector of input data types * @return Vector of plugin trigger actions */ virtual gui::PluginTriggerActions getPluginTriggerActions(const DataTypes& dataTypes) const { diff --git a/ManiVault/src/ViewPlugin.h b/ManiVault/src/ViewPlugin.h index 4cc843e72..bfe662b91 100644 --- a/ManiVault/src/ViewPlugin.h +++ b/ManiVault/src/ViewPlugin.h @@ -193,7 +193,7 @@ class CORE_EXPORT ViewPluginFactory : public PluginFactory ViewPluginFactory(bool producesSystemViewPlugins = false); /** Destructor */ - ~ViewPluginFactory() = default; + ~ViewPluginFactory() override = default; /** * Get plugin icon diff --git a/ManiVault/src/actions/PluginLearningCenterAction.cpp b/ManiVault/src/actions/PluginLearningCenterAction.cpp index 31677de6a..282c85c78 100644 --- a/ManiVault/src/actions/PluginLearningCenterAction.cpp +++ b/ManiVault/src/actions/PluginLearningCenterAction.cpp @@ -50,8 +50,6 @@ PluginLearningCenterAction::PluginLearningCenterAction(QObject* parent, const QS _viewDescriptionAction.setConfigurationFlag(WidgetAction::ConfigurationFlag::HiddenInActionContextMenu); _viewDescriptionAction.setConnectionPermissionsToForceNone(); - connect(&_viewDescriptionAction, &TriggerAction::triggered, this, &PluginLearningCenterAction::viewDescription); - _viewHelpAction.setConfigurationFlag(WidgetAction::ConfigurationFlag::HiddenInActionContextMenu, false); _viewHelpAction.setConnectionPermissionsToForceNone(); @@ -311,23 +309,6 @@ plugin::ViewPlugin* PluginLearningCenterAction::getViewPlugin() const return dynamic_cast(_plugin); } -void PluginLearningCenterAction::viewDescription() const -{ -#ifdef VIEW_PLUGIN_VERBOSE - qDebug() << __FUNCTION__; -#endif - - if (isViewPlugin() && hasDescription()) - { - if (!_descriptionOverlayWidget.isNull()) - return; - - ViewPluginDescriptionDialog viewPluginDescriptionDialog(dynamic_cast(_plugin)); - - viewPluginDescriptionDialog.exec(); - } -} - void PluginLearningCenterAction::viewShortcuts() const { #ifdef VIEW_PLUGIN_VERBOSE diff --git a/ManiVault/src/actions/PluginLearningCenterAction.h b/ManiVault/src/actions/PluginLearningCenterAction.h index 2d881390d..c5ad64aed 100644 --- a/ManiVault/src/actions/PluginLearningCenterAction.h +++ b/ManiVault/src/actions/PluginLearningCenterAction.h @@ -233,9 +233,6 @@ class CORE_EXPORT PluginLearningCenterAction final : public WidgetAction */ mv::plugin::ViewPlugin* getViewPlugin() const; - /** View plugin description (view depends on the type of plugin) */ - void viewDescription() const; - /** View shortcuts (view depends on the type of plugin) */ void viewShortcuts() const; @@ -269,7 +266,7 @@ class CORE_EXPORT PluginLearningCenterAction final : public WidgetAction const TriggerAction& getViewDescriptionAction() const { return _viewDescriptionAction; } const TriggerAction& getViewHelpAction() const { return _viewHelpAction; } const TriggerAction& getViewShortcutsAction() const { return _viewShortcutsAction; } - const ToggleAction& getOverlayVisibleAction() const { return _toolbarVisibleAction; } + const ToggleAction& getToolbarVisibleAction() const { return _toolbarVisibleAction; } const TriggerAction& getHideToolbarAction() const { return _hideToolbarAction; } const OptionAction& getAlignmentAction() const { return _alignmentAction; } const TriggerAction& getMoveToTopRightAction() const { return _moveToTopRightAction; } @@ -326,7 +323,6 @@ class CORE_EXPORT PluginLearningCenterAction final : public WidgetAction util::LearningCenterVideos _videos; /** Plugin related videos */ util::LearningCenterTutorials _tutorials; /** Plugin related tutorials */ ViewPluginLearningCenterOverlayWidget* _learningCenterOverlayWidget; /** Add learning center overlay widget */ - QPointer _descriptionOverlayWidget; /** Guarded pointer to description overlay widget */ friend class plugin::ViewPlugin; }; diff --git a/ManiVault/src/plugins/TutorialPlugin/src/TutorialPlugin.cpp b/ManiVault/src/plugins/TutorialPlugin/src/TutorialPlugin.cpp index 21ad278ac..1feee7935 100644 --- a/ManiVault/src/plugins/TutorialPlugin/src/TutorialPlugin.cpp +++ b/ManiVault/src/plugins/TutorialPlugin/src/TutorialPlugin.cpp @@ -22,7 +22,7 @@ TutorialPlugin::TutorialPlugin(const PluginFactory* factory) : _tutorialPickerAction(this, "Pick tutorial"), _openInBrowserAction(this, "Open in browser") { - getLearningCenterAction().getToolbarVisibleAction().setChecked(false); + getLearningCenterAction().getToolbarVisibleAction().setChecked(true); _horizontalGroupAction.setShowLabels(false); diff --git a/ManiVault/src/private/StartPageGetStartedWidget.cpp b/ManiVault/src/private/StartPageGetStartedWidget.cpp index 5b240fa2c..4c309f9f6 100644 --- a/ManiVault/src/private/StartPageGetStartedWidget.cpp +++ b/ManiVault/src/private/StartPageGetStartedWidget.cpp @@ -69,10 +69,12 @@ StartPageGetStartedWidget::StartPageGetStartedWidget(StartPageContentWidget* sta const auto toggleViews = [this]() -> void { _createProjectFromWorkspaceWidget.setVisible(_startPageContentWidget->getToggleProjectFromWorkspaceAction().isChecked()); _createProjectFromDatasetWidget.setVisible(_startPageContentWidget->getToggleProjectFromDataAction().isChecked()); + _tutorialsWidget.setVisible(_startPageContentWidget->getToggleTutorialsAction().isChecked()); }; connect(&_startPageContentWidget->getToggleProjectFromWorkspaceAction(), &ToggleAction::toggled, this, toggleViews); connect(&_startPageContentWidget->getToggleProjectFromDataAction(), &ToggleAction::toggled, this, toggleViews); + connect(&_startPageContentWidget->getToggleTutorialsAction(), &ToggleAction::toggled, this, toggleViews); toggleViews(); } diff --git a/ManiVault/src/widgets/ViewPluginLearningCenterOverlayWidget.cpp b/ManiVault/src/widgets/ViewPluginLearningCenterOverlayWidget.cpp index c05f8d973..27b785063 100644 --- a/ManiVault/src/widgets/ViewPluginLearningCenterOverlayWidget.cpp +++ b/ManiVault/src/widgets/ViewPluginLearningCenterOverlayWidget.cpp @@ -111,6 +111,7 @@ ViewPluginLearningCenterOverlayWidget::ViewPluginLearningCenterOverlayWidget(QWi connect(&getLearningCenterAction().getHideToolbarAction(), &TriggerAction::triggered, this, [this]() -> void { collapse(); _learningCenterToolbarItemWidget.getWidgetFader().setOpacity(0.f, animationDuration); + hide(); }); alignmentChanged(); @@ -339,7 +340,7 @@ ViewPluginLearningCenterOverlayWidget::LearningCenterToolbarItemWidget::Learning updateTooltip(); - connect(&getViewPlugin()->getLearningCenterAction().getOverlayVisibleAction(), &ToggleAction::toggled, this, [this, updateTooltip]() -> void + connect(&getViewPlugin()->getLearningCenterAction().getToolbarVisibleAction(), &ToggleAction::toggled, this, [this, updateTooltip]() -> void { updateTooltip(); updateIcon(); @@ -355,7 +356,7 @@ QIcon ViewPluginLearningCenterOverlayWidget::LearningCenterToolbarItemWidget::ge bool ViewPluginLearningCenterOverlayWidget::LearningCenterToolbarItemWidget::shouldDisplay() const { - return getViewPlugin()->getLearningCenterAction().getOverlayVisibleAction().isChecked(); + return getViewPlugin()->getLearningCenterAction().getToolbarVisibleAction().isChecked(); } ViewPluginLearningCenterOverlayWidget::VideosToolbarItemWidget::VideosToolbarItemWidget(const plugin::ViewPlugin* viewPlugin, ViewPluginLearningCenterOverlayWidget* overlayWidget) : @@ -745,7 +746,7 @@ ViewPluginLearningCenterOverlayWidget::ToolbarWidget::ToolbarWidget(const plugin QTimer::singleShot(widgetAsyncUpdateTimerInterval + animationDuration, _overlayWidget, &ViewPluginLearningCenterOverlayWidget::updateMask); }); - connect(&_viewPlugin->getLearningCenterAction().getOverlayVisibleAction(), &ToggleAction::toggled, this, &ToolbarWidget::visibilityChanged); + connect(&_viewPlugin->getLearningCenterAction().getToolbarVisibleAction(), &ToggleAction::toggled, this, &ToolbarWidget::visibilityChanged); connect(&_viewPlugin->getLearningCenterAction().getAlignmentAction(), &OptionAction::currentIndexChanged, this, &ToolbarWidget::alignmentChanged); @@ -847,7 +848,7 @@ void ViewPluginLearningCenterOverlayWidget::ToolbarWidget::visibilityChanged() if (_alwaysVisible) return; - if (_viewPlugin->getLearningCenterAction().getOverlayVisibleAction().isChecked()) { + if (_viewPlugin->getLearningCenterAction().getToolbarVisibleAction().isChecked()) { _backgroundWidgetFader.setOpacity(0.95f, animationDuration); _overlayWidget->addMouseEventReceiverWidget(this); update();