Don't enter edit profile mode when already editing the dive

This is not the ideal solution. Ideally we might want to simply enter the
profile edit mode if we edit a dive that was manually added. But right now
the code contains lots of assumptions about being in one mode or the other
and as we are redoing the profile / planner classes for 4.1 anyway, I'd
rather err on the safe side for 4.0.1

Fixes #374

(well, it fixes the second bug reported in 374 which is quite different
from the original bug)

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2013-12-17 06:45:31 -08:00
parent fe88a2a476
commit 33668ffd35

View file

@ -870,7 +870,7 @@ void MainWindow::on_actionImportCSV_triggered()
void MainWindow::editCurrentDive()
{
if(DivePlannerPointsModel::instance()->currentMode() != DivePlannerPointsModel::NOTHING){
if(information()->isEditing() || DivePlannerPointsModel::instance()->currentMode() != DivePlannerPointsModel::NOTHING){
QMessageBox::warning(this, tr("Warning"), tr("First finish the current edition before trying to do another."));
return;
}