mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-01 00:53:24 +00:00
Make gas selection for add dive work
This now offers the correct gases for which we have cylinders defined. For both the planner and add dive we still don't end up with the correct cylinders in the resulting dive. But that's for another commit to fix. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
83a7f1f5b4
commit
3c8155880a
2 changed files with 6 additions and 2 deletions
|
@ -261,6 +261,9 @@ bool MainTab::isEditing()
|
||||||
|
|
||||||
void MainTab::updateDiveInfo(int dive)
|
void MainTab::updateDiveInfo(int dive)
|
||||||
{
|
{
|
||||||
|
// don't execute this while adding a dive
|
||||||
|
if (editMode == ADD)
|
||||||
|
return;
|
||||||
if (!isEnabled() && dive != -1)
|
if (!isEnabled() && dive != -1)
|
||||||
setEnabled(true);
|
setEnabled(true);
|
||||||
if (isEnabled() && dive == -1)
|
if (isEnabled() && dive == -1)
|
||||||
|
|
|
@ -286,8 +286,8 @@ void MainWindow::on_actionAddDive_triggered()
|
||||||
// clear the selection
|
// clear the selection
|
||||||
dive_list()->unselectDives();
|
dive_list()->unselectDives();
|
||||||
disableDcShortcuts();
|
disableDcShortcuts();
|
||||||
DivePlannerPointsModel::instance()->clear();
|
|
||||||
DivePlannerPointsModel::instance()->setPlanMode(DivePlannerPointsModel::ADD);
|
DivePlannerPointsModel::instance()->setPlanMode(DivePlannerPointsModel::ADD);
|
||||||
|
|
||||||
// now cheat - create one dive that we use to store the info tab data in
|
// now cheat - create one dive that we use to store the info tab data in
|
||||||
struct dive *dive = alloc_dive();
|
struct dive *dive = alloc_dive();
|
||||||
dive->when = QDateTime::currentMSecsSinceEpoch() / 1000L + gettimezoneoffset();
|
dive->when = QDateTime::currentMSecsSinceEpoch() / 1000L + gettimezoneoffset();
|
||||||
|
@ -297,11 +297,12 @@ void MainWindow::on_actionAddDive_triggered()
|
||||||
// accepting the dive
|
// accepting the dive
|
||||||
select_dive(get_divenr(dive));
|
select_dive(get_divenr(dive));
|
||||||
ui.InfoWidget->updateDiveInfo(selected_dive);
|
ui.InfoWidget->updateDiveInfo(selected_dive);
|
||||||
|
ui.InfoWidget->addDiveStarted();
|
||||||
ui.stackedWidget->setCurrentIndex(PLANNERPROFILE); // Planner.
|
ui.stackedWidget->setCurrentIndex(PLANNERPROFILE); // Planner.
|
||||||
ui.infoPane->setCurrentIndex(MAINTAB);
|
ui.infoPane->setCurrentIndex(MAINTAB);
|
||||||
|
DivePlannerPointsModel::instance()->clear();
|
||||||
DivePlannerPointsModel::instance()->createSimpleDive();
|
DivePlannerPointsModel::instance()->createSimpleDive();
|
||||||
refreshDisplay();
|
refreshDisplay();
|
||||||
ui.InfoWidget->addDiveStarted();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::on_actionRenumber_triggered()
|
void MainWindow::on_actionRenumber_triggered()
|
||||||
|
|
Loading…
Add table
Reference in a new issue