Commit d60d4dac authored by Emmanuel Promayon's avatar Emmanuel Promayon

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
parent 495201b0
......@@ -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;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment