summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--desktop-widgets/mainwindow.cpp4
-rw-r--r--desktop-widgets/tab-widgets/maintab.cpp6
-rw-r--r--desktop-widgets/tab-widgets/maintab.h2
3 files changed, 6 insertions, 6 deletions
diff --git a/desktop-widgets/mainwindow.cpp b/desktop-widgets/mainwindow.cpp
index 7796ddf04..1c122a4fd 100644
--- a/desktop-widgets/mainwindow.cpp
+++ b/desktop-widgets/mainwindow.cpp
@@ -1767,13 +1767,13 @@ void MainWindow::editCurrentDive()
graphics->setAddState();
setApplicationState(ApplicationState::EditDive);
DivePlannerPointsModel::instance()->loadFromDive(d);
- mainTab->enableEdition(MainTab::MANUALLY_ADDED_DIVE);
+ mainTab->enableEdition();
} else if (defaultDC == "planned dive") {
disableShortcuts();
DivePlannerPointsModel::instance()->setPlanMode(DivePlannerPointsModel::PLAN);
setApplicationState(ApplicationState::EditPlannedDive);
DivePlannerPointsModel::instance()->loadFromDive(d);
- mainTab->enableEdition(MainTab::MANUALLY_ADDED_DIVE);
+ mainTab->enableEdition();
}
}
diff --git a/desktop-widgets/tab-widgets/maintab.cpp b/desktop-widgets/tab-widgets/maintab.cpp
index 14db8ae28..eaf19b7db 100644
--- a/desktop-widgets/tab-widgets/maintab.cpp
+++ b/desktop-widgets/tab-widgets/maintab.cpp
@@ -206,9 +206,9 @@ void MainTab::displayMessage(QString str)
ui.diveNotesMessage->animatedShow();
}
-void MainTab::enableEdition(EditMode newEditMode)
+void MainTab::enableEdition()
{
- if (((newEditMode == DIVE || newEditMode == NONE) && current_dive == NULL) || editMode != NONE)
+ if (current_dive == NULL || editMode != NONE)
return;
ui.editDiveSiteButton->setEnabled(false);
@@ -218,7 +218,7 @@ void MainTab::enableEdition(EditMode newEditMode)
ui.dateEdit->setEnabled(true);
displayMessage(tr("This dive is being edited."));
- editMode = newEditMode != NONE ? newEditMode : DIVE;
+ editMode = MANUALLY_ADDED_DIVE;
}
// This function gets called if a field gets updated by an undo command.
diff --git a/desktop-widgets/tab-widgets/maintab.h b/desktop-widgets/tab-widgets/maintab.h
index 6411f6b3a..2524ed2a7 100644
--- a/desktop-widgets/tab-widgets/maintab.h
+++ b/desktop-widgets/tab-widgets/maintab.h
@@ -72,7 +72,7 @@ slots:
void closeMessage();
void closeWarning();
void displayMessage(QString str);
- void enableEdition(EditMode newEditMode = NONE);
+ void enableEdition();
void escDetected(void);
private:
Ui::MainTab ui;