checkin from browser
authorClaus Gittinger <cg@exept.de>
Fri, 04 Apr 1997 12:21:01 +0200
changeset 1112 6808d55dd8d8
parent 1111 5e7eb6e13e59
child 1113 289b0356eebb
checkin from browser
FBrowser.st
FileBrowser.st
--- a/FBrowser.st	Fri Apr 04 10:51:56 1997 +0200
+++ b/FBrowser.st	Fri Apr 04 12:21:01 1997 +0200
@@ -2197,10 +2197,12 @@
 !
 
 initialCommandFor:fileName into:aBox
-    "set a useful initial command for execute box.
-
-     XXX should be changed to take stuff from a config file
-     XXX or from resources."
+    "set a useful initial command for execute box."
+
+    |lcFilename|
+
+    "/ XXX should be changed to take stuff from a config file
+    "/ XXX or from resources.
 
     ((currentDirectory typeOf:fileName) == #regular) ifTrue:[
 
@@ -2209,6 +2211,8 @@
             ^ self
         ].
 
+        lcFilename := fileName asLowercase.
+
         "some heuristics - my personal preferences ...
          (actually this should come from a configfile)"
 
@@ -2216,7 +2220,7 @@
             aBox initialText:'make target' selectFrom:6 to:11.
             ^ self
         ].
-        (fileName endsWith:'.tar.Z') ifTrue:[
+        (lcFilename endsWith:'.tar.z') ifTrue:[
             aBox initialText:'zcat ' , fileName , ' | tar tvf -'.
             ^ self
         ].
@@ -2232,15 +2236,19 @@
             aBox initialText:'zoo -list ' , fileName selectFrom:1 to:9.
             ^ self
         ].
-        (fileName endsWith:'.zip') ifTrue:[
+        (lcFilename endsWith:'.zip') ifTrue:[
             aBox initialText:'unzip -l ' , fileName selectFrom:1 to:8.
             ^ self
         ].
-        (fileName endsWith:'.Z') ifTrue:[
+        (lcFilename endsWith:'.z') ifTrue:[
             aBox initialText:'uncompress ' , fileName selectFrom:1 to:10.
             ^ self
         ].
-        (fileName endsWith:'tar.gz') ifTrue:[
+        (fileName endsWith:'.tar.gz') ifTrue:[
+            aBox initialText:('gunzip <' , fileName , ' | tar tvf -' ).
+            ^ self
+        ].
+        (fileName endsWith:'.tgz') ifTrue:[
             aBox initialText:('gunzip <' , fileName , ' | tar tvf -' ).
             ^ self
         ].
@@ -2248,8 +2256,12 @@
             aBox initialText:('gunzip <' , fileName , ' >' , (fileName copyWithoutLast:3 "copyTo:(fileName size - 3)")).
             ^ self
         ].
-        (fileName endsWith:'.html') ifTrue:[
-            aBox initialText:'chimera ' , fileName .
+        (lcFilename endsWith:'.html') ifTrue:[
+            aBox initialText:'netscape ' , fileName .
+            ^ self
+        ].
+        (lcFilename endsWith:'.htm') ifTrue:[
+            aBox initialText:'netscape ' , fileName .
             ^ self
         ].
         (fileName endsWith:'.uue') ifTrue:[
@@ -2272,7 +2284,7 @@
             aBox initialText:'bitmap ' , fileName selectFrom:1 to:6.
             ^ self
         ].
-        ((fileName endsWith:'.ps') or:[fileName endsWith:'.PS']) ifTrue:[
+        (lcFilename endsWith:'.ps') ifTrue:[
             aBox initialText:'ghostview ' , fileName selectFrom:1 to:9.
             ^ self
         ].
@@ -2283,6 +2295,8 @@
         ].
         aBox initialText:'<cmd> ' , fileName selectFrom:1 to:5
     ]
+
+    "Modified: 4.4.1997 / 12:20:15 / cg"
 !
 
 nonBinaryFileAction:aFilename
@@ -2984,5 +2998,5 @@
 !FileBrowser class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libtool/Attic/FBrowser.st,v 1.128 1997-04-04 08:51:56 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/Attic/FBrowser.st,v 1.129 1997-04-04 10:21:01 cg Exp $'
 ! !
--- a/FileBrowser.st	Fri Apr 04 10:51:56 1997 +0200
+++ b/FileBrowser.st	Fri Apr 04 12:21:01 1997 +0200
@@ -2197,10 +2197,12 @@
 !
 
 initialCommandFor:fileName into:aBox
-    "set a useful initial command for execute box.
-
-     XXX should be changed to take stuff from a config file
-     XXX or from resources."
+    "set a useful initial command for execute box."
+
+    |lcFilename|
+
+    "/ XXX should be changed to take stuff from a config file
+    "/ XXX or from resources.
 
     ((currentDirectory typeOf:fileName) == #regular) ifTrue:[
 
@@ -2209,6 +2211,8 @@
             ^ self
         ].
 
+        lcFilename := fileName asLowercase.
+
         "some heuristics - my personal preferences ...
          (actually this should come from a configfile)"
 
@@ -2216,7 +2220,7 @@
             aBox initialText:'make target' selectFrom:6 to:11.
             ^ self
         ].
-        (fileName endsWith:'.tar.Z') ifTrue:[
+        (lcFilename endsWith:'.tar.z') ifTrue:[
             aBox initialText:'zcat ' , fileName , ' | tar tvf -'.
             ^ self
         ].
@@ -2232,15 +2236,19 @@
             aBox initialText:'zoo -list ' , fileName selectFrom:1 to:9.
             ^ self
         ].
-        (fileName endsWith:'.zip') ifTrue:[
+        (lcFilename endsWith:'.zip') ifTrue:[
             aBox initialText:'unzip -l ' , fileName selectFrom:1 to:8.
             ^ self
         ].
-        (fileName endsWith:'.Z') ifTrue:[
+        (lcFilename endsWith:'.z') ifTrue:[
             aBox initialText:'uncompress ' , fileName selectFrom:1 to:10.
             ^ self
         ].
-        (fileName endsWith:'tar.gz') ifTrue:[
+        (fileName endsWith:'.tar.gz') ifTrue:[
+            aBox initialText:('gunzip <' , fileName , ' | tar tvf -' ).
+            ^ self
+        ].
+        (fileName endsWith:'.tgz') ifTrue:[
             aBox initialText:('gunzip <' , fileName , ' | tar tvf -' ).
             ^ self
         ].
@@ -2248,8 +2256,12 @@
             aBox initialText:('gunzip <' , fileName , ' >' , (fileName copyWithoutLast:3 "copyTo:(fileName size - 3)")).
             ^ self
         ].
-        (fileName endsWith:'.html') ifTrue:[
-            aBox initialText:'chimera ' , fileName .
+        (lcFilename endsWith:'.html') ifTrue:[
+            aBox initialText:'netscape ' , fileName .
+            ^ self
+        ].
+        (lcFilename endsWith:'.htm') ifTrue:[
+            aBox initialText:'netscape ' , fileName .
             ^ self
         ].
         (fileName endsWith:'.uue') ifTrue:[
@@ -2272,7 +2284,7 @@
             aBox initialText:'bitmap ' , fileName selectFrom:1 to:6.
             ^ self
         ].
-        ((fileName endsWith:'.ps') or:[fileName endsWith:'.PS']) ifTrue:[
+        (lcFilename endsWith:'.ps') ifTrue:[
             aBox initialText:'ghostview ' , fileName selectFrom:1 to:9.
             ^ self
         ].
@@ -2283,6 +2295,8 @@
         ].
         aBox initialText:'<cmd> ' , fileName selectFrom:1 to:5
     ]
+
+    "Modified: 4.4.1997 / 12:20:15 / cg"
 !
 
 nonBinaryFileAction:aFilename
@@ -2984,5 +2998,5 @@
 !FileBrowser class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libtool/FileBrowser.st,v 1.128 1997-04-04 08:51:56 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/FileBrowser.st,v 1.129 1997-04-04 10:21:01 cg Exp $'
 ! !