summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Sergey Starosek <sergey.starosek@gmail.com>2014-06-27 16:17:33 +0400
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-06-27 06:56:21 -0700
commite88f37d3278c74052e122457498de244b1c73d60 (patch)
tree570858d2a04b82c89298428ccce206764ac8bc31
parentd1511aa9680d17c28ded0ee9b5472b1189edac65 (diff)
downloadsubsurface-e88f37d3278c74052e122457498de244b1c73d60.tar.gz
Start external viewer on photo double-click
Signed-off-by: Sergey Starosek <sergey.starosek@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r--qt-ui/maintab.cpp7
-rw-r--r--qt-ui/maintab.h1
2 files changed, 8 insertions, 0 deletions
diff --git a/qt-ui/maintab.cpp b/qt-ui/maintab.cpp
index 3df1e8a32..6f9be07b8 100644
--- a/qt-ui/maintab.cpp
+++ b/qt-ui/maintab.cpp
@@ -27,6 +27,7 @@
#include <QScrollBar>
#include <QShortcut>
#include <QMessageBox>
+#include <QDesktopServices>
MainTab::MainTab(QWidget *parent) : QTabWidget(parent),
weightModel(new WeightModel(this)),
@@ -41,6 +42,7 @@ MainTab::MainTab(QWidget *parent) : QTabWidget(parent),
ui.cylinders->setModel(cylindersModel);
ui.weights->setModel(weightModel);
ui.photosView->setModel(divePictureModel);
+ connect(ui.photosView, SIGNAL(photoDoubleClicked(QString)), this, SLOT(photoDoubleClicked(QString)));
closeMessage();
QAction *action = new QAction(tr("Save"), this);
@@ -1119,3 +1121,8 @@ void MainTab::escDetected()
if (editMode != NONE)
rejectChanges();
}
+
+void MainTab::photoDoubleClicked(const QString filePath)
+{
+ QDesktopServices::openUrl(QUrl::fromLocalFile(filePath));
+}
diff --git a/qt-ui/maintab.h b/qt-ui/maintab.h
index f20af8477..3d51f72d6 100644
--- a/qt-ui/maintab.h
+++ b/qt-ui/maintab.h
@@ -85,6 +85,7 @@ slots:
void updateTextLabels(bool showUnits = true);
QString trHemisphere(const char *orig);
void escDetected(void);
+ void photoDoubleClicked(const QString filePath);
private:
Ui::MainTab ui;