#REFACTORING by stefan expeccoALM_1_13
authorStefan Vogel <sv@exept.de>
Thu, 22 Nov 2018 10:08:37 +0100
changeset 18531 d744a31fa413
parent 18530 744f8ccf939d
child 18533 6ff54dd7f909
#REFACTORING by stefan class: AbstractLauncherApplication changed: #exit
AbstractLauncherApplication.st
--- a/AbstractLauncherApplication.st	Wed Nov 21 11:31:34 2018 +0100
+++ b/AbstractLauncherApplication.st	Thu Nov 22 10:08:37 2018 +0100
@@ -1856,38 +1856,43 @@
 
     |fileName saveAndExit box|
 
-    box := EnterBox2 title:(resources string:'Save image before exiting?')
-        okText:(resources string:'Exit')
-        abortText:(resources string:'Cancel')
-        action:[:str | saveAndExit := false].
+    box := EnterBox2 
+                title:(resources string:'Save image before exiting?')
+                okText:(resources string:'Exit')
+                abortText:(resources string:'Cancel')
+                action:[:str | saveAndExit := false].
     box label: (resources string:'Exiting ST/X').
     box initialText: ObjectMemory nameForSnapshot.
-    box okText2:(resources string:'Save & Exit') action2:[:str|fileName := str. saveAndExit := true].
+    box okText2:(resources string:'Save & Exit') 
+        action2:[:str| fileName := str. saveAndExit := true].
     box showAtPointer.
 
-    saveAndExit notNil ifTrue:[
+    saveAndExit isNil ifTrue:[
+        "cancelled"
+        ^ self.
+    ].
+
+    saveAndExit ifTrue:[
         [
-            saveAndExit ifTrue:[
-                self saveImageAs:fileName
-            ].
-            Smalltalk exit.
+            self saveImageAs:fileName
         ] on:SnapshotError do:[:ex|
             "do not exit when snapshot writing fails"
             self warn:ex description.
+            ^ self.
         ]
-    ].
-    
-    saveAndExit ~~ true ifTrue:[
+    ] ifFalse:[
         "/ not saved - see if settings changed
         UserPreferences current isModified ifTrue:[
             (Dialog confirm:(resources string:'Save changed settings before exiting?')) ifTrue:[
                 SettingsDialog saveSettingsAsDefaultSettings 
             ]
-        ]
-    ].
-    
-
-    "Modified: / 23.4.1998 / 18:37:46 / cg"
+        ].
+    ].
+
+    Smalltalk exit.
+
+    "Modified: / 23-04-1998 / 18:37:46 / cg"
+    "Modified: / 22-11-2018 / 10:06:51 / Stefan Vogel"
 !
 
 fileLoadPackage