DirectoryContentsBrowser.st
changeset 4370 777181a805ec
parent 4353 fe7b65eee458
child 4376 e6e33ae8f78a
equal deleted inserted replaced
4369:9b496f6aa2a1 4370:777181a805ec
  2096         ]
  2096         ]
  2097         arguments:nil.
  2097         arguments:nil.
  2098 !
  2098 !
  2099 
  2099 
  2100 startUpdateTask
  2100 startUpdateTask
  2101 
       
  2102     | processLoop |
       
  2103 
       
  2104     updateTask isNil ifTrue:[
  2101     updateTask isNil ifTrue:[
  2105         processLoop := self updateLoop.
  2102         updateTask := [ 
  2106         updateTask := processLoop newProcess.
  2103                         [true] whileTrue:[
       
  2104                             self updateStep
       
  2105                         ] 
       
  2106                       ] newProcess.
  2107         updateTask name:'DirectoryContentsBrowser updateTask'.
  2107         updateTask name:'DirectoryContentsBrowser updateTask'.
  2108         updateTask priorityRange:(Processor systemBackgroundPriority to:Processor activePriority).
  2108         updateTask priorityRange:(Processor systemBackgroundPriority to:Processor activePriority).
       
  2109         updateTask restartable:true.
  2109         updateTask resume.
  2110         updateTask resume.
  2110     ].
  2111     ].
  2111 !
  2112 !
  2112 
  2113 
  2113 stopUpdateTask
  2114 stopUpdateTask
  2156         ].
  2157         ].
  2157 "/        Transcript showCR:'STOP'.
  2158 "/        Transcript showCR:'STOP'.
  2158     ]
  2159     ]
  2159 !
  2160 !
  2160 
  2161 
  2161 updateLoop
  2162 updateStep
  2162 
  2163     AbortSignal handle:[
  2163     ^ [ 
  2164         self debugMessage:'get an abort signal'.
  2164         [true] whileTrue:[
  2165         self directoryContentsChangeFlag:false.
  2165             AbortSignal handle:[
  2166         self filterChangeFlag:false.
  2166                 self debugMessage:'get an abort signal'.
  2167         self sortBlockChangeFlag:false.
  2167                 self directoryContentsChangeFlag:false.
  2168     ] do:[
  2168                 self filterChangeFlag:false.
  2169         | timeOut |
  2169                 self sortBlockChangeFlag:false.
  2170         self debugMessage:'sema wait'.
  2170             ] do:[
  2171         timeOut := (self changeSema waitWithTimeoutMs:(self class updateTaskCyleTime)) isNil.
  2171                 | timeOut |
  2172         self debugMessage:'timeOut:', timeOut asString.
  2172                 self debugMessage:'sema wait'.
  2173         (self filterChangeFlag or:[self sortBlockChangeFlag or:[self directoryChangeFlag]]) ifTrue:[
  2173                 timeOut := (self changeSema waitWithTimeoutMs:(self class updateTaskCyleTime)) isNil.
  2174             | oldCursor |
  2174                 self debugMessage:'timeOut:', timeOut asString.
  2175             oldCursor := self window cursor.
  2175                 (self filterChangeFlag or:[self sortBlockChangeFlag or:[self directoryChangeFlag]]) ifTrue:[
  2176             self showCursor:(Cursor execute).
  2176                     | oldCursor |
  2177             self updateBlock value:timeOut.
  2177                     oldCursor := self window cursor.
  2178             self showCursor:oldCursor.
  2178                     self showCursor:(Cursor execute).
  2179         ] ifFalse:[
  2179                     self updateBlock value:timeOut.
  2180             self updateBlock value:timeOut.
  2180                     self showCursor:oldCursor.
       
  2181                 ] ifFalse:[
       
  2182                     self updateBlock value:timeOut.
       
  2183                 ]
       
  2184             ]
       
  2185         ]
  2181         ]
  2186     ]
  2182     ]
  2187 ! !
  2183 ! !
  2188 
  2184 
  2189 !DirectoryContentsBrowser methodsFor:'update task trigger'!
  2185 !DirectoryContentsBrowser methodsFor:'update task trigger'!
  2708 ! !
  2704 ! !
  2709 
  2705 
  2710 !DirectoryContentsBrowser class methodsFor:'documentation'!
  2706 !DirectoryContentsBrowser class methodsFor:'documentation'!
  2711 
  2707 
  2712 version
  2708 version
  2713     ^ '$Header: /cvs/stx/stx/libtool/DirectoryContentsBrowser.st,v 1.64 2002-12-06 11:48:59 cg Exp $'
  2709     ^ '$Header: /cvs/stx/stx/libtool/DirectoryContentsBrowser.st,v 1.65 2002-12-12 12:37:29 penk Exp $'
  2714 ! !
  2710 ! !