# HG changeset patch # User Stefan Vogel # Date 1046630361 -3600 # Node ID 46517dedc5034fd60064bf8a143a60fb430933fd # Parent 08b2b63e31076bda74481efb42ab3b7ccabb13b3 Handle openErrorSignal in preparition for change openErrorSignal to be a real exception (this is currently a Notification) diff -r 08b2b63e3107 -r 46517dedc503 FileOperation.st --- a/FileOperation.st Sun Mar 02 19:36:14 2003 +0100 +++ b/FileOperation.st Sun Mar 02 19:39:21 2003 +0100 @@ -196,7 +196,7 @@ !FileOperation::Copy class methodsFor:'documentation'! version - ^ '$Header: /cvs/stx/stx/libtool/FileOperation.st,v 1.24 2003-02-27 17:14:48 penk Exp $' + ^ '$Header: /cvs/stx/stx/libtool/FileOperation.st,v 1.25 2003-03-02 18:39:21 stefan Exp $' ! ! !FileOperation::Copy methodsFor:'accessing'! @@ -400,7 +400,7 @@ !FileOperation::Create class methodsFor:'documentation'! version - ^ '$Header: /cvs/stx/stx/libtool/FileOperation.st,v 1.24 2003-02-27 17:14:48 penk Exp $' + ^ '$Header: /cvs/stx/stx/libtool/FileOperation.st,v 1.25 2003-03-02 18:39:21 stefan Exp $' ! ! !FileOperation::Create methodsFor:'accessing'! @@ -522,17 +522,10 @@ ] do:[ aStream := newFile newReadWriteStream. ]. - aStream notNil ifTrue:[ - aStream close. - self createdFile:newFile. - LastCreatedFile := newFile. - self result:true. - ] ifFalse:[ - msg := ('Cannot create file '', newName, '' !!') , '(' , (FileStream lastErrorString) , ')'. - errorString := msg. - self result:false. - ^ Dialog warn:errorString - ]. + aStream close. + self createdFile:newFile. + LastCreatedFile := newFile. + self result:true. ]. ! @@ -653,7 +646,7 @@ !FileOperation::Delete class methodsFor:'documentation'! version - ^ '$Header: /cvs/stx/stx/libtool/FileOperation.st,v 1.24 2003-02-27 17:14:48 penk Exp $' + ^ '$Header: /cvs/stx/stx/libtool/FileOperation.st,v 1.25 2003-03-02 18:39:21 stefan Exp $' ! ! !FileOperation::Delete methodsFor:'actions'! @@ -689,7 +682,7 @@ deleteFiles:colOfFiles "delete current selected files/directories " - |resources retVal ask size labels values contents | + |resources retVal ask size labels values| resources := AbstractFileBrowser classResources. @@ -727,20 +720,17 @@ ]. retVal == #yes ifTrue:[ doDelete := true. - filename isDirectory ifTrue:[ - contents := filename directoryContents. - contents isNilOrEmptyCollection ifFalse:[ - answer := Dialog - confirmWithCancel:(('Directory ''%1'' is not empty', Character cr asString, 'remove anyway ?') - bindWith:filename pathName allBold) - labels:( #('Cancel' 'Keep' 'Remove') ) - values:#(nil false true) - default:2. - answer == nil ifTrue:[ - ^ self - ]. - doDelete := answer - ] + filename isNonEmptyDirectory ifTrue:[ + answer := Dialog + confirmWithCancel:(('Directory ''%1'' is not empty', Character cr asString, 'remove anyway ?') + bindWith:filename pathName allBold) + labels:( #('Cancel' 'Keep' 'Remove') ) + values:#(nil false true) + default:2. + answer == nil ifTrue:[ + ^ self + ]. + doDelete := answer ]. doDelete ifTrue:[ self deleteFile:filename. @@ -820,7 +810,7 @@ !FileOperation::Move class methodsFor:'documentation'! version - ^ '$Header: /cvs/stx/stx/libtool/FileOperation.st,v 1.24 2003-02-27 17:14:48 penk Exp $' + ^ '$Header: /cvs/stx/stx/libtool/FileOperation.st,v 1.25 2003-03-02 18:39:21 stefan Exp $' ! ! !FileOperation::Move methodsFor:'accessing'! @@ -990,7 +980,7 @@ !FileOperation::Rename class methodsFor:'documentation'! version - ^ '$Header: /cvs/stx/stx/libtool/FileOperation.st,v 1.24 2003-02-27 17:14:48 penk Exp $' + ^ '$Header: /cvs/stx/stx/libtool/FileOperation.st,v 1.25 2003-03-02 18:39:21 stefan Exp $' ! ! !FileOperation::Rename methodsFor:'accessing'! @@ -1077,5 +1067,5 @@ !FileOperation class methodsFor:'documentation'! version - ^ '$Header: /cvs/stx/stx/libtool/FileOperation.st,v 1.24 2003-02-27 17:14:48 penk Exp $' + ^ '$Header: /cvs/stx/stx/libtool/FileOperation.st,v 1.25 2003-03-02 18:39:21 stefan Exp $' ! !