mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Dive site rewrite: make trip location edit work
Don't erase the trip information after the user started editing it. Don't act as if a dive was edited - it's trip information we are modifying. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
89599b81ac
commit
0afe07d021
1 changed files with 3 additions and 2 deletions
|
@ -371,7 +371,6 @@ void MainTab::enableEdition(EditMode newEditMode)
|
||||||
if (isTripEdit) {
|
if (isTripEdit) {
|
||||||
// we are editing trip location and notes
|
// we are editing trip location and notes
|
||||||
displayMessage(tr("This trip is being edited."));
|
displayMessage(tr("This trip is being edited."));
|
||||||
memset(&displayedTrip, 0, sizeof(displayedTrip));
|
|
||||||
currentTrip = current_dive->divetrip;
|
currentTrip = current_dive->divetrip;
|
||||||
ui.dateEdit->setEnabled(false);
|
ui.dateEdit->setEnabled(false);
|
||||||
editMode = TRIP;
|
editMode = TRIP;
|
||||||
|
@ -933,7 +932,7 @@ void MainTab::acceptChanges()
|
||||||
fixup_dive(d);
|
fixup_dive(d);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (current_dive->divetrip) {
|
if (!editMode == TRIP && current_dive->divetrip) {
|
||||||
current_dive->divetrip->when = current_dive->when;
|
current_dive->divetrip->when = current_dive->when;
|
||||||
find_new_trip_start_time(current_dive->divetrip);
|
find_new_trip_start_time(current_dive->divetrip);
|
||||||
}
|
}
|
||||||
|
@ -1320,6 +1319,8 @@ void MainTab::on_location_editingFinished()
|
||||||
if (currentTrip) {
|
if (currentTrip) {
|
||||||
free(displayedTrip.location);
|
free(displayedTrip.location);
|
||||||
displayedTrip.location = strdup(qPrintable(ui.location->text()));
|
displayedTrip.location = strdup(qPrintable(ui.location->text()));
|
||||||
|
markChangedWidget(ui.location);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString currText = ui.location->text();
|
QString currText = ui.location->text();
|
||||||
|
|
Loading…
Add table
Reference in a new issue