summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--qt-ui/maintab.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/qt-ui/maintab.cpp b/qt-ui/maintab.cpp
index 406e09a50..329e5eeeb 100644
--- a/qt-ui/maintab.cpp
+++ b/qt-ui/maintab.cpp
@@ -202,24 +202,25 @@ void MainTab::clearStats()
ui->timeLimits->clear();
}
-#define UPDATE_TEXT(d, field) \
+#define UPDATE_TEXT(d, field) \
if (!d || !d->field) \
ui->field->setText(""); \
- else \
+ else \
ui->field->setText(d->field)
-#define UPDATE_TEMP(d, field) \
- if (!d || d->field.mkelvin == 0) \
+#define UPDATE_TEMP(d, field) \
+ if (!d || d->field.mkelvin == 0) \
ui->field->setText(""); \
- else \
- ui->field->setText(get_temperature_string(d->field, TRUE));
+ else \
+ ui->field->setText(get_temperature_string(d->field, TRUE))
void MainTab::updateDiveInfo(int dive)
{
- if(!isEnabled() && dive != -1)
+ if (!isEnabled() && dive != -1)
setEnabled(true);
-
+ if (isEnabled() && dive == -1)
+ setEnabled(false);
editMode = NONE;
// This method updates ALL tabs whenever a new dive or trip is
// selected.