mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-30 22:20:21 +00:00
Don't change visibility of depth and duration UI field when no dive
After one selected a dive and then selects NO dive don't touch the visibility of UI fields for depth and duration. So if previously selected dive was a manually added dive, keep them visible. If it was no manually added dive keep them invisible. Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
This commit is contained in:
parent
a95cc2b1c5
commit
006a0ebb39
1 changed files with 7 additions and 5 deletions
|
@ -549,11 +549,13 @@ void MainTab::updateDiveInfo(bool clear)
|
||||||
weightModel->updateDive();
|
weightModel->updateDive();
|
||||||
taglist_get_tagstring(displayed_dive.tag_list, buf, 1024);
|
taglist_get_tagstring(displayed_dive.tag_list, buf, 1024);
|
||||||
ui.tagWidget->setText(QString(buf));
|
ui.tagWidget->setText(QString(buf));
|
||||||
bool isManual = !current_dive || same_string(current_dive->dc.model, "manually added dive");
|
if (current_dive) {
|
||||||
ui.depth->setVisible(isManual);
|
bool isManual = same_string(current_dive->dc.model, "manually added dive");
|
||||||
ui.depthLabel->setVisible(isManual);
|
ui.depth->setVisible(isManual);
|
||||||
ui.duration->setVisible(isManual);
|
ui.depthLabel->setVisible(isManual);
|
||||||
ui.durationLabel->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.duration->setText(QDateTime::fromTime_t(displayed_dive.duration.seconds).toUTC().toString("h:mm"));
|
||||||
ui.depth->setText(get_depth_string(displayed_dive.maxdepth, true));
|
ui.depth->setText(get_depth_string(displayed_dive.maxdepth, true));
|
||||||
|
|
Loading…
Reference in a new issue