diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2020-05-08 11:43:22 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2020-05-08 08:51:37 -0700 |
commit | ce7cc797054059cb852cb9de9a30cd27af85db72 (patch) | |
tree | 4261fe117cca866a063b3cfc0d8f8373effdf778 | |
parent | ab6cac9799192f1478c150b2ce63906901db2b3b (diff) | |
download | subsurface-ce7cc797054059cb852cb9de9a30cd27af85db72.tar.gz |
desktop: hide/unhide tags if dive site was edited
The tags of the dive site were shown/hidden when changing the
current dive.
Thus the following could happen:
1) User changes to dive with no tags. Tags are hidden.
2) User add image, which creates GPS tag
3) Tag is updated but not shown.
Fix this by showing/hiding tags when they are calculated not
when switching the dive.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
-rw-r--r-- | desktop-widgets/tab-widgets/maintab.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/desktop-widgets/tab-widgets/maintab.cpp b/desktop-widgets/tab-widgets/maintab.cpp index 501afaa0c..9c08ddcbd 100644 --- a/desktop-widgets/tab-widgets/maintab.cpp +++ b/desktop-widgets/tab-widgets/maintab.cpp @@ -331,6 +331,11 @@ void MainTab::updateDiveSite(struct dive *d) ui.locationTags->clear(); ui.editDiveSiteButton->setEnabled(false); } + + if (ui.locationTags->text().isEmpty()) + ui.locationTags->hide(); + else + ui.locationTags->show(); } void MainTab::updateDiveInfo() @@ -444,10 +449,6 @@ void MainTab::updateDiveInfo() ui.duration->setText(render_seconds_to_string(current_dive->duration.seconds)); ui.depth->setText(get_depth_string(current_dive->maxdepth, true)); - if(ui.locationTags->text().isEmpty()) - ui.locationTags->hide(); - else - ui.locationTags->show(); ui.editDiveSiteButton->setEnabled(!ui.location->text().isEmpty()); /* unset the special value text for date and time, just in case someone dove at midnight */ ui.dateEdit->setSpecialValueText(QString()); |