Only warn when trying to replan a logged dive

If there are more than 100 samples, average some of them so we end up with no more than 100.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Robert C. Helling 2015-05-07 22:59:12 +02:00 committed by Dirk Hohndel
parent 69b4a404b9
commit 9d8eb10421
3 changed files with 28 additions and 10 deletions

View file

@ -596,8 +596,9 @@ void MainWindow::on_actionReplanDive_triggered()
if (!plannerStateClean() || !current_dive || !current_dive->dc.model)
return;
else if (strcmp(current_dive->dc.model, "planned dive")) {
QMessageBox::warning(this, tr("Warning"), tr("trying to replan a dive that's not a planned dive."));
return;
if (QMessageBox::warning(this, tr("Warning"), tr("trying to replan a dive that's not a planned dive."),
QMessageBox::Ok | QMessageBox::Cancel) == QMessageBox::Cancel)
return;
}
// put us in PLAN mode
DivePlannerPointsModel::instance()->clear();