mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-30 22:20:21 +00:00
desktop UI: only show salinity warning when DC salinity is different
There were two cases that were handled incorrectly: - if the user hasn't entered a salinity, obviously there shouldn't be a warning - if this is a manually entered dive, there is no salinity downloaded from a dive computer, so equally, no warning Suggested-by: willemferguson <willemferguson@zoology.up.ac.za> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
c03731b220
commit
254f42e396
1 changed files with 3 additions and 2 deletions
|
@ -200,7 +200,7 @@ void TabDiveInformation::checkDcSalinityOverWritten()
|
|||
int dc_value = current_dc->salinity;
|
||||
int user_value = current_dive->user_salinity;
|
||||
bool show_indicator = false;
|
||||
if (user_value != dc_value)
|
||||
if (!manualDive && user_value != 0 && user_value != dc_value)
|
||||
show_indicator = true;
|
||||
ui->salinityOverWrittenIcon->setVisible(show_indicator);
|
||||
}
|
||||
|
@ -301,7 +301,8 @@ void TabDiveInformation::on_waterTypeCombo_activated(int index) {
|
|||
else
|
||||
ui->salinityText->clear();
|
||||
divesEdited(Command::editWaterTypeUser(combobox_salinity, false));
|
||||
if (dc_salinity == combobox_salinity) // If salinity differs from that of dc, then save it
|
||||
// If salinity differs from that downloaded from dc, show warning
|
||||
if (manualDive || dc_salinity == combobox_salinity)
|
||||
ui->salinityOverWrittenIcon->setVisible(false);
|
||||
else
|
||||
ui->salinityOverWrittenIcon->setVisible(true);
|
||||
|
|
Loading…
Reference in a new issue