mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
cleanup: remove parameter to MainTab::enableEdition
All remaining callers were passing MANUALLY_ADDED_DIVE as a new mode, so we may just as well remove the parameter and thus simplify the logic. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
accf1fcc8f
commit
13d339451e
3 changed files with 6 additions and 6 deletions
|
@ -1767,13 +1767,13 @@ void MainWindow::editCurrentDive()
|
||||||
graphics->setAddState();
|
graphics->setAddState();
|
||||||
setApplicationState(ApplicationState::EditDive);
|
setApplicationState(ApplicationState::EditDive);
|
||||||
DivePlannerPointsModel::instance()->loadFromDive(d);
|
DivePlannerPointsModel::instance()->loadFromDive(d);
|
||||||
mainTab->enableEdition(MainTab::MANUALLY_ADDED_DIVE);
|
mainTab->enableEdition();
|
||||||
} else if (defaultDC == "planned dive") {
|
} else if (defaultDC == "planned dive") {
|
||||||
disableShortcuts();
|
disableShortcuts();
|
||||||
DivePlannerPointsModel::instance()->setPlanMode(DivePlannerPointsModel::PLAN);
|
DivePlannerPointsModel::instance()->setPlanMode(DivePlannerPointsModel::PLAN);
|
||||||
setApplicationState(ApplicationState::EditPlannedDive);
|
setApplicationState(ApplicationState::EditPlannedDive);
|
||||||
DivePlannerPointsModel::instance()->loadFromDive(d);
|
DivePlannerPointsModel::instance()->loadFromDive(d);
|
||||||
mainTab->enableEdition(MainTab::MANUALLY_ADDED_DIVE);
|
mainTab->enableEdition();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -206,9 +206,9 @@ void MainTab::displayMessage(QString str)
|
||||||
ui.diveNotesMessage->animatedShow();
|
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;
|
return;
|
||||||
|
|
||||||
ui.editDiveSiteButton->setEnabled(false);
|
ui.editDiveSiteButton->setEnabled(false);
|
||||||
|
@ -218,7 +218,7 @@ void MainTab::enableEdition(EditMode newEditMode)
|
||||||
ui.dateEdit->setEnabled(true);
|
ui.dateEdit->setEnabled(true);
|
||||||
displayMessage(tr("This dive is being edited."));
|
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.
|
// This function gets called if a field gets updated by an undo command.
|
||||||
|
|
|
@ -72,7 +72,7 @@ slots:
|
||||||
void closeMessage();
|
void closeMessage();
|
||||||
void closeWarning();
|
void closeWarning();
|
||||||
void displayMessage(QString str);
|
void displayMessage(QString str);
|
||||||
void enableEdition(EditMode newEditMode = NONE);
|
void enableEdition();
|
||||||
void escDetected(void);
|
void escDetected(void);
|
||||||
private:
|
private:
|
||||||
Ui::MainTab ui;
|
Ui::MainTab ui;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue