FileBrowser.st
changeset 355 55f1bac567eb
parent 346 9ee1f936b7ea
child 380 ec0cfd2b3200
--- a/FileBrowser.st	Thu Feb 08 20:41:41 1996 +0100
+++ b/FileBrowser.st	Fri Feb 09 00:26:59 1996 +0100
@@ -1421,13 +1421,13 @@
      it will make me raise stopSignal when pressed
     "
     killButton 
-	action:[
-	    stream notNil ifTrue:[
-		access critical:[
-		    myProcess interruptWith:[stopSignal raise].
-		]
-	    ]
-	].
+        action:[
+            stream notNil ifTrue:[
+                access critical:[
+                    myProcess interruptWith:[stopSignal raise].
+                ]
+            ]
+        ].
     "
      start it up under its own windowgroup
     "
@@ -1439,63 +1439,63 @@
     self label:(myName , ': executing ' , (command copyTo:(20 min:command size)) , ' ...').
     [
       self withWaitCursorDo:[
-	stopSignal catch:[
-	    startLine := subView cursorLine.
-	    startCol := subView cursorCol.
+        stopSignal catch:[
+            startLine := subView cursorLine.
+            startCol := subView cursorCol.
+
+            "
+             this can be a time consuming operation; therefore lower my priority
+            "
+            myProcess := Processor activeProcess.
+            myPriority := myProcess priority.
+            myProcess priority:(Processor userBackgroundPriority).
 
-	    stream := PipeStream readingFrom:('cd '
-					      , currentDirectory pathName
-					      , '; '
-					      , command
-					      , ' 2>&1' ).
-	    stream notNil ifTrue:[
-		"
-		 this can be a time consuming operation; therefore lower my priority
-		"
-		myProcess := Processor activeProcess.
-		myPriority := myProcess priority.
-		myProcess priority:(Processor userBackgroundPriority).
+            stream := PipeStream readingFrom:('cd '
+                                              , currentDirectory pathName
+                                              , '; '
+                                              , command
+                                              , ' 2>&1' ).
+            stream notNil ifTrue:[
+                [
+                    |codeView lines|
 
-		[
-		    |codeView lines|
-
-		    codeView := subView.
+                    codeView := subView.
 
-		    replace ifTrue:[
-			codeView list:nil.
-			lnr := 1.
-		    ].
+                    replace ifTrue:[
+                        codeView list:nil.
+                        lnr := 1.
+                    ].
 
-		    [stream atEnd] whileFalse:[
-			(stream readWaitWithTimeoutMs:250) ifFalse:[
-			    "
-			     data available
-			    "
-			    lines := OrderedCollection new:50.
-			    line := stream nextLine.
-			    line notNil ifTrue:[lines add:line].
+                    [stream atEnd] whileFalse:[
+                        (stream readWaitWithTimeoutMs:50) ifFalse:[
+                            "
+                             data available
+                            "
+                            lines := OrderedCollection new:50.
+                            line := stream nextLine.
+                            line notNil ifTrue:[lines add:line].
 
-			    [stream atEnd not
-			    and:[stream canReadWithoutBlocking
-			    and:[lines size < 50]]] whileTrue:[
-				line := stream nextLine.
-				line notNil ifTrue:[lines add:line].
-			    ].
+                            [stream atEnd not
+                            and:[stream canReadWithoutBlocking
+                            and:[lines size < 50]]] whileTrue:[
+                                line := stream nextLine.
+                                line notNil ifTrue:[lines add:line].
+                            ].
 
-			    "
-			     need this critical section; otherwise,
-			     we could get the signal while waiting for
-			     an expose event ...
-			    "
-			    access critical:[                        
-				lines size > 0 ifTrue:[
-				    replace ifTrue:[
-					lines do:[:line |
-					    codeView at:lnr put:line withTabsExpanded.
-					    codeView cursorToBottom; cursorDown.
-					    lnr := lnr + 1.
-					].
-				    ] ifFalse:[
+                            "
+                             need this critical section; otherwise,
+                             we could get the signal while waiting for
+                             an expose event ...
+                            "
+                            access critical:[                        
+                                lines size > 0 ifTrue:[
+                                    replace ifTrue:[
+                                        lines do:[:line |
+                                            codeView at:lnr put:line withTabsExpanded.
+                                            codeView cursorToBottom; cursorDown.
+                                            lnr := lnr + 1.
+                                        ].
+                                    ] ifFalse:[
 codeView insertLines:lines before:codeView cursorLine.
 codeView cursorDown:lines size.
 "/ lines do:[:line |
@@ -1504,68 +1504,68 @@
 "/ ]
 "/                                        codeView insertStringAtCursor:line.
 "/                                        codeView insertCharAtCursor:(Character cr).
-				    ]
-				].
-			    ].
-			].
+                                    ]
+                                ].
+                            ].
+                        ].
 
-			shown ifTrue:[windowGroup processExposeEvents].
-			"
-			 give others running at same prio a chance too
-			 (especially other FileBrowsers doing the same)
-			"
-			Processor yield
-		    ].
-		] valueNowOrOnUnwindDo:[
-		    stream close. stream := nil.
-		].
-		self updateCurrentDirectory
-	    ].
-	    replace ifTrue:[
-		subView modified:false.
-	    ].
-	]
+                        shown ifTrue:[windowGroup processExposeEvents].
+                        "
+                         give others running at same prio a chance too
+                         (especially other FileBrowsers doing the same)
+                        "
+                        Processor yield
+                    ].
+                ] valueNowOrOnUnwindDo:[
+                    stream shutDown "close". stream := nil.
+                ].
+                self updateCurrentDirectory
+            ].
+            replace ifTrue:[
+                subView modified:false.
+            ].
+        ]
       ]
     ] valueNowOrOnUnwindDo:[
-	|wg|
+        |wg|
 
-	self label:myName; iconLabel:myName.
-	myProcess notNil ifTrue:[myProcess priority:myPriority].
+        self label:myName; iconLabel:myName.
+        myProcess notNil ifTrue:[myProcess priority:myPriority].
 
-	"
-	 remove the killButton from its group
-	 (otherwise, it will be destroyed when we shut down the group)
-	"
-	wg := killButton windowGroup.
-	killButton windowGroup:nil.
-	"
-	 shut down the windowgroup
-	"
-	wg notNil ifTrue:[
-	    wg process terminate.
-	].
-	"
-	 hide the button, and make sure it will stay
-	 hidden when we are realized again
-	"
-	killButton beInvisible.
-	"
-	 clear its action (actually not needed, but
-	 releases reference to thisContext earlier)
-	"
-	killButton action:nil.
+        "
+         remove the killButton from its group
+         (otherwise, it will be destroyed when we shut down the group)
+        "
+        wg := killButton windowGroup.
+        killButton windowGroup:nil.
+        "
+         shut down the windowgroup
+        "
+        wg notNil ifTrue:[
+            wg process terminate.
+        ].
+        "
+         hide the button, and make sure it will stay
+         hidden when we are realized again
+        "
+        killButton beInvisible.
+        "
+         clear its action (actually not needed, but
+         releases reference to thisContext earlier)
+        "
+        killButton action:nil.
     ].
 
     currentFileName isNil ifTrue:[
-	subView modified:false.
+        subView modified:false.
     ].
 
     subView size > 10000 ifTrue:[
-	self warn:'text quite large now - please cut off some lines'
+        self warn:'text quite large now - please cut off some lines'
     ]
 
     "Modified: 21.9.1995 / 11:18:46 / claus"
-    "Modified: 17.1.1996 / 11:45:49 / cg"
+    "Modified: 9.2.1996 / 00:26:07 / cg"
 !
 
 doFileGet
@@ -2388,4 +2388,4 @@
 !FileBrowser class methodsFor:'documentation'!
 
 version
-^ '$Header: /cvs/stx/stx/libtool/FileBrowser.st,v 1.69 1996-02-02 16:27:00 cg Exp $'! !
+^ '$Header: /cvs/stx/stx/libtool/FileBrowser.st,v 1.70 1996-02-08 23:26:59 cg Exp $'! !