aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2017-02-04 13:44:10 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2017-03-04 12:16:49 -0800
commitba570c9eea3645583b4b60806ce0c3f49c4dc65a (patch)
tree7987eac3bc761c600dd2bf06d5d3cadcf7761304
parent05b53d6204a638147727441a904f0661127142f2 (diff)
downloadsubsurface-ba570c9eea3645583b4b60806ce0c3f49c4dc65a.tar.gz
For manually added dives, show depth and duration
So far this is purely informational, you can't edit this. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r--desktop-widgets/maintab.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/desktop-widgets/maintab.cpp b/desktop-widgets/maintab.cpp
index 8b0b48363..8b24710a0 100644
--- a/desktop-widgets/maintab.cpp
+++ b/desktop-widgets/maintab.cpp
@@ -539,6 +539,10 @@ void MainTab::updateDiveInfo(bool clear)
ui.notes->setText(currentTrip->notes);
clearEquipment();
ui.equipmentTab->setEnabled(false);
+ ui.depth->setVisible(false);
+ ui.depthLabel->setVisible(false);
+ ui.duration->setVisible(false);
+ ui.durationLabel->setVisible(false);
} else {
setTabText(0, tr("Notes"));
currentTrip = NULL;
@@ -579,7 +583,14 @@ void MainTab::updateDiveInfo(bool clear)
extraDataModel->updateDive();
taglist_get_tagstring(displayed_dive.tag_list, buf, 1024);
ui.tagWidget->setText(QString(buf));
+ bool isManual = !current_dive || same_string(current_dive->dc.model, "manually added dive");
+ ui.depth->setVisible(isManual);
+ ui.depthLabel->setVisible(isManual);
+ ui.duration->setVisible(isManual);
+ ui.durationLabel->setVisible(isManual);
}
+ ui.duration->setText(QDateTime::fromTime_t(displayed_dive.duration.seconds).toUTC().toString("h:mm"));
+ ui.depth->setText(get_depth_string(displayed_dive.maxdepth, true));
ui.maximumDepthText->setText(get_depth_string(displayed_dive.maxdepth, true));
ui.averageDepthText->setText(get_depth_string(displayed_dive.meandepth, true));
ui.maxcnsText->setText(QString("%1\%").arg(displayed_dive.maxcns));