Changed code to properly abort a shutdown process without destroying session relevant state (see issue456). eric7

Sun, 27 Nov 2022 15:58:44 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sun, 27 Nov 2022 15:58:44 +0100
branch
eric7
changeset 9540
6bc76f2c80aa
parent 9539
67a811025fa7
child 9541
69167c94995f

Changed code to properly abort a shutdown process without destroying session relevant state (see issue456).

src/eric7/UI/UserInterface.py file | annotate | diff | comparison | revisions
src/eric7/ViewManager/ViewManager.py file | annotate | diff | comparison | revisions
--- a/src/eric7/UI/UserInterface.py	Sat Nov 26 19:49:14 2022 +0100
+++ b/src/eric7/UI/UserInterface.py	Sun Nov 27 15:58:44 2022 +0100
@@ -8088,10 +8088,14 @@
         Private method to perform all necessary steps to close down the IDE.
 
         @return flag indicating success
+        @rtype bool
         """
         if self.shutdownCalled:
             return True
 
+        if not self.viewmanager.checkAllDirty():
+            return False
+
         if self.__webBrowserProcess is not None:
             self.__webBrowserShutdown()
 
--- a/src/eric7/ViewManager/ViewManager.py	Sat Nov 26 19:49:14 2022 +0100
+++ b/src/eric7/ViewManager/ViewManager.py	Sun Nov 27 15:58:44 2022 +0100
@@ -7356,18 +7356,19 @@
 
         If it cannot close all editor windows, it aborts the shutdown process.
 
-        @return flag indicating success (boolean)
+        @return flag indicating success
+        @rtype bool
         """
         with contextlib.suppress(TypeError):
             ericApp().focusChanged.disconnect(self.appFocusChanged)
 
-        self.closeAllWindows()
+        self.closeAllWindows(ignoreDirty=True)
         self.currentEditor = None
 
-        # save the list of recently opened projects
+        # save the list of recently opened files
         self.__saveRecent()
 
-        # save the list of recently opened projects
+        # save the list of bookmarked files
         Preferences.getSettings().setValue("Bookmarked/Sources", self.bookmarked)
 
         res = len(self.editors) == 0

eric ide

mercurial