summaryrefslogtreecommitdiffstats
path: root/qt-ui/divelistview.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'qt-ui/divelistview.cpp')
-rw-r--r--qt-ui/divelistview.cpp20
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);
+}