Enable editing a dive that was manually entered.

This patch enables editing a dive that was manually entered,
it doesn't cover dive plans yet because on the plan I need to
figure out what are the 'user-entered' points, and what are
the algorithm point. and I feel lazy. =p

One last thing that's missing is to revert the dive to the
previous condition if the user cancels the edition, currently
canceling and applying ok is the same thing.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
This commit is contained in:
Tomaz Canabrava 2013-11-01 11:48:34 -04:00
parent d9afcdc8cb
commit f7cd3e780c
6 changed files with 51 additions and 6 deletions

View file

@ -819,3 +819,23 @@ void MainWindow::on_actionImportCSV_triggered()
process_dives(TRUE, FALSE);
refreshDisplay();
}
void MainWindow::editCurrentDive()
{
struct dive *d = current_dive;
QString defaultDC(d->dc.model);
if (defaultDC == tr("manually added dive")){
disableDcShortcuts();
DivePlannerPointsModel::instance()->setPlanMode(false);
ui.stackedWidget->setCurrentIndex(PLANNERPROFILE); // Planner.
ui.infoPane->setCurrentIndex(MAINTAB);
DivePlannerPointsModel::instance()->loadFromDive(d);
ui.InfoWidget->enableEdition(MainTab::MANUALLY_ADDED_DIVE);
}
else if (defaultDC == tr("Simulated Dive")){
}
}