mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Don't go to edit mode if the dive notes field didn't change.
The maintab view should be consistent; some fields just go to edit mode whenever they acquire focus and most of them wait till their values are changed. Change the dive notes field to be consistent with the other fields and only enter edit mode if its value is changed. [Dirk Hohndel: changed to use same_string()] Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
129b54093b
commit
f16f4e2f6e
1 changed files with 4 additions and 0 deletions
|
@ -1159,9 +1159,13 @@ void MainTab::on_notes_textChanged()
|
|||
if (editMode == IGNORE || acceptingEdit == true)
|
||||
return;
|
||||
if (currentTrip) {
|
||||
if (same_string(displayedTrip.notes, ui.notes->toPlainText().toUtf8().data()))
|
||||
return;
|
||||
free(displayedTrip.notes);
|
||||
displayedTrip.notes = strdup(ui.notes->toPlainText().toUtf8().data());
|
||||
} else {
|
||||
if (same_string(displayed_dive.notes, ui.notes->toPlainText().toUtf8().data()))
|
||||
return;
|
||||
free(displayed_dive.notes);
|
||||
if (ui.notes->toHtml().indexOf("<table") != -1)
|
||||
displayed_dive.notes = strdup(ui.notes->toHtml().toUtf8().data());
|
||||
|
|
Loading…
Add table
Reference in a new issue