##// END OF EJS Templates
Adds selection zone actions in the context menu
trabillard -
r1112:77b0e391c46a
parent child
Show More
@@ -10,6 +10,7
10 10 #include "Visualization/VisualizationZoneWidget.h"
11 11 #include "ui_VisualizationGraphWidget.h"
12 12
13 #include <Actions/ActionsGuiController.h>
13 14 #include <Common/MimeTypesDef.h>
14 15 #include <Data/ArrayData.h>
15 16 #include <Data/IDataSeries.h>
@@ -602,6 +603,22 void VisualizationGraphWidget::onGraphMenuRequested(const QPoint &pos) noexcept
602 603 graphMenu.addAction(tr("Undo Zoom"), [this]() { undoZoom(); });
603 604 }
604 605
606 auto selectionZoneItem = impl->selectionZoneAt(pos, plot());
607 if (selectionZoneItem) {
608 auto selectedItems = parentVisualizationWidget()->selectionZoneManager().selectedItems();
609 auto zoneActions = sqpApp->actionsGuiController().selectionZoneActions();
610 if (!zoneActions.isEmpty() && !graphMenu.isEmpty()) {
611 graphMenu.addSeparator();
612 }
613
614 for (auto zoneAction : zoneActions) {
615 auto action = graphMenu.addAction(zoneAction->name());
616 QObject::connect(action, &QAction::triggered, [zoneAction, &selectedItems]() {
617 zoneAction->execute(selectedItems);
618 });
619 }
620 }
621
605 622 if (!graphMenu.isEmpty()) {
606 623 graphMenu.exec(QCursor::pos());
607 624 }
General Comments 4
Under Review
author

Auto status change to "Under Review"

Approved

Status change > Approved

Approved

Status change > Approved

You need to be logged in to leave comments. Login now