diff options
author | Robert C. Helling <helling@atdotde.de> | 2014-02-12 16:46:17 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-02-17 10:56:43 -0800 |
commit | fe2a264db3ee9ef49c87e5530d8d198357cd43b5 (patch) | |
tree | d18afcb3ab3d71cd48e45b8ad6160091e4a83c05 /qt-ui/divelistview.cpp | |
parent | dd24eaa377bf95fa9dafd43ca5989aebd822663b (diff) | |
download | subsurface-fe2a264db3ee9ef49c87e5530d8d198357cd43b5.tar.gz |
Store camera time offset in preferences
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/divelistview.cpp')
-rw-r--r-- | qt-ui/divelistview.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/qt-ui/divelistview.cpp b/qt-ui/divelistview.cpp index 028b232c2..14a2f30e5 100644 --- a/qt-ui/divelistview.cpp +++ b/qt-ui/divelistview.cpp @@ -813,7 +813,9 @@ void DiveListView::loadImages() updateLastUsedImageDir(QFileInfo(fileNames[0]).dir().path()); ShiftImageTimesDialog shiftDialog(this); + shiftDialog.setOffset(lastImageTimeOffset()); shiftDialog.exec(); + updateLastImageTimeOffset(shiftDialog.amount()); for (int i = 0; i < fileNames.size(); ++i) { struct tm tm; @@ -890,3 +892,21 @@ void DiveListView::updateLastUsedImageDir(const QString& dir) s.beginGroup("FileDialog"); s.setValue("LastImageDir", dir); } + +int DiveListView::lastImageTimeOffset() +{ + QSettings settings; + int offset = 0; + + settings.beginGroup("MainWindow"); + if (settings.contains("LastImageTimeOffset")) + offset = settings.value("LastImageTimeOffset").toInt(); + return offset; +} + +void DiveListView::updateLastImageTimeOffset(const int offset) +{ + QSettings s; + s.beginGroup("MainWindow"); + s.setValue("LastImageTimeOffset", offset); +} |