##// END OF EJS Templates
Prevent the creation of events with the same product on 2 graphs
trabillard -
r1312:fc19e80a8809
parent child
Show More
@@ -90,16 +90,23 void CatalogueActionManager::installSelectionZoneActions()
90 90 auto &actionController = sqpApp->actionsGuiController();
91 91
92 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 96 for (auto zone : zones) {
95 97 auto graph = zone->parentGraphWidget();
96 if (!usedGraphs.contains(graph)) {
97 usedGraphs.insert(graph);
98 auto variables = graph->variables();
99
100 for (auto var : variables) {
101 auto datasourceId = var->metadata().value(DataSourceItem::ID_DATA_KEY).toString();
102 if (!usedDatasource.contains(datasourceId)) {
103 usedDatasource.insert(datasourceId);
98 104 }
99 105 else {
100 106 return false;
101 107 }
102 108 }
109 }
103 110
104 111 return true;
105 112 };
General Comments 0
You need to be logged in to leave comments. Login now