summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--qt-ui/shifttimes.ui25
-rw-r--r--qt-ui/simplewidgets.cpp12
2 files changed, 21 insertions, 16 deletions
diff --git a/qt-ui/shifttimes.ui b/qt-ui/shifttimes.ui
index 39b3250a1..b3c8c958f 100644
--- a/qt-ui/shifttimes.ui
+++ b/qt-ui/shifttimes.ui
@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
- <width>229</width>
- <height>134</height>
+ <width>343</width>
+ <height>226</height>
</rect>
</property>
<property name="windowTitle">
@@ -18,7 +18,7 @@
<number>0</number>
</property>
<property name="leftMargin">
- <number>0</number>
+ <number>14</number>
</property>
<property name="topMargin">
<number>0</number>
@@ -35,11 +35,14 @@
<string>Shift times of selected dives by</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
+ <property name="spacing">
+ <number>0</number>
+ </property>
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
- <number>0</number>
+ <number>23</number>
</property>
<property name="rightMargin">
<number>0</number>
@@ -73,29 +76,25 @@
<day>1</day>
</date>
</property>
+ <property name="displayFormat">
+ <string>h:mm</string>
+ </property>
<property name="timeSpec">
<enum>Qt::LocalTime</enum>
</property>
- <property name="time">
- <time>
- <hour>0</hour>
- <minute>0</minute>
- <second>0</second>
- </time>
- </property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="backwards">
<property name="text">
- <string>backwards</string>
+ <string>earlier</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="forward">
<property name="text">
- <string>forward</string>
+ <string>later</string>
</property>
<property name="checked">
<bool>true</bool>
diff --git a/qt-ui/simplewidgets.cpp b/qt-ui/simplewidgets.cpp
index bbe7b1b37..692cda1a1 100644
--- a/qt-ui/simplewidgets.cpp
+++ b/qt-ui/simplewidgets.cpp
@@ -134,9 +134,15 @@ void ShiftTimesDialog::buttonClicked(QAbstractButton* button)
amount = ui.timeEdit->time().hour() * 3600 + ui.timeEdit->time().minute() * 60;
if (ui.backwards->isChecked())
amount *= -1;
-
- shift_times(amount);
- mainWindow()->refreshDisplay();
+ if (amount != 0) {
+ // DANGER, DANGER - this could get our dive_table unsorted...
+ shift_times(amount);
+ sort_table(&dive_table);
+ mark_divelist_changed(TRUE);
+ mainWindow()->dive_list()->rememberSelection();
+ mainWindow()->refreshDisplay();
+ mainWindow()->dive_list()->restoreSelection();
+ }
}
}