author | Claus Gittinger <cg@exept.de> |
Fri, 21 May 1999 12:11:45 +0200 | |
changeset 2166 | e1b98bde42c4 |
parent 2158 | edf13d7fd732 |
child 2170 | e9078e7a7e40 |
permissions | -rw-r--r-- |
36 | 1 |
" |
2 |
COPYRIGHT (c) 1991 by Claus Gittinger |
|
1317 | 3 |
All Rights Reserved |
36 | 4 |
|
5 |
This software is furnished under a license and may be used |
|
6 |
only in accordance with the terms of that license and with the |
|
7 |
inclusion of the above copyright notice. This software may not |
|
8 |
be provided or otherwise made available to, or used by, any |
|
9 |
other person. No title to or ownership of the software is |
|
10 |
hereby transferred. |
|
11 |
" |
|
12 |
||
13 |
StandardSystemView subclass:#FileBrowser |
|
1010 | 14 |
instanceVariableNames:'labelView filterField fileListView subView currentDirectory |
1834 | 15 |
fileList checkBlock checkDelta timeOfLastCheck myName killButton |
16 |
pauseToggle compressTabs lockUpdate previousDirectory |
|
17 |
currentFileName timeOfFileRead tabSpec commandView commandIndex |
|
18 |
fileEncoding tabRulerView scrollView icons listUpdateProcess |
|
19 |
currentFileInFileName lastFileDiffDirectory sortByWhat |
|
2031 | 20 |
sortCaseless showingDetails showingHiddenFiles |
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
21 |
showingBigImagePreview imagePreviewView imageRenderProcess |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
22 |
dosEOLMode' |
1010 | 23 |
classVariableNames:'DirectoryHistory DirectoryHistoryWhere HistorySize DefaultIcon |
1142
9066d7d02a3a
remember last executed command per suffix; offer this as default.
Claus Gittinger <cg@exept.de>
parents:
1141
diff
changeset
|
24 |
CommandHistory CommandHistorySize Icons DefaultCommandPerSuffix' |
1010 | 25 |
poolDictionaries:'' |
26 |
category:'Interface-Browsers' |
|
36 | 27 |
! |
28 |
||
763
94a8d188b52d
care for the nameSpace Query when loading binary classes
Claus Gittinger <cg@exept.de>
parents:
749
diff
changeset
|
29 |
!FileBrowser class methodsFor:'documentation'! |
36 | 30 |
|
31 |
copyright |
|
32 |
" |
|
33 |
COPYRIGHT (c) 1991 by Claus Gittinger |
|
1317 | 34 |
All Rights Reserved |
36 | 35 |
|
36 |
This software is furnished under a license and may be used |
|
37 |
only in accordance with the terms of that license and with the |
|
38 |
inclusion of the above copyright notice. This software may not |
|
39 |
be provided or otherwise made available to, or used by, any |
|
40 |
other person. No title to or ownership of the software is |
|
41 |
hereby transferred. |
|
42 |
" |
|
43 |
! |
|
44 |
||
45 |
documentation |
|
46 |
" |
|
47 |
this used to be a very simple demo application, |
|
48 |
but migrated into a quite nice tool, includes all kinds of |
|
49 |
warning and information boxes, background processes for directory- |
|
50 |
reading and internationalized strings. A good example for beginners, |
|
100 | 51 |
on how to do things .... (and maybe how not to do things ;-, since some |
52 |
stuff is historic and was implemented at times when better mechanisms |
|
53 |
were not available) |
|
52 | 54 |
|
36 | 55 |
See additional information in 'doc/misc/fbrowser.doc'. |
45 | 56 |
|
52 | 57 |
WARNING: files edited with FileBrowser will have leading spaces (multiple-8) |
2138 | 58 |
being replaced by tabs. If tabs are to be preserved at other |
59 |
positions (for example, sendmail-config files) they will be |
|
60 |
corrupt after being written. |
|
508 | 61 |
|
62 |
[instance variables]: |
|
63 |
||
2138 | 64 |
checkDelta <Integer> number of seconds of check interval |
65 |
(looks ever so often if shown directory |
|
66 |
has changed). You may make this number |
|
67 |
higher, if your network-times are |
|
68 |
incorrect and thus, the filebrowser |
|
69 |
checks too often. |
|
70 |
||
71 |
compressTabs <Boolean> if true, leading spaces will be |
|
72 |
replaced by tabs when saving text |
|
52 | 73 |
|
74 |
some of the defaults (long/short list etc.) can be set by the resource file; |
|
75 |
see FileBrowser>>initialize for more details.. |
|
508 | 76 |
|
77 |
[author:] |
|
2138 | 78 |
Claus Gittinger |
2031 | 79 |
|
80 |
[start with:] |
|
2138 | 81 |
FileBrowser open |
36 | 82 |
" |
203 | 83 |
! ! |
36 | 84 |
|
763
94a8d188b52d
care for the nameSpace Query when loading binary classes
Claus Gittinger <cg@exept.de>
parents:
749
diff
changeset
|
85 |
!FileBrowser class methodsFor:'instance creation'! |
36 | 86 |
|
87 |
openOn:aDirectoryPath |
|
88 |
"start a new FileBrowser in a pathname" |
|
89 |
||
90 |
^ (self new currentDirectory:aDirectoryPath) open |
|
91 |
||
52 | 92 |
" |
93 |
FileBrowser openOn:'aDirectoryPath' |
|
94 |
FileBrowser openOn:'/etc' |
|
95 |
FileBrowser openOn:'..' |
|
96 |
FileBrowser openOn:'.' |
|
97 |
" |
|
93 | 98 |
! |
99 |
||
100 |
openOnFileNamed:aFilename |
|
101 |
"start a new FileBrowser on a file" |
|
102 |
||
103 |
|f browser| |
|
104 |
||
105 |
f := aFilename asFilename. |
|
1124 | 106 |
f isDirectory ifTrue:[ |
1868 | 107 |
^ self openOn:aFilename |
1124 | 108 |
]. |
1689 | 109 |
|
93 | 110 |
browser := self new. |
111 |
browser currentDirectory:f directoryName. |
|
1689 | 112 |
browser updateCurrentDirectory. |
93 | 113 |
browser showFile:f baseName. |
1689 | 114 |
|
115 |
^ browser open. |
|
93 | 116 |
|
117 |
" |
|
118 |
FileBrowser openOnFileNamed:'Makefile' |
|
119 |
FileBrowser openOnFileNamed:'../Makefile' |
|
120 |
FileBrowser openOnFileNamed:'/tmp/foo' |
|
121 |
" |
|
1124 | 122 |
|
1689 | 123 |
"Modified: / 17.6.1998 / 11:25:29 / cg" |
36 | 124 |
! ! |
125 |
||
1145
0464625bbdbb
read directory in a subprocess.
Claus Gittinger <cg@exept.de>
parents:
1144
diff
changeset
|
126 |
!FileBrowser class methodsFor:'class initialization'! |
0464625bbdbb
read directory in a subprocess.
Claus Gittinger <cg@exept.de>
parents:
1144
diff
changeset
|
127 |
|
1178
f5f4d0c605db
lazy initialization of Icons
Claus Gittinger <cg@exept.de>
parents:
1173
diff
changeset
|
128 |
initializeIcons |
1239
e58e2cb6639a
allow specification of icons from resource file.
Claus Gittinger <cg@exept.de>
parents:
1235
diff
changeset
|
129 |
|resources| |
e58e2cb6639a
allow specification of icons from resource file.
Claus Gittinger <cg@exept.de>
parents:
1235
diff
changeset
|
130 |
|
e58e2cb6639a
allow specification of icons from resource file.
Claus Gittinger <cg@exept.de>
parents:
1235
diff
changeset
|
131 |
resources := self classResources. |
e58e2cb6639a
allow specification of icons from resource file.
Claus Gittinger <cg@exept.de>
parents:
1235
diff
changeset
|
132 |
|
1784
329e3a904236
ask MIMETypes when mapping suffixes to icons.
Claus Gittinger <cg@exept.de>
parents:
1758
diff
changeset
|
133 |
Icons := Dictionary new. |
1145
0464625bbdbb
read directory in a subprocess.
Claus Gittinger <cg@exept.de>
parents:
1144
diff
changeset
|
134 |
|
1147 | 135 |
#( |
1868 | 136 |
"/ internal-type to icon mappings. |
137 |
(#directory 'ICON_DIRECTORY' 'tiny_yellow_dir.xpm' ) |
|
138 |
(#directoryLocked 'ICON_DIRECTORY_LOCKED' 'tiny_yellow_dir_locked.xpm') |
|
139 |
(#directoryLink 'ICON_DIRECTORY_LINK' 'tiny_yellow_dir_link.xpm' ) |
|
140 |
(#file 'ICON_FILE' 'tiny_file_plain.xpm' ) |
|
141 |
(#fileLink 'ICON_FILE_LINK' 'tiny_file_link.xpm' ) |
|
142 |
(#fileLocked 'ICON_FILE_LOCKED' 'tiny_file_lock.xpm' ) |
|
143 |
(#imageFile 'ICON_IMAGE_FILE' 'tiny_file_pix.xpm' ) |
|
144 |
(#textFile 'ICON_TEXT_FILE' 'tiny_file_text.xpm' ) |
|
145 |
(#executableFile 'ICON_EXECUTABLEFILE' 'tiny_file_exec.xpm' ) |
|
146 |
||
147 |
"/ mime-type to icon mappings. |
|
148 |
('text/plain' nil 'tiny_file_text.xpm' ) |
|
149 |
('text/html' nil 'tiny_file_text.xpm' ) |
|
150 |
('application/x-smalltalk-source' nil 'tiny_file_st.xpm' ) |
|
1239
e58e2cb6639a
allow specification of icons from resource file.
Claus Gittinger <cg@exept.de>
parents:
1235
diff
changeset
|
151 |
) do:[:entry | |
1868 | 152 |
|key resource defaultName nm| |
153 |
||
154 |
key := entry at:1. |
|
155 |
resource := entry at:2. |
|
156 |
defaultName := entry at:3. |
|
157 |
||
158 |
resource notNil ifTrue:[ |
|
159 |
nm := resources at:resource default:nil. |
|
160 |
]. |
|
161 |
nm isNil ifTrue:[ |
|
162 |
nm := 'bitmaps/xpmBitmaps/document_images/' , defaultName |
|
163 |
]. |
|
164 |
Icons at:key put:(Image fromFile:nm). |
|
1147 | 165 |
] |
166 |
||
167 |
" |
|
1178
f5f4d0c605db
lazy initialization of Icons
Claus Gittinger <cg@exept.de>
parents:
1173
diff
changeset
|
168 |
self initializeIcons |
1147 | 169 |
" |
170 |
||
1784
329e3a904236
ask MIMETypes when mapping suffixes to icons.
Claus Gittinger <cg@exept.de>
parents:
1758
diff
changeset
|
171 |
"Modified: / 1.8.1998 / 17:39:27 / cg" |
1145
0464625bbdbb
read directory in a subprocess.
Claus Gittinger <cg@exept.de>
parents:
1144
diff
changeset
|
172 |
! ! |
0464625bbdbb
read directory in a subprocess.
Claus Gittinger <cg@exept.de>
parents:
1144
diff
changeset
|
173 |
|
865
48395e8ecca9
remember executeCommand actions in history as well.
Claus Gittinger <cg@exept.de>
parents:
851
diff
changeset
|
174 |
!FileBrowser class methodsFor:'command history'! |
48395e8ecca9
remember executeCommand actions in history as well.
Claus Gittinger <cg@exept.de>
parents:
851
diff
changeset
|
175 |
|
1142
9066d7d02a3a
remember last executed command per suffix; offer this as default.
Claus Gittinger <cg@exept.de>
parents:
1141
diff
changeset
|
176 |
addToCommandHistory:aCommandString for:aFilename |
9066d7d02a3a
remember last executed command per suffix; offer this as default.
Claus Gittinger <cg@exept.de>
parents:
1141
diff
changeset
|
177 |
|cmd suffix| |
9066d7d02a3a
remember last executed command per suffix; offer this as default.
Claus Gittinger <cg@exept.de>
parents:
1141
diff
changeset
|
178 |
|
865
48395e8ecca9
remember executeCommand actions in history as well.
Claus Gittinger <cg@exept.de>
parents:
851
diff
changeset
|
179 |
(aCommandString notNil and:[aCommandString notEmpty]) ifTrue:[ |
1317 | 180 |
CommandHistory notNil ifTrue:[ |
181 |
CommandHistory addFirst:aCommandString. |
|
182 |
CommandHistory size > CommandHistorySize ifTrue:[ |
|
183 |
CommandHistory removeLast |
|
184 |
] |
|
185 |
]. |
|
186 |
aFilename notNil ifTrue:[ |
|
187 |
cmd := aCommandString copyTo:(aCommandString indexOf:Character space ifAbsent:[aCommandString size + 1])-1. |
|
188 |
DefaultCommandPerSuffix isNil ifTrue:[ |
|
189 |
DefaultCommandPerSuffix := Dictionary new. |
|
190 |
]. |
|
191 |
suffix := aFilename asFilename suffix. |
|
192 |
suffix notNil ifTrue:[ |
|
193 |
DefaultCommandPerSuffix at:suffix put:cmd. |
|
194 |
] |
|
195 |
] |
|
865
48395e8ecca9
remember executeCommand actions in history as well.
Claus Gittinger <cg@exept.de>
parents:
851
diff
changeset
|
196 |
] |
48395e8ecca9
remember executeCommand actions in history as well.
Claus Gittinger <cg@exept.de>
parents:
851
diff
changeset
|
197 |
|
48395e8ecca9
remember executeCommand actions in history as well.
Claus Gittinger <cg@exept.de>
parents:
851
diff
changeset
|
198 |
"Created: 14.11.1996 / 14:58:13 / cg" |
48395e8ecca9
remember executeCommand actions in history as well.
Claus Gittinger <cg@exept.de>
parents:
851
diff
changeset
|
199 |
! ! |
48395e8ecca9
remember executeCommand actions in history as well.
Claus Gittinger <cg@exept.de>
parents:
851
diff
changeset
|
200 |
|
763
94a8d188b52d
care for the nameSpace Query when loading binary classes
Claus Gittinger <cg@exept.de>
parents:
749
diff
changeset
|
201 |
!FileBrowser class methodsFor:'defaults'! |
73 | 202 |
|
203 |
defaultIcon |
|
1147 | 204 |
"return the file browsers default window icon" |
205 |
||
1287 | 206 |
<resource: #style (#FILEBROWSER_ICON #FILEBROWSER_ICON_FILE)> |
207 |
||
208 |
|nm i res| |
|
1147 | 209 |
|
210 |
(i := DefaultIcon) isNil ifTrue:[ |
|
1317 | 211 |
res := self classResources. |
212 |
i := res at:'FILEBROWSER_ICON' default:nil. |
|
213 |
i isNil ifTrue:[ |
|
214 |
nm := res at:'FILEBROWSER_ICON_FILE' default:'FBrowser.xbm'. |
|
215 |
i := Image fromFile:nm resolution:100. |
|
216 |
i isNil ifTrue:[ |
|
217 |
i := Image fromFile:('bitmaps/' , nm) resolution:100. |
|
218 |
i isNil ifTrue:[ |
|
219 |
i := StandardSystemView defaultIcon |
|
220 |
] |
|
221 |
] |
|
222 |
]. |
|
223 |
i notNil ifTrue:[ |
|
224 |
DefaultIcon := i := i on:Display |
|
225 |
] |
|
1145
0464625bbdbb
read directory in a subprocess.
Claus Gittinger <cg@exept.de>
parents:
1144
diff
changeset
|
226 |
]. |
0464625bbdbb
read directory in a subprocess.
Claus Gittinger <cg@exept.de>
parents:
1144
diff
changeset
|
227 |
^ i |
0464625bbdbb
read directory in a subprocess.
Claus Gittinger <cg@exept.de>
parents:
1144
diff
changeset
|
228 |
|
1147 | 229 |
"Modified: 19.3.1997 / 20:48:34 / ca" |
1287 | 230 |
"Modified: 15.8.1997 / 15:27:19 / cg" |
73 | 231 |
! ! |
232 |
||
1933 | 233 |
!FileBrowser class methodsFor:'interface specs'! |
234 |
||
235 |
fileSearchDialogSpec |
|
236 |
"This resource specification was automatically generated |
|
237 |
by the UIPainter of ST/X." |
|
238 |
||
239 |
"Do not manually edit this!! If it is corrupted, |
|
240 |
the UIPainter may not be able to read the specification." |
|
241 |
||
242 |
" |
|
243 |
UIPainter new openOnClass:FileBrowser andSelector:#fileSearchDialogSpec |
|
244 |
" |
|
245 |
||
246 |
<resource: #canvas> |
|
247 |
||
248 |
^ |
|
249 |
||
250 |
#(#FullSpec |
|
2138 | 251 |
#window: |
252 |
#(#WindowSpec |
|
253 |
#name: 'File Search' |
|
254 |
#layout: #(#LayoutFrame 4 0 50 0 315 0 349 0) |
|
255 |
#level: 0 |
|
256 |
#label: 'File Search' |
|
257 |
#min: #(#Point 10 10) |
|
258 |
#max: #(#Point 1280 1024) |
|
259 |
#bounds: #(#Rectangle 4 50 316 350) |
|
260 |
#usePreferredExtent: false |
|
261 |
#returnIsOKInDialog: true |
|
262 |
#escapeIsCancelInDialog: true |
|
263 |
) |
|
264 |
#component: |
|
265 |
#(#SpecCollection |
|
266 |
#collection: |
|
267 |
#( |
|
268 |
#(#LabelSpec |
|
269 |
#name: 'Label1' |
|
270 |
#layout: #(#LayoutFrame 0 0 10 0 0 1 32 0) |
|
271 |
#label: 'Search for files named:' |
|
272 |
#translateLabel: true |
|
273 |
#adjust: #left |
|
274 |
) |
|
275 |
#(#InputFieldSpec |
|
276 |
#name: 'EntryField1' |
|
277 |
#layout: #(#LayoutFrame 10 0 36 0 305 0 58 0) |
|
278 |
#tabable: true |
|
279 |
#model: #namePatternHolder |
|
280 |
) |
|
281 |
#(#CheckBoxSpec |
|
282 |
#name: 'CheckBox1' |
|
283 |
#layout: #(#LayoutFrame 7 0 66 0 143 0 88 0) |
|
284 |
#tabable: true |
|
285 |
#model: #ignoreCaseInName |
|
286 |
#label: 'Ignore case' |
|
287 |
#translateLabel: true |
|
288 |
) |
|
289 |
#(#LabelSpec |
|
290 |
#name: 'Label2' |
|
291 |
#layout: #(#LayoutFrame 0 0.0 107 0 0 1.0 129 0) |
|
292 |
#label: 'Containing the string:' |
|
293 |
#translateLabel: true |
|
294 |
#adjust: #left |
|
295 |
) |
|
296 |
#(#InputFieldSpec |
|
297 |
#name: 'EntryField2' |
|
298 |
#layout: #(#LayoutFrame 10 0 133 0 305 0 155 0) |
|
299 |
#enableChannel: #notSearchForSameContents |
|
300 |
#tabable: true |
|
301 |
#model: #contentsPatternHolder |
|
302 |
) |
|
303 |
#(#CheckBoxSpec |
|
304 |
#name: 'CheckBox2' |
|
305 |
#layout: #(#LayoutFrame 6 0 163 0 142 0 185 0) |
|
306 |
#enableChannel: #notSearchForSameContents |
|
307 |
#tabable: true |
|
308 |
#model: #ignoreCaseInContents |
|
309 |
#label: 'Ignore case' |
|
310 |
#translateLabel: true |
|
311 |
) |
|
312 |
#(#LabelSpec |
|
313 |
#name: 'Label3' |
|
314 |
#layout: #(#LayoutFrame 0 0.0 223 0 -30 1.0 245 0) |
|
315 |
#label: 'Containing same contents as selected:' |
|
316 |
#translateLabel: true |
|
317 |
#adjust: #left |
|
318 |
) |
|
319 |
#(#DividerSpec |
|
320 |
#name: 'Separator1' |
|
321 |
#layout: #(#LayoutFrame 0 0.0 97 0 0 1.0 101 0) |
|
322 |
) |
|
323 |
#(#CheckToggleSpec |
|
324 |
#name: 'CheckToggle1' |
|
325 |
#layout: #(#LayoutOrigin -25 1 225 0) |
|
326 |
#tabable: true |
|
327 |
#model: #searchForSameContents |
|
328 |
#enableChannel: #searchForSameContentsEnabled |
|
329 |
#isTriggerOnDown: true |
|
330 |
#showLamp: false |
|
331 |
#lampColor: #(#Color 100.0 100.0 0.0) |
|
332 |
) |
|
333 |
#(#HorizontalPanelViewSpec |
|
334 |
#name: 'HorizontalPanel1' |
|
335 |
#layout: #(#LayoutFrame 0 0.0 -30 1 0 1.0 0 1.0) |
|
336 |
#component: |
|
337 |
#(#SpecCollection |
|
338 |
#collection: |
|
339 |
#( |
|
340 |
#(#ActionButtonSpec |
|
341 |
#name: 'Button1' |
|
342 |
#label: 'Cancel' |
|
343 |
#translateLabel: true |
|
344 |
#tabable: true |
|
345 |
#model: #cancel |
|
346 |
#extent: #(#Point 151 25) |
|
347 |
) |
|
348 |
#(#ActionButtonSpec |
|
349 |
#name: 'Button2' |
|
350 |
#label: 'Search' |
|
351 |
#translateLabel: true |
|
352 |
#tabable: true |
|
353 |
#model: #accept |
|
354 |
#isDefault: true |
|
355 |
#extent: #(#Point 152 25) |
|
356 |
) |
|
357 |
) |
|
358 |
) |
|
359 |
#horizontalLayout: #fitSpace |
|
360 |
#verticalLayout: #centerMax |
|
361 |
#horizontalSpace: 3 |
|
362 |
#verticalSpace: 3 |
|
363 |
) |
|
364 |
) |
|
365 |
) |
|
1933 | 366 |
) |
367 |
! ! |
|
368 |
||
1834 | 369 |
!FileBrowser class methodsFor:'menu specs'! |
370 |
||
371 |
baseDirectoryMenuSpec |
|
372 |
"This resource specification was automatically generated |
|
373 |
by the MenuEditor of ST/X." |
|
374 |
||
375 |
"Do not manually edit this!! If it is corrupted, |
|
376 |
the MenuEditor may not be able to read the specification." |
|
377 |
||
378 |
" |
|
379 |
MenuEditor new openOnClass:FileBrowser andSelector:#directoryMenuSpec |
|
380 |
(Menu new fromLiteralArrayEncoding:(FileBrowser directoryMenuSpec)) startUp |
|
381 |
" |
|
382 |
||
383 |
<resource: #menu> |
|
384 |
||
385 |
^ |
|
386 |
||
387 |
#(#Menu |
|
388 |
||
1868 | 389 |
#( |
390 |
#(#MenuItem |
|
391 |
#label: 'Copy Path' |
|
392 |
#translateLabel: true |
|
393 |
#value: #copyPath |
|
394 |
) |
|
395 |
#(#MenuItem |
|
396 |
#label: '-' |
|
397 |
) |
|
398 |
#(#MenuItem |
|
399 |
#label: 'Up' |
|
400 |
#translateLabel: true |
|
401 |
#value: #changeToParentDirectory |
|
402 |
#enabled: #currentDirectoryIsNotTop |
|
403 |
) |
|
404 |
#(#MenuItem |
|
405 |
#label: 'Back' |
|
406 |
#translateLabel: true |
|
407 |
#value: #changeToPreviousDirectory |
|
408 |
) |
|
409 |
#(#MenuItem |
|
410 |
#label: 'Home' |
|
411 |
#translateLabel: true |
|
412 |
#value: #changeToHomeDirectory |
|
413 |
) |
|
414 |
#(#MenuItem |
|
415 |
#label: 'Default' |
|
416 |
#translateLabel: true |
|
417 |
#value: #changeToDefaultDirectory |
|
418 |
) |
|
419 |
#(#MenuItem |
|
420 |
#label: 'Goto...' |
|
421 |
#translateLabel: true |
|
422 |
#value: #changeCurrentDirectory |
|
423 |
) |
|
424 |
) nil |
|
425 |
nil |
|
1834 | 426 |
) |
427 |
||
428 |
"Created: / 4.8.1998 / 17:21:16 / cg" |
|
1835 | 429 |
"Modified: / 14.8.1998 / 19:19:06 / cg" |
1834 | 430 |
! |
431 |
||
432 |
directoryMenuSpec |
|
433 |
"This resource specification was automatically generated |
|
434 |
by the MenuEditor of ST/X." |
|
435 |
||
436 |
"Do not manually edit this!! If it is corrupted, |
|
437 |
the MenuEditor may not be able to read the specification." |
|
438 |
||
439 |
" |
|
440 |
MenuEditor new openOnClass:FileBrowser andSelector:#directoryMenuSpec |
|
441 |
(Menu new fromLiteralArrayEncoding:(FileBrowser directoryMenuSpec)) startUp |
|
442 |
" |
|
443 |
||
444 |
<resource: #programMenu> |
|
445 |
||
2035
307ed5143d8b
national language stuff - again
Claus Gittinger <cg@exept.de>
parents:
2031
diff
changeset
|
446 |
|m| |
307ed5143d8b
national language stuff - again
Claus Gittinger <cg@exept.de>
parents:
2031
diff
changeset
|
447 |
|
307ed5143d8b
national language stuff - again
Claus Gittinger <cg@exept.de>
parents:
2031
diff
changeset
|
448 |
m := self baseDirectoryMenuSpec. |
307ed5143d8b
national language stuff - again
Claus Gittinger <cg@exept.de>
parents:
2031
diff
changeset
|
449 |
m := m decodeAsLiteralArray. |
1834 | 450 |
|
451 |
"/ add the history items ... |
|
452 |
||
1835 | 453 |
DirectoryHistory size > 0 ifTrue:[ |
2138 | 454 |
m addItem:(MenuItem labeled:'-'). |
455 |
DirectoryHistory do:[:dirName | |
|
456 |
m addItem:((MenuItem label:dirName value:#changeDirectoryTo:) |
|
457 |
argument:dirName; |
|
458 |
yourself). |
|
459 |
]. |
|
1834 | 460 |
]. |
461 |
||
2035
307ed5143d8b
national language stuff - again
Claus Gittinger <cg@exept.de>
parents:
2031
diff
changeset
|
462 |
m findGuiResourcesIn:self. |
307ed5143d8b
national language stuff - again
Claus Gittinger <cg@exept.de>
parents:
2031
diff
changeset
|
463 |
^ m |
1834 | 464 |
|
1837 | 465 |
"Modified: / 17.8.1998 / 10:13:05 / cg" |
1834 | 466 |
! |
467 |
||
468 |
menuPopUp |
|
469 |
"This resource specification was automatically generated |
|
470 |
by the MenuEditor of ST/X." |
|
471 |
||
472 |
"Do not manually edit this!! If it is corrupted, |
|
473 |
the MenuEditor may not be able to read the specification." |
|
474 |
||
475 |
" |
|
476 |
MenuEditor new openOnClass:FileBrowser andSelector:#menuPopUp |
|
477 |
(Menu new fromLiteralArrayEncoding:(FileBrowser menuPopUp)) startUp |
|
478 |
" |
|
479 |
||
480 |
<resource: #menu> |
|
481 |
||
482 |
^ |
|
483 |
||
484 |
#(#Menu |
|
485 |
||
2138 | 486 |
#( |
487 |
#(#MenuItem |
|
488 |
#label: 'Spawn' |
|
489 |
#translateLabel: true |
|
490 |
#value: #fileSpawn |
|
491 |
) |
|
492 |
#(#MenuItem |
|
493 |
#label: '-' |
|
494 |
) |
|
495 |
#(#MenuItem |
|
496 |
#label: 'Get Contents' |
|
497 |
#translateLabel: true |
|
498 |
#value: #fileGet |
|
499 |
#enabled: #hasSelection |
|
500 |
) |
|
501 |
#(#MenuItem |
|
502 |
#label: 'Insert Contents' |
|
503 |
#translateLabel: true |
|
504 |
#value: #fileInsert |
|
505 |
#enabled: #hasSelection |
|
506 |
) |
|
507 |
#(#MenuItem |
|
508 |
#label: 'FileIn' |
|
509 |
#translateLabel: true |
|
510 |
#value: #fileFileIn |
|
511 |
#enabled: #hasSelection |
|
512 |
) |
|
513 |
#(#MenuItem |
|
514 |
#label: '-' |
|
515 |
) |
|
516 |
#(#MenuItem |
|
517 |
#label: 'Unix Command...' |
|
518 |
#translateLabel: true |
|
519 |
#isVisible: #systemIsUnix |
|
520 |
#value: #menuOSCommand |
|
521 |
) |
|
522 |
#(#MenuItem |
|
523 |
#label: 'DOS Command...' |
|
524 |
#translateLabel: true |
|
525 |
#isVisible: #systemIsDOS |
|
526 |
#value: #menuOSCommand |
|
527 |
) |
|
528 |
#(#MenuItem |
|
529 |
#label: 'VMS Command...' |
|
530 |
#translateLabel: true |
|
531 |
#isVisible: #systemIsVMS |
|
532 |
#value: #menuOSCommand |
|
533 |
) |
|
534 |
#(#MenuItem |
|
535 |
#label: 'ST/X Tools' |
|
536 |
#translateLabel: true |
|
537 |
#submenu: |
|
538 |
#(#Menu |
|
1834 | 539 |
|
2138 | 540 |
#( |
541 |
#(#MenuItem |
|
542 |
#label: 'Changes Browser' |
|
543 |
#translateLabel: true |
|
544 |
#value: #openChangesBrowser |
|
545 |
#enabled: #hasSelection |
|
546 |
) |
|
547 |
#(#MenuItem |
|
548 |
#label: 'Editor' |
|
549 |
#translateLabel: true |
|
550 |
#value: #openEditor |
|
551 |
#enabled: #hasSelection |
|
552 |
) |
|
553 |
#(#MenuItem |
|
554 |
#label: 'HTML Reader' |
|
555 |
#translateLabel: true |
|
556 |
#value: #openHTMLReader |
|
557 |
#enabled: #hasSelection |
|
558 |
) |
|
559 |
#(#MenuItem |
|
560 |
#label: 'Applet Viewer' |
|
561 |
#translateLabel: true |
|
562 |
#isVisible: #hasJava |
|
563 |
#value: #openAppletViewer |
|
564 |
#enabled: #hasJavaAndSelection |
|
565 |
) |
|
566 |
#(#MenuItem |
|
567 |
#label: 'Image Inspect' |
|
568 |
#translateLabel: true |
|
569 |
#value: #openImageInspector |
|
570 |
#enabled: #hasSelection |
|
571 |
) |
|
572 |
#(#MenuItem |
|
573 |
#label: 'Image Preview' |
|
574 |
#translateLabel: true |
|
575 |
#value: #openImagePreview |
|
576 |
#enabled: #hasSelection |
|
577 |
) |
|
578 |
#(#MenuItem |
|
579 |
#label: 'Image Editor' |
|
580 |
#translateLabel: true |
|
581 |
#value: #openImageEditor |
|
582 |
#enabled: #hasSelection |
|
583 |
) |
|
584 |
#(#MenuItem |
|
585 |
#label: 'ZipFile Tool' |
|
586 |
#translateLabel: true |
|
587 |
#value: #openZipTool |
|
588 |
#enabled: #hasZipFileSelected |
|
589 |
) |
|
590 |
#(#MenuItem |
|
591 |
#label: 'Hex Dump' |
|
592 |
#translateLabel: true |
|
593 |
#value: #fileHexDump |
|
594 |
) |
|
595 |
#(#MenuItem |
|
596 |
#label: 'Show File Differences' |
|
597 |
#translateLabel: true |
|
598 |
#value: #openDiffView |
|
599 |
) |
|
600 |
#(#MenuItem |
|
601 |
#label: 'Terminal' |
|
602 |
#translateLabel: true |
|
603 |
#isVisible: #systemIsUnix |
|
604 |
#value: #openTerminal |
|
605 |
#enabled: #systemIsUnix |
|
606 |
) |
|
607 |
) nil |
|
608 |
nil |
|
609 |
) |
|
610 |
) |
|
611 |
#(#MenuItem |
|
612 |
#label: '-' |
|
613 |
) |
|
614 |
#(#MenuItem |
|
615 |
#label: 'Remove...' |
|
616 |
#translateLabel: true |
|
617 |
#value: #fileRemove |
|
618 |
#enabled: #hasSelection |
|
619 |
) |
|
620 |
#(#MenuItem |
|
621 |
#label: 'Rename...' |
|
622 |
#translateLabel: true |
|
623 |
#value: #fileRename |
|
624 |
#enabled: #hasSelection |
|
625 |
) |
|
626 |
#(#MenuItem |
|
627 |
#label: '-' |
|
628 |
) |
|
629 |
#(#MenuItem |
|
630 |
#label: 'New Directory...' |
|
631 |
#translateLabel: true |
|
632 |
#value: #newDirectory |
|
633 |
) |
|
634 |
#(#MenuItem |
|
635 |
#label: 'New File...' |
|
636 |
#translateLabel: true |
|
637 |
#value: #newFile |
|
638 |
) |
|
639 |
#(#MenuItem |
|
640 |
#label: '-' |
|
641 |
) |
|
642 |
#(#MenuItem |
|
643 |
#label: 'Update' |
|
644 |
#translateLabel: true |
|
645 |
#value: #updateCurrentDirectory |
|
646 |
) |
|
647 |
) nil |
|
648 |
nil |
|
1834 | 649 |
) |
650 |
! |
|
651 |
||
652 |
menuSpec |
|
653 |
"This resource specification was automatically generated |
|
654 |
by the MenuEditor of ST/X." |
|
655 |
||
656 |
"Do not manually edit this!! If it is corrupted, |
|
657 |
the MenuEditor may not be able to read the specification." |
|
658 |
||
659 |
" |
|
660 |
MenuEditor new openOnClass:FileBrowser andSelector:#menuSpec |
|
661 |
(Menu new fromLiteralArrayEncoding:(FileBrowser menuSpec)) startUp |
|
662 |
" |
|
663 |
||
664 |
<resource: #menu> |
|
665 |
||
2102 | 666 |
^ |
667 |
#(#Menu |
|
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
668 |
#( |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
669 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
670 |
#label: 'About' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
671 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
672 |
#labelImage: #(#ResourceRetriever #ToolApplicationModel #menuIcon) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
673 |
#submenu: |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
674 |
#(#Menu |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
675 |
#( |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
676 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
677 |
#label: 'About Smalltalk/X...' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
678 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
679 |
#value: #showAboutSTX |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
680 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
681 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
682 |
#label: '-' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
683 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
684 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
685 |
#label: 'About FileBrowser...' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
686 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
687 |
#value: #openAboutThisApplication |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
688 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
689 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
690 |
nil |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
691 |
nil |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
692 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
693 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
694 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
695 |
#label: 'File' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
696 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
697 |
#submenu: |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
698 |
#(#Menu |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
699 |
#( |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
700 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
701 |
#label: 'Open' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
702 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
703 |
#value: #menuOpen |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
704 |
#enabled: #hasSelection |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
705 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
706 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
707 |
#label: 'Open selected Filename' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
708 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
709 |
#isVisible: #hasFilenameSelectionInCodeView |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
710 |
#value: #openSelectedFilename |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
711 |
#enabled: #hasFilenameSelectionInCodeView |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
712 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
713 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
714 |
#label: 'FileIn' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
715 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
716 |
#value: #fileFileIn |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
717 |
#enabled: #hasSelection |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
718 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
719 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
720 |
#label: '-' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
721 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
722 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
723 |
#label: 'New' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
724 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
725 |
#submenu: |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
726 |
#(#Menu |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
727 |
#( |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
728 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
729 |
#label: 'Directory...' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
730 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
731 |
#value: #newDirectory |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
732 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
733 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
734 |
#label: 'File...' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
735 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
736 |
#value: #newFile |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
737 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
738 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
739 |
#label: 'Hard Link...' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
740 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
741 |
#isVisible: #systemIsUnix |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
742 |
#value: #newHardLink |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
743 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
744 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
745 |
#label: 'Symbolic Link...' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
746 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
747 |
#isVisible: #systemIsUnix |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
748 |
#value: #newSoftLink |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
749 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
750 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
751 |
nil |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
752 |
nil |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
753 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
754 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
755 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
756 |
#label: 'Remove' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
757 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
758 |
#value: #fileRemove |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
759 |
#enabled: #hasSelection |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
760 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
761 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
762 |
#label: 'Rename' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
763 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
764 |
#value: #fileRename |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
765 |
#enabled: #hasSelection |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
766 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
767 |
#(#MenuItem |
2143 | 768 |
#label: '-' |
769 |
) |
|
770 |
#(#MenuItem |
|
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
771 |
#label: 'Properties...' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
772 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
773 |
#value: #fileGetLongInfo |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
774 |
#enabled: #hasSelection |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
775 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
776 |
#(#MenuItem |
2143 | 777 |
#label: 'Encoding...' |
778 |
#translateLabel: true |
|
779 |
#value: #fileEncoding |
|
780 |
) |
|
781 |
#(#MenuItem |
|
782 |
#label: 'DOS EndOfLine Mode' |
|
783 |
#translateLabel: true |
|
784 |
#indication: #dosEOLMode |
|
785 |
) |
|
786 |
#(#MenuItem |
|
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
787 |
#label: '-' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
788 |
#isVisible: #javaSupportLoaded |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
789 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
790 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
791 |
#label: 'Add to Java ClassPath' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
792 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
793 |
#isVisible: #javaSupportLoaded |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
794 |
#value: #fileAddToJavaClassPath |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
795 |
#enabled: #canAddToClassPath |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
796 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
797 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
798 |
#label: 'Remove from Java ClassPath' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
799 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
800 |
#isVisible: #javaSupportLoaded |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
801 |
#value: #fileRemoveFromJavaClassPath |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
802 |
#enabled: #canRemoveToClassPath |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
803 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
804 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
805 |
#label: '-' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
806 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
807 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
808 |
#label: 'Spawn' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
809 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
810 |
#value: #fileSpawn |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
811 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
812 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
813 |
#label: '-' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
814 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
815 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
816 |
#label: 'Exit' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
817 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
818 |
#value: #menuExit |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
819 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
820 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
821 |
nil |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
822 |
nil |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
823 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
824 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
825 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
826 |
#label: 'Directory' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
827 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
828 |
#submenuChannel: #directoryMenuSpec |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
829 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
830 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
831 |
#label: 'Edit' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
832 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
833 |
#submenu: |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
834 |
#(#Menu |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
835 |
#( |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
836 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
837 |
#label: 'Get Contents' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
838 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
839 |
#value: #fileGet |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
840 |
#enabled: #hasSelection |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
841 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
842 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
843 |
#label: 'Insert Contents' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
844 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
845 |
#value: #fileInsert |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
846 |
#enabled: #hasSelection |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
847 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
848 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
849 |
#label: '-' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
850 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
851 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
852 |
#label: 'Copy File List' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
853 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
854 |
#value: #copyFileList |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
855 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
856 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
857 |
#label: 'Copy Selected Filename' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
858 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
859 |
#value: #copySelectedFileName |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
860 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
861 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
862 |
#label: 'Copy Command History' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
863 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
864 |
#value: #copyCommandHistory |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
865 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
866 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
867 |
nil |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
868 |
nil |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
869 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
870 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
871 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
872 |
#label: 'View' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
873 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
874 |
#submenu: |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
875 |
#(#Menu |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
876 |
#( |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
877 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
878 |
#label: 'Details' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
879 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
880 |
#indication: #showingDetails |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
881 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
882 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
883 |
#label: 'Show Hidden Files' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
884 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
885 |
#indication: #showingHiddenFiles |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
886 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
887 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
888 |
#label: 'Big Image Preview' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
889 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
890 |
#indication: #showingBigImagePreview |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
891 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
892 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
893 |
#label: '-' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
894 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
895 |
#(#MenuItem |
2155 | 896 |
#label: 'Sort by Name' |
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
897 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
898 |
#choice: #sortByWhat |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
899 |
#choiceValue: #name |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
900 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
901 |
#(#MenuItem |
2155 | 902 |
#label: 'Sort by Type' |
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
903 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
904 |
#choice: #sortByWhat |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
905 |
#choiceValue: #type |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
906 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
907 |
#(#MenuItem |
2155 | 908 |
#label: 'Sort by Time' |
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
909 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
910 |
#choice: #sortByWhat |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
911 |
#choiceValue: #time |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
912 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
913 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
914 |
#label: 'Ignore Case' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
915 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
916 |
#enabled: #sortByName |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
917 |
#indication: #sortCaseless |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
918 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
919 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
920 |
#label: '-' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
921 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
922 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
923 |
#label: 'Update' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
924 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
925 |
#value: #updateCurrentDirectory |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
926 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
927 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
928 |
nil |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
929 |
nil |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
930 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
931 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
932 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
933 |
#label: 'Tools' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
934 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
935 |
#submenu: |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
936 |
#(#Menu |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
937 |
#( |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
938 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
939 |
#label: 'Unix Command' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
940 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
941 |
#isVisible: #systemIsUnix |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
942 |
#value: #menuOSCommand |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
943 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
944 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
945 |
#label: 'DOS Command' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
946 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
947 |
#isVisible: #systemIsDOS |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
948 |
#value: #menuOSCommand |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
949 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
950 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
951 |
#label: 'VMS Command' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
952 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
953 |
#isVisible: #systemIsVMS |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
954 |
#value: #menuOSCommand |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
955 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
956 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
957 |
#label: '-' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
958 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
959 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
960 |
#label: 'Changes Browser' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
961 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
962 |
#value: #openChangesBrowser |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
963 |
#enabled: #hasSelection |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
964 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
965 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
966 |
#label: 'Editor' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
967 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
968 |
#value: #openEditor |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
969 |
#enabled: #hasSelection |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
970 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
971 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
972 |
#label: 'HTML Reader' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
973 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
974 |
#value: #openHTMLReader |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
975 |
#enabled: #hasSelection |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
976 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
977 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
978 |
#label: 'Applet Viewer' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
979 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
980 |
#isVisible: #hasJava |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
981 |
#value: #openAppletViewer |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
982 |
#enabled: #hasJavaAndSelection |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
983 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
984 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
985 |
#label: 'Image Inspector' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
986 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
987 |
#value: #openImageInspector |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
988 |
#enabled: #hasSelection |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
989 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
990 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
991 |
#label: 'Image Preview' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
992 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
993 |
#value: #openImagePreview |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
994 |
#enabled: #hasSelection |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
995 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
996 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
997 |
#label: 'Image Editor' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
998 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
999 |
#value: #openImageEditor |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1000 |
#enabled: #hasSelection |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1001 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1002 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1003 |
#label: 'ZipFile Tool' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1004 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1005 |
#value: #openZipTool |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1006 |
#enabled: #hasZipFileSelected |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1007 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1008 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1009 |
#label: 'File Differences...' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1010 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1011 |
#value: #openDiffView |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1012 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1013 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1014 |
#label: 'Find Duplicate Files' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1015 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1016 |
#value: #fileFindDuplicates |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1017 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1018 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1019 |
#label: 'Find All Duplicate Files (recursive)' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1020 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1021 |
#value: #fileFindAllDuplicates |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1022 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1023 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1024 |
#label: 'Find a File...' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1025 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1026 |
#value: #fileFindFile |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1027 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1028 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1029 |
#label: 'Hex Dump' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1030 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1031 |
#value: #fileHexDump |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1032 |
#enabled: #hasSelection |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1033 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1034 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1035 |
#label: 'Shell Terminal' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1036 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1037 |
#isVisible: #canDoTerminal |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1038 |
#value: #openTerminal |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1039 |
#enabled: #canDoTerminal |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1040 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1041 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1042 |
nil |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1043 |
nil |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1044 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1045 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1046 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1047 |
#label: 'CVS' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1048 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1049 |
#submenu: |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1050 |
#(#Menu |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1051 |
#( |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1052 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1053 |
#label: 'Update selected files/directories' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1054 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1055 |
#value: #cvsUpdateSelection |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1056 |
#enabled: #hasSelection |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1057 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1058 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1059 |
#label: 'Update directory local' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1060 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1061 |
#value: #cvsUpdateDirectoryLocal |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1062 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1063 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1064 |
#label: 'Update directory recursive' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1065 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1066 |
#value: #cvsUpdateDirectoryRecursive |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1067 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1068 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1069 |
#label: '-' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1070 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1071 |
#(#MenuItem |
2145 | 1072 |
#label: 'Remove file && CVS Container...' |
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1073 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1074 |
#value: #cvsRemoveFileAndContainer |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1075 |
#enabled: #canRemoveCVSContainer |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1076 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1077 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1078 |
nil |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1079 |
nil |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1080 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1081 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1082 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1083 |
#label: 'Help' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1084 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1085 |
#startGroup: #right |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1086 |
#submenu: |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1087 |
#(#Menu |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1088 |
#( |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1089 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1090 |
#label: 'FileBrowser Documentation' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1091 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1092 |
#value: #openHTMLDocument: |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1093 |
#argument: 'tools/fbrowser/TOP.html' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1094 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1095 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1096 |
nil |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1097 |
nil |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1098 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1099 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1100 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1101 |
nil |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1102 |
nil |
1834 | 1103 |
) |
2129 | 1104 |
|
2155 | 1105 |
"Modified: / 8.5.1999 / 20:27:20 / cg" |
1834 | 1106 |
! ! |
1107 |
||
2094 | 1108 |
!FileBrowser class methodsFor:'queries'! |
1109 |
||
1110 |
isVisualStartable |
|
1111 |
"return true, if this application can be started via #open" |
|
1112 |
||
1113 |
^ true |
|
1114 |
||
1115 |
||
1116 |
! ! |
|
1117 |
||
1834 | 1118 |
!FileBrowser methodsFor:'aspects'! |
1119 |
||
1893
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
1120 |
canAddToClassPath |
1988 | 1121 |
^ [ |f sel| |
1893
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
1122 |
|
2138 | 1123 |
(Java isNil or:[Java isLoaded not]) ifTrue:[ |
1124 |
false |
|
1125 |
] ifFalse:[ |
|
1126 |
sel := fileListView selection. |
|
1127 |
sel size > 1 ifTrue:[ |
|
1128 |
false |
|
1129 |
] ifFalse:[ |
|
1130 |
sel size == 0 ifTrue:[ |
|
1131 |
f := currentDirectory asFilename |
|
1132 |
] ifFalse:[ |
|
1133 |
f := fileList at:sel first ifAbsent:nil. |
|
1134 |
f notNil ifTrue:[ |
|
1135 |
f := currentDirectory asFilename construct:f |
|
1136 |
]. |
|
1137 |
]. |
|
1138 |
f notNil |
|
1139 |
and:[(Java classPath includes:f pathName) not |
|
1140 |
and:[f isDirectory |
|
1141 |
or:[(f hasSuffix:'jar') |
|
1142 |
or:[(f hasSuffix:'zip')]]]]. |
|
1143 |
] |
|
1144 |
] |
|
1893
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
1145 |
] |
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
1146 |
|
1989 | 1147 |
"Modified: / 1.2.1999 / 20:38:42 / cg" |
1893
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
1148 |
! |
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
1149 |
|
2129 | 1150 |
canDoTerminal |
1151 |
^ OperatingSystem isUNIXlike |
|
1152 |
or:[OperatingSystem isMSWINDOWSlike] |
|
1153 |
||
1154 |
"Created: / 4.8.1998 / 13:37:13 / cg" |
|
1155 |
"Modified: / 28.4.1999 / 11:54:17 / cg" |
|
1156 |
! |
|
1157 |
||
2101 | 1158 |
canRemoveCVSContainer |
1159 |
^ [ |cvsDir| |
|
1160 |
||
2138 | 1161 |
currentDirectory notNil |
1162 |
and:[fileListView selection size > 0 |
|
1163 |
and:[(cvsDir := currentDirectory construct:'CVS') exists |
|
1164 |
and:[cvsDir isDirectory]]]] |
|
2101 | 1165 |
! |
1166 |
||
1893
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
1167 |
canRemoveToClassPath |
1988 | 1168 |
^ [ |f sel| |
1893
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
1169 |
|
2138 | 1170 |
(Java isNil or:[Java isLoaded not]) ifTrue:[ |
1171 |
false |
|
1172 |
] ifFalse:[ |
|
1173 |
sel := fileListView selection. |
|
1174 |
sel size > 1 ifTrue:[ |
|
1175 |
false |
|
1176 |
] ifFalse:[ |
|
1177 |
sel size == 0 ifTrue:[ |
|
1178 |
f := currentDirectory asFilename |
|
1179 |
] ifFalse:[ |
|
1180 |
f := fileList at:sel first ifAbsent:nil. |
|
1181 |
f notNil ifTrue:[ |
|
1182 |
f := currentDirectory asFilename construct:f |
|
1183 |
]. |
|
1184 |
]. |
|
1185 |
f notNil |
|
1186 |
and:[(Java classPath includes:f pathName) |
|
1187 |
and:[f isDirectory |
|
1188 |
or:[(f hasSuffix:'jar') |
|
1189 |
or:[(f hasSuffix:'zip')]]]] |
|
1190 |
] |
|
1191 |
] |
|
1893
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
1192 |
] |
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
1193 |
|
1989 | 1194 |
"Modified: / 1.2.1999 / 20:39:25 / cg" |
1893
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
1195 |
! |
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
1196 |
|
1834 | 1197 |
currentDirectoryIsNotTop |
1198 |
^ [currentDirectory notNil and:[currentDirectory isRootDirectory not]] |
|
1199 |
||
1200 |
"Modified: / 4.8.1998 / 14:10:57 / cg" |
|
1201 |
"Created: / 14.8.1998 / 12:07:10 / cg" |
|
1202 |
! |
|
1203 |
||
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1204 |
dosEOLMode |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1205 |
^ dosEOLMode |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1206 |
|
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1207 |
"Created: / 6.5.1999 / 11:37:25 / cg" |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1208 |
"Modified: / 6.5.1999 / 11:39:38 / cg" |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1209 |
! |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1210 |
|
1994 | 1211 |
hasFilenameSelectionInCodeView |
1212 |
^ [ |val sel| |
|
1213 |
||
2138 | 1214 |
val := false. |
1215 |
sel := subView selection. |
|
1216 |
sel notNil ifTrue:[ |
|
1217 |
sel := sel asString withoutSeparators. |
|
1218 |
sel asFilename exists ifTrue:[ |
|
1219 |
val := sel asFilename isReadable |
|
1220 |
] |
|
1221 |
]. |
|
1222 |
val |
|
1994 | 1223 |
] |
1224 |
||
1225 |
"Created: / 4.2.1999 / 17:34:57 / cg" |
|
1226 |
"Modified: / 4.2.1999 / 17:39:32 / cg" |
|
1227 |
! |
|
1228 |
||
1942 | 1229 |
hasJava |
1230 |
^ [ JavaClassReader notNil |
|
2138 | 1231 |
and:[JavaClassReader isLoaded]] |
1942 | 1232 |
|
1233 |
"Modified: / 17.10.1998 / 16:57:14 / cg" |
|
1234 |
"Created: / 17.10.1998 / 22:58:25 / cg" |
|
1235 |
! |
|
1236 |
||
1237 |
hasJavaAndSelection |
|
1238 |
^ [ fileListView selection size > 0 |
|
2138 | 1239 |
and:[JavaClassReader notNil |
1240 |
and:[JavaClassReader isLoaded]]] |
|
1942 | 1241 |
|
1242 |
"Modified: / 17.10.1998 / 16:57:14 / cg" |
|
1243 |
"Created: / 17.10.1998 / 22:58:03 / cg" |
|
1244 |
! |
|
1245 |
||
1834 | 1246 |
hasSelection |
1247 |
^ [fileListView selection size > 0] |
|
1248 |
||
1249 |
"Created: / 4.8.1998 / 14:10:31 / cg" |
|
1250 |
"Modified: / 4.8.1998 / 14:10:57 / cg" |
|
1251 |
! |
|
1252 |
||
1835 | 1253 |
hasVisitHistory |
1254 |
^ [DirectoryHistory size > 0] |
|
1255 |
||
1256 |
"Created: / 14.8.1998 / 19:17:02 / cg" |
|
1257 |
"Modified: / 14.8.1998 / 19:17:17 / cg" |
|
1258 |
! |
|
1259 |
||
1853 | 1260 |
hasZipFileSelected |
1988 | 1261 |
^ [|sel f fn suff| |
1262 |
||
2138 | 1263 |
sel := fileListView selection. |
1264 |
sel size == 1 ifTrue:[ |
|
1265 |
f := fileList at:sel first ifAbsent:nil. |
|
1266 |
f notNil ifTrue:[ |
|
1267 |
suff := f asFilename suffix asLowercase. |
|
1268 |
suff = 'zip' or:[suff = 'jar'] |
|
1269 |
] ifFalse:[ |
|
1270 |
false |
|
1271 |
] |
|
1272 |
] ifFalse:[ |
|
1273 |
false |
|
1274 |
] |
|
1853 | 1275 |
] |
1276 |
||
1277 |
"Created: / 26.8.1998 / 16:15:26 / cg" |
|
1988 | 1278 |
"Modified: / 30.1.1999 / 19:05:59 / cg" |
1853 | 1279 |
! |
1280 |
||
1893
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
1281 |
javaSupportLoaded |
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
1282 |
^ [ JavaClassReader notNil |
2138 | 1283 |
and:[JavaClassReader isLoaded]] |
1893
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
1284 |
|
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
1285 |
"Created: / 9.11.1998 / 05:33:17 / cg" |
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
1286 |
! |
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
1287 |
|
2031 | 1288 |
showingBigImagePreview |
1289 |
^ showingBigImagePreview |
|
1290 |
||
1291 |
"Created: / 14.8.1998 / 14:15:44 / cg" |
|
1292 |
! |
|
1293 |
||
1834 | 1294 |
showingDetails |
1295 |
^ showingDetails |
|
1296 |
||
1297 |
"Created: / 14.8.1998 / 14:15:15 / cg" |
|
1298 |
! |
|
1299 |
||
1300 |
showingHiddenFiles |
|
1301 |
^ showingHiddenFiles |
|
1302 |
||
1303 |
"Created: / 14.8.1998 / 14:15:44 / cg" |
|
1304 |
! |
|
1305 |
||
1306 |
sortByWhat |
|
1307 |
^ sortByWhat |
|
1308 |
||
1309 |
"Created: / 14.8.1998 / 15:55:18 / cg" |
|
1310 |
"Modified: / 14.8.1998 / 15:56:08 / cg" |
|
1311 |
! |
|
1312 |
||
1313 |
sortCaseless |
|
1314 |
^ sortCaseless |
|
1315 |
||
1316 |
"Created: / 14.8.1998 / 14:21:21 / cg" |
|
1317 |
! |
|
1318 |
||
1319 |
systemIsDOS |
|
1320 |
^ OperatingSystem isMSDOSlike |
|
1321 |
||
1322 |
"Created: / 4.8.1998 / 13:37:28 / cg" |
|
1323 |
! |
|
1324 |
||
1325 |
systemIsUnix |
|
1326 |
^ OperatingSystem isUNIXlike |
|
1327 |
||
1328 |
"Created: / 4.8.1998 / 13:37:13 / cg" |
|
1329 |
! |
|
1330 |
||
1331 |
systemIsVMS |
|
1332 |
^ OperatingSystem isVMSlike |
|
1333 |
||
1334 |
"Created: / 4.8.1998 / 13:37:37 / cg" |
|
1335 |
! ! |
|
1336 |
||
1119 | 1337 |
!FileBrowser methodsFor:'drag & drop'! |
172 | 1338 |
|
1132
bd2eda432e1d
drop arg is always a collection
Claus Gittinger <cg@exept.de>
parents:
1124
diff
changeset
|
1339 |
canDrop:aCollectionOfDropObjects |
1119 | 1340 |
"I accept fileObjects only" |
1341 |
||
1132
bd2eda432e1d
drop arg is always a collection
Claus Gittinger <cg@exept.de>
parents:
1124
diff
changeset
|
1342 |
aCollectionOfDropObjects do:[:aDropObject | |
1317 | 1343 |
aDropObject isFileObject ifFalse:[ |
1344 |
aDropObject isTextObject ifFalse:[^ false]. |
|
1345 |
] |
|
1122
970fc7e88639
support drag out of my list.
Claus Gittinger <cg@exept.de>
parents:
1120
diff
changeset
|
1346 |
]. |
1132
bd2eda432e1d
drop arg is always a collection
Claus Gittinger <cg@exept.de>
parents:
1124
diff
changeset
|
1347 |
^ true |
bd2eda432e1d
drop arg is always a collection
Claus Gittinger <cg@exept.de>
parents:
1124
diff
changeset
|
1348 |
|
bd2eda432e1d
drop arg is always a collection
Claus Gittinger <cg@exept.de>
parents:
1124
diff
changeset
|
1349 |
"Modified: 11.4.1997 / 12:41:59 / cg" |
1118 | 1350 |
! |
1351 |
||
1132
bd2eda432e1d
drop arg is always a collection
Claus Gittinger <cg@exept.de>
parents:
1124
diff
changeset
|
1352 |
drop:aCollectionOfDropObjects at:aPoint |
1122
970fc7e88639
support drag out of my list.
Claus Gittinger <cg@exept.de>
parents:
1120
diff
changeset
|
1353 |
"handle drops" |
970fc7e88639
support drag out of my list.
Claus Gittinger <cg@exept.de>
parents:
1120
diff
changeset
|
1354 |
|
1132
bd2eda432e1d
drop arg is always a collection
Claus Gittinger <cg@exept.de>
parents:
1124
diff
changeset
|
1355 |
aCollectionOfDropObjects do:[:aDropObject | |
1317 | 1356 |
self dropSingleObject:aDropObject at:aPoint |
1132
bd2eda432e1d
drop arg is always a collection
Claus Gittinger <cg@exept.de>
parents:
1124
diff
changeset
|
1357 |
] |
bd2eda432e1d
drop arg is always a collection
Claus Gittinger <cg@exept.de>
parents:
1124
diff
changeset
|
1358 |
|
bd2eda432e1d
drop arg is always a collection
Claus Gittinger <cg@exept.de>
parents:
1124
diff
changeset
|
1359 |
"Modified: 11.4.1997 / 12:43:36 / cg" |
1122
970fc7e88639
support drag out of my list.
Claus Gittinger <cg@exept.de>
parents:
1120
diff
changeset
|
1360 |
! |
970fc7e88639
support drag out of my list.
Claus Gittinger <cg@exept.de>
parents:
1120
diff
changeset
|
1361 |
|
970fc7e88639
support drag out of my list.
Claus Gittinger <cg@exept.de>
parents:
1120
diff
changeset
|
1362 |
dropSingleObject:someObject at:aPoint |
1119 | 1363 |
"handle drops; if its a directory, change to it. |
1124 | 1364 |
If its a file, change to its directory and select the file. |
1365 |
If its text, paste it into the codeView." |
|
1119 | 1366 |
|
1122
970fc7e88639
support drag out of my list.
Claus Gittinger <cg@exept.de>
parents:
1120
diff
changeset
|
1367 |
|newDir newFile| |
970fc7e88639
support drag out of my list.
Claus Gittinger <cg@exept.de>
parents:
1120
diff
changeset
|
1368 |
|
1124 | 1369 |
someObject isFileObject ifTrue:[ |
1317 | 1370 |
someObject isDirectory ifTrue:[ |
1371 |
newDir := someObject theObject pathName. |
|
1372 |
] ifFalse:[ |
|
1373 |
newDir := someObject theObject directoryName. |
|
1374 |
newFile := someObject theObject baseName. |
|
1375 |
]. |
|
1376 |
||
1377 |
newDir notNil ifTrue:[ |
|
1378 |
newDir ~= currentDirectory pathName ifTrue:[ |
|
1379 |
self changeDirectoryTo:newDir. |
|
1380 |
] |
|
1381 |
]. |
|
1382 |
newFile notNil ifTrue:[ |
|
1383 |
newFile ~= currentFileName ifTrue:[ |
|
1384 |
fileListView selection:(fileList indexOf:newFile). |
|
1385 |
self doFileGet:false. |
|
1386 |
] |
|
1387 |
]. |
|
1388 |
^ self |
|
1122
970fc7e88639
support drag out of my list.
Claus Gittinger <cg@exept.de>
parents:
1120
diff
changeset
|
1389 |
]. |
970fc7e88639
support drag out of my list.
Claus Gittinger <cg@exept.de>
parents:
1120
diff
changeset
|
1390 |
|
1124 | 1391 |
someObject isTextObject ifTrue:[ |
1317 | 1392 |
subView paste:someObject theObject. |
1393 |
^ self |
|
1118 | 1394 |
]. |
1124 | 1395 |
|
1396 |
"Modified: 6.4.1997 / 14:46:44 / cg" |
|
1119 | 1397 |
! ! |
1398 |
||
1399 |
!FileBrowser methodsFor:'events'! |
|
1118 | 1400 |
|
1010 | 1401 |
handlesKeyPress:key inView:view |
1402 |
"this method is reached via delegation: are we prepared to handle |
|
1403 |
a keyPress in some other view ?" |
|
1404 |
||
1396 | 1405 |
<resource: #keyboard (#GotoLine #InspectIt #CmdI #Cmdu #DoIt #Delete #BackSpace #Accept #CmdF #CmdD)> |
1010 | 1406 |
|
1407 |
view == fileListView ifTrue:[ |
|
1418 | 1408 |
(key == #Delete |
1409 |
or:[key == #BackSpace |
|
1410 |
or:[key == #Accept |
|
1411 |
or:[key == #CmdI |
|
1412 |
or:[key == #CmdF |
|
1413 |
or:[key == #CmdD |
|
1414 |
or:[key == #Cmdu |
|
1415 |
or:[key == #InspectIt |
|
1416 |
or:[key == #GotoLine |
|
1417 |
or:[key == #DoIt]]]]]]]]]) ifTrue:[^ true]. |
|
1010 | 1418 |
]. |
1419 |
^ false |
|
1420 |
||
1396 | 1421 |
"Created: / 28.1.1997 / 14:03:20 / stefan" |
1422 |
"Modified: / 20.6.1997 / 16:35:01 / cg" |
|
1423 |
"Modified: / 16.1.1998 / 16:50:39 / stefan" |
|
1010 | 1424 |
! |
1425 |
||
1426 |
keyPress:key x:x y:y view:view |
|
1427 |
"this method is reached via delegation from the fileListView" |
|
1428 |
||
1429 |
<resource: #keyboard (#GotoLine #InspectIt #CmdI #Cmdu #DoIt #Delete #BackSpace #Accept)> |
|
1430 |
||
1431 |
(key == #Delete or:[key == #BackSpace]) ifTrue:[ |
|
1418 | 1432 |
self fileRemove. |
1433 |
^ self |
|
1010 | 1434 |
]. |
1435 |
(key == #Accept) ifTrue:[ |
|
1418 | 1436 |
self fileFileIn. |
1437 |
^ self |
|
1010 | 1438 |
]. |
1439 |
(key == #GotoLine) ifTrue:[ |
|
1418 | 1440 |
self fileGet. |
1441 |
^ self |
|
1010 | 1442 |
]. |
1443 |
(key == #DoIt) ifTrue:[ |
|
1418 | 1444 |
self fileExecute. |
1445 |
^ self |
|
1010 | 1446 |
]. |
1447 |
(key == #InspectIt) ifTrue:[ |
|
1418 | 1448 |
self fileGetInfo. |
1449 |
^ self |
|
1010 | 1450 |
]. |
1451 |
(key == #CmdI) ifTrue:[ |
|
1418 | 1452 |
self fileGetLongInfo. |
1453 |
^ self |
|
1010 | 1454 |
]. |
1455 |
(key == #Cmdu) ifTrue:[ |
|
1418 | 1456 |
self updateCurrentDirectory. |
1457 |
^ self |
|
1396 | 1458 |
]. |
1459 |
(key == #CmdF) ifTrue:[ |
|
1418 | 1460 |
self newFile. |
1461 |
^ self |
|
1396 | 1462 |
]. |
1463 |
(key == #CmdD) ifTrue:[ |
|
1418 | 1464 |
self newDirectory. |
1465 |
^ self |
|
1010 | 1466 |
]. |
1467 |
fileListView keyPress:key x:x y:y |
|
1468 |
||
1396 | 1469 |
"Created: / 28.1.1997 / 14:03:56 / stefan" |
1470 |
"Modified: / 20.6.1997 / 16:35:08 / cg" |
|
1471 |
"Modified: / 16.1.1998 / 16:51:38 / stefan" |
|
1010 | 1472 |
! |
1473 |
||
172 | 1474 |
mapped |
1475 |
super mapped. |
|
1476 |
" |
|
1477 |
whant to know about changed history |
|
1478 |
" |
|
1479 |
self updateCurrentDirectory |
|
1480 |
! |
|
1481 |
||
1482 |
visibilityChange:how |
|
1483 |
|wasVisible| |
|
1484 |
||
1485 |
wasVisible := shown. |
|
1486 |
super visibilityChange:how. |
|
1487 |
(wasVisible not and:[shown]) ifTrue:[ |
|
1868 | 1488 |
" |
1489 |
start checking again |
|
1490 |
" |
|
1491 |
Processor removeTimedBlock:checkBlock. |
|
1492 |
Processor addTimedBlock:checkBlock afterSeconds:checkDelta. |
|
172 | 1493 |
] |
1481 | 1494 |
|
1495 |
"Modified: / 18.2.1998 / 17:57:44 / cg" |
|
172 | 1496 |
! ! |
1497 |
||
1498 |
!FileBrowser methodsFor:'fileList user interaction'! |
|
1499 |
||
2031 | 1500 |
bigImagePreviewSettingChanged |
1501 |
"invoked, when big image preview flag changed" |
|
1502 |
||
1503 |
|fh| |
|
1504 |
||
1505 |
(showingBigImagePreview value == true |
|
1506 |
and:[showingDetails value == true]) ifTrue:[ |
|
2138 | 1507 |
fh := fileListView font height. |
1508 |
fileListView lineSpacing:(34 - fh max:0). |
|
2031 | 1509 |
] ifFalse:[ |
2138 | 1510 |
fileListView clear. |
1511 |
self updateCurrentDirectory. |
|
1512 |
fileListView lineSpacing:2. |
|
2031 | 1513 |
]. |
1514 |
fileListView clear. |
|
1515 |
self updateCurrentDirectory |
|
1516 |
||
1517 |
"Modified: / 4.8.1998 / 13:43:54 / cg" |
|
1518 |
"Created: / 14.8.1998 / 14:17:49 / cg" |
|
1519 |
! |
|
1520 |
||
172 | 1521 |
changeDisplayMode |
1522 |
"toggle from long to short listing (and vice-versa)" |
|
1523 |
||
1834 | 1524 |
showingDetails value:(showingDetails value not). |
1525 |
"/ showLongList := showLongList not. |
|
1156
f3df28086973
dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents:
1154
diff
changeset
|
1526 |
self showOrHideTabView. |
172 | 1527 |
self updateCurrentDirectory |
747 | 1528 |
|
1834 | 1529 |
"Modified: / 4.8.1998 / 13:43:54 / cg" |
172 | 1530 |
! |
1531 |
||
1532 |
changeDotFileVisibility |
|
1533 |
"turn on/off visibility of files whose name starts with '.'" |
|
1534 |
||
1834 | 1535 |
showingHiddenFiles value:(showingHiddenFiles value not). |
1536 |
"/ showDotFiles := showDotFiles not. |
|
172 | 1537 |
self updateCurrentDirectory |
1834 | 1538 |
|
1539 |
"Modified: / 4.8.1998 / 13:45:46 / cg" |
|
1540 |
! |
|
1541 |
||
1542 |
detailsSettingChanged |
|
1543 |
"invoked, when detail (i.e. long / short) listing flag changed" |
|
1544 |
||
1545 |
self showOrHideTabView. |
|
2031 | 1546 |
self bigImagePreviewSettingChanged |
1834 | 1547 |
|
1548 |
"Modified: / 4.8.1998 / 13:43:54 / cg" |
|
1549 |
"Created: / 14.8.1998 / 14:17:49 / cg" |
|
172 | 1550 |
! |
1551 |
||
1327 | 1552 |
fileDoubleClick:lineNr |
1553 |
"double click on a file - get its contents" |
|
1554 |
||
1555 |
self fileSelect:lineNr. |
|
1556 |
self fileGet:true |
|
1557 |
! |
|
1558 |
||
386
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
1559 |
fileEncoding |
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
1560 |
"open a dialog to allow change of the files character encoding. |
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
1561 |
Files are converted to internal encoding when read, and converted back |
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
1562 |
to this encoding when saved. |
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
1563 |
The default encoding is nil, which means that files are already in |
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
1564 |
the internal encoding (which is iso8859). |
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
1565 |
Notice: currently, not too many encodings are supported by the system." |
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
1566 |
|
495
6d6a6b8feb2b
ask characterArray for encodings
Claus Gittinger <cg@exept.de>
parents:
488
diff
changeset
|
1567 |
|dialog list descr encodings encodingNames idx| |
386
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
1568 |
|
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
1569 |
list := SelectionInList new. |
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
1570 |
|
495
6d6a6b8feb2b
ask characterArray for encodings
Claus Gittinger <cg@exept.de>
parents:
488
diff
changeset
|
1571 |
descr := CharacterArray supportedExternalEncodings. |
6d6a6b8feb2b
ask characterArray for encodings
Claus Gittinger <cg@exept.de>
parents:
488
diff
changeset
|
1572 |
encodings := descr at:2. |
6d6a6b8feb2b
ask characterArray for encodings
Claus Gittinger <cg@exept.de>
parents:
488
diff
changeset
|
1573 |
encodingNames := descr at:1. |
6d6a6b8feb2b
ask characterArray for encodings
Claus Gittinger <cg@exept.de>
parents:
488
diff
changeset
|
1574 |
|
6d6a6b8feb2b
ask characterArray for encodings
Claus Gittinger <cg@exept.de>
parents:
488
diff
changeset
|
1575 |
list list:encodingNames. |
386
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
1576 |
list selectionIndex:(encodings indexOf:fileEncoding ifAbsent:1). |
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
1577 |
|
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
1578 |
dialog := Dialog new. |
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
1579 |
|
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
1580 |
dialog addTextLabel:(resources string:'ENCODING_MSG') withCRs. |
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
1581 |
dialog addVerticalSpace. |
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
1582 |
dialog addListBoxOn:list withNumberOfLines:5. |
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
1583 |
|
2048 | 1584 |
dialog addAbortAndOkButtons. |
386
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
1585 |
dialog open. |
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
1586 |
|
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
1587 |
dialog accepted ifTrue:[ |
2138 | 1588 |
idx := list selectionIndex. |
1589 |
fileEncoding := encodings at:idx. |
|
1590 |
subView externalEncoding:fileEncoding. |
|
1591 |
||
1592 |
self validateFontEncodingFor:fileEncoding ask:true. |
|
386
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
1593 |
]. |
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
1594 |
|
1219 | 1595 |
"Modified: 30.6.1997 / 14:41:12 / cg" |
386
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
1596 |
! |
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
1597 |
|
172 | 1598 |
fileExecute |
1599 |
"if text was modified show a queryBox, |
|
1600 |
otherwise pop up execute box immediately" |
|
1601 |
||
1142
9066d7d02a3a
remember last executed command per suffix; offer this as default.
Claus Gittinger <cg@exept.de>
parents:
1141
diff
changeset
|
1602 |
|action sel fileName| |
172 | 1603 |
|
1604 |
" |
|
1605 |
this replaces everything by the commands output ... |
|
1606 |
" |
|
865
48395e8ecca9
remember executeCommand actions in history as well.
Claus Gittinger <cg@exept.de>
parents:
851
diff
changeset
|
1607 |
action := [:command | |
1317 | 1608 |
self class addToCommandHistory:command for:fileName. |
1609 |
self doExecuteCommand:command replace:true |
|
1610 |
]. |
|
172 | 1611 |
|
1612 |
(self askIfModified:'contents has not been saved.\\Modifications will be lost when command is executed.' |
|
1317 | 1613 |
yesButton:'execute') ifFalse:[^ self]. |
172 | 1614 |
|
1615 |
"/ " |
|
1616 |
"/ this inserts the commands output ... |
|
1617 |
"/ " |
|
1618 |
"/ action := [:command| self doExecuteCommand:command replace:false]. |
|
1619 |
"/ |
|
1142
9066d7d02a3a
remember last executed command per suffix; offer this as default.
Claus Gittinger <cg@exept.de>
parents:
1141
diff
changeset
|
1620 |
|
9066d7d02a3a
remember last executed command per suffix; offer this as default.
Claus Gittinger <cg@exept.de>
parents:
1141
diff
changeset
|
1621 |
sel := fileListView selection. |
9066d7d02a3a
remember last executed command per suffix; offer this as default.
Claus Gittinger <cg@exept.de>
parents:
1141
diff
changeset
|
1622 |
sel size == 1 ifTrue:[ |
1317 | 1623 |
fileName := fileList at:sel first |
1142
9066d7d02a3a
remember last executed command per suffix; offer this as default.
Claus Gittinger <cg@exept.de>
parents:
1141
diff
changeset
|
1624 |
]. |
9066d7d02a3a
remember last executed command per suffix; offer this as default.
Claus Gittinger <cg@exept.de>
parents:
1141
diff
changeset
|
1625 |
self askForCommandFor:fileName thenDo:action |
865
48395e8ecca9
remember executeCommand actions in history as well.
Claus Gittinger <cg@exept.de>
parents:
851
diff
changeset
|
1626 |
|
48395e8ecca9
remember executeCommand actions in history as well.
Claus Gittinger <cg@exept.de>
parents:
851
diff
changeset
|
1627 |
"Modified: 14.11.1996 / 14:59:34 / cg" |
172 | 1628 |
! |
1629 |
||
1630 |
fileFileIn |
|
1631 |
"fileIn the selected file(s)" |
|
1632 |
||
1633 |
self fileFileInLazy:false |
|
1634 |
! |
|
1635 |
||
1636 |
fileFileInLazy |
|
1637 |
"fileIn the selected file(s). Do a quick load (no compilation)" |
|
1638 |
||
1639 |
self fileFileInLazy:true |
|
1640 |
! |
|
1641 |
||
1642 |
fileFileInLazy:lazy |
|
1643 |
"fileIn the selected file(s)" |
|
1644 |
||
1702
962056a31c06
remember the current file during fileIn,
Claus Gittinger <cg@exept.de>
parents:
1700
diff
changeset
|
1645 |
|aStream path oldPath wasLazy bos prevCurrentFileName| |
172 | 1646 |
|
1647 |
self selectedFilesDo:[:fileName | |
|
1868 | 1648 |
path := currentDirectory filenameFor:fileName. |
1649 |
path type == #regular ifTrue:[ |
|
1650 |
prevCurrentFileName := currentFileInFileName. |
|
1651 |
currentFileInFileName := fileName. |
|
1652 |
||
1653 |
(ObjectFileLoader notNil |
|
1654 |
and:[ObjectFileLoader hasValidBinaryExtension:fileName]) ifTrue:[ |
|
1655 |
Object abortSignal catch:[ |
|
1656 |
|p| |
|
1657 |
||
1658 |
"/ |
|
1659 |
"/ look if already loaded ... then unload first |
|
1660 |
"/ |
|
1661 |
p := path pathName. |
|
1662 |
(ObjectFileLoader loadedObjectFiles includes:p) ifTrue:[ |
|
1663 |
(Dialog confirm:(resources |
|
1664 |
string:'%1 is already loaded; load anyway ?' |
|
1665 |
with:p)) ifFalse:[ |
|
1666 |
^ self |
|
1667 |
]. |
|
1668 |
Transcript showCR:'unloading old ' , p , ' ...'. |
|
1669 |
ObjectFileLoader unloadObjectFile:p. |
|
1670 |
]. |
|
1671 |
||
1672 |
Transcript showCR:'loading ' , p , ' ...'. |
|
1673 |
ObjectFileLoader loadObjectFile:p. |
|
1674 |
Class addInfoRecord:('fileIn ' , fileName) |
|
1675 |
] |
|
1676 |
] ifFalse:[ |
|
1677 |
(path hasSuffix:'cls') ifTrue:[ |
|
1678 |
aStream := path readStream. |
|
1679 |
aStream notNil ifTrue:[ |
|
1680 |
bos := BinaryObjectStorage onOld:aStream. |
|
1681 |
Class nameSpaceQuerySignal |
|
1682 |
answer:Smalltalk |
|
1683 |
do:[ |
|
1684 |
bos next. |
|
1685 |
]. |
|
1686 |
bos close |
|
1687 |
] |
|
1688 |
] ifFalse:[ |
|
1689 |
((path hasSuffix:'class') |
|
1690 |
or:[(path hasSuffix:'cla')]) ifTrue:[ |
|
1691 |
JavaClassReader notNil ifTrue:[ |
|
1692 |
JavaClassReader loadFile:(path pathName) |
|
1693 |
] |
|
1694 |
] ifFalse:[ |
|
1695 |
aStream := path readStream. |
|
1696 |
aStream notNil ifTrue:[ |
|
1697 |
[ |
|
1698 |
Class withoutUpdatingChangesDo:[ |
|
1699 |
oldPath := Smalltalk systemPath. |
|
1700 |
Smalltalk systemPath:(oldPath copy addFirst:currentDirectory pathName; yourself). |
|
1701 |
wasLazy := Compiler compileLazy:lazy. |
|
1702 |
aStream fileIn. |
|
1703 |
]. |
|
1704 |
Class addInfoRecord:('fileIn ' , fileName) |
|
1705 |
] valueNowOrOnUnwindDo:[ |
|
1706 |
Compiler compileLazy:wasLazy. |
|
1707 |
Smalltalk systemPath:oldPath. |
|
1708 |
aStream close |
|
1709 |
] |
|
1710 |
] |
|
1711 |
] |
|
1712 |
] |
|
1713 |
] |
|
1714 |
]. |
|
1715 |
currentFileInFileName := prevCurrentFileName |
|
172 | 1716 |
] |
1717 |
||
1702
962056a31c06
remember the current file during fileIn,
Claus Gittinger <cg@exept.de>
parents:
1700
diff
changeset
|
1718 |
"Modified: / 19.9.1997 / 23:42:22 / stefan" |
962056a31c06
remember the current file during fileIn,
Claus Gittinger <cg@exept.de>
parents:
1700
diff
changeset
|
1719 |
"Modified: / 18.6.1998 / 15:30:38 / cg" |
172 | 1720 |
! |
1721 |
||
1972 | 1722 |
fileFindAllDuplicates |
1723 |
"scan directory and all subdirs for duplicate files" |
|
1724 |
||
1725 |
|fileNames dir infoDir filesBySize |
|
1726 |
result info dirPrefix| |
|
1727 |
||
1728 |
(self askIfModified:'contents has not been saved.\\Modifications will be lost when you proceed.' |
|
2138 | 1729 |
yesButton:'proceed') ifFalse:[^ self]. |
1972 | 1730 |
|
1731 |
self withWaitCursorDo:[ |
|
2138 | 1732 |
result := Dictionary new. |
1733 |
||
1734 |
dir := currentDirectory asFilename. |
|
1735 |
self label:myName , '- gathering file names ...'. |
|
1736 |
fileNames := dir recursiveDirectoryContents. |
|
1737 |
fileNames := fileNames collect:[:fn | dir construct:fn]. |
|
1738 |
fileNames := fileNames select:[:fn | fn isDirectory not]. |
|
1739 |
||
1740 |
self label:myName , '- gathering sizes ...'. |
|
1741 |
infoDir := Dictionary new. |
|
1742 |
fileNames do:[:fn | |
|
1743 |
infoDir at:fn put:(fn fileSize) |
|
1744 |
]. |
|
1745 |
||
1746 |
"/ for each, get the files size. |
|
1747 |
"/ in a first pass, look for files of the same size and |
|
1748 |
"/ compare them ... |
|
1749 |
||
1750 |
self label:myName , '- preselect possible duplicates ...'. |
|
1751 |
filesBySize := Dictionary new. |
|
1752 |
infoDir keysAndValuesDo:[:fn :sz | |
|
1753 |
|entry| |
|
1754 |
||
1755 |
entry := filesBySize at:sz ifAbsentPut:[Set new]. |
|
1756 |
entry add:fn. |
|
1757 |
]. |
|
1758 |
||
1759 |
"/ any of same size ? |
|
1760 |
||
1761 |
self label:myName , '- checking for duplicates ...'. |
|
1762 |
filesBySize do:[:entry | |
|
1763 |
|files| |
|
1764 |
||
1765 |
entry size > 1 ifTrue:[ |
|
1766 |
files := entry asArray. |
|
1767 |
1 to:files size-1 do:[:idx1 | |
|
1768 |
idx1+1 to:files size do:[:idx2 | |
|
1769 |
|fn1 fn2| |
|
1770 |
||
1771 |
fn1 := files at:idx1. |
|
1772 |
fn2 := files at:idx2. |
|
1972 | 1773 |
|
1774 |
"/ self label:myName , '- checking ' , fn1 baseName , ' vs. ' , fn2 baseName , ' ...'. |
|
2138 | 1775 |
(result at:fn2 ifAbsent:nil) ~= fn1 ifTrue:[ |
1776 |
"/ compare the files |
|
1777 |
(fn1 sameContentsAs:fn2) ifTrue:[ |
|
1972 | 1778 |
"/ Transcript show:'Same: '; show:fn1 baseName; show:' and '; showCR:fn2 baseName. |
2138 | 1779 |
result at:fn1 put:fn2. |
1780 |
] |
|
1781 |
] |
|
1782 |
] |
|
1783 |
] |
|
1784 |
] |
|
1785 |
]. |
|
1786 |
||
1787 |
self label:myName , '- sorting ...'. |
|
1788 |
dirPrefix := currentDirectory asFilename pathName. |
|
1789 |
result := result associations. |
|
1790 |
result := result collect:[:assoc | |
|
1791 |
|f1 f2| |
|
1792 |
||
1793 |
f1 := assoc key name. |
|
1794 |
f2 := assoc value name. |
|
1795 |
(f1 startsWith:dirPrefix) ifTrue:[ |
|
1796 |
f1 := f1 copyFrom:dirPrefix size + 2. |
|
1797 |
]. |
|
1798 |
(f2 startsWith:dirPrefix) ifTrue:[ |
|
1799 |
f2 := f2 copyFrom:dirPrefix size + 2. |
|
1800 |
]. |
|
1801 |
f1 < f2 ifTrue:[ |
|
1802 |
f2 -> f1 |
|
1803 |
] ifFalse:[ |
|
1804 |
f1 -> f2 |
|
1805 |
] |
|
1806 |
]. |
|
1807 |
result sort:[:f1 :f2 | f2 value < f1 value]. |
|
1808 |
||
1809 |
info := OrderedCollection new. |
|
1810 |
result do:[:assoc | |
|
1811 |
info add:(assoc key , ' same as ' , assoc value) |
|
1812 |
]. |
|
1813 |
info isEmpty ifTrue:[ |
|
1814 |
info := 'No duplicate files found.' |
|
1815 |
]. |
|
1972 | 1816 |
]. |
1817 |
||
1818 |
subView contents:info. |
|
1819 |
self label:myName. |
|
1820 |
||
1821 |
"Created: / 28.11.1998 / 17:47:53 / cg" |
|
1822 |
"Modified: / 10.12.1998 / 17:13:14 / cg" |
|
1823 |
! |
|
1824 |
||
1911
6d1b77eda98f
check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents:
1903
diff
changeset
|
1825 |
fileFindDuplicates |
6d1b77eda98f
check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents:
1903
diff
changeset
|
1826 |
"scan directory for duplicate files" |
6d1b77eda98f
check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents:
1903
diff
changeset
|
1827 |
|
6d1b77eda98f
check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents:
1903
diff
changeset
|
1828 |
|fileNames dir infoDir filesBySize |
6d1b77eda98f
check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents:
1903
diff
changeset
|
1829 |
result info| |
6d1b77eda98f
check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents:
1903
diff
changeset
|
1830 |
|
6d1b77eda98f
check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents:
1903
diff
changeset
|
1831 |
(self askIfModified:'contents has not been saved.\\Modifications will be lost when you proceed.' |
2138 | 1832 |
yesButton:'proceed') ifFalse:[^ self]. |
1911
6d1b77eda98f
check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents:
1903
diff
changeset
|
1833 |
|
6d1b77eda98f
check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents:
1903
diff
changeset
|
1834 |
self withWaitCursorDo:[ |
2138 | 1835 |
result := Dictionary new. |
1836 |
||
1837 |
dir := currentDirectory asFilename. |
|
1838 |
fileNames := dir directoryContents. |
|
1839 |
fileNames := fileNames collect:[:fn | dir construct:fn]. |
|
1840 |
fileNames := fileNames select:[:fn | fn isDirectory not]. |
|
1841 |
||
1842 |
infoDir := Dictionary new. |
|
1843 |
fileNames do:[:fn | |
|
1844 |
infoDir at:fn put:(fn info) |
|
1845 |
]. |
|
1846 |
||
1847 |
"/ for each, get the files size. |
|
1848 |
"/ in a first pass, look for files of the same size and |
|
1849 |
"/ compare them ... |
|
1850 |
||
1851 |
filesBySize := Dictionary new. |
|
1852 |
infoDir keysAndValuesDo:[:fn :info | |
|
1853 |
|sz entry| |
|
1854 |
||
1855 |
sz := info size. |
|
1856 |
entry := filesBySize at:sz ifAbsentPut:[Set new]. |
|
1857 |
entry add:fn. |
|
1858 |
]. |
|
1859 |
||
1860 |
"/ any of same size ? |
|
1861 |
||
1862 |
filesBySize do:[:entry | |
|
1863 |
|files| |
|
1864 |
||
1865 |
entry size > 1 ifTrue:[ |
|
1866 |
files := entry asArray. |
|
1867 |
1 to:files size-1 do:[:idx1 | |
|
1868 |
idx1+1 to:files size do:[:idx2 | |
|
1869 |
|fn1 fn2| |
|
1870 |
||
1871 |
fn1 := files at:idx1. |
|
1872 |
fn2 := files at:idx2. |
|
1873 |
||
1874 |
(result at:fn2 ifAbsent:nil) ~= fn1 ifTrue:[ |
|
1875 |
"/ compare the files |
|
1876 |
(fn1 sameContentsAs:fn2) ifTrue:[ |
|
1911
6d1b77eda98f
check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents:
1903
diff
changeset
|
1877 |
"/ Transcript show:'Same: '; show:fn1 baseName; show:' and '; showCR:fn2 baseName. |
2138 | 1878 |
result at:fn1 put:fn2. |
1879 |
] |
|
1880 |
] |
|
1881 |
] |
|
1882 |
] |
|
1883 |
] |
|
1884 |
]. |
|
1885 |
||
1886 |
result := result associations. |
|
1887 |
result := result collect:[:assoc | |
|
1888 |
|f1 f2| |
|
1889 |
||
1890 |
f1 := assoc key baseName. |
|
1891 |
f2 := assoc value baseName. |
|
1892 |
f1 < f2 ifTrue:[ |
|
1893 |
f2 -> f1 |
|
1894 |
] ifFalse:[ |
|
1895 |
f1 -> f2 |
|
1896 |
] |
|
1897 |
]. |
|
1898 |
result sort:[:f1 :f2 | f2 value < f1 value]. |
|
1899 |
||
1900 |
info := OrderedCollection new. |
|
1901 |
result do:[:assoc | |
|
1902 |
info add:(assoc key , ' same as ' , assoc value) |
|
1903 |
]. |
|
1904 |
info isEmpty ifTrue:[ |
|
1905 |
info := 'No duplicate files found.' |
|
1906 |
]. |
|
1911
6d1b77eda98f
check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents:
1903
diff
changeset
|
1907 |
]. |
6d1b77eda98f
check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents:
1903
diff
changeset
|
1908 |
|
6d1b77eda98f
check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents:
1903
diff
changeset
|
1909 |
subView contents:info |
6d1b77eda98f
check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents:
1903
diff
changeset
|
1910 |
|
6d1b77eda98f
check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents:
1903
diff
changeset
|
1911 |
"Created: / 3.10.1998 / 17:59:00 / cg" |
1912 | 1912 |
"Modified: / 3.10.1998 / 19:29:19 / cg" |
1911
6d1b77eda98f
check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents:
1903
diff
changeset
|
1913 |
! |
6d1b77eda98f
check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents:
1903
diff
changeset
|
1914 |
|
1933 | 1915 |
fileFindFile |
1965 | 1916 |
|sel bindings |
1933 | 1917 |
namePatternHolder contentsPatternHolder |
1918 |
ignoreCaseInName ignoreCaseInContents |
|
2166
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
1919 |
namePattern namePatterns contentsPattern |
1965 | 1920 |
searchForSameContentsEnabled searchForSameContents| |
1933 | 1921 |
|
1922 |
(self askIfModified:'contents has not been saved.\\Modifications will be lost when you proceed.' |
|
2166
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
1923 |
yesButton:'proceed') ifFalse:[^ self]. |
1933 | 1924 |
|
1925 |
subView contents:nil; scrollToTop. |
|
1926 |
||
1927 |
bindings := IdentityDictionary new. |
|
1928 |
bindings at:#namePatternHolder put:(namePatternHolder := '' asValue). |
|
1929 |
bindings at:#contentsPatternHolder put:(contentsPatternHolder := '' asValue). |
|
1930 |
bindings at:#ignoreCaseInName put:(ignoreCaseInName := false asValue). |
|
1931 |
bindings at:#ignoreCaseInContents put:(ignoreCaseInContents := false asValue). |
|
1932 |
||
1965 | 1933 |
searchForSameContentsEnabled := false. |
1934 |
sel := fileListView selectionValue. |
|
1935 |
sel size == 1 ifTrue:[ |
|
2166
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
1936 |
searchForSameContentsEnabled := true. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
1937 |
sel := sel first string withoutSeparators |
1965 | 1938 |
]. |
1939 |
bindings at:#searchForSameContentsEnabled put:(searchForSameContentsEnabled := searchForSameContentsEnabled asValue). |
|
1940 |
bindings at:#searchForSameContents put:(searchForSameContents := false asValue). |
|
1941 |
bindings at:#notSearchForSameContents put:(BlockValue forLogicalNot:searchForSameContents). |
|
1942 |
||
1943 |
||
1933 | 1944 |
(SimpleDialog new |
2166
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
1945 |
openFor:self |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
1946 |
interfaceSpec:(self class fileSearchDialogSpec) |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
1947 |
withBindings:bindings) ifTrue:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
1948 |
|
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
1949 |
namePattern := namePatternHolder value. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
1950 |
namePattern size == 0 ifTrue:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
1951 |
namePatterns := nil |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
1952 |
] ifFalse:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
1953 |
ignoreCaseInName value ifTrue:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
1954 |
namePattern := namePattern asLowercase |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
1955 |
]. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
1956 |
namePatterns := namePattern asCollectionOfSubstringsSeparatedBy:$; |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
1957 |
]. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
1958 |
contentsPattern := contentsPatternHolder value. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
1959 |
contentsPattern size == 0 ifTrue:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
1960 |
contentsPattern := nil |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
1961 |
] ifFalse:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
1962 |
ignoreCaseInContents value ifTrue:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
1963 |
contentsPattern := contentsPattern asLowercase |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
1964 |
] |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
1965 |
]. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
1966 |
|
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
1967 |
self withWaitCursorDo:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
1968 |
|stopSignal access myProcess lowerFrameView| |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
1969 |
|
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
1970 |
myProcess := Processor activeProcess. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
1971 |
|
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
1972 |
access := Semaphore forMutualExclusion name:'accessLock'. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
1973 |
stopSignal := Signal new. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
1974 |
|
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
1975 |
" |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
1976 |
The following is tricky: |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
1977 |
the pauseToggle & killButton will |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
1978 |
be handled by their own windowGroup process. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
1979 |
This means, that they respond to events even though |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
1980 |
I myself am reading the commands output. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
1981 |
" |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
1982 |
|
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
1983 |
commandView beInvisible. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
1984 |
|
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
1985 |
" |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
1986 |
must take kill & pauseButtons out of my group |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
1987 |
" |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
1988 |
killButton windowGroup:nil. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
1989 |
|
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
1990 |
" |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
1991 |
bring them to front, and turn hidden-mode off |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
1992 |
" |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
1993 |
killButton label:(resources string:'stop'). |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
1994 |
killButton raise; beVisible. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
1995 |
|
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
1996 |
" |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
1997 |
kill will make me raise the stopSignal when pressed |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
1998 |
" |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
1999 |
killButton |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2000 |
action:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2001 |
access critical:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2002 |
myProcess interruptWith:[stopSignal raiseRequest]. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2003 |
] |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2004 |
]. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2005 |
|
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2006 |
" |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2007 |
start kill button under its own windowgroup |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2008 |
" |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2009 |
killButton openAutonomous. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2010 |
killButton windowGroup process processGroupId:(Processor activeProcess id). |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2011 |
|
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2012 |
lowerFrameView := subView superView. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2013 |
|
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2014 |
[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2015 |
stopSignal catch:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2016 |
searchForSameContents value ifTrue:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2017 |
self |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2018 |
doFindFileNamed:namePatterns |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2019 |
ignoreCase:ignoreCaseInName value |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2020 |
containingString:nil |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2021 |
ignoreCaseInContents:ignoreCaseInContents value |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2022 |
sameContentsAsFile:(currentDirectory asFilename construct:sel) |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2023 |
sameContentsAs:nil |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2024 |
in:currentDirectory. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2025 |
] ifFalse:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2026 |
(contentsPattern size > 0 or:[namePatterns size > 0]) ifTrue:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2027 |
self |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2028 |
doFindFileNamed:namePatterns |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2029 |
ignoreCase:ignoreCaseInName value |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2030 |
containingString:contentsPattern |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2031 |
ignoreCaseInContents:ignoreCaseInContents value |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2032 |
sameContentsAsFile:nil |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2033 |
sameContentsAs:nil |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2034 |
in:currentDirectory. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2035 |
] |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2036 |
] |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2037 |
] |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2038 |
] valueNowOrOnUnwindDo:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2039 |
|wg| |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2040 |
|
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2041 |
self label:myName; iconLabel:myName. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2042 |
|
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2043 |
" |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2044 |
hide the button, and make sure it will stay |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2045 |
hidden when we are realized again |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2046 |
" |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2047 |
killButton beInvisible. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2048 |
|
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2049 |
commandView beVisible. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2050 |
|
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2051 |
" |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2052 |
remove the killButton from its group |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2053 |
(otherwise, it will be destroyed when we shut down the group) |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2054 |
" |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2055 |
wg := killButton windowGroup. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2056 |
killButton windowGroup:nil. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2057 |
|
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2058 |
" |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2059 |
shut down the kill buttons windowgroup |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2060 |
" |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2061 |
wg notNil ifTrue:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2062 |
wg process terminate. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2063 |
]. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2064 |
" |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2065 |
clear its action (actually not needed, but |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2066 |
releases reference to thisContext earlier) |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2067 |
" |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2068 |
killButton action:nil. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2069 |
killButton label:(resources string:'kill'). |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2070 |
|
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2071 |
"/ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2072 |
"/ allow interaction with the codeView |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2073 |
"/ (bring it back into my group) |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2074 |
"/ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2075 |
lowerFrameView windowGroup:(self windowGroup). |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2076 |
]. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2077 |
|
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2078 |
]. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2079 |
self label:myName. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2080 |
currentFileName isNil ifTrue:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2081 |
subView modified:false. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2082 |
]. |
1933 | 2083 |
]. |
2084 |
||
2085 |
"Created: / 15.10.1998 / 11:32:57 / cg" |
|
2086 |
"Modified: / 15.10.1998 / 12:41:09 / cg" |
|
2087 |
! |
|
2088 |
||
172 | 2089 |
fileGet |
2090 |
"get contents of selected file into subView. |
|
2091 |
If text was modified show a queryBox, |
|
2092 |
otherwise get it immediately" |
|
2093 |
||
633
4630175ed31e
double click on .htm / .html files open a viewer;
Claus Gittinger <cg@exept.de>
parents:
585
diff
changeset
|
2094 |
self fileGet:false |
4630175ed31e
double click on .htm / .html files open a viewer;
Claus Gittinger <cg@exept.de>
parents:
585
diff
changeset
|
2095 |
|
4630175ed31e
double click on .htm / .html files open a viewer;
Claus Gittinger <cg@exept.de>
parents:
585
diff
changeset
|
2096 |
"Modified: 19.6.1996 / 09:38:45 / cg" |
4630175ed31e
double click on .htm / .html files open a viewer;
Claus Gittinger <cg@exept.de>
parents:
585
diff
changeset
|
2097 |
! |
4630175ed31e
double click on .htm / .html files open a viewer;
Claus Gittinger <cg@exept.de>
parents:
585
diff
changeset
|
2098 |
|
4630175ed31e
double click on .htm / .html files open a viewer;
Claus Gittinger <cg@exept.de>
parents:
585
diff
changeset
|
2099 |
fileGet:viaDoubleClick |
4630175ed31e
double click on .htm / .html files open a viewer;
Claus Gittinger <cg@exept.de>
parents:
585
diff
changeset
|
2100 |
"get contents of selected file into subView. |
4630175ed31e
double click on .htm / .html files open a viewer;
Claus Gittinger <cg@exept.de>
parents:
585
diff
changeset
|
2101 |
If text was modified show a queryBox, |
4630175ed31e
double click on .htm / .html files open a viewer;
Claus Gittinger <cg@exept.de>
parents:
585
diff
changeset
|
2102 |
otherwise get it immediately" |
4630175ed31e
double click on .htm / .html files open a viewer;
Claus Gittinger <cg@exept.de>
parents:
585
diff
changeset
|
2103 |
|
172 | 2104 |
|fileName msg label| |
2105 |
||
1110
9ec4692e9cda
dont decode string, if the encoding is already iso8859
Claus Gittinger <cg@exept.de>
parents:
1104
diff
changeset
|
2106 |
(subView modified not or:[subView contentsWasSaved]) ifTrue:[ |
1329 | 2107 |
self doFileGet:viaDoubleClick. |
2108 |
^ self |
|
1110
9ec4692e9cda
dont decode string, if the encoding is already iso8859
Claus Gittinger <cg@exept.de>
parents:
1104
diff
changeset
|
2109 |
]. |
172 | 2110 |
fileName := self getSelectedFileName. |
2111 |
fileName notNil ifTrue:[ |
|
1329 | 2112 |
(currentDirectory filenameFor:fileName) isDirectory ifTrue:[ |
2113 |
msg := 'contents has not been saved.\\Modifications will be lost when directory is changed.'. |
|
2114 |
label := 'change'. |
|
2115 |
] ifFalse:[ |
|
2116 |
msg := 'contents has not been saved.\\Modifications will be lost when new file is read.'. |
|
2117 |
label := 'get'. |
|
2118 |
]. |
|
2119 |
(self ask:(resources at:msg) yesButton:label) ifTrue:[ |
|
2120 |
subView modified:false. |
|
2121 |
self doFileGet:viaDoubleClick |
|
2122 |
] |
|
172 | 2123 |
] |
633
4630175ed31e
double click on .htm / .html files open a viewer;
Claus Gittinger <cg@exept.de>
parents:
585
diff
changeset
|
2124 |
|
4630175ed31e
double click on .htm / .html files open a viewer;
Claus Gittinger <cg@exept.de>
parents:
585
diff
changeset
|
2125 |
"Created: 19.6.1996 / 09:38:35 / cg" |
1162 | 2126 |
"Modified: 23.4.1997 / 13:04:11 / cg" |
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
2127 |
"Modified: 18.9.1997 / 16:27:34 / stefan" |
172 | 2128 |
! |
2129 |
||
2130 |
fileGetInfo |
|
2131 |
"show short file (stat)-info" |
|
2132 |
||
2133 |
self fileGetInfo:false |
|
2134 |
! |
|
2135 |
||
2136 |
fileGetInfo:longInfo |
|
2137 |
"get info on selected file - show it in a box" |
|
2138 |
||
1672
9df905f8bfa3
update fileInfo while showing infoBox
Claus Gittinger <cg@exept.de>
parents:
1628
diff
changeset
|
2139 |
|string box updater| |
172 | 2140 |
|
2141 |
string := self getFileInfoString:longInfo. |
|
2142 |
string notNil ifTrue:[ |
|
1868 | 2143 |
box := InfoBox title:string. |
2144 |
updater := [ |
|
2145 |
[true] whileTrue:[ |
|
2146 |
Delay waitForSeconds:2. |
|
2147 |
string := self getFileInfoString:longInfo. |
|
2148 |
box title:string |
|
2149 |
] |
|
2150 |
] fork. |
|
2151 |
||
2152 |
box showAtPointer. |
|
2153 |
updater terminate. |
|
2154 |
box destroy |
|
172 | 2155 |
] |
2156 |
! |
|
2157 |
||
2158 |
fileGetLongInfo |
|
2159 |
"show long stat (file)-info" |
|
2160 |
||
2161 |
self fileGetInfo:true |
|
2162 |
! |
|
2163 |
||
1874 | 2164 |
fileHexDump |
2165 |
"show a hex dump (similar to od -x) |
|
2166 |
Only needed with non-Unix systems." |
|
2167 |
||
2168 |
self withReadCursorDo:[ |
|
2138 | 2169 |
|fileName f stream data offs |
2170 |
addrDigits col line asciiLine lines| |
|
2171 |
||
2172 |
fileName := self getSelectedFileName. |
|
2173 |
fileName notNil ifTrue:[ |
|
2174 |
f := currentDirectory construct:fileName. |
|
2175 |
f isDirectory ifTrue:[ |
|
2176 |
^ self warn:(resources string:'%1 is a directory.' with:fileName). |
|
2177 |
]. |
|
2178 |
f exists ifFalse:[ |
|
2179 |
self warn:(resources string:'oops, ''%1'' is gone or unreadable.' with:fileName). |
|
2180 |
^ self |
|
2181 |
]. |
|
2182 |
f isReadable ifFalse:[ |
|
2183 |
self warn:(resources string:'''%1'' is unreadable.' with:fileName). |
|
2184 |
^ self |
|
2185 |
]. |
|
2186 |
stream := f readStream binary. |
|
2187 |
data := stream contents. |
|
2188 |
stream close. |
|
2189 |
||
2190 |
subView list:nil. |
|
2191 |
col := 1. |
|
2192 |
offs := 0. |
|
2193 |
lines := StringCollection new. |
|
2194 |
||
2195 |
addrDigits := ((f fileSize + 1) log:16) truncated + 1. |
|
2196 |
||
2197 |
line := (offs hexPrintString:addrDigits) , ': '. |
|
2198 |
asciiLine := ''. |
|
2199 |
||
2200 |
data do:[:byte | |
|
2201 |
line := line , (byte hexPrintString:2). |
|
2202 |
(byte between:32 and:127) ifTrue:[ |
|
2203 |
asciiLine := asciiLine copyWith:(Character value:byte) |
|
2204 |
] ifFalse:[ |
|
2205 |
asciiLine := asciiLine , '.' |
|
2206 |
]. |
|
2207 |
||
2208 |
offs := offs + 1. |
|
2209 |
col := col + 1. |
|
2210 |
col > 16 ifTrue:[ |
|
2211 |
lines add:(line , ' ' , asciiLine). |
|
2212 |
(offs bitAnd:16rFF) == 0 ifTrue:[ |
|
2213 |
lines add:nil |
|
2214 |
]. |
|
2215 |
line := (offs hexPrintString:addrDigits) , ': '. |
|
2216 |
asciiLine := ''. |
|
2217 |
col := 1. |
|
2218 |
] ifFalse:[ |
|
2219 |
line := line , ' ' |
|
2220 |
] |
|
2221 |
]. |
|
2222 |
line := line paddedTo:(3*16 + addrDigits + 1). |
|
2223 |
lines add:(line , ' ' , asciiLine). |
|
2224 |
self show:lines. |
|
2225 |
] |
|
1874 | 2226 |
] |
2227 |
||
2228 |
"Modified: / 7.9.1998 / 15:37:47 / cg" |
|
2229 |
! |
|
2230 |
||
172 | 2231 |
fileInsert |
1162 | 2232 |
"insert contents of file at the cursor position" |
172 | 2233 |
|
2234 |
|fileName| |
|
2235 |
||
2236 |
fileName := self getSelectedFileName. |
|
2237 |
fileName notNil ifTrue:[ |
|
1317 | 2238 |
self showFile:fileName insert:true encoding:fileEncoding |
172 | 2239 |
] |
386
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
2240 |
|
1162 | 2241 |
"Modified: 23.4.1997 / 13:06:06 / cg" |
172 | 2242 |
! |
2243 |
||
2244 |
fileListMenu |
|
2245 |
"return the menu to show in the fileList" |
|
2246 |
||
1235
13610578a5d2
resource flag: #menu -> #programMenu
Claus Gittinger <cg@exept.de>
parents:
1227
diff
changeset
|
2247 |
<resource: #programMenu> |
1040 | 2248 |
|
1834 | 2249 |
|m| |
2250 |
||
2251 |
m := self class menuPopUp. |
|
2252 |
m := m decodeAsLiteralArray. |
|
2253 |
m receiver:self. |
|
2035
307ed5143d8b
national language stuff - again
Claus Gittinger <cg@exept.de>
parents:
2031
diff
changeset
|
2254 |
m findGuiResourcesIn:self. |
1834 | 2255 |
^ m. |
2256 |
||
2257 |
"Modified: / 14.8.1998 / 14:09:12 / cg" |
|
2258 |
! |
|
2259 |
||
2260 |
fileListMenu_old |
|
2261 |
"return the menu to show in the fileList" |
|
2262 |
||
2263 |
<resource: #programMenu> |
|
2264 |
||
1736
36cab4d1d655
remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents:
1735
diff
changeset
|
2265 |
|items m sel ns subMenu subItems| |
36cab4d1d655
remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents:
1735
diff
changeset
|
2266 |
|
36cab4d1d655
remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents:
1735
diff
changeset
|
2267 |
items := #( |
1868 | 2268 |
('spawn' fileSpawn ) |
2269 |
('-' nil ) |
|
2270 |
('get contents' fileGet GotoLine) |
|
2271 |
('insert contents' fileInsert ) |
|
2272 |
('show info' fileGetInfo InspectIt) |
|
2273 |
('show full info' fileGetLongInfo CmdI) |
|
2274 |
). |
|
1193
568b858d94ce
show current namespace in menus fileIn item
Claus Gittinger <cg@exept.de>
parents:
1189
diff
changeset
|
2275 |
|
568b858d94ce
show current namespace in menus fileIn item
Claus Gittinger <cg@exept.de>
parents:
1189
diff
changeset
|
2276 |
((ns := Project current defaultNameSpace) notNil |
568b858d94ce
show current namespace in menus fileIn item
Claus Gittinger <cg@exept.de>
parents:
1189
diff
changeset
|
2277 |
and:[ns ~~ Smalltalk]) ifTrue:[ |
1868 | 2278 |
items := items copyWith:(Array |
2279 |
with:(resources string:'fileIn (into ''%1'')' with:(Project current defaultNameSpace name)) |
|
2280 |
with:#fileFileIn |
|
2281 |
with:#Accept) |
|
1736
36cab4d1d655
remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents:
1735
diff
changeset
|
2282 |
|
1193
568b858d94ce
show current namespace in menus fileIn item
Claus Gittinger <cg@exept.de>
parents:
1189
diff
changeset
|
2283 |
] ifFalse:[ |
1868 | 2284 |
items := items copyWith:#( 'fileIn' #fileFileIn #Accept) |
1193
568b858d94ce
show current namespace in menus fileIn item
Claus Gittinger <cg@exept.de>
parents:
1189
diff
changeset
|
2285 |
]. |
568b858d94ce
show current namespace in menus fileIn item
Claus Gittinger <cg@exept.de>
parents:
1189
diff
changeset
|
2286 |
|
1736
36cab4d1d655
remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents:
1735
diff
changeset
|
2287 |
items := items , #( |
1868 | 2288 |
('-' ) |
2289 |
('update' updateCurrentDirectory Cmdu) |
|
2290 |
('-' ) |
|
2291 |
('execute unix command ...' fileExecute DoIt) |
|
2292 |
('st/x tools' stxTools ) |
|
2293 |
('-' ) |
|
2294 |
('remove' fileRemove Delete) |
|
2295 |
('rename ...' fileRename ) |
|
2296 |
('-' ) |
|
2297 |
('display long list' changeDisplayMode ) |
|
2298 |
('show all files' changeDotFileVisibility ) |
|
2299 |
('encoding ...' fileEncoding ) |
|
2300 |
('-' ) |
|
2301 |
('create directory ...' newDirectory CmdD) |
|
2302 |
('create file ...' newFile CmdF) |
|
2303 |
). |
|
172 | 2304 |
|
2305 |
m := PopUpMenu |
|
1868 | 2306 |
itemList:items |
2307 |
resources:resources. |
|
172 | 2308 |
|
1834 | 2309 |
showingHiddenFiles value "showDotFiles" ifTrue:[ |
1868 | 2310 |
m labelAt:#changeDotFileVisibility put:(resources string:'hide hidden files') |
172 | 2311 |
]. |
1834 | 2312 |
showingDetails value "showLongList" ifTrue:[ |
1868 | 2313 |
m labelAt:#changeDisplayMode put:(resources string:'display short list') |
172 | 2314 |
]. |
2315 |
||
1736
36cab4d1d655
remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents:
1735
diff
changeset
|
2316 |
items := #( |
1868 | 2317 |
('Changes browser' openChangesBrowser ) |
2318 |
('Editor' openEditor ) |
|
2319 |
('HTML reader' openHTMLReader ) |
|
2320 |
('Image inspect' openImageInspector ) |
|
2321 |
('show file differences' openDiffView ) |
|
2322 |
). |
|
1286
2a464093d865
added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents:
1272
diff
changeset
|
2323 |
|
1751 | 2324 |
OperatingSystem isUNIXlike ifTrue:[ |
1868 | 2325 |
items := items , #( ('terminal' openTerminal )). |
1751 | 2326 |
]. |
2327 |
||
1286
2a464093d865
added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents:
1272
diff
changeset
|
2328 |
JavaInterpreter notNil ifTrue:[ |
1868 | 2329 |
items := items , #( ('Java Applet Viewer' openAppletViewer)). |
1286
2a464093d865
added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents:
1272
diff
changeset
|
2330 |
]. |
2a464093d865
added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents:
1272
diff
changeset
|
2331 |
|
2a464093d865
added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents:
1272
diff
changeset
|
2332 |
m subMenuAt:#stxTools |
1868 | 2333 |
put:(PopUpMenu |
2334 |
itemList:items |
|
2335 |
resources:resources). |
|
1736
36cab4d1d655
remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents:
1735
diff
changeset
|
2336 |
|
36cab4d1d655
remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents:
1735
diff
changeset
|
2337 |
((sel := fileListView selection) isNil |
36cab4d1d655
remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents:
1735
diff
changeset
|
2338 |
or:[sel isEmpty]) ifTrue:[ |
1868 | 2339 |
m disableAll:#(fileGet fileInsert |
2340 |
fileGetInfo fileGetLongInfo |
|
2341 |
fileFileIn fileFileInLazy |
|
2342 |
fileRemove fileRename). |
|
2343 |
(m subMenuAt:#stxTools) |
|
2344 |
disableAll:#(openChangesBrowser openEditor openHTMLReader openImageInspector) |
|
865
48395e8ecca9
remember executeCommand actions in history as well.
Claus Gittinger <cg@exept.de>
parents:
851
diff
changeset
|
2345 |
] ifFalse:[ |
1868 | 2346 |
fileListView selection size > 1 ifTrue:[ |
2347 |
m disableAll:#( fileGet fileInsert fileGetInfo fileGetLongInfo fileRename ) |
|
2348 |
] |
|
172 | 2349 |
]. |
2350 |
||
2351 |
^m |
|
252 | 2352 |
|
1396 | 2353 |
"Modified: / 16.1.1998 / 16:42:59 / stefan" |
1834 | 2354 |
"Modified: / 4.8.1998 / 13:45:56 / cg" |
2355 |
"Created: / 13.8.1998 / 20:51:38 / cg" |
|
172 | 2356 |
! |
2357 |
||
2358 |
filePrint |
|
1162 | 2359 |
"send a files contents to the printer (not in the menu)" |
2360 |
||
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
2361 |
|fileName path inStream printStream line| |
172 | 2362 |
|
294 | 2363 |
self withWaitCursorDo:[ |
1329 | 2364 |
fileName := self getSelectedFileName. |
2365 |
fileName notNil ifTrue:[ |
|
2366 |
path := currentDirectory filenameFor:fileName. |
|
2367 |
(path type == #regular) ifTrue:[ |
|
2368 |
inStream := path readStream. |
|
2369 |
inStream isNil ifFalse:[ |
|
2370 |
printStream := PrinterStream new. |
|
2371 |
printStream notNil ifTrue:[ |
|
2372 |
[inStream atEnd] whileFalse:[ |
|
2373 |
line := inStream nextLine. |
|
2374 |
printStream nextPutLine:line. |
|
2375 |
]. |
|
2376 |
printStream close |
|
2377 |
]. |
|
2378 |
inStream close |
|
2379 |
] |
|
2380 |
] |
|
2381 |
]. |
|
2382 |
0 "compiler hint" |
|
172 | 2383 |
] |
294 | 2384 |
|
1162 | 2385 |
"Modified: 23.4.1997 / 13:05:40 / cg" |
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
2386 |
"Modified: 18.9.1997 / 16:29:17 / stefan" |
172 | 2387 |
! |
2388 |
||
2389 |
fileRemove |
|
2390 |
"remove the selected file(s). |
|
2391 |
Query if user really wants to remove the file. |
|
2392 |
- should be enhanced, to look for a ~/.trash directory |
|
2393 |
and move files there if it exists (without asking in this case)." |
|
2394 |
||
2395 |
|sel q| |
|
2396 |
||
2094 | 2397 |
sel := fileListView selection. |
2398 |
sel size > 0 ifTrue:[ |
|
2138 | 2399 |
sel := sel collect:[:rawIndex | fileList at:rawIndex]. |
2400 |
sel size > 1 ifTrue:[ |
|
2401 |
q := resources string:'remove %1 selected files ?' with:(sel size) |
|
2402 |
] ifFalse:[ |
|
2403 |
q := resources string:'remove ''%1'' ?' with:(sel first asText allBold) |
|
2404 |
]. |
|
2405 |
(self sensor shiftDown |
|
2406 |
or:[self ask:q yesButton:'remove']) ifTrue:[ |
|
2407 |
self withCursor:(Cursor wait) do:[ |
|
2408 |
self doRemove:sel |
|
2409 |
] |
|
2410 |
] |
|
172 | 2411 |
] |
1974 | 2412 |
|
2413 |
"Modified: / 16.12.1998 / 17:30:31 / cg" |
|
172 | 2414 |
! |
2415 |
||
2416 |
fileRename |
|
2417 |
"rename the selected file(s)" |
|
2418 |
||
2419 |
|queryBox| |
|
2420 |
||
2421 |
queryBox := FilenameEnterBox new. |
|
2422 |
queryBox okText:(resources at:'rename'). |
|
2423 |
self selectedFilesDo:[:oldName | |
|
1317 | 2424 |
queryBox title:(resources string:'rename ''%1'' to:' with:oldName). |
2425 |
queryBox initialText:oldName. |
|
2426 |
queryBox action:[:newName | self doRename:oldName to:newName]. |
|
2427 |
queryBox showAtPointer |
|
172 | 2428 |
] |
2429 |
! |
|
2430 |
||
2431 |
fileSelect:lineNr |
|
2432 |
"selected a file - do nothing here" |
|
1162 | 2433 |
|
2094 | 2434 |
|fn| |
2435 |
||
2095 | 2436 |
imagePreviewView notNil ifTrue:[ |
2138 | 2437 |
self stopImageRenderProcess. |
2438 |
||
2439 |
fn := self getSelectedFileName. |
|
2440 |
(Image isImageFileSuffix:(fn asFilename suffix)) ifTrue:[ |
|
2441 |
imageRenderProcess := [ |
|
2442 |
self loadImageAndPerform:[:img | |
|
2443 |
imagePreviewView beVisible. |
|
2444 |
imagePreviewView image:img |
|
2445 |
] |
|
2446 |
] forkAt:(Processor activePriority - 1). |
|
2447 |
] ifFalse:[ |
|
2448 |
imagePreviewView beInvisible |
|
2449 |
]. |
|
2095 | 2450 |
] |
1162 | 2451 |
|
2452 |
"Modified: 23.4.1997 / 13:04:55 / cg" |
|
172 | 2453 |
! |
2454 |
||
2455 |
fileSpawn |
|
2456 |
"start another FileBrowser on the selected directory or |
|
2457 |
on the same directory if none is selected." |
|
2458 |
||
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
2459 |
|any path| |
172 | 2460 |
|
2461 |
any := false. |
|
2462 |
self selectedFilesDo:[:fileName | |
|
1329 | 2463 |
path := currentDirectory filenameFor:fileName. |
2464 |
path isDirectory ifTrue:[ |
|
2465 |
self class openOn:(path pathName). |
|
2466 |
any := true |
|
2467 |
] |
|
172 | 2468 |
]. |
2469 |
any ifFalse:[ |
|
1329 | 2470 |
self class openOn:currentDirectory pathName |
172 | 2471 |
] |
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
2472 |
|
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
2473 |
"Modified: 18.9.1997 / 16:32:39 / stefan" |
172 | 2474 |
! |
2475 |
||
1964 | 2476 |
loadImageAndPerform:aSelectorOrBlock |
1853 | 2477 |
|img path| |
2478 |
||
2479 |
self selectedFilesDo:[:fileName | |
|
2138 | 2480 |
path := currentDirectory filenameFor:fileName. |
2481 |
path isDirectory ifFalse:[ |
|
2482 |
img := Image fromFile:(path pathName). |
|
2483 |
img notNil ifTrue:[ |
|
2484 |
aSelectorOrBlock isSymbol ifTrue:[ |
|
2485 |
img perform:aSelectorOrBlock |
|
2486 |
] ifFalse:[ |
|
2487 |
aSelectorOrBlock value:img |
|
2488 |
] |
|
2489 |
] ifFalse:[ |
|
2490 |
self warn:'unknown format: ' , fileName |
|
2491 |
] |
|
2492 |
] |
|
1853 | 2493 |
]. |
2494 |
||
2495 |
"Modified: / 17.9.1995 / 17:41:24 / claus" |
|
2496 |
"Modified: / 18.9.1997 / 17:05:04 / stefan" |
|
2497 |
"Created: / 26.8.1998 / 16:20:18 / cg" |
|
2498 |
! |
|
2499 |
||
172 | 2500 |
newDirectory |
2501 |
"ask for and create a new directory" |
|
2502 |
||
2503 |
|queryBox| |
|
2504 |
||
2505 |
queryBox := FilenameEnterBox |
|
1317 | 2506 |
title:(resources at:'create new directory:') withCRs |
2507 |
okText:(resources at:'create') |
|
2508 |
action:[:newName | self doCreateDirectory:newName]. |
|
172 | 2509 |
queryBox showAtPointer |
1162 | 2510 |
|
2511 |
"Modified: 23.4.1997 / 13:04:27 / cg" |
|
172 | 2512 |
! |
2513 |
||
2514 |
newFile |
|
2515 |
"ask for and create a new file" |
|
2516 |
||
2517 |
|sel queryBox| |
|
2518 |
||
2519 |
queryBox := FilenameEnterBox |
|
1418 | 2520 |
title:(resources at:'create new file:') withCRs |
2521 |
okText:(resources at:'create') |
|
2522 |
action:[:newName | newName isEmpty ifFalse:[self doCreateFile:newName]]. |
|
172 | 2523 |
sel := subView selection. |
2524 |
sel notNil ifTrue:[ |
|
1418 | 2525 |
queryBox initialText:(sel asString) |
172 | 2526 |
]. |
2527 |
queryBox showAtPointer |
|
381 | 2528 |
|
1396 | 2529 |
"Modified: / 23.4.1997 / 13:04:38 / cg" |
2530 |
"Modified: / 16.1.1998 / 16:54:00 / stefan" |
|
172 | 2531 |
! |
2532 |
||
1834 | 2533 |
newHardLink |
2534 |
"ask for and create a hard link (unix only)" |
|
2535 |
||
2536 |
|sel box orgName1 name1 name2 f1 f2 f d err nm here l1 if1 if2| |
|
2537 |
||
2538 |
sel := self getSelectedFileName. |
|
2539 |
||
2540 |
orgName1 := ''. |
|
2541 |
(sel size > 0) ifTrue:[ |
|
2138 | 2542 |
(currentDirectory construct:sel) isDirectory ifFalse:[ |
2543 |
orgName1 := sel |
|
2544 |
] |
|
1834 | 2545 |
]. |
2546 |
||
2547 |
name1 := orgName1 asValue. |
|
2548 |
name2 := '' asValue. |
|
2549 |
||
2550 |
box := DialogBox new. |
|
2035
307ed5143d8b
national language stuff - again
Claus Gittinger <cg@exept.de>
parents:
2031
diff
changeset
|
2551 |
(box addTextLabel:(resources string:'Create hard link from:')) adjust:#left. |
1834 | 2552 |
if1 := box addFilenameInputFieldOn:name1 in:here tabable:true. |
2035
307ed5143d8b
national language stuff - again
Claus Gittinger <cg@exept.de>
parents:
2031
diff
changeset
|
2553 |
(box addTextLabel:(resources string:'to:')) adjust:#left. |
1834 | 2554 |
if2 := box addFilenameInputFieldOn:name2 in:here tabable:true. |
2555 |
||
2048 | 2556 |
box addAbortAndOkButtons. |
1834 | 2557 |
|
2558 |
orgName1 size > 0 ifTrue:[ |
|
2138 | 2559 |
box focusOnField:if2. |
1834 | 2560 |
]. |
2561 |
box showAtPointer. |
|
2562 |
||
2563 |
box accepted ifTrue:[ |
|
2138 | 2564 |
name1 := name1 value. |
2565 |
(name1 size == 0) ifTrue:[ |
|
2566 |
err := 'no name entered'. |
|
2567 |
] ifFalse:[ |
|
2568 |
f1 := name1 asFilename. |
|
2569 |
name2 := name2 value. |
|
2570 |
(name2 size == 0) ifTrue:[ |
|
2571 |
err := 'no name entered'. |
|
2572 |
] ifFalse:[ |
|
2573 |
f2 := name2 asFilename. |
|
2574 |
f2 exists ifTrue:[ |
|
2575 |
err := '''%2'' already exists'. |
|
2576 |
] ifFalse:[ |
|
2577 |
f1 exists ifFalse:[ |
|
2578 |
err := '''%1'' does not exist'. |
|
2579 |
] ifTrue:[ |
|
2580 |
f1 isDirectory ifTrue:[ |
|
2581 |
err := '''%1'' is a directory'. |
|
2582 |
] ifFalse:[ |
|
2583 |
ErrorSignal handle:[:ex | |
|
2584 |
err := ex errorString |
|
2585 |
] do:[ |
|
2586 |
OperatingSystem createHardLinkFrom:name1 to:name2 |
|
2587 |
] |
|
2588 |
] |
|
2589 |
] |
|
2590 |
] |
|
2591 |
] |
|
2592 |
]. |
|
2593 |
||
2594 |
err notNil ifTrue:[ |
|
2595 |
self warn:(resources string:err with:(name1 ? '') asText allBold with:(name2 ? '') asText allBold). |
|
2596 |
^ self |
|
2597 |
]. |
|
1834 | 2598 |
]. |
2599 |
||
2600 |
"Modified: / 13.8.1998 / 21:47:01 / cg" |
|
2601 |
! |
|
2602 |
||
2603 |
newSoftLink |
|
2604 |
"ask for and create a soft link (unix only)" |
|
2605 |
||
2606 |
|sel box orgName1 name1 name2 f1 f2 f d err nm here l1 if1 if2| |
|
2607 |
||
2608 |
sel := self getSelectedFileName. |
|
2609 |
||
2610 |
orgName1 := ''. |
|
2611 |
(sel size > 0) ifTrue:[ |
|
2138 | 2612 |
orgName1 := sel |
1834 | 2613 |
]. |
2614 |
||
2615 |
name1 := orgName1 asValue. |
|
2616 |
name2 := '' asValue. |
|
2617 |
||
2618 |
box := DialogBox new. |
|
2619 |
(box addTextLabel:'Create symbolic link to:') adjust:#left. |
|
2620 |
if1 := box addFilenameInputFieldOn:name1 in:here tabable:true. |
|
2621 |
(box addTextLabel:'as:') adjust:#left. |
|
2622 |
if2 := box addFilenameInputFieldOn:name2 in:here tabable:true. |
|
2623 |
||
2048 | 2624 |
box addAbortAndOkButtons. |
1834 | 2625 |
|
2626 |
orgName1 size > 0 ifTrue:[ |
|
2138 | 2627 |
box focusOnField:if2. |
1834 | 2628 |
]. |
2629 |
box showAtPointer. |
|
2630 |
||
2631 |
box accepted ifTrue:[ |
|
2138 | 2632 |
name1 := name1 value. |
2633 |
(name1 size == 0) ifTrue:[ |
|
2634 |
err := 'no name entered'. |
|
2635 |
] ifFalse:[ |
|
2636 |
f1 := name1 asFilename. |
|
2637 |
name2 := name2 value. |
|
2638 |
(name2 size == 0) ifTrue:[ |
|
2639 |
err := 'no name entered'. |
|
2640 |
] ifFalse:[ |
|
2641 |
f2 := name2 asFilename. |
|
2642 |
f2 exists ifTrue:[ |
|
2643 |
err := '''%2'' already exists'. |
|
2644 |
] ifFalse:[ |
|
2645 |
f1 exists ifFalse:[ |
|
2646 |
err := '''%1'' does not exist (link created anyway)'. |
|
2647 |
]. |
|
2648 |
ErrorSignal handle:[:ex | |
|
2649 |
err := ex errorString |
|
2650 |
] do:[ |
|
2651 |
OperatingSystem createSymbolicLinkFrom:name1 to:name2 |
|
2652 |
] |
|
2653 |
] |
|
2654 |
] |
|
2655 |
]. |
|
2656 |
||
2657 |
err notNil ifTrue:[ |
|
2658 |
self warn:(resources string:err with:(name1 ? '') asText allBold with:(name2 ? '') asText allBold). |
|
2659 |
^ self |
|
2660 |
]. |
|
1834 | 2661 |
]. |
2662 |
||
2663 |
"Modified: / 13.8.1998 / 21:26:59 / cg" |
|
2664 |
"Created: / 13.8.1998 / 21:47:14 / cg" |
|
2665 |
! |
|
2666 |
||
1286
2a464093d865
added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents:
1272
diff
changeset
|
2667 |
openAppletViewer |
2a464093d865
added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents:
1272
diff
changeset
|
2668 |
|numItems| |
2a464093d865
added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents:
1272
diff
changeset
|
2669 |
|
2a464093d865
added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents:
1272
diff
changeset
|
2670 |
(numItems := fileListView selection size) > 2 ifTrue:[ |
2138 | 2671 |
(self |
2672 |
confirm:(resources string:'open for each of the %1 items ?' |
|
2673 |
with:numItems)) ifFalse:[^ self]. |
|
1286
2a464093d865
added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents:
1272
diff
changeset
|
2674 |
]. |
2a464093d865
added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents:
1272
diff
changeset
|
2675 |
|
1942 | 2676 |
Java startupJavaSystem. |
2677 |
"/ Java markAllClassesUninitialized. |
|
2678 |
"/ Java initAllStaticFields. |
|
2679 |
"/ Java initAllClasses. |
|
1286
2a464093d865
added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents:
1272
diff
changeset
|
2680 |
|
2a464093d865
added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents:
1272
diff
changeset
|
2681 |
self selectedFilesDo:[:fileName | |
2138 | 2682 |
|p path| |
2683 |
||
2684 |
path := currentDirectory filenameFor:fileName. |
|
2685 |
path isDirectory ifFalse:[ |
|
2686 |
p := Java |
|
2687 |
javaProcessForMainOf:(Java classForName:'sun.applet.AppletViewer') |
|
2688 |
argumentString:path pathName. |
|
2689 |
p resume. |
|
2690 |
] |
|
1286
2a464093d865
added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents:
1272
diff
changeset
|
2691 |
]. |
2a464093d865
added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents:
1272
diff
changeset
|
2692 |
|
1942 | 2693 |
"Modified: / 18.9.1997 / 17:00:59 / stefan" |
2694 |
"Modified: / 17.10.1998 / 17:00:43 / cg" |
|
1286
2a464093d865
added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents:
1272
diff
changeset
|
2695 |
! |
2a464093d865
added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents:
1272
diff
changeset
|
2696 |
|
172 | 2697 |
openChangesBrowser |
2698 |
"open a change browser on the selected file(s)" |
|
2699 |
||
1939
5947fefec5af
care for newChangesBrowser setting
Claus Gittinger <cg@exept.de>
parents:
1933
diff
changeset
|
2700 |
self openTool:(UserPreferences current changesBrowserClass) |
5947fefec5af
care for newChangesBrowser setting
Claus Gittinger <cg@exept.de>
parents:
1933
diff
changeset
|
2701 |
|
5947fefec5af
care for newChangesBrowser setting
Claus Gittinger <cg@exept.de>
parents:
1933
diff
changeset
|
2702 |
"Modified: / 17.10.1998 / 14:39:15 / cg" |
172 | 2703 |
! |
2704 |
||
252 | 2705 |
openDiffView |
2706 |
"open a diff-view" |
|
2707 |
||
1736
36cab4d1d655
remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents:
1735
diff
changeset
|
2708 |
|sel box orgName1 name1 name2 text1 text2 f d err nm here l1| |
36cab4d1d655
remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents:
1735
diff
changeset
|
2709 |
|
36cab4d1d655
remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents:
1735
diff
changeset
|
2710 |
sel := self getSelectedFileName. |
36cab4d1d655
remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents:
1735
diff
changeset
|
2711 |
|
36cab4d1d655
remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents:
1735
diff
changeset
|
2712 |
orgName1 := ''. |
36cab4d1d655
remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents:
1735
diff
changeset
|
2713 |
(sel size > 0 |
36cab4d1d655
remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents:
1735
diff
changeset
|
2714 |
and:[lastFileDiffDirectory notNil |
36cab4d1d655
remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents:
1735
diff
changeset
|
2715 |
and:[lastFileDiffDirectory asFilename isDirectory]]) ifTrue:[ |
2140
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
2716 |
f := lastFileDiffDirectory asFilename construct:sel. |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
2717 |
(f exists |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
2718 |
and:[f isReadable]) ifTrue:[ |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
2719 |
orgName1 := f name |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
2720 |
] |
1736
36cab4d1d655
remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents:
1735
diff
changeset
|
2721 |
]. |
36cab4d1d655
remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents:
1735
diff
changeset
|
2722 |
|
36cab4d1d655
remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents:
1735
diff
changeset
|
2723 |
name1 := orgName1 asValue. |
252 | 2724 |
name2 := self getSelectedFileName asValue. |
2725 |
here := currentDirectory pathName. |
|
2726 |
||
2727 |
box := DialogBox new. |
|
1852 | 2728 |
(box addTextLabel:'show difference between:\\file1 (empty for views contents):' withCRs) adjust:#left. |
252 | 2729 |
box addFilenameInputFieldOn:name1 in:here tabable:true. |
1852 | 2730 |
(box addTextLabel:'and file2:') adjust:#left. |
252 | 2731 |
box addFilenameInputFieldOn:name2 in:here tabable:true. |
2732 |
||
2048 | 2733 |
box addAbortAndOkButtons. |
252 | 2734 |
|
2735 |
box showAtPointer. |
|
2736 |
||
2737 |
box accepted ifTrue:[ |
|
2140
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
2738 |
name1 := name1 value. |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
2739 |
(name1 isNil or:[name1 isEmpty]) ifTrue:[ |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
2740 |
"/ text1 := subView contents. |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
2741 |
text1 := subView list asStringCollection withTabs. |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
2742 |
text1 := text1 collect:[:l | l isNil ifTrue:[' '] ifFalse:[l]]. |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
2743 |
name1 := nil. |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
2744 |
l1 := 'browser contents' |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
2745 |
] ifFalse:[ |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
2746 |
name1 := currentDirectory filenameFor:name1. |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
2747 |
name1 isReadable ifFalse:[ |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
2748 |
nm := name1. |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
2749 |
name1 exists ifFalse:[ |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
2750 |
err := '%1 does not exist'. |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
2751 |
] ifTrue:[ |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
2752 |
err := '%1 is not readable' |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
2753 |
]. |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
2754 |
]. |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
2755 |
l1 := name1 pathName |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
2756 |
]. |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
2757 |
|
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
2758 |
name2 := currentDirectory filenameFor:name2 value. |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
2759 |
err isNil ifTrue:[ |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
2760 |
name2 isReadable ifFalse:[ |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
2761 |
nm := name2. |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
2762 |
name2 exists ifFalse:[ |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
2763 |
err := '%1 does not exist'. |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
2764 |
] ifTrue:[ |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
2765 |
err := '%1 is not readable' |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
2766 |
]. |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
2767 |
]. |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
2768 |
]. |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
2769 |
err notNil ifTrue:[ |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
2770 |
self warn:(resources string:err with:nm pathName). |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
2771 |
^ self |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
2772 |
]. |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
2773 |
|
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
2774 |
self withWaitCursorDo:[ |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
2775 |
(name1 notNil and:[name1 name ~= orgName1]) ifTrue:[ |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
2776 |
lastFileDiffDirectory := name1 directoryName |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
2777 |
]. |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
2778 |
name1 notNil ifTrue:[ |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
2779 |
text1 := name1 contents. |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
2780 |
]. |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
2781 |
text2 := name2 contents. |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
2782 |
text1 = text2 ifTrue:[ |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
2783 |
self information:'same contents' |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
2784 |
] ifFalse:[ |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
2785 |
d := DiffTextView |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
2786 |
openOn:text1 label:l1 |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
2787 |
and:text2 label:name2 pathName. |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
2788 |
d label:'file differences'. |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
2789 |
] |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
2790 |
] |
252 | 2791 |
]. |
2792 |
||
1735
57ebbb06fcd7
only show an infoBox, if files have the same contents
Claus Gittinger <cg@exept.de>
parents:
1732
diff
changeset
|
2793 |
"Created: / 7.12.1995 / 20:33:58 / cg" |
57ebbb06fcd7
only show an infoBox, if files have the same contents
Claus Gittinger <cg@exept.de>
parents:
1732
diff
changeset
|
2794 |
"Modified: / 18.9.1997 / 17:31:46 / stefan" |
2140
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
2795 |
"Modified: / 5.5.1999 / 16:04:10 / cg" |
267 | 2796 |
! |
2797 |
||
2798 |
openEditor |
|
2799 |
self openTool:EditTextView |
|
2800 |
! |
|
2801 |
||
2802 |
openHTMLReader |
|
1874 | 2803 |
self openTool:HTMLDocumentView ignoreDirectories:false |
2804 |
||
2805 |
"Modified: / 7.9.1998 / 21:31:58 / cg" |
|
267 | 2806 |
! |
2807 |
||
1834 | 2808 |
openImageEditor |
1874 | 2809 |
[self loadImageAndPerform:#edit] fork |
1834 | 2810 |
|
2811 |
"Modified: / 17.9.1995 / 17:41:24 / claus" |
|
2812 |
"Modified: / 18.9.1997 / 17:05:04 / stefan" |
|
2813 |
"Created: / 13.8.1998 / 22:07:09 / cg" |
|
1874 | 2814 |
"Modified: / 7.9.1998 / 21:31:41 / cg" |
1834 | 2815 |
! |
2816 |
||
267 | 2817 |
openImageInspector |
1874 | 2818 |
[self loadImageAndPerform:#inspect] fork |
1853 | 2819 |
|
2820 |
"Modified: / 17.9.1995 / 17:41:24 / claus" |
|
2821 |
"Modified: / 18.9.1997 / 17:05:04 / stefan" |
|
1874 | 2822 |
"Modified: / 7.9.1998 / 21:31:30 / cg" |
267 | 2823 |
! |
2824 |
||
1964 | 2825 |
openImagePreview |
2826 |
[self loadImageAndPerform:[:img | |
|
2138 | 2827 |
|i top viewer| |
2828 |
||
2829 |
top := StandardSystemView new. |
|
2830 |
||
2831 |
viewer := ImageView origin:0.0@0.0 corner:1.0@1.0 in:top. |
|
2832 |
i := img. |
|
2833 |
top extent:200@200. |
|
2834 |
top label:(img fileName asFilename directoryName asFilename baseName , '/' , img fileName asFilename baseName). |
|
2835 |
top openAndWait. |
|
2836 |
||
2837 |
(i width > 200 or:[i height > 200]) ifTrue:[ |
|
2838 |
i := i magnifiedPreservingRatioTo:200@200. |
|
2839 |
]. |
|
2840 |
viewer image:i. |
|
2841 |
]. |
|
1964 | 2842 |
] fork |
1969 | 2843 |
|
2844 |
"Modified: / 4.12.1998 / 15:49:03 / cg" |
|
1964 | 2845 |
! |
2846 |
||
1994 | 2847 |
openSelectedFilename |
2848 |
|sel| |
|
2849 |
||
2850 |
sel := subView selection. |
|
2851 |
sel notNil ifTrue:[ |
|
2138 | 2852 |
sel := sel asString withoutSeparators. |
2853 |
sel asFilename exists ifTrue:[ |
|
2854 |
self doOpenFile:sel viaDoubleClick:false |
|
2855 |
] |
|
1994 | 2856 |
]. |
2857 |
||
2858 |
"Created: / 4.2.1999 / 17:40:42 / cg" |
|
2859 |
"Modified: / 4.2.1999 / 17:47:06 / cg" |
|
2860 |
! |
|
2861 |
||
1731 | 2862 |
openTerminal |
1732 | 2863 |
VT100TerminalView openShellIn:currentDirectory |
1731 | 2864 |
|
2865 |
"Created: / 20.7.1998 / 18:18:15 / cg" |
|
1732 | 2866 |
"Modified: / 20.7.1998 / 18:32:28 / cg" |
1731 | 2867 |
! |
2868 |
||
267 | 2869 |
openTool:aToolClass |
2870 |
"open a tool on the selected file(s)" |
|
2871 |
||
2015 | 2872 |
^ self openTool:aToolClass ignoreDirectories:true |
1874 | 2873 |
|
2874 |
"Modified: / 7.9.1998 / 19:32:10 / cg" |
|
2875 |
! |
|
2876 |
||
2877 |
openTool:aToolClass ignoreDirectories:ignoreDirs |
|
2878 |
"open a tool on the selected file(s)" |
|
2879 |
||
2015 | 2880 |
|numItems path tool| |
865
48395e8ecca9
remember executeCommand actions in history as well.
Claus Gittinger <cg@exept.de>
parents:
851
diff
changeset
|
2881 |
|
1883 | 2882 |
aToolClass isNil ifTrue:[ |
2138 | 2883 |
^ self warn:'Sorry, that tool seems to be not available'. |
1883 | 2884 |
]. |
2885 |
||
865
48395e8ecca9
remember executeCommand actions in history as well.
Claus Gittinger <cg@exept.de>
parents:
851
diff
changeset
|
2886 |
(numItems := fileListView selection size) > 2 ifTrue:[ |
2138 | 2887 |
(self |
2888 |
confirm:(resources string:'open for each of the %1 items ?' |
|
2889 |
with:numItems)) ifFalse:[^ self]. |
|
865
48395e8ecca9
remember executeCommand actions in history as well.
Claus Gittinger <cg@exept.de>
parents:
851
diff
changeset
|
2890 |
]. |
48395e8ecca9
remember executeCommand actions in history as well.
Claus Gittinger <cg@exept.de>
parents:
851
diff
changeset
|
2891 |
|
267 | 2892 |
self selectedFilesDo:[:fileName | |
2138 | 2893 |
path := currentDirectory filenameFor:fileName. |
2894 |
(ignoreDirs not |
|
2895 |
or:[path isDirectory not]) ifTrue:[ |
|
2896 |
tool := aToolClass openOn:(path pathName). |
|
2897 |
] |
|
267 | 2898 |
]. |
2015 | 2899 |
^ tool |
865
48395e8ecca9
remember executeCommand actions in history as well.
Claus Gittinger <cg@exept.de>
parents:
851
diff
changeset
|
2900 |
|
1874 | 2901 |
"Modified: / 18.9.1997 / 17:06:18 / stefan" |
2902 |
"Created: / 7.9.1998 / 19:31:49 / cg" |
|
1883 | 2903 |
"Modified: / 10.9.1998 / 13:58:23 / cg" |
1156
f3df28086973
dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents:
1154
diff
changeset
|
2904 |
! |
f3df28086973
dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents:
1154
diff
changeset
|
2905 |
|
1853 | 2906 |
openZipTool |
2015 | 2907 |
|zipTool| |
2908 |
||
2909 |
zipTool := self openTool:ZipTool. |
|
2910 |
zipTool initialExtractDirectory:currentDirectory |
|
1853 | 2911 |
|
2912 |
"Created: / 26.8.1998 / 16:20:55 / cg" |
|
2913 |
! |
|
2914 |
||
1156
f3df28086973
dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents:
1154
diff
changeset
|
2915 |
showOrHideTabView |
f3df28086973
dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents:
1154
diff
changeset
|
2916 |
"depending on the showLongList setting, show or hde the tabSpec view" |
f3df28086973
dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents:
1154
diff
changeset
|
2917 |
|
1834 | 2918 |
showingDetails value "showLongList" ifTrue:[ |
1868 | 2919 |
tabRulerView isNil ifTrue:[ |
2920 |
self createTabRulerIn:scrollView superView. |
|
2921 |
]. |
|
2922 |
tabRulerView beVisible. |
|
1758 | 2923 |
|
1868 | 2924 |
false "self is3D" ifTrue:[ |
2925 |
scrollView topInset:(tabRulerView superView height). |
|
2926 |
tabRulerView superView leftInset:(fileListView originRelativeTo:scrollView) x. |
|
2927 |
] ifFalse:[ |
|
2928 |
scrollView topInset:(tabRulerView height). |
|
2929 |
tabRulerView leftInset:(fileListView originRelativeTo:scrollView) x. |
|
2930 |
]. |
|
2931 |
tabRulerView hiddenTabs:#(1). |
|
2932 |
tabRulerView fixedTabs:#(1). |
|
1156
f3df28086973
dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents:
1154
diff
changeset
|
2933 |
] ifFalse:[ |
1868 | 2934 |
tabRulerView notNil ifTrue:[ |
2935 |
tabRulerView beInvisible. |
|
2936 |
]. |
|
2937 |
scrollView topInset:0 |
|
1156
f3df28086973
dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents:
1154
diff
changeset
|
2938 |
]. |
f3df28086973
dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents:
1154
diff
changeset
|
2939 |
tabSpec := nil. |
f3df28086973
dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents:
1154
diff
changeset
|
2940 |
|
1758 | 2941 |
"Created: / 19.4.1997 / 09:50:02 / cg" |
1834 | 2942 |
"Modified: / 4.8.1998 / 13:44:14 / cg" |
172 | 2943 |
! ! |
2944 |
||
2945 |
!FileBrowser methodsFor:'help '! |
|
2946 |
||
2947 |
helpTextFor:aComponent |
|
2948 |
|s| |
|
2949 |
||
2950 |
aComponent == subView ifTrue:[ |
|
1317 | 2951 |
s := 'HELP_SUBVIEW' |
172 | 2952 |
]. |
2953 |
aComponent == fileListView ifTrue:[ |
|
1317 | 2954 |
s := 'HELP_FILELIST' |
172 | 2955 |
]. |
2956 |
aComponent == filterField ifTrue:[ |
|
1317 | 2957 |
s := 'HELP_FILTER' |
172 | 2958 |
]. |
2959 |
aComponent == labelView ifTrue:[ |
|
1317 | 2960 |
s := 'HELP_PATHFIELD' |
172 | 2961 |
]. |
2962 |
aComponent == commandView ifTrue:[ |
|
1317 | 2963 |
s := 'HELP_COMMANDVIEW' |
172 | 2964 |
]. |
2965 |
s notNil ifTrue:[ |
|
1317 | 2966 |
^ resources string:s |
172 | 2967 |
]. |
2968 |
^ nil |
|
2969 |
! ! |
|
2970 |
||
2116 | 2971 |
!FileBrowser methodsFor:'initialize / release'! |
36 | 2972 |
|
1758 | 2973 |
createTabRulerIn:topFrame |
2974 |
|v| |
|
2975 |
||
2976 |
false "self is3D" ifTrue:[ |
|
1868 | 2977 |
v := View in:topFrame. |
2978 |
v level:-1. |
|
2979 |
tabRulerView := TabSpecRuler in:v. |
|
2980 |
tabRulerView level:1. |
|
2981 |
v origin:(0.0@0.0) corner:(1.0@10). |
|
2982 |
tabRulerView origin:(0.0@0.0) corner:(1.0@1.0). |
|
1758 | 2983 |
] ifFalse:[ |
1868 | 2984 |
tabRulerView := TabSpecRuler in:topFrame. |
2985 |
tabRulerView origin:(0.0@0.0) corner:(1.0@10). |
|
1758 | 2986 |
]. |
2987 |
tabRulerView borderWidth:0. |
|
2988 |
tabRulerView synchronousOperation:true. |
|
2989 |
||
2990 |
"Created: / 27.7.1998 / 20:23:10 / cg" |
|
2991 |
"Modified: / 27.7.1998 / 20:30:10 / cg" |
|
2992 |
! |
|
2993 |
||
172 | 2994 |
currentDirectory:aDirectoryPath |
2995 |
"set the directory to be browsed" |
|
2996 |
||
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
2997 |
currentDirectory := aDirectoryPath asFilename. |
172 | 2998 |
self changed:#path. |
1327 | 2999 |
|
172 | 3000 |
" |
3001 |
tell my subview (whatever that is) to start its file-dialog |
|
3002 |
(i.e. save-as etc.) in that directory |
|
3003 |
" |
|
3004 |
(subView respondsTo:#directoryForFileDialog:) ifTrue:[ |
|
1329 | 3005 |
subView directoryForFileDialog:currentDirectory |
172 | 3006 |
] |
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
3007 |
|
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
3008 |
"Modified: 16.9.1997 / 14:56:17 / stefan" |
1327 | 3009 |
"Modified: 21.9.1997 / 11:28:49 / cg" |
172 | 3010 |
! |
3011 |
||
2116 | 3012 |
destroy |
3013 |
"destroy view and boxes" |
|
3014 |
||
3015 |
ObjectMemory removeDependent:self. |
|
3016 |
self stopUpdateProcess. |
|
3017 |
self stopImageRenderProcess. |
|
3018 |
checkBlock := nil. |
|
3019 |
super destroy |
|
3020 |
||
3021 |
"Modified: 19.4.1997 / 13:51:48 / cg" |
|
3022 |
! |
|
3023 |
||
172 | 3024 |
focusSequence |
3025 |
"return the sequence in which ALT-CursorRight steps focus" |
|
3026 |
||
3027 |
|fs| |
|
3028 |
||
3029 |
fs := Array |
|
1418 | 3030 |
with:labelView |
1317 | 3031 |
with:filterField |
3032 |
with:fileListView |
|
3033 |
with:subView. |
|
172 | 3034 |
|
3035 |
commandView notNil ifTrue:[ |
|
1317 | 3036 |
fs := fs copyWith:commandView |
172 | 3037 |
]. |
3038 |
^fs |
|
3039 |
! |
|
3040 |
||
3041 |
initEvents |
|
3042 |
super initEvents. |
|
3043 |
self enableEvent:#visibilityChange. |
|
3044 |
! |
|
3045 |
||
36 | 3046 |
initialize |
1102 | 3047 |
|frame spacing halfSpacing v topFrame labelFrame filterModel |
2094 | 3048 |
buttonPanel img mH menuPanel lowerFrame| |
36 | 3049 |
|
3050 |
super initialize. |
|
3051 |
||
819
b78a26650047
initialize fileEncoding to #iso8859
Claus Gittinger <cg@exept.de>
parents:
807
diff
changeset
|
3052 |
fileEncoding := #iso8859. "/ native ST/X encoding |
386
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
3053 |
|
52 | 3054 |
"if true, will replace leading spaces by tabs on |
3055 |
file write. If false, they will be written as spaces |
|
3056 |
" |
|
3057 |
compressTabs := resources at:'COMPRESS_TABS' default:true. |
|
3058 |
||
3059 |
" |
|
3060 |
showing long or short by default |
|
3061 |
" |
|
1834 | 3062 |
"/ showLongList := resources at:'LONG_LIST' default:false. |
3063 |
showingDetails := (resources at:'LONG_LIST' default:false) asValue. |
|
3064 |
showingDetails onChangeSend:#detailsSettingChanged to:self. |
|
52 | 3065 |
|
3066 |
" |
|
3067 |
show hidden files or not ? |
|
3068 |
" |
|
1834 | 3069 |
"/ showDotFiles := resources at:'SHOW_DOT_FILES' default:false. |
3070 |
showingHiddenFiles := (resources at:'SHOW_DOT_FILES' default:false) asValue. |
|
3071 |
showingHiddenFiles onChangeSend:#updateCurrentDirectory to:self. |
|
3072 |
||
2031 | 3073 |
" |
3074 |
showing small icons by default |
|
3075 |
" |
|
3076 |
showingBigImagePreview := (resources at:'BIG_IMAGE_PREVIEW' default:false) asValue. |
|
3077 |
showingBigImagePreview onChangeSend:#bigImagePreviewSettingChanged to:self. |
|
3078 |
||
1834 | 3079 |
sortByWhat := #name asValue. |
3080 |
sortByWhat onChangeSend:#sortChanged to:self. |
|
3081 |
||
3082 |
sortCaseless := (Filename isCaseSensitive not) asValue. |
|
3083 |
sortCaseless onChangeSend:#updateCurrentDirectory to:self. |
|
52 | 3084 |
|
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
3085 |
dosEOLMode := false asValue. |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
3086 |
|
45 | 3087 |
lockUpdate := false. |
3088 |
||
132 | 3089 |
CommandHistory isNil ifTrue:[ |
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
3090 |
CommandHistory := OrderedCollection new. |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
3091 |
CommandHistorySize := 50 |
132 | 3092 |
]. |
36 | 3093 |
DirectoryHistory isNil ifTrue:[ |
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
3094 |
DirectoryHistory := OrderedCollection new. |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
3095 |
DirectoryHistoryWhere := OrderedCollection new. |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
3096 |
HistorySize := 15. |
36 | 3097 |
]. |
132 | 3098 |
commandIndex := 0. |
36 | 3099 |
|
1784
329e3a904236
ask MIMETypes when mapping suffixes to icons.
Claus Gittinger <cg@exept.de>
parents:
1758
diff
changeset
|
3100 |
icons := Dictionary new. |
1495 | 3101 |
|
3102 |
Icons isNil ifTrue:[ |
|
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
3103 |
self class initializeIcons |
1495 | 3104 |
]. |
3105 |
||
36 | 3106 |
myName := (resources string:self class name). |
3107 |
self label:myName. |
|
45 | 3108 |
|
1834 | 3109 |
menuPanel := MenuPanel in:self. |
1835 | 3110 |
menuPanel level:1. |
1834 | 3111 |
menuPanel verticalLayout:false. |
3112 |
menuPanel receiver:self. |
|
3113 |
menuPanel menu:(self pullDownMenu). |
|
2050 | 3114 |
|
1834 | 3115 |
mH := menuPanel preferredExtent y. |
1846
6b66290db627
geometry fixes for win95 style
Claus Gittinger <cg@exept.de>
parents:
1845
diff
changeset
|
3116 |
menuPanel origin:(0.0 @ 0.0) corner:(1.0 @ (mH)). |
1834 | 3117 |
|
93 | 3118 |
labelFrame := View |
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
3119 |
origin:(0.0 @ mH) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
3120 |
corner:(1.0 @ (font height * 1.8 + mH) rounded) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
3121 |
in:self. |
52 | 3122 |
|
1846
6b66290db627
geometry fixes for win95 style
Claus Gittinger <cg@exept.de>
parents:
1845
diff
changeset
|
3123 |
(styleSheet name = #st80 or:[styleSheet name == #win95]) ifTrue:[ |
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
3124 |
labelFrame level:1. |
1879 | 3125 |
"/ labelFrame rightInset:-1. |
45 | 3126 |
]. |
36 | 3127 |
|
3128 |
spacing := ViewSpacing. |
|
3129 |
halfSpacing := spacing // 2. |
|
3130 |
||
1100
d9382b49c62d
Use #pushEvent: for timer handling.
Stefan Vogel <sv@exept.de>
parents:
1091
diff
changeset
|
3131 |
" |
d9382b49c62d
Use #pushEvent: for timer handling.
Stefan Vogel <sv@exept.de>
parents:
1091
diff
changeset
|
3132 |
checkBlock is executed by the Processor every checkDelta seconds. |
d9382b49c62d
Use #pushEvent: for timer handling.
Stefan Vogel <sv@exept.de>
parents:
1091
diff
changeset
|
3133 |
We use #pushEvent: to perform the directory update |
d9382b49c62d
Use #pushEvent: for timer handling.
Stefan Vogel <sv@exept.de>
parents:
1091
diff
changeset
|
3134 |
in our windowgroups process. |
d9382b49c62d
Use #pushEvent: for timer handling.
Stefan Vogel <sv@exept.de>
parents:
1091
diff
changeset
|
3135 |
" |
d9382b49c62d
Use #pushEvent: for timer handling.
Stefan Vogel <sv@exept.de>
parents:
1091
diff
changeset
|
3136 |
checkBlock := [self pushEvent:#checkIfDirectoryHasChanged]. |
45 | 3137 |
checkDelta := resources at:'CHECK_DELTA' default:10. |
36 | 3138 |
|
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
3139 |
currentDirectory := Filename currentDirectory. |
36 | 3140 |
|
344
3f881dbee13a
use a model for the filter field
Claus Gittinger <cg@exept.de>
parents:
333
diff
changeset
|
3141 |
filterModel := '*' asValue. |
45 | 3142 |
filterField := EditField in:labelFrame. |
1071 | 3143 |
filterField |
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
3144 |
origin:[((width // 4 * 3) + halfSpacing) @ (halfSpacing)] |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
3145 |
corner:(1.0 @ (filterField heightIncludingBorder + halfSpacing) ). |
1846
6b66290db627
geometry fixes for win95 style
Claus Gittinger <cg@exept.de>
parents:
1845
diff
changeset
|
3146 |
filterField rightInset:(ViewSpacing - halfSpacing). |
344
3f881dbee13a
use a model for the filter field
Claus Gittinger <cg@exept.de>
parents:
333
diff
changeset
|
3147 |
filterField model:filterModel. |
45 | 3148 |
|
1846
6b66290db627
geometry fixes for win95 style
Claus Gittinger <cg@exept.de>
parents:
1845
diff
changeset
|
3149 |
labelFrame corner:(1.0 @ (mH + ViewSpacing + filterField height + halfSpacing)). |
6b66290db627
geometry fixes for win95 style
Claus Gittinger <cg@exept.de>
parents:
1845
diff
changeset
|
3150 |
|
36 | 3151 |
self initializeFilterPattern. |
344
3f881dbee13a
use a model for the filter field
Claus Gittinger <cg@exept.de>
parents:
333
diff
changeset
|
3152 |
filterModel onChangeSend:#filterPatternChanged to:self. |
3f881dbee13a
use a model for the filter field
Claus Gittinger <cg@exept.de>
parents:
333
diff
changeset
|
3153 |
"/ filterField leaveAction:[:key | fileListView scrollToTop. self updateCurrentDirectory]. |
36 | 3154 |
|
1327 | 3155 |
"/ labelView := Label in:labelFrame. |
3156 |
"/ labelView origin:(halfSpacing @ halfSpacing) |
|
3157 |
"/ extent:[((width // 4 * 3) - spacing - borderWidth) |
|
3158 |
"/ @ |
|
3159 |
"/ (filterField heightIncludingBorder) |
|
3160 |
"/ "(font height + font descent)" |
|
3161 |
"/ ]. |
|
3162 |
"/ labelView adjust:#right. |
|
3163 |
"/ labelView borderWidth:0. |
|
3164 |
"/ labelView model:self; menu:#labelMenu; aspect:#path; labelMessage:#path. |
|
3165 |
"/ labelFrame model:self; menu:#labelMenu. |
|
3166 |
||
3167 |
labelView := FilenameEditField in:labelFrame. |
|
3168 |
labelView |
|
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
3169 |
origin:(halfSpacing @ (halfSpacing)) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
3170 |
extent:[((width // 4 * 3) - spacing - borderWidth) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
3171 |
@ |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
3172 |
(filterField heightIncludingBorder) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
3173 |
"(font height + font descent)" |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
3174 |
]. |
1834 | 3175 |
labelView menu:#labelMenu; |
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
3176 |
aspect:#path; changeMessage:#pathChanged:. |
1327 | 3177 |
labelView model:self. |
3178 |
labelView backgroundColor:(labelFrame viewBackground). |
|
73 | 3179 |
labelFrame model:self; menu:#labelMenu. |
1329 | 3180 |
labelView cursorType:#solidCaret; cursorTypeNoFocus:#none. |
3181 |
labelView level:0. |
|
3182 |
labelView borderWidth:0. |
|
3183 |
||
3184 |
killButton := Button label:(resources string:'kill') in:self. |
|
3185 |
"/ killButton origin:(halfSpacing @ halfSpacing) |
|
3186 |
"/ extent:(killButton width @ filterField height). |
|
3187 |
killButton origin:(halfSpacing @ 1.0). |
|
3188 |
killButton topInset:(killButton height negated). |
|
3189 |
killButton beInvisible. |
|
3190 |
||
3191 |
pauseToggle := Toggle label:(resources string:'pause') in:self. |
|
3192 |
"/ pauseToggle origin:((killButton corner x + 50) @ halfSpacing) |
|
3193 |
"/ extent:(pauseToggle width @ filterField height). |
|
3194 |
pauseToggle origin:((killButton corner x + ViewSpacing + 20) @ 1.0). |
|
3195 |
pauseToggle topInset:(pauseToggle height negated). |
|
3196 |
pauseToggle beInvisible. |
|
36 | 3197 |
|
132 | 3198 |
self initializeCommandViewIn:self. |
3199 |
||
3200 |
"/ frame := VariableVerticalPanel |
|
3201 |
"/ origin:[frame borderWidth negated |
|
3202 |
"/ @ |
|
3203 |
"/ labelFrame height |
|
3204 |
"/ "/ (labelView height + labelView origin y + spacing) |
|
3205 |
"/ ] |
|
3206 |
"/ corner:(1.0 @ 1.0) |
|
3207 |
"/ in:self. |
|
3208 |
||
1834 | 3209 |
frame := VariableVerticalPanel origin:0.0@mH corner:1.0@1.0 in:self. |
132 | 3210 |
frame topInset:labelFrame height. |
3211 |
commandView notNil ifTrue:[ |
|
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
3212 |
frame bottomInset:(commandView height + spacing + spacing) |
132 | 3213 |
]. |
36 | 3214 |
|
1102 | 3215 |
topFrame := View in:frame. |
36 | 3216 |
topFrame origin:(0.0 @ 0.0) corner:(1.0 @ 0.3). |
3217 |
||
1758 | 3218 |
false ifTrue:[ |
3219 |
self createTabRulerIn:topFrame. |
|
3220 |
]. |
|
1102 | 3221 |
|
3222 |
scrollView := ScrollableView in:topFrame. |
|
3223 |
scrollView origin:(0.0 @ 0.0) corner:(1.0 @ 1.0). |
|
3224 |
||
3225 |
fileListView := SelectionInListView new. |
|
3226 |
scrollView scrolledView:fileListView. |
|
36 | 3227 |
fileListView action:[:lineNr | self fileSelect:lineNr]. |
1326 | 3228 |
fileListView doubleClickAction:[:lineNr | self fileDoubleClick:lineNr]. |
36 | 3229 |
fileListView multipleSelectOk:true. |
1010 | 3230 |
fileListView delegate:self. |
98 | 3231 |
fileListView menuHolder:self; menuPerformer:self; menuMessage:#fileListMenu. |
1122
970fc7e88639
support drag out of my list.
Claus Gittinger <cg@exept.de>
parents:
1120
diff
changeset
|
3232 |
fileListView allowDrag:true. |
1156
f3df28086973
dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents:
1154
diff
changeset
|
3233 |
fileListView dragObjectConverter:[:obj | |
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
3234 |
|dir nm path idx| |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
3235 |
|
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
3236 |
nm := obj theObject asString. |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
3237 |
idx := fileListView list indexOf:nm. |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
3238 |
idx == 0 ifTrue:[ |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
3239 |
"/ cannot happen ... |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
3240 |
nil |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
3241 |
] ifFalse:[ |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
3242 |
nm := fileList at:idx. |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
3243 |
dir := currentDirectory pathName asFilename. |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
3244 |
path := dir constructString:nm. |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
3245 |
DropObject newFile:path. |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
3246 |
] |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
3247 |
]. |
1158
ea2cd788ef59
delay tabView origin setting
Claus Gittinger <cg@exept.de>
parents:
1157
diff
changeset
|
3248 |
|
ea2cd788ef59
delay tabView origin setting
Claus Gittinger <cg@exept.de>
parents:
1157
diff
changeset
|
3249 |
"/ sigh - must be delayed - origin is not yet fixe |
ea2cd788ef59
delay tabView origin setting
Claus Gittinger <cg@exept.de>
parents:
1157
diff
changeset
|
3250 |
"/ tabRulerView leftInset:(fileListView originRelativeTo:scrollView) x. |
ea2cd788ef59
delay tabView origin setting
Claus Gittinger <cg@exept.de>
parents:
1157
diff
changeset
|
3251 |
"/ self showOrHideTabView. |
1102 | 3252 |
|
2094 | 3253 |
lowerFrame := View in:frame. |
3254 |
lowerFrame origin:(0.0 @ 0.3) corner:(1.0 @ 1.0). |
|
3255 |
||
3256 |
v := self initializeSubViewIn:lowerFrame. |
|
3257 |
||
36 | 3258 |
subView := v scrolledView. |
3259 |
(subView respondsTo:#directoryForFileDialog:) ifTrue:[ |
|
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
3260 |
subView directoryForFileDialog:currentDirectory |
36 | 3261 |
]. |
3262 |
||
1329 | 3263 |
"/ buttonPanel := HorizontalPanelView in:self. |
3264 |
"/ buttonPanel horizontalLayout:#leftSpace. |
|
3265 |
"/ buttonPanel verticalSpace:0. |
|
3266 |
"/ "/ buttonPanel verticalLayout:#top. |
|
3267 |
"/ buttonPanel borderWidth:0. |
|
3268 |
"/ |
|
3269 |
"/ buttonPanel |
|
3270 |
"/ origin:(0.5 @ halfSpacing) |
|
3271 |
"/ extent:[((width // 4) - spacing - borderWidth) |
|
3272 |
"/ @ |
|
3273 |
"/ (buttonPanel preferredExtent y max:(labelView height)) |
|
3274 |
"/ ]. |
|
3275 |
"/ "/ buttonPanel level:-1. |
|
3276 |
"/ |
|
3277 |
"/ upButton := Button in:buttonPanel. |
|
3278 |
"/ img := Image fromFile:'bitmaps/xpmBitmaps/document_images/tiny_yellow_dir_up.xpm'. |
|
3279 |
"/ upButton label:(img ? 'up'). |
|
3280 |
"/ upButton action:[self changeToParentDirectory]. |
|
1328 | 3281 |
|
36 | 3282 |
ObjectMemory addDependent:self. |
132 | 3283 |
|
1758 | 3284 |
"Modified: / 6.9.1995 / 20:26:06 / claus" |
3285 |
"Modified: / 16.9.1997 / 14:52:46 / stefan" |
|
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
3286 |
"Modified: / 6.5.1999 / 11:38:08 / cg" |
36 | 3287 |
! |
3288 |
||
132 | 3289 |
initializeCommandViewIn:frame |
3290 |
"set up the command view - can be redefined in subclasses as empty, |
|
3291 |
if no commandView is wanted" |
|
3292 |
||
3293 |
||
3294 |
commandView := EditField origin:0.0@1.0 corner:1.0@1.0 in:frame. |
|
1303 | 3295 |
commandView allInset:ViewSpacing//2. |
132 | 3296 |
commandView topInset:(commandView preferredExtent y negated - ViewSpacing). |
3297 |
||
133 | 3298 |
"/ commandView contents:'** no commands which require input here **'. |
132 | 3299 |
|
142 | 3300 |
commandView entryCompletionBlock:[:contents | |
1329 | 3301 |
|newString| |
3302 |
||
3303 |
newString := Filename |
|
3304 |
filenameCompletionFor:contents |
|
3305 |
directory:currentDirectory |
|
3306 |
directoriesOnly:false |
|
3307 |
filesOnly:false |
|
3308 |
ifMultiple:[:dir | commandView flash.]. |
|
3309 |
commandView contents:newString. |
|
3310 |
commandView cursorToEndOfLine. |
|
132 | 3311 |
]. |
3312 |
commandView leaveAction:[:key | |
|
1329 | 3313 |
|cmd nCmd empty| |
3314 |
||
3315 |
(key == #CursorDown |
|
3316 |
or:[key == #CursorUp]) ifTrue:[ |
|
3317 |
nCmd := CommandHistory size. |
|
3318 |
nCmd == 0 ifTrue:[ |
|
3319 |
empty := true |
|
3320 |
] ifFalse:[ |
|
3321 |
key == #CursorUp ifTrue:[ |
|
3322 |
commandIndex == nCmd ifTrue:[ |
|
3323 |
commandView flash. |
|
3324 |
]. |
|
3325 |
commandIndex := (commandIndex + 1) min:nCmd |
|
3326 |
] ifFalse:[ |
|
3327 |
commandIndex == 1 ifTrue:[ |
|
3328 |
commandView flash. |
|
3329 |
empty := true. |
|
3330 |
]. |
|
3331 |
commandIndex := (commandIndex - 1) max:1. |
|
3332 |
]. |
|
3333 |
]. |
|
3334 |
empty == true ifTrue:[ |
|
3335 |
commandView contents:nil |
|
3336 |
] ifFalse:[ |
|
3337 |
commandView contents:(CommandHistory at:commandIndex). |
|
3338 |
] |
|
3339 |
]. |
|
3340 |
key == #Return ifTrue:[ |
|
3341 |
cmd := commandView contents. |
|
3342 |
||
3343 |
subView insertLine:( |
|
3344 |
Text string:('>> ' , cmd) |
|
3345 |
emphasis:(Array with:#bold with:#underline with:(#color->Color blue)) |
|
539
33b603dd30ba
replaced ColoredListEntry by Text
Claus Gittinger <cg@exept.de>
parents:
525
diff
changeset
|
3346 |
"/ ColoredListEntry string:('>> ' , cmd) color:Color blue |
1329 | 3347 |
) |
3348 |
before:(subView cursorLine). |
|
3349 |
subView cursorDown:1. |
|
133 | 3350 |
|
3351 |
"/ subView insertStringAtCursor:cmd. |
|
3352 |
"/ subView insertCharAtCursor:(Character cr). |
|
132 | 3353 |
|
1329 | 3354 |
(cmd notNil and:[cmd notEmpty]) ifTrue:[ |
3355 |
self class addToCommandHistory:cmd for:nil. |
|
3356 |
self doExecuteCommand:cmd replace:false. |
|
3357 |
commandView contents:nil. |
|
3358 |
commandIndex := 0 |
|
3359 |
] |
|
3360 |
] |
|
132 | 3361 |
]. |
3362 |
||
133 | 3363 |
"Modified: 7.9.1995 / 15:48:45 / claus" |
1303 | 3364 |
"Modified: 30.8.1997 / 19:22:52 / cg" |
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
3365 |
"Modified: 18.9.1997 / 16:55:01 / stefan" |
132 | 3366 |
! |
3367 |
||
172 | 3368 |
initializeFilterPattern |
3369 |
"set an initial matchpattern - can be redefined in subclasses" |
|
3370 |
||
344
3f881dbee13a
use a model for the filter field
Claus Gittinger <cg@exept.de>
parents:
333
diff
changeset
|
3371 |
filterField model value:'*' |
172 | 3372 |
! |
3373 |
||
3374 |
initializeSubViewIn:frame |
|
3375 |
"set up the contents view - can be redefined in subclasses for |
|
3376 |
different view types (SoundFileBrowser/ImageBrowsers etc.)" |
|
3377 |
||
2094 | 3378 |
|textView| |
3379 |
||
3380 |
textView := HVScrollableView |
|
2138 | 3381 |
for:CodeView |
3382 |
miniScrollerH:true |
|
3383 |
miniScrollerV:false |
|
3384 |
in:frame. |
|
2094 | 3385 |
textView origin:(0.0 @ 0.0) corner:(1.0 @ 1.0). |
3386 |
||
2095 | 3387 |
"/ imagePreviewView := HVScrollableView |
3388 |
"/ for:ImageView |
|
3389 |
"/ miniScrollerH:true |
|
3390 |
"/ miniScrollerV:false |
|
3391 |
"/ in:frame. |
|
3392 |
"/ imagePreviewView origin:(0.0 @ 0.0) corner:(1.0 @ 1.0). |
|
3393 |
"/ |
|
3394 |
"/ imagePreviewView beInvisible. |
|
2094 | 3395 |
|
3396 |
^ textView. |
|
1158
ea2cd788ef59
delay tabView origin setting
Claus Gittinger <cg@exept.de>
parents:
1157
diff
changeset
|
3397 |
! |
ea2cd788ef59
delay tabView origin setting
Claus Gittinger <cg@exept.de>
parents:
1157
diff
changeset
|
3398 |
|
1247 | 3399 |
postRealize |
3400 |
super postRealize. |
|
1158
ea2cd788ef59
delay tabView origin setting
Claus Gittinger <cg@exept.de>
parents:
1157
diff
changeset
|
3401 |
self showOrHideTabView. |
ea2cd788ef59
delay tabView origin setting
Claus Gittinger <cg@exept.de>
parents:
1157
diff
changeset
|
3402 |
|
1247 | 3403 |
"Created: 24.7.1997 / 18:13:46 / cg" |
172 | 3404 |
! ! |
3405 |
||
1834 | 3406 |
!FileBrowser methodsFor:'menu actions'! |
3407 |
||
1950 | 3408 |
copyCommandHistory |
3409 |
"copy the command history to the clipBoard" |
|
3410 |
||
3411 |
self setTextSelection:(CommandHistory asStringCollection asString). |
|
3412 |
||
3413 |
"Modified: / 29.10.1998 / 12:17:14 / cg" |
|
3414 |
! |
|
3415 |
||
1837 | 3416 |
copyFileList |
3417 |
"copy fileList to the clipBoard" |
|
3418 |
||
3419 |
self setTextSelection:(fileListView list |
|
1868 | 3420 |
collect:[:l | |ll| |
3421 |
ll := l string withoutSeparators. |
|
3422 |
(ll endsWith:' ...') ifTrue:[ |
|
3423 |
ll copyWithoutLast:4 |
|
3424 |
] ifFalse:[ |
|
3425 |
ll |
|
3426 |
] |
|
3427 |
]) |
|
3428 |
asStringCollection asString. |
|
1837 | 3429 |
|
3430 |
"Modified: / 17.8.1998 / 10:13:10 / cg" |
|
3431 |
! |
|
3432 |
||
1920
adffddc8cfc2
added #copyFilename (to clipboard)
Claus Gittinger <cg@exept.de>
parents:
1912
diff
changeset
|
3433 |
copySelectedFileName |
adffddc8cfc2
added #copyFilename (to clipboard)
Claus Gittinger <cg@exept.de>
parents:
1912
diff
changeset
|
3434 |
"copy the selected filename to the clipBoard (for easy paste)" |
adffddc8cfc2
added #copyFilename (to clipboard)
Claus Gittinger <cg@exept.de>
parents:
1912
diff
changeset
|
3435 |
|
adffddc8cfc2
added #copyFilename (to clipboard)
Claus Gittinger <cg@exept.de>
parents:
1912
diff
changeset
|
3436 |
|sel fileName| |
adffddc8cfc2
added #copyFilename (to clipboard)
Claus Gittinger <cg@exept.de>
parents:
1912
diff
changeset
|
3437 |
|
adffddc8cfc2
added #copyFilename (to clipboard)
Claus Gittinger <cg@exept.de>
parents:
1912
diff
changeset
|
3438 |
sel := fileListView selection. |
adffddc8cfc2
added #copyFilename (to clipboard)
Claus Gittinger <cg@exept.de>
parents:
1912
diff
changeset
|
3439 |
sel size == 1 ifTrue:[ |
2138 | 3440 |
fileName := fileList at:sel first. |
3441 |
self setTextSelection:fileName |
|
1920
adffddc8cfc2
added #copyFilename (to clipboard)
Claus Gittinger <cg@exept.de>
parents:
1912
diff
changeset
|
3442 |
]. |
adffddc8cfc2
added #copyFilename (to clipboard)
Claus Gittinger <cg@exept.de>
parents:
1912
diff
changeset
|
3443 |
! |
adffddc8cfc2
added #copyFilename (to clipboard)
Claus Gittinger <cg@exept.de>
parents:
1912
diff
changeset
|
3444 |
|
1834 | 3445 |
menuExit |
3446 |
self closeRequest |
|
3447 |
||
3448 |
"Created: / 4.8.1998 / 13:41:38 / cg" |
|
3449 |
! |
|
3450 |
||
3451 |
menuOSCommand |
|
3452 |
self fileExecute |
|
3453 |
||
3454 |
"Created: / 4.8.1998 / 14:06:54 / cg" |
|
3455 |
! |
|
3456 |
||
3457 |
menuOpen |
|
3458 |
"same as a double-click" |
|
3459 |
||
3460 |
"Modified: / 4.8.1998 / 13:42:14 / cg" |
|
3461 |
! |
|
3462 |
||
3463 |
menuShowFileBrowserDocumentation |
|
3464 |
||
3465 |
"Created: / 4.8.1998 / 14:03:57 / cg" |
|
3466 |
! |
|
3467 |
||
3468 |
openAboutThisApplication |
|
3469 |
"opens an about box for this application." |
|
3470 |
||
3471 |
|rev box myClass clsRev image msg| |
|
3472 |
||
3473 |
rev := ''. |
|
3474 |
myClass := self class. |
|
3475 |
||
3476 |
(clsRev := myClass revision) notNil ifTrue: [rev := ' (rev: ', clsRev printString, ')']. |
|
3477 |
||
3478 |
msg := '\' withCRs , myClass name asBoldText, rev. |
|
3479 |
||
3480 |
AboutBox isNil ifTrue:[ |
|
1868 | 3481 |
"/ this handles bad installations of ST/X, |
3482 |
"/ where the AboutBox is missing. |
|
3483 |
"/ (May vanish in the future) |
|
3484 |
^ self information:msg |
|
1834 | 3485 |
]. |
3486 |
||
3487 |
box := AboutBox title:msg. |
|
3488 |
||
3489 |
image := self class defaultIcon. |
|
3490 |
image notNil ifTrue:[ |
|
1868 | 3491 |
box image:image |
1834 | 3492 |
]. |
3493 |
box label:'About This Application'. |
|
3494 |
box autoHideAfter:10 with:[]. |
|
3495 |
box showAtPointer. |
|
3496 |
||
3497 |
"Modified: / 14.8.1998 / 13:20:24 / cg" |
|
3498 |
! |
|
3499 |
||
3500 |
openHTMLDocument:relativeDocPath |
|
3501 |
HTMLDocumentView openFullOnDocumentationFile:relativeDocPath |
|
3502 |
||
3503 |
"Created: / 4.8.1998 / 14:06:10 / cg" |
|
3504 |
! |
|
3505 |
||
3506 |
pullDownMenu |
|
3507 |
"return the top (pullDown) menu" |
|
3508 |
||
3509 |
<resource: #programMenu> |
|
3510 |
||
3511 |
|m| |
|
3512 |
||
3513 |
m := self class menuSpec. |
|
3514 |
m := m decodeAsLiteralArray. |
|
3515 |
m receiver:self. |
|
2035
307ed5143d8b
national language stuff - again
Claus Gittinger <cg@exept.de>
parents:
2031
diff
changeset
|
3516 |
m findGuiResourcesIn:self. |
1834 | 3517 |
^ m. |
3518 |
||
3519 |
"Modified: / 14.8.1998 / 14:09:12 / cg" |
|
3520 |
"Created: / 14.8.1998 / 14:14:16 / cg" |
|
3521 |
! |
|
3522 |
||
3523 |
showAboutSTX |
|
3524 |
ToolApplicationModel openAboutSTX |
|
3525 |
||
3526 |
"Created: / 14.8.1998 / 13:18:41 / cg" |
|
3527 |
! |
|
3528 |
||
3529 |
sortChanged |
|
2020 | 3530 |
"/ Transcript show:'fBrowser:'; showCR:sortByWhat value. |
1834 | 3531 |
self updateCurrentDirectory |
3532 |
||
3533 |
"Created: / 14.8.1998 / 16:17:20 / cg" |
|
3534 |
"Modified: / 14.8.1998 / 16:44:00 / cg" |
|
3535 |
! ! |
|
3536 |
||
2102 | 3537 |
!FileBrowser methodsFor:'menu actions - cvs'! |
3538 |
||
3539 |
cvsRemoveFileAndContainer |
|
3540 |
"remove the selected file(s) and their CVS containers. |
|
3541 |
Query if user really wants to really remove them." |
|
3542 |
||
3543 |
|sel q| |
|
3544 |
||
3545 |
sel := fileListView selection. |
|
3546 |
sel size > 0 ifTrue:[ |
|
2138 | 3547 |
sel := sel collect:[:rawIndex | fileList at:rawIndex]. |
3548 |
sel size > 1 ifTrue:[ |
|
3549 |
q := resources string:'remove %1 selected files and CVS containers ?' with:(sel size) |
|
3550 |
] ifFalse:[ |
|
3551 |
q := resources string:'remove ''%1'' and CVS container ?' with:(sel first asText allBold) |
|
3552 |
]. |
|
3553 |
(self sensor shiftDown |
|
3554 |
or:[self ask:q yesButton:'remove']) ifTrue:[ |
|
3555 |
self withCursor:(Cursor wait) do:[ |
|
3556 |
self doRemoveAndRemoveFromCVS:sel |
|
3557 |
] |
|
3558 |
] |
|
2102 | 3559 |
] |
3560 |
||
3561 |
"Modified: / 16.12.1998 / 17:30:31 / cg" |
|
3562 |
! |
|
3563 |
||
3564 |
cvsUpdateDirectoryLocal |
|
3565 |
"update this directory" |
|
3566 |
||
3567 |
self |
|
2138 | 3568 |
doExecuteCommand:'cvs upd -l' replace:false |
2102 | 3569 |
|
3570 |
"Modified: / 16.12.1998 / 17:30:31 / cg" |
|
3571 |
! |
|
3572 |
||
3573 |
cvsUpdateDirectoryRecursive |
|
3574 |
"update this directory" |
|
3575 |
||
3576 |
self |
|
2138 | 3577 |
doExecuteCommand:'cvs upd -d' replace:false |
2102 | 3578 |
|
3579 |
"Modified: / 16.12.1998 / 17:30:31 / cg" |
|
3580 |
! |
|
3581 |
||
3582 |
cvsUpdateSelection |
|
3583 |
"update selected files" |
|
3584 |
||
3585 |
|sel| |
|
3586 |
||
3587 |
sel := fileListView selection. |
|
3588 |
sel size > 0 ifTrue:[ |
|
2138 | 3589 |
sel := sel collect:[:rawIndex | fileList at:rawIndex]. |
3590 |
sel do:[:fn | |
|
3591 |
self |
|
3592 |
doExecuteCommand:('cvs upd ' , fn) replace:false |
|
3593 |
] |
|
2102 | 3594 |
]. |
3595 |
! |
|
3596 |
||
3597 |
doRemoveAndRemoveFromCVS:filesToRemove |
|
3598 |
"remove the selected file(s) and their CVS containers - no questions asked" |
|
3599 |
||
3600 |
|msg idx needUpdate toRemove updateRunning yesToAll| |
|
3601 |
||
3602 |
updateRunning := listUpdateProcess notNil. |
|
3603 |
self stopUpdateProcess. |
|
3604 |
toRemove := OrderedCollection new. |
|
3605 |
||
3606 |
"/ |
|
3607 |
"/ did the directory change in the meanwhile ? |
|
3608 |
"/ |
|
3609 |
needUpdate := (currentDirectory modificationTime > timeOfLastCheck). |
|
3610 |
||
3611 |
yesToAll := false. |
|
3612 |
lockUpdate := true. |
|
3613 |
[ |
|
2138 | 3614 |
filesToRemove do:[:fileName | |
3615 |
|f| |
|
3616 |
||
3617 |
f := currentDirectory construct:fileName. |
|
3618 |
OperatingSystem accessDeniedErrorSignal handle:[:ex| |
|
3619 |
"was not able to remove it" |
|
3620 |
msg := (resources string:'cannot remove ''%1'' !!' with:fileName). |
|
3621 |
self showAlert:msg with:(OperatingSystem lastErrorString) |
|
3622 |
] do:[ |
|
3623 |
|answer contents| |
|
3624 |
||
3625 |
(f isSymbolicLink not) ifTrue:[ |
|
3626 |
self |
|
3627 |
doExecuteCommand:('cvs remove -f ' , f baseName) |
|
3628 |
replace:false. |
|
2102 | 3629 |
|
3630 |
" |
|
2138 | 3631 |
self show:nil |
2102 | 3632 |
" |
2138 | 3633 |
idx := fileList indexOf:fileName. |
3634 |
idx ~~ 0 ifTrue:[ |
|
3635 |
toRemove add:idx. |
|
3636 |
] |
|
3637 |
] |
|
3638 |
]. |
|
3639 |
]. |
|
2102 | 3640 |
] valueNowOrOnUnwindDo:[ |
2138 | 3641 |
lockUpdate := false. |
3642 |
fileListView setSelection:nil. |
|
3643 |
||
3644 |
"/ |
|
3645 |
"/ remove reverse - otherwise indices are wrong |
|
3646 |
"/ |
|
3647 |
toRemove sort. |
|
3648 |
toRemove reverseDo:[:idx | |
|
3649 |
fileList removeIndex:idx. |
|
3650 |
fileListView removeIndex:idx. |
|
3651 |
]. |
|
3652 |
||
3653 |
updateRunning ifTrue:[ |
|
3654 |
self updateCurrentDirectory |
|
3655 |
] ifFalse:[ |
|
3656 |
" |
|
3657 |
install a new check after some time |
|
3658 |
" |
|
3659 |
needUpdate ifFalse:[timeOfLastCheck := AbsoluteTime now]. |
|
3660 |
Processor removeTimedBlock:checkBlock. |
|
3661 |
Processor addTimedBlock:checkBlock afterSeconds:checkDelta. |
|
3662 |
] |
|
2102 | 3663 |
]. |
3664 |
||
3665 |
self |
|
2138 | 3666 |
doExecuteCommand:('cvs commit -m ''removed via FileBrowser''') |
3667 |
replace:false. |
|
2102 | 3668 |
|
3669 |
"Modified: / 21.10.1998 / 17:02:11 / cg" |
|
3670 |
! ! |
|
3671 |
||
172 | 3672 |
!FileBrowser methodsFor:'misc user interaction'! |
3673 |
||
1786 | 3674 |
closeRequest |
3675 |
"exit FileBrowser" |
|
3676 |
||
3677 |
(self askIfModified:'contents has not been saved.\\Modifications will be lost when FileBrowser is closed.' |
|
1868 | 3678 |
yesButton:'close') |
1786 | 3679 |
ifTrue:[ |
1868 | 3680 |
"/ self windowGroup closeDownViews. |
3681 |
super closeRequest |
|
1786 | 3682 |
] |
3683 |
||
3684 |
"Created: / 3.8.1998 / 19:55:06 / cg" |
|
1834 | 3685 |
"Modified: / 4.8.1998 / 18:21:03 / cg" |
1786 | 3686 |
! |
3687 |
||
1339
4b712d8c1738
Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents:
1336
diff
changeset
|
3688 |
discardChangesDialog |
4b712d8c1738
Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents:
1336
diff
changeset
|
3689 |
"ask the user if changes should be discarded, |
4b712d8c1738
Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents:
1336
diff
changeset
|
3690 |
return true if changes should be discarded, false otherwise" |
4b712d8c1738
Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents:
1336
diff
changeset
|
3691 |
|
4b712d8c1738
Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents:
1336
diff
changeset
|
3692 |
^ self askIfModified:'contents has not been saved.\\Modifications will be lost when directory is changed.' |
1393 | 3693 |
yesButton:'change' |
1339
4b712d8c1738
Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents:
1336
diff
changeset
|
3694 |
|
4b712d8c1738
Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents:
1336
diff
changeset
|
3695 |
"Created: 2.10.1997 / 14:08:37 / stefan" |
4b712d8c1738
Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents:
1336
diff
changeset
|
3696 |
! |
4b712d8c1738
Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents:
1336
diff
changeset
|
3697 |
|
346 | 3698 |
filterPatternChanged |
1911
6d1b77eda98f
check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents:
1903
diff
changeset
|
3699 |
fileListView scrollToTop. |
6d1b77eda98f
check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents:
1903
diff
changeset
|
3700 |
fileListView deselect. |
346 | 3701 |
self updateCurrentDirectory |
1911
6d1b77eda98f
check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents:
1903
diff
changeset
|
3702 |
|
6d1b77eda98f
check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents:
1903
diff
changeset
|
3703 |
"Modified: / 3.10.1998 / 18:23:34 / cg" |
346 | 3704 |
! |
3705 |
||
172 | 3706 |
update:what with:someArgument from:changedObject |
3707 |
realized ifFalse:[^ self]. |
|
36 | 3708 |
|
172 | 3709 |
(what == #aboutToExit) ifTrue:[ |
1317 | 3710 |
"system wants to shut down this |
3711 |
- if text was modified, pop up, and ask user and save if requested." |
|
3712 |
||
3713 |
(subView modified and:[subView contentsWasSaved not]) ifTrue:[ |
|
3714 |
self raiseDeiconified. |
|
3715 |
||
3716 |
(self |
|
3717 |
ask:(resources at:'FileBrowser:\\contents has not been saved.\\Save before exiting ?') |
|
3718 |
yesButton:'save' |
|
3719 |
noButton:'don''t save') |
|
3720 |
ifTrue:[ |
|
3721 |
subView acceptAction notNil ifTrue:[ |
|
3722 |
subView accept |
|
3723 |
] ifFalse:[ |
|
3724 |
subView save |
|
3725 |
] |
|
3726 |
] |
|
3727 |
]. |
|
3728 |
^ self |
|
172 | 3729 |
]. |
3730 |
changedObject == tabSpec ifTrue:[ |
|
1317 | 3731 |
fileListView invalidate |
172 | 3732 |
]. |
380 | 3733 |
|
585
be0241bf7268
use #invalidate instead of #redraw
Claus Gittinger <cg@exept.de>
parents:
564
diff
changeset
|
3734 |
"Modified: 29.5.1996 / 16:13:43 / cg" |
172 | 3735 |
! ! |
3736 |
||
3737 |
!FileBrowser methodsFor:'pathField user interaction'! |
|
3738 |
||
1271 | 3739 |
addDirToJavaClassPath |
3740 |
"add the current path to javas classPath |
|
3741 |
(only available with ST/J System" |
|
3742 |
||
3743 |
Java addToClassPath:currentDirectory pathName |
|
3744 |
||
3745 |
"Modified: 14.12.1996 / 15:37:47 / cg" |
|
3746 |
"Created: 1.8.1997 / 21:25:22 / cg" |
|
3747 |
! |
|
3748 |
||
1272 | 3749 |
addDirToJavaSourcePath |
3750 |
"add the current path to javas sourcePath |
|
3751 |
(only available with ST/J System" |
|
3752 |
||
3753 |
Java addToSourcePath:currentDirectory pathName |
|
3754 |
||
3755 |
"Modified: 14.12.1996 / 15:37:47 / cg" |
|
3756 |
"Created: 2.8.1997 / 14:11:19 / cg" |
|
3757 |
! |
|
3758 |
||
172 | 3759 |
changeCurrentDirectory |
3760 |
"if text was modified show a queryBox, |
|
1329 | 3761 |
otherwise ask for & change to that directory" |
172 | 3762 |
|
1339
4b712d8c1738
Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents:
1336
diff
changeset
|
3763 |
self discardChangesDialog ifTrue:[ |
1393 | 3764 |
self queryForDirectoryToChange |
36 | 3765 |
] |
1329 | 3766 |
|
3767 |
"Modified: 21.9.1997 / 23:45:35 / cg" |
|
1339
4b712d8c1738
Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents:
1336
diff
changeset
|
3768 |
"Modified: 2.10.1997 / 14:09:02 / stefan" |
36 | 3769 |
! |
3770 |
||
172 | 3771 |
changeDirectoryTo:aDirectoryName |
3772 |
"sent from label menu to change back to a previous directory" |
|
132 | 3773 |
|
1339
4b712d8c1738
Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents:
1336
diff
changeset
|
3774 |
self discardChangesDialog ifTrue:[ |
1868 | 3775 |
self doChangeCurrentDirectoryTo:aDirectoryName updateHistory:true "/false. |
1339
4b712d8c1738
Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents:
1336
diff
changeset
|
3776 |
]. |
4b712d8c1738
Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents:
1336
diff
changeset
|
3777 |
|
1737 | 3778 |
"Modified: / 2.10.1997 / 14:09:24 / stefan" |
3779 |
"Modified: / 21.7.1998 / 16:38:03 / cg" |
|
172 | 3780 |
! |
3781 |
||
1329 | 3782 |
changeToDefaultDirectory |
3783 |
"if text was modified show a queryBox, |
|
3784 |
otherwise change immediately to the default directory" |
|
3785 |
||
1339
4b712d8c1738
Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents:
1336
diff
changeset
|
3786 |
self discardChangesDialog ifTrue:[ |
1393 | 3787 |
self doChangeToDefaultDirectory |
1329 | 3788 |
] |
3789 |
||
3790 |
"Modified: 21.9.1997 / 23:45:04 / cg" |
|
1339
4b712d8c1738
Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents:
1336
diff
changeset
|
3791 |
"Modified: 2.10.1997 / 14:09:33 / stefan" |
1329 | 3792 |
! |
3793 |
||
172 | 3794 |
changeToHomeDirectory |
3795 |
"if text was modified show a queryBox, |
|
1329 | 3796 |
otherwise change immediately to the home directory" |
132 | 3797 |
|
1339
4b712d8c1738
Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents:
1336
diff
changeset
|
3798 |
self discardChangesDialog ifTrue:[ |
1393 | 3799 |
self doChangeToHomeDirectory |
172 | 3800 |
] |
1329 | 3801 |
|
3802 |
"Modified: 21.9.1997 / 23:45:10 / cg" |
|
1339
4b712d8c1738
Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents:
1336
diff
changeset
|
3803 |
"Modified: 2.10.1997 / 14:09:42 / stefan" |
172 | 3804 |
! |
45 | 3805 |
|
172 | 3806 |
changeToParentDirectory |
3807 |
"if text was modified show a queryBox, |
|
1329 | 3808 |
otherwise change immediately to the parent directory" |
45 | 3809 |
|
1339
4b712d8c1738
Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents:
1336
diff
changeset
|
3810 |
self discardChangesDialog ifTrue:[ |
1393 | 3811 |
self doChangeToParentDirectory |
36 | 3812 |
] |
1329 | 3813 |
|
3814 |
"Modified: 21.9.1997 / 23:45:15 / cg" |
|
1339
4b712d8c1738
Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents:
1336
diff
changeset
|
3815 |
"Modified: 2.10.1997 / 14:09:55 / stefan" |
98 | 3816 |
! |
3817 |
||
172 | 3818 |
copyPath |
3819 |
"copy current path into cut & paste buffer" |
|
3820 |
||
873 | 3821 |
self setTextSelection:currentDirectory pathName |
3822 |
||
3823 |
"Modified: 14.12.1996 / 15:37:47 / cg" |
|
172 | 3824 |
! |
3825 |
||
1893
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
3826 |
fileAddToJavaClassPath |
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
3827 |
"add the current path to javas classPath |
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
3828 |
(only available with ST/J System" |
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
3829 |
|
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
3830 |
|f| |
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
3831 |
|
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
3832 |
f := self getSelectedFileName. |
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
3833 |
f isNil ifTrue:[ |
2138 | 3834 |
^ self addDirToJavaClassPath |
1893
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
3835 |
]. |
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
3836 |
f := currentDirectory asFilename construct:f. |
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
3837 |
Java addToClassPath:(f pathName) |
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
3838 |
|
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
3839 |
"Created: / 9.11.1998 / 05:41:34 / cg" |
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
3840 |
"Modified: / 9.11.1998 / 05:56:00 / cg" |
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
3841 |
! |
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
3842 |
|
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
3843 |
fileRemoveFromJavaClassPath |
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
3844 |
"remove the current path from javas classPath |
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
3845 |
(only available with ST/J System" |
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
3846 |
|
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
3847 |
|f| |
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
3848 |
|
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
3849 |
f := self getSelectedFileName. |
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
3850 |
f isNil ifTrue:[ |
2138 | 3851 |
^ self removeDirToJavaClassPath |
1893
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
3852 |
]. |
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
3853 |
f := currentDirectory asFilename construct:f. |
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
3854 |
Java removeFromClassPath:(f pathName) |
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
3855 |
|
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
3856 |
"Created: / 9.11.1998 / 05:42:05 / cg" |
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
3857 |
"Modified: / 9.11.1998 / 05:56:14 / cg" |
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
3858 |
! |
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
3859 |
|
172 | 3860 |
labelMenu |
1040 | 3861 |
"return the popUpMenu for the path label" |
3862 |
||
1235
13610578a5d2
resource flag: #menu -> #programMenu
Claus Gittinger <cg@exept.de>
parents:
1227
diff
changeset
|
3863 |
<resource: #programMenu> |
1040 | 3864 |
|
2051 | 3865 |
|m| |
3866 |
||
3867 |
m := self class directoryMenuSpec. |
|
3868 |
m menuPerformer:self. |
|
3869 |
^ m |
|
1834 | 3870 |
|
3871 |
"Modified: / 14.8.1998 / 12:11:16 / cg" |
|
3872 |
! |
|
3873 |
||
3874 |
labelMenu_old |
|
3875 |
"return the popUpMenu for the path label" |
|
3876 |
||
3877 |
<resource: #programMenu> |
|
3878 |
||
1737 | 3879 |
|items menu currentIndex| |
1736
36cab4d1d655
remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents:
1735
diff
changeset
|
3880 |
|
36cab4d1d655
remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents:
1735
diff
changeset
|
3881 |
items := #( |
1868 | 3882 |
('copy path' copyPath ) |
3883 |
('-' ) |
|
3884 |
('up' changeToParentDirectory ) |
|
3885 |
('back' changeToPreviousDirectory ) |
|
3886 |
('change to home-directory' changeToHomeDirectory ) |
|
3887 |
('change to default-directory' changeToDefaultDirectory ) |
|
3888 |
('change directory ...' changeCurrentDirectory ) |
|
3889 |
). |
|
1400 | 3890 |
|
3891 |
(JavaClassReader notNil and:[JavaClassReader isLoaded]) ifTrue:[ |
|
1868 | 3892 |
items := items , #( |
3893 |
( '-') |
|
3894 |
( 'add to JavaClassPath' addDirToJavaClassPath) |
|
3895 |
( 'add to JavaSourcePath' addDirToJavaSourcePath) |
|
3896 |
( 'remove from JavaClassPath' removeDirFromJavaClassPath) |
|
3897 |
( 'remove from JavaSourcePath' removeDirFromJavaSourcePath) |
|
3898 |
). |
|
1271 | 3899 |
]. |
3900 |
||
172 | 3901 |
DirectoryHistory size > 0 ifTrue:[ |
1868 | 3902 |
items := items copyWith:#('-'). |
3903 |
items := items , |
|
3904 |
(DirectoryHistory |
|
3905 |
collect:[:dirName | |
|
3906 |
Array |
|
3907 |
with:dirName |
|
3908 |
with:#changeDirectoryTo: |
|
3909 |
with:nil |
|
3910 |
with:dirName |
|
3911 |
] |
|
3912 |
). |
|
3913 |
currentIndex := items findFirst:[:i | (i at:1) = currentDirectory pathName]. |
|
3914 |
currentIndex == 0 ifTrue:[currentIndex := nil]. |
|
123 | 3915 |
]. |
172 | 3916 |
|
3917 |
menu := PopUpMenu |
|
1868 | 3918 |
itemList:items |
3919 |
resources:resources. |
|
172 | 3920 |
|
3921 |
previousDirectory isNil ifTrue:[ |
|
1868 | 3922 |
menu disable:#changeToPreviousDirectory. |
132 | 3923 |
]. |
1737 | 3924 |
currentIndex notNil ifTrue:[ |
1868 | 3925 |
menu disable:currentIndex |
1737 | 3926 |
]. |
1400 | 3927 |
(JavaClassReader notNil and:[JavaClassReader isLoaded]) ifTrue:[ |
1868 | 3928 |
(Java classPath includes:currentDirectory pathName) ifTrue:[ |
3929 |
menu disable:#addDirToJavaClassPath |
|
3930 |
] ifFalse:[ |
|
3931 |
menu disable:#removeDirFromJavaClassPath |
|
3932 |
]. |
|
3933 |
(Java sourcePath includes:currentDirectory pathName) ifTrue:[ |
|
3934 |
menu disable:#addDirToJavaSourcePath |
|
3935 |
] ifFalse:[ |
|
3936 |
menu disable:#removeDirFromJavaSourcePath |
|
3937 |
]. |
|
1393 | 3938 |
]. |
172 | 3939 |
^menu. |
1040 | 3940 |
|
1737 | 3941 |
"Modified: / 21.7.1998 / 16:43:25 / cg" |
1834 | 3942 |
"Created: / 14.8.1998 / 12:10:02 / cg" |
172 | 3943 |
! |
3944 |
||
1327 | 3945 |
pathChanged:newPath |
1339
4b712d8c1738
Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents:
1336
diff
changeset
|
3946 |
"change directory to newPath. If newPath is a filename, change |
4b712d8c1738
Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents:
1336
diff
changeset
|
3947 |
to its directory and get get the file." |
4b712d8c1738
Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents:
1336
diff
changeset
|
3948 |
|
2135
88eb91efc5dd
care for caseless systems when entering a fileName
Claus Gittinger <cg@exept.de>
parents:
2129
diff
changeset
|
3949 |
|f name lcName idx| |
1339
4b712d8c1738
Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents:
1336
diff
changeset
|
3950 |
|
4b712d8c1738
Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents:
1336
diff
changeset
|
3951 |
self discardChangesDialog ifTrue:[ |
2138 | 3952 |
f := newPath asFilename. |
3953 |
(f isDirectory) ifTrue:[ |
|
3954 |
self changeDirectoryTo:newPath |
|
3955 |
] ifFalse:[ |
|
3956 |
self changeDirectoryTo:(f directoryName). |
|
3957 |
self changed:#path. |
|
3958 |
name := f baseName. |
|
3959 |
idx := fileList indexOf:name. |
|
3960 |
idx = 0 ifTrue:[ |
|
3961 |
lcName := name asLowercase. |
|
3962 |
f class isCaseSensitive ifFalse:[ |
|
3963 |
idx := fileList findFirst:[:nm | nm asLowercase = lcName]. |
|
3964 |
] |
|
3965 |
]. |
|
3966 |
fileListView selection:idx. |
|
3967 |
self fileSelect:name. |
|
3968 |
self fileGet:true. |
|
3969 |
]. |
|
1339
4b712d8c1738
Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents:
1336
diff
changeset
|
3970 |
] ifFalse:[ |
2138 | 3971 |
self changed:#path. |
2135
88eb91efc5dd
care for caseless systems when entering a fileName
Claus Gittinger <cg@exept.de>
parents:
2129
diff
changeset
|
3972 |
]. |
88eb91efc5dd
care for caseless systems when entering a fileName
Claus Gittinger <cg@exept.de>
parents:
2129
diff
changeset
|
3973 |
|
88eb91efc5dd
care for caseless systems when entering a fileName
Claus Gittinger <cg@exept.de>
parents:
2129
diff
changeset
|
3974 |
"Created: / 21.9.1997 / 10:43:12 / cg" |
88eb91efc5dd
care for caseless systems when entering a fileName
Claus Gittinger <cg@exept.de>
parents:
2129
diff
changeset
|
3975 |
"Modified: / 7.10.1997 / 14:10:39 / stefan" |
88eb91efc5dd
care for caseless systems when entering a fileName
Claus Gittinger <cg@exept.de>
parents:
2129
diff
changeset
|
3976 |
"Modified: / 30.4.1999 / 11:19:29 / cg" |
1327 | 3977 |
! |
3978 |
||
172 | 3979 |
queryForDirectoryToChange |
3980 |
"query for new directory" |
|
123 | 3981 |
|
1168
b157f3712548
care for nil returns from userName/groupName * time queries
Claus Gittinger <cg@exept.de>
parents:
1166
diff
changeset
|
3982 |
|queryBox dirName| |
98 | 3983 |
|
172 | 3984 |
queryBox := FilenameEnterBox |
1317 | 3985 |
title:(resources at:'change directory to:') withCRs |
3986 |
okText:(resources at:'change') |
|
3987 |
action:[:newName | dirName := newName]. |
|
172 | 3988 |
"/ queryBox initialText:''. |
1168
b157f3712548
care for nil returns from userName/groupName * time queries
Claus Gittinger <cg@exept.de>
parents:
1166
diff
changeset
|
3989 |
queryBox showAtPointer. |
b157f3712548
care for nil returns from userName/groupName * time queries
Claus Gittinger <cg@exept.de>
parents:
1166
diff
changeset
|
3990 |
queryBox destroy. |
b157f3712548
care for nil returns from userName/groupName * time queries
Claus Gittinger <cg@exept.de>
parents:
1166
diff
changeset
|
3991 |
self doChangeCurrentDirectoryTo:dirName updateHistory:true. |
b157f3712548
care for nil returns from userName/groupName * time queries
Claus Gittinger <cg@exept.de>
parents:
1166
diff
changeset
|
3992 |
|
b157f3712548
care for nil returns from userName/groupName * time queries
Claus Gittinger <cg@exept.de>
parents:
1166
diff
changeset
|
3993 |
"Modified: 28.4.1997 / 19:50:52 / cg" |
b157f3712548
care for nil returns from userName/groupName * time queries
Claus Gittinger <cg@exept.de>
parents:
1166
diff
changeset
|
3994 |
"Modified: 28.4.1997 / 22:30:40 / dq" |
1271 | 3995 |
! |
3996 |
||
3997 |
removeDirFromJavaClassPath |
|
3998 |
"remove the current path from javas classPath |
|
3999 |
(only available with ST/J System" |
|
4000 |
||
4001 |
Java removeFromClassPath:currentDirectory pathName |
|
4002 |
||
4003 |
"Modified: 14.12.1996 / 15:37:47 / cg" |
|
4004 |
"Created: 1.8.1997 / 21:25:36 / cg" |
|
1272 | 4005 |
! |
4006 |
||
4007 |
removeDirFromJavaSourcePath |
|
4008 |
"remove the current path from javas sourcePath |
|
4009 |
(only available with ST/J System" |
|
4010 |
||
4011 |
Java removeFromSourcePath:currentDirectory pathName |
|
4012 |
||
4013 |
"Modified: 14.12.1996 / 15:37:47 / cg" |
|
4014 |
"Created: 2.8.1997 / 14:11:41 / cg" |
|
36 | 4015 |
! ! |
4016 |
||
4017 |
!FileBrowser methodsFor:'private'! |
|
4018 |
||
172 | 4019 |
ask:question yesButton:yesButtonText |
4020 |
"common method to ask a yes/no question; return true or false" |
|
36 | 4021 |
|
172 | 4022 |
^ self ask:question yesButton:yesButtonText noButton:'cancel' |
4023 |
! |
|
93 | 4024 |
|
172 | 4025 |
ask:question yesButton:yesButtonText noButton:noButtonText |
36 | 4026 |
"common method to ask a yes/no question" |
4027 |
||
380 | 4028 |
^ Dialog |
1317 | 4029 |
confirm:question withCRs |
4030 |
yesLabel:(resources at:yesButtonText) |
|
4031 |
noLabel:(resources at:noButtonText) |
|
37 | 4032 |
|
380 | 4033 |
"Modified: 21.2.1996 / 01:19:21 / cg" |
36 | 4034 |
! |
4035 |
||
1142
9066d7d02a3a
remember last executed command per suffix; offer this as default.
Claus Gittinger <cg@exept.de>
parents:
1141
diff
changeset
|
4036 |
askForCommandFor:fileName thenDo:aBlock |
172 | 4037 |
"setup and launch a querybox to ask for unix command. |
4038 |
Then evaluate aBlock passing the command-string as argument." |
|
93 | 4039 |
|
1834 | 4040 |
|box osName| |
4041 |
||
4042 |
osName := OperatingSystem platformName. |
|
93 | 4043 |
|
172 | 4044 |
box := FilenameEnterBox |
1868 | 4045 |
title:(resources string:'execute %1 command:' with:osName) |
4046 |
okText:(resources string:'execute') |
|
4047 |
action:aBlock. |
|
79 | 4048 |
|
172 | 4049 |
fileName notNil ifTrue:[ |
1868 | 4050 |
self initialCommandFor:fileName into:box. |
172 | 4051 |
]. |
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
4052 |
box directory:currentDirectory. |
1142
9066d7d02a3a
remember last executed command per suffix; offer this as default.
Claus Gittinger <cg@exept.de>
parents:
1141
diff
changeset
|
4053 |
box showAtPointer. |
9066d7d02a3a
remember last executed command per suffix; offer this as default.
Claus Gittinger <cg@exept.de>
parents:
1141
diff
changeset
|
4054 |
box destroy. |
36 | 4055 |
|
1834 | 4056 |
"Modified: / 7.9.1995 / 10:31:54 / claus" |
4057 |
"Modified: / 16.9.1997 / 15:35:10 / stefan" |
|
4058 |
"Modified: / 14.8.1998 / 14:12:52 / cg" |
|
36 | 4059 |
! |
4060 |
||
98 | 4061 |
askIfModified:question yesButton:yesButtonText |
4062 |
"tell user, that code has been modified - let her confirm" |
|
4063 |
||
4064 |
(subView modified not or:[subView contentsWasSaved]) ifTrue:[ |
|
1393 | 4065 |
^ true |
98 | 4066 |
]. |
1340 | 4067 |
(self ask:(resources string:question) yesButton:yesButtonText) ifTrue:[ |
1393 | 4068 |
"/ reset modified flag so question is asked only once |
4069 |
subView modified:false. |
|
4070 |
^ true |
|
1340 | 4071 |
]. |
4072 |
^ false |
|
1339
4b712d8c1738
Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents:
1336
diff
changeset
|
4073 |
|
4b712d8c1738
Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents:
1336
diff
changeset
|
4074 |
"Modified: 2.10.1997 / 14:23:47 / stefan" |
98 | 4075 |
! |
4076 |
||
1162 | 4077 |
getSelectedFileName |
4078 |
"returns the currently selected file; shows an error if |
|
4079 |
multiple files are selected" |
|
4080 |
||
4081 |
|sel| |
|
4082 |
||
4083 |
sel := fileListView selection. |
|
4084 |
(sel size > 1) ifTrue:[ |
|
2138 | 4085 |
self onlyOneSelection |
1162 | 4086 |
] ifFalse:[ |
2138 | 4087 |
sel notNil ifTrue:[ |
4088 |
^ fileList at:sel first ifAbsent:nil |
|
4089 |
] |
|
1162 | 4090 |
]. |
4091 |
^ nil |
|
1911
6d1b77eda98f
check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents:
1903
diff
changeset
|
4092 |
|
6d1b77eda98f
check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents:
1903
diff
changeset
|
4093 |
"Modified: / 3.10.1998 / 18:21:23 / cg" |
1162 | 4094 |
! |
4095 |
||
4096 |
onlyOneSelection |
|
4097 |
"show a warning, that only one file must be selected for |
|
4098 |
this operation" |
|
4099 |
||
4100 |
self warn:'exactly one file must be selected !!' |
|
4101 |
! |
|
4102 |
||
4103 |
selectedFilesDo:aBlock |
|
4104 |
"evaluate aBlock on all selected files; |
|
4105 |
show a wait cursor while doing this" |
|
4106 |
||
1969 | 4107 |
|sel action| |
1162 | 4108 |
|
4109 |
sel := fileListView selection. |
|
4110 |
sel notNil ifTrue:[ |
|
2138 | 4111 |
sel := sel collect:[:aSelectionIndex | |
4112 |
|nm| |
|
4113 |
||
4114 |
nm := fileList at:aSelectionIndex ifAbsent:nil. |
|
4115 |
nm notNil ifTrue:[ |
|
4116 |
nm := nm string. |
|
4117 |
(nm endsWith:' ...') ifTrue:[ |
|
4118 |
nm := (nm copyWithoutLast:4) withoutSpaces |
|
4119 |
]. |
|
4120 |
]. |
|
4121 |
nm |
|
4122 |
]. |
|
4123 |
action := [ |
|
4124 |
sel do:[:nm | |
|
4125 |
nm notNil ifTrue:[ |
|
4126 |
aBlock value:nm |
|
4127 |
] |
|
4128 |
] |
|
4129 |
]. |
|
4130 |
Processor activeProcess == self windowGroup process ifTrue:[ |
|
4131 |
self withWaitCursorDo:action |
|
4132 |
] ifFalse:[ |
|
4133 |
action value |
|
4134 |
] |
|
1162 | 4135 |
] |
4136 |
||
1974 | 4137 |
"Modified: / 16.12.1998 / 17:30:57 / cg" |
1162 | 4138 |
! |
4139 |
||
4140 |
show:something |
|
4141 |
"show something in subview and undef acceptAction" |
|
4142 |
||
4143 |
subView contents:something. |
|
4144 |
subView acceptAction:nil. |
|
4145 |
subView modified:false. |
|
4146 |
currentFileName := nil |
|
4147 |
! |
|
4148 |
||
4149 |
showAlert:aString with:anErrorString |
|
4150 |
"show an alertbox, displaying the last Unix-error" |
|
4151 |
||
4152 |
|msg| |
|
4153 |
||
4154 |
anErrorString isNil ifTrue:[ |
|
1317 | 4155 |
msg := aString |
1162 | 4156 |
] ifFalse:[ |
1317 | 4157 |
msg := aString , '\\(' , anErrorString , ')' |
1162 | 4158 |
]. |
4159 |
self warn:msg withCRs |
|
4160 |
! |
|
4161 |
||
4162 |
withoutHiddenFiles:aCollection |
|
4163 |
"remove hidden files (i.e. those that start with '.') from |
|
4164 |
the list in aCollection" |
|
4165 |
||
4166 |
|newCollection| |
|
4167 |
||
4168 |
newCollection := aCollection species new. |
|
4169 |
aCollection do:[:fname | |
|
1868 | 4170 |
|ignore| |
4171 |
||
4172 |
ignore := false. |
|
4173 |
||
4174 |
((fname startsWith:'.') and:[fname ~= '..']) ifTrue:[ |
|
4175 |
showingHiddenFiles value "showDotFiles" ifFalse:[ |
|
4176 |
ignore := true |
|
4177 |
] |
|
4178 |
]. |
|
4179 |
ignore ifFalse:[ |
|
4180 |
newCollection add:fname |
|
4181 |
] |
|
1162 | 4182 |
]. |
4183 |
^ newCollection |
|
4184 |
||
1834 | 4185 |
"Modified: / 4.8.1998 / 13:46:27 / cg" |
1162 | 4186 |
! ! |
4187 |
||
4188 |
!FileBrowser methodsFor:'private - actions & command execution'! |
|
4189 |
||
4190 |
binaryFileAction:aFilename |
|
4191 |
"for some binary files, if double clicked, we can do some useful |
|
4192 |
action ..." |
|
4193 |
||
1330 | 4194 |
(currentDirectory construct:aFilename) isExecutableProgram ifTrue:[ |
1329 | 4195 |
(OperatingSystem executeCommand:'cd ', currentDirectory pathName, '; ',aFilename) |
4196 |
ifTrue:[^true]. |
|
1162 | 4197 |
]. |
4198 |
^ self imageAction:aFilename |
|
4199 |
||
4200 |
"Modified: 19.6.1996 / 09:44:07 / cg" |
|
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
4201 |
"Modified: 18.9.1997 / 17:18:04 / stefan" |
1162 | 4202 |
! |
4203 |
||
1358 | 4204 |
doExecuteCommand:commandArg replace:replace |
1162 | 4205 |
"execute a unix command inserting the output of the command. |
4206 |
If replace is true, all text is replaced by the commands output; |
|
4207 |
otherwise, its inserted as selected text at the cursor position." |
|
4208 |
||
1493 | 4209 |
|command stream line lnr myProcess myPriority startLine startCol stopSignal |
1983
50157c992ef9
subprocess name of button event handler
Claus Gittinger <cg@exept.de>
parents:
1981
diff
changeset
|
4210 |
pauseSignal access stillReplacing pauseHolder lowerFrameView |
50157c992ef9
subprocess name of button event handler
Claus Gittinger <cg@exept.de>
parents:
1981
diff
changeset
|
4211 |
buttonWindowGroup| |
1162 | 4212 |
|
1358 | 4213 |
command := commandArg asString. |
4214 |
||
1162 | 4215 |
access := Semaphore forMutualExclusion name:'accessLock'. |
4216 |
stopSignal := Signal new. |
|
1335
4f8ee6e1d8e1
Use signal instead polling for pauseButton in #doExecuteCommand:replace:.
Stefan Vogel <sv@exept.de>
parents:
1334
diff
changeset
|
4217 |
pauseSignal := Signal new. |
1162 | 4218 |
|
4219 |
" |
|
1298
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
4220 |
The following is tricky: |
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
4221 |
the pauseToggle & killButton will |
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
4222 |
be handled by their own windowGroup process. |
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
4223 |
This means, that they respond to events even though |
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
4224 |
I myself am reading the commands output. |
1162 | 4225 |
" |
1298
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
4226 |
|
1329 | 4227 |
commandView beInvisible. |
4228 |
||
1298
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
4229 |
" |
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
4230 |
must take kill & pauseButtons out of my group |
1162 | 4231 |
" |
1298
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
4232 |
killButton windowGroup:nil. |
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
4233 |
pauseToggle windowGroup:nil. |
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
4234 |
|
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
4235 |
" |
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
4236 |
bring them to front, and turn hidden-mode off |
1162 | 4237 |
" |
1298
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
4238 |
killButton raise; beVisible. |
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
4239 |
pauseToggle raise; beVisible. |
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
4240 |
|
1162 | 4241 |
" |
1298
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
4242 |
kill will make me raise the stopSignal when pressed |
1162 | 4243 |
" |
4244 |
killButton |
|
2138 | 4245 |
action:[ |
4246 |
stream notNil ifTrue:[ |
|
4247 |
access critical:[ |
|
4248 |
myProcess interruptWith:[stopSignal raiseRequest]. |
|
4249 |
] |
|
4250 |
] |
|
4251 |
]. |
|
1298
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
4252 |
|
1162 | 4253 |
" |
1298
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
4254 |
pause makes me stop reading the commands output |
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
4255 |
" |
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
4256 |
pauseHolder := false asValue. |
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
4257 |
pauseToggle model:pauseHolder. |
1335
4f8ee6e1d8e1
Use signal instead polling for pauseButton in #doExecuteCommand:replace:.
Stefan Vogel <sv@exept.de>
parents:
1334
diff
changeset
|
4258 |
pauseToggle pressAction:[ |
2138 | 4259 |
stream notNil ifTrue:[ |
4260 |
access critical:[ |
|
4261 |
myProcess interruptWith:[pauseSignal raiseRequest]. |
|
4262 |
] |
|
4263 |
] |
|
1335
4f8ee6e1d8e1
Use signal instead polling for pauseButton in #doExecuteCommand:replace:.
Stefan Vogel <sv@exept.de>
parents:
1334
diff
changeset
|
4264 |
]. |
4f8ee6e1d8e1
Use signal instead polling for pauseButton in #doExecuteCommand:replace:.
Stefan Vogel <sv@exept.de>
parents:
1334
diff
changeset
|
4265 |
|
1298
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
4266 |
|
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
4267 |
" |
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
4268 |
start kill button under its own windowgroup |
1162 | 4269 |
" |
4270 |
killButton openAutonomous. |
|
1983
50157c992ef9
subprocess name of button event handler
Claus Gittinger <cg@exept.de>
parents:
1981
diff
changeset
|
4271 |
buttonWindowGroup := killButton windowGroup. |
50157c992ef9
subprocess name of button event handler
Claus Gittinger <cg@exept.de>
parents:
1981
diff
changeset
|
4272 |
buttonWindowGroup process name:'FileBrowser sub'. |
50157c992ef9
subprocess name of button event handler
Claus Gittinger <cg@exept.de>
parents:
1981
diff
changeset
|
4273 |
buttonWindowGroup process processGroupId:(Processor activeProcess id). |
1298
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
4274 |
|
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
4275 |
" |
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
4276 |
and add the pauseToggle to its windowGroup |
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
4277 |
" |
1983
50157c992ef9
subprocess name of button event handler
Claus Gittinger <cg@exept.de>
parents:
1981
diff
changeset
|
4278 |
pauseToggle windowGroup:buttonWindowGroup. |
1298
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
4279 |
|
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
4280 |
|
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
4281 |
lowerFrameView := subView superView. |
1162 | 4282 |
|
4283 |
" |
|
4284 |
go fork a pipe and read it |
|
4285 |
" |
|
4286 |
self label:(myName , ': executing ' , (command copyTo:(20 min:command size)) , ' ...'). |
|
4287 |
[ |
|
4288 |
self withWaitCursorDo:[ |
|
2138 | 4289 |
stopSignal catch:[ |
4290 |
pauseSignal handle:[:ex| |
|
4291 |
|noPauseSema| |
|
4292 |
||
4293 |
"/ |
|
4294 |
"/ allow interaction with |
|
4295 |
"/ the codeView via the other windowGroup |
|
4296 |
"/ |
|
4297 |
lowerFrameView windowGroup:buttonWindowGroup. |
|
4298 |
||
4299 |
"/ |
|
4300 |
"/ wait for pause to be turned off |
|
4301 |
"/ |
|
4302 |
noPauseSema := Semaphore new. |
|
4303 |
pauseHolder onChangeSend:#signal to:noPauseSema. |
|
4304 |
noPauseSema wait. |
|
4305 |
||
4306 |
"/ |
|
4307 |
"/ no interaction with the codeView ... |
|
4308 |
"/ |
|
4309 |
lowerFrameView windowGroup:(self windowGroup). |
|
4310 |
ex proceed. |
|
4311 |
] do:[ |
|
4312 |
startLine := subView cursorLine. |
|
4313 |
startCol := subView cursorCol. |
|
4314 |
||
4315 |
" |
|
4316 |
this can be a time consuming operation; therefore lower my priority |
|
4317 |
" |
|
4318 |
myProcess := Processor activeProcess. |
|
1912 | 4319 |
"/ myPriority := myProcess priority. |
4320 |
"/ myProcess priority:(Processor userBackgroundPriority). |
|
4321 |
||
2138 | 4322 |
stream := PipeStream |
4323 |
readingFrom:command |
|
4324 |
errorDisposition:#inline |
|
4325 |
inDirectory:currentDirectory. |
|
4326 |
stream notNil ifTrue:[ |
|
4327 |
[ |
|
4328 |
|codeView lines noPauseSema enc| |
|
4329 |
||
4330 |
enc := fileEncoding. |
|
4331 |
enc == #iso8859 ifTrue:[ |
|
4332 |
enc := nil |
|
4333 |
]. |
|
4334 |
||
4335 |
stream buffered:true. |
|
4336 |
codeView := subView. |
|
4337 |
codeView unselect. |
|
4338 |
||
4339 |
replace ifTrue:[ |
|
4340 |
codeView list:nil. |
|
4341 |
lnr := 1. |
|
4342 |
]. |
|
4343 |
||
4344 |
stillReplacing := replace. |
|
4345 |
||
4346 |
[stream readWait. stream atEnd] whileFalse:[ |
|
4347 |
" |
|
4348 |
data available; read up to 100 lines |
|
4349 |
and insert as a single junk. This speeds up |
|
4350 |
display of long output (less line-scrolling). |
|
4351 |
" |
|
4352 |
lines := OrderedCollection new:100. |
|
4353 |
||
4354 |
[ |
|
4355 |
line := stream nextLine. |
|
4356 |
line notNil ifTrue:[ |
|
4357 |
enc notNil ifTrue:[ |
|
4358 |
line := line decodeFrom:enc |
|
4359 |
]. |
|
4360 |
lines add:line |
|
4361 |
]. |
|
4362 |
] doWhile:[ |
|
4363 |
stream canReadWithoutBlocking |
|
4364 |
and:[stream atEnd not |
|
4365 |
and:[lines size < 100]] |
|
4366 |
]. |
|
4367 |
||
4368 |
" |
|
4369 |
need this critical section; otherwise, |
|
4370 |
we could get the signal while waiting for |
|
4371 |
an expose event ... |
|
4372 |
" |
|
4373 |
access critical:[ |
|
4374 |
lines size > 0 ifTrue:[ |
|
4375 |
stillReplacing ifTrue:[ |
|
4376 |
lines do:[:line | |
|
4377 |
codeView at:lnr put:line withTabsExpanded. |
|
4378 |
codeView cursorToBottom; cursorDown:1. |
|
4379 |
lnr := lnr + 1. |
|
4380 |
lnr > codeView list size ifTrue:[ |
|
4381 |
stillReplacing := false |
|
4382 |
] |
|
4383 |
]. |
|
4384 |
] ifFalse:[ |
|
4385 |
codeView insertLines:lines before:codeView cursorLine. |
|
4386 |
codeView cursorDown:lines size. |
|
4387 |
] |
|
4388 |
]. |
|
4389 |
]. |
|
4390 |
||
4391 |
" |
|
4392 |
give others running at same prio a chance too |
|
4393 |
(especially other FileBrowsers doing the same) |
|
4394 |
" |
|
4395 |
Processor yield |
|
4396 |
]. |
|
4397 |
] valueNowOrOnUnwindDo:[ |
|
4398 |
stream shutDown "close". stream := nil. |
|
4399 |
]. |
|
4400 |
||
4401 |
"/ |
|
4402 |
"/ the command could have changed the directory |
|
4403 |
"/ |
|
4404 |
self updateCurrentDirectoryIfChanged |
|
4405 |
]. |
|
4406 |
replace ifTrue:[ |
|
4407 |
subView modified:false. |
|
4408 |
]. |
|
4409 |
] |
|
4410 |
] |
|
1162 | 4411 |
] |
4412 |
] valueNowOrOnUnwindDo:[ |
|
2138 | 4413 |
|wg| |
4414 |
||
4415 |
self label:myName; iconLabel:myName. |
|
1912 | 4416 |
"/ myProcess notNil ifTrue:[myProcess priority:myPriority]. |
4417 |
||
2138 | 4418 |
" |
4419 |
hide the button, and make sure it will stay |
|
4420 |
hidden when we are realized again |
|
4421 |
" |
|
4422 |
killButton beInvisible. |
|
4423 |
pauseToggle beInvisible. |
|
4424 |
||
4425 |
commandView beVisible. |
|
4426 |
||
4427 |
" |
|
4428 |
remove the killButton from its group |
|
4429 |
(otherwise, it will be destroyed when we shut down the group) |
|
4430 |
" |
|
4431 |
wg := killButton windowGroup. |
|
4432 |
killButton windowGroup:nil. |
|
4433 |
pauseToggle windowGroup:nil. |
|
4434 |
||
4435 |
" |
|
4436 |
shut down the kill buttons windowgroup |
|
4437 |
" |
|
4438 |
wg notNil ifTrue:[ |
|
4439 |
wg process terminate. |
|
4440 |
]. |
|
4441 |
" |
|
4442 |
clear its action (actually not needed, but |
|
4443 |
releases reference to thisContext earlier) |
|
4444 |
" |
|
4445 |
killButton action:nil. |
|
4446 |
pauseToggle pressAction:nil. |
|
4447 |
"/ |
|
4448 |
"/ allow interaction with the codeView |
|
4449 |
"/ (bring it back into my group) |
|
4450 |
"/ |
|
4451 |
lowerFrameView windowGroup:(self windowGroup). |
|
1162 | 4452 |
]. |
4453 |
||
4454 |
currentFileName isNil ifTrue:[ |
|
2138 | 4455 |
subView modified:false. |
1162 | 4456 |
]. |
4457 |
||
4458 |
subView size > 10000 ifTrue:[ |
|
2138 | 4459 |
self warn:'text quite large now - please cut off some lines' |
1162 | 4460 |
] |
4461 |
||
1358 | 4462 |
"Modified: / 21.9.1995 / 11:18:46 / claus" |
1508
66bca43c9654
Use #raiseRequest when exception handler does #proceed
Stefan Vogel <sv@exept.de>
parents:
1507
diff
changeset
|
4463 |
"Modified: / 6.3.1998 / 17:32:03 / stefan" |
1933 | 4464 |
"Modified: / 15.10.1998 / 12:37:52 / cg" |
1162 | 4465 |
! |
4466 |
||
4467 |
imageAction:aFilename |
|
4468 |
"for some image files, if double clicked, we can do some useful |
|
4469 |
action ..." |
|
4470 |
||
2158
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
4471 |
|img errmsg| |
1162 | 4472 |
|
4473 |
(Image isImageFileSuffix:(aFilename asFilename suffix)) |
|
4474 |
ifTrue:[ |
|
2158
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
4475 |
Image imageLoadErrorSignal handle:[:ex | |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
4476 |
errmsg := ex errorString |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
4477 |
] do:[ |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
4478 |
img := Image fromFile:(currentDirectory construct:aFilename). |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
4479 |
]. |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
4480 |
img notNil ifTrue:[ |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
4481 |
ImageEditor openOnImage:img. |
1410 | 4482 |
"/ img inspect. |
2158
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
4483 |
^ true |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
4484 |
]. |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
4485 |
errmsg notNil ifTrue:[ |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
4486 |
self warn:errmsg. |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
4487 |
] |
1162 | 4488 |
]. |
4489 |
^ false |
|
4490 |
||
2158
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
4491 |
"Created: / 19.6.1996 / 09:43:50 / cg" |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
4492 |
"Modified: / 18.9.1997 / 16:35:48 / stefan" |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
4493 |
"Modified: / 18.5.1999 / 15:45:06 / cg" |
1162 | 4494 |
! |
4495 |
||
4496 |
initialCommandFor:fileName into:aBox |
|
4497 |
"set a useful initial command for execute box." |
|
4498 |
||
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
4499 |
|cmd select path suffix| |
1162 | 4500 |
|
4501 |
"/ XXX should be changed to take stuff from a config file |
|
4502 |
"/ XXX or from resources. |
|
4503 |
||
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
4504 |
path := currentDirectory filenameFor:fileName. |
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
4505 |
(path type == #regular) ifTrue:[ |
2138 | 4506 |
path isExecutableProgram ifTrue:[ |
4507 |
aBox initialText:(fileName , ' <arguments>'). |
|
4508 |
^ self |
|
4509 |
]. |
|
4510 |
||
4511 |
select := true. |
|
4512 |
||
4513 |
"some heuristics - my personal preferences ... |
|
4514 |
(actually this should come from a configfile)" |
|
4515 |
||
4516 |
(fileName endsWith:'akefile') ifTrue:[ |
|
4517 |
aBox initialText:'make target' selectFrom:6 to:11. |
|
4518 |
^ self |
|
4519 |
]. |
|
4520 |
||
4521 |
suffix := path suffix. |
|
4522 |
(suffix = 'C') ifTrue:[ |
|
4523 |
cmd := 'g++ -c %1'. |
|
4524 |
select := 6. |
|
4525 |
] ifFalse:[ |
|
4526 |
suffix := suffix asLowercase. |
|
4527 |
(suffix = 'taz') ifTrue:[ |
|
4528 |
aBox initialText:'zcat %1 | tar tvf -'. |
|
4529 |
select := false. |
|
4530 |
]. |
|
4531 |
(suffix = 'tar') ifTrue:[ |
|
4532 |
cmd := 'tar tvf %1'. |
|
4533 |
select := 7. |
|
4534 |
]. |
|
4535 |
(suffix = 'zoo') ifTrue:[ |
|
4536 |
cmd := 'zoo -list %1'. |
|
4537 |
select := 9. |
|
4538 |
]. |
|
4539 |
(suffix = 'zip') ifTrue:[ |
|
4540 |
cmd := 'unzip -l %1'. |
|
4541 |
select := 8. |
|
4542 |
]. |
|
4543 |
(suffix = 'jar') ifTrue:[ |
|
4544 |
cmd := 'unzip -l %1'. |
|
4545 |
select := 8. |
|
4546 |
]. |
|
4547 |
(suffix = 'z') ifTrue:[ |
|
4548 |
(fileName asLowercase endsWith:'tar.z') ifTrue:[ |
|
4549 |
cmd := 'zcat %1 | tar tvf -'. |
|
4550 |
select := false. |
|
4551 |
] ifFalse:[ |
|
4552 |
cmd := 'uncompress %1' |
|
4553 |
]. |
|
4554 |
]. |
|
4555 |
(suffix = 'gz') ifTrue:[ |
|
4556 |
(fileName asLowercase endsWith:'tar.gz') ifTrue:[ |
|
4557 |
cmd := ('gunzip < %1 | tar tvf -' ). |
|
4558 |
select := false. |
|
4559 |
] ifFalse:[ |
|
4560 |
cmd := 'gunzip %1'. |
|
4561 |
]. |
|
4562 |
]. |
|
4563 |
(suffix = 'tgz') ifTrue:[ |
|
4564 |
cmd := ('gunzip < %1 | tar tvf -' ). |
|
4565 |
select := false. |
|
4566 |
]. |
|
4567 |
(suffix = 'html') ifTrue:[ |
|
4568 |
cmd := 'netscape %1' |
|
4569 |
]. |
|
4570 |
(suffix = 'htm') ifTrue:[ |
|
4571 |
cmd := 'netscape %1' |
|
4572 |
]. |
|
4573 |
(suffix = 'uue') ifTrue:[ |
|
4574 |
cmd := 'uudecode %1' |
|
4575 |
]. |
|
4576 |
(suffix = 'c') ifTrue:[ |
|
4577 |
cmd := 'cc -c %1'. |
|
4578 |
select := 5. |
|
4579 |
]. |
|
4580 |
(suffix = 'cc') ifTrue:[ |
|
4581 |
cmd := 'g++ -c %1'. |
|
4582 |
select := 6. |
|
4583 |
]. |
|
4584 |
(suffix = 'xbm') ifTrue:[ |
|
4585 |
cmd := 'bitmap %1' |
|
4586 |
]. |
|
4587 |
(suffix = 'ps') ifTrue:[ |
|
4588 |
cmd := 'ghostview %1' |
|
4589 |
]. |
|
4590 |
((suffix = '1') or:[suffix = 'man']) ifTrue:[ |
|
4591 |
cmd := 'nroff -man %1'. |
|
4592 |
select := 10. |
|
4593 |
]. |
|
4594 |
]. |
|
4595 |
||
4596 |
cmd isNil ifTrue:[ |
|
4597 |
DefaultCommandPerSuffix isNil ifTrue:[ |
|
4598 |
cmd := '<cmd>' |
|
4599 |
] ifFalse:[ |
|
4600 |
cmd := DefaultCommandPerSuffix |
|
4601 |
at:suffix |
|
4602 |
ifAbsent:'<cmd>'. |
|
4603 |
]. |
|
4604 |
cmd := cmd , ' %1'. |
|
4605 |
]. |
|
4606 |
||
4607 |
cmd := cmd bindWith:fileName. |
|
4608 |
select == false ifTrue:[ |
|
4609 |
aBox initialText:cmd |
|
4610 |
] ifFalse:[ |
|
4611 |
select isInteger ifFalse:[ |
|
4612 |
select := (cmd indexOf:Character space ifAbsent:[cmd size + 1]) - 1. |
|
4613 |
]. |
|
4614 |
aBox initialText:cmd selectFrom:1 to:select |
|
4615 |
] |
|
1162 | 4616 |
] |
4617 |
||
1542 | 4618 |
"Modified: / 24.9.1997 / 16:34:52 / stefan" |
4619 |
"Modified: / 9.4.1998 / 17:15:57 / cg" |
|
1162 | 4620 |
! |
4621 |
||
4622 |
nonBinaryFileAction:aFilename |
|
4623 |
"for some nonBinary files, if double clicked, we can do some useful |
|
4624 |
action ..." |
|
4625 |
||
1493 | 4626 |
|fullPath| |
1162 | 4627 |
|
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
4628 |
fullPath := currentDirectory filenameFor:aFilename. |
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
4629 |
((fullPath hasSuffix:'htm') or:[fullPath hasSuffix:'html']) ifTrue:[ |
2138 | 4630 |
HTMLDocumentView openOn:fullPath pathName. |
4631 |
^ true |
|
2091 | 4632 |
]. |
4633 |
((fullPath hasSuffix:'prj') |
|
4634 |
and:[ProjectBrowser notNil]) ifTrue:[ |
|
2138 | 4635 |
ProjectBrowser openOnFile:fullPath pathName. |
4636 |
^ true |
|
1162 | 4637 |
]. |
4638 |
||
4639 |
OperatingSystem isUNIXlike ifTrue:[ |
|
2138 | 4640 |
(#('.man' '.1' '.2' '.3') findFirst:[:suff | fullPath hasSuffix:suff]) ~~ 0 |
4641 |
ifTrue:[ |
|
4642 |
HTMLDocumentView openFullOnText:(HTMLDocGenerator manPageForFile:fullPath pathName). |
|
4643 |
^ true |
|
4644 |
] |
|
1162 | 4645 |
]. |
4646 |
^ self imageAction:aFilename |
|
4647 |
||
4648 |
"Created: 19.6.1996 / 09:36:38 / cg" |
|
4649 |
"Modified: 4.4.1997 / 10:49:00 / cg" |
|
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
4650 |
"Modified: 18.9.1997 / 16:58:40 / stefan" |
1162 | 4651 |
! ! |
4652 |
||
4653 |
!FileBrowser methodsFor:'private - directory stuff'! |
|
4654 |
||
1371
a80db8d0e311
remember directory in history when entering (not when leaving)
Claus Gittinger <cg@exept.de>
parents:
1358
diff
changeset
|
4655 |
addToHistory:path |
a80db8d0e311
remember directory in history when entering (not when leaving)
Claus Gittinger <cg@exept.de>
parents:
1358
diff
changeset
|
4656 |
|pos idx| |
a80db8d0e311
remember directory in history when entering (not when leaving)
Claus Gittinger <cg@exept.de>
parents:
1358
diff
changeset
|
4657 |
|
a80db8d0e311
remember directory in history when entering (not when leaving)
Claus Gittinger <cg@exept.de>
parents:
1358
diff
changeset
|
4658 |
(DirectoryHistory includes:path) ifFalse:[ |
1393 | 4659 |
DirectoryHistory size >= HistorySize ifTrue:[ |
4660 |
DirectoryHistory removeLast. |
|
4661 |
DirectoryHistoryWhere removeLast |
|
4662 |
] |
|
1371
a80db8d0e311
remember directory in history when entering (not when leaving)
Claus Gittinger <cg@exept.de>
parents:
1358
diff
changeset
|
4663 |
] ifTrue:[ |
1393 | 4664 |
"already been there before; move the entry to |
4665 |
the beginning, so it will fall out later." |
|
4666 |
||
4667 |
idx := DirectoryHistory indexOf:path. |
|
4668 |
DirectoryHistory removeIndex:idx. |
|
4669 |
pos := DirectoryHistoryWhere at:idx. |
|
4670 |
DirectoryHistoryWhere removeIndex:idx. |
|
1371
a80db8d0e311
remember directory in history when entering (not when leaving)
Claus Gittinger <cg@exept.de>
parents:
1358
diff
changeset
|
4671 |
]. |
a80db8d0e311
remember directory in history when entering (not when leaving)
Claus Gittinger <cg@exept.de>
parents:
1358
diff
changeset
|
4672 |
DirectoryHistory addFirst:path. |
a80db8d0e311
remember directory in history when entering (not when leaving)
Claus Gittinger <cg@exept.de>
parents:
1358
diff
changeset
|
4673 |
DirectoryHistoryWhere addFirst:pos. |
a80db8d0e311
remember directory in history when entering (not when leaving)
Claus Gittinger <cg@exept.de>
parents:
1358
diff
changeset
|
4674 |
|
a80db8d0e311
remember directory in history when entering (not when leaving)
Claus Gittinger <cg@exept.de>
parents:
1358
diff
changeset
|
4675 |
"Created: / 8.11.1997 / 17:16:29 / cg" |
a80db8d0e311
remember directory in history when entering (not when leaving)
Claus Gittinger <cg@exept.de>
parents:
1358
diff
changeset
|
4676 |
! |
a80db8d0e311
remember directory in history when entering (not when leaving)
Claus Gittinger <cg@exept.de>
parents:
1358
diff
changeset
|
4677 |
|
172 | 4678 |
changeToPreviousDirectory |
4679 |
"if text was modified show a queryBox, |
|
4680 |
otherwise change immediately to previous directory." |
|
93 | 4681 |
|
172 | 4682 |
previousDirectory isNil ifTrue:[^ self]. |
1339
4b712d8c1738
Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents:
1336
diff
changeset
|
4683 |
self discardChangesDialog ifTrue:[ |
1393 | 4684 |
self doChangeCurrentDirectoryTo:previousDirectory updateHistory:false |
172 | 4685 |
] |
1339
4b712d8c1738
Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents:
1336
diff
changeset
|
4686 |
|
4b712d8c1738
Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents:
1336
diff
changeset
|
4687 |
"Modified: 2.10.1997 / 14:13:40 / stefan" |
36 | 4688 |
! |
4689 |
||
98 | 4690 |
checkIfDirectoryHasChanged |
4691 |
"every checkDelta secs, check if directoy has changed and update the list if so. |
|
4692 |
Also, we check if the file shown has been touched in the meanwhile (for example, |
|
4693 |
from another browser) and say 'outdated' in the label if so. |
|
4694 |
This avoids confusion if the same file is being edited by two browsers. (or other editors). |
|
4695 |
If the text shown in the codeView has been edited, 'modified' is shown. |
|
4696 |
" |
|
4697 |
||
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
4698 |
|oldSelection nOld newState msg newLabel t| |
98 | 4699 |
|
4700 |
shown ifTrue:[ |
|
1868 | 4701 |
currentDirectory notNil ifTrue:[ |
4702 |
lockUpdate ifTrue:[ |
|
4703 |
Processor removeTimedBlock:checkBlock. |
|
4704 |
Processor addTimedBlock:checkBlock afterSeconds:checkDelta. |
|
4705 |
^ self |
|
4706 |
]. |
|
4707 |
||
4708 |
subView modified ifTrue:[ |
|
4709 |
newState := ' (modified)' |
|
4710 |
]. |
|
4711 |
||
4712 |
(currentDirectory isReadable) ifTrue:[ |
|
4713 |
Processor removeTimedBlock:checkBlock. |
|
4714 |
||
4715 |
t := currentDirectory modificationTime. |
|
4716 |
(t notNil and:[t > timeOfLastCheck]) ifTrue:[ |
|
4717 |
nOld := fileListView numberOfSelections. |
|
4718 |
oldSelection := fileListView selectionValue. |
|
4719 |
self updateCurrentDirectory. |
|
4720 |
nOld ~~ 0 ifTrue:[ |
|
4721 |
nOld > 1 ifTrue:[ |
|
4722 |
oldSelection do:[:element | |
|
4723 |
fileListView addElementToSelection:element |
|
4724 |
] |
|
4725 |
] ifFalse:[ |
|
4726 |
fileListView selectElementWithoutScroll:oldSelection |
|
4727 |
] |
|
4728 |
]. |
|
4729 |
] ifFalse:[ |
|
4730 |
Processor addTimedBlock:checkBlock afterSeconds:checkDelta |
|
4731 |
]. |
|
4732 |
||
4733 |
currentFileName notNil ifTrue:[ |
|
4734 |
|f| |
|
4735 |
f := currentDirectory construct:currentFileName. |
|
4736 |
f exists ifFalse:[ |
|
4737 |
newState := ' (removed)'. |
|
4738 |
] ifTrue:[ |
|
4739 |
f modificationTime > timeOfFileRead ifTrue:[ |
|
4740 |
newState := ' (outdated)'. |
|
4741 |
subView modified ifTrue:[ |
|
4742 |
newState := ' (modified & outdated)' |
|
4743 |
] |
|
4744 |
]. |
|
4745 |
]. |
|
4746 |
]. |
|
4747 |
] ifFalse:[ |
|
4748 |
" |
|
4749 |
if the directory has been deleted, or is not readable ... |
|
4750 |
" |
|
4751 |
(currentDirectory exists) ifFalse:[ |
|
4752 |
msg := 'FileBrowser:\\directory %1 is gone ?!!?' |
|
4753 |
] ifTrue:[ |
|
4754 |
msg := 'FileBrowser:\\directory %1 is no longer readable ?!!?' |
|
4755 |
]. |
|
4756 |
self warn:(resources string:msg with:currentDirectory pathName) withCRs. |
|
4757 |
||
4758 |
fileListView contents:nil. |
|
4759 |
newLabel := myName , ': directory is gone !!'. |
|
4760 |
"/ Processor addTimedBlock:checkBlock afterSeconds:checkDelta |
|
4761 |
]. |
|
4762 |
||
4763 |
newState notNil ifTrue:[ |
|
4764 |
newLabel := myName. |
|
4765 |
currentFileName notNil ifTrue:[ |
|
4766 |
newLabel := newLabel , ': ' , currentFileName |
|
4767 |
]. |
|
4768 |
newLabel := newLabel , newState. |
|
4769 |
]. |
|
4770 |
newLabel notNil ifTrue:[ |
|
4771 |
self label:newLabel. |
|
4772 |
] |
|
4773 |
] |
|
98 | 4774 |
] |
1168
b157f3712548
care for nil returns from userName/groupName * time queries
Claus Gittinger <cg@exept.de>
parents:
1166
diff
changeset
|
4775 |
|
1380
547d31bfa12c
warning string fixed when directory vanishes
Claus Gittinger <cg@exept.de>
parents:
1374
diff
changeset
|
4776 |
"Modified: / 28.4.1997 / 22:31:02 / dq" |
547d31bfa12c
warning string fixed when directory vanishes
Claus Gittinger <cg@exept.de>
parents:
1374
diff
changeset
|
4777 |
"Modified: / 16.9.1997 / 15:17:15 / stefan" |
1481 | 4778 |
"Modified: / 18.2.1998 / 17:57:49 / cg" |
98 | 4779 |
! |
4780 |
||
172 | 4781 |
doChangeCurrentDirectoryTo:fileName updateHistory:updateHistory |
4782 |
"verify argument is name of a readable & executable directory |
|
4783 |
and if so, go there" |
|
4784 |
||
1317 | 4785 |
|msg path idx f| |
172 | 4786 |
|
4787 |
self label:myName; iconLabel:myName. |
|
4788 |
fileName notNil ifTrue:[ |
|
2138 | 4789 |
(f := fileName asFilename) isAbsolute ifFalse:[ |
4790 |
f := currentDirectory filenameFor:fileName. |
|
4791 |
]. |
|
4792 |
f := f asAbsoluteFilename. |
|
4793 |
(f isDirectory) ifTrue:[ |
|
4794 |
(f isReadable) ifTrue:[ |
|
4795 |
(f isExecutable) ifTrue:[ |
|
4796 |
path := currentDirectory pathName. |
|
4797 |
previousDirectory := path. |
|
4798 |
||
4799 |
" |
|
4800 |
remember where we are positioned in the fileList |
|
4801 |
(in case we want to return) |
|
4802 |
" |
|
4803 |
idx := DirectoryHistory indexOf:path. |
|
4804 |
idx ~~ 0 ifTrue:[ |
|
4805 |
DirectoryHistoryWhere at:idx put:fileListView firstLineShown |
|
4806 |
]. |
|
4807 |
||
4808 |
updateHistory ifTrue:[ |
|
4809 |
self addToHistory:path. |
|
4810 |
]. |
|
4811 |
||
4812 |
self setCurrentDirectory:(f pathName). |
|
4813 |
||
4814 |
"/ fetch the new path. |
|
4815 |
path := currentDirectory pathName. |
|
4816 |
||
4817 |
" |
|
4818 |
if we have already been there, look for the |
|
4819 |
position offset, and scroll the fileList |
|
4820 |
" |
|
4821 |
idx := DirectoryHistory indexOf:path. |
|
4822 |
idx ~~ 0 ifTrue:[ |
|
4823 |
|pos| |
|
4824 |
||
4825 |
pos := DirectoryHistoryWhere at:idx. |
|
4826 |
pos notNil ifTrue:[ |
|
4827 |
fileListView scrollToLine:pos. |
|
4828 |
] |
|
4829 |
]. |
|
4830 |
||
4831 |
updateHistory ifTrue:[ |
|
4832 |
self addToHistory:path. |
|
4833 |
]. |
|
4834 |
||
4835 |
^ self |
|
4836 |
]. |
|
4837 |
msg := 'cannot change directory to ''%1'' !!' |
|
4838 |
] ifFalse:[ |
|
4839 |
msg := 'cannot read directory ''%1'' !!' |
|
4840 |
] |
|
4841 |
] ifFalse:[ |
|
4842 |
OperatingSystem isVMSlike ifTrue:[ |
|
4843 |
"/ cannot tell if it exists or is simply invisible ... |
|
4844 |
msg := '''%1'' is not a directory or unreadable !!' |
|
4845 |
] ifFalse:[ |
|
4846 |
msg := '''%1'' is not a directory !!' |
|
4847 |
] |
|
4848 |
]. |
|
4849 |
Dialog warn:(resources string:msg withCRs with:fileName). |
|
172 | 4850 |
] |
1166
0029f77ccea7
when updating the directoryList,
Claus Gittinger <cg@exept.de>
parents:
1162
diff
changeset
|
4851 |
|
1371
a80db8d0e311
remember directory in history when entering (not when leaving)
Claus Gittinger <cg@exept.de>
parents:
1358
diff
changeset
|
4852 |
"Modified: / 18.9.1997 / 18:22:30 / stefan" |
2128
dfff36f688d2
care for windows filenames (dont expand \'s in filename)
Claus Gittinger <cg@exept.de>
parents:
2124
diff
changeset
|
4853 |
"Modified: / 27.4.1999 / 17:10:14 / cg" |
1329 | 4854 |
! |
4855 |
||
4856 |
doChangeToDefaultDirectory |
|
4857 |
"go to parent directory" |
|
4858 |
||
4859 |
self doChangeCurrentDirectoryTo:(Filename currentDirectory pathName) updateHistory:true |
|
4860 |
||
4861 |
"Created: 21.9.1997 / 23:45:59 / cg" |
|
172 | 4862 |
! |
4863 |
||
4864 |
doChangeToHomeDirectory |
|
4865 |
"go to home directory" |
|
4866 |
||
4867 |
self doChangeCurrentDirectoryTo:(OperatingSystem getHomeDirectory) updateHistory:true |
|
4868 |
! |
|
4869 |
||
4870 |
doChangeToParentDirectory |
|
1317 | 4871 |
"go to parent directory" |
36 | 4872 |
|
172 | 4873 |
self doChangeCurrentDirectoryTo:'..' updateHistory:true |
4874 |
! |
|
4875 |
||
4876 |
doCreateDirectory:newName |
|
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
4877 |
|f| |
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
4878 |
|
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
4879 |
f := currentDirectory filenameFor:newName. |
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
4880 |
f exists ifTrue:[ |
2138 | 4881 |
self warn:'%1 already exists.' with:newName. |
4882 |
^ self |
|
172 | 4883 |
]. |
4884 |
||
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
4885 |
f makeDirectory ifTrue:[ |
2138 | 4886 |
self updateCurrentDirectory |
172 | 4887 |
] ifFalse:[ |
2138 | 4888 |
self showAlert:(resources string:'cannot create directory ''%1'' !!' with:newName) |
4889 |
with:(OperatingSystem lastErrorString) |
|
172 | 4890 |
] |
1157
667a57034e40
only update if the directory did change (after execute command)
Claus Gittinger <cg@exept.de>
parents:
1156
diff
changeset
|
4891 |
|
1988 | 4892 |
"Modified: / 18.9.1997 / 17:21:25 / stefan" |
4893 |
"Modified: / 30.1.1999 / 16:24:12 / cg" |
|
172 | 4894 |
! |
4895 |
||
1162 | 4896 |
setCurrentDirectory:aPathName |
4897 |
"setup for another directory" |
|
4898 |
||
4899 |
|newDirectory| |
|
4900 |
||
4901 |
aPathName isEmpty ifTrue:[^ self]. |
|
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
4902 |
newDirectory := currentDirectory filenameFor:aPathName. |
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
4903 |
newDirectory isDirectory ifTrue:[ |
1329 | 4904 |
self currentDirectory:newDirectory. |
4905 |
currentFileName notNil ifTrue:[ |
|
4906 |
fileListView contents:nil. |
|
4907 |
currentFileName := nil. |
|
4908 |
] ifFalse:[ |
|
4909 |
fileListView setSelection:nil. |
|
4910 |
fileListView scrollToTop. |
|
4911 |
]. |
|
4912 |
self updateCurrentDirectory. |
|
4913 |
self showInfo. |
|
172 | 4914 |
] |
294 | 4915 |
|
1162 | 4916 |
"Modified: 21.9.1995 / 11:22:45 / claus" |
4917 |
"Modified: 25.5.1996 / 12:27:01 / cg" |
|
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
4918 |
"Modified: 18.9.1997 / 17:08:07 / stefan" |
912
dae70963b64c
define language specific commentStrings
Claus Gittinger <cg@exept.de>
parents:
874
diff
changeset
|
4919 |
! |
dae70963b64c
define language specific commentStrings
Claus Gittinger <cg@exept.de>
parents:
874
diff
changeset
|
4920 |
|
1162 | 4921 |
updateCurrentDirectoryIfChanged |
1837 | 4922 |
|t| |
4923 |
||
1975 | 4924 |
OperatingSystem isMSDOSlike ifTrue:[ |
2138 | 4925 |
"/ workaround: DOS has no diretory modifiation time ... |
4926 |
self updateCurrentDirectory. |
|
4927 |
^ self |
|
1975 | 4928 |
]. |
4929 |
||
1837 | 4930 |
((t := currentDirectory modificationTime) isNil |
4931 |
or:[t > timeOfLastCheck]) ifTrue:[ |
|
2138 | 4932 |
self updateCurrentDirectory |
1162 | 4933 |
] |
4934 |
||
1837 | 4935 |
"Modified: / 16.9.1997 / 15:35:52 / stefan" |
1975 | 4936 |
"Modified: / 16.12.1998 / 22:55:44 / cg" |
1162 | 4937 |
! ! |
4938 |
||
4939 |
!FileBrowser methodsFor:'private - encoding'! |
|
172 | 4940 |
|
395 | 4941 |
guessEncodingFrom:aBuffer |
988 | 4942 |
"look for a string |
1317 | 4943 |
encoding #name |
988 | 4944 |
or: |
1317 | 4945 |
encoding: name |
1209 | 4946 |
within the given buffer |
4947 |
(which is usually the first few bytes of a textFile). |
|
4948 |
If thats not found, use heuristics (in CharacterArray) to guess." |
|
988 | 4949 |
|
395 | 4950 |
|n "{Class: SmallInteger }" |
1209 | 4951 |
binary idx s w enc| |
395 | 4952 |
|
4953 |
binary := false. |
|
4954 |
n := aBuffer size. |
|
4955 |
||
1223 | 4956 |
(idx := aBuffer findString:'charset=') ~~ 0 ifTrue:[ |
1317 | 4957 |
s := ReadStream on:aBuffer. |
4958 |
s position:idx + 8. |
|
4959 |
s skipSeparators. |
|
4960 |
w := s upToSeparator. |
|
4961 |
w notNil ifTrue:[ |
|
4962 |
(idx := w indexOf:$") ~~ 0 ifTrue:[ |
|
4963 |
w := w copyTo:idx-1 |
|
4964 |
]. |
|
4965 |
^ w asSymbol |
|
4966 |
]. |
|
1223 | 4967 |
]. |
807 | 4968 |
(idx := aBuffer findString:'encoding') ~~ 0 ifTrue:[ |
1317 | 4969 |
s := ReadStream on:aBuffer. |
4970 |
s position:idx + 8. |
|
4971 |
s skipSeparators. |
|
4972 |
s peek == $: ifTrue:[ |
|
4973 |
s next. |
|
4974 |
s skipSeparators. |
|
4975 |
]. |
|
4976 |
||
4977 |
s peek == $# ifTrue:[ |
|
4978 |
s next. |
|
4979 |
s skipSeparators. |
|
4980 |
]. |
|
4981 |
w := s upToSeparator. |
|
4982 |
w notNil ifTrue:[ |
|
4983 |
^ w asSymbol |
|
4984 |
]. |
|
807 | 4985 |
]. |
4986 |
||
395 | 4987 |
1 to:n do:[:i | |
1317 | 4988 |
(aBuffer at:i) isPrintable ifFalse:[binary := true]. |
395 | 4989 |
]. |
807 | 4990 |
|
395 | 4991 |
binary ifTrue:[ |
1317 | 4992 |
"/ look for JIS7 / EUC encoding |
4993 |
||
4994 |
enc := CharacterArray guessEncodingFrom:aBuffer. |
|
4995 |
enc notNil ifTrue:[ |
|
4996 |
^ enc |
|
4997 |
]. |
|
4998 |
||
4999 |
"/ if the encoding has been set to any non iso setting, |
|
5000 |
"/ assume its what we defined ... |
|
5001 |
||
5002 |
(('iso*' match:fileEncoding) or:['ascii*' match:fileEncoding]) ifTrue:[ |
|
5003 |
^ #binary |
|
5004 |
]. |
|
5005 |
^ fileEncoding ? #binary |
|
395 | 5006 |
]. |
5007 |
^ #ascii |
|
5008 |
||
5009 |
"Created: 26.2.1996 / 17:43:08 / cg" |
|
1223 | 5010 |
"Modified: 1.7.1997 / 00:00:27 / cg" |
1214
02d5bbd925dd
allow decoding errors to be ignored
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
5011 |
! |
02d5bbd925dd
allow decoding errors to be ignored
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
5012 |
|
02d5bbd925dd
allow decoding errors to be ignored
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
5013 |
preferredFontEncodingFor:fileEncoding |
02d5bbd925dd
allow decoding errors to be ignored
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
5014 |
"given a file encoding, return corresponding preferred fontEncoding |
02d5bbd925dd
allow decoding errors to be ignored
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
5015 |
match pattern" |
02d5bbd925dd
allow decoding errors to be ignored
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
5016 |
|
1223 | 5017 |
|fe| |
5018 |
||
5019 |
fe := MIMETypes fontForCharset:fileEncoding. |
|
5020 |
fe notNil ifTrue:[^ fe]. |
|
1221 | 5021 |
^ 'iso8859*' |
1214
02d5bbd925dd
allow decoding errors to be ignored
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
5022 |
|
02d5bbd925dd
allow decoding errors to be ignored
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
5023 |
"Created: 28.6.1997 / 20:47:35 / cg" |
1223 | 5024 |
"Modified: 1.7.1997 / 00:04:56 / cg" |
395 | 5025 |
! |
5026 |
||
1140 | 5027 |
validateFontEncodingFor:newEncoding ask:ask |
5028 |
"if required, query user if he/she wants to change to another font, |
|
5029 |
which is able to display text encoded as specified by newEncoding" |
|
5030 |
||
1214
02d5bbd925dd
allow decoding errors to be ignored
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
5031 |
|fontsEncoding msg filter f defaultFont pref| |
1140 | 5032 |
|
5033 |
fontsEncoding := subView font encoding. |
|
5034 |
||
1221 | 5035 |
pref := self preferredFontEncodingFor:newEncoding. |
5036 |
||
5037 |
(pref match:fontsEncoding) ifTrue:[ |
|
1317 | 5038 |
^ self |
1140 | 5039 |
]. |
1221 | 5040 |
"/ stupid ... |
5041 |
pref = 'ascii*' ifTrue:[ |
|
1317 | 5042 |
(fontsEncoding match:'iso8859*') ifTrue:[ |
5043 |
^ self |
|
5044 |
] |
|
1140 | 5045 |
]. |
5046 |
||
1221 | 5047 |
filter := [:f | |coding| |
1317 | 5048 |
(coding := f encoding) notNil |
5049 |
and:[pref match:coding]]. |
|
1221 | 5050 |
|
5051 |
defaultFont := TextView defaultFont onDevice:device. |
|
5052 |
(pref match:(defaultFont encoding)) ifFalse:[ |
|
1317 | 5053 |
defaultFont := nil. |
1140 | 5054 |
]. |
5055 |
||
1221 | 5056 |
defaultFont isNil ifTrue:[ |
1317 | 5057 |
(pref = 'ascii*' |
5058 |
or:[pref = 'iso8859*']) ifTrue:[ |
|
5059 |
defaultFont := FontDescription family:'courier' face:'medium' style:'roman' size:12 |
|
5060 |
] |
|
1221 | 5061 |
]. |
5062 |
||
5063 |
defaultFont isNil ifTrue:[ |
|
1317 | 5064 |
defaultFont := device |
5065 |
listOfAvailableFonts |
|
5066 |
detect:[:f | filter value:f] |
|
5067 |
ifNone:nil. |
|
5068 |
defaultFont isNil ifTrue:[ |
|
5069 |
||
5070 |
"/ flush list, and refetch font list |
|
5071 |
"/ (in case someone just changed the font path ...) |
|
5072 |
||
5073 |
device flushListOfAvailableFonts. |
|
5074 |
defaultFont := device |
|
5075 |
listOfAvailableFonts |
|
5076 |
detect:[:f | filter value:f] |
|
5077 |
ifNone:nil. |
|
5078 |
]. |
|
5079 |
||
5080 |
defaultFont isNil ifTrue:[ |
|
5081 |
self warn:'your display does not seem to provide any ' , newEncoding , '-encoded font.'. |
|
5082 |
^ self. |
|
5083 |
] |
|
1221 | 5084 |
]. |
5085 |
||
5086 |
msg := 'switch to a %1 encoded font ?'. |
|
5087 |
(ask not or:[self confirm:(resources string:msg with:pref) withCRs]) |
|
5088 |
ifTrue:[ |
|
1317 | 5089 |
self withWaitCursorDo:[ |
5090 |
f := FontPanel |
|
5091 |
fontFromUserInitial:defaultFont |
|
5092 |
title:(resources string:'font selection') |
|
5093 |
filter:filter. |
|
5094 |
f notNil ifTrue:[ |
|
5095 |
subView font:f |
|
5096 |
] |
|
5097 |
] |
|
1140 | 5098 |
] |
5099 |
||
5100 |
"Created: 26.10.1996 / 12:06:54 / cg" |
|
1221 | 5101 |
"Modified: 30.6.1997 / 17:46:46 / cg" |
1162 | 5102 |
! ! |
5103 |
||
5104 |
!FileBrowser methodsFor:'private - file stuff'! |
|
5105 |
||
5106 |
doCreateFile:newName |
|
5107 |
"create an empty file" |
|
5108 |
||
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
5109 |
|aStream f| |
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
5110 |
|
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
5111 |
f := currentDirectory filenameFor:newName. |
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
5112 |
f exists ifTrue:[ |
1329 | 5113 |
(self |
5114 |
ask:(resources string:'%1 already exists\\truncate ?' with:newName) |
|
5115 |
yesButton:'truncate' |
|
5116 |
) ifFalse:[^ self]. |
|
1162 | 5117 |
]. |
5118 |
||
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
5119 |
FileStream openErrorSignal handle:[:ex| |
1329 | 5120 |
^ self showAlert:(resources string:'cannot create file ''%1'' !!' with:newName) |
5121 |
with:(FileStream lastErrorString) |
|
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
5122 |
] do:[ |
1329 | 5123 |
aStream := f newReadWriteStream. |
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
5124 |
]. |
1162 | 5125 |
aStream notNil ifTrue:[ |
1329 | 5126 |
aStream close. |
5127 |
self updateCurrentDirectoryIfChanged |
|
1162 | 5128 |
] ifFalse:[ |
1329 | 5129 |
self showAlert:(resources string:'cannot create file ''%1'' !!' with:newName) |
5130 |
with:(FileStream lastErrorString) |
|
1162 | 5131 |
] |
5132 |
||
5133 |
"Modified: 23.4.1997 / 13:19:12 / cg" |
|
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
5134 |
"Modified: 18.9.1997 / 17:21:45 / stefan" |
1140 | 5135 |
! |
5136 |
||
1162 | 5137 |
doFileGet:viaDoubleClick |
5138 |
"get selected file - show contents in subView. |
|
5139 |
This is invoked either by the 'get file' menu item, or via double click. |
|
5140 |
When invoked via the menu (viaDoubleClick argument is false), |
|
5141 |
the automatic file action is not performed - instead, the file is always |
|
5142 |
shown in the codeView (if possible). |
|
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
5143 |
This distinction was done to allow xpm or xbm files (which have an automatic |
1162 | 5144 |
action) to be edited." |
5145 |
||
1994 | 5146 |
|fileName| |
5147 |
||
5148 |
fileName := self getSelectedFileName. |
|
5149 |
fileName notNil ifTrue:[ |
|
2138 | 5150 |
self doOpenFile:fileName viaDoubleClick:viaDoubleClick |
1162 | 5151 |
] |
5152 |
||
1955
e10babdbf077
before accepting, see if the file is outdated and warn if so.
Claus Gittinger <cg@exept.de>
parents:
1950
diff
changeset
|
5153 |
"Created: / 19.6.1996 / 09:39:07 / cg" |
e10babdbf077
before accepting, see if the file is outdated and warn if so.
Claus Gittinger <cg@exept.de>
parents:
1950
diff
changeset
|
5154 |
"Modified: / 18.9.1997 / 17:35:31 / stefan" |
1994 | 5155 |
"Modified: / 4.2.1999 / 17:43:51 / cg" |
1162 | 5156 |
! |
5157 |
||
2166
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5158 |
doFindFileNamed:namePatterns ignoreCase:ignCaseInName containingString:contentsString ignoreCaseInContents:ignCaseInString sameContentsAsFile:filenameToCompareContentsOrNil sameContentsAs:bytesToCompareContentsOrNil in:aDirectory |
1965 | 5159 |
|dir subDirs nameMatches contentsMatches lines contentsToCompare| |
5160 |
||
5161 |
bytesToCompareContentsOrNil notNil ifTrue:[ |
|
2166
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5162 |
contentsToCompare := bytesToCompareContentsOrNil |
1965 | 5163 |
]. |
1933 | 5164 |
|
5165 |
subDirs := OrderedCollection new. |
|
5166 |
||
5167 |
dir := aDirectory asFilename. |
|
5168 |
self label:myName , '- searching ' , dir name. |
|
5169 |
(dir directoryContents ? #()) sort do:[:fn | |
|
2166
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5170 |
|f| |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5171 |
|
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5172 |
f := dir construct:fn. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5173 |
f isDirectory ifTrue:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5174 |
f isSymbolicLink ifFalse:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5175 |
subDirs add:f |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5176 |
] |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5177 |
] ifFalse:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5178 |
(nameMatches := namePatterns isNil) ifFalse:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5179 |
ignCaseInName ifTrue:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5180 |
nameMatches := namePatterns contains:[:aPattern | aPattern match:(fn asLowercase)] |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5181 |
] ifFalse:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5182 |
nameMatches := namePatterns contains:[:aPattern | aPattern match:fn] |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5183 |
] |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5184 |
]. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5185 |
nameMatches ifTrue:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5186 |
filenameToCompareContentsOrNil notNil ifTrue:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5187 |
"/ contents compare ... |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5188 |
contentsMatches := false. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5189 |
f pathName ~= filenameToCompareContentsOrNil pathName ifTrue:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5190 |
f fileSize == filenameToCompareContentsOrNil fileSize ifTrue:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5191 |
contentsToCompare isNil ifTrue:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5192 |
filenameToCompareContentsOrNil fileSize < (512*1024) ifTrue:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5193 |
contentsToCompare := filenameToCompareContentsOrNil binaryContentsOfEntireFile |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5194 |
] |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5195 |
]. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5196 |
contentsToCompare isNil ifTrue:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5197 |
"/ too large - compare block-wise ... |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5198 |
contentsMatches := (filenameToCompareContentsOrNil sameContentsAs:f). |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5199 |
] ifFalse:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5200 |
contentsMatches := contentsToCompare = (f binaryContentsOfEntireFile). |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5201 |
] |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5202 |
]. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5203 |
] ifFalse:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5204 |
f isSymbolicLink ifTrue:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5205 |
subView insertLine:(f name , ' is a symbolic link to ' , f pathName) before:subView cursorLine. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5206 |
subView cursorDown. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5207 |
] |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5208 |
] |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5209 |
] ifFalse:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5210 |
"/ string search ... |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5211 |
(contentsMatches := contentsString isNil) ifFalse:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5212 |
(f exists and:[f isReadable]) ifFalse:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5213 |
subView insertLine:('*** ' , f pathName , ' skipped - unreadable or bad symbolic link ***') before:subView cursorLine. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5214 |
subView cursorDown. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5215 |
] ifTrue:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5216 |
f fileSize > (4024*1024) ifTrue:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5217 |
subView insertLine:('*** ' , f pathName , ' skipped - too large ***') before:subView cursorLine. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5218 |
subView cursorDown. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5219 |
] ifFalse:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5220 |
Stream lineTooLongErrorSignal handle:[:ex | |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5221 |
|cont| |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5222 |
|
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5223 |
"/ this typically happens, when a binary file is read linewise ... |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5224 |
cont := f readStream binary contentsOfEntireFile asString. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5225 |
ignCaseInString ifTrue:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5226 |
contentsMatches := cont asLowercase includesString:contentsString |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5227 |
] ifFalse:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5228 |
contentsMatches := cont includesString:contentsString |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5229 |
]. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5230 |
] do:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5231 |
lines := f contents ? #(). |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5232 |
ignCaseInString ifTrue:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5233 |
contentsMatches := (lines findFirst:[:l | l asLowercase includesString:contentsString]) ~~ 0 |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5234 |
] ifFalse:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5235 |
contentsMatches := (lines findFirst:[:l | l includesString:contentsString]) ~~ 0 |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5236 |
]. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5237 |
]. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5238 |
]. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5239 |
]. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5240 |
]. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5241 |
]. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5242 |
contentsMatches ifTrue:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5243 |
subView insertLine:f pathName before:subView cursorLine. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5244 |
subView cursorDown. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5245 |
] |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5246 |
] |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5247 |
] |
1933 | 5248 |
]. |
5249 |
||
5250 |
subDirs do:[:dir | |
|
2166
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5251 |
self |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5252 |
doFindFileNamed:namePatterns |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5253 |
ignoreCase:ignCaseInName |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5254 |
containingString:contentsString |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5255 |
ignoreCaseInContents:ignCaseInString |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5256 |
sameContentsAsFile:filenameToCompareContentsOrNil |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5257 |
sameContentsAs:contentsToCompare |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5258 |
in:dir |
1933 | 5259 |
]. |
5260 |
||
5261 |
"Created: / 15.10.1998 / 11:37:15 / cg" |
|
5262 |
"Modified: / 15.10.1998 / 12:50:48 / cg" |
|
5263 |
! |
|
5264 |
||
1994 | 5265 |
doOpenFile:fileName viaDoubleClick:viaDoubleClick |
5266 |
"get selected file - show contents in subView. |
|
5267 |
This is invoked either by the 'get file' menu item, or via double click. |
|
5268 |
When invoked via the menu (viaDoubleClick argument is false), |
|
5269 |
the automatic file action is not performed - instead, the file is always |
|
5270 |
shown in the codeView (if possible). |
|
5271 |
This distinction was done to allow xpm or xbm files (which have an automatic |
|
5272 |
action) to be edited." |
|
5273 |
||
5274 |
|iconLbl winLbl f| |
|
5275 |
||
5276 |
self withReadCursorDo:[ |
|
2139 | 5277 |
(f := fileName asFilename) isAbsolute ifFalse:[ |
5278 |
f := currentDirectory construct:fileName. |
|
5279 |
]. |
|
5280 |
f isDirectory ifTrue:[ |
|
5281 |
self doChangeCurrentDirectoryTo:fileName updateHistory:true. |
|
5282 |
winLbl := myName. |
|
5283 |
iconLbl := myName |
|
5284 |
] ifFalse:[ |
|
5285 |
f exists ifFalse:[ |
|
5286 |
Dialog warn:(resources string:'oops, ''%1'' is gone or unreadable.' withCRs with:f pathName asText allBold). |
|
5287 |
^ self |
|
5288 |
]. |
|
5289 |
timeOfFileRead := f modificationTime. |
|
5290 |
self showFile:fileName insert:false encoding:fileEncoding doubleClick:viaDoubleClick. |
|
5291 |
currentFileName := fileName. |
|
5292 |
||
5293 |
self fileTypeSpecificActions. |
|
5294 |
||
5295 |
subView acceptAction:[:theCode | |
|
5296 |
(f modificationTime <= timeOfFileRead |
|
5297 |
or:[ |
|
5298 |
(self |
|
5299 |
ask:(resources at:'FileBrowser:\\file has changed somehow in the meanwhile.\(Hint: use the file-difference menu function to see what has changed)\\Do you really want to save ?') |
|
5300 |
yesButton:'save' |
|
5301 |
noButton:'don''t save')]) ifTrue:[ |
|
5302 |
||
5303 |
self withCursor:(Cursor write) do:[ |
|
5304 |
self writeFile:fileName text:theCode encoding:fileEncoding. |
|
5305 |
timeOfFileRead := f modificationTime. |
|
5306 |
self label:myName , ': ' , currentFileName |
|
5307 |
] |
|
5308 |
] |
|
5309 |
]. |
|
5310 |
||
5311 |
winLbl := myName , ': ' , fileName. |
|
5312 |
f isWritable ifFalse:[ |
|
5313 |
winLbl := winLbl , ' (readonly)' |
|
5314 |
]. |
|
5315 |
iconLbl := fileName |
|
5316 |
]. |
|
5317 |
self label:winLbl. |
|
5318 |
self iconLabel:iconLbl. |
|
1994 | 5319 |
] |
5320 |
||
5321 |
"Created: / 4.2.1999 / 17:43:26 / cg" |
|
2139 | 5322 |
"Modified: / 3.5.1999 / 20:32:27 / ps" |
5323 |
"Modified: / 4.5.1999 / 20:39:10 / cg" |
|
1994 | 5324 |
! |
5325 |
||
1961
f81295571da7
care for updating listView while removing (get selection before)
Claus Gittinger <cg@exept.de>
parents:
1956
diff
changeset
|
5326 |
doRemove:filesToRemove |
1162 | 5327 |
"remove the selected file(s) - no questions asked" |
5328 |
||
2124
826a16d63a93
care for win32 - no file modificationTime
Claus Gittinger <cg@exept.de>
parents:
2116
diff
changeset
|
5329 |
|msg needUpdate toRemove updateRunning yesToAll mTime| |
1162 | 5330 |
|
5331 |
updateRunning := listUpdateProcess notNil. |
|
5332 |
self stopUpdateProcess. |
|
5333 |
toRemove := OrderedCollection new. |
|
5334 |
||
5335 |
"/ |
|
5336 |
"/ did the directory change in the meanwhile ? |
|
5337 |
"/ |
|
2124
826a16d63a93
care for win32 - no file modificationTime
Claus Gittinger <cg@exept.de>
parents:
2116
diff
changeset
|
5338 |
mTime := currentDirectory modificationTime. |
826a16d63a93
care for win32 - no file modificationTime
Claus Gittinger <cg@exept.de>
parents:
2116
diff
changeset
|
5339 |
needUpdate := mTime notNil and:[mTime > timeOfLastCheck]. |
1162 | 5340 |
|
1945
8acc1753a8ed
added 'yes-to-all' in multi-remove confirmation dialog.
Claus Gittinger <cg@exept.de>
parents:
1942
diff
changeset
|
5341 |
yesToAll := false. |
1162 | 5342 |
lockUpdate := true. |
5343 |
[ |
|
2138 | 5344 |
filesToRemove keysAndValuesDo:[:idx :fileName | |
5345 |
|f| |
|
5346 |
||
5347 |
f := currentDirectory construct:fileName. |
|
5348 |
OperatingSystem accessDeniedErrorSignal handle:[:ex| |
|
5349 |
"was not able to remove it" |
|
5350 |
msg := (resources string:'cannot remove ''%1'' !!' with:fileName). |
|
5351 |
self showAlert:msg with:(OperatingSystem lastErrorString) |
|
5352 |
] do:[ |
|
5353 |
|answer contents i| |
|
5354 |
||
5355 |
(f isSymbolicLink not and:[f isDirectory]) ifTrue:[ |
|
5356 |
contents := f directoryContents. |
|
5357 |
contents isEmpty ifTrue:[ |
|
5358 |
f remove |
|
5359 |
] ifFalse:[ |
|
5360 |
yesToAll ifFalse:[ |
|
5361 |
idx == filesToRemove size ifTrue:[ |
|
5362 |
answer := Dialog |
|
5363 |
confirmWithCancel:(resources string:'directory ''%1'' is not empty\remove anyway ?' with:fileName asText allBold) withCRs |
|
5364 |
labels:(resources array:#('cancel' 'remove')) |
|
5365 |
values:#(false true) |
|
5366 |
default:2. |
|
5367 |
] ifFalse:[ |
|
5368 |
answer := Dialog |
|
5369 |
confirmWithCancel:(resources string:'directory ''%1'' is not empty\remove anyway ?' with:fileName asText allBold) withCRs |
|
5370 |
labels:(resources array:#('cancel' 'remove all' 'remove')) |
|
5371 |
values:#(false #removeAll true) |
|
5372 |
default:3. |
|
5373 |
]. |
|
5374 |
answer == false ifTrue:[ |
|
5375 |
^ self |
|
5376 |
]. |
|
5377 |
answer == #removeAll ifTrue:[ |
|
5378 |
yesToAll := true |
|
5379 |
]. |
|
5380 |
]. |
|
5381 |
f recursiveRemove |
|
5382 |
]. |
|
5383 |
] ifFalse:[ |
|
5384 |
f remove. |
|
5385 |
]. |
|
1162 | 5386 |
" |
2138 | 5387 |
self show:nil |
1945
8acc1753a8ed
added 'yes-to-all' in multi-remove confirmation dialog.
Claus Gittinger <cg@exept.de>
parents:
1942
diff
changeset
|
5388 |
" |
2138 | 5389 |
i := fileList indexOf:fileName. |
5390 |
i ~~ 0 ifTrue:[ |
|
5391 |
toRemove add:i. |
|
5392 |
] |
|
5393 |
]. |
|
5394 |
]. |
|
1162 | 5395 |
] valueNowOrOnUnwindDo:[ |
2138 | 5396 |
lockUpdate := false. |
5397 |
fileListView setSelection:nil. |
|
5398 |
||
5399 |
"/ |
|
5400 |
"/ remove reverse - otherwise indices are wrong |
|
5401 |
"/ |
|
5402 |
toRemove sort. |
|
5403 |
toRemove reverseDo:[:idx | |
|
5404 |
fileList removeIndex:idx. |
|
5405 |
fileListView removeIndex:idx. |
|
5406 |
]. |
|
5407 |
||
5408 |
updateRunning ifTrue:[ |
|
5409 |
self updateCurrentDirectory |
|
5410 |
] ifFalse:[ |
|
5411 |
" |
|
5412 |
install a new check after some time |
|
5413 |
" |
|
5414 |
needUpdate ifFalse:[timeOfLastCheck := AbsoluteTime now]. |
|
5415 |
Processor removeTimedBlock:checkBlock. |
|
5416 |
Processor addTimedBlock:checkBlock afterSeconds:checkDelta. |
|
5417 |
] |
|
1162 | 5418 |
] |
5419 |
||
1374
b3a1e95a6220
Do not ask for nonempty directory if remove target is a symlink
Stefan Vogel <sv@exept.de>
parents:
1371
diff
changeset
|
5420 |
"Modified: / 20.11.1997 / 17:39:14 / stefan" |
2124
826a16d63a93
care for win32 - no file modificationTime
Claus Gittinger <cg@exept.de>
parents:
2116
diff
changeset
|
5421 |
"Modified: / 26.4.1999 / 23:03:12 / cg" |
1162 | 5422 |
! |
5423 |
||
5424 |
doRename:oldName to:newName |
|
1331
73e712c85588
Handle errors when renaming files.
Stefan Vogel <sv@exept.de>
parents:
1330
diff
changeset
|
5425 |
"rename a file (or directory)" |
1162 | 5426 |
|
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
5427 |
|old new| |
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
5428 |
|
1162 | 5429 |
(oldName notNil and:[newName notNil]) ifTrue:[ |
2138 | 5430 |
(oldName isBlank or:[newName isBlank]) ifFalse:[ |
5431 |
old := currentDirectory filenameFor:oldName. |
|
5432 |
new := currentDirectory filenameFor:newName. |
|
5433 |
OperatingSystem errorSignal handle:[:ex| |
|
5434 |
self showAlert:(resources string:'cannot rename file ''%1'' to %2 !!' |
|
5435 |
with:oldName with:newName) |
|
5436 |
with:(OperatingSystem lastErrorString) |
|
5437 |
] do:[ |
|
5438 |
new exists ifTrue:[ |
|
5439 |
(self confirm:(resources string:'''%1'' already exists - rename (i.e. overwrite) anyway ?' with:new baseName asText allBold)) |
|
5440 |
ifFalse:[ |
|
5441 |
^ self |
|
5442 |
] |
|
5443 |
]. |
|
5444 |
old renameTo:new. |
|
5445 |
]. |
|
5446 |
self updateCurrentDirectoryIfChanged. |
|
5447 |
] |
|
1162 | 5448 |
] |
5449 |
||
1911
6d1b77eda98f
check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents:
1903
diff
changeset
|
5450 |
"Modified: / 24.9.1997 / 09:20:00 / stefan" |
6d1b77eda98f
check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents:
1903
diff
changeset
|
5451 |
"Modified: / 3.10.1998 / 18:19:27 / cg" |
1162 | 5452 |
! ! |
5453 |
||
5454 |
!FileBrowser methodsFor:'private - file type & info'! |
|
5455 |
||
5456 |
fileCommentStrings |
|
5457 |
"return a useful comment definition; based upon the fileName for now" |
|
5458 |
||
5459 |
"/ for now, |
|
5460 |
"/ define comment strings, by heuristics; |
|
5461 |
"/ (should look for some mode= or similar string |
|
5462 |
"/ found in the file itself - like emacs does it) |
|
5463 |
||
2087
343c831f625a
fixed commentString setting (commentIt/uncommentIt for C sources)
Claus Gittinger <cg@exept.de>
parents:
2074
diff
changeset
|
5464 |
(#('Make.proto' |
343c831f625a
fixed commentString setting (commentIt/uncommentIt for C sources)
Claus Gittinger <cg@exept.de>
parents:
2074
diff
changeset
|
5465 |
'Makefile' |
343c831f625a
fixed commentString setting (commentIt/uncommentIt for C sources)
Claus Gittinger <cg@exept.de>
parents:
2074
diff
changeset
|
5466 |
'makefile' |
343c831f625a
fixed commentString setting (commentIt/uncommentIt for C sources)
Claus Gittinger <cg@exept.de>
parents:
2074
diff
changeset
|
5467 |
) includes:currentFileName) ifTrue:[ |
2139 | 5468 |
^ #('#' (nil nil)). |
2138 | 5469 |
]. |
5470 |
(currentFileName endsWith:'.mak') ifTrue:[ |
|
2139 | 5471 |
^ #('#' (nil nil)). |
2138 | 5472 |
]. |
5473 |
||
2087
343c831f625a
fixed commentString setting (commentIt/uncommentIt for C sources)
Claus Gittinger <cg@exept.de>
parents:
2074
diff
changeset
|
5474 |
(currentFileName endsWith:'.sh') ifTrue:[ |
2139 | 5475 |
^ #('#' (nil nil)). |
1162 | 5476 |
]. |
5477 |
((currentFileName endsWith:'.c') |
|
5478 |
or:[(currentFileName endsWith:'.C')]) ifTrue:[ |
|
2139 | 5479 |
^ #(nil ('/*' '*/')). |
1162 | 5480 |
]. |
5481 |
((currentFileName endsWith:'.cc') |
|
5482 |
or:[(currentFileName endsWith:'.CC')]) ifTrue:[ |
|
2139 | 5483 |
^ #('//' ('/*' '*/')). |
1162 | 5484 |
]. |
5485 |
(currentFileName endsWith:'.java') ifTrue:[ |
|
2139 | 5486 |
^ #('//' (nil nil)). |
1162 | 5487 |
]. |
2104 | 5488 |
(currentFileName endsWith:'.style') ifTrue:[ |
2139 | 5489 |
^ #(';' (nil nil)). |
2104 | 5490 |
]. |
5491 |
(currentFileName endsWith:'.rs') ifTrue:[ |
|
2139 | 5492 |
^ #(';' (nil nil)). |
2104 | 5493 |
]. |
1162 | 5494 |
|
5495 |
"/ smalltalk comments |
|
5496 |
||
5497 |
^ #('"/' ('"' '"')). |
|
5498 |
||
2139 | 5499 |
"Created: / 7.1.1997 / 20:30:00 / cg" |
5500 |
"Modified: / 4.5.1999 / 19:42:30 / ps" |
|
5501 |
"Modified: / 4.5.1999 / 20:39:14 / cg" |
|
1162 | 5502 |
! |
5503 |
||
5504 |
fileTypeSpecificActions |
|
5505 |
"any special fileTypeSpecific actions are done here, |
|
5506 |
when a new file is selected" |
|
5507 |
||
5508 |
|commentStrings| |
|
5509 |
||
5510 |
commentStrings := self fileCommentStrings. |
|
5511 |
commentStrings notNil ifTrue:[ |
|
2138 | 5512 |
subView perform:#commentStrings: with:commentStrings ifNotUnderstood:nil |
1162 | 5513 |
]. |
5514 |
||
5515 |
"Modified: 7.1.1997 / 20:30:54 / cg" |
|
5516 |
! |
|
5517 |
||
5518 |
getFileInfoString:longInfo |
|
5519 |
"get stat info on selected file - return a string which can be |
|
5520 |
shown in a box" |
|
5521 |
||
5522 |
|fileName f fullPath text info fileOutput type modeBits modeString s ts| |
|
5523 |
||
5524 |
fileName := self getSelectedFileName. |
|
5525 |
fileName isNil ifTrue:[^ nil]. |
|
5526 |
||
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
5527 |
f := currentDirectory construct:fileName. |
1162 | 5528 |
info := f info. |
5529 |
||
5530 |
info isNil ifTrue:[ |
|
1329 | 5531 |
self showAlert:(resources string:'cannot get info of ''%1'' !!' with:fileName) |
5532 |
with:(OperatingSystem lastErrorString). |
|
5533 |
^ nil |
|
1162 | 5534 |
]. |
5535 |
||
5536 |
text := StringCollection new. |
|
5537 |
f isSymbolicLink ifTrue:[ |
|
1329 | 5538 |
text add:(resources string:'symbolic link to: %1' with:(f linkInfo path)) |
1162 | 5539 |
]. |
5540 |
||
5541 |
type := info type. |
|
5542 |
(longInfo and:[type == #regular]) ifTrue:[ |
|
1329 | 5543 |
fullPath := currentDirectory pathName asFilename constructString:fileName. |
5544 |
fileOutput := fullPath asFilename fileType. |
|
1162 | 5545 |
]. |
5546 |
||
5547 |
s := (resources at:'type: '). |
|
5548 |
fileOutput isNil ifTrue:[ |
|
1329 | 5549 |
s := s , type asString |
1162 | 5550 |
] ifFalse:[ |
1329 | 5551 |
s := s , 'regular (' , fileOutput , ')' |
1162 | 5552 |
]. |
5553 |
text add:s. |
|
5554 |
text add:(resources string:'size: %1' with:(info size) printString). |
|
5555 |
||
5556 |
modeBits := info mode. |
|
5557 |
modeString := self getModeString:modeBits. |
|
5558 |
longInfo ifTrue:[ |
|
1329 | 5559 |
text add:(resources string:'access: %1 (%2)' |
5560 |
with:modeString |
|
5561 |
with:(modeBits printStringRadix:8)) |
|
1162 | 5562 |
] ifFalse:[ |
1329 | 5563 |
text add:(resources string:'access: %1' with:modeString) |
1162 | 5564 |
]. |
5565 |
text add:(resources string:'owner: %1' |
|
1329 | 5566 |
with:(OperatingSystem getUserNameFromID:(info uid))). |
1162 | 5567 |
longInfo ifTrue:[ |
1329 | 5568 |
text add:(resources string:'group: %1' |
5569 |
with:(OperatingSystem getGroupNameFromID:(info gid))). |
|
5570 |
||
5571 |
ts := info accessed. |
|
5572 |
text add:(resources string:'last access: %1 %2' |
|
5573 |
with:(ts asTime printString) |
|
5574 |
with:(ts asDate printString)). |
|
5575 |
||
5576 |
ts := info modified. |
|
5577 |
text add:(resources string:'last modification: %1 %2' |
|
5578 |
with:(ts asTime printString) |
|
5579 |
with:(ts asDate printString)). |
|
1162 | 5580 |
]. |
5581 |
^ text asString |
|
5582 |
||
5583 |
"Modified: 8.9.1995 / 11:59:28 / claus" |
|
5584 |
"Modified: 1.11.1996 / 20:47:52 / cg" |
|
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
5585 |
"Modified: 18.9.1997 / 16:34:31 / stefan" |
1162 | 5586 |
! |
5587 |
||
5588 |
getInfoFile |
|
5589 |
"get filename of a description-file (.dir.info, README etc.); |
|
5590 |
This file is automatically shown when a directory is enterred. |
|
5591 |
You can add more names below if you like." |
|
5592 |
||
5593 |
#( |
|
5594 |
'.dir.info' |
|
5595 |
'README' |
|
5596 |
'ReadMe' |
|
5597 |
'Readme' |
|
5598 |
'readme' |
|
5599 |
'read.me' |
|
5600 |
'Read.me' |
|
5601 |
'READ.ME' |
|
1272 | 5602 |
'README.TXT' |
5603 |
'readme.txt' |
|
5604 |
'Readme.txt' |
|
1307 | 5605 |
'Info.txt' |
5606 |
'info.txt' |
|
5607 |
'INFO.TXT' |
|
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
5608 |
) do:[:f | |
1329 | 5609 |
|n| |
5610 |
n := currentDirectory construct:f. |
|
5611 |
(n isReadable and:[n isDirectory not]) ifTrue:[ |
|
5612 |
^ f. |
|
5613 |
] |
|
1140 | 5614 |
]. |
1162 | 5615 |
^ nil |
5616 |
||
1272 | 5617 |
"Modified: 3.8.1997 / 16:50:33 / cg" |
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
5618 |
"Modified: 16.9.1997 / 15:26:53 / stefan" |
1162 | 5619 |
! |
5620 |
||
5621 |
getModeString:modeBits |
|
5622 |
"convert file-mode bits into a more user-friendly string. |
|
5623 |
This is wrong here - should be moved into OperatingSystem." |
|
5624 |
||
5625 |
^ self getModeString:modeBits |
|
1317 | 5626 |
with:#( 'owner:' $r $w $x |
5627 |
' group:' $r $w $x |
|
5628 |
' others:' $r $w $x ) |
|
1140 | 5629 |
! |
5630 |
||
1162 | 5631 |
getModeString:modeBits with:texts |
5632 |
"convert file-mode bits into a more user-friendly string. |
|
5633 |
This is wrong here - should be moved into OperatingSystem." |
|
5634 |
||
5635 |
|bits modeString| |
|
5636 |
||
5637 |
bits := modeBits bitAnd:8r777. |
|
5638 |
modeString := ''. |
|
5639 |
||
5640 |
#( nil 8r400 8r200 8r100 nil 8r040 8r020 8r010 nil 8r004 8r002 8r001 ) |
|
5641 |
with: texts do:[:bitMask :access | |
|
1317 | 5642 |
|ch| |
5643 |
||
5644 |
bitMask isNil ifTrue:[ |
|
5645 |
modeString := modeString , (resources string:access) |
|
5646 |
] ifFalse:[ |
|
5647 |
(bits bitAnd:bitMask) == 0 ifTrue:[ |
|
5648 |
ch := $- |
|
5649 |
] ifFalse:[ |
|
5650 |
ch := access |
|
5651 |
]. |
|
5652 |
modeString := modeString copyWith:ch |
|
5653 |
] |
|
633
4630175ed31e
double click on .htm / .html files open a viewer;
Claus Gittinger <cg@exept.de>
parents:
585
diff
changeset
|
5654 |
]. |
1162 | 5655 |
^ modeString |
5656 |
! |
|
5657 |
||
5658 |
showInfo |
|
5659 |
"show directory info when dir has changed" |
|
5660 |
||
5661 |
|info txt| |
|
5662 |
||
5663 |
info := self getInfoFile. |
|
5664 |
info notNil ifTrue:[ |
|
1317 | 5665 |
txt := self readFile:info |
1162 | 5666 |
]. |
5667 |
self show:txt. |
|
5668 |
! |
|
5669 |
||
5670 |
sizePrintString:size |
|
5671 |
"helper for update-directory to return a string with a files size. |
|
5672 |
This one gives the size in byte, Kb or Mb depending on size. |
|
5673 |
If you dont like this, just uncomment the first statement below." |
|
5674 |
||
5675 |
|unitString n| |
|
5676 |
||
5677 |
" |
|
5678 |
^ size printString. |
|
5679 |
" |
|
5680 |
unitString := ''. |
|
5681 |
size < (500 * 1024) ifTrue:[ |
|
1317 | 5682 |
size < 1024 ifTrue:[ |
5683 |
n := size |
|
5684 |
] ifFalse:[ |
|
5685 |
n := (size * 10 // 1024 / 10.0). |
|
5686 |
unitString := ' Kb' |
|
5687 |
] |
|
1162 | 5688 |
] ifFalse:[ |
1317 | 5689 |
n := (size * 10 // 1024 // 1024 / 10.0). |
5690 |
unitString := ' Mb' |
|
1162 | 5691 |
]. |
5692 |
^ (n printStringLeftPaddedTo:5) , unitString. |
|
5693 |
! ! |
|
5694 |
||
5695 |
!FileBrowser methodsFor:'private - file-I/O'! |
|
5696 |
||
5697 |
readFile:fileName |
|
5698 |
"read in the file, answer its contents as StringCollection" |
|
5699 |
||
5700 |
^ self readFile:fileName lineDelimiter:Character cr encoding:nil |
|
5701 |
||
5702 |
"Modified: 22.2.1996 / 14:57:08 / cg" |
|
5703 |
! |
|
5704 |
||
5705 |
readFile:fileName lineDelimiter:aCharacter encoding:encoding |
|
5706 |
"read in the file, return its contents as StringCollection. |
|
5707 |
The files lines are delimited by aCharacter. |
|
5708 |
If encoding is nonNil, the file is assumed to be coded according to |
|
5709 |
that symbol, and #decodeString: should be able to convert it." |
|
5710 |
||
1994 | 5711 |
|f stream text msg sz| |
5712 |
||
5713 |
(f := fileName asFilename) isAbsolute ifFalse:[ |
|
2138 | 5714 |
f := (currentDirectory construct:fileName) |
1994 | 5715 |
]. |
5716 |
stream := f readStream. |
|
1162 | 5717 |
stream isNil ifTrue:[ |
2138 | 5718 |
msg := (resources string:'cannot read file ''%1'' !!' with:fileName). |
5719 |
self showAlert:msg with:(FileStream lastErrorString). |
|
5720 |
^ nil |
|
1162 | 5721 |
]. |
5722 |
||
5723 |
" |
|
5724 |
for very big files, give ObjectMemory a hint, to preallocate more |
|
5725 |
" |
|
1311 | 5726 |
(sz := stream fileSize) > 1000000 ifTrue:[ |
2138 | 5727 |
Processor activeProcess withPriority:Processor userBackgroundPriority do:[ |
5728 |
ObjectMemory announceSpaceNeed:(sz + (sz // 5)) "/ add 20% for tab expansion |
|
5729 |
]. |
|
1162 | 5730 |
]. |
5731 |
||
5732 |
text := self readStream:stream lineDelimiter:aCharacter encoding:encoding. |
|
5733 |
stream close. |
|
5734 |
^ text |
|
5735 |
||
1994 | 5736 |
"Created: / 22.2.1996 / 14:56:48 / cg" |
5737 |
"Modified: / 18.9.1997 / 17:06:54 / stefan" |
|
5738 |
"Modified: / 4.2.1999 / 17:52:18 / cg" |
|
1162 | 5739 |
! |
5740 |
||
5741 |
readStream:aStream |
|
5742 |
"read in from aStream, answer its contents as StringCollection" |
|
5743 |
||
5744 |
^ self readStream:aStream lineDelimiter:Character cr encoding:nil |
|
5745 |
||
5746 |
"Modified: 22.2.1996 / 14:58:40 / cg" |
|
633
4630175ed31e
double click on .htm / .html files open a viewer;
Claus Gittinger <cg@exept.de>
parents:
585
diff
changeset
|
5747 |
! |
4630175ed31e
double click on .htm / .html files open a viewer;
Claus Gittinger <cg@exept.de>
parents:
585
diff
changeset
|
5748 |
|
1162 | 5749 |
readStream:aStream lineDelimiter:aCharacter encoding:encoding |
5750 |
"read from aStream, answer its contents as StringCollection. |
|
5751 |
The files lines are delimited by aCharacter. |
|
5752 |
If encoding is nonNil, the file is assumed to be coded according to |
|
5753 |
that symbol, and #decodeString: should be able to convert it." |
|
5754 |
||
5755 |
|text line enc| |
|
5756 |
||
5757 |
text := StringCollection new. |
|
5758 |
||
5759 |
enc := encoding. |
|
5760 |
enc == #iso8859 ifTrue:[ |
|
2138 | 5761 |
enc := nil |
1162 | 5762 |
]. |
5763 |
||
5764 |
aCharacter == Character cr ifTrue:[ |
|
2138 | 5765 |
FileStream lineTooLongErrorSignal handle:[:ex | |
5766 |
|s partialLine| |
|
5767 |
||
5768 |
s := ex parameter at:1. |
|
5769 |
partialLine := ex parameter at:2. |
|
5770 |
ex proceedWith:(partialLine , s upTo:aCharacter) |
|
5771 |
] do:[ |
|
5772 |
[aStream atEnd] whileFalse:[ |
|
5773 |
line := aStream nextLine withTabsExpanded. |
|
5774 |
enc notNil ifTrue:[ |
|
5775 |
line := line decodeFrom:enc |
|
5776 |
]. |
|
5777 |
text add:line |
|
5778 |
]. |
|
5779 |
]. |
|
1162 | 5780 |
] ifFalse:[ |
2138 | 5781 |
[aStream atEnd] whileFalse:[ |
5782 |
line := (aStream upTo:aCharacter) withTabsExpanded. |
|
5783 |
enc notNil ifTrue:[ |
|
5784 |
line := line decodeFrom:enc |
|
5785 |
]. |
|
5786 |
text add:line |
|
5787 |
]. |
|
633
4630175ed31e
double click on .htm / .html files open a viewer;
Claus Gittinger <cg@exept.de>
parents:
585
diff
changeset
|
5788 |
]. |
1162 | 5789 |
^ text |
5790 |
||
1994 | 5791 |
"Created: / 22.2.1996 / 14:58:25 / cg" |
5792 |
"Modified: / 5.2.1999 / 00:53:22 / cg" |
|
1162 | 5793 |
! |
5794 |
||
5795 |
showFile:fileName |
|
5796 |
"show contents of fileName in subView" |
|
5797 |
||
1689 | 5798 |
fileListView selection:(fileList indexOf:fileName). |
5799 |
self fileGet |
|
5800 |
||
5801 |
"Modified: / 17.6.1998 / 11:26:13 / cg" |
|
1162 | 5802 |
! |
5803 |
||
5804 |
showFile:fileName insert:insert encoding:encoding |
|
5805 |
"show/insert contents of fileName in subView" |
|
5806 |
||
5807 |
^ self |
|
1317 | 5808 |
showFile:fileName insert:insert encoding:encoding doubleClick:false |
1162 | 5809 |
|
5810 |
"Modified: 19.6.1996 / 09:40:19 / cg" |
|
5811 |
! |
|
5812 |
||
5813 |
showFile:fileName insert:insert encoding:encoding doubleClick:viaDoubleClick |
|
5814 |
"show/insert contents of fileName in subView" |
|
5815 |
||
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
5816 |
|path buffer s n i ok convert text msg eol guess action enc |
1214
02d5bbd925dd
allow decoding errors to be ignored
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
5817 |
fontsEncoding pref failWarning| |
1162 | 5818 |
|
1994 | 5819 |
fileName asFilename isAbsolute ifFalse:[ |
2158
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5820 |
path := currentDirectory filenameFor:fileName. |
1994 | 5821 |
] ifTrue:[ |
2158
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5822 |
path := fileName asFilename asAbsoluteFilename |
1994 | 5823 |
]. |
5824 |
||
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
5825 |
(path type == #regular) ifFalse:[ |
2158
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5826 |
"asked for a non-file - ignore it ..." |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5827 |
path exists ifFalse:[ |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5828 |
msg := '''%1'' does not exist !!'. |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5829 |
] ifTrue:[ |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5830 |
msg := '''%1'' is not a regular file !!'. |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5831 |
]. |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5832 |
self warn:(resources string:msg with:fileName). |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5833 |
^ self |
1162 | 5834 |
]. |
5835 |
||
5836 |
"/ |
|
5837 |
"/ check if file is a text file |
|
5838 |
"/ |
|
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
5839 |
s := path readStream. |
1162 | 5840 |
s isNil ifTrue:[ |
2158
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5841 |
self showAlert:(resources string:'cannot read file ''%1'' !!' with:fileName) |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5842 |
with:(FileStream lastErrorString). |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5843 |
^ nil |
1162 | 5844 |
]. |
5845 |
||
1222
f2952fc3ced9
look at more when guessing the encoding
Claus Gittinger <cg@exept.de>
parents:
1221
diff
changeset
|
5846 |
buffer := String new:4096. |
f2952fc3ced9
look at more when guessing the encoding
Claus Gittinger <cg@exept.de>
parents:
1221
diff
changeset
|
5847 |
n := s nextBytes:4096 into:buffer. |
1162 | 5848 |
s close. |
5849 |
||
5850 |
enc := encoding. |
|
5851 |
ok := true. |
|
5852 |
guess := self guessEncodingFrom:buffer. |
|
5853 |
||
5854 |
guess == #binary ifTrue:[ |
|
2158
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5855 |
ok := false. |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5856 |
viaDoubleClick ifTrue:[ |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5857 |
(self binaryFileAction:fileName) ifTrue:[^ self]. |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5858 |
]. |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5859 |
(self confirm:(resources string:'''%1'' seems to be a binary file (or unsupported format) - show anyway ?' with:fileName)) |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5860 |
ifFalse:[^ self] |
1162 | 5861 |
] ifFalse:[ |
2158
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5862 |
viaDoubleClick ifTrue:[ |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5863 |
(self nonBinaryFileAction:fileName) ifTrue:[^ self]. |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5864 |
]. |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5865 |
|
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5866 |
fontsEncoding := subView font encoding. |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5867 |
pref := self preferredFontEncodingFor:guess. |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5868 |
|
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5869 |
ok := pref match:fontsEncoding. |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5870 |
ok ifFalse:[ |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5871 |
pref = 'iso8859*' ifTrue:[ |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5872 |
ok := 'ascii*' match:fontsEncoding |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5873 |
] |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5874 |
]. |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5875 |
ok ifTrue:[ |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5876 |
fileEncoding := guess. |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5877 |
enc := guess. |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5878 |
] ifFalse:[ |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5879 |
action := Dialog choose:(resources string:'''%1'' seems to require a %2 font.' with:fileName with:pref) |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5880 |
labels:(resources array:#('cancel' 'show' 'change font')) |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5881 |
values:#(nil #show #encoding) |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5882 |
default:#encoding. |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5883 |
action isNil ifTrue:[^ self]. |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5884 |
action == #encoding ifTrue:[ |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5885 |
fileEncoding := guess asSymbol. |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5886 |
subView externalEncoding:fileEncoding. |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5887 |
self validateFontEncodingFor:fileEncoding ask:false. |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5888 |
] ifFalse:[ |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5889 |
self information:(resources string:'Individual characters may be invisible/wrong in this font.') |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5890 |
]. |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5891 |
enc := fileEncoding. |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5892 |
]. |
1162 | 5893 |
]. |
5894 |
||
5895 |
convert := false. |
|
1329 | 5896 |
"/ ok ifTrue:[ |
5897 |
"/ "/ |
|
5898 |
"/ "/ check if line delimiter is a cr |
|
5899 |
"/ "/ |
|
5900 |
"/ i := buffer indexOf:Character cr. |
|
5901 |
"/ i == 0 ifTrue:[ |
|
5902 |
"/ "/ |
|
5903 |
"/ "/ no newline found - try cr |
|
5904 |
"/ "/ |
|
5905 |
"/ i := buffer indexOf:(Character value:13). |
|
5906 |
"/ i ~~ 0 ifTrue:[ |
|
5907 |
"/ convert := self confirm:(resources string:'''%1'' seems to have CR as line delimiter - convert to NL ?' with:fileName). |
|
5908 |
"/ ] |
|
5909 |
"/ ] |
|
5910 |
"/ ]. |
|
1162 | 5911 |
|
5912 |
insert ifFalse:[ |
|
2158
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5913 |
"/ release old text first |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5914 |
"/ - we might need the memory in case of huge files |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5915 |
"/ (helps if you have a 4Mb file in the view, |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5916 |
"/ and click on another biggy) |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5917 |
|
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5918 |
subView contents:nil. |
1162 | 5919 |
]. |
5920 |
||
5921 |
convert ifTrue:[ |
|
2158
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5922 |
eol := Character value:13 |
1162 | 5923 |
] ifFalse:[ |
2158
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5924 |
eol := Character cr |
1162 | 5925 |
]. |
1212 | 5926 |
|
1214
02d5bbd925dd
allow decoding errors to be ignored
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
5927 |
failWarning := false. |
1212 | 5928 |
CharacterArray decodingFailedSignal handle:[:ex | |
2158
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5929 |
|errStr| |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5930 |
|
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5931 |
failWarning ifFalse:[ |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5932 |
errStr := resources string:ex errorString. |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5933 |
(self confirm:(resources |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5934 |
string:'An error occurred while decoding:\%1\\The file has either a different encoding or is corrupted.\\Continue ?' |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5935 |
with:errStr) withCRs) |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5936 |
ifFalse:[ |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5937 |
^ self |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5938 |
]. |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5939 |
failWarning := true. |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5940 |
]. |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5941 |
ex proceed. |
1212 | 5942 |
] do:[ |
2158
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5943 |
text := self readFile:fileName lineDelimiter:eol encoding:enc. |
1212 | 5944 |
]. |
1162 | 5945 |
|
5946 |
insert ifFalse:[ |
|
2158
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5947 |
self show:text |
1162 | 5948 |
] ifTrue:[ |
2158
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5949 |
subView insertSelectedStringAtCursor:text asString |
1162 | 5950 |
]. |
5951 |
||
1994 | 5952 |
"Created: / 19.6.1996 / 09:39:52 / cg" |
5953 |
"Modified: / 18.9.1997 / 17:10:20 / stefan" |
|
2158
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5954 |
"Modified: / 18.5.1999 / 15:51:18 / cg" |
1162 | 5955 |
! |
5956 |
||
5957 |
writeFile:fileName text:someText encoding:encoding |
|
1353 | 5958 |
|stream errReason msg startNr nLines string| |
5959 |
||
5960 |
errReason := ''. |
|
5961 |
FileStream streamErrorSignal handle:[:ex | |
|
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
5962 |
errReason := ex errorString. |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
5963 |
ex return. |
1353 | 5964 |
] do:[ |
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
5965 |
stream := (currentDirectory filenameFor:fileName) writeStream. |
1353 | 5966 |
]. |
1162 | 5967 |
stream isNil ifTrue:[ |
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
5968 |
msg := (resources string:'cannot write file ''%1'' !!' with:fileName). |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
5969 |
self showAlert:msg with:errReason. |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
5970 |
^ self. |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
5971 |
]. |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
5972 |
|
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
5973 |
dosEOLMode value == true ifTrue:[ |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
5974 |
stream eolMode:#crlf. |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
5975 |
"/ must do it lineWise ... |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
5976 |
someText asStringCollection do:[:line | |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
5977 |
line notNil ifTrue:[ |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
5978 |
stream nextPutAll:line |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
5979 |
]. |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
5980 |
stream cr |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
5981 |
] |
1162 | 5982 |
] ifFalse:[ |
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
5983 |
(someText isString) ifTrue:[ |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
5984 |
stream nextPutAll:someText. |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
5985 |
] ifFalse:[ |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
5986 |
"/ |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
5987 |
"/ on some systems, writing linewise is very slow (via NFS) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
5988 |
"/ therefore we convert to a string and write it in chunks. |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
5989 |
"/ To avoid creating huge strings, we do it in blocks of 1000 lines. |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
5990 |
"/ |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
5991 |
startNr := 1. |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
5992 |
nLines := someText size. |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
5993 |
[startNr <= nLines] whileTrue:[ |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
5994 |
string := someText asStringWithCRsFrom:startNr |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
5995 |
to:((startNr + 1000) min:nLines) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
5996 |
compressTabs:compressTabs. |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
5997 |
encoding notNil ifTrue:[ |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
5998 |
string := string encodeInto:encoding |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
5999 |
]. |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
6000 |
stream nextPutAll:string. |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
6001 |
startNr := startNr + 1000 + 1. |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
6002 |
]. |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
6003 |
]. |
1353 | 6004 |
]. |
6005 |
||
6006 |
stream close. |
|
6007 |
subView modified:false |
|
1162 | 6008 |
|
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
6009 |
"Created: / 22.2.1996 / 15:03:10 / cg" |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
6010 |
"Modified: / 18.9.1997 / 17:12:44 / stefan" |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
6011 |
"Modified: / 6.5.1999 / 11:45:50 / cg" |
1140 | 6012 |
! ! |
6013 |
||
6014 |
!FileBrowser methodsFor:'private - presentation'! |
|
6015 |
||
6016 |
defineTabulatorsForLongList |
|
6017 |
"define the tabs for the long list" |
|
6018 |
||
6019 |
tabSpec := TabulatorSpecification new. |
|
6020 |
tabSpec unit:#inch. |
|
6021 |
"/ tabSpec positions:#(0 0.25 2.3 4.3 5.3 6.0 6.5). |
|
6022 |
tabSpec widths: #(0.25 2 2.0 1 0.5 0.5 1"any"). |
|
6023 |
" icon name mode owner group size type" |
|
6024 |
tabSpec align: #(#left #left #left #right #right #decimal #left). |
|
6025 |
tabSpec addDependent:self. |
|
6026 |
||
6027 |
tabRulerView tabulatorSpecification:tabSpec. |
|
6028 |
||
6029 |
"Modified: 17.4.1997 / 02:56:07 / cg" |
|
172 | 6030 |
! |
6031 |
||
1140 | 6032 |
defineTabulatorsForShortList |
6033 |
"define the tabs for the short list" |
|
6034 |
||
6035 |
tabSpec := TabulatorSpecification new. |
|
6036 |
tabSpec unit:#inch. |
|
6037 |
"/ tabSpec positions:#(0 0.25 ). |
|
6038 |
tabSpec widths: #(0.25 2 ). |
|
6039 |
" icon name" |
|
6040 |
tabSpec align: #(#left #left). |
|
6041 |
tabSpec addDependent:self. |
|
6042 |
||
1758 | 6043 |
tabRulerView notNil ifTrue:[ |
6044 |
tabRulerView tabulatorSpecification:tabSpec. |
|
6045 |
]. |
|
6046 |
||
6047 |
"Created: / 17.4.1997 / 02:51:41 / cg" |
|
6048 |
"Modified: / 27.7.1998 / 20:23:34 / cg" |
|
1140 | 6049 |
! |
6050 |
||
6051 |
iconForFile:aFilenameString |
|
1147 | 6052 |
"given a fileName, return an appropriate icon" |
6053 |
||
1784
329e3a904236
ask MIMETypes when mapping suffixes to icons.
Claus Gittinger <cg@exept.de>
parents:
1758
diff
changeset
|
6054 |
|f icn key key2 suff mimeType| |
1140 | 6055 |
|
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
6056 |
f := currentDirectory construct:aFilenameString. |
1140 | 6057 |
f isDirectory ifTrue:[ |
1868 | 6058 |
f isSymbolicLink ifTrue:[ |
6059 |
key := #directoryLink |
|
6060 |
] ifFalse:[ |
|
6061 |
key := #directory. |
|
6062 |
(f isReadable not or:[f isExecutable not]) ifTrue:[ |
|
6063 |
key := #directoryLocked |
|
6064 |
]. |
|
6065 |
] |
|
1147 | 6066 |
] ifFalse:[ |
1868 | 6067 |
f isSymbolicLink ifTrue:[ |
6068 |
f isReadable not ifTrue:[ |
|
6069 |
key := #fileLocked |
|
6070 |
] ifFalse:[ |
|
6071 |
key := #fileLink |
|
6072 |
] |
|
6073 |
] ifFalse:[ |
|
6074 |
key := key2 := #file. |
|
6075 |
f isExecutableProgram ifTrue:[ |
|
6076 |
key := key2 := #executableFile |
|
6077 |
]. |
|
6078 |
(f isReadable not) ifTrue:[ |
|
6079 |
key := #fileLocked |
|
6080 |
] ifFalse:[ |
|
6081 |
suff := f suffix. |
|
6082 |
mimeType := MIMETypes mimeTypeForSuffix:suff. |
|
6083 |
mimeType notNil ifTrue:[ |
|
6084 |
(mimeType startsWith:'image/') ifTrue:[ |
|
6085 |
key := #imageFile |
|
6086 |
] ifFalse:[ |
|
6087 |
(mimeType startsWith:'text/') ifTrue:[ |
|
6088 |
key := #textFile |
|
6089 |
] |
|
6090 |
] |
|
6091 |
]. |
|
6092 |
]. |
|
6093 |
]. |
|
1141 | 6094 |
]. |
1147 | 6095 |
|
1784
329e3a904236
ask MIMETypes when mapping suffixes to icons.
Claus Gittinger <cg@exept.de>
parents:
1758
diff
changeset
|
6096 |
"/ local (device) icons |
329e3a904236
ask MIMETypes when mapping suffixes to icons.
Claus Gittinger <cg@exept.de>
parents:
1758
diff
changeset
|
6097 |
icons notNil ifTrue:[ |
1868 | 6098 |
mimeType notNil ifTrue:[ |
6099 |
icn := icons at:mimeType ifAbsent:nil. |
|
6100 |
icn notNil ifTrue:[^ icn]. |
|
6101 |
]. |
|
6102 |
icn := icons at:key ifAbsent:nil. |
|
6103 |
icn notNil ifTrue:[^ icn]. |
|
1141 | 6104 |
]. |
1495 | 6105 |
|
1784
329e3a904236
ask MIMETypes when mapping suffixes to icons.
Claus Gittinger <cg@exept.de>
parents:
1758
diff
changeset
|
6106 |
"/ global icons |
329e3a904236
ask MIMETypes when mapping suffixes to icons.
Claus Gittinger <cg@exept.de>
parents:
1758
diff
changeset
|
6107 |
|
329e3a904236
ask MIMETypes when mapping suffixes to icons.
Claus Gittinger <cg@exept.de>
parents:
1758
diff
changeset
|
6108 |
Icons notNil ifTrue:[ |
1868 | 6109 |
mimeType notNil ifTrue:[ |
6110 |
icn := Icons at:mimeType ifAbsent:nil. |
|
6111 |
]. |
|
6112 |
icn notNil ifTrue:[ |
|
6113 |
key := mimeType |
|
6114 |
] ifFalse:[ |
|
6115 |
icn := Icons at:key ifAbsent:nil. |
|
6116 |
]. |
|
1784
329e3a904236
ask MIMETypes when mapping suffixes to icons.
Claus Gittinger <cg@exept.de>
parents:
1758
diff
changeset
|
6117 |
]. |
1495 | 6118 |
|
1253 | 6119 |
icn isNil ifTrue:[ |
1868 | 6120 |
( (key := key2) isNil |
6121 |
or:[(icn := icons at:key ifAbsent:nil) notNil |
|
6122 |
or:[(icn := Icons at:key ifAbsent:nil) isNil]] |
|
6123 |
) ifTrue:[ |
|
6124 |
^ icn |
|
6125 |
] |
|
1253 | 6126 |
]. |
1495 | 6127 |
|
1784
329e3a904236
ask MIMETypes when mapping suffixes to icons.
Claus Gittinger <cg@exept.de>
parents:
1758
diff
changeset
|
6128 |
"/ remember device icon |
329e3a904236
ask MIMETypes when mapping suffixes to icons.
Claus Gittinger <cg@exept.de>
parents:
1758
diff
changeset
|
6129 |
icn := icn copy onDevice:device. |
1495 | 6130 |
icn clearMaskedPixels. |
6131 |
icons at:key put:icn. |
|
1239
e58e2cb6639a
allow specification of icons from resource file.
Claus Gittinger <cg@exept.de>
parents:
1235
diff
changeset
|
6132 |
^ icn |
1141 | 6133 |
|
1746
68a187e3f30f
another icon for executable files.
Claus Gittinger <cg@exept.de>
parents:
1737
diff
changeset
|
6134 |
"Modified: / 18.9.1997 / 16:35:28 / stefan" |
1784
329e3a904236
ask MIMETypes when mapping suffixes to icons.
Claus Gittinger <cg@exept.de>
parents:
1758
diff
changeset
|
6135 |
"Modified: / 1.8.1998 / 17:42:37 / cg" |
36 | 6136 |
! |
6137 |
||
2094 | 6138 |
stopImageRenderProcess |
6139 |
imageRenderProcess notNil ifTrue:[ |
|
2138 | 6140 |
imageRenderProcess terminate. |
6141 |
imageRenderProcess := nil |
|
2094 | 6142 |
]. |
6143 |
||
6144 |
"Created: 19.4.1997 / 13:51:34 / cg" |
|
6145 |
! |
|
6146 |
||
1156
f3df28086973
dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents:
1154
diff
changeset
|
6147 |
stopUpdateProcess |
f3df28086973
dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents:
1154
diff
changeset
|
6148 |
Processor removeTimedBlock:checkBlock. |
f3df28086973
dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents:
1154
diff
changeset
|
6149 |
listUpdateProcess notNil ifTrue:[ |
1317 | 6150 |
listUpdateProcess terminate. |
6151 |
listUpdateProcess := nil. |
|
1156
f3df28086973
dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents:
1154
diff
changeset
|
6152 |
]. |
f3df28086973
dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents:
1154
diff
changeset
|
6153 |
|
f3df28086973
dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents:
1154
diff
changeset
|
6154 |
"Created: 19.4.1997 / 13:51:34 / cg" |
f3df28086973
dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents:
1154
diff
changeset
|
6155 |
! |
f3df28086973
dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents:
1154
diff
changeset
|
6156 |
|
36 | 6157 |
updateCurrentDirectory |
6158 |
"update listView with directory contents" |
|
6159 |
||
49 | 6160 |
"the code below may look somewhat complex - |
6161 |
it reads the directory first for the names, |
|
1151
194b10bad6da
great asynchronous list update;
Claus Gittinger <cg@exept.de>
parents:
1147
diff
changeset
|
6162 |
then (in followup sweeps over the files) gets the |
194b10bad6da
great asynchronous list update;
Claus Gittinger <cg@exept.de>
parents:
1147
diff
changeset
|
6163 |
files type, info and icon in a forked subprocess. |
1145
0464625bbdbb
read directory in a subprocess.
Claus Gittinger <cg@exept.de>
parents:
1144
diff
changeset
|
6164 |
This makes the Filebrowsers list update faster, since the fileInfo |
0464625bbdbb
read directory in a subprocess.
Claus Gittinger <cg@exept.de>
parents:
1144
diff
changeset
|
6165 |
(i.e. stat-calls) may take long - especially on NFS-mounted directories. |
49 | 6166 |
The file reading is done at lower priority, to let user continue |
6167 |
his work in other views. However, to be fair to other fileBrowser, |
|
6168 |
which may also read directories at low prio, give up the processor |
|
1145
0464625bbdbb
read directory in a subprocess.
Claus Gittinger <cg@exept.de>
parents:
1144
diff
changeset
|
6169 |
after every entry. This shares the cpu among all fileBrowsers; |
0464625bbdbb
read directory in a subprocess.
Claus Gittinger <cg@exept.de>
parents:
1144
diff
changeset
|
6170 |
Therefore, browsers which read short directories will finish first. |
49 | 6171 |
ST/X users love this behavior ;-) |
6172 |
" |
|
6173 |
||
294 | 6174 |
self withReadCursorDo:[ |
2138 | 6175 |
|files matchPattern list passDone f| |
6176 |
||
6177 |
self stopUpdateProcess. |
|
6178 |
||
6179 |
timeOfLastCheck := AbsoluteTime now. |
|
6180 |
||
6181 |
files := currentDirectory asFilename fullDirectoryContents. |
|
1329 | 6182 |
|
6183 |
"/ (files includes:(Filename parentDirectoryName)) ifTrue:[ |
|
6184 |
"/ upButton enable. |
|
6185 |
"/ ] ifFalse:[ |
|
6186 |
"/ upButton disable. |
|
6187 |
"/ ]. |
|
6188 |
||
2138 | 6189 |
"/ show files which are either directories |
6190 |
"/ or match the current pattern |
|
6191 |
||
6192 |
matchPattern := filterField contents. |
|
6193 |
(matchPattern notNil and:[ |
|
6194 |
matchPattern isEmpty not and:[ |
|
6195 |
matchPattern ~= '*']]) ifTrue:[ |
|
6196 |
files := files select:[:aName | |
|
6197 |
((currentDirectory construct:aName) isDirectory) |
|
6198 |
or:[matchPattern compoundMatch:aName] |
|
6199 |
]. |
|
6200 |
]. |
|
6201 |
||
6202 |
files size == 0 ifTrue:[ |
|
6203 |
self information:('directory ', currentDirectory pathName, ' vanished'). |
|
6204 |
^ self |
|
6205 |
]. |
|
6206 |
(sortByWhat value == #name) ifTrue:[ |
|
6207 |
sortCaseless value == true ifTrue:[ |
|
6208 |
files sort:[:a :b | a asLowercase < b asLowercase] |
|
6209 |
] ifFalse:[ |
|
6210 |
files sort. |
|
6211 |
] |
|
6212 |
] ifFalse:[ |
|
6213 |
(sortByWhat value == #time) ifTrue:[ |
|
6214 |
files sort:[:a :b | |f1 f2 t1 t2| |
|
6215 |
f1 := (currentDirectory construct:a). |
|
6216 |
f2 := (currentDirectory construct:b). |
|
6217 |
t1 := f1 isSymbolicLink |
|
6218 |
ifFalse:[f1 modificationTime] |
|
6219 |
ifTrue:[f1 linkInfo modified]. |
|
6220 |
t2 := f2 isSymbolicLink |
|
6221 |
ifFalse:[f2 modificationTime] |
|
6222 |
ifTrue:[f2 linkInfo modified]. |
|
6223 |
t1 := t1 ? (AbsoluteTime now). |
|
6224 |
t2 := t2 ? (AbsoluteTime now). |
|
6225 |
t1 > t2 |
|
6226 |
] |
|
6227 |
] ifFalse:[ |
|
6228 |
(sortByWhat value == #type) ifTrue:[ |
|
6229 |
files sort:[:a :b | |f1 f2 t1 t2 suff1 suff2| |
|
6230 |
f1 := (currentDirectory construct:a). |
|
6231 |
f2 := (currentDirectory construct:b). |
|
6232 |
t1 := f1 type ? #xbadLink. |
|
6233 |
t2 := f2 type ? #xbadLink. |
|
6234 |
t1 = t2 ifTrue:[ |
|
6235 |
suff1 := f1 suffix. |
|
6236 |
suff2 := f2 suffix. |
|
6237 |
suff1 = suff2 ifTrue:[ |
|
6238 |
sortCaseless value == true ifTrue:[ |
|
6239 |
a asLowercase < b asLowercase |
|
6240 |
] ifFalse:[ |
|
6241 |
a < b |
|
6242 |
] |
|
6243 |
] ifFalse:[ |
|
6244 |
suff1 asLowercase < suff2 asLowercase |
|
6245 |
] |
|
6246 |
] ifFalse:[ |
|
6247 |
t1 < t2 |
|
6248 |
] |
|
6249 |
] |
|
6250 |
] |
|
6251 |
] |
|
6252 |
]. |
|
6253 |
||
6254 |
files := self withoutHiddenFiles:files. |
|
6255 |
fileList := files copy. |
|
6256 |
||
6257 |
tabSpec isNil ifTrue:[ |
|
6258 |
showingDetails value "showLongList" ifTrue:[ |
|
6259 |
self defineTabulatorsForLongList |
|
6260 |
] ifFalse:[ |
|
6261 |
self defineTabulatorsForShortList |
|
6262 |
]. |
|
6263 |
]. |
|
6264 |
||
6265 |
"/ |
|
6266 |
"/ first show all the names - this can be done fast ... |
|
6267 |
"/ |
|
6268 |
list := files collect:[:fileName | |
|
6269 |
|entry| |
|
6270 |
||
6271 |
entry := MultiColListEntry new. |
|
6272 |
entry tabulatorSpecification:tabSpec. |
|
6273 |
entry colAt:1 put:nil. |
|
6274 |
entry colAt:2 put:fileName. |
|
6275 |
]. |
|
6276 |
||
6277 |
fileListView setList:list expandTabs:false. |
|
6278 |
passDone := Array new:list size withAll:0. |
|
6279 |
||
6280 |
" |
|
6281 |
this is a time consuming operation (especially, if reading an |
|
6282 |
NFS-mounted directory); therefore, start a low prio process, |
|
6283 |
which fills in the remaining fields in the fileList ... |
|
6284 |
" |
|
6285 |
||
6286 |
listUpdateProcess := [ |
|
6287 |
|prevUid prevGid fileNameString nameString groupString |
|
6288 |
modeString info line len |
|
6289 |
anyImages lineIndex aFileName |
|
6290 |
entry typ f p typeString done endIndex |
|
6291 |
state stopAtEnd nextState img prevFirstLine prevLastLine |
|
6292 |
numVisible dirSuffix| |
|
6293 |
||
6294 |
dirSuffix := Filename directorySuffix. |
|
6295 |
dirSuffix size > 0 ifTrue:[ |
|
6296 |
dirSuffix := '.' , dirSuffix asLowercase. |
|
6297 |
]. |
|
6298 |
||
6299 |
"/ |
|
6300 |
"/ then walk over the files, adding more info |
|
6301 |
"/ (since we have to stat each file, this may take a while longer) |
|
6302 |
"/ Visible items are always filled first. |
|
6303 |
||
6304 |
"/ |
|
6305 |
"/ the state machine |
|
6306 |
"/ |
|
6307 |
nextState := IdentityDictionary new. |
|
6308 |
showingDetails value "showLongList" ifTrue:[ |
|
6309 |
nextState add:(#visibleIcons -> #visibleAttributes). |
|
6310 |
nextState add:(#visibleAttributes -> #visibleTypes). |
|
6311 |
nextState add:(#visibleTypes -> #visibleImages). |
|
6312 |
nextState add:(#visibleImages -> #nextPageIcons). |
|
6313 |
||
6314 |
nextState add:(#nextPageIcons -> #nextPageAttributes). |
|
6315 |
nextState add:(#nextPageAttributes -> #nextPageTypes). |
|
6316 |
nextState add:(#nextPageTypes -> #nextPageImages). |
|
6317 |
nextState add:(#nextPageImages -> #previousPageIcons). |
|
6318 |
||
6319 |
nextState add:(#previousPageIcons -> #previousPageAttributes). |
|
6320 |
nextState add:(#previousPageAttributes -> #previousPageTypes). |
|
6321 |
nextState add:(#previousPageTypes -> #previousPageImages). |
|
6322 |
nextState add:(#previousPageImages -> #remainingIcons). |
|
6323 |
||
6324 |
nextState add:(#remainingIcons -> #remainingAttributes). |
|
6325 |
nextState add:(#remainingAttributes -> #remainingTypes). |
|
6326 |
nextState add:(#remainingTypes -> #remainingImages). |
|
6327 |
nextState add:(#remainingImages -> nil). |
|
6328 |
] ifFalse:[ |
|
6329 |
nextState add:(#visibleIcons -> #nextPageIcons). |
|
6330 |
nextState add:(#nextPageIcons -> #previousPageIcons). |
|
6331 |
nextState add:(#previousPageIcons -> #remainingIcons). |
|
6332 |
nextState add:(#remainingIcons -> nil). |
|
6333 |
]. |
|
6334 |
||
6335 |
anyImages := false. |
|
6336 |
||
6337 |
lineIndex := prevFirstLine := fileListView firstLineShown. |
|
6338 |
endIndex := prevLastLine := fileListView lastLineShown. |
|
6339 |
endIndex := endIndex min:(files size). |
|
6340 |
state := #visibleIcons. |
|
6341 |
||
6342 |
done := false. |
|
6343 |
[done] whileFalse:[ |
|
6344 |
"/ |
|
6345 |
"/ if multiple FileBrowsers are reading, let others |
|
6346 |
"/ make some progress too |
|
6347 |
"/ |
|
6348 |
Processor yield. |
|
6349 |
||
6350 |
"/ |
|
6351 |
"/ could be destroyed in the meanwhile ... |
|
6352 |
"/ |
|
6353 |
realized ifFalse:[ |
|
6354 |
listUpdateProcess := nil. |
|
6355 |
Processor activeProcess terminate |
|
6356 |
]. |
|
6357 |
||
6358 |
((prevFirstLine ~~ fileListView firstLineShown) |
|
6359 |
or:[prevLastLine ~~ fileListView lastLineShown]) ifTrue:[ |
|
6360 |
"/ start all over again |
|
6361 |
lineIndex := prevFirstLine := fileListView firstLineShown. |
|
6362 |
endIndex := prevLastLine := fileListView lastLineShown. |
|
6363 |
endIndex := endIndex min:(files size). |
|
6364 |
state := #visibleIcons. |
|
6365 |
]. |
|
6366 |
||
6367 |
(lineIndex between:1 and:(files size)) ifTrue:[ |
|
6368 |
||
6369 |
"/ |
|
6370 |
"/ expand the next entry ... |
|
6371 |
"/ |
|
6372 |
aFileName := files at:lineIndex. |
|
6373 |
entry := fileListView at:lineIndex. |
|
6374 |
f := currentDirectory construct:aFileName. |
|
6375 |
||
6376 |
(state endsWith:'Icons') ifTrue:[ |
|
6377 |
"/ |
|
6378 |
"/ pass 1 - icons |
|
6379 |
"/ |
|
6380 |
(passDone at:lineIndex) < 1 ifTrue:[ |
|
6381 |
(f isDirectory |
|
6382 |
and:[(aFileName ~= '..') and:[aFileName ~= '.']] |
|
6383 |
) ifTrue:[ |
|
6384 |
||
6385 |
"/ the following suffix cutOff is not really required, |
|
6386 |
"/ but makes the list look better on VMS ... |
|
6387 |
fileNameString := aFileName. |
|
6388 |
dirSuffix notNil ifTrue:[ |
|
6389 |
(aFileName asLowercase endsWith:dirSuffix) ifTrue:[ |
|
6390 |
fileNameString := aFileName copyWithoutLast:(dirSuffix size). |
|
6391 |
] |
|
6392 |
]. |
|
6393 |
fileNameString := fileNameString , ' ...' |
|
6394 |
] ifFalse:[ |
|
6395 |
fileNameString := aFileName. |
|
6396 |
OperatingSystem isVMSlike ifTrue:[ |
|
6397 |
(aFileName endsWith:'.') ifTrue:[ |
|
6398 |
aFileName ~= '..' ifTrue:[ |
|
6399 |
fileNameString := aFileName copyWithoutLast:1 |
|
6400 |
] |
|
6401 |
] |
|
6402 |
] |
|
6403 |
]. |
|
6404 |
||
6405 |
showingDetails value "showLongList" ifTrue:[ |
|
6406 |
len := fileNameString size. |
|
6407 |
(len > 20) ifTrue:[ |
|
6408 |
fileNameString := (fileNameString contractTo:20) |
|
6409 |
]. |
|
6410 |
]. |
|
6411 |
||
6412 |
entry colAt:1 put:(self iconForFile:aFileName). |
|
6413 |
entry colAt:2 put:fileNameString. |
|
6414 |
||
6415 |
"/fileListView at:lineIndex put:entry. |
|
6416 |
fileListView withoutRedrawAt:lineIndex put:entry. |
|
6417 |
fileListView invalidateLine:lineIndex. |
|
6418 |
||
6419 |
anyImages ifFalse:[ |
|
6420 |
(Image isImageFileSuffix:(aFileName asFilename suffix)) |
|
6421 |
ifTrue:[ |
|
6422 |
anyImages := true |
|
6423 |
] |
|
6424 |
]. |
|
6425 |
passDone at:lineIndex put:1 |
|
6426 |
] |
|
6427 |
]. |
|
6428 |
||
6429 |
(state endsWith:'Attributes') ifTrue:[ |
|
6430 |
"/ |
|
6431 |
"/ pass 2 - everything except fileType (which takes very long) |
|
6432 |
"/ |
|
6433 |
(passDone at:lineIndex) < 2 ifTrue:[ |
|
6434 |
info := f info. |
|
6435 |
info isNil ifTrue:[ |
|
6436 |
"not accessable - usually a symlink, |
|
6437 |
to a nonexisting/nonreadable file |
|
6438 |
" |
|
6439 |
f isSymbolicLink ifTrue:[ |
|
6440 |
p := f linkInfo path. |
|
6441 |
typeString := 'broken symbolic link to ' , p |
|
6442 |
] ifFalse:[ |
|
6443 |
typeString := 'unknown' |
|
6444 |
]. |
|
6445 |
] ifFalse:[ |
|
6446 |
typ := (info type). |
|
6447 |
||
6448 |
modeString := self getModeString:(info at:#mode) |
|
6449 |
with:#( '' $r $w $x |
|
6450 |
' ' $r $w $x |
|
6451 |
' ' $r $w $x ). |
|
6452 |
entry colAt:3 put:modeString. |
|
6453 |
||
6454 |
((info uid) ~~ prevUid) ifTrue:[ |
|
6455 |
prevUid := (info uid). |
|
6456 |
nameString := OperatingSystem getUserNameFromID:prevUid. |
|
6457 |
nameString := nameString contractTo:10. |
|
6458 |
nameString := nameString , (String new:(10 - nameString size)) |
|
6459 |
]. |
|
6460 |
nameString isNil ifTrue:[nameString := '???']. |
|
6461 |
entry colAt:4 put:nameString withoutSpaces. |
|
6462 |
||
6463 |
((info gid) ~~ prevGid) ifTrue:[ |
|
6464 |
prevGid := (info gid). |
|
6465 |
groupString := OperatingSystem getGroupNameFromID:prevGid. |
|
6466 |
groupString := groupString contractTo:10. |
|
6467 |
groupString := groupString , (String new:(10 - groupString size)) |
|
6468 |
]. |
|
6469 |
groupString isNil ifTrue:[groupString := '???']. |
|
6470 |
entry colAt:5 put:groupString withoutSpaces. |
|
6471 |
||
6472 |
(typ == #regular) ifTrue:[ |
|
6473 |
entry colAt:6 put:(self sizePrintString:(info size)). |
|
6474 |
]. |
|
6475 |
||
6476 |
f isSymbolicLink ifTrue:[ |
|
6477 |
p := f linkInfo path. |
|
6478 |
typeString := 'symbolic link to ' , p |
|
6479 |
] ifFalse:[ |
|
6480 |
typeString := typ asString |
|
6481 |
]. |
|
6482 |
]. |
|
6483 |
entry colAt:7 put:typeString. |
|
6484 |
||
6485 |
"/ fileListView at:lineIndex put:entry. |
|
6486 |
fileListView withoutRedrawAt:lineIndex put:entry. |
|
6487 |
fileListView invalidateLine:lineIndex. |
|
6488 |
passDone at:lineIndex put:2. |
|
6489 |
]. |
|
6490 |
]. |
|
6491 |
||
6492 |
(state endsWith:'Types') ifTrue:[ |
|
6493 |
"/ |
|
6494 |
"/ pass 3: add fileType |
|
6495 |
"/ |
|
6496 |
(passDone at:lineIndex) < 3 ifTrue:[ |
|
6497 |
info := f info. |
|
6498 |
info notNil ifTrue:[ |
|
6499 |
f isSymbolicLink ifFalse:[ |
|
6500 |
(Image isImageFileSuffix:(f suffix)) ifFalse:[ |
|
6501 |
typeString := f fileType. |
|
6502 |
||
6503 |
entry colAt:7 put:typeString. |
|
6504 |
"/ fileListView at:lineIndex put:entry |
|
6505 |
fileListView withoutRedrawAt:lineIndex put:entry. |
|
6506 |
fileListView invalidateLine:lineIndex. |
|
6507 |
]. |
|
6508 |
]. |
|
6509 |
]. |
|
6510 |
||
6511 |
passDone at:lineIndex put:3 |
|
6512 |
]. |
|
6513 |
]. |
|
6514 |
||
6515 |
(state endsWith:'Images') ifTrue:[ |
|
6516 |
"/ |
|
6517 |
"/ pass 4: read images |
|
6518 |
"/ |
|
6519 |
(passDone at:lineIndex) < 4 ifTrue:[ |
|
6520 |
(Image isImageFileSuffix:(f suffix)) ifTrue:[ |
|
6521 |
f isDirectory ifFalse:[ |
|
6522 |
img := Image fromFile:(f pathName). |
|
6523 |
img notNil ifTrue:[ |
|
6524 |
showingBigImagePreview value == true ifTrue:[ |
|
6525 |
img := img magnifiedTo:32@32. |
|
6526 |
] ifFalse:[ |
|
6527 |
img := img magnifiedTo:16@16. |
|
6528 |
]. |
|
6529 |
img := img on:self device. |
|
6530 |
entry colAt:7 put:img. |
|
6531 |
"/ fileListView at:lineIndex put:entry |
|
6532 |
fileListView withoutRedrawAt:lineIndex put:entry. |
|
6533 |
fileListView invalidateLine:lineIndex. |
|
6534 |
] |
|
6535 |
] |
|
6536 |
]. |
|
6537 |
passDone at:lineIndex put:4 |
|
6538 |
]. |
|
6539 |
]. |
|
6540 |
]. |
|
6541 |
||
6542 |
"/ |
|
6543 |
"/ advance to the next line |
|
6544 |
"/ |
|
6545 |
lineIndex := lineIndex + 1. |
|
6546 |
lineIndex > endIndex ifTrue:[ |
|
6547 |
"/ finished this round ... |
|
6548 |
"/ see what we are going for ... |
|
6549 |
numVisible := (fileListView lastLineShown - fileListView firstLineShown + 1). |
|
6550 |
||
6551 |
state := nextState at:state ifAbsent:nil. |
|
6552 |
||
6553 |
state isNil ifTrue:[ |
|
6554 |
done := true |
|
6555 |
] ifFalse:[ |
|
6556 |
(state startsWith:'visible') ifTrue:[ |
|
6557 |
lineIndex := fileListView firstLineShown. |
|
6558 |
endIndex := fileListView lastLineShown. |
|
6559 |
endIndex := endIndex min:(files size). |
|
6560 |
] ifFalse:[ |
|
6561 |
(state startsWith:'nextPage') ifTrue:[ |
|
6562 |
lineIndex := fileListView lastLineShown + 1. |
|
6563 |
endIndex := lineIndex + numVisible. |
|
6564 |
endIndex := endIndex min:(files size). |
|
6565 |
lineIndex := lineIndex min:(files size). |
|
6566 |
] ifFalse:[ |
|
6567 |
(state startsWith:'previousPage') ifTrue:[ |
|
6568 |
endIndex := fileListView firstLineShown - 1. |
|
6569 |
lineIndex := endIndex - numVisible. |
|
6570 |
lineIndex := lineIndex max:1. |
|
6571 |
endIndex := endIndex min:(files size). |
|
6572 |
endIndex := endIndex max:1. |
|
6573 |
] ifFalse:[ |
|
6574 |
"/ remaining |
|
6575 |
lineIndex := 1. |
|
6576 |
endIndex := files size. |
|
6577 |
] |
|
6578 |
] |
|
6579 |
] |
|
6580 |
] |
|
6581 |
] |
|
6582 |
]. |
|
6583 |
||
6584 |
listUpdateProcess := nil. |
|
6585 |
||
6586 |
] forkAt:(Processor activePriority - 1). |
|
6587 |
||
6588 |
" |
|
6589 |
install a new check after some time |
|
6590 |
" |
|
6591 |
Processor addTimedBlock:checkBlock afterSeconds:checkDelta |
|
36 | 6592 |
] |
142 | 6593 |
|
1487
c8d32d8b039c
oops - dont sort a nil object
Claus Gittinger <cg@exept.de>
parents:
1481
diff
changeset
|
6594 |
"Modified: / 21.9.1995 / 11:40:23 / claus" |
c8d32d8b039c
oops - dont sort a nil object
Claus Gittinger <cg@exept.de>
parents:
1481
diff
changeset
|
6595 |
"Modified: / 28.4.1997 / 22:30:30 / dq" |
c8d32d8b039c
oops - dont sort a nil object
Claus Gittinger <cg@exept.de>
parents:
1481
diff
changeset
|
6596 |
"Modified: / 18.9.1997 / 18:28:30 / stefan" |
1834 | 6597 |
"Modified: / 14.8.1998 / 17:59:06 / cg" |
386
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
6598 |
! ! |
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
6599 |
|
172 | 6600 |
!FileBrowser methodsFor:'queries'! |
73 | 6601 |
|
1700
5067b3c4cafa
added access to fileName (kludge to fileIn RefactoryBrowser)
Claus Gittinger <cg@exept.de>
parents:
1689
diff
changeset
|
6602 |
fileName |
1702
962056a31c06
remember the current file during fileIn,
Claus Gittinger <cg@exept.de>
parents:
1700
diff
changeset
|
6603 |
"return my current fileName - during fileIn, the file |
962056a31c06
remember the current file during fileIn,
Claus Gittinger <cg@exept.de>
parents:
1700
diff
changeset
|
6604 |
which is being loaded is returned. |
962056a31c06
remember the current file during fileIn,
Claus Gittinger <cg@exept.de>
parents:
1700
diff
changeset
|
6605 |
This is provided for VW fileIn scripts, which walk the |
962056a31c06
remember the current file during fileIn,
Claus Gittinger <cg@exept.de>
parents:
1700
diff
changeset
|
6606 |
context hierarchy and ask the fileBrowser for the name." |
962056a31c06
remember the current file during fileIn,
Claus Gittinger <cg@exept.de>
parents:
1700
diff
changeset
|
6607 |
|
962056a31c06
remember the current file during fileIn,
Claus Gittinger <cg@exept.de>
parents:
1700
diff
changeset
|
6608 |
|f| |
962056a31c06
remember the current file during fileIn,
Claus Gittinger <cg@exept.de>
parents:
1700
diff
changeset
|
6609 |
|
962056a31c06
remember the current file during fileIn,
Claus Gittinger <cg@exept.de>
parents:
1700
diff
changeset
|
6610 |
f := currentFileInFileName ? currentFileName. |
962056a31c06
remember the current file during fileIn,
Claus Gittinger <cg@exept.de>
parents:
1700
diff
changeset
|
6611 |
f isNil ifTrue:[^ nil]. |
962056a31c06
remember the current file during fileIn,
Claus Gittinger <cg@exept.de>
parents:
1700
diff
changeset
|
6612 |
^ self path asFilename construct:f |
1700
5067b3c4cafa
added access to fileName (kludge to fileIn RefactoryBrowser)
Claus Gittinger <cg@exept.de>
parents:
1689
diff
changeset
|
6613 |
|
5067b3c4cafa
added access to fileName (kludge to fileIn RefactoryBrowser)
Claus Gittinger <cg@exept.de>
parents:
1689
diff
changeset
|
6614 |
" |
5067b3c4cafa
added access to fileName (kludge to fileIn RefactoryBrowser)
Claus Gittinger <cg@exept.de>
parents:
1689
diff
changeset
|
6615 |
(FileBrowser openOnFileNamed:'Makefile') fileName |
5067b3c4cafa
added access to fileName (kludge to fileIn RefactoryBrowser)
Claus Gittinger <cg@exept.de>
parents:
1689
diff
changeset
|
6616 |
" |
5067b3c4cafa
added access to fileName (kludge to fileIn RefactoryBrowser)
Claus Gittinger <cg@exept.de>
parents:
1689
diff
changeset
|
6617 |
|
1702
962056a31c06
remember the current file during fileIn,
Claus Gittinger <cg@exept.de>
parents:
1700
diff
changeset
|
6618 |
"Modified: / 18.6.1998 / 15:27:35 / cg" |
1700
5067b3c4cafa
added access to fileName (kludge to fileIn RefactoryBrowser)
Claus Gittinger <cg@exept.de>
parents:
1689
diff
changeset
|
6619 |
! |
5067b3c4cafa
added access to fileName (kludge to fileIn RefactoryBrowser)
Claus Gittinger <cg@exept.de>
parents:
1689
diff
changeset
|
6620 |
|
172 | 6621 |
path |
6622 |
"return my currentDirectories pathName; |
|
1329 | 6623 |
sent from the pathField to aquire the pathname when I changed directory" |
6624 |
||
6625 |
"/ somewhat tricky: first ask it for the full pathName, |
|
6626 |
"/ then convert it to a directory name |
|
6627 |
"/ (which only makes a difference on VMS) |
|
6628 |
||
1828 | 6629 |
^ currentDirectory asFilename pathName "/ asFilename osNameForDirectory |
6630 |
||
6631 |
"Modified: / 12.8.1998 / 14:45:48 / cg" |
|
49 | 6632 |
! ! |
6633 |
||
763
94a8d188b52d
care for the nameSpace Query when loading binary classes
Claus Gittinger <cg@exept.de>
parents:
749
diff
changeset
|
6634 |
!FileBrowser class methodsFor:'documentation'! |
203 | 6635 |
|
6636 |
version |
|
2166
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6637 |
^ '$Header: /cvs/stx/stx/libtool/FileBrowser.st,v 1.323 1999-05-21 10:11:45 cg Exp $' |
381 | 6638 |
! ! |