| 290 | |
| 291 | |
| 292 | void PlotCanvas::saveCurrentLayer(bool visible) |
| 293 | { |
| 294 | const LayerDataBase& layer = getCurrentLayer(); |
| 295 | |
| 296 | // determine proposed filename |
| 297 | String proposed_name = param_.getValue("default_path").toString(); |
| 298 | if (visible == false && layer.filename != "") |
| 299 | { |
| 300 | proposed_name = layer.filename; |
| 301 | } |
| 302 | |
| 303 | auto formats = layer.storeFullData()->getSupportedFileFormats(); // storeFullData() is cheap; we just want the formats... |
| 304 | QString file_name = GUIHelpers::getSaveFilename(this, "Save file", proposed_name.toQString(), formats, true, formats.getTypes().front()); |
| 305 | if (file_name.isEmpty()) |
| 306 | { |
| 307 | return; |
| 308 | } |
| 309 | |
| 310 | auto visitor_data = visible ? layer.storeVisibleData(getVisibleArea().getAreaUnit(), layer.filters) : layer.storeFullData(); |
| 311 | visitor_data->saveToFile(file_name, ProgressLogger::GUI); |
| 312 | modificationStatus_(getCurrentLayerIndex(), false); |
| 313 | } |
| 314 | |
| 315 | void PlotCanvas::paintGridLines_(QPainter& painter) |
| 316 | { |
no test coverage detected