summaryrefslogtreecommitdiff
path: root/metawatch/metawatchdigitalsimulatorform.cpp
diff options
context:
space:
mode:
authorJavier S. Pedro <maemo@javispedro.com>2012-09-02 20:53:05 +0200
committerJavier S. Pedro <maemo@javispedro.com>2012-09-02 20:53:05 +0200
commit2f631362b54180252d0daa34f359338860a8782b (patch)
tree86148bee6e0b09e2c68a8166fc2b6143f22d7949 /metawatch/metawatchdigitalsimulatorform.cpp
parent3e5440a3e1d4f23180b8e6795ae1c29f9964379d (diff)
downloadsowatch-2f631362b54180252d0daa34f359338860a8782b.tar.gz
sowatch-2f631362b54180252d0daa34f359338860a8782b.zip
fixing a few warnings
Diffstat (limited to 'metawatch/metawatchdigitalsimulatorform.cpp')
-rw-r--r--metawatch/metawatchdigitalsimulatorform.cpp23
1 files changed, 22 insertions, 1 deletions
diff --git a/metawatch/metawatchdigitalsimulatorform.cpp b/metawatch/metawatchdigitalsimulatorform.cpp
index fc3c890..04d6482 100644
--- a/metawatch/metawatchdigitalsimulatorform.cpp
+++ b/metawatch/metawatchdigitalsimulatorform.cpp
@@ -1,10 +1,13 @@
+#include <QtCore/QDebug>
+#include <QtGui/QFileDialog>
+
#include "metawatchdigitalsimulatorform.h"
#include "ui_metawatchdigitalsimulatorform.h"
using namespace sowatch;
MetaWatchDigitalSimulatorForm::MetaWatchDigitalSimulatorForm(QWidget* parent) :
- QWidget(parent),
+ QMainWindow(parent),
ui(new Ui::MetaWatchDigitalSimulatorForm)
{
ui->setupUi(this);
@@ -80,3 +83,21 @@ void MetaWatchDigitalSimulatorForm::btnFReleased()
{
emit buttonReleased(5);
}
+
+void MetaWatchDigitalSimulatorForm::on_actionCaptureScreen_triggered()
+{
+ QString fileName = QFileDialog::getSaveFileName(this, tr("Save capture"), QString(), tr("Images (*.png)"));
+ if (fileName.isEmpty()) {
+ return;
+ }
+ if (!fileName.endsWith(".png")) {
+ fileName.append(".png");
+ }
+ qDebug() << "Saving to" << fileName;
+ ui->lblDisplay->pixmap()->save(fileName, "PNG");
+}
+
+void MetaWatchDigitalSimulatorForm::on_actionQuit_triggered()
+{
+ QApplication::quit();
+}