selection: pass down selection to tab widgets

On selection change, pass down selection (including current
dive and dc) to the tab widgets. Ultimately, this should
remove access to global variables. A number of new accesses
are marked as TODO. They shall be removed in due course.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2022-09-04 11:04:01 +02:00 committed by bstoeger
parent 908da77863
commit cded7ef5fe
16 changed files with 62 additions and 55 deletions

View file

@ -333,7 +333,7 @@ void MainWindow::updateAutogroup()
void MainWindow::divesSelected(const std::vector<dive *> &selection, dive *currentDive, int currentDC)
{
mainTab->updateDiveInfo();
mainTab->updateDiveInfo(selection, currentDive, currentDC);
if (currentDive)
enableDisableOtherDCsActions();
profile->plotCurrentDive();
@ -827,7 +827,8 @@ void MainWindow::on_actionPreviousDC_triggered()
unsigned nrdc = number_of_computers(current_dive);
dc_number = (dc_number + nrdc - 1) % nrdc;
profile->plotCurrentDive();
mainTab->updateDiveInfo();
// TODO: remove
mainTab->updateDiveInfo(getDiveSelection(), current_dive, dc_number);
}
void MainWindow::on_actionNextDC_triggered()
@ -835,7 +836,8 @@ void MainWindow::on_actionNextDC_triggered()
unsigned nrdc = number_of_computers(current_dive);
dc_number = (dc_number + 1) % nrdc;
profile->plotCurrentDive();
mainTab->updateDiveInfo();
// TODO: remove
mainTab->updateDiveInfo(getDiveSelection(), current_dive, dc_number);
}
void MainWindow::on_actionFullScreen_triggered(bool checked)