diff options
Diffstat (limited to 'src/mainwindow.cc')
-rw-r--r-- | src/mainwindow.cc | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/mainwindow.cc b/src/mainwindow.cc index e52b9f3..298c811 100644 --- a/src/mainwindow.cc +++ b/src/mainwindow.cc @@ -117,6 +117,11 @@ MainWindow::MainWindow(QString p) connect(act, SIGNAL(triggered()), this, SLOT(reset())); } + { + QAction *act = toolbar->addAction("Image"); + connect(act, SIGNAL(triggered()), this, SLOT(image())); + } + loadSettings(); statusBar()->showMessage(tr("Ready")); @@ -356,6 +361,28 @@ void MainWindow::reset() out->reset(); } +void MainWindow::image() +{ + QString filename + = QFileDialog::getSaveFileName(this, tr("Save Kaiman File"), + "", + tr("Image Files (*.png)")); + + if(filename == "") + { + // User clicked cancel + return; + } + + if(filename.right(4) != ".png") + { + filename += ".png"; + } + + auto image = out->acquire(true); + image.save(filename); +} + void MainWindow::programChanged() { dirty = true; |