##// END OF EJS Templates
Prevent the creation of events with the same product on 2 graphs
trabillard -
r1312:fc19e80a8809
parent child
Show More
@@ -90,14 +90,21 void CatalogueActionManager::installSelectionZoneActions()
90 auto &actionController = sqpApp->actionsGuiController();
90 auto &actionController = sqpApp->actionsGuiController();
91
91
92 auto createEventEnableFuntion = [](auto zones) {
92 auto createEventEnableFuntion = [](auto zones) {
93 QSet<VisualizationGraphWidget *> usedGraphs;
93
94 // Checks that all variables in the zones doesn't refer to the same product
95 QSet<QString> usedDatasource;
94 for (auto zone : zones) {
96 for (auto zone : zones) {
95 auto graph = zone->parentGraphWidget();
97 auto graph = zone->parentGraphWidget();
96 if (!usedGraphs.contains(graph)) {
98 auto variables = graph->variables();
97 usedGraphs.insert(graph);
99
98 }
100 for (auto var : variables) {
99 else {
101 auto datasourceId = var->metadata().value(DataSourceItem::ID_DATA_KEY).toString();
100 return false;
102 if (!usedDatasource.contains(datasourceId)) {
103 usedDatasource.insert(datasourceId);
104 }
105 else {
106 return false;
107 }
101 }
108 }
102 }
109 }
103
110
General Comments 0
You need to be logged in to leave comments. Login now