Opened 4 years ago

Closed 4 years ago

#374 closed defect (fixed)

Subsurface does not warn befere closing

Reported by: karent Owned by: tcanabrava
Priority: critical Component: Qt-UI
Version: 4.0 Keywords:
Cc: Plattform (please give specifics in the ticket text): Linux

Description

If dive is being edited, user gets a warning if he/she tries to use File->Quit, but clicking on X or pressing Alt-F4 results in immediate exit, without a prompt to save data first.
I get reports of users loosing unsaved data this way.

Change History (9)

comment:1 Changed 4 years ago by DirkHH

  • Priority changed from major to critical

That's bad.
I must admit that I haven't closed applications with the little X in ages, but I thought we caught that.

Is this on all platforms or are the reports on Windows (Alt-F4 is such a Windows thing...)

comment:2 Changed 4 years ago by karent

Looks like this applies to all platforms. Report came from a Mac user and I also see this on Linux.

comment:3 Changed 4 years ago by DirkHH

You see this on Linux?
That's weird. If I modify the divelist and hit either Alt F4 or the little X I get asked if I want to save my data file...

comment:4 Changed 4 years ago by karent

ok, here's what I do:

  1. open divelog, select dive, click dive notes, start typing
  2. a blue message that dive is being edited appears
  3. save changes
  4. click dive notes, start typing again
  5. Alt-F4
  6. there's a nice warning about unsaved changes

but... skip steps 3 and 4 - and there's no warning on exit

comment:5 Changed 4 years ago by DirkHH

Oh YES. Of course. Because as you haven't saved any changes, yet, Subsurface thinks the divelist is still unchanged.

We need to expand the check for 'is the dive being edited' to one more spot.

Easy enough to do, I think.

Thanks for the great report!

comment:6 Changed 4 years ago by Dirk Hohndel <dirk@…>

  • Resolution set to fixed
  • Status changed from new to closed

In fe88a2a4765c45bcea8387438574f9c1014997b8/subsurface:

Don't quit while dive is edited

If the user edits a dive and then quits we try to ask them to finish
editing, first. If the user did this by either clicking the little 'x'
in the window decoration or by hitting Alt-F4 (or similar), we didn't
have that question (only the 'save changes' question in case the dive list
had already been modified.

Fixes #374

Signed-off-by: Dirk Hohndel <dirk@…>

comment:7 Changed 4 years ago by starosek

  • Resolution fixed deleted
  • Status changed from closed to reopened

Dirk,

This commit makes it impossible to exit Subsurface in some situations. Here is the scenario:

  • start with empty log
  • add new dive and save it
  • start editing this dive by clicking on any text input field
  • click edit (penguin) button on profile
  • click save button on blue ribbon
  • try to exit application by any means...

Entering edit mode should switch profile to an edit mode as well (for manually edited/planned dives). Not sure about multi-edit.

comment:8 Changed 4 years ago by DirkHH

Correct. But a VERY different bug.
We get our edit modes confused.

comment:9 Changed 4 years ago by Dirk Hohndel <dirk@…>

  • Resolution set to fixed
  • Status changed from reopened to closed

In 33668ffd3501f9e80af9e7260bc98970fa5b8900/subsurface:

Don't enter edit profile mode when already editing the dive

This is not the ideal solution. Ideally we might want to simply enter the
profile edit mode if we edit a dive that was manually added. But right now
the code contains lots of assumptions about being in one mode or the other
and as we are redoing the profile / planner classes for 4.1 anyway, I'd
rather err on the safe side for 4.0.1

Fixes #374

(well, it fixes the second bug reported in 374 which is quite different
from the original bug)

Signed-off-by: Dirk Hohndel <dirk@…>

Note: See TracTickets for help on using tickets.