desktop: disable extradata tab if no site selected

Owing to bit-rot, the extradata tab was not disabled if no dive
is selected. The reason was that there was an additional tab
(dive-computers) that should not be disabled. However that
tab was removed and now the extradata tab was not disabled.

Fix this, but note that there is another of these 'parasitic'
tabs, that should be removed, namely the dive-site tab.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2022-09-18 13:49:29 +02:00
parent 3abb82bfd5
commit 724af75722

View file

@ -107,11 +107,11 @@ void MainTab::updateDiveInfo()
if (DivePlannerPointsModel::instance()->isPlanner())
return;
// If there is no current dive, disable all widgets except the last two,
// which are the dive site tab and the dive computer tabs.
// TODO: Conceptually, these two shouldn't even be a tabs here!
// If there is no current dive, disable all widgets except the last one,
// which is the dive site tab
// TODO: Conceptually, this shouldn't even be a tab here!
bool enabled = current_dive != nullptr;
for (int i = 0; i < extraWidgets.size() - 2; ++i)
for (int i = 0; i < extraWidgets.size() - 1; ++i)
extraWidgets[i]->setEnabled(enabled);
if (current_dive) {