mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
First steps to make add dive work with the correct infrastructure
This just makes sure that we do the right thing with the staging drive, that we don't mess up the selection, the we are smart about using our helper functions, etc. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
94222fbe49
commit
a683a217b9
3 changed files with 20 additions and 11 deletions
|
@ -283,11 +283,7 @@ void MainWindow::on_actionAddDive_triggered()
|
|||
}
|
||||
|
||||
// clear the selection
|
||||
for (int i = 0; i < dive_table.nr; i++) {
|
||||
struct dive *d = get_dive(i);
|
||||
if (d && d->selected)
|
||||
deselect_dive(i);
|
||||
}
|
||||
dive_list()->unselectDives();
|
||||
disableDcShortcuts();
|
||||
DivePlannerPointsModel::instance()->clear();
|
||||
DivePlannerPointsModel::instance()->setPlanMode(DivePlannerPointsModel::ADD);
|
||||
|
@ -296,6 +292,8 @@ void MainWindow::on_actionAddDive_triggered()
|
|||
dive->when = QDateTime::currentMSecsSinceEpoch() / 1000L + gettimezoneoffset();
|
||||
dive->dc.model = "manually added dive"; // don't translate! this is stored in the XML file
|
||||
record_dive(dive);
|
||||
// this isn't in the UI yet, so let's call the C helper function - we'll fix this up when
|
||||
// accepting the dive
|
||||
select_dive(get_divenr(dive));
|
||||
ui.InfoWidget->updateDiveInfo(selected_dive);
|
||||
ui.stackedWidget->setCurrentIndex(PLANNERPROFILE); // Planner.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue