class: FileOperation
changed: #fileExistsDialogForNewFile:oldFile:withCancel:withRemoveIfSame:withAllAction:
--- a/FileOperation.st Fri Feb 27 16:34:42 2015 +0100
+++ b/FileOperation.st Fri Feb 27 19:55:33 2015 +0100
@@ -1,3 +1,5 @@
+"{ Encoding: utf8 }"
+
"
COPYRIGHT (c) 2003 by eXept Software AG
All Rights Reserved
@@ -233,20 +235,22 @@
"
|msg oldSize newSize sameContents resources sourceType destType labels values default olderOrNewer
- forAllHolder answer|
+ forAllHolder answer oldFileIsDirectory newFileIsDirectory|
newFile exists ifFalse:[ ^ true ].
oldSize := oldFile fileSize.
newSize := newFile fileSize.
sameContents := false.
+ oldFileIsDirectory := oldFile isDirectory.
+ newFileIsDirectory := newFile isDirectory.
- newFile isDirectory ifTrue:[
- oldFile isDirectory ifTrue:[
+ newFileIsDirectory ifTrue:[
+ oldFileIsDirectory ifTrue:[
"/ could (should?) recursively look for same contents here...
].
] ifFalse:[
- oldFile isDirectory ifFalse:[
+ oldFileIsDirectory ifFalse:[
sameContents := oldSize = newSize and:[oldFile sameContentsAs:newFile].
]
].
@@ -254,13 +258,13 @@
resources := AbstractFileBrowser classResources.
"/ for now:
- oldFile isDirectory ~~ newFile isDirectory ifTrue:[
+ oldFileIsDirectory ~~ newFileIsDirectory ifTrue:[
Dialog warn:(resources string:'Will not overwrite directory with file and vice versa.').
^ false.
].
- sourceType := newFile isDirectory ifTrue:'directory' ifFalse:'file'.
- destType := oldFile isDirectory ifTrue:'directory' ifFalse:'file'.
+ sourceType := newFileIsDirectory ifTrue:'directory' ifFalse:'file'.
+ destType := oldFileIsDirectory ifTrue:'directory' ifFalse:'file'.
sameContents ifTrue:[
msg := 'Overwrite existing destination %7:\\ %1\ size: %3 of %2\\with %8 source (same contents):\\ %4\ size: %6 of %5'.
@@ -302,11 +306,8 @@
].
forAllHolder := false asValue.
- Dialog aboutToOpenBoxNotificationSignal handle:[:ex |
- |box|
-
+ Dialog modifyingBoxWith:[:box |
withAllAction ifTrue:[
- box := ex box.
box addVerticalSpace:10.
box verticalPanel
add:(CheckBox
@@ -1632,10 +1633,10 @@
!FileOperation class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libtool/FileOperation.st,v 1.97 2015-01-21 10:32:33 stefan Exp $'
+ ^ '$Header: /cvs/stx/stx/libtool/FileOperation.st,v 1.98 2015-02-27 18:55:33 cg Exp $'
!
version_CVS
- ^ '$Header: /cvs/stx/stx/libtool/FileOperation.st,v 1.97 2015-01-21 10:32:33 stefan Exp $'
+ ^ '$Header: /cvs/stx/stx/libtool/FileOperation.st,v 1.98 2015-02-27 18:55:33 cg Exp $'
! !