*** empty log message ***
authorClaus Gittinger <cg@exept.de>
Tue, 01 Jun 2004 13:16:09 +0200
changeset 5888 f2758e87cb4f
parent 5887 e60702459af8
child 5889 394c4b0f74cc
*** empty log message ***
AbstractFileBrowser.st
FileOperation.st
--- a/AbstractFileBrowser.st	Thu May 27 16:30:02 2004 +0200
+++ b/AbstractFileBrowser.st	Tue Jun 01 13:16:09 2004 +0200
@@ -1647,27 +1647,27 @@
     <resource: #menu>
 
     ^ 
-     #(#Menu
-        #(
-         #(#MenuItem
-            #enabled: #hasSelection
-            #label: 'Copy Selected Filenames to Clipboard'
-            #itemValue: #copySelectedFilenames
-            #translateLabel: true
+     #(Menu
+        (
+         (MenuItem
+            enabled: hasFileSelection
+            label: 'Copy Selected Filenames to Clipboard'
+            itemValue: copySelectedFilenames
+            translateLabel: true
           )
-         #(#MenuItem
-            #enabled: #fileListIsNotEmpty
-            #label: 'Copy All Filenames to Clipboard'
-            #itemValue: #copyFileList
-            #translateLabel: true
+         (MenuItem
+            enabled: fileListIsNotEmpty
+            label: 'Copy All Filenames to Clipboard'
+            itemValue: copyFileList
+            translateLabel: true
           )
-         #(#MenuItem
-            #label: '-'
+         (MenuItem
+            label: '-'
           )
-         #(#MenuItem
-            #label: 'Settings...'
-            #itemValue: #openSettingsDialog
-            #translateLabel: true
+         (MenuItem
+            label: 'Settings...'
+            itemValue: openSettingsDialog
+            translateLabel: true
           )
          )
         nil
@@ -6085,7 +6085,7 @@
 theSingleSelectedDirectoryOrHomeDir
     |dir|
 
-    dir := self theSingleSelectedDirectoryOrNil
+    dir := self theSingleSelectedDirectoryOrNil.
     dir isNil ifTrue:[ dir := Filename homeDirectory].
     ^ dir.
 !
@@ -6882,5 +6882,5 @@
 !AbstractFileBrowser class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libtool/AbstractFileBrowser.st,v 1.235 2004-05-24 07:53:04 penk Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/AbstractFileBrowser.st,v 1.236 2004-06-01 11:15:49 cg Exp $'
 ! !
--- a/FileOperation.st	Thu May 27 16:30:02 2004 +0200
+++ b/FileOperation.st	Tue Jun 01 13:16:09 2004 +0200
@@ -114,18 +114,37 @@
         #removeSource and #removeDestination.
     "
 
-    |msg oldSize newSize sameContents resources|
+    |msg oldSize newSize sameContents resources sourceType destType|
 
     newFile exists ifFalse:[ ^ true ].
     oldSize := oldFile fileSize.
     newSize := newFile fileSize.
 
-    sameContents := oldSize = newSize and:[oldFile sameContentsAs:newFile].
+    sameContents := false.
+
+    newFile isDirectory ifTrue:[
+        oldFile isDirectory ifTrue:[
+            "/ could (should?) recursively look for same contents here...
+        ].
+    ] ifFalse:[
+        oldFile isDirectory ifFalse:[
+            sameContents := oldSize = newSize and:[oldFile sameContentsAs:newFile].
+        ]
+    ].
+
+    "/ for now:
+    oldFile isDirectory ~~ newFile isDirectory 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'.
 
     sameContents ifTrue:[
-        msg := 'Overwrite existing destination file:\\  %1\    size: %3 of %2\\with source (same contents):\\  %4\    size: %6 of %5'.
+        msg := 'Overwrite existing destination %7:\\  %1\    size: %3 of %2\\with source (same contents):\\  %4\    size: %6 of %5'.
     ] ifFalse:[
-        msg := 'Overwrite existing destination file:\\  %1\    size: %3 of %2\\with source:\\  %4\    size: %6 of %5'.
+        msg := 'Overwrite existing destination %7:\\  %1\    size: %3 of %2\\with source:\\  %4\    size: %6 of %5'.
     ].
 
     resources := AbstractFileBrowser classResources.
@@ -137,7 +156,8 @@
                 with:newSize
                 with:oldFile asString allBold 
                 with:(oldFile modificationTime printStringFormat:'%(Day)-%(mon)-%(year) %h:%m:%s')
-                with:oldSize).
+                with:oldSize
+                with:destType).
 
     (sameContents and:[withRemoveIfSame]) ifTrue:[
         ^ OptionBox  
@@ -224,7 +244,7 @@
 !FileOperation::Copy class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libtool/FileOperation.st,v 1.53 2004-05-18 14:12:36 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/FileOperation.st,v 1.54 2004-06-01 11:16:09 cg Exp $'
 ! !
 
 !FileOperation::Copy methodsFor:'accessing'!
@@ -433,7 +453,7 @@
 !FileOperation::Create class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libtool/FileOperation.st,v 1.53 2004-05-18 14:12:36 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/FileOperation.st,v 1.54 2004-06-01 11:16:09 cg Exp $'
 ! !
 
 !FileOperation::Create methodsFor:'accessing'!
@@ -706,7 +726,7 @@
 !FileOperation::Delete class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libtool/FileOperation.st,v 1.53 2004-05-18 14:12:36 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/FileOperation.st,v 1.54 2004-06-01 11:16:09 cg Exp $'
 ! !
 
 !FileOperation::Delete methodsFor:'actions'!
@@ -911,7 +931,7 @@
 !FileOperation::Move class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libtool/FileOperation.st,v 1.53 2004-05-18 14:12:36 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/FileOperation.st,v 1.54 2004-06-01 11:16:09 cg Exp $'
 ! !
 
 !FileOperation::Move methodsFor:'accessing'!
@@ -1129,7 +1149,7 @@
 !FileOperation::Rename class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libtool/FileOperation.st,v 1.53 2004-05-18 14:12:36 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/FileOperation.st,v 1.54 2004-06-01 11:16:09 cg Exp $'
 ! !
 
 !FileOperation::Rename methodsFor:'accessing'!
@@ -1244,5 +1264,5 @@
 !FileOperation class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libtool/FileOperation.st,v 1.53 2004-05-18 14:12:36 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/FileOperation.st,v 1.54 2004-06-01 11:16:09 cg Exp $'
 ! !