FileBrowser.st
changeset 3414 25cdf64dab21
parent 3413 0ccd467922b8
child 3417 1fee40dd5af4
--- a/FileBrowser.st	Thu Nov 15 17:16:03 2001 +0100
+++ b/FileBrowser.st	Thu Nov 15 17:19:14 2001 +0100
@@ -6558,16 +6558,18 @@
     "Modified: 19.6.1996 / 09:40:19 / cg"
 !
 
-showFile:fileName insert:insert encoding:encoding doubleClick:viaDoubleClick
+showFile:fileNameString insert:insert encoding:encoding doubleClick:viaDoubleClick
     "show/insert contents of fileName in subView"
 
     |path buffer s n i ok convert text msg eol guess action enc 
-     fontsEncoding pref failWarning f answer|
-
-    fileName asFilename isAbsolute ifFalse:[
-        path := currentDirectory filenameFor:fileName.
+     fontsEncoding pref failWarning f answer fileName|
+
+    fileName := fileNameString asFilename.
+
+    fileName isAbsolute ifFalse:[
+        path := currentDirectory filenameFor:fileNameString.
     ] ifTrue:[
-        path := fileName asFilename asAbsoluteFilename
+        path := fileName asAbsoluteFilename
     ].
 
     (path type == #regular) ifFalse:[
@@ -6577,7 +6579,7 @@
         ] ifTrue:[
             msg := '''%1'' is not a regular file !!'.
         ].
-        self warn:(resources string:msg with:fileName).
+        self warn:(resources string:msg with:fileNameString).
         ^ self
     ].
 
@@ -6586,7 +6588,7 @@
     "/
     s := path readStream.
     s isNil ifTrue:[
-        self showAlert:(resources string:'cannot read file ''%1'' !!' with:fileName)
+        self showAlert:(resources string:'cannot read file ''%1'' !!' with:fileNameString)
                   with:(FileStream lastErrorString).
         ^ nil
     ].
@@ -6602,14 +6604,14 @@
     guess == #binary ifTrue:[
         ok := false.
         viaDoubleClick ifTrue:[
-            (self binaryFileAction:fileName) ifTrue:[^ self].
+            (self binaryFileAction:fileNameString) ifTrue:[^ self].
         ].
-        answer := self confirmWithCancel:(resources string:'''%1'' seems to be a binary file (or unsupported format) - show anyway ?' with:fileName).
+        answer := self confirmWithCancel:(resources string:'''%1'' seems to be a binary file (or unsupported format) - show anyway ?' with:fileNameString).
         answer == false ifTrue:[^ self].
         answer isNil ifTrue:[AbortSignal raise].
     ] ifFalse:[
         viaDoubleClick ifTrue:[
-            (self nonBinaryFileAction:fileName) ifTrue:[^ self].
+            (self nonBinaryFileAction:fileNameString) ifTrue:[^ self].
         ].
 
         fontsEncoding := subView font encoding ? 'unknown'.
@@ -6628,7 +6630,7 @@
             doNotShowFontDialog == true ifTrue:[
                 action := #show
             ] ifFalse:[
-                action := Dialog choose:(resources string:'''%1'' seems to require a %2 font.' with:fileName with:pref)
+                action := Dialog choose:(resources string:'''%1'' seems to require a %2 font.' with:fileNameString with:pref)
                                labels:(resources array:#('cancel' 'show' 'dont ask again' 'change font'))
                                values:#(nil #show #showAlways #encoding)
                                default:#encoding.
@@ -6663,7 +6665,7 @@
 "/            "/
 "/            i := buffer indexOf:(Character value:13).
 "/            i ~~ 0 ifTrue:[
-"/                convert := self confirm:(resources string:'''%1'' seems to have CR as line delimiter - convert to NL ?' with:fileName).
+"/                convert := self confirm:(resources string:'''%1'' seems to have CR as line delimiter - convert to NL ?' with:fileNameString).
 "/            ]
 "/        ]
 "/    ].
@@ -6699,12 +6701,12 @@
         ].
         ex proceed.
     ] do:[
-        text := self readFile:fileName lineDelimiter:eol encoding:enc.
+        text := self readFile:fileNameString lineDelimiter:eol encoding:enc.
     ].
 
     insert ifFalse:[
-        (f := fileName asFilename) isAbsolute ifFalse:[
-            f := (currentDirectory construct:fileName)
+        (f := fileName) isAbsolute ifFalse:[
+            f := (currentDirectory construct:fileNameString)
         ].
         self class addToVisitedFileHistory:f pathName.
 
@@ -6715,7 +6717,7 @@
 
     "Created: / 19.6.1996 / 09:39:52 / cg"
     "Modified: / 18.9.1997 / 17:10:20 / stefan"
-    "Modified: / 15.11.2001 / 17:11:57 / cg"
+    "Modified: / 15.11.2001 / 17:15:27 / cg"
 !
 
 writeFile:fileName text:someText encoding:encoding
@@ -7429,5 +7431,5 @@
 !FileBrowser class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libtool/FileBrowser.st,v 1.435 2001-11-15 16:16:03 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/FileBrowser.st,v 1.436 2001-11-15 16:19:14 cg Exp $'
 ! !