Start external viewer on photo double-click

Signed-off-by: Sergey Starosek <sergey.starosek@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Sergey Starosek 2014-06-27 16:17:33 +04:00 committed by Dirk Hohndel
parent d1511aa968
commit e88f37d327
2 changed files with 8 additions and 0 deletions

View file

@ -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));
}

View file

@ -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;