##// END OF EJS Templates
Closes all graphs of the selected zone in graph mode
trabillard -
r1307:47a361805173
parent child
Show More
@@ -68,6 +68,9 public:
68 /// Returns the first graph in the zone or nullptr if there is no graph inside
68 /// Returns the first graph in the zone or nullptr if there is no graph inside
69 VisualizationGraphWidget *firstGraph() const;
69 VisualizationGraphWidget *firstGraph() const;
70
70
71 /// Closes all graphes inside the zone
72 void closeAllGraphs();
73
71 // IVisualizationWidget interface
74 // IVisualizationWidget interface
72 void accept(IVisualizationWidgetVisitor *visitor) override;
75 void accept(IVisualizationWidgetVisitor *visitor) override;
73 bool canDrop(const Variable &variable) const override;
76 bool canDrop(const Variable &variable) const override;
@@ -259,7 +259,7 struct CatalogueEventsWidget::CatalogueEventsWidgetPrivate {
259 return;
259 return;
260 }
260 }
261
261
262 // Close the previous graph and delete the asociated variables
262 // Closes the previous graph and delete the asociated variables
263 for (auto graph : m_CustomGraphs) {
263 for (auto graph : m_CustomGraphs) {
264 graph->close();
264 graph->close();
265 auto variables = graph->variables().toVector();
265 auto variables = graph->variables().toVector();
@@ -270,6 +270,9 struct CatalogueEventsWidget::CatalogueEventsWidgetPrivate {
270 }
270 }
271 m_CustomGraphs.clear();
271 m_CustomGraphs.clear();
272
272
273 // Closes the remaining graphs inside the zone
274 zone->closeAllGraphs();
275
273 // Calculates the range of each graph which will be created
276 // Calculates the range of each graph which will be created
274 auto graphRange = getGraphRanges(event);
277 auto graphRange = getGraphRanges(event);
275
278
@@ -336,6 +336,12 VisualizationGraphWidget *VisualizationZoneWidget::firstGraph() const
336 return firstGraph;
336 return firstGraph;
337 }
337 }
338
338
339 void VisualizationZoneWidget::closeAllGraphs()
340 {
341 processGraphs(*ui->dragDropContainer->layout(),
342 [](VisualizationGraphWidget &graphWidget) { graphWidget.close(); });
343 }
344
339 void VisualizationZoneWidget::accept(IVisualizationWidgetVisitor *visitor)
345 void VisualizationZoneWidget::accept(IVisualizationWidgetVisitor *visitor)
340 {
346 {
341 if (visitor) {
347 if (visitor) {
General Comments 0
You need to be logged in to leave comments. Login now