mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Manual added dives edit button is missing
once the manual added dive is added it can't be edited directly, This can be fixed by adding an edit button to the log menu, this will be consistent with the plan/replan buttons. Fixes #847 Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
e2a0a51b29
commit
4122387208
3 changed files with 28 additions and 0 deletions
|
@ -654,6 +654,27 @@ void MainWindow::on_actionAddDive_triggered()
|
|||
graphics()->plotDive();
|
||||
}
|
||||
|
||||
void MainWindow::on_actionEditDive_triggered()
|
||||
{
|
||||
if (information()->isEditing() || DivePlannerPointsModel::instance()->currentMode() != DivePlannerPointsModel::NOTHING) {
|
||||
QMessageBox::warning(this, tr("Warning"), tr("Please, first finish the current edition before trying to do another."));
|
||||
return;
|
||||
}
|
||||
|
||||
const bool isTripEdit = dive_list()->selectedTrips().count() >= 1;
|
||||
if (!current_dive || isTripEdit || strcmp(current_dive->dc.model, "manually added dive")) {
|
||||
return;
|
||||
}
|
||||
|
||||
DivePlannerPointsModel::instance()->clear();
|
||||
disableShortcuts();
|
||||
DivePlannerPointsModel::instance()->setPlanMode(DivePlannerPointsModel::ADD);
|
||||
graphics()->setAddState();
|
||||
setApplicationState("EditDive");
|
||||
DivePlannerPointsModel::instance()->loadFromDive(current_dive);
|
||||
information()->enableEdition(MainTab::MANUALLY_ADDED_DIVE);
|
||||
}
|
||||
|
||||
void MainWindow::on_actionRenumber_triggered()
|
||||
{
|
||||
RenumberDialog::instance()->renumberOnlySelected(false);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue