From d60d4dac94a1ac41fb52f76964ce5bb9e41502bf Mon Sep 17 00:00:00 2001 From: Emmanuel Promayon Date: Tue, 31 Dec 2019 10:45:51 +0100 Subject: [PATCH] FIXED bug when quitting app The "Quit" action did not quit the application, it just closed the main window. Some specific action dialogs were therefore not closed (e.g. the volume rendering or rigid mesh transform dialog). Now ensure as well that the modified components are not deleted without asking the user if she/he wants to save them (abort is also possible thanks to the "Close All" action --- sdk/actions/application/QuitAction.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/sdk/actions/application/QuitAction.cpp b/sdk/actions/application/QuitAction.cpp index d1be48f0..e0a0d4f6 100644 --- a/sdk/actions/application/QuitAction.cpp +++ b/sdk/actions/application/QuitAction.cpp @@ -57,7 +57,16 @@ QWidget* QuitAction::getWidget() { // --------------- apply ------------------- Action::ApplyStatus QuitAction::apply() { - Application::getMainWindow()->close(); - return SUCCESS; + // close all components (and therefore ask the user to savet the modified ones) + ApplyStatus closeAllStatus = Application::getAction("Close All")->apply(); + if (closeAllStatus == SUCCESS) { + // Quit the app (will call Application::quitting() and therefore unload all action extensions and delete all actions) + Application::quit(); + return SUCCESS; + } + else { + // or abort the operation + return ABORTED; + } } -- GitLab