| 257 | } |
| 258 | |
| 259 | void PlotWidget::closeEvent(QCloseEvent* e) |
| 260 | { |
| 261 | for (UInt l = 0; l < canvas()->getLayerCount(); ++l) |
| 262 | { |
| 263 | //modified => ask if it should be saved |
| 264 | const LayerDataBase& layer = canvas()->getLayer(l); |
| 265 | if (layer.modified) |
| 266 | { |
| 267 | QMessageBox::StandardButton result = QMessageBox::question(this, "Save?", (String("Do you want to save your changes to layer '") + layer.getName() + "'?").toQString(), QMessageBox::Ok | QMessageBox::Discard); |
| 268 | if (result == QMessageBox::Ok) |
| 269 | { |
| 270 | canvas()->activateLayer(l); |
| 271 | canvas()->saveCurrentLayer(false); |
| 272 | } |
| 273 | } |
| 274 | } |
| 275 | e->accept(); |
| 276 | } |
| 277 | |
| 278 | void PlotWidget::dragEnterEvent(QDragEnterEvent* event) |
| 279 | { |
nothing calls this directly
no test coverage detected