Skip to content

Commit

Permalink
Some last housekeeping
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasKroes committed Dec 18, 2024
1 parent 45c6447 commit 5b07bdc
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 31 deletions.
2 changes: 1 addition & 1 deletion ManiVault/src/PluginFactory.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion ManiVault/src/ViewPlugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ class CORE_EXPORT ViewPluginFactory : public PluginFactory
ViewPluginFactory(bool producesSystemViewPlugins = false);

/** Destructor */
~ViewPluginFactory() = default;
~ViewPluginFactory() override = default;

/**
* Get plugin icon
Expand Down
19 changes: 0 additions & 19 deletions ManiVault/src/actions/PluginLearningCenterAction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down Expand Up @@ -311,23 +309,6 @@ plugin::ViewPlugin* PluginLearningCenterAction::getViewPlugin() const
return dynamic_cast<ViewPlugin*>(_plugin);
}

void PluginLearningCenterAction::viewDescription() const
{
#ifdef VIEW_PLUGIN_VERBOSE
qDebug() << __FUNCTION__;
#endif

if (isViewPlugin() && hasDescription())
{
if (!_descriptionOverlayWidget.isNull())
return;

ViewPluginDescriptionDialog viewPluginDescriptionDialog(dynamic_cast<ViewPlugin*>(_plugin));

viewPluginDescriptionDialog.exec();
}
}

void PluginLearningCenterAction::viewShortcuts() const
{
#ifdef VIEW_PLUGIN_VERBOSE
Expand Down
6 changes: 1 addition & 5 deletions ManiVault/src/actions/PluginLearningCenterAction.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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; }
Expand Down Expand Up @@ -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<QWidget> _descriptionOverlayWidget; /** Guarded pointer to description overlay widget */

friend class plugin::ViewPlugin;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
2 changes: 2 additions & 0 deletions ManiVault/src/private/StartPageGetStartedWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ ViewPluginLearningCenterOverlayWidget::ViewPluginLearningCenterOverlayWidget(QWi
connect(&getLearningCenterAction().getHideToolbarAction(), &TriggerAction::triggered, this, [this]() -> void {
collapse();
_learningCenterToolbarItemWidget.getWidgetFader().setOpacity(0.f, animationDuration);
hide();
});

alignmentChanged();
Expand Down Expand Up @@ -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();
Expand All @@ -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) :
Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit 5b07bdc

Please sign in to comment.