desktop: prevent exit only in plan but not in edit mode

Currently, when the profile is in edit mode, the user can't
save, exit, plan a new dive and is requested to save the
current dive. However, this makes no sense anymore, since
the profile always switches to edit mode when showing a
manually added dive.

If the user has any unsaved profile changes, the usual
dirty checks of the undo-system apply.

Only show above behavior when in the planner. There it is
useful because, these are not included in the undo system.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2022-03-12 12:48:12 +01:00
parent b1384b286f
commit fd35fbb349
2 changed files with 10 additions and 6 deletions

View file

@ -70,7 +70,6 @@ public:
void importFiles(const QStringList importFiles);
void setToolButtonsEnabled(bool enabled);
void setApplicationState(ApplicationState state);
bool inPlanner();
NotificationWidget *getNotificationWidget();
void enableDisableCloudActions();
void enableDisableOtherDCsActions();
@ -194,6 +193,7 @@ private:
UpdateManager *updateManager;
std::unique_ptr<LocationInformationWidget> diveSiteEdit;
bool inPlanner();
bool plannerStateClean();
void setupSocialNetworkMenu();
QDialog *findMovedImagesDialog;