#UI_ENHANCEMENT by cg
authorClaus Gittinger <cg@exept.de>
Fri, 15 Jun 2018 00:39:39 +0200
changeset 18213 c0d117c0473d
parent 18212 b709e276e731
child 18214 e7e8fd9c292f
#UI_ENHANCEMENT by cg class: FileOperation::Delete changed: #deleteFile: added "cancel all" option to break out of a multi-delete.
FileOperation.st
--- a/FileOperation.st	Thu Jun 14 16:39:20 2018 +0200
+++ b/FileOperation.st	Fri Jun 15 00:39:39 2018 +0200
@@ -1161,30 +1161,37 @@
     | file isDirectory |
 
     aFileOrDirectory notNil ifTrue:[
-	file := aFileOrDirectory asFilename.
+        file := aFileOrDirectory asFilename.
 
-	isDirectory := file isDirectory.
+        isDirectory := file isDirectory.
 
-	Error handle:[:ex|
-	    "was not able to remove it"
-	    Dialog warn:(ex description).
-	    self errorString:(ex description).
-	    result := false.
-	    ^ self.
-	] do:[
-	    isDirectory ifTrue:[
-		file recursiveRemove
-	    ] ifFalse:[
-		self eraseFilesContentsBeforeRemoving:file.
-		file remove
-	    ].
-	].
-	"/ flush parent directory or directory
+        Error handle:[:ex|
+            "was not able to remove it"
+            AbortAllOperationRequest isHandled ifTrue:[
+                (Dialog confirm:(ex description) yesLabel:'OK' noLabel:'Cancel All') ifFalse:[
+                    AbortAllOperationRequest raise
+                ].    
+            ] ifFalse:[    
+                Dialog warn:(ex description).
+            ].
+            self errorString:(ex description).
+            result := false.
+            ^ self.
+        ] do:[
+            isDirectory ifTrue:[
+                file recursiveRemove
+            ] ifFalse:[
+                self eraseFilesContentsBeforeRemoving:file.
+                file remove
+            ].
+        ].
+        "/ flush parent directory or directory
     ].
     DirectoryContents flushCachedDirectoryFor:(file directory).
     result := true.
 
     "Modified: / 17-03-2004 / 12:42:02 / cg"
+    "Modified: / 15-06-2018 / 00:38:25 / Claus Gittinger"
 !
 
 deleteFiles:colOfFiles confirm:confirm