author | penk |
Tue, 10 Sep 2002 16:02:13 +0200 | |
changeset 3860 | 8c491484ea20 |
parent 3824 | fc741ad2faf3 |
child 3861 | 8d5fcf90ae5f |
permissions | -rw-r--r-- |
36 | 1 |
" |
2 |
COPYRIGHT (c) 1991 by Claus Gittinger |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
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 |
||
2665
3601bc8c5ae2
cursorLeft - change to parent dir
Claus Gittinger <cg@exept.de>
parents:
2640
diff
changeset
|
13 |
"{ Package: 'stx:libtool' }" |
3601bc8c5ae2
cursorLeft - change to parent dir
Claus Gittinger <cg@exept.de>
parents:
2640
diff
changeset
|
14 |
|
36 | 15 |
StandardSystemView subclass:#FileBrowser |
3454 | 16 |
instanceVariableNames:'menuPanel labelView filterField fileListView subView |
17 |
currentDirectory fileList checkBlock checkDelta timeOfLastCheck |
|
18 |
myName killButton pauseToggle compressTabs lockUpdate |
|
19 |
previousDirectory currentFileName timeOfFileRead tabSpec |
|
20 |
commandView commandIndex fileEncoding tabRulerView scrollView |
|
21 |
icons listUpdateProcess currentFileInFileName |
|
22 |
lastFileDiffDirectory sortByWhat sortCaseless showingDetails |
|
23 |
showingTimeAndDate showingHiddenFiles showingBigImagePreview |
|
24 |
imagePreviewView imageRenderProcess dosEOLMode doAutoUpdate |
|
3789 | 25 |
doNotShowFontDialog lastEnforcedNameSpace' |
3454 | 26 |
classVariableNames:'DirectoryHistory DirectoryHistoryWhere DirectoryBookmarks |
27 |
HistorySize DefaultIcon CommandHistory CommandHistorySize Icons |
|
3789 | 28 |
DefaultCommandPerSuffix DefaultCommandPerMIME VisitedFileHistory |
29 |
LastEnforcedNameSpace' |
|
3454 | 30 |
poolDictionaries:'' |
31 |
category:'Interface-Browsers' |
|
36 | 32 |
! |
33 |
||
763
94a8d188b52d
care for the nameSpace Query when loading binary classes
Claus Gittinger <cg@exept.de>
parents:
749
diff
changeset
|
34 |
!FileBrowser class methodsFor:'documentation'! |
36 | 35 |
|
36 |
copyright |
|
37 |
" |
|
38 |
COPYRIGHT (c) 1991 by Claus Gittinger |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
39 |
All Rights Reserved |
36 | 40 |
|
41 |
This software is furnished under a license and may be used |
|
42 |
only in accordance with the terms of that license and with the |
|
43 |
inclusion of the above copyright notice. This software may not |
|
44 |
be provided or otherwise made available to, or used by, any |
|
45 |
other person. No title to or ownership of the software is |
|
46 |
hereby transferred. |
|
47 |
" |
|
48 |
! |
|
49 |
||
50 |
documentation |
|
51 |
" |
|
52 |
this used to be a very simple demo application, |
|
53 |
but migrated into a quite nice tool, includes all kinds of |
|
54 |
warning and information boxes, background processes for directory- |
|
55 |
reading and internationalized strings. A good example for beginners, |
|
100 | 56 |
on how to do things .... (and maybe how not to do things ;-, since some |
57 |
stuff is historic and was implemented at times when better mechanisms |
|
58 |
were not available) |
|
52 | 59 |
|
36 | 60 |
See additional information in 'doc/misc/fbrowser.doc'. |
45 | 61 |
|
52 | 62 |
WARNING: files edited with FileBrowser will have leading spaces (multiple-8) |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
63 |
being replaced by tabs. If tabs are to be preserved at other |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
64 |
positions (for example, sendmail-config files) they will be |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
65 |
corrupt after being written. |
508 | 66 |
|
67 |
[instance variables]: |
|
68 |
||
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
69 |
checkDelta <Integer> number of seconds of check interval |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
70 |
(looks ever so often if shown directory |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
71 |
has changed). You may make this number |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
72 |
higher, if your network-times are |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
73 |
incorrect and thus, the filebrowser |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
74 |
checks too often. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
75 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
76 |
compressTabs <Boolean> if true, leading spaces will be |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
77 |
replaced by tabs when saving text |
52 | 78 |
|
79 |
some of the defaults (long/short list etc.) can be set by the resource file; |
|
80 |
see FileBrowser>>initialize for more details.. |
|
508 | 81 |
|
82 |
[author:] |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
83 |
Claus Gittinger |
2031 | 84 |
|
85 |
[start with:] |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
86 |
FileBrowser open |
36 | 87 |
" |
203 | 88 |
! ! |
36 | 89 |
|
763
94a8d188b52d
care for the nameSpace Query when loading binary classes
Claus Gittinger <cg@exept.de>
parents:
749
diff
changeset
|
90 |
!FileBrowser class methodsFor:'instance creation'! |
36 | 91 |
|
3025 | 92 |
on:aDirectoryPath |
93 |
"return a new FileBrowser in a pathname" |
|
94 |
||
95 |
^ (self new currentDirectory:aDirectoryPath) |
|
96 |
||
97 |
" |
|
98 |
(FileBrowser on:'/usr/local/bin') open |
|
99 |
(FileBrowser on:'/etc' ) open |
|
100 |
(FileBrowser on:'..' ) open |
|
101 |
(FileBrowser on:'.' ) open |
|
102 |
" |
|
103 |
! |
|
104 |
||
36 | 105 |
openOn:aDirectoryPath |
106 |
"start a new FileBrowser in a pathname" |
|
107 |
||
3025 | 108 |
^ (self on:aDirectoryPath) open |
36 | 109 |
|
52 | 110 |
" |
111 |
FileBrowser openOn:'/etc' |
|
112 |
FileBrowser openOn:'..' |
|
113 |
FileBrowser openOn:'.' |
|
114 |
" |
|
93 | 115 |
! |
116 |
||
3025 | 117 |
openOn:aDirectoryPath withExtent:extent |
118 |
"start a new FileBrowser in a pathname" |
|
119 |
||
120 |
^ (self on:aDirectoryPath) openWithExtent:extent |
|
121 |
||
122 |
" |
|
123 |
FileBrowser openOn:'/etc' withExtent:200@300 |
|
124 |
FileBrowser openOn:'..' withExtent:200@300 |
|
125 |
FileBrowser openOn:'.' withExtent:200@300 |
|
126 |
" |
|
127 |
! |
|
128 |
||
93 | 129 |
openOnFileNamed:aFilename |
130 |
"start a new FileBrowser on a file" |
|
131 |
||
132 |
|f browser| |
|
133 |
||
134 |
f := aFilename asFilename. |
|
1124 | 135 |
f isDirectory ifTrue:[ |
3025 | 136 |
^ self openOn:aFilename |
137 |
]. |
|
138 |
||
139 |
browser := self on:f directoryName. |
|
1689 | 140 |
browser updateCurrentDirectory. |
93 | 141 |
browser showFile:f baseName. |
1689 | 142 |
|
143 |
^ browser open. |
|
93 | 144 |
|
145 |
" |
|
146 |
FileBrowser openOnFileNamed:'Makefile' |
|
147 |
FileBrowser openOnFileNamed:'../Makefile' |
|
148 |
FileBrowser openOnFileNamed:'/tmp/foo' |
|
149 |
" |
|
1124 | 150 |
|
1689 | 151 |
"Modified: / 17.6.1998 / 11:25:29 / cg" |
36 | 152 |
! ! |
153 |
||
1145
0464625bbdbb
read directory in a subprocess.
Claus Gittinger <cg@exept.de>
parents:
1144
diff
changeset
|
154 |
!FileBrowser class methodsFor:'class initialization'! |
0464625bbdbb
read directory in a subprocess.
Claus Gittinger <cg@exept.de>
parents:
1144
diff
changeset
|
155 |
|
2676 | 156 |
icons |
157 |
Icons isNil ifTrue:[ |
|
158 |
self initializeIcons |
|
159 |
]. |
|
160 |
^ Icons |
|
161 |
! |
|
162 |
||
2346 | 163 |
initializeDefaultCommands |
164 |
DefaultCommandPerMIME := Dictionary new. |
|
165 |
||
166 |
DefaultCommandPerMIME at:'application/x-tar-compressed' put:'gunzip < %1 | tar tvf -'. |
|
3654 | 167 |
DefaultCommandPerMIME at:'application/pdf' put:'acroread -display %2 %1'. |
2346 | 168 |
|
169 |
" |
|
170 |
self initializeDefaultCommands |
|
171 |
" |
|
172 |
||
173 |
"Modified: / 1.8.1998 / 17:39:27 / cg" |
|
174 |
! |
|
175 |
||
3860 | 176 |
initializeFileTypeIcons |
1239
e58e2cb6639a
allow specification of icons from resource file.
Claus Gittinger <cg@exept.de>
parents:
1235
diff
changeset
|
177 |
|resources| |
e58e2cb6639a
allow specification of icons from resource file.
Claus Gittinger <cg@exept.de>
parents:
1235
diff
changeset
|
178 |
|
e58e2cb6639a
allow specification of icons from resource file.
Claus Gittinger <cg@exept.de>
parents:
1235
diff
changeset
|
179 |
resources := self classResources. |
e58e2cb6639a
allow specification of icons from resource file.
Claus Gittinger <cg@exept.de>
parents:
1235
diff
changeset
|
180 |
|
1147 | 181 |
#( |
2187
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
182 |
"/ internal-type to icon mappings. |
3860 | 183 |
(#directory 'ICON_DIRECTORY' 'tiny_yellow_dir.xpm' ) |
184 |
(#directoryLocked 'ICON_DIRECTORY_LOCKED' 'tiny_yellow_dir_locked.xpm' ) |
|
185 |
(#directoryLink 'ICON_DIRECTORY_LINK' 'tiny_yellow_dir_link.xpm' ) |
|
186 |
(#file 'ICON_FILE' 'tiny_file_plain.xpm' ) |
|
187 |
(#fileLink 'ICON_FILE_LINK' 'tiny_file_link.xpm' ) |
|
188 |
(#fileLocked 'ICON_FILE_LOCKED' 'tiny_file_lock.xpm' ) |
|
189 |
(#imageFile 'ICON_IMAGE_FILE' 'tiny_file_pix.xpm' ) |
|
190 |
(#textFile 'ICON_TEXT_FILE' 'tiny_file_text.xpm' ) |
|
191 |
(#executableFile 'ICON_EXECUTABLEFILE' 'tiny_file_exec.xpm' ) |
|
192 |
(#deviceFile 'ICON_DEVICE_FILE' 'tiny_file_device.xpm' ) |
|
193 |
(#binaryFile 'ICON_BINARY_FILE' 'tiny_file_binary.xpm' ) |
|
194 |
(#compressedFile 'ICON_COMPRESSED_FILE' 'tiny_file_compressed.xpm' ) |
|
195 |
(#compressedArchive 'ICON_COMPRESSED_ARCHIVE' 'tiny_file_tar_compressed.xpm' ) |
|
196 |
(#archive 'ICON_ARCHIVE' 'tiny_file_tar.xpm' ) |
|
197 |
(#specialFile 'ICON_SPECIALFILE' 'tiny_file_special.xpm' ) |
|
198 |
||
199 |
(#directoryGray 'ICON_DIRECTORY_GRAY' 'tiny_yellow_dir_gray.xpm' ) |
|
1239
e58e2cb6639a
allow specification of icons from resource file.
Claus Gittinger <cg@exept.de>
parents:
1235
diff
changeset
|
200 |
) do:[:entry | |
2491
0222b19ee371
new icon search (search under goodies package)
Claus Gittinger <cg@exept.de>
parents:
2476
diff
changeset
|
201 |
|key resource defaultName nm img| |
2187
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
202 |
|
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
203 |
key := entry at:1. |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
204 |
resource := entry at:2. |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
205 |
defaultName := entry at:3. |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
206 |
|
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
207 |
resource notNil ifTrue:[ |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
208 |
nm := resources at:resource default:nil. |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
209 |
]. |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
210 |
nm isNil ifTrue:[ |
2491
0222b19ee371
new icon search (search under goodies package)
Claus Gittinger <cg@exept.de>
parents:
2476
diff
changeset
|
211 |
nm := 'xpmBitmaps/document_images/' , defaultName |
2187
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
212 |
]. |
2492
055eef2763e3
moved icon search to smalltalk utility method
Claus Gittinger <cg@exept.de>
parents:
2491
diff
changeset
|
213 |
Icons at:key put:(Smalltalk imageFromFileNamed:nm forClass:self). |
1147 | 214 |
] |
215 |
||
216 |
" |
|
3860 | 217 |
self initializeFileTypeIcons |
218 |
" |
|
219 |
! |
|
220 |
||
221 |
initializeIcons |
|
222 |
|resources| |
|
223 |
||
224 |
resources := self classResources. |
|
225 |
||
226 |
Icons := Dictionary new. |
|
227 |
self initializeFileTypeIcons. |
|
228 |
self initializeMimeTypeIcons. |
|
229 |
||
230 |
" |
|
1178
f5f4d0c605db
lazy initialization of Icons
Claus Gittinger <cg@exept.de>
parents:
1173
diff
changeset
|
231 |
self initializeIcons |
1147 | 232 |
" |
233 |
||
1784
329e3a904236
ask MIMETypes when mapping suffixes to icons.
Claus Gittinger <cg@exept.de>
parents:
1758
diff
changeset
|
234 |
"Modified: / 1.8.1998 / 17:39:27 / cg" |
3860 | 235 |
! |
236 |
||
237 |
initializeMimeTypeIcons |
|
238 |
||
239 |
#( |
|
240 |
"/ mime-type to icon mappings. |
|
241 |
'image/jpeg' 'tiny_file_pix.xpm' |
|
242 |
'image/gif' 'tiny_file_pix.xpm' |
|
243 |
'image/tiff' 'tiny_file_pix.xpm' |
|
244 |
'image/x-xbitmap' 'tiny_file_pix.xpm' |
|
245 |
'image/x-xpixmap' 'tiny_file_pix.xpm' |
|
246 |
'image/x-png' 'tiny_file_pix.xpm' |
|
247 |
'image/x-photo-cd' 'tiny_file_pix.xpm' |
|
248 |
'image/x-MS-bmp' 'tiny_file_pix.xpm' |
|
249 |
'image/x-rgb' 'tiny_file_pix.xpm' |
|
250 |
'image/x-portable-pixmap' 'tiny_file_pix.xpm' |
|
251 |
'image/x-portable-graymap' 'tiny_file_pix.xpm' |
|
252 |
'image/x-portable-bitmap' 'tiny_file_pix.xpm' |
|
253 |
'image/x-portable-anymap' 'tiny_file_pix.xpm' |
|
254 |
'image/x-xwindowdump' 'tiny_file_pix.xpm' |
|
255 |
'image/x-cmu-raster' 'tiny_file_pix.xpm' |
|
256 |
'image/x-targa' 'tiny_file_pix.xpm' |
|
257 |
||
258 |
"/ misc text ... |
|
259 |
||
260 |
'text/html' 'tiny_file_text.xpm' |
|
261 |
'text/html' 'tiny_file_text.xpm' |
|
262 |
'text/plain' 'tiny_file_text.xpm' |
|
263 |
||
264 |
'application/postscript' 'tiny_file_postscript.xpm' |
|
265 |
'application/pdf' 'tiny_file_pdf.xpm' |
|
266 |
'application/rtf' 'tiny_file_text.xpm' |
|
267 |
||
268 |
"/ video formats ... |
|
269 |
||
270 |
'video/x-sgi-movie' 'tiny_file_movie.xpm' |
|
271 |
'video/x-msvideo' 'tiny_file_movie.xpm' |
|
272 |
'video/quicktime' 'tiny_file_movie.xpm' |
|
273 |
'video/x-mpeg2' 'tiny_file_movie.xpm' |
|
274 |
'video/mpeg' 'tiny_file_movie.xpm' |
|
275 |
||
276 |
"/ audio formats ... |
|
277 |
||
278 |
'audio/x-pn-realaudio' 'tiny_file_sound.xpm' |
|
279 |
'audio/x-mpeg' 'tiny_file_sound.xpm' |
|
280 |
'audio/x-mp3' 'tiny_file_sound.xpm' |
|
281 |
'audio/x-wav' 'tiny_file_sound.xpm' |
|
282 |
'audio/x-aiff' 'tiny_file_sound.xpm' |
|
283 |
'audio/basic' 'tiny_file_sound.xpm' |
|
284 |
||
285 |
"/ more multimedia ... |
|
286 |
||
287 |
'audio/x-shockwave-flash' 'tiny_file_sound.xpm' |
|
288 |
||
289 |
"/ misc stuff |
|
290 |
'application/winword' 'tiny_file_text.xpm' |
|
291 |
||
292 |
"/ progr. languages |
|
293 |
'application/x-smalltalk-source' 'tiny_file_st.xpm' |
|
294 |
'application/x-smalltalk-source-sif' 'tiny_file_text.xpm' |
|
295 |
'application/x-c-source' 'tiny_file_text.xpm' |
|
296 |
'application/x-cpp-source' 'tiny_file_text.xpm' |
|
297 |
'application/x-javascript' 'tiny_file_text.xpm' |
|
298 |
'application/x-java-source' 'tiny_file_java.xpm' |
|
299 |
'application/x-sh' 'tiny_file_text.xpm' |
|
300 |
'application/x-csh' 'tiny_file_text.xpm' |
|
301 |
'application/x-tcl' 'tiny_file_text.xpm' |
|
302 |
'application/x-perl' 'tiny_file_text.xpm' |
|
303 |
'application/x-make' 'tiny_file_text.xpm' |
|
304 |
'application/x-batch-script' 'tiny_file_text.xpm' |
|
305 |
'application/x-asn1-source' 'tiny_file_text.xpm' |
|
306 |
||
307 |
"/ compressors / archivers |
|
308 |
'application/x-tar' 'tiny_file_archive.xpm' |
|
309 |
'application/x-gtar' 'tiny_file_archive.xpm' |
|
310 |
'application/x-tar-compressed' 'tiny_file_compressed_archive.xpm' |
|
311 |
'application/x-zip-compressed' 'tiny_file_compressed_archive.xpm' |
|
312 |
'application/x-gzip-compressed' 'tiny_file_compressed_archive.xpm' |
|
313 |
'application/x-cpio' 'tiny_file_archive.xpm' |
|
314 |
'application/x-shar' 'tiny_file_archive.xpm' |
|
315 |
'application/java-archive' 'tiny_file_archive.xpm' |
|
316 |
) pairWiseDo:[:mimeType :fileName | |
|
317 |
| nm | |
|
318 |
||
319 |
nm := 'xpmBitmaps/document_images/' , fileName. |
|
320 |
Icons at:mimeType put:(Smalltalk imageFromFileNamed:nm forClass:self). |
|
321 |
] |
|
322 |
||
323 |
" |
|
324 |
self initializeMimeTypeIcons |
|
325 |
" |
|
1145
0464625bbdbb
read directory in a subprocess.
Claus Gittinger <cg@exept.de>
parents:
1144
diff
changeset
|
326 |
! ! |
0464625bbdbb
read directory in a subprocess.
Claus Gittinger <cg@exept.de>
parents:
1144
diff
changeset
|
327 |
|
763
94a8d188b52d
care for the nameSpace Query when loading binary classes
Claus Gittinger <cg@exept.de>
parents:
749
diff
changeset
|
328 |
!FileBrowser class methodsFor:'defaults'! |
73 | 329 |
|
330 |
defaultIcon |
|
1147 | 331 |
"return the file browsers default window icon" |
332 |
||
1287 | 333 |
<resource: #style (#FILEBROWSER_ICON #FILEBROWSER_ICON_FILE)> |
334 |
||
335 |
|nm i res| |
|
1147 | 336 |
|
337 |
(i := DefaultIcon) isNil ifTrue:[ |
|
2339 | 338 |
res := self classResources. |
339 |
i := res at:'FILEBROWSER_ICON' default:nil. |
|
340 |
i isNil ifTrue:[ |
|
341 |
nm := res at:'FILEBROWSER_ICON_FILE' default:'FBrowser.xbm'. |
|
2476 | 342 |
i := Smalltalk imageFromFileNamed:nm forClass:self. |
2339 | 343 |
i isNil ifTrue:[ |
2453
63c50508c4cd
try my bitmaps in package directory
Claus Gittinger <cg@exept.de>
parents:
2447
diff
changeset
|
344 |
i := StandardSystemView defaultIcon |
2339 | 345 |
] |
346 |
]. |
|
347 |
i notNil ifTrue:[ |
|
348 |
DefaultIcon := i := i onDevice:Display |
|
349 |
] |
|
1145
0464625bbdbb
read directory in a subprocess.
Claus Gittinger <cg@exept.de>
parents:
1144
diff
changeset
|
350 |
]. |
0464625bbdbb
read directory in a subprocess.
Claus Gittinger <cg@exept.de>
parents:
1144
diff
changeset
|
351 |
^ i |
0464625bbdbb
read directory in a subprocess.
Claus Gittinger <cg@exept.de>
parents:
1144
diff
changeset
|
352 |
|
1147 | 353 |
"Modified: 19.3.1997 / 20:48:34 / ca" |
1287 | 354 |
"Modified: 15.8.1997 / 15:27:19 / cg" |
73 | 355 |
! ! |
356 |
||
2951
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
357 |
!FileBrowser class methodsFor:'history'! |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
358 |
|
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
359 |
addToCommandHistory:aCommandString for:aFilename |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
360 |
|cmd suffix| |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
361 |
|
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
362 |
(aCommandString notNil and:[aCommandString notEmpty]) ifTrue:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
363 |
CommandHistory notNil ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
364 |
CommandHistory addFirst:aCommandString. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
365 |
CommandHistory size > CommandHistorySize ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
366 |
CommandHistory removeLast |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
367 |
] |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
368 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
369 |
aFilename notNil ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
370 |
cmd := aCommandString copyTo:(aCommandString indexOf:Character space ifAbsent:[aCommandString size + 1])-1. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
371 |
DefaultCommandPerSuffix isNil ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
372 |
DefaultCommandPerSuffix := Dictionary new. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
373 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
374 |
suffix := aFilename asFilename suffix. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
375 |
suffix notNil ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
376 |
DefaultCommandPerSuffix at:suffix put:cmd. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
377 |
] |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
378 |
] |
2951
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
379 |
] |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
380 |
|
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
381 |
"Created: 14.11.1996 / 14:58:13 / cg" |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
382 |
! |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
383 |
|
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
384 |
addToHistory:path |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
385 |
|pos idx| |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
386 |
|
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
387 |
idx := DirectoryHistory indexOf:path. |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
388 |
idx == 0 ifTrue:[ |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
389 |
DirectoryHistory size >= HistorySize ifTrue:[ |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
390 |
DirectoryHistory removeLast. |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
391 |
DirectoryHistoryWhere removeLast |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
392 |
] |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
393 |
] ifFalse:[ |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
394 |
"already been there before; move the entry to |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
395 |
the beginning, so it will fall out later." |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
396 |
|
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
397 |
DirectoryHistory removeIndex:idx. |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
398 |
pos := DirectoryHistoryWhere at:idx. |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
399 |
DirectoryHistoryWhere removeIndex:idx. |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
400 |
]. |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
401 |
DirectoryHistory addFirst:path. |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
402 |
DirectoryHistoryWhere addFirst:pos. |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
403 |
|
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
404 |
"Created: / 8.11.1997 / 17:16:29 / cg" |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
405 |
! |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
406 |
|
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
407 |
addToVisitedFileHistory:path |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
408 |
|idx| |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
409 |
|
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
410 |
idx := VisitedFileHistory indexOf:path. |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
411 |
idx == 0 ifTrue:[ |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
412 |
VisitedFileHistory size >= HistorySize ifTrue:[ |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
413 |
VisitedFileHistory removeLast. |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
414 |
] |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
415 |
] ifFalse:[ |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
416 |
"already been there before; move the entry to |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
417 |
the beginning, so it will fall out later." |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
418 |
|
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
419 |
VisitedFileHistory removeIndex:idx. |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
420 |
]. |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
421 |
VisitedFileHistory addFirst:path. |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
422 |
! ! |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
423 |
|
1933 | 424 |
!FileBrowser class methodsFor:'interface specs'! |
425 |
||
426 |
fileSearchDialogSpec |
|
427 |
"This resource specification was automatically generated |
|
428 |
by the UIPainter of ST/X." |
|
429 |
||
430 |
"Do not manually edit this!! If it is corrupted, |
|
431 |
the UIPainter may not be able to read the specification." |
|
432 |
||
433 |
" |
|
434 |
UIPainter new openOnClass:FileBrowser andSelector:#fileSearchDialogSpec |
|
435 |
" |
|
436 |
||
437 |
<resource: #canvas> |
|
438 |
||
439 |
^ |
|
440 |
||
441 |
#(#FullSpec |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
442 |
#window: |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
443 |
#(#WindowSpec |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
444 |
#name: 'File Search' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
445 |
#layout: #(#LayoutFrame 4 0 50 0 315 0 349 0) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
446 |
#level: 0 |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
447 |
#label: 'File Search' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
448 |
#min: #(#Point 10 10) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
449 |
#max: #(#Point 1280 1024) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
450 |
#bounds: #(#Rectangle 4 50 316 350) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
451 |
#usePreferredExtent: false |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
452 |
#returnIsOKInDialog: true |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
453 |
#escapeIsCancelInDialog: true |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
454 |
) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
455 |
#component: |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
456 |
#(#SpecCollection |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
457 |
#collection: |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
458 |
#( |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
459 |
#(#LabelSpec |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
460 |
#name: 'Label1' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
461 |
#layout: #(#LayoutFrame 0 0 10 0 0 1 32 0) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
462 |
#label: 'Search for files named:' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
463 |
#translateLabel: true |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
464 |
#adjust: #left |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
465 |
) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
466 |
#(#InputFieldSpec |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
467 |
#name: 'EntryField1' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
468 |
#layout: #(#LayoutFrame 10 0 36 0 305 0 58 0) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
469 |
#tabable: true |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
470 |
#model: #namePatternHolder |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
471 |
) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
472 |
#(#CheckBoxSpec |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
473 |
#name: 'CheckBox1' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
474 |
#layout: #(#LayoutFrame 7 0 66 0 143 0 88 0) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
475 |
#tabable: true |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
476 |
#model: #ignoreCaseInName |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
477 |
#label: 'Ignore case' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
478 |
#translateLabel: true |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
479 |
) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
480 |
#(#LabelSpec |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
481 |
#name: 'Label2' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
482 |
#layout: #(#LayoutFrame 0 0.0 107 0 0 1.0 129 0) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
483 |
#label: 'Containing the string:' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
484 |
#translateLabel: true |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
485 |
#adjust: #left |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
486 |
) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
487 |
#(#InputFieldSpec |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
488 |
#name: 'EntryField2' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
489 |
#layout: #(#LayoutFrame 10 0 133 0 305 0 155 0) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
490 |
#enableChannel: #notSearchForSameContents |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
491 |
#tabable: true |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
492 |
#model: #contentsPatternHolder |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
493 |
) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
494 |
#(#CheckBoxSpec |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
495 |
#name: 'CheckBox2' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
496 |
#layout: #(#LayoutFrame 6 0 163 0 142 0 185 0) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
497 |
#enableChannel: #notSearchForSameContents |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
498 |
#tabable: true |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
499 |
#model: #ignoreCaseInContents |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
500 |
#label: 'Ignore case' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
501 |
#translateLabel: true |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
502 |
) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
503 |
#(#LabelSpec |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
504 |
#name: 'Label3' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
505 |
#layout: #(#LayoutFrame 0 0.0 223 0 -30 1.0 245 0) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
506 |
#label: 'Containing same contents as selected:' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
507 |
#translateLabel: true |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
508 |
#adjust: #left |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
509 |
) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
510 |
#(#DividerSpec |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
511 |
#name: 'Separator1' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
512 |
#layout: #(#LayoutFrame 0 0.0 97 0 0 1.0 101 0) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
513 |
) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
514 |
#(#CheckToggleSpec |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
515 |
#name: 'CheckToggle1' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
516 |
#layout: #(#LayoutOrigin -25 1 225 0) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
517 |
#tabable: true |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
518 |
#model: #searchForSameContents |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
519 |
#enableChannel: #searchForSameContentsEnabled |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
520 |
#isTriggerOnDown: true |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
521 |
#showLamp: false |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
522 |
#lampColor: #(#Color 100.0 100.0 0.0) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
523 |
) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
524 |
#(#HorizontalPanelViewSpec |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
525 |
#name: 'HorizontalPanel1' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
526 |
#layout: #(#LayoutFrame 0 0.0 -30 1 0 1.0 0 1.0) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
527 |
#component: |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
528 |
#(#SpecCollection |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
529 |
#collection: |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
530 |
#( |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
531 |
#(#ActionButtonSpec |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
532 |
#name: 'Button1' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
533 |
#label: 'Cancel' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
534 |
#translateLabel: true |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
535 |
#tabable: true |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
536 |
#model: #cancel |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
537 |
#extent: #(#Point 151 25) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
538 |
) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
539 |
#(#ActionButtonSpec |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
540 |
#name: 'Button2' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
541 |
#label: 'Search' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
542 |
#translateLabel: true |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
543 |
#tabable: true |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
544 |
#model: #accept |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
545 |
#isDefault: true |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
546 |
#extent: #(#Point 152 25) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
547 |
) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
548 |
) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
549 |
) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
550 |
#horizontalLayout: #fitSpace |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
551 |
#verticalLayout: #centerMax |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
552 |
#horizontalSpace: 3 |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
553 |
#verticalSpace: 3 |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
554 |
) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
555 |
) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
556 |
) |
1933 | 557 |
) |
558 |
! ! |
|
559 |
||
1834 | 560 |
!FileBrowser class methodsFor:'menu specs'! |
561 |
||
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
562 |
baseBookmarksMenuSpec |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
563 |
"This resource specification was automatically generated |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
564 |
by the MenuEditor of ST/X." |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
565 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
566 |
"Do not manually edit this!! If it is corrupted, |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
567 |
the MenuEditor may not be able to read the specification." |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
568 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
569 |
" |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
570 |
MenuEditor new openOnClass:FileBrowser andSelector:#baseBookmarksMenuSpec |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
571 |
(Menu new fromLiteralArrayEncoding:(FileBrowser baseBookmarksMenuSpec)) startUp |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
572 |
" |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
573 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
574 |
<resource: #menu> |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
575 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
576 |
^ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
577 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
578 |
#(#Menu |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
579 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
580 |
#( |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
581 |
#(#MenuItem |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
582 |
#label: 'Add Bookmark' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
583 |
#translateLabel: true |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
584 |
#value: #addBookmark |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
585 |
) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
586 |
#(#MenuItem |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
587 |
#label: 'Remove Bookmark' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
588 |
#translateLabel: true |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
589 |
#value: #removeBookmark |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
590 |
#enabled: #hasBookmarksToRemove |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
591 |
) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
592 |
) nil |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
593 |
nil |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
594 |
) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
595 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
596 |
"Created: / 4.8.1998 / 17:21:16 / cg" |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
597 |
"Modified: / 14.8.1998 / 19:19:06 / cg" |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
598 |
! |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
599 |
|
1834 | 600 |
baseDirectoryMenuSpec |
601 |
"This resource specification was automatically generated |
|
602 |
by the MenuEditor of ST/X." |
|
603 |
||
604 |
"Do not manually edit this!! If it is corrupted, |
|
605 |
the MenuEditor may not be able to read the specification." |
|
606 |
||
607 |
" |
|
608 |
MenuEditor new openOnClass:FileBrowser andSelector:#directoryMenuSpec |
|
609 |
(Menu new fromLiteralArrayEncoding:(FileBrowser directoryMenuSpec)) startUp |
|
610 |
" |
|
611 |
||
612 |
<resource: #menu> |
|
613 |
||
614 |
^ |
|
615 |
||
616 |
#(#Menu |
|
617 |
||
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
618 |
#( |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
619 |
#(#MenuItem |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
620 |
#label: 'Copy Path' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
621 |
#translateLabel: true |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
622 |
#value: #copyPath |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
623 |
) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
624 |
#(#MenuItem |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
625 |
#label: '-' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
626 |
) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
627 |
#(#MenuItem |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
628 |
#label: 'Up' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
629 |
#translateLabel: true |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
630 |
#value: #changeToParentDirectory |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
631 |
#enabled: #currentDirectoryIsNotTop |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
632 |
) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
633 |
#(#MenuItem |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
634 |
#label: 'Back' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
635 |
#translateLabel: true |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
636 |
#value: #changeToPreviousDirectory |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
637 |
) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
638 |
#(#MenuItem |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
639 |
#label: 'Home' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
640 |
#translateLabel: true |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
641 |
#value: #changeToHomeDirectory |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
642 |
) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
643 |
#(#MenuItem |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
644 |
#label: 'Default' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
645 |
#translateLabel: true |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
646 |
#value: #changeToDefaultDirectory |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
647 |
) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
648 |
#(#MenuItem |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
649 |
#label: 'Goto...' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
650 |
#translateLabel: true |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
651 |
#value: #changeCurrentDirectory |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
652 |
) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
653 |
#(#MenuItem |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
654 |
#label: '-' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
655 |
) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
656 |
#(#MenuItem |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
657 |
#label: 'Bookmarks' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
658 |
#translateLabel: true |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
659 |
#submenuChannel: #bookmarksMenuSpec |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
660 |
) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
661 |
) nil |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
662 |
nil |
1834 | 663 |
) |
664 |
||
665 |
"Created: / 4.8.1998 / 17:21:16 / cg" |
|
1835 | 666 |
"Modified: / 14.8.1998 / 19:19:06 / cg" |
1834 | 667 |
! |
668 |
||
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
669 |
bookmarksMenuSpec |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
670 |
"This resource specification was automatically generated |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
671 |
by the MenuEditor of ST/X." |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
672 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
673 |
"Do not manually edit this!! If it is corrupted, |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
674 |
the MenuEditor may not be able to read the specification." |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
675 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
676 |
" |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
677 |
MenuEditor new openOnClass:FileBrowser andSelector:#bookmarksMenuSpec |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
678 |
(Menu new fromLiteralArrayEncoding:(FileBrowser bookmarksMenuSpec)) startUp |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
679 |
" |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
680 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
681 |
<resource: #programMenu> |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
682 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
683 |
|m| |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
684 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
685 |
m := self baseBookmarksMenuSpec. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
686 |
m := m decodeAsLiteralArray. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
687 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
688 |
"/ add the history items ... |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
689 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
690 |
DirectoryBookmarks size > 0 ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
691 |
m addItem:(MenuItem labeled:'-'). |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
692 |
DirectoryBookmarks do:[:dirName | |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
693 |
m addItem:((MenuItem label:dirName value:#changeDirectoryTo:) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
694 |
argument:dirName; |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
695 |
yourself). |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
696 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
697 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
698 |
^ m |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
699 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
700 |
"Modified: / 17.8.1998 / 10:13:05 / cg" |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
701 |
! |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
702 |
|
1834 | 703 |
directoryMenuSpec |
704 |
"This resource specification was automatically generated |
|
705 |
by the MenuEditor of ST/X." |
|
706 |
||
707 |
"Do not manually edit this!! If it is corrupted, |
|
708 |
the MenuEditor may not be able to read the specification." |
|
709 |
||
710 |
" |
|
711 |
MenuEditor new openOnClass:FileBrowser andSelector:#directoryMenuSpec |
|
712 |
(Menu new fromLiteralArrayEncoding:(FileBrowser directoryMenuSpec)) startUp |
|
713 |
" |
|
714 |
||
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
715 |
<resource: #menu> |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
716 |
|
3658 | 717 |
^ |
718 |
#(#Menu |
|
719 |
#( |
|
720 |
#(#MenuItem |
|
721 |
#label: 'Copy Path' |
|
722 |
#translateLabel: true |
|
723 |
#value: #copyPath |
|
724 |
) |
|
725 |
#(#MenuItem |
|
726 |
#label: '-' |
|
727 |
) |
|
728 |
#(#MenuItem |
|
729 |
#label: 'Up' |
|
730 |
#translateLabel: true |
|
731 |
#value: #changeToParentDirectory |
|
732 |
#enabled: #currentDirectoryIsNotTop |
|
733 |
) |
|
734 |
#(#MenuItem |
|
735 |
#label: 'Goto...' |
|
736 |
#translateLabel: true |
|
737 |
#value: #changeCurrentDirectory |
|
738 |
) |
|
739 |
#(#MenuItem |
|
740 |
#label: '-' |
|
741 |
) |
|
742 |
#(#MenuItem |
|
743 |
#label: 'Back' |
|
744 |
#translateLabel: true |
|
745 |
#value: #changeToPreviousDirectory |
|
746 |
) |
|
747 |
#(#MenuItem |
|
748 |
#label: '-' |
|
749 |
) |
|
750 |
#(#MenuItem |
|
751 |
#label: 'Default' |
|
752 |
#translateLabel: true |
|
753 |
#value: #changeToDefaultDirectory |
|
754 |
) |
|
755 |
#(#MenuItem |
|
756 |
#label: 'Home' |
|
757 |
#translateLabel: true |
|
758 |
#value: #changeToHomeDirectory |
|
759 |
) |
|
760 |
#(#MenuItem |
|
761 |
#label: 'Bookmarks' |
|
762 |
#translateLabel: true |
|
763 |
#submenuChannel: #bookmarksMenuSpec |
|
764 |
) |
|
765 |
#(#MenuItem |
|
766 |
#label: '-' |
|
767 |
) |
|
768 |
#(#MenuItem |
|
769 |
#label: 'Visited Directories' |
|
770 |
#translateLabel: true |
|
771 |
#submenuChannel: #historyMenuSpec |
|
772 |
) |
|
773 |
) |
|
774 |
nil |
|
775 |
nil |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
776 |
) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
777 |
! |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
778 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
779 |
historyMenuSpec |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
780 |
"This resource specification was automatically generated |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
781 |
by the MenuEditor of ST/X." |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
782 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
783 |
"Do not manually edit this!! If it is corrupted, |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
784 |
the MenuEditor may not be able to read the specification." |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
785 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
786 |
" |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
787 |
MenuEditor new openOnClass:FileBrowser andSelector:#directoryMenuSpec |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
788 |
(Menu new fromLiteralArrayEncoding:(FileBrowser directoryMenuSpec)) startUp |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
789 |
" |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
790 |
|
1834 | 791 |
<resource: #programMenu> |
792 |
||
2035
307ed5143d8b
national language stuff - again
Claus Gittinger <cg@exept.de>
parents:
2031
diff
changeset
|
793 |
|m| |
307ed5143d8b
national language stuff - again
Claus Gittinger <cg@exept.de>
parents:
2031
diff
changeset
|
794 |
|
1834 | 795 |
"/ add the history items ... |
796 |
||
1835 | 797 |
DirectoryHistory size > 0 ifTrue:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
798 |
m := Menu new. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
799 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
800 |
DirectoryHistory do:[:dirName | |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
801 |
m addItem:((MenuItem label:dirName value:#changeDirectoryTo:) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
802 |
argument:dirName; |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
803 |
yourself). |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
804 |
]. |
3454 | 805 |
]. |
806 |
||
2035
307ed5143d8b
national language stuff - again
Claus Gittinger <cg@exept.de>
parents:
2031
diff
changeset
|
807 |
^ m |
1834 | 808 |
|
1837 | 809 |
"Modified: / 17.8.1998 / 10:13:05 / cg" |
1834 | 810 |
! |
811 |
||
812 |
menuPopUp |
|
813 |
"This resource specification was automatically generated |
|
814 |
by the MenuEditor of ST/X." |
|
815 |
||
816 |
"Do not manually edit this!! If it is corrupted, |
|
817 |
the MenuEditor may not be able to read the specification." |
|
818 |
||
819 |
" |
|
820 |
MenuEditor new openOnClass:FileBrowser andSelector:#menuPopUp |
|
821 |
(Menu new fromLiteralArrayEncoding:(FileBrowser menuPopUp)) startUp |
|
822 |
" |
|
823 |
||
824 |
<resource: #menu> |
|
825 |
||
2185 | 826 |
^ |
827 |
#(#Menu |
|
828 |
#( |
|
829 |
#(#MenuItem |
|
830 |
#label: 'Spawn' |
|
831 |
#translateLabel: true |
|
832 |
#value: #fileSpawn |
|
833 |
) |
|
834 |
#(#MenuItem |
|
835 |
#label: '-' |
|
836 |
) |
|
837 |
#(#MenuItem |
|
838 |
#label: 'Get Contents' |
|
839 |
#translateLabel: true |
|
840 |
#value: #fileGet |
|
841 |
#enabled: #hasSelection |
|
842 |
) |
|
843 |
#(#MenuItem |
|
844 |
#label: 'Insert Contents' |
|
845 |
#translateLabel: true |
|
846 |
#value: #fileInsert |
|
847 |
#enabled: #hasSelection |
|
848 |
) |
|
849 |
#(#MenuItem |
|
850 |
#label: 'FileIn' |
|
851 |
#translateLabel: true |
|
852 |
#value: #fileFileIn |
|
853 |
#enabled: #hasSelection |
|
2825
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
854 |
#shortcutKeyCharacter: #Accept |
2185 | 855 |
) |
856 |
#(#MenuItem |
|
857 |
#label: '-' |
|
858 |
) |
|
859 |
#(#MenuItem |
|
3172 | 860 |
#label: 'New' |
2185 | 861 |
#translateLabel: true |
3172 | 862 |
#submenu: |
863 |
#(#Menu |
|
864 |
#( |
|
865 |
#(#MenuItem |
|
866 |
#label: 'Directory...' |
|
867 |
#translateLabel: true |
|
868 |
#value: #newDirectory |
|
869 |
) |
|
870 |
#(#MenuItem |
|
871 |
#label: 'File...' |
|
872 |
#translateLabel: true |
|
873 |
#value: #newFile |
|
874 |
) |
|
875 |
#(#MenuItem |
|
876 |
#label: 'Hard Link...' |
|
877 |
#translateLabel: true |
|
878 |
#isVisible: #systemIsUnix |
|
879 |
#value: #newHardLink |
|
880 |
) |
|
881 |
#(#MenuItem |
|
882 |
#label: 'Symbolic Link...' |
|
883 |
#translateLabel: true |
|
884 |
#isVisible: #systemIsUnix |
|
885 |
#value: #newSoftLink |
|
886 |
) |
|
887 |
) |
|
888 |
nil |
|
889 |
nil |
|
890 |
) |
|
2185 | 891 |
) |
892 |
#(#MenuItem |
|
893 |
#label: 'Remove...' |
|
894 |
#translateLabel: true |
|
895 |
#value: #fileRemove |
|
896 |
#enabled: #hasSelection |
|
2543 | 897 |
#shortcutKeyCharacter: #Cut |
2185 | 898 |
) |
899 |
#(#MenuItem |
|
900 |
#label: 'Rename...' |
|
901 |
#translateLabel: true |
|
902 |
#value: #fileRename |
|
903 |
#enabled: #hasSelection |
|
2825
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
904 |
#shortcutKeyCharacter: #Replace |
2185 | 905 |
) |
906 |
#(#MenuItem |
|
907 |
#label: '-' |
|
908 |
) |
|
909 |
#(#MenuItem |
|
3172 | 910 |
#label: 'Properties...' |
2185 | 911 |
#translateLabel: true |
3172 | 912 |
#value: #fileGetLongInfo |
913 |
#enabled: #hasSelection |
|
2185 | 914 |
) |
915 |
#(#MenuItem |
|
3172 | 916 |
#label: '-' |
917 |
) |
|
918 |
#(#MenuItem |
|
919 |
#label: 'Tools' |
|
2185 | 920 |
#translateLabel: true |
3172 | 921 |
#submenuChannel: #toolsMenuSpec |
922 |
#shortcutKeyCharacter: #Ctrl |
|
2185 | 923 |
) |
924 |
#(#MenuItem |
|
925 |
#label: '-' |
|
926 |
) |
|
927 |
#(#MenuItem |
|
928 |
#label: 'Update' |
|
929 |
#translateLabel: true |
|
930 |
#value: #updateCurrentDirectory |
|
931 |
) |
|
932 |
) |
|
933 |
nil |
|
934 |
nil |
|
2844 | 935 |
) |
936 |
! |
|
1834 | 937 |
|
938 |
menuSpec |
|
939 |
"This resource specification was automatically generated |
|
940 |
by the MenuEditor of ST/X." |
|
941 |
||
942 |
"Do not manually edit this!! If it is corrupted, |
|
943 |
the MenuEditor may not be able to read the specification." |
|
944 |
||
945 |
" |
|
946 |
MenuEditor new openOnClass:FileBrowser andSelector:#menuSpec |
|
947 |
(Menu new fromLiteralArrayEncoding:(FileBrowser menuSpec)) startUp |
|
948 |
" |
|
949 |
||
950 |
<resource: #menu> |
|
951 |
||
2102 | 952 |
^ |
953 |
#(#Menu |
|
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
954 |
#( |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
955 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
956 |
#label: 'File' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
957 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
958 |
#submenu: |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
959 |
#(#Menu |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
960 |
#( |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
961 |
#(#MenuItem |
2951
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
962 |
#label: 'Spawn' |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
963 |
#translateLabel: true |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
964 |
#value: #fileSpawn |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
965 |
) |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
966 |
#(#MenuItem |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
967 |
#label: '-' |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
968 |
) |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
969 |
#(#MenuItem |
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
970 |
#label: 'Open' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
971 |
#translateLabel: true |
3213 | 972 |
#isVisible: false |
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
973 |
#value: #menuOpen |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
974 |
#enabled: #hasSelection |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
975 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
976 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
977 |
#label: 'Open selected Filename' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
978 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
979 |
#isVisible: #hasFilenameSelectionInCodeView |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
980 |
#value: #openSelectedFilename |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
981 |
#enabled: #hasFilenameSelectionInCodeView |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
982 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
983 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
984 |
#label: 'FileIn' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
985 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
986 |
#value: #fileFileIn |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
987 |
#enabled: #hasSelection |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
988 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
989 |
#(#MenuItem |
3465
f52e089ca838
added fileIntoNameSpace menu item
Claus Gittinger <cg@exept.de>
parents:
3461
diff
changeset
|
990 |
#label: 'FileInTo NameSpace...' |
f52e089ca838
added fileIntoNameSpace menu item
Claus Gittinger <cg@exept.de>
parents:
3461
diff
changeset
|
991 |
#translateLabel: true |
f52e089ca838
added fileIntoNameSpace menu item
Claus Gittinger <cg@exept.de>
parents:
3461
diff
changeset
|
992 |
#value: #fileFileInToNameSpace |
f52e089ca838
added fileIntoNameSpace menu item
Claus Gittinger <cg@exept.de>
parents:
3461
diff
changeset
|
993 |
#enabled: #hasSelection |
f52e089ca838
added fileIntoNameSpace menu item
Claus Gittinger <cg@exept.de>
parents:
3461
diff
changeset
|
994 |
) |
f52e089ca838
added fileIntoNameSpace menu item
Claus Gittinger <cg@exept.de>
parents:
3461
diff
changeset
|
995 |
#(#MenuItem |
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
996 |
#label: '-' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
997 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
998 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
999 |
#label: 'New' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1000 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1001 |
#submenu: |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1002 |
#(#Menu |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1003 |
#( |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1004 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1005 |
#label: 'Directory...' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1006 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1007 |
#value: #newDirectory |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1008 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1009 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1010 |
#label: 'File...' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1011 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1012 |
#value: #newFile |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1013 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1014 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1015 |
#label: 'Hard Link...' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1016 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1017 |
#isVisible: #systemIsUnix |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1018 |
#value: #newHardLink |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1019 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1020 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1021 |
#label: 'Symbolic Link...' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1022 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1023 |
#isVisible: #systemIsUnix |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1024 |
#value: #newSoftLink |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1025 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1026 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1027 |
nil |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1028 |
nil |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1029 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1030 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1031 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1032 |
#label: 'Remove' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1033 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1034 |
#value: #fileRemove |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1035 |
#enabled: #hasSelection |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1036 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1037 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1038 |
#label: 'Rename' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1039 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1040 |
#value: #fileRename |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1041 |
#enabled: #hasSelection |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1042 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1043 |
#(#MenuItem |
2143 | 1044 |
#label: '-' |
1045 |
) |
|
1046 |
#(#MenuItem |
|
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1047 |
#label: 'Properties...' |
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 |
#value: #fileGetLongInfo |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1050 |
#enabled: #hasSelection |
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: '-' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1054 |
#isVisible: #javaSupportLoaded |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1055 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1056 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1057 |
#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
|
1058 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1059 |
#isVisible: #javaSupportLoaded |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1060 |
#value: #fileAddToJavaClassPath |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1061 |
#enabled: #canAddToClassPath |
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: 'Remove from Java ClassPath' |
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 |
#isVisible: #javaSupportLoaded |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1067 |
#value: #fileRemoveFromJavaClassPath |
2368 | 1068 |
#enabled: #canRemoveFromClassPath |
1069 |
) |
|
1070 |
#(#MenuItem |
|
1071 |
#label: 'Add to Java SourcePath' |
|
1072 |
#translateLabel: true |
|
1073 |
#isVisible: #javaSupportLoaded |
|
1074 |
#value: #fileAddToJavaSourcePath |
|
1075 |
#enabled: #canAddToSourcePath |
|
1076 |
) |
|
1077 |
#(#MenuItem |
|
1078 |
#label: 'Remove from Java SourcePath' |
|
1079 |
#translateLabel: true |
|
1080 |
#isVisible: #javaSupportLoaded |
|
1081 |
#value: #fileRemoveFromJavaSourcePath |
|
1082 |
#enabled: #canRemoveFromSourcePath |
|
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1083 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1084 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1085 |
#label: '-' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1086 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1087 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1088 |
#label: 'Exit' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1089 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1090 |
#value: #menuExit |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1091 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1092 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1093 |
nil |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1094 |
nil |
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 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1097 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1098 |
#label: 'Directory' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1099 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1100 |
#submenuChannel: #directoryMenuSpec |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1101 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1102 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1103 |
#label: 'Edit' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1104 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1105 |
#submenu: |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1106 |
#(#Menu |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1107 |
#( |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1108 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1109 |
#label: 'Get Contents' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1110 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1111 |
#value: #fileGet |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1112 |
#enabled: #hasSelection |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1113 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1114 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1115 |
#label: 'Insert Contents' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1116 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1117 |
#value: #fileInsert |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1118 |
#enabled: #hasSelection |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1119 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1120 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1121 |
#label: '-' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1122 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1123 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1124 |
#label: 'Copy File List' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1125 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1126 |
#value: #copyFileList |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1127 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1128 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1129 |
#label: 'Copy Selected Filename' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1130 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1131 |
#value: #copySelectedFileName |
3010 | 1132 |
#enabled: #hasSelection |
1133 |
) |
|
1134 |
#(#MenuItem |
|
1135 |
#label: 'Copy Selected Pathname' |
|
1136 |
#translateLabel: true |
|
1137 |
#value: #copySelectedPathName |
|
1138 |
#enabled: #hasSelection |
|
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1139 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1140 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1141 |
#label: 'Copy Command History' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1142 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1143 |
#value: #copyCommandHistory |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1144 |
) |
2951
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
1145 |
#(#MenuItem |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
1146 |
#label: '-' |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
1147 |
) |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
1148 |
#(#MenuItem |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
1149 |
#label: 'Visited Files' |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
1150 |
#translateLabel: true |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
1151 |
#submenuChannel: #visitedFileMenuSpec |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
1152 |
) |
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1153 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1154 |
nil |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1155 |
nil |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1156 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1157 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1158 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1159 |
#label: 'View' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1160 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1161 |
#submenu: |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1162 |
#(#Menu |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1163 |
#( |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1164 |
#(#MenuItem |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1165 |
#label: 'Show Details' |
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1166 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1167 |
#indication: #showingDetails |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1168 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1169 |
#(#MenuItem |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1170 |
#label: 'Show Time && Date' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1171 |
#translateLabel: true |
3658 | 1172 |
#enabled: #showingDetails |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1173 |
#indication: #showingTimeAndDate |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1174 |
) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1175 |
#(#MenuItem |
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1176 |
#label: 'Show Hidden Files' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1177 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1178 |
#indication: #showingHiddenFiles |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1179 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1180 |
#(#MenuItem |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1181 |
#label: 'Show Big Image Preview' |
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1182 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1183 |
#indication: #showingBigImagePreview |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1184 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1185 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1186 |
#label: '-' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1187 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1188 |
#(#MenuItem |
2155 | 1189 |
#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
|
1190 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1191 |
#choice: #sortByWhat |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1192 |
#choiceValue: #name |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1193 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1194 |
#(#MenuItem |
2155 | 1195 |
#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
|
1196 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1197 |
#choice: #sortByWhat |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1198 |
#choiceValue: #type |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1199 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1200 |
#(#MenuItem |
2155 | 1201 |
#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
|
1202 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1203 |
#choice: #sortByWhat |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1204 |
#choiceValue: #time |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1205 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1206 |
#(#MenuItem |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1207 |
#label: 'Ignore Case in Sort' |
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1208 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1209 |
#indication: #sortCaseless |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1210 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1211 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1212 |
#label: '-' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1213 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1214 |
#(#MenuItem |
3172 | 1215 |
#label: 'Encoding...' |
1216 |
#translateLabel: true |
|
1217 |
#value: #fileEncoding |
|
1218 |
) |
|
1219 |
#(#MenuItem |
|
1220 |
#label: 'DOS EndOfLine Mode' |
|
1221 |
#translateLabel: true |
|
1222 |
#indication: #dosEOLMode |
|
1223 |
) |
|
1224 |
#(#MenuItem |
|
1225 |
#label: '-' |
|
1226 |
) |
|
1227 |
#(#MenuItem |
|
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1228 |
#label: 'Update' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1229 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1230 |
#value: #updateCurrentDirectory |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1231 |
) |
2220
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
1232 |
#(#MenuItem |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
1233 |
#label: 'AutoUpdate' |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
1234 |
#translateLabel: true |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
1235 |
#indication: #autoUpdate |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
1236 |
) |
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1237 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1238 |
nil |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1239 |
nil |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1240 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1241 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1242 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1243 |
#label: 'Tools' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1244 |
#translateLabel: true |
2825
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1245 |
#submenuChannel: #toolsMenuSpec |
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1246 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1247 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1248 |
#label: 'CVS' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1249 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1250 |
#submenu: |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1251 |
#(#Menu |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1252 |
#( |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1253 |
#(#MenuItem |
3691
f5d9ed09899b
menu texts: standard headline case
Claus Gittinger <cg@exept.de>
parents:
3665
diff
changeset
|
1254 |
#label: 'Update Selected Files/Directories' |
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1255 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1256 |
#value: #cvsUpdateSelection |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1257 |
#enabled: #hasSelection |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1258 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1259 |
#(#MenuItem |
3691
f5d9ed09899b
menu texts: standard headline case
Claus Gittinger <cg@exept.de>
parents:
3665
diff
changeset
|
1260 |
#label: 'Update Directory Local' |
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1261 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1262 |
#value: #cvsUpdateDirectoryLocal |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1263 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1264 |
#(#MenuItem |
3691
f5d9ed09899b
menu texts: standard headline case
Claus Gittinger <cg@exept.de>
parents:
3665
diff
changeset
|
1265 |
#label: 'Update Directory Recursive' |
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1266 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1267 |
#value: #cvsUpdateDirectoryRecursive |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1268 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1269 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1270 |
#label: '-' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1271 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1272 |
#(#MenuItem |
2386 | 1273 |
#label: 'Commit...' |
1274 |
#translateLabel: true |
|
1275 |
#value: #cvsCommitSelection |
|
1276 |
) |
|
1277 |
#(#MenuItem |
|
3467 | 1278 |
#label: 'Add && Commit...' |
2424 | 1279 |
#translateLabel: true |
3467 | 1280 |
#value: #cvsAddAndCommitSelection |
2424 | 1281 |
) |
1282 |
#(#MenuItem |
|
2386 | 1283 |
#label: '-' |
1284 |
) |
|
1285 |
#(#MenuItem |
|
3691
f5d9ed09899b
menu texts: standard headline case
Claus Gittinger <cg@exept.de>
parents:
3665
diff
changeset
|
1286 |
#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
|
1287 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1288 |
#value: #cvsRemoveFileAndContainer |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1289 |
#enabled: #canRemoveCVSContainer |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1290 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1291 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1292 |
nil |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1293 |
nil |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1294 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1295 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1296 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1297 |
#label: 'Help' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1298 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1299 |
#startGroup: #right |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1300 |
#submenu: |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1301 |
#(#Menu |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1302 |
#( |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1303 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1304 |
#label: 'FileBrowser Documentation' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1305 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1306 |
#value: #openHTMLDocument: |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1307 |
#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
|
1308 |
) |
3213 | 1309 |
#(#MenuItem |
1310 |
#label: '-' |
|
1311 |
) |
|
1312 |
#(#MenuItem |
|
1313 |
#label: 'About FileBrowser...' |
|
1314 |
#translateLabel: true |
|
1315 |
#value: #openAboutThisApplication |
|
1316 |
) |
|
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1317 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1318 |
nil |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1319 |
nil |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1320 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1321 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1322 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1323 |
nil |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1324 |
nil |
1834 | 1325 |
) |
2825
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1326 |
! |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1327 |
|
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1328 |
toolsMenuSpec |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1329 |
"This resource specification was automatically generated |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1330 |
by the MenuEditor of ST/X." |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1331 |
|
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1332 |
"Do not manually edit this!! If it is corrupted, |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1333 |
the MenuEditor may not be able to read the specification." |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1334 |
|
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1335 |
" |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1336 |
MenuEditor new openOnClass:FileBrowser andSelector:#toolsMenuSpec |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1337 |
(Menu new fromLiteralArrayEncoding:(FileBrowser toolsMenuSpec)) startUp |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1338 |
" |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1339 |
|
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1340 |
<resource: #menu> |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1341 |
|
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1342 |
^ |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1343 |
#(#Menu |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1344 |
#( |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1345 |
#(#MenuItem |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1346 |
#label: 'Unix Command...' |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1347 |
#translateLabel: true |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1348 |
#isVisible: #systemIsUnix |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1349 |
#value: #menuOSCommand |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1350 |
) |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1351 |
#(#MenuItem |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1352 |
#label: 'DOS Command...' |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1353 |
#translateLabel: true |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1354 |
#isVisible: #systemIsDOS |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1355 |
#value: #menuOSCommand |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1356 |
) |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1357 |
#(#MenuItem |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1358 |
#label: 'VMS Command...' |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1359 |
#translateLabel: true |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1360 |
#isVisible: #systemIsVMS |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1361 |
#value: #menuOSCommand |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1362 |
) |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1363 |
#(#MenuItem |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1364 |
#label: 'Shell Terminal' |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1365 |
#translateLabel: true |
3398 | 1366 |
#isVisible: #canDoTerminalAndSystemIsUnix |
1367 |
#value: #openTerminal |
|
1368 |
#enabled: #canDoTerminal |
|
1369 |
) |
|
1370 |
#(#MenuItem |
|
1371 |
#label: 'DOS Terminal' |
|
1372 |
#translateLabel: true |
|
1373 |
#isVisible: #canDoTerminalAndSystemIsDOS |
|
2825
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1374 |
#value: #openTerminal |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1375 |
#enabled: #canDoTerminal |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1376 |
) |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1377 |
#(#MenuItem |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1378 |
#label: '-' |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1379 |
) |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1380 |
#(#MenuItem |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1381 |
#label: 'Changes Browser' |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1382 |
#translateLabel: true |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1383 |
#value: #openChangesBrowser |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1384 |
#enabled: #hasSelection |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1385 |
) |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1386 |
#(#MenuItem |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1387 |
#label: 'Snapshot Image Browser' |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1388 |
#translateLabel: true |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1389 |
#value: #openSnapshotImageBrowser |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1390 |
#enabled: #hasSnapshotSelection |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1391 |
) |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1392 |
#(#MenuItem |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1393 |
#label: 'Create Smalltalk Project' |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1394 |
#translateLabel: true |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1395 |
#value: #createProjectAndOpenProjectBrowser |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1396 |
#enabled: #canCreateNewProject |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1397 |
) |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1398 |
#(#MenuItem |
3765
8309f42ebf29
+ installAllAsAutoloaded function
Claus Gittinger <cg@exept.de>
parents:
3762
diff
changeset
|
1399 |
#label: 'Install Autoloaded' |
2825
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1400 |
#translateLabel: true |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1401 |
#value: #readAbbrevFile |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1402 |
#enabled: #canReadAbbrevFile |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1403 |
) |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1404 |
#(#MenuItem |
3814 | 1405 |
#label: 'Install All as Autoloaded' |
3765
8309f42ebf29
+ installAllAsAutoloaded function
Claus Gittinger <cg@exept.de>
parents:
3762
diff
changeset
|
1406 |
#translateLabel: true |
8309f42ebf29
+ installAllAsAutoloaded function
Claus Gittinger <cg@exept.de>
parents:
3762
diff
changeset
|
1407 |
#value: #installAllAsAutoloaded |
8309f42ebf29
+ installAllAsAutoloaded function
Claus Gittinger <cg@exept.de>
parents:
3762
diff
changeset
|
1408 |
#enabled: #anySTFilesPresent |
8309f42ebf29
+ installAllAsAutoloaded function
Claus Gittinger <cg@exept.de>
parents:
3762
diff
changeset
|
1409 |
) |
8309f42ebf29
+ installAllAsAutoloaded function
Claus Gittinger <cg@exept.de>
parents:
3762
diff
changeset
|
1410 |
#(#MenuItem |
2825
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1411 |
#label: 'Editor' |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1412 |
#translateLabel: true |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1413 |
#value: #openEditor |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1414 |
#enabled: #hasSelection |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1415 |
) |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1416 |
#(#MenuItem |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1417 |
#label: 'HTML Reader' |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1418 |
#translateLabel: true |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1419 |
#value: #openHTMLReader |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1420 |
#enabled: #hasSelection |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1421 |
) |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1422 |
#(#MenuItem |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1423 |
#label: 'ASN1 Browser' |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1424 |
#translateLabel: true |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1425 |
#isVisible: #hasASN1 |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1426 |
#value: #openASN1Browser |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1427 |
#enabled: #hasASN1AndSelection |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1428 |
) |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1429 |
#(#MenuItem |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1430 |
#label: 'C Browser' |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1431 |
#translateLabel: true |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1432 |
#isVisible: #hasCBrowser |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1433 |
#value: #openCBrowser |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1434 |
#enabled: #hasCBrowser |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1435 |
) |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1436 |
#(#MenuItem |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1437 |
#label: 'Applet Viewer' |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1438 |
#translateLabel: true |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1439 |
#isVisible: #hasJava |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1440 |
#value: #openAppletViewer |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1441 |
#enabled: #hasJavaAndSelection |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1442 |
) |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1443 |
#(#MenuItem |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1444 |
#label: 'Image Inspector' |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1445 |
#translateLabel: true |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1446 |
#value: #openImageInspector |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1447 |
#enabled: #hasSelection |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1448 |
) |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1449 |
#(#MenuItem |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1450 |
#label: 'Image Preview' |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1451 |
#translateLabel: true |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1452 |
#value: #openImagePreview |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1453 |
#enabled: #hasSelection |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1454 |
) |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1455 |
#(#MenuItem |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1456 |
#label: 'Image Editor' |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1457 |
#translateLabel: true |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1458 |
#value: #openImageEditor |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1459 |
#enabled: #hasSelection |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1460 |
) |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1461 |
#(#MenuItem |
3001 | 1462 |
#label: 'MP3 Player' |
1463 |
#translateLabel: true |
|
1464 |
#isVisible: #hasMP3Player |
|
1465 |
#value: #openMP3Player |
|
1466 |
#enabled: #hasMP3PlayerAndSelection |
|
1467 |
) |
|
1468 |
#(#MenuItem |
|
2825
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1469 |
#label: 'ZipFile Tool' |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1470 |
#translateLabel: true |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1471 |
#value: #openZipTool |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1472 |
#enabled: #hasZipFileSelected |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1473 |
) |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1474 |
#(#MenuItem |
3536 | 1475 |
#label: 'SlideShow' |
1476 |
#translateLabel: true |
|
1477 |
#value: #openSlideShow |
|
1478 |
#isVisible: #hasSlideShow |
|
1479 |
) |
|
1480 |
#(#MenuItem |
|
2825
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1481 |
#label: 'File Differences...' |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1482 |
#translateLabel: true |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1483 |
#value: #openDiffView |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1484 |
) |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1485 |
#(#MenuItem |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1486 |
#label: 'Find Duplicate Files' |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1487 |
#translateLabel: true |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1488 |
#value: #fileFindDuplicates |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1489 |
) |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1490 |
#(#MenuItem |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1491 |
#label: 'Find All Duplicate Files (recursive)' |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1492 |
#translateLabel: true |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1493 |
#value: #fileFindAllDuplicates |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1494 |
) |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1495 |
#(#MenuItem |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1496 |
#label: 'Find a File...' |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1497 |
#translateLabel: true |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1498 |
#value: #fileFindFile |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1499 |
) |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1500 |
#(#MenuItem |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1501 |
#label: 'Hex Dump' |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1502 |
#translateLabel: true |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1503 |
#value: #fileHexDump |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1504 |
#enabled: #hasSelection |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1505 |
) |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1506 |
) |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1507 |
nil |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1508 |
nil |
2844 | 1509 |
) |
3398 | 1510 |
|
3536 | 1511 |
"Modified: / 29.12.2001 / 21:59:27 / cg" |
2951
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
1512 |
! |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
1513 |
|
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
1514 |
visitedFileMenuSpec |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
1515 |
|
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
1516 |
<resource: #programMenu> |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
1517 |
|
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
1518 |
|m| |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
1519 |
|
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
1520 |
VisitedFileHistory size == 0 ifTrue:[^ nil]. |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
1521 |
|
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
1522 |
m := Menu new. |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
1523 |
|
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
1524 |
"/ add the history items ... |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
1525 |
|
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
1526 |
VisitedFileHistory do:[:pathName | |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
1527 |
m addItem:((MenuItem label:pathName asFilename baseName value:#revisitFile:) |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
1528 |
argument:pathName; |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
1529 |
yourself). |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
1530 |
]. |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
1531 |
^ m |
2844 | 1532 |
! ! |
1834 | 1533 |
|
2094 | 1534 |
!FileBrowser class methodsFor:'queries'! |
1535 |
||
1536 |
isVisualStartable |
|
2844 | 1537 |
"return true, if this application can be started via #open. |
1538 |
(to allow start of a change browser via double-click in the browser)" |
|
2094 | 1539 |
|
1540 |
^ true |
|
1541 |
! ! |
|
1542 |
||
1834 | 1543 |
!FileBrowser methodsFor:'aspects'! |
1544 |
||
3765
8309f42ebf29
+ installAllAsAutoloaded function
Claus Gittinger <cg@exept.de>
parents:
3762
diff
changeset
|
1545 |
anyFilesPresentWithSuffix:suffix |
8309f42ebf29
+ installAllAsAutoloaded function
Claus Gittinger <cg@exept.de>
parents:
3762
diff
changeset
|
1546 |
^ currentDirectory notNil |
8309f42ebf29
+ installAllAsAutoloaded function
Claus Gittinger <cg@exept.de>
parents:
3762
diff
changeset
|
1547 |
and:[currentDirectory |
8309f42ebf29
+ installAllAsAutoloaded function
Claus Gittinger <cg@exept.de>
parents:
3762
diff
changeset
|
1548 |
directoryContents |
8309f42ebf29
+ installAllAsAutoloaded function
Claus Gittinger <cg@exept.de>
parents:
3762
diff
changeset
|
1549 |
contains:[:f| f asFilename suffix = suffix]] |
8309f42ebf29
+ installAllAsAutoloaded function
Claus Gittinger <cg@exept.de>
parents:
3762
diff
changeset
|
1550 |
! |
8309f42ebf29
+ installAllAsAutoloaded function
Claus Gittinger <cg@exept.de>
parents:
3762
diff
changeset
|
1551 |
|
8309f42ebf29
+ installAllAsAutoloaded function
Claus Gittinger <cg@exept.de>
parents:
3762
diff
changeset
|
1552 |
anySTFilesPresent |
8309f42ebf29
+ installAllAsAutoloaded function
Claus Gittinger <cg@exept.de>
parents:
3762
diff
changeset
|
1553 |
^ self anyFilesPresentWithSuffix:'st' |
8309f42ebf29
+ installAllAsAutoloaded function
Claus Gittinger <cg@exept.de>
parents:
3762
diff
changeset
|
1554 |
! |
8309f42ebf29
+ installAllAsAutoloaded function
Claus Gittinger <cg@exept.de>
parents:
3762
diff
changeset
|
1555 |
|
2220
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
1556 |
autoUpdate |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
1557 |
^ doAutoUpdate |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
1558 |
|
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
1559 |
"Created: / 6.5.1999 / 11:37:25 / cg" |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
1560 |
"Modified: / 6.5.1999 / 11:39:38 / cg" |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
1561 |
! |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
1562 |
|
1893
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
1563 |
canAddToClassPath |
2368 | 1564 |
^ [ |f| |
1565 |
||
1566 |
(Java isNil or:[Java isLoaded not]) ifTrue:[ |
|
1567 |
false |
|
1568 |
] ifFalse:[ |
|
1569 |
f := self singleSelectedFileOrCurrentDirectory. |
|
1570 |
f notNil |
|
1571 |
and:[(Java classPath includes:f pathName) not |
|
1572 |
and:[f isDirectory |
|
1573 |
or:[(f hasSuffix:'jar') |
|
1574 |
or:[(f hasSuffix:'zip')]]]]. |
|
1575 |
] |
|
1576 |
] |
|
1577 |
||
1578 |
"Modified: / 1.2.1999 / 20:38:42 / cg" |
|
1579 |
! |
|
1580 |
||
1581 |
canAddToSourcePath |
|
1582 |
^ [ |f| |
|
1583 |
||
1584 |
(Java isNil or:[Java isLoaded not]) ifTrue:[ |
|
1585 |
false |
|
1586 |
] ifFalse:[ |
|
1587 |
f := self singleSelectedFileOrCurrentDirectory. |
|
1588 |
f notNil |
|
2438 | 1589 |
and:[(Java sourcePath isNil |
1590 |
or:[(Java sourcePath includes:f pathName) not]) |
|
2368 | 1591 |
and:[f isDirectory |
1592 |
or:[(f hasSuffix:'jar') |
|
1593 |
or:[(f hasSuffix:'zip')]]]]. |
|
1594 |
] |
|
1893
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
1595 |
] |
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
1596 |
|
1989 | 1597 |
"Modified: / 1.2.1999 / 20:38:42 / cg" |
1893
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
1598 |
! |
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
1599 |
|
2562
da7680fe8407
first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents:
2550
diff
changeset
|
1600 |
canCreateNewProject |
da7680fe8407
first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents:
2550
diff
changeset
|
1601 |
^ [ |
da7680fe8407
first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents:
2550
diff
changeset
|
1602 |
currentDirectory notNil |
3765
8309f42ebf29
+ installAllAsAutoloaded function
Claus Gittinger <cg@exept.de>
parents:
3762
diff
changeset
|
1603 |
and:[(self anyFilesPresentWithSuffix:'prj') not |
8309f42ebf29
+ installAllAsAutoloaded function
Claus Gittinger <cg@exept.de>
parents:
3762
diff
changeset
|
1604 |
and:[(self anyFilesPresentWithSuffix:'st')]] |
8309f42ebf29
+ installAllAsAutoloaded function
Claus Gittinger <cg@exept.de>
parents:
3762
diff
changeset
|
1605 |
] |
2562
da7680fe8407
first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents:
2550
diff
changeset
|
1606 |
! |
da7680fe8407
first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents:
2550
diff
changeset
|
1607 |
|
2129 | 1608 |
canDoTerminal |
1609 |
^ OperatingSystem isUNIXlike |
|
1610 |
or:[OperatingSystem isMSWINDOWSlike] |
|
1611 |
||
1612 |
"Created: / 4.8.1998 / 13:37:13 / cg" |
|
1613 |
"Modified: / 28.4.1999 / 11:54:17 / cg" |
|
1614 |
! |
|
1615 |
||
3398 | 1616 |
canDoTerminalAndSystemIsDOS |
1617 |
^ self canDoTerminal and:[OperatingSystem isMSWINDOWSlike] |
|
1618 |
||
1619 |
"Created: / 10.11.2001 / 13:10:32 / cg" |
|
1620 |
! |
|
1621 |
||
1622 |
canDoTerminalAndSystemIsUnix |
|
1623 |
^ self canDoTerminal and:[OperatingSystem isUNIXlike] |
|
1624 |
||
1625 |
"Created: / 10.11.2001 / 13:10:46 / cg" |
|
1626 |
! |
|
1627 |
||
2567
dd029fea485d
added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents:
2562
diff
changeset
|
1628 |
canReadAbbrevFile |
3013 | 1629 |
^ [|sel f fn suff ok| |
2567
dd029fea485d
added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents:
2562
diff
changeset
|
1630 |
|
dd029fea485d
added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents:
2562
diff
changeset
|
1631 |
sel := fileListView selection. |
dd029fea485d
added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents:
2562
diff
changeset
|
1632 |
sel size == 1 ifTrue:[ |
dd029fea485d
added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents:
2562
diff
changeset
|
1633 |
f := fileList at:sel first ifAbsent:nil. |
3013 | 1634 |
ok := (f = 'abbrev.stc'). |
1635 |
]. |
|
1636 |
ok ifFalse:[ |
|
1637 |
ok := currentDirectory notNil |
|
3747
d30bc1e54f15
Remove unused vars and asFilename sends
Stefan Vogel <sv@exept.de>
parents:
3746
diff
changeset
|
1638 |
and:[(currentDirectory construct:'abbrev.stc') exists]. |
3013 | 1639 |
]. |
1640 |
ok |
|
2567
dd029fea485d
added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents:
2562
diff
changeset
|
1641 |
] |
dd029fea485d
added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents:
2562
diff
changeset
|
1642 |
|
dd029fea485d
added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents:
2562
diff
changeset
|
1643 |
"Modified: / 30.1.1999 / 19:05:59 / cg" |
dd029fea485d
added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents:
2562
diff
changeset
|
1644 |
"Created: / 29.1.2000 / 13:00:57 / cg" |
dd029fea485d
added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents:
2562
diff
changeset
|
1645 |
! |
dd029fea485d
added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents:
2562
diff
changeset
|
1646 |
|
2101 | 1647 |
canRemoveCVSContainer |
1648 |
^ [ |cvsDir| |
|
1649 |
||
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1650 |
currentDirectory notNil |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1651 |
and:[fileListView selection size > 0 |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1652 |
and:[(cvsDir := currentDirectory construct:'CVS') exists |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1653 |
and:[cvsDir isDirectory]]]] |
2101 | 1654 |
! |
1655 |
||
2368 | 1656 |
canRemoveFromClassPath |
1657 |
^ [ |f| |
|
1658 |
||
1659 |
(Java isNil or:[Java isLoaded not]) ifTrue:[ |
|
1660 |
false |
|
1661 |
] ifFalse:[ |
|
1662 |
f := self singleSelectedFileOrCurrentDirectory. |
|
1663 |
f notNil |
|
1664 |
and:[(Java classPath includes:f pathName) |
|
1665 |
and:[f isDirectory |
|
1666 |
or:[(f hasSuffix:'jar') |
|
1667 |
or:[(f hasSuffix:'zip')]]]] |
|
1668 |
] |
|
1669 |
] |
|
1670 |
||
1671 |
"Modified: / 1.2.1999 / 20:39:25 / cg" |
|
1672 |
! |
|
1673 |
||
1674 |
canRemoveFromSourcePath |
|
1675 |
^ [ |f| |
|
1676 |
||
1677 |
(Java isNil or:[Java isLoaded not]) ifTrue:[ |
|
1678 |
false |
|
1679 |
] ifFalse:[ |
|
1680 |
f := self singleSelectedFileOrCurrentDirectory. |
|
1681 |
f notNil |
|
2438 | 1682 |
and:[(Java sourcePath isNil |
1683 |
or:[(Java sourcePath includes:f pathName)]) |
|
2368 | 1684 |
and:[f isDirectory |
1685 |
or:[(f hasSuffix:'jar') |
|
1686 |
or:[(f hasSuffix:'zip')]]]] |
|
1687 |
] |
|
1893
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
1688 |
] |
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
1689 |
|
1989 | 1690 |
"Modified: / 1.2.1999 / 20:39:25 / cg" |
1893
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
1691 |
! |
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
1692 |
|
1834 | 1693 |
currentDirectoryIsNotTop |
1694 |
^ [currentDirectory notNil and:[currentDirectory isRootDirectory not]] |
|
1695 |
||
1696 |
"Modified: / 4.8.1998 / 14:10:57 / cg" |
|
1697 |
"Created: / 14.8.1998 / 12:07:10 / cg" |
|
1698 |
! |
|
1699 |
||
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1700 |
dosEOLMode |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1701 |
^ dosEOLMode |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1702 |
|
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1703 |
"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
|
1704 |
"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
|
1705 |
! |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1706 |
|
2185 | 1707 |
hasASN1 |
1708 |
^ [ OSI::ASN1Parser notNil |
|
1709 |
and:[OSI::ASN1Parser isLoaded]] |
|
1710 |
||
1711 |
! |
|
1712 |
||
1713 |
hasASN1AndSelection |
|
1714 |
^ [ fileListView selection size > 0 |
|
1715 |
and:[OSI::ASN1Parser notNil |
|
1716 |
and:[OSI::ASN1Parser isLoaded]]] |
|
1717 |
! |
|
1718 |
||
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1719 |
hasBookmarks |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1720 |
^ DirectoryBookmarks size > 0 |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1721 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1722 |
"Created: / 14.8.1998 / 19:17:02 / cg" |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1723 |
"Modified: / 14.8.1998 / 19:17:17 / cg" |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1724 |
! |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1725 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1726 |
hasBookmarksToRemove |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1727 |
^ DirectoryBookmarks size > 0 |
3747
d30bc1e54f15
Remove unused vars and asFilename sends
Stefan Vogel <sv@exept.de>
parents:
3746
diff
changeset
|
1728 |
and:[ DirectoryBookmarks includes:(currentDirectory pathName) ] |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1729 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1730 |
"Created: / 14.8.1998 / 19:17:02 / cg" |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1731 |
"Modified: / 14.8.1998 / 19:17:17 / cg" |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1732 |
! |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1733 |
|
2814 | 1734 |
hasCBrowser |
3767 | 1735 |
^ [ CBrowser::Browser notNil ] |
2814 | 1736 |
! |
1737 |
||
1994 | 1738 |
hasFilenameSelectionInCodeView |
1739 |
^ [ |val sel| |
|
1740 |
||
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1741 |
val := false. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1742 |
sel := subView selection. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1743 |
sel notNil ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1744 |
sel := sel asString withoutSeparators. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1745 |
sel asFilename exists ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1746 |
val := sel asFilename isReadable |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1747 |
] |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1748 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1749 |
val |
1994 | 1750 |
] |
1751 |
||
1752 |
"Created: / 4.2.1999 / 17:34:57 / cg" |
|
1753 |
"Modified: / 4.2.1999 / 17:39:32 / cg" |
|
1754 |
! |
|
1755 |
||
1942 | 1756 |
hasJava |
1757 |
^ [ JavaClassReader notNil |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1758 |
and:[JavaClassReader isLoaded]] |
1942 | 1759 |
|
1760 |
"Modified: / 17.10.1998 / 16:57:14 / cg" |
|
1761 |
"Created: / 17.10.1998 / 22:58:25 / cg" |
|
1762 |
! |
|
1763 |
||
1764 |
hasJavaAndSelection |
|
1765 |
^ [ fileListView selection size > 0 |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1766 |
and:[JavaClassReader notNil |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1767 |
and:[JavaClassReader isLoaded]]] |
1942 | 1768 |
|
1769 |
"Modified: / 17.10.1998 / 16:57:14 / cg" |
|
1770 |
"Created: / 17.10.1998 / 22:58:03 / cg" |
|
1771 |
! |
|
1772 |
||
3001 | 1773 |
hasMP3Player |
1774 |
^ [ MP3PlayerApplication notNil |
|
1775 |
or:[SaugFix::MP3PlayerApplication notNil ]] |
|
1776 |
! |
|
1777 |
||
1778 |
hasMP3PlayerAndSelection |
|
1779 |
^ [ fileListView selection size > 0 |
|
1780 |
and:[ self hasMP3Player value]] |
|
1781 |
! |
|
1782 |
||
1834 | 1783 |
hasSelection |
1784 |
^ [fileListView selection size > 0] |
|
1785 |
||
1786 |
"Created: / 4.8.1998 / 14:10:31 / cg" |
|
1787 |
"Modified: / 4.8.1998 / 14:10:57 / cg" |
|
1788 |
! |
|
1789 |
||
2825
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1790 |
hasSnapshotSelection |
3627 | 1791 |
^ [ |fn| |
1792 |
||
2825
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1793 |
(fileListView selection size == 1) |
3627 | 1794 |
and:[ ((fn := fileListView selectionValue first string withoutSeparators asFilename) hasSuffix:'img') |
1795 |
or:[fn hasSuffix:'sav'] ] |
|
2825
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1796 |
] |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1797 |
|
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1798 |
"Created: / 4.8.1998 / 14:10:31 / cg" |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1799 |
"Modified: / 4.8.1998 / 14:10:57 / cg" |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1800 |
! |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1801 |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1802 |
hasVisitHistory |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1803 |
^ [DirectoryHistory size > 0] |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1804 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1805 |
"Created: / 14.8.1998 / 19:17:02 / cg" |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1806 |
"Modified: / 14.8.1998 / 19:17:17 / cg" |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1807 |
! |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1808 |
|
1853 | 1809 |
hasZipFileSelected |
1988 | 1810 |
^ [|sel f fn suff| |
1811 |
||
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1812 |
sel := fileListView selection. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1813 |
sel size == 1 ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1814 |
f := fileList at:sel first ifAbsent:nil. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1815 |
f notNil ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1816 |
suff := f asFilename suffix asLowercase. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1817 |
suff = 'zip' or:[suff = 'jar'] |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1818 |
] ifFalse:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1819 |
false |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1820 |
] |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1821 |
] ifFalse:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1822 |
false |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1823 |
] |
1853 | 1824 |
] |
1825 |
||
1826 |
"Created: / 26.8.1998 / 16:15:26 / cg" |
|
1988 | 1827 |
"Modified: / 30.1.1999 / 19:05:59 / cg" |
1853 | 1828 |
! |
1829 |
||
1893
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
1830 |
javaSupportLoaded |
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
1831 |
^ [ JavaClassReader notNil |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1832 |
and:[JavaClassReader isLoaded]] |
1893
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
1833 |
|
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
1834 |
"Created: / 9.11.1998 / 05:33:17 / cg" |
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
1835 |
! |
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
1836 |
|
2031 | 1837 |
showingBigImagePreview |
1838 |
^ showingBigImagePreview |
|
1839 |
||
1840 |
"Created: / 14.8.1998 / 14:15:44 / cg" |
|
1841 |
! |
|
1842 |
||
1834 | 1843 |
showingDetails |
1844 |
^ showingDetails |
|
1845 |
||
1846 |
"Created: / 14.8.1998 / 14:15:15 / cg" |
|
1847 |
! |
|
1848 |
||
1849 |
showingHiddenFiles |
|
1850 |
^ showingHiddenFiles |
|
1851 |
||
1852 |
"Created: / 14.8.1998 / 14:15:44 / cg" |
|
1853 |
! |
|
1854 |
||
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1855 |
showingTimeAndDate |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1856 |
^ showingTimeAndDate |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1857 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1858 |
"Created: / 14.8.1998 / 14:15:44 / cg" |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1859 |
! |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1860 |
|
2567
dd029fea485d
added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents:
2562
diff
changeset
|
1861 |
singleSelectedFile |
dd029fea485d
added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents:
2562
diff
changeset
|
1862 |
|f sel| |
dd029fea485d
added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents:
2562
diff
changeset
|
1863 |
|
dd029fea485d
added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents:
2562
diff
changeset
|
1864 |
sel := fileListView selection. |
dd029fea485d
added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents:
2562
diff
changeset
|
1865 |
sel size ~~ 1 ifTrue:[ |
dd029fea485d
added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents:
2562
diff
changeset
|
1866 |
^ nil |
dd029fea485d
added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents:
2562
diff
changeset
|
1867 |
]. |
dd029fea485d
added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents:
2562
diff
changeset
|
1868 |
f := fileList at:sel first ifAbsent:nil. |
dd029fea485d
added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents:
2562
diff
changeset
|
1869 |
f notNil ifTrue:[ |
3747
d30bc1e54f15
Remove unused vars and asFilename sends
Stefan Vogel <sv@exept.de>
parents:
3746
diff
changeset
|
1870 |
^ currentDirectory construct:f |
2567
dd029fea485d
added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents:
2562
diff
changeset
|
1871 |
]. |
dd029fea485d
added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents:
2562
diff
changeset
|
1872 |
^ nil |
dd029fea485d
added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents:
2562
diff
changeset
|
1873 |
|
dd029fea485d
added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents:
2562
diff
changeset
|
1874 |
"Created: / 29.1.2000 / 13:09:09 / cg" |
dd029fea485d
added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents:
2562
diff
changeset
|
1875 |
! |
dd029fea485d
added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents:
2562
diff
changeset
|
1876 |
|
2368 | 1877 |
singleSelectedFileOrCurrentDirectory |
1878 |
|f sel| |
|
1879 |
||
1880 |
sel := fileListView selection. |
|
1881 |
sel size > 1 ifTrue:[ |
|
1882 |
^ nil |
|
1883 |
]. |
|
1884 |
sel size == 0 ifTrue:[ |
|
3747
d30bc1e54f15
Remove unused vars and asFilename sends
Stefan Vogel <sv@exept.de>
parents:
3746
diff
changeset
|
1885 |
^ currentDirectory |
2368 | 1886 |
]. |
1887 |
f := fileList at:sel first ifAbsent:nil. |
|
1888 |
f notNil ifTrue:[ |
|
3747
d30bc1e54f15
Remove unused vars and asFilename sends
Stefan Vogel <sv@exept.de>
parents:
3746
diff
changeset
|
1889 |
^ currentDirectory construct:f |
2368 | 1890 |
]. |
1891 |
^ nil |
|
1892 |
! |
|
1893 |
||
1834 | 1894 |
sortByWhat |
1895 |
^ sortByWhat |
|
1896 |
||
1897 |
"Created: / 14.8.1998 / 15:55:18 / cg" |
|
1898 |
"Modified: / 14.8.1998 / 15:56:08 / cg" |
|
1899 |
! |
|
1900 |
||
1901 |
sortCaseless |
|
1902 |
^ sortCaseless |
|
1903 |
||
1904 |
"Created: / 14.8.1998 / 14:21:21 / cg" |
|
1905 |
! |
|
1906 |
||
1907 |
systemIsDOS |
|
1908 |
^ OperatingSystem isMSDOSlike |
|
1909 |
||
1910 |
"Created: / 4.8.1998 / 13:37:28 / cg" |
|
1911 |
! |
|
1912 |
||
1913 |
systemIsUnix |
|
1914 |
^ OperatingSystem isUNIXlike |
|
1915 |
||
1916 |
"Created: / 4.8.1998 / 13:37:13 / cg" |
|
1917 |
! |
|
1918 |
||
1919 |
systemIsVMS |
|
1920 |
^ OperatingSystem isVMSlike |
|
1921 |
||
1922 |
"Created: / 4.8.1998 / 13:37:37 / cg" |
|
1923 |
! ! |
|
1924 |
||
1119 | 1925 |
!FileBrowser methodsFor:'drag & drop'! |
172 | 1926 |
|
1132
bd2eda432e1d
drop arg is always a collection
Claus Gittinger <cg@exept.de>
parents:
1124
diff
changeset
|
1927 |
canDrop:aCollectionOfDropObjects |
1119 | 1928 |
"I accept fileObjects only" |
1929 |
||
1132
bd2eda432e1d
drop arg is always a collection
Claus Gittinger <cg@exept.de>
parents:
1124
diff
changeset
|
1930 |
aCollectionOfDropObjects do:[:aDropObject | |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1931 |
aDropObject isFileObject ifFalse:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1932 |
aDropObject isTextObject ifFalse:[^ false]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1933 |
] |
1122
970fc7e88639
support drag out of my list.
Claus Gittinger <cg@exept.de>
parents:
1120
diff
changeset
|
1934 |
]. |
1132
bd2eda432e1d
drop arg is always a collection
Claus Gittinger <cg@exept.de>
parents:
1124
diff
changeset
|
1935 |
^ true |
bd2eda432e1d
drop arg is always a collection
Claus Gittinger <cg@exept.de>
parents:
1124
diff
changeset
|
1936 |
|
bd2eda432e1d
drop arg is always a collection
Claus Gittinger <cg@exept.de>
parents:
1124
diff
changeset
|
1937 |
"Modified: 11.4.1997 / 12:41:59 / cg" |
1118 | 1938 |
! |
1939 |
||
1132
bd2eda432e1d
drop arg is always a collection
Claus Gittinger <cg@exept.de>
parents:
1124
diff
changeset
|
1940 |
drop:aCollectionOfDropObjects at:aPoint |
1122
970fc7e88639
support drag out of my list.
Claus Gittinger <cg@exept.de>
parents:
1120
diff
changeset
|
1941 |
"handle drops" |
970fc7e88639
support drag out of my list.
Claus Gittinger <cg@exept.de>
parents:
1120
diff
changeset
|
1942 |
|
3061 | 1943 |
"/ for now ... only allow single drop |
1944 |
aCollectionOfDropObjects size > 1 ifTrue:[ |
|
1945 |
(self confirm:'Drop the last file only ?') ifFalse:[ |
|
1946 |
^ self |
|
1947 |
]. |
|
1948 |
self dropSingleObject:aCollectionOfDropObjects first at:aPoint. |
|
1949 |
^ self |
|
1950 |
]. |
|
3045 | 1951 |
|
1132
bd2eda432e1d
drop arg is always a collection
Claus Gittinger <cg@exept.de>
parents:
1124
diff
changeset
|
1952 |
aCollectionOfDropObjects do:[:aDropObject | |
3045 | 1953 |
self dropSingleObject:aDropObject at:aPoint |
1132
bd2eda432e1d
drop arg is always a collection
Claus Gittinger <cg@exept.de>
parents:
1124
diff
changeset
|
1954 |
] |
bd2eda432e1d
drop arg is always a collection
Claus Gittinger <cg@exept.de>
parents:
1124
diff
changeset
|
1955 |
|
bd2eda432e1d
drop arg is always a collection
Claus Gittinger <cg@exept.de>
parents:
1124
diff
changeset
|
1956 |
"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
|
1957 |
! |
970fc7e88639
support drag out of my list.
Claus Gittinger <cg@exept.de>
parents:
1120
diff
changeset
|
1958 |
|
970fc7e88639
support drag out of my list.
Claus Gittinger <cg@exept.de>
parents:
1120
diff
changeset
|
1959 |
dropSingleObject:someObject at:aPoint |
1119 | 1960 |
"handle drops; if its a directory, change to it. |
1124 | 1961 |
If its a file, change to its directory and select the file. |
1962 |
If its text, paste it into the codeView." |
|
1119 | 1963 |
|
1122
970fc7e88639
support drag out of my list.
Claus Gittinger <cg@exept.de>
parents:
1120
diff
changeset
|
1964 |
|newDir newFile| |
970fc7e88639
support drag out of my list.
Claus Gittinger <cg@exept.de>
parents:
1120
diff
changeset
|
1965 |
|
1124 | 1966 |
someObject isFileObject ifTrue:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1967 |
someObject isDirectory ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1968 |
newDir := someObject theObject pathName. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1969 |
] ifFalse:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1970 |
newDir := someObject theObject directoryName. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1971 |
newFile := someObject theObject baseName. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1972 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1973 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1974 |
newDir notNil ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1975 |
newDir ~= currentDirectory pathName ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1976 |
self changeDirectoryTo:newDir. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1977 |
] |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1978 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1979 |
newFile notNil ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1980 |
newFile ~= currentFileName ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1981 |
fileListView selection:(fileList indexOf:newFile). |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1982 |
self doFileGet:false. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1983 |
] |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1984 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1985 |
^ self |
1122
970fc7e88639
support drag out of my list.
Claus Gittinger <cg@exept.de>
parents:
1120
diff
changeset
|
1986 |
]. |
970fc7e88639
support drag out of my list.
Claus Gittinger <cg@exept.de>
parents:
1120
diff
changeset
|
1987 |
|
1124 | 1988 |
someObject isTextObject ifTrue:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1989 |
subView paste:someObject theObject. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1990 |
^ self |
1118 | 1991 |
]. |
1124 | 1992 |
|
1993 |
"Modified: 6.4.1997 / 14:46:44 / cg" |
|
1119 | 1994 |
! ! |
1995 |
||
1996 |
!FileBrowser methodsFor:'events'! |
|
1118 | 1997 |
|
1010 | 1998 |
handlesKeyPress:key inView:view |
1999 |
"this method is reached via delegation: are we prepared to handle |
|
2000 |
a keyPress in some other view ?" |
|
2001 |
||
2669
677ca47d8d11
cursor-right --> change to previous directory
Claus Gittinger <cg@exept.de>
parents:
2666
diff
changeset
|
2002 |
<resource: #keyboard (#GotoLine #InspectIt #CmdI #Cmdu |
677ca47d8d11
cursor-right --> change to previous directory
Claus Gittinger <cg@exept.de>
parents:
2666
diff
changeset
|
2003 |
#DoIt #Delete #BackSpace #Accept #CmdF #CmdD |
677ca47d8d11
cursor-right --> change to previous directory
Claus Gittinger <cg@exept.de>
parents:
2666
diff
changeset
|
2004 |
#CursorLeft #CursorRight |
677ca47d8d11
cursor-right --> change to previous directory
Claus Gittinger <cg@exept.de>
parents:
2666
diff
changeset
|
2005 |
)> |
1010 | 2006 |
|
2007 |
view == fileListView ifTrue:[ |
|
2543 | 2008 |
(key == #Delete |
2009 |
or:[key == #BackSpace |
|
2010 |
or:[key == #Accept |
|
2011 |
or:[key == #CmdI |
|
2012 |
or:[key == #CmdF |
|
2013 |
or:[key == #CmdD |
|
2014 |
or:[key == #Cmdu |
|
2015 |
or:[key == #Cut |
|
2016 |
or:[key == #Cmdr |
|
2017 |
or:[key == #Replace |
|
2018 |
or:[key == #InspectIt |
|
2019 |
or:[key == #GotoLine |
|
2665
3601bc8c5ae2
cursorLeft - change to parent dir
Claus Gittinger <cg@exept.de>
parents:
2640
diff
changeset
|
2020 |
or:[key == #CursorLeft |
2669
677ca47d8d11
cursor-right --> change to previous directory
Claus Gittinger <cg@exept.de>
parents:
2666
diff
changeset
|
2021 |
or:[key == #CursorRight |
677ca47d8d11
cursor-right --> change to previous directory
Claus Gittinger <cg@exept.de>
parents:
2666
diff
changeset
|
2022 |
or:[key == #DoIt]]]]]]]]]]]]]]) ifTrue:[^ true]. |
1010 | 2023 |
]. |
2024 |
^ false |
|
2025 |
||
1396 | 2026 |
"Created: / 28.1.1997 / 14:03:20 / stefan" |
2027 |
"Modified: / 20.6.1997 / 16:35:01 / cg" |
|
2028 |
"Modified: / 16.1.1998 / 16:50:39 / stefan" |
|
1010 | 2029 |
! |
2030 |
||
2031 |
keyPress:key x:x y:y view:view |
|
2032 |
"this method is reached via delegation from the fileListView" |
|
2033 |
||
2543 | 2034 |
<resource: #keyboard (#GotoLine #InspectIt |
2035 |
#CmdI #Cmdu #DoIt #Delete #BackSpace #Accept |
|
2669
677ca47d8d11
cursor-right --> change to previous directory
Claus Gittinger <cg@exept.de>
parents:
2666
diff
changeset
|
2036 |
#Cmdr #Cut #CursorLeft #CursorRight)> |
2543 | 2037 |
|
2038 |
(key == #Delete |
|
2039 |
or:[key == #Cut |
|
2040 |
or:[key == #BackSpace]]) ifTrue:[ |
|
2041 |
self fileRemove. |
|
2042 |
^ self |
|
1010 | 2043 |
]. |
2044 |
(key == #Accept) ifTrue:[ |
|
2543 | 2045 |
self fileFileIn. |
2046 |
^ self |
|
1010 | 2047 |
]. |
2048 |
(key == #GotoLine) ifTrue:[ |
|
2543 | 2049 |
self fileGet. |
2050 |
^ self |
|
1010 | 2051 |
]. |
2052 |
(key == #DoIt) ifTrue:[ |
|
2543 | 2053 |
self fileExecute. |
2054 |
^ self |
|
1010 | 2055 |
]. |
2056 |
(key == #InspectIt) ifTrue:[ |
|
2543 | 2057 |
self fileGetInfo. |
2058 |
^ self |
|
1010 | 2059 |
]. |
2060 |
(key == #CmdI) ifTrue:[ |
|
2543 | 2061 |
self fileGetLongInfo. |
2062 |
^ self |
|
1010 | 2063 |
]. |
2064 |
(key == #Cmdu) ifTrue:[ |
|
2543 | 2065 |
self updateCurrentDirectory. |
2066 |
^ self |
|
1396 | 2067 |
]. |
2068 |
(key == #CmdF) ifTrue:[ |
|
2543 | 2069 |
self newFile. |
2070 |
^ self |
|
1396 | 2071 |
]. |
2072 |
(key == #CmdD) ifTrue:[ |
|
2543 | 2073 |
self newDirectory. |
2074 |
^ self |
|
2075 |
]. |
|
2076 |
((key == #Cmdr) or:[key == #Replace]) ifTrue:[ |
|
2077 |
self fileRename. |
|
2078 |
^ self |
|
1010 | 2079 |
]. |
2665
3601bc8c5ae2
cursorLeft - change to parent dir
Claus Gittinger <cg@exept.de>
parents:
2640
diff
changeset
|
2080 |
(key == #CursorLeft) ifTrue:[ |
3601bc8c5ae2
cursorLeft - change to parent dir
Claus Gittinger <cg@exept.de>
parents:
2640
diff
changeset
|
2081 |
self changeToParentDirectory. |
3601bc8c5ae2
cursorLeft - change to parent dir
Claus Gittinger <cg@exept.de>
parents:
2640
diff
changeset
|
2082 |
^ self |
3601bc8c5ae2
cursorLeft - change to parent dir
Claus Gittinger <cg@exept.de>
parents:
2640
diff
changeset
|
2083 |
]. |
2669
677ca47d8d11
cursor-right --> change to previous directory
Claus Gittinger <cg@exept.de>
parents:
2666
diff
changeset
|
2084 |
(key == #CursorRight) ifTrue:[ |
677ca47d8d11
cursor-right --> change to previous directory
Claus Gittinger <cg@exept.de>
parents:
2666
diff
changeset
|
2085 |
self changeToPreviousDirectory. |
677ca47d8d11
cursor-right --> change to previous directory
Claus Gittinger <cg@exept.de>
parents:
2666
diff
changeset
|
2086 |
^ self |
677ca47d8d11
cursor-right --> change to previous directory
Claus Gittinger <cg@exept.de>
parents:
2666
diff
changeset
|
2087 |
]. |
1010 | 2088 |
fileListView keyPress:key x:x y:y |
2089 |
||
1396 | 2090 |
"Created: / 28.1.1997 / 14:03:56 / stefan" |
2091 |
"Modified: / 20.6.1997 / 16:35:08 / cg" |
|
2092 |
"Modified: / 16.1.1998 / 16:51:38 / stefan" |
|
1010 | 2093 |
! |
2094 |
||
172 | 2095 |
mapped |
2096 |
super mapped. |
|
2097 |
" |
|
2098 |
whant to know about changed history |
|
2099 |
" |
|
2100 |
self updateCurrentDirectory |
|
2101 |
! |
|
2102 |
||
2103 |
visibilityChange:how |
|
2104 |
|wasVisible| |
|
2105 |
||
2106 |
wasVisible := shown. |
|
2107 |
super visibilityChange:how. |
|
2108 |
(wasVisible not and:[shown]) ifTrue:[ |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2109 |
" |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2110 |
start checking again |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2111 |
" |
3520
83cf11e1bf32
schedule checkBlock for the right process
Claus Gittinger <cg@exept.de>
parents:
3503
diff
changeset
|
2112 |
self scheduleCheckBlock. |
172 | 2113 |
] |
1481 | 2114 |
|
2115 |
"Modified: / 18.2.1998 / 17:57:44 / cg" |
|
172 | 2116 |
! ! |
2117 |
||
2118 |
!FileBrowser methodsFor:'fileList user interaction'! |
|
2119 |
||
2031 | 2120 |
bigImagePreviewSettingChanged |
2121 |
"invoked, when big image preview flag changed" |
|
2122 |
||
2123 |
|fh| |
|
2124 |
||
2125 |
(showingBigImagePreview value == true |
|
2126 |
and:[showingDetails value == true]) ifTrue:[ |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2127 |
fh := fileListView font height. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2128 |
fileListView lineSpacing:(34 - fh max:0). |
2031 | 2129 |
] ifFalse:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2130 |
fileListView clear. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2131 |
self updateCurrentDirectory. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2132 |
fileListView lineSpacing:2. |
2031 | 2133 |
]. |
2134 |
fileListView clear. |
|
2135 |
self updateCurrentDirectory |
|
2136 |
||
2137 |
"Modified: / 4.8.1998 / 13:43:54 / cg" |
|
2138 |
"Created: / 14.8.1998 / 14:17:49 / cg" |
|
2139 |
! |
|
2140 |
||
172 | 2141 |
changeDisplayMode |
2142 |
"toggle from long to short listing (and vice-versa)" |
|
2143 |
||
1834 | 2144 |
showingDetails value:(showingDetails value not). |
2145 |
"/ showLongList := showLongList not. |
|
1156
f3df28086973
dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents:
1154
diff
changeset
|
2146 |
self showOrHideTabView. |
172 | 2147 |
self updateCurrentDirectory |
747 | 2148 |
|
1834 | 2149 |
"Modified: / 4.8.1998 / 13:43:54 / cg" |
172 | 2150 |
! |
2151 |
||
2152 |
changeDotFileVisibility |
|
2153 |
"turn on/off visibility of files whose name starts with '.'" |
|
2154 |
||
1834 | 2155 |
showingHiddenFiles value:(showingHiddenFiles value not). |
2156 |
"/ showDotFiles := showDotFiles not. |
|
172 | 2157 |
self updateCurrentDirectory |
1834 | 2158 |
|
2159 |
"Modified: / 4.8.1998 / 13:45:46 / cg" |
|
2160 |
! |
|
2161 |
||
3281 | 2162 |
confirmAndRemove:fileNames |
2163 |
"remove fileNames with user confirmation. |
|
2164 |
TODO: Should be enhanced, to look for a ~/.trash directory |
|
2165 |
and move files there if it exists (without asking in this case)." |
|
2166 |
||
2167 |
|q doRemove| |
|
2168 |
||
2169 |
"/ do not ask, if shift is pressed |
|
2170 |
fileNames size > 1 ifTrue:[ |
|
2171 |
q := resources string:'Remove %1 selected files ?' with:(fileNames size). |
|
2172 |
doRemove := Dialog |
|
2173 |
confirmWithCancel:q |
|
2174 |
labels:(resources array:#('Cancel' 'Confirm Each' 'Remove')) |
|
2175 |
values:#(false #confirm true) |
|
2176 |
default:3. |
|
2177 |
doRemove isNil ifTrue:[^ self]. |
|
2178 |
doRemove == #confirm ifTrue:[ |
|
2179 |
fileNames do:[:eachFileName | |
|
2180 |
self confirmAndRemove:(Array with:eachFileName). |
|
2181 |
]. |
|
2182 |
^ self. |
|
2183 |
]. |
|
2184 |
] ifFalse:[ |
|
2185 |
q := resources string:'Remove ''%1'' ?' with:(fileNames first allBold). |
|
2186 |
doRemove := self ask:q yesButton:'Remove'. |
|
2187 |
]. |
|
2188 |
||
2189 |
doRemove ifTrue:[ |
|
2190 |
self doRemove:fileNames |
|
2191 |
] |
|
2192 |
! |
|
2193 |
||
1834 | 2194 |
detailsSettingChanged |
2195 |
"invoked, when detail (i.e. long / short) listing flag changed" |
|
2196 |
||
2197 |
self showOrHideTabView. |
|
2031 | 2198 |
self bigImagePreviewSettingChanged |
1834 | 2199 |
|
2200 |
"Modified: / 4.8.1998 / 13:43:54 / cg" |
|
2201 |
"Created: / 14.8.1998 / 14:17:49 / cg" |
|
172 | 2202 |
! |
2203 |
||
1327 | 2204 |
fileDoubleClick:lineNr |
2205 |
"double click on a file - get its contents" |
|
2206 |
||
2207 |
self fileSelect:lineNr. |
|
2208 |
self fileGet:true |
|
2209 |
! |
|
2210 |
||
386
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
2211 |
fileEncoding |
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
2212 |
"open a dialog to allow change of the files character encoding. |
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
2213 |
Files are converted to internal encoding when read, and converted back |
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
2214 |
to this encoding when saved. |
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
2215 |
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
|
2216 |
the internal encoding (which is iso8859). |
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
2217 |
Notice: currently, not too many encodings are supported by the system." |
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
2218 |
|
495
6d6a6b8feb2b
ask characterArray for encodings
Claus Gittinger <cg@exept.de>
parents:
488
diff
changeset
|
2219 |
|dialog list descr encodings encodingNames idx| |
386
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
2220 |
|
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
2221 |
list := SelectionInList new. |
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
2222 |
|
495
6d6a6b8feb2b
ask characterArray for encodings
Claus Gittinger <cg@exept.de>
parents:
488
diff
changeset
|
2223 |
descr := CharacterArray supportedExternalEncodings. |
6d6a6b8feb2b
ask characterArray for encodings
Claus Gittinger <cg@exept.de>
parents:
488
diff
changeset
|
2224 |
encodings := descr at:2. |
6d6a6b8feb2b
ask characterArray for encodings
Claus Gittinger <cg@exept.de>
parents:
488
diff
changeset
|
2225 |
encodingNames := descr at:1. |
6d6a6b8feb2b
ask characterArray for encodings
Claus Gittinger <cg@exept.de>
parents:
488
diff
changeset
|
2226 |
|
6d6a6b8feb2b
ask characterArray for encodings
Claus Gittinger <cg@exept.de>
parents:
488
diff
changeset
|
2227 |
list list:encodingNames. |
386
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
2228 |
list selectionIndex:(encodings indexOf:fileEncoding ifAbsent:1). |
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
2229 |
|
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
2230 |
dialog := Dialog new. |
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
2231 |
|
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
2232 |
dialog addTextLabel:(resources string:'ENCODING_MSG') withCRs. |
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
2233 |
dialog addVerticalSpace. |
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
2234 |
dialog addListBoxOn:list withNumberOfLines:5. |
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
2235 |
|
2048 | 2236 |
dialog addAbortAndOkButtons. |
386
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
2237 |
dialog open. |
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
2238 |
|
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
2239 |
dialog accepted ifTrue:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2240 |
idx := list selectionIndex. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2241 |
fileEncoding := encodings at:idx. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2242 |
subView externalEncoding:fileEncoding. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2243 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2244 |
self validateFontEncodingFor:fileEncoding ask:true. |
386
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
2245 |
]. |
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
2246 |
|
1219 | 2247 |
"Modified: 30.6.1997 / 14:41:12 / cg" |
386
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
2248 |
! |
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
2249 |
|
172 | 2250 |
fileExecute |
2251 |
"if text was modified show a queryBox, |
|
2252 |
otherwise pop up execute box immediately" |
|
2253 |
||
1142
9066d7d02a3a
remember last executed command per suffix; offer this as default.
Claus Gittinger <cg@exept.de>
parents:
1141
diff
changeset
|
2254 |
|action sel fileName| |
172 | 2255 |
|
2256 |
" |
|
2257 |
this replaces everything by the commands output ... |
|
2258 |
" |
|
865
48395e8ecca9
remember executeCommand actions in history as well.
Claus Gittinger <cg@exept.de>
parents:
851
diff
changeset
|
2259 |
action := [:command | |
3252 | 2260 |
self class addToCommandHistory:command for:fileName. |
2261 |
self doExecuteCommand:command replace:true |
|
2262 |
]. |
|
2263 |
||
2264 |
(self askIfModified:'Contents has not been saved.\\Modifications will be lost when command is executed.' |
|
2265 |
yesButton:'Execute') ifFalse:[^ self]. |
|
172 | 2266 |
|
2267 |
"/ " |
|
2268 |
"/ this inserts the commands output ... |
|
2269 |
"/ " |
|
2270 |
"/ action := [:command| self doExecuteCommand:command replace:false]. |
|
2271 |
"/ |
|
1142
9066d7d02a3a
remember last executed command per suffix; offer this as default.
Claus Gittinger <cg@exept.de>
parents:
1141
diff
changeset
|
2272 |
|
9066d7d02a3a
remember last executed command per suffix; offer this as default.
Claus Gittinger <cg@exept.de>
parents:
1141
diff
changeset
|
2273 |
sel := fileListView selection. |
9066d7d02a3a
remember last executed command per suffix; offer this as default.
Claus Gittinger <cg@exept.de>
parents:
1141
diff
changeset
|
2274 |
sel size == 1 ifTrue:[ |
3252 | 2275 |
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
|
2276 |
]. |
9066d7d02a3a
remember last executed command per suffix; offer this as default.
Claus Gittinger <cg@exept.de>
parents:
1141
diff
changeset
|
2277 |
self askForCommandFor:fileName thenDo:action |
865
48395e8ecca9
remember executeCommand actions in history as well.
Claus Gittinger <cg@exept.de>
parents:
851
diff
changeset
|
2278 |
|
48395e8ecca9
remember executeCommand actions in history as well.
Claus Gittinger <cg@exept.de>
parents:
851
diff
changeset
|
2279 |
"Modified: 14.11.1996 / 14:59:34 / cg" |
172 | 2280 |
! |
2281 |
||
2282 |
fileFileIn |
|
2283 |
"fileIn the selected file(s)" |
|
2284 |
||
2285 |
self fileFileInLazy:false |
|
2286 |
! |
|
2287 |
||
3766
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2288 |
fileFileIn:fileName lazy:lazy |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2289 |
"fileIn fileName" |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2290 |
|
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2291 |
|aStream path wasLazy prevCurrentFileName| |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2292 |
|
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2293 |
path := currentDirectory filenameFor:fileName. |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2294 |
path type == #regular ifTrue:[ |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2295 |
prevCurrentFileName := currentFileInFileName. |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2296 |
currentFileInFileName := fileName. |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2297 |
|
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2298 |
(ObjectFileLoader notNil |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2299 |
and:[ObjectFileLoader hasValidBinaryExtension:fileName]) ifTrue:[ |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2300 |
AbortOperationRequest catch:[ |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2301 |
|p| |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2302 |
|
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2303 |
"/ |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2304 |
"/ look if already loaded ... then unload first |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2305 |
"/ |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2306 |
p := path pathName. |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2307 |
(ObjectFileLoader loadedObjectFiles includes:p) ifTrue:[ |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2308 |
(Dialog confirm:(resources |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2309 |
string:'%1 is already loaded; load anyway ?' |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2310 |
with:p)) ifFalse:[ |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2311 |
^ self |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2312 |
]. |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2313 |
Transcript showCR:'unloading old ' , p , ' ...'. |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2314 |
ObjectFileLoader unloadObjectFile:p. |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2315 |
]. |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2316 |
|
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2317 |
Transcript showCR:'loading ' , p , ' ...'. |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2318 |
ObjectFileLoader loadObjectFile:p. |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2319 |
Class addInfoRecord:('fileIn ' , fileName) |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2320 |
] |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2321 |
] ifFalse:[ ((path hasSuffix:'cls') |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2322 |
and:[((path mimeTypeOfContents ? '') startsWith:'application/x-smalltalk-source') not ]) ifTrue:[ |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2323 |
"/ loading a binary class file |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2324 |
aStream := path readStream. |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2325 |
aStream notNil ifTrue:[ |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2326 |
aStream fileInBinary. |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2327 |
] |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2328 |
] ifFalse:[ |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2329 |
((path hasSuffix:'class') |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2330 |
or:[(path hasSuffix:'cla')]) ifTrue:[ |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2331 |
"/ loading a java class file |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2332 |
JavaClassReader notNil ifTrue:[ |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2333 |
JavaClassReader loadFile:(path pathName) |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2334 |
] |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2335 |
] ifFalse:[ (path hasSuffix:'sif') ifTrue:[ |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2336 |
"/ loading a sif (smalltalk interchange format) file |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2337 |
SmalltalkInterchangeSTXFileInManager autoload. |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2338 |
SmalltalkInterchangeFileManager newForFileIn |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2339 |
fileName: path pathName; |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2340 |
fileIn. |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2341 |
] ifFalse:[ (path hasSuffix:'pcl') ifTrue:[ |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2342 |
Parcel isNil ifTrue:[ |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2343 |
self warn:'Parcel support not loaded.' |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2344 |
] ifFalse:[ |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2345 |
Parcel loadParcelFrom: path pathName |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2346 |
] |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2347 |
] ifFalse:[ |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2348 |
"/ loading a regular (chunk) or xml source file |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2349 |
aStream := path readStream. |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2350 |
aStream notNil ifTrue:[ |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2351 |
[ |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2352 |
Class withoutUpdatingChangesDo:[ |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2353 |
wasLazy := Compiler compileLazy:lazy. |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2354 |
aStream fileIn. |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2355 |
]. |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2356 |
Class addInfoRecord:('fileIn ' , fileName) |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2357 |
] ensure:[ |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2358 |
Compiler compileLazy:wasLazy. |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2359 |
aStream close |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2360 |
] |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2361 |
] |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2362 |
]]] |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2363 |
]] |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2364 |
]. |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2365 |
currentFileInFileName := prevCurrentFileName |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2366 |
|
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2367 |
"Modified: / 19.9.1997 / 23:42:22 / stefan" |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2368 |
"Modified: / 16.11.2001 / 17:38:34 / cg" |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2369 |
! |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2370 |
|
172 | 2371 |
fileFileInLazy |
2372 |
"fileIn the selected file(s). Do a quick load (no compilation)" |
|
2373 |
||
2374 |
self fileFileInLazy:true |
|
2375 |
! |
|
2376 |
||
2377 |
fileFileInLazy:lazy |
|
2378 |
"fileIn the selected file(s)" |
|
2379 |
||
3766
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2380 |
|
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2381 |
fileListView selection size > 1 ifTrue:[ |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2382 |
AbortAllSignal catch:[ |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2383 |
self selectedFilesDo:[:fileName | |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2384 |
AbortSignal catch:[ |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2385 |
self fileFileIn:fileName lazy:lazy. |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2386 |
] |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2387 |
] |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2388 |
]. |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2389 |
^ self. |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2390 |
]. |
172 | 2391 |
|
2392 |
self selectedFilesDo:[:fileName | |
|
3766
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2393 |
self fileFileIn:fileName lazy:lazy. |
172 | 2394 |
] |
2395 |
||
1702
962056a31c06
remember the current file during fileIn,
Claus Gittinger <cg@exept.de>
parents:
1700
diff
changeset
|
2396 |
"Modified: / 19.9.1997 / 23:42:22 / stefan" |
3436
c4fe19deba58
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3421
diff
changeset
|
2397 |
"Modified: / 16.11.2001 / 17:38:34 / cg" |
172 | 2398 |
! |
2399 |
||
3465
f52e089ca838
added fileIntoNameSpace menu item
Claus Gittinger <cg@exept.de>
parents:
3461
diff
changeset
|
2400 |
fileFileInToNameSpace |
f52e089ca838
added fileIntoNameSpace menu item
Claus Gittinger <cg@exept.de>
parents:
3461
diff
changeset
|
2401 |
"fileIn the selected file(s)<into a nameSpace" |
f52e089ca838
added fileIntoNameSpace menu item
Claus Gittinger <cg@exept.de>
parents:
3461
diff
changeset
|
2402 |
|
3786
2cc5b344133b
better box for fileIntoNameSpace
Claus Gittinger <cg@exept.de>
parents:
3767
diff
changeset
|
2403 |
|ns listOfKnownNameSpaces| |
2cc5b344133b
better box for fileIntoNameSpace
Claus Gittinger <cg@exept.de>
parents:
3767
diff
changeset
|
2404 |
|
2cc5b344133b
better box for fileIntoNameSpace
Claus Gittinger <cg@exept.de>
parents:
3767
diff
changeset
|
2405 |
listOfKnownNameSpaces := Set new. |
2cc5b344133b
better box for fileIntoNameSpace
Claus Gittinger <cg@exept.de>
parents:
3767
diff
changeset
|
2406 |
NameSpace |
2cc5b344133b
better box for fileIntoNameSpace
Claus Gittinger <cg@exept.de>
parents:
3767
diff
changeset
|
2407 |
allNamespaces |
2cc5b344133b
better box for fileIntoNameSpace
Claus Gittinger <cg@exept.de>
parents:
3767
diff
changeset
|
2408 |
do:[:eachNameSpace | |
2cc5b344133b
better box for fileIntoNameSpace
Claus Gittinger <cg@exept.de>
parents:
3767
diff
changeset
|
2409 |
listOfKnownNameSpaces add:eachNameSpace name |
2cc5b344133b
better box for fileIntoNameSpace
Claus Gittinger <cg@exept.de>
parents:
3767
diff
changeset
|
2410 |
]. |
2cc5b344133b
better box for fileIntoNameSpace
Claus Gittinger <cg@exept.de>
parents:
3767
diff
changeset
|
2411 |
listOfKnownNameSpaces := listOfKnownNameSpaces asOrderedCollection sort. |
2cc5b344133b
better box for fileIntoNameSpace
Claus Gittinger <cg@exept.de>
parents:
3767
diff
changeset
|
2412 |
|
2cc5b344133b
better box for fileIntoNameSpace
Claus Gittinger <cg@exept.de>
parents:
3767
diff
changeset
|
2413 |
ns := Dialog |
2cc5b344133b
better box for fileIntoNameSpace
Claus Gittinger <cg@exept.de>
parents:
3767
diff
changeset
|
2414 |
request:'During fileIn, new classes are created in nameSpace:' |
3789 | 2415 |
initialAnswer:(lastEnforcedNameSpace ? LastEnforcedNameSpace ? Class nameSpaceQuerySignal query name) |
3786
2cc5b344133b
better box for fileIntoNameSpace
Claus Gittinger <cg@exept.de>
parents:
3767
diff
changeset
|
2416 |
list:listOfKnownNameSpaces. |
2cc5b344133b
better box for fileIntoNameSpace
Claus Gittinger <cg@exept.de>
parents:
3767
diff
changeset
|
2417 |
ns isEmptyOrNil ifTrue:[^ self]. |
2cc5b344133b
better box for fileIntoNameSpace
Claus Gittinger <cg@exept.de>
parents:
3767
diff
changeset
|
2418 |
|
3789 | 2419 |
LastEnforcedNameSpace := lastEnforcedNameSpace := ns. |
3465
f52e089ca838
added fileIntoNameSpace menu item
Claus Gittinger <cg@exept.de>
parents:
3461
diff
changeset
|
2420 |
ns := NameSpace name:ns. |
3786
2cc5b344133b
better box for fileIntoNameSpace
Claus Gittinger <cg@exept.de>
parents:
3767
diff
changeset
|
2421 |
|
3465
f52e089ca838
added fileIntoNameSpace menu item
Claus Gittinger <cg@exept.de>
parents:
3461
diff
changeset
|
2422 |
Class nameSpaceQuerySignal |
f52e089ca838
added fileIntoNameSpace menu item
Claus Gittinger <cg@exept.de>
parents:
3461
diff
changeset
|
2423 |
answer:ns |
f52e089ca838
added fileIntoNameSpace menu item
Claus Gittinger <cg@exept.de>
parents:
3461
diff
changeset
|
2424 |
do:[ self fileFileInLazy:false ] |
f52e089ca838
added fileIntoNameSpace menu item
Claus Gittinger <cg@exept.de>
parents:
3461
diff
changeset
|
2425 |
! |
f52e089ca838
added fileIntoNameSpace menu item
Claus Gittinger <cg@exept.de>
parents:
3461
diff
changeset
|
2426 |
|
1972 | 2427 |
fileFindAllDuplicates |
2428 |
"scan directory and all subdirs for duplicate files" |
|
2429 |
||
2430 |
|fileNames dir infoDir filesBySize |
|
2431 |
result info dirPrefix| |
|
2432 |
||
2433 |
(self askIfModified:'contents has not been saved.\\Modifications will be lost when you proceed.' |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2434 |
yesButton:'proceed') ifFalse:[^ self]. |
1972 | 2435 |
|
2436 |
self withWaitCursorDo:[ |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2437 |
result := Dictionary new. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2438 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2439 |
dir := currentDirectory asFilename. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2440 |
self label:myName , '- gathering file names ...'. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2441 |
fileNames := dir recursiveDirectoryContents. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2442 |
fileNames := fileNames collect:[:fn | dir construct:fn]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2443 |
fileNames := fileNames select:[:fn | fn isDirectory not]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2444 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2445 |
self label:myName , '- gathering sizes ...'. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2446 |
infoDir := Dictionary new. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2447 |
fileNames do:[:fn | |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2448 |
infoDir at:fn put:(fn fileSize) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2449 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2450 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2451 |
"/ for each, get the files size. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2452 |
"/ in a first pass, look for files of the same size and |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2453 |
"/ compare them ... |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2454 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2455 |
self label:myName , '- preselect possible duplicates ...'. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2456 |
filesBySize := Dictionary new. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2457 |
infoDir keysAndValuesDo:[:fn :sz | |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2458 |
|entry| |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2459 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2460 |
entry := filesBySize at:sz ifAbsentPut:[Set new]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2461 |
entry add:fn. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2462 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2463 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2464 |
"/ any of same size ? |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2465 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2466 |
self label:myName , '- checking for duplicates ...'. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2467 |
filesBySize do:[:entry | |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2468 |
|files| |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2469 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2470 |
entry size > 1 ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2471 |
files := entry asArray. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2472 |
1 to:files size-1 do:[:idx1 | |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2473 |
idx1+1 to:files size do:[:idx2 | |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2474 |
|fn1 fn2| |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2475 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2476 |
fn1 := files at:idx1. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2477 |
fn2 := files at:idx2. |
1972 | 2478 |
|
2479 |
"/ self label:myName , '- checking ' , fn1 baseName , ' vs. ' , fn2 baseName , ' ...'. |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2480 |
(result at:fn2 ifAbsent:nil) ~= fn1 ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2481 |
"/ compare the files |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2482 |
(fn1 sameContentsAs:fn2) ifTrue:[ |
1972 | 2483 |
"/ Transcript show:'Same: '; show:fn1 baseName; show:' and '; showCR:fn2 baseName. |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2484 |
result at:fn1 put:fn2. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2485 |
] |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2486 |
] |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2487 |
] |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2488 |
] |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2489 |
] |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2490 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2491 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2492 |
self label:myName , '- sorting ...'. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2493 |
dirPrefix := currentDirectory asFilename pathName. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2494 |
result := result associations. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2495 |
result := result collect:[:assoc | |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2496 |
|f1 f2| |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2497 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2498 |
f1 := assoc key name. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2499 |
f2 := assoc value name. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2500 |
(f1 startsWith:dirPrefix) ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2501 |
f1 := f1 copyFrom:dirPrefix size + 2. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2502 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2503 |
(f2 startsWith:dirPrefix) ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2504 |
f2 := f2 copyFrom:dirPrefix size + 2. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2505 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2506 |
f1 < f2 ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2507 |
f2 -> f1 |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2508 |
] ifFalse:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2509 |
f1 -> f2 |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2510 |
] |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2511 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2512 |
result sort:[:f1 :f2 | f2 value < f1 value]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2513 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2514 |
info := OrderedCollection new. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2515 |
result do:[:assoc | |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2516 |
info add:(assoc key , ' same as ' , assoc value) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2517 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2518 |
info isEmpty ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2519 |
info := 'No duplicate files found.' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2520 |
]. |
1972 | 2521 |
]. |
2522 |
||
2523 |
subView contents:info. |
|
2524 |
self label:myName. |
|
2525 |
||
2526 |
"Created: / 28.11.1998 / 17:47:53 / cg" |
|
2527 |
"Modified: / 10.12.1998 / 17:13:14 / cg" |
|
2528 |
! |
|
2529 |
||
1911
6d1b77eda98f
check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents:
1903
diff
changeset
|
2530 |
fileFindDuplicates |
6d1b77eda98f
check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents:
1903
diff
changeset
|
2531 |
"scan directory for duplicate files" |
6d1b77eda98f
check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents:
1903
diff
changeset
|
2532 |
|
6d1b77eda98f
check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents:
1903
diff
changeset
|
2533 |
|fileNames dir infoDir filesBySize |
6d1b77eda98f
check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents:
1903
diff
changeset
|
2534 |
result info| |
6d1b77eda98f
check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents:
1903
diff
changeset
|
2535 |
|
6d1b77eda98f
check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents:
1903
diff
changeset
|
2536 |
(self askIfModified:'contents has not been saved.\\Modifications will be lost when you proceed.' |
3726 | 2537 |
yesButton:'Proceed') ifFalse:[^ self]. |
1911
6d1b77eda98f
check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents:
1903
diff
changeset
|
2538 |
|
6d1b77eda98f
check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents:
1903
diff
changeset
|
2539 |
self withWaitCursorDo:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2540 |
result := Dictionary new. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2541 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2542 |
dir := currentDirectory asFilename. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2543 |
fileNames := dir directoryContents. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2544 |
fileNames := fileNames collect:[:fn | dir construct:fn]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2545 |
fileNames := fileNames select:[:fn | fn isDirectory not]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2546 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2547 |
infoDir := Dictionary new. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2548 |
fileNames do:[:fn | |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2549 |
infoDir at:fn put:(fn info) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2550 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2551 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2552 |
"/ for each, get the files size. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2553 |
"/ in a first pass, look for files of the same size and |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2554 |
"/ compare them ... |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2555 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2556 |
filesBySize := Dictionary new. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2557 |
infoDir keysAndValuesDo:[:fn :info | |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2558 |
|sz entry| |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2559 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2560 |
sz := info size. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2561 |
entry := filesBySize at:sz ifAbsentPut:[Set new]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2562 |
entry add:fn. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2563 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2564 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2565 |
"/ any of same size ? |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2566 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2567 |
filesBySize do:[:entry | |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2568 |
|files| |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2569 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2570 |
entry size > 1 ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2571 |
files := entry asArray. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2572 |
1 to:files size-1 do:[:idx1 | |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2573 |
idx1+1 to:files size do:[:idx2 | |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2574 |
|fn1 fn2| |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2575 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2576 |
fn1 := files at:idx1. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2577 |
fn2 := files at:idx2. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2578 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2579 |
(result at:fn2 ifAbsent:nil) ~= fn1 ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2580 |
"/ compare the files |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2581 |
(fn1 sameContentsAs:fn2) ifTrue:[ |
1911
6d1b77eda98f
check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents:
1903
diff
changeset
|
2582 |
"/ Transcript show:'Same: '; show:fn1 baseName; show:' and '; showCR:fn2 baseName. |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2583 |
result at:fn1 put:fn2. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2584 |
] |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2585 |
] |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2586 |
] |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2587 |
] |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2588 |
] |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2589 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2590 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2591 |
result := result associations. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2592 |
result := result collect:[:assoc | |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2593 |
|f1 f2| |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2594 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2595 |
f1 := assoc key baseName. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2596 |
f2 := assoc value baseName. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2597 |
f1 < f2 ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2598 |
f2 -> f1 |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2599 |
] ifFalse:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2600 |
f1 -> f2 |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2601 |
] |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2602 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2603 |
result sort:[:f1 :f2 | f2 value < f1 value]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2604 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2605 |
info := OrderedCollection new. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2606 |
result do:[:assoc | |
3556 | 2607 |
|fn1 fn2| |
2608 |
||
2609 |
fn1 := assoc key. |
|
2610 |
fn2 := assoc value. |
|
2611 |
(fn1 includes:Character space) ifTrue:[ |
|
2612 |
fn1 := '"' , fn1 , '"' |
|
2613 |
]. |
|
2614 |
(fn2 includes:Character space) ifTrue:[ |
|
2615 |
fn2 := '"' , fn2 , '"' |
|
2616 |
]. |
|
2617 |
info add:(fn1 , ' same as ' , fn2) |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2618 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2619 |
info isEmpty ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2620 |
info := 'No duplicate files found.' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2621 |
]. |
1911
6d1b77eda98f
check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents:
1903
diff
changeset
|
2622 |
]. |
6d1b77eda98f
check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents:
1903
diff
changeset
|
2623 |
|
6d1b77eda98f
check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents:
1903
diff
changeset
|
2624 |
subView contents:info |
6d1b77eda98f
check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents:
1903
diff
changeset
|
2625 |
|
6d1b77eda98f
check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents:
1903
diff
changeset
|
2626 |
"Created: / 3.10.1998 / 17:59:00 / cg" |
1912 | 2627 |
"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
|
2628 |
! |
6d1b77eda98f
check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents:
1903
diff
changeset
|
2629 |
|
1933 | 2630 |
fileFindFile |
1965 | 2631 |
|sel bindings |
1933 | 2632 |
namePatternHolder contentsPatternHolder |
2633 |
ignoreCaseInName ignoreCaseInContents |
|
2166
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2634 |
namePattern namePatterns contentsPattern |
1965 | 2635 |
searchForSameContentsEnabled searchForSameContents| |
1933 | 2636 |
|
2637 |
(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
|
2638 |
yesButton:'proceed') ifFalse:[^ self]. |
1933 | 2639 |
|
2640 |
subView contents:nil; scrollToTop. |
|
2641 |
||
2642 |
bindings := IdentityDictionary new. |
|
2643 |
bindings at:#namePatternHolder put:(namePatternHolder := '' asValue). |
|
2644 |
bindings at:#contentsPatternHolder put:(contentsPatternHolder := '' asValue). |
|
2645 |
bindings at:#ignoreCaseInName put:(ignoreCaseInName := false asValue). |
|
2646 |
bindings at:#ignoreCaseInContents put:(ignoreCaseInContents := false asValue). |
|
2647 |
||
1965 | 2648 |
searchForSameContentsEnabled := false. |
2649 |
sel := fileListView selectionValue. |
|
2650 |
sel size == 1 ifTrue:[ |
|
2166
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2651 |
searchForSameContentsEnabled := true. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2652 |
sel := sel first string withoutSeparators |
1965 | 2653 |
]. |
2654 |
bindings at:#searchForSameContentsEnabled put:(searchForSameContentsEnabled := searchForSameContentsEnabled asValue). |
|
2655 |
bindings at:#searchForSameContents put:(searchForSameContents := false asValue). |
|
2656 |
bindings at:#notSearchForSameContents put:(BlockValue forLogicalNot:searchForSameContents). |
|
2657 |
||
2658 |
||
1933 | 2659 |
(SimpleDialog new |
2166
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2660 |
openFor:self |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2661 |
interfaceSpec:(self class fileSearchDialogSpec) |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2662 |
withBindings:bindings) ifTrue:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2663 |
|
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2664 |
namePattern := namePatternHolder value. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2665 |
namePattern size == 0 ifTrue:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2666 |
namePatterns := nil |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2667 |
] ifFalse:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2668 |
ignoreCaseInName value ifTrue:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2669 |
namePattern := namePattern asLowercase |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2670 |
]. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2671 |
namePatterns := namePattern asCollectionOfSubstringsSeparatedBy:$; |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2672 |
]. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2673 |
contentsPattern := contentsPatternHolder value. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2674 |
contentsPattern size == 0 ifTrue:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2675 |
contentsPattern := nil |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2676 |
] ifFalse:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2677 |
ignoreCaseInContents value ifTrue:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2678 |
contentsPattern := contentsPattern asLowercase |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2679 |
] |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2680 |
]. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2681 |
|
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2682 |
self withWaitCursorDo:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2683 |
|stopSignal access myProcess lowerFrameView| |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2684 |
|
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2685 |
myProcess := Processor activeProcess. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2686 |
|
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2687 |
access := Semaphore forMutualExclusion name:'accessLock'. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2688 |
stopSignal := Signal new. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2689 |
|
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2690 |
" |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2691 |
The following is tricky: |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2692 |
the pauseToggle & killButton will |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2693 |
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
|
2694 |
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
|
2695 |
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
|
2696 |
" |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2697 |
|
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2698 |
commandView beInvisible. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2699 |
|
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2700 |
" |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2701 |
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
|
2702 |
" |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2703 |
killButton windowGroup:nil. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2704 |
|
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2705 |
" |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2706 |
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
|
2707 |
" |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2708 |
killButton label:(resources string:'stop'). |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2709 |
killButton raise; beVisible. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2710 |
|
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2711 |
" |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2712 |
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
|
2713 |
" |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2714 |
killButton |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2715 |
action:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2716 |
access critical:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2717 |
myProcess interruptWith:[stopSignal raiseRequest]. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2718 |
] |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2719 |
]. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2720 |
|
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2721 |
" |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2722 |
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
|
2723 |
" |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2724 |
killButton openAutonomous. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2725 |
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
|
2726 |
|
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2727 |
lowerFrameView := subView superView. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2728 |
|
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2729 |
[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2730 |
stopSignal catch:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2731 |
searchForSameContents value ifTrue:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2732 |
self |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2733 |
doFindFileNamed:namePatterns |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2734 |
ignoreCase:ignoreCaseInName value |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2735 |
containingString:nil |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2736 |
ignoreCaseInContents:ignoreCaseInContents value |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2737 |
sameContentsAsFile:(currentDirectory asFilename construct:sel) |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2738 |
sameContentsAs:nil |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2739 |
in:currentDirectory. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2740 |
] ifFalse:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2741 |
(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
|
2742 |
self |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2743 |
doFindFileNamed:namePatterns |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2744 |
ignoreCase:ignoreCaseInName value |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2745 |
containingString:contentsPattern |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2746 |
ignoreCaseInContents:ignoreCaseInContents value |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2747 |
sameContentsAsFile:nil |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2748 |
sameContentsAs:nil |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2749 |
in:currentDirectory. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2750 |
] |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2751 |
] |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2752 |
] |
3596
9761af1f3f72
#valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents:
3568
diff
changeset
|
2753 |
] ensure:[ |
2166
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2754 |
|wg| |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2755 |
|
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2756 |
self label:myName; iconLabel:myName. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2757 |
|
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2758 |
" |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2759 |
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
|
2760 |
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
|
2761 |
" |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2762 |
killButton beInvisible. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2763 |
|
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2764 |
commandView beVisible. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2765 |
|
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2766 |
" |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2767 |
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
|
2768 |
(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
|
2769 |
" |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2770 |
wg := killButton windowGroup. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2771 |
killButton windowGroup:nil. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2772 |
|
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2773 |
" |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2774 |
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
|
2775 |
" |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2776 |
wg notNil ifTrue:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2777 |
wg process terminate. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2778 |
]. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2779 |
" |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2780 |
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
|
2781 |
releases reference to thisContext earlier) |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2782 |
" |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2783 |
killButton action:nil. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2784 |
killButton label:(resources string:'kill'). |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2785 |
|
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2786 |
"/ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2787 |
"/ allow interaction with the codeView |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2788 |
"/ (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
|
2789 |
"/ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2790 |
lowerFrameView windowGroup:(self windowGroup). |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2791 |
]. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2792 |
|
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2793 |
]. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2794 |
self label:myName. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2795 |
currentFileName isNil ifTrue:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2796 |
subView modified:false. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2797 |
]. |
1933 | 2798 |
]. |
2799 |
||
2800 |
"Created: / 15.10.1998 / 11:32:57 / cg" |
|
2801 |
"Modified: / 15.10.1998 / 12:41:09 / cg" |
|
2802 |
! |
|
2803 |
||
172 | 2804 |
fileGet |
2805 |
"get contents of selected file into subView. |
|
2806 |
If text was modified show a queryBox, |
|
2807 |
otherwise get it immediately" |
|
2808 |
||
633
4630175ed31e
double click on .htm / .html files open a viewer;
Claus Gittinger <cg@exept.de>
parents:
585
diff
changeset
|
2809 |
self fileGet:false |
4630175ed31e
double click on .htm / .html files open a viewer;
Claus Gittinger <cg@exept.de>
parents:
585
diff
changeset
|
2810 |
|
4630175ed31e
double click on .htm / .html files open a viewer;
Claus Gittinger <cg@exept.de>
parents:
585
diff
changeset
|
2811 |
"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
|
2812 |
! |
4630175ed31e
double click on .htm / .html files open a viewer;
Claus Gittinger <cg@exept.de>
parents:
585
diff
changeset
|
2813 |
|
4630175ed31e
double click on .htm / .html files open a viewer;
Claus Gittinger <cg@exept.de>
parents:
585
diff
changeset
|
2814 |
fileGet:viaDoubleClick |
4630175ed31e
double click on .htm / .html files open a viewer;
Claus Gittinger <cg@exept.de>
parents:
585
diff
changeset
|
2815 |
"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
|
2816 |
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
|
2817 |
otherwise get it immediately" |
4630175ed31e
double click on .htm / .html files open a viewer;
Claus Gittinger <cg@exept.de>
parents:
585
diff
changeset
|
2818 |
|
172 | 2819 |
|fileName msg label| |
2820 |
||
1110
9ec4692e9cda
dont decode string, if the encoding is already iso8859
Claus Gittinger <cg@exept.de>
parents:
1104
diff
changeset
|
2821 |
(subView modified not or:[subView contentsWasSaved]) ifTrue:[ |
3252 | 2822 |
self doFileGet:viaDoubleClick. |
2823 |
^ self |
|
1110
9ec4692e9cda
dont decode string, if the encoding is already iso8859
Claus Gittinger <cg@exept.de>
parents:
1104
diff
changeset
|
2824 |
]. |
172 | 2825 |
fileName := self getSelectedFileName. |
2826 |
fileName notNil ifTrue:[ |
|
3252 | 2827 |
(currentDirectory filenameFor:fileName) isDirectory ifTrue:[ |
2828 |
msg := 'Contents has not been saved.\\Modifications will be lost when directory is changed.'. |
|
2829 |
label := 'Change'. |
|
2830 |
] ifFalse:[ |
|
2831 |
msg := 'Contents has not been saved.\\Modifications will be lost when new file is read.'. |
|
2832 |
label := 'Get'. |
|
2833 |
]. |
|
2834 |
(self ask:(resources at:msg) yesButton:label) ifTrue:[ |
|
2835 |
subView modified:false. |
|
2836 |
self doFileGet:viaDoubleClick |
|
2837 |
] |
|
172 | 2838 |
] |
633
4630175ed31e
double click on .htm / .html files open a viewer;
Claus Gittinger <cg@exept.de>
parents:
585
diff
changeset
|
2839 |
|
4630175ed31e
double click on .htm / .html files open a viewer;
Claus Gittinger <cg@exept.de>
parents:
585
diff
changeset
|
2840 |
"Created: 19.6.1996 / 09:38:35 / cg" |
1162 | 2841 |
"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
|
2842 |
"Modified: 18.9.1997 / 16:27:34 / stefan" |
172 | 2843 |
! |
2844 |
||
2845 |
fileGetInfo |
|
2846 |
"show short file (stat)-info" |
|
2847 |
||
2848 |
self fileGetInfo:false |
|
2849 |
! |
|
2850 |
||
2851 |
fileGetInfo:longInfo |
|
2852 |
"get info on selected file - show it in a box" |
|
2853 |
||
1672
9df905f8bfa3
update fileInfo while showing infoBox
Claus Gittinger <cg@exept.de>
parents:
1628
diff
changeset
|
2854 |
|string box updater| |
172 | 2855 |
|
2856 |
string := self getFileInfoString:longInfo. |
|
2857 |
string notNil ifTrue:[ |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2858 |
box := InfoBox title:string. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2859 |
updater := [ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2860 |
[true] whileTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2861 |
Delay waitForSeconds:2. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2862 |
string := self getFileInfoString:longInfo. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2863 |
box title:string |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2864 |
] |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2865 |
] fork. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2866 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2867 |
box showAtPointer. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2868 |
updater terminate. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2869 |
box destroy |
172 | 2870 |
] |
2871 |
! |
|
2872 |
||
2873 |
fileGetLongInfo |
|
2874 |
"show long stat (file)-info" |
|
2875 |
||
2876 |
self fileGetInfo:true |
|
2877 |
! |
|
2878 |
||
1874 | 2879 |
fileHexDump |
2880 |
"show a hex dump (similar to od -x) |
|
2881 |
Only needed with non-Unix systems." |
|
2882 |
||
3252 | 2883 |
(self askIfModified:'Contents has not been saved.\\Modifications will be lost when hex dump is shown.' |
2884 |
yesButton:'HexDump') ifFalse:[^ self]. |
|
2885 |
||
1874 | 2886 |
self withReadCursorDo:[ |
2666 | 2887 |
|fileName f stream data offs |
2701
78171ebe64f5
less memory need for hexDump
Claus Gittinger <cg@exept.de>
parents:
2688
diff
changeset
|
2888 |
addrDigits col line lineStream asciiLineStream lines| |
2666 | 2889 |
|
2890 |
fileName := self getSelectedFileName. |
|
2891 |
fileName notNil ifTrue:[ |
|
2892 |
f := currentDirectory construct:fileName. |
|
2893 |
f isDirectory ifTrue:[ |
|
2894 |
^ self warn:(resources string:'%1 is a directory.' with:fileName). |
|
2895 |
]. |
|
2896 |
f exists ifFalse:[ |
|
3528 | 2897 |
Dialog warn:(resources string:'oops, ''%1'' is gone or unreadable.' with:fileName). |
2666 | 2898 |
^ self |
2899 |
]. |
|
2900 |
f isReadable ifFalse:[ |
|
3528 | 2901 |
Dialog warn:(resources string:'''%1'' is unreadable.' with:fileName). |
2666 | 2902 |
^ self |
2903 |
]. |
|
2904 |
f fileSize > (512*1024) ifTrue:[ |
|
2905 |
(self confirm:'Warning: the file is big (', (f fileSize//1024) printString , 'Kb). Show anyway ?') |
|
2906 |
ifFalse:[ |
|
2907 |
^ self |
|
2908 |
] |
|
2909 |
]. |
|
2910 |
stream := f readStream binary. |
|
2911 |
data := stream contents. |
|
2912 |
stream close. |
|
2913 |
||
2914 |
subView list:nil. |
|
2915 |
col := 1. |
|
2916 |
offs := 0. |
|
2917 |
lines := StringCollection new. |
|
2918 |
||
2919 |
addrDigits := ((f fileSize + 1) log:16) truncated + 1. |
|
2920 |
||
2701
78171ebe64f5
less memory need for hexDump
Claus Gittinger <cg@exept.de>
parents:
2688
diff
changeset
|
2921 |
lineStream := '' writeStream. |
78171ebe64f5
less memory need for hexDump
Claus Gittinger <cg@exept.de>
parents:
2688
diff
changeset
|
2922 |
asciiLineStream := '' writeStream. |
78171ebe64f5
less memory need for hexDump
Claus Gittinger <cg@exept.de>
parents:
2688
diff
changeset
|
2923 |
|
78171ebe64f5
less memory need for hexDump
Claus Gittinger <cg@exept.de>
parents:
2688
diff
changeset
|
2924 |
lineStream nextPutAll:(offs hexPrintString:addrDigits). |
78171ebe64f5
less memory need for hexDump
Claus Gittinger <cg@exept.de>
parents:
2688
diff
changeset
|
2925 |
lineStream nextPutAll:': '. |
2666 | 2926 |
|
2927 |
data do:[:byte | |
|
2701
78171ebe64f5
less memory need for hexDump
Claus Gittinger <cg@exept.de>
parents:
2688
diff
changeset
|
2928 |
lineStream nextPutAll:(byte hexPrintString:2). |
2666 | 2929 |
(byte between:32 and:127) ifTrue:[ |
2701
78171ebe64f5
less memory need for hexDump
Claus Gittinger <cg@exept.de>
parents:
2688
diff
changeset
|
2930 |
asciiLineStream nextPut:(Character value:byte) |
2666 | 2931 |
] ifFalse:[ |
2701
78171ebe64f5
less memory need for hexDump
Claus Gittinger <cg@exept.de>
parents:
2688
diff
changeset
|
2932 |
asciiLineStream nextPut:$. |
2666 | 2933 |
]. |
2934 |
||
2935 |
offs := offs + 1. |
|
2936 |
col := col + 1. |
|
2937 |
col > 16 ifTrue:[ |
|
2701
78171ebe64f5
less memory need for hexDump
Claus Gittinger <cg@exept.de>
parents:
2688
diff
changeset
|
2938 |
lineStream nextPutAll:' '. |
78171ebe64f5
less memory need for hexDump
Claus Gittinger <cg@exept.de>
parents:
2688
diff
changeset
|
2939 |
lineStream nextPutAll:asciiLineStream contents. |
78171ebe64f5
less memory need for hexDump
Claus Gittinger <cg@exept.de>
parents:
2688
diff
changeset
|
2940 |
lines add:(lineStream contents). |
2666 | 2941 |
(offs bitAnd:16rFF) == 0 ifTrue:[ |
2942 |
lines add:nil |
|
2943 |
]. |
|
2701
78171ebe64f5
less memory need for hexDump
Claus Gittinger <cg@exept.de>
parents:
2688
diff
changeset
|
2944 |
lineStream reset. |
78171ebe64f5
less memory need for hexDump
Claus Gittinger <cg@exept.de>
parents:
2688
diff
changeset
|
2945 |
asciiLineStream reset. |
78171ebe64f5
less memory need for hexDump
Claus Gittinger <cg@exept.de>
parents:
2688
diff
changeset
|
2946 |
|
78171ebe64f5
less memory need for hexDump
Claus Gittinger <cg@exept.de>
parents:
2688
diff
changeset
|
2947 |
lineStream nextPutAll:(offs hexPrintString:addrDigits). |
78171ebe64f5
less memory need for hexDump
Claus Gittinger <cg@exept.de>
parents:
2688
diff
changeset
|
2948 |
lineStream nextPutAll:': '. |
2666 | 2949 |
col := 1. |
2950 |
] ifFalse:[ |
|
2701
78171ebe64f5
less memory need for hexDump
Claus Gittinger <cg@exept.de>
parents:
2688
diff
changeset
|
2951 |
lineStream space |
2666 | 2952 |
] |
2953 |
]. |
|
2701
78171ebe64f5
less memory need for hexDump
Claus Gittinger <cg@exept.de>
parents:
2688
diff
changeset
|
2954 |
line := lineStream contents paddedTo:(3*16 + addrDigits + 1). |
78171ebe64f5
less memory need for hexDump
Claus Gittinger <cg@exept.de>
parents:
2688
diff
changeset
|
2955 |
lines add:(line , ' ' , asciiLineStream contents). |
2666 | 2956 |
self show:lines. |
2957 |
] |
|
1874 | 2958 |
] |
2959 |
||
2960 |
"Modified: / 7.9.1998 / 15:37:47 / cg" |
|
2961 |
! |
|
2962 |
||
172 | 2963 |
fileInsert |
1162 | 2964 |
"insert contents of file at the cursor position" |
172 | 2965 |
|
2966 |
|fileName| |
|
2967 |
||
2968 |
fileName := self getSelectedFileName. |
|
2969 |
fileName notNil ifTrue:[ |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2970 |
self showFile:fileName insert:true encoding:fileEncoding |
172 | 2971 |
] |
386
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
2972 |
|
1162 | 2973 |
"Modified: 23.4.1997 / 13:06:06 / cg" |
172 | 2974 |
! |
2975 |
||
2976 |
fileListMenu |
|
2977 |
"return the menu to show in the fileList" |
|
2978 |
||
1235
13610578a5d2
resource flag: #menu -> #programMenu
Claus Gittinger <cg@exept.de>
parents:
1227
diff
changeset
|
2979 |
<resource: #programMenu> |
1040 | 2980 |
|
3330 | 2981 |
|spec| |
1834 | 2982 |
|
3002 | 2983 |
self sensor ctrlDown ifTrue:[ |
3330 | 2984 |
spec := self class toolsMenuSpec. |
3002 | 2985 |
] ifFalse:[ |
3330 | 2986 |
spec := self class menuPopUp. |
2987 |
]. |
|
2988 |
^ self menuFromSpec:spec. |
|
2989 |
"/ |m| |
|
2990 |
"/ |
|
2991 |
"/ self sensor ctrlDown ifTrue:[ |
|
2992 |
"/ m := self class toolsMenuSpec. |
|
2993 |
"/ ] ifFalse:[ |
|
2994 |
"/ m := self class menuPopUp. |
|
2995 |
"/ ]. |
|
2996 |
"/ m := m decodeAsLiteralArray. |
|
2997 |
"/ m receiver:self. |
|
2998 |
"/ m findGuiResourcesIn:self. |
|
2999 |
"/ ^ m. |
|
1834 | 3000 |
|
3001 |
"Modified: / 14.8.1998 / 14:09:12 / cg" |
|
3002 |
! |
|
3003 |
||
3004 |
fileListMenu_old |
|
3005 |
"return the menu to show in the fileList" |
|
3006 |
||
3007 |
<resource: #programMenu> |
|
3008 |
||
3527 | 3009 |
|items m sel ns| |
1736
36cab4d1d655
remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents:
1735
diff
changeset
|
3010 |
|
36cab4d1d655
remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents:
1735
diff
changeset
|
3011 |
items := #( |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3012 |
('spawn' fileSpawn ) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3013 |
('-' nil ) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3014 |
('get contents' fileGet GotoLine) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3015 |
('insert contents' fileInsert ) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3016 |
('show info' fileGetInfo InspectIt) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3017 |
('show full info' fileGetLongInfo CmdI) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3018 |
). |
1193
568b858d94ce
show current namespace in menus fileIn item
Claus Gittinger <cg@exept.de>
parents:
1189
diff
changeset
|
3019 |
|
568b858d94ce
show current namespace in menus fileIn item
Claus Gittinger <cg@exept.de>
parents:
1189
diff
changeset
|
3020 |
((ns := Project current defaultNameSpace) notNil |
568b858d94ce
show current namespace in menus fileIn item
Claus Gittinger <cg@exept.de>
parents:
1189
diff
changeset
|
3021 |
and:[ns ~~ Smalltalk]) ifTrue:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3022 |
items := items copyWith:(Array |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3023 |
with:(resources string:'fileIn (into ''%1'')' with:(Project current defaultNameSpace name)) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3024 |
with:#fileFileIn |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3025 |
with:#Accept) |
1736
36cab4d1d655
remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents:
1735
diff
changeset
|
3026 |
|
1193
568b858d94ce
show current namespace in menus fileIn item
Claus Gittinger <cg@exept.de>
parents:
1189
diff
changeset
|
3027 |
] ifFalse:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3028 |
items := items copyWith:#( 'fileIn' #fileFileIn #Accept) |
1193
568b858d94ce
show current namespace in menus fileIn item
Claus Gittinger <cg@exept.de>
parents:
1189
diff
changeset
|
3029 |
]. |
568b858d94ce
show current namespace in menus fileIn item
Claus Gittinger <cg@exept.de>
parents:
1189
diff
changeset
|
3030 |
|
1736
36cab4d1d655
remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents:
1735
diff
changeset
|
3031 |
items := items , #( |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3032 |
('-' ) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3033 |
('update' updateCurrentDirectory Cmdu) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3034 |
('-' ) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3035 |
('execute unix command ...' fileExecute DoIt) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3036 |
('st/x tools' stxTools ) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3037 |
('-' ) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3038 |
('remove' fileRemove Delete) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3039 |
('rename ...' fileRename ) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3040 |
('-' ) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3041 |
('display long list' changeDisplayMode ) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3042 |
('show all files' changeDotFileVisibility ) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3043 |
('encoding ...' fileEncoding ) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3044 |
('-' ) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3045 |
('create directory ...' newDirectory CmdD) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3046 |
('create file ...' newFile CmdF) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3047 |
). |
172 | 3048 |
|
3049 |
m := PopUpMenu |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3050 |
itemList:items |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3051 |
resources:resources. |
172 | 3052 |
|
1834 | 3053 |
showingHiddenFiles value "showDotFiles" ifTrue:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3054 |
m labelAt:#changeDotFileVisibility put:(resources string:'hide hidden files') |
172 | 3055 |
]. |
1834 | 3056 |
showingDetails value "showLongList" ifTrue:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3057 |
m labelAt:#changeDisplayMode put:(resources string:'display short list') |
172 | 3058 |
]. |
3059 |
||
1736
36cab4d1d655
remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents:
1735
diff
changeset
|
3060 |
items := #( |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3061 |
('Changes browser' openChangesBrowser ) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3062 |
('Editor' openEditor ) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3063 |
('HTML reader' openHTMLReader ) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3064 |
('Image inspect' openImageInspector ) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3065 |
('show file differences' openDiffView ) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3066 |
). |
1286
2a464093d865
added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents:
1272
diff
changeset
|
3067 |
|
1751 | 3068 |
OperatingSystem isUNIXlike ifTrue:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3069 |
items := items , #( ('terminal' openTerminal )). |
1751 | 3070 |
]. |
3071 |
||
1286
2a464093d865
added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents:
1272
diff
changeset
|
3072 |
JavaInterpreter notNil ifTrue:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3073 |
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
|
3074 |
]. |
2a464093d865
added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents:
1272
diff
changeset
|
3075 |
|
2a464093d865
added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents:
1272
diff
changeset
|
3076 |
m subMenuAt:#stxTools |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3077 |
put:(PopUpMenu |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3078 |
itemList:items |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3079 |
resources:resources). |
1736
36cab4d1d655
remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents:
1735
diff
changeset
|
3080 |
|
36cab4d1d655
remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents:
1735
diff
changeset
|
3081 |
((sel := fileListView selection) isNil |
36cab4d1d655
remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents:
1735
diff
changeset
|
3082 |
or:[sel isEmpty]) ifTrue:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3083 |
m disableAll:#(fileGet fileInsert |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3084 |
fileGetInfo fileGetLongInfo |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3085 |
fileFileIn fileFileInLazy |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3086 |
fileRemove fileRename). |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3087 |
(m subMenuAt:#stxTools) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3088 |
disableAll:#(openChangesBrowser openEditor openHTMLReader openImageInspector) |
865
48395e8ecca9
remember executeCommand actions in history as well.
Claus Gittinger <cg@exept.de>
parents:
851
diff
changeset
|
3089 |
] ifFalse:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3090 |
fileListView selection size > 1 ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3091 |
m disableAll:#( fileGet fileInsert fileGetInfo fileGetLongInfo fileRename ) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3092 |
] |
172 | 3093 |
]. |
3094 |
||
3095 |
^m |
|
252 | 3096 |
|
1396 | 3097 |
"Modified: / 16.1.1998 / 16:42:59 / stefan" |
1834 | 3098 |
"Modified: / 4.8.1998 / 13:45:56 / cg" |
3099 |
"Created: / 13.8.1998 / 20:51:38 / cg" |
|
172 | 3100 |
! |
3101 |
||
3102 |
filePrint |
|
1162 | 3103 |
"send a files contents to the printer (not in the menu)" |
3104 |
||
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
3105 |
|fileName path inStream printStream line| |
172 | 3106 |
|
294 | 3107 |
self withWaitCursorDo:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3108 |
fileName := self getSelectedFileName. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3109 |
fileName notNil ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3110 |
path := currentDirectory filenameFor:fileName. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3111 |
(path type == #regular) ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3112 |
inStream := path readStream. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3113 |
inStream isNil ifFalse:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3114 |
printStream := PrinterStream new. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3115 |
printStream notNil ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3116 |
[inStream atEnd] whileFalse:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3117 |
line := inStream nextLine. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3118 |
printStream nextPutLine:line. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3119 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3120 |
printStream close |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3121 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3122 |
inStream close |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3123 |
] |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3124 |
] |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3125 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3126 |
0 "compiler hint" |
172 | 3127 |
] |
294 | 3128 |
|
1162 | 3129 |
"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
|
3130 |
"Modified: 18.9.1997 / 16:29:17 / stefan" |
172 | 3131 |
! |
3132 |
||
3133 |
fileRemove |
|
3134 |
"remove the selected file(s). |
|
3281 | 3135 |
Query if user really wants to remove the file, except if |
3136 |
shift-key is pressed. |
|
3137 |
TODO: Should be enhanced, to look for a ~/.trash directory |
|
3138 |
and move files there if it exists (without asking in this case)." |
|
3139 |
||
3140 |
|sel| |
|
172 | 3141 |
|
2094 | 3142 |
sel := fileListView selection. |
3143 |
sel size > 0 ifTrue:[ |
|
2868 | 3144 |
sel := sel collect:[:rawIndex | fileList at:rawIndex]. |
3281 | 3145 |
"/ do not ask, if shift is pressed |
3146 |
self sensor shiftDown ifTrue:[ |
|
3147 |
self doRemove:sel |
|
2868 | 3148 |
] ifFalse:[ |
3281 | 3149 |
self confirmAndRemove:sel |
2868 | 3150 |
]. |
3281 | 3151 |
] |
3152 |
! |
|
3153 |
||
3154 |
fileRemove:fileNames |
|
3155 |
"remove fileNames. |
|
3156 |
Query if user really wants to remove the file, except if |
|
3157 |
shift-key is pressed. |
|
3158 |
TODO: Should be enhanced, to look for a ~/.trash directory |
|
3159 |
and move files there if it exists (without asking in this case)." |
|
3160 |
||
3161 |
|q doRemove| |
|
3162 |
||
3163 |
"/ do not ask, if shift is pressed |
|
3164 |
doRemove := self sensor shiftDown. |
|
3165 |
doRemove ifFalse:[ |
|
3166 |
fileNames size > 1 ifTrue:[ |
|
3167 |
q := resources string:'Remove %1 selected files ?' with:(fileNames size). |
|
3168 |
doRemove := Dialog |
|
3169 |
confirmWithCancel:q |
|
3170 |
labels:(resources array:#('Remove' 'Confirm Each' 'Cancel')) |
|
3171 |
values:#(true #confirm false) |
|
3172 |
default:true. |
|
3173 |
doRemove == #confirm ifTrue:[ |
|
3527 | 3174 |
self halt:'Confirm each not yet implemented'. |
3281 | 3175 |
]. |
3176 |
] ifFalse:[ |
|
3177 |
q := resources string:'Remove ''%1'' ?' with:(fileNames first allBold). |
|
3178 |
doRemove := self ask:q yesButton:'Remove'. |
|
3179 |
]. |
|
3180 |
]. |
|
3181 |
||
3182 |
doRemove ifTrue:[ |
|
3183 |
self withWaitCursorDo:[ |
|
3184 |
self doRemove:fileNames |
|
2868 | 3185 |
] |
172 | 3186 |
] |
3187 |
! |
|
3188 |
||
3189 |
fileRename |
|
3190 |
"rename the selected file(s)" |
|
3191 |
||
3565 | 3192 |
|queryBox b lastNewName lastOldName initialText| |
172 | 3193 |
|
3194 |
queryBox := FilenameEnterBox new. |
|
3280 | 3195 |
queryBox okText:(resources at:'Rename'). |
3059
ced4d5b13ad2
cancelAll if renaming multiple files
Claus Gittinger <cg@exept.de>
parents:
3045
diff
changeset
|
3196 |
fileListView selection size > 1 ifTrue:[ |
3697
e2f7d8dec6e2
menu items/button labels uppercase-first
Claus Gittinger <cg@exept.de>
parents:
3691
diff
changeset
|
3197 |
b := queryBox addAbortButtonLabelled:(resources at:'Cancel All'). |
3059
ced4d5b13ad2
cancelAll if renaming multiple files
Claus Gittinger <cg@exept.de>
parents:
3045
diff
changeset
|
3198 |
b action:[^ self ]. |
ced4d5b13ad2
cancelAll if renaming multiple files
Claus Gittinger <cg@exept.de>
parents:
3045
diff
changeset
|
3199 |
]. |
ced4d5b13ad2
cancelAll if renaming multiple files
Claus Gittinger <cg@exept.de>
parents:
3045
diff
changeset
|
3200 |
|
172 | 3201 |
self selectedFilesDo:[:oldName | |
3280 | 3202 |
queryBox title:(resources string:'Rename ''%1'' to:' with:oldName). |
3066
7daebd50006e
intelligent default in rename
Claus Gittinger <cg@exept.de>
parents:
3061
diff
changeset
|
3203 |
initialText := oldName. |
7daebd50006e
intelligent default in rename
Claus Gittinger <cg@exept.de>
parents:
3061
diff
changeset
|
3204 |
|
3556 | 3205 |
lastNewName notNil ifTrue:[ |
3059
ced4d5b13ad2
cancelAll if renaming multiple files
Claus Gittinger <cg@exept.de>
parents:
3045
diff
changeset
|
3206 |
"/ intelligent default ... |
3565 | 3207 |
initialText := self goodRenameDefaultFor:oldName lastOld:lastOldName lastNew:lastNewName |
3059
ced4d5b13ad2
cancelAll if renaming multiple files
Claus Gittinger <cg@exept.de>
parents:
3045
diff
changeset
|
3208 |
]. |
3565 | 3209 |
queryBox initialText:(initialText ? oldName). |
3059
ced4d5b13ad2
cancelAll if renaming multiple files
Claus Gittinger <cg@exept.de>
parents:
3045
diff
changeset
|
3210 |
queryBox action:[:newName | |
3060 | 3211 |
fileListView removeFromSelection:(fileList indexOf:oldName). |
3059
ced4d5b13ad2
cancelAll if renaming multiple files
Claus Gittinger <cg@exept.de>
parents:
3045
diff
changeset
|
3212 |
self doRename:oldName to:newName. |
ced4d5b13ad2
cancelAll if renaming multiple files
Claus Gittinger <cg@exept.de>
parents:
3045
diff
changeset
|
3213 |
lastOldName := oldName. |
ced4d5b13ad2
cancelAll if renaming multiple files
Claus Gittinger <cg@exept.de>
parents:
3045
diff
changeset
|
3214 |
lastNewName := newName. |
ced4d5b13ad2
cancelAll if renaming multiple files
Claus Gittinger <cg@exept.de>
parents:
3045
diff
changeset
|
3215 |
]. |
ced4d5b13ad2
cancelAll if renaming multiple files
Claus Gittinger <cg@exept.de>
parents:
3045
diff
changeset
|
3216 |
|
ced4d5b13ad2
cancelAll if renaming multiple files
Claus Gittinger <cg@exept.de>
parents:
3045
diff
changeset
|
3217 |
queryBox showAtPointer |
172 | 3218 |
] |
3219 |
! |
|
3220 |
||
3221 |
fileSelect:lineNr |
|
3222 |
"selected a file - do nothing here" |
|
1162 | 3223 |
|
2094 | 3224 |
|fn| |
3225 |
||
2095 | 3226 |
imagePreviewView notNil ifTrue:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3227 |
self stopImageRenderProcess. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3228 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3229 |
fn := self getSelectedFileName. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3230 |
(Image isImageFileSuffix:(fn asFilename suffix)) ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3231 |
imageRenderProcess := [ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3232 |
self loadImageAndPerform:[:img | |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3233 |
imagePreviewView beVisible. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3234 |
imagePreviewView image:img |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3235 |
] |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3236 |
] forkAt:(Processor activePriority - 1). |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3237 |
] ifFalse:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3238 |
imagePreviewView beInvisible |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3239 |
]. |
2095 | 3240 |
] |
1162 | 3241 |
|
3242 |
"Modified: 23.4.1997 / 13:04:55 / cg" |
|
172 | 3243 |
! |
3244 |
||
3245 |
fileSpawn |
|
3246 |
"start another FileBrowser on the selected directory or |
|
3247 |
on the same directory if none is selected." |
|
3248 |
||
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
3249 |
|any path| |
172 | 3250 |
|
3251 |
any := false. |
|
3252 |
self selectedFilesDo:[:fileName | |
|
3025 | 3253 |
path := currentDirectory filenameFor:fileName. |
3254 |
path isDirectory ifTrue:[ |
|
3255 |
self class openOn:(path pathName). |
|
3256 |
any := true |
|
3257 |
] |
|
172 | 3258 |
]. |
3259 |
any ifFalse:[ |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3260 |
"/ access by name, to get most up-to-date version |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3261 |
"/ (if changed in the browser, and the running one is old) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3262 |
(Smalltalk at:(self class name)) |
3747
d30bc1e54f15
Remove unused vars and asFilename sends
Stefan Vogel <sv@exept.de>
parents:
3746
diff
changeset
|
3263 |
openOn:currentDirectory withExtent:self topView extent |
172 | 3264 |
] |
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
3265 |
|
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
3266 |
"Modified: 18.9.1997 / 16:32:39 / stefan" |
172 | 3267 |
! |
3268 |
||
3565 | 3269 |
goodRenameDefaultFor:oldName lastOld:lastOldName lastNew:lastNewName |
3636 | 3270 |
|prefix suffix lastNewSize lastOldSize t |
3635 | 3271 |
lastOldWOSuffix lastNewWOSuffix oldWOSuffix lastOldRest oldRest lastNewRest |
3272 |
lastRemoved lastInserted| |
|
3565 | 3273 |
|
3274 |
lastNewName isNil ifTrue:[ ^ nil]. |
|
3275 |
||
3276 |
lastNewSize := lastNewName size. |
|
3277 |
lastOldSize := lastOldName size. |
|
3278 |
||
3279 |
"/ intelligent default ... |
|
3280 |
(lastNewName endsWith:lastOldName) ifTrue:[ |
|
3281 |
prefix := lastNewName copyTo:(lastNewSize - lastOldSize). |
|
3282 |
^ (prefix , oldName). |
|
3283 |
]. |
|
3284 |
(lastOldName endsWith:lastNewName) ifTrue:[ |
|
3285 |
prefix := lastOldName copyTo:(lastOldSize - lastNewSize). |
|
3286 |
^ (oldName copyFrom:prefix size+1). |
|
3287 |
]. |
|
3288 |
(lastOldName withoutSeparators = lastNewName) ifTrue:[ |
|
3289 |
"/ intelligent default ... |
|
3290 |
^ oldName withoutSeparators. |
|
3291 |
]. |
|
3292 |
(lastNewName startsWith:lastOldName) ifTrue:[ |
|
3293 |
"/ intelligent default ... |
|
3294 |
suffix := lastNewName copyLast:(lastNewSize - lastOldSize). |
|
3295 |
^ (oldName , suffix). |
|
3296 |
]. |
|
3297 |
(lastOldName startsWith:lastNewName) ifTrue:[ |
|
3298 |
suffix := lastOldName copyLast:(lastOldSize - lastNewSize). |
|
3299 |
(oldName endsWith:suffix) ifTrue:[ |
|
3300 |
^ (oldName copyWithoutLast:suffix size). |
|
3301 |
] |
|
3302 |
]. |
|
3303 |
||
3304 |
lastOldWOSuffix := lastOldName asFilename withoutSuffix name. |
|
3305 |
lastNewWOSuffix := lastNewName asFilename withoutSuffix name. |
|
3306 |
oldWOSuffix := oldName asFilename withoutSuffix name. |
|
3307 |
||
3636 | 3308 |
prefix := lastOldWOSuffix commonPrefixWith:oldWOSuffix. |
3565 | 3309 |
(lastNewWOSuffix startsWith:prefix) ifTrue:[ |
3310 |
lastOldRest := lastOldWOSuffix copyFrom:prefix size + 1. |
|
3311 |
lastNewRest := lastNewWOSuffix copyFrom:prefix size + 1. |
|
3312 |
oldRest := oldWOSuffix copyFrom:prefix size + 1. |
|
3313 |
||
3314 |
(lastNewRest endsWith:lastOldRest) ifTrue:[ |
|
3315 |
t := lastNewRest copyWithoutLast:lastOldRest size. |
|
3316 |
^ ((prefix , t , oldRest) asFilename withSuffix:oldName asFilename suffix) name |
|
3317 |
]. |
|
3318 |
]. |
|
3319 |
||
3636 | 3320 |
suffix := lastOldWOSuffix commonSuffixWith:lastNewWOSuffix. |
3635 | 3321 |
suffix size > 0 ifTrue:[ |
3322 |
"/ last change changed something at the beginning |
|
3636 | 3323 |
prefix := oldWOSuffix commonPrefixWith:lastOldWOSuffix. |
3635 | 3324 |
prefix size > 0 ifTrue:[ |
3325 |
"/ this name starts with the same characters |
|
3326 |
lastRemoved := lastOldWOSuffix copyWithoutLast:suffix size. |
|
3327 |
lastInserted := lastNewWOSuffix copyWithoutLast:suffix size. |
|
3328 |
^ lastInserted , (oldName copyFrom:lastRemoved size + 1) |
|
3329 |
]. |
|
3330 |
]. |
|
3331 |
||
3565 | 3332 |
^ nil |
3333 |
! |
|
3334 |
||
3536 | 3335 |
hasSlideShow |
3336 |
^ [CodingExamples_GUI::SlideShow notNil] |
|
3337 |
||
3338 |
"Created: / 29.12.2001 / 21:58:47 / cg" |
|
3339 |
"Modified: / 29.12.2001 / 21:59:01 / cg" |
|
3340 |
! |
|
3341 |
||
3765
8309f42ebf29
+ installAllAsAutoloaded function
Claus Gittinger <cg@exept.de>
parents:
3762
diff
changeset
|
3342 |
installAllAsAutoloaded |
8309f42ebf29
+ installAllAsAutoloaded function
Claus Gittinger <cg@exept.de>
parents:
3762
diff
changeset
|
3343 |
"install all classes found here as autoloaded classes" |
8309f42ebf29
+ installAllAsAutoloaded function
Claus Gittinger <cg@exept.de>
parents:
3762
diff
changeset
|
3344 |
|
8309f42ebf29
+ installAllAsAutoloaded function
Claus Gittinger <cg@exept.de>
parents:
3762
diff
changeset
|
3345 |
currentDirectory directoryContentsDo:[:fileNameString | |
8309f42ebf29
+ installAllAsAutoloaded function
Claus Gittinger <cg@exept.de>
parents:
3762
diff
changeset
|
3346 |
|fn| |
8309f42ebf29
+ installAllAsAutoloaded function
Claus Gittinger <cg@exept.de>
parents:
3762
diff
changeset
|
3347 |
|
8309f42ebf29
+ installAllAsAutoloaded function
Claus Gittinger <cg@exept.de>
parents:
3762
diff
changeset
|
3348 |
fn := (currentDirectory construct:fileNameString). |
8309f42ebf29
+ installAllAsAutoloaded function
Claus Gittinger <cg@exept.de>
parents:
3762
diff
changeset
|
3349 |
(fn hasSuffix:'st') ifTrue:[ |
8309f42ebf29
+ installAllAsAutoloaded function
Claus Gittinger <cg@exept.de>
parents:
3762
diff
changeset
|
3350 |
self installAsAutoloaded:fn |
8309f42ebf29
+ installAllAsAutoloaded function
Claus Gittinger <cg@exept.de>
parents:
3762
diff
changeset
|
3351 |
] |
8309f42ebf29
+ installAllAsAutoloaded function
Claus Gittinger <cg@exept.de>
parents:
3762
diff
changeset
|
3352 |
]. |
8309f42ebf29
+ installAllAsAutoloaded function
Claus Gittinger <cg@exept.de>
parents:
3762
diff
changeset
|
3353 |
! |
8309f42ebf29
+ installAllAsAutoloaded function
Claus Gittinger <cg@exept.de>
parents:
3762
diff
changeset
|
3354 |
|
8309f42ebf29
+ installAllAsAutoloaded function
Claus Gittinger <cg@exept.de>
parents:
3762
diff
changeset
|
3355 |
installAsAutoloaded:aFilename |
8309f42ebf29
+ installAllAsAutoloaded function
Claus Gittinger <cg@exept.de>
parents:
3762
diff
changeset
|
3356 |
"install aFilename as autoloaded class" |
8309f42ebf29
+ installAllAsAutoloaded function
Claus Gittinger <cg@exept.de>
parents:
3762
diff
changeset
|
3357 |
|
8309f42ebf29
+ installAllAsAutoloaded function
Claus Gittinger <cg@exept.de>
parents:
3762
diff
changeset
|
3358 |
|chunks s| |
8309f42ebf29
+ installAllAsAutoloaded function
Claus Gittinger <cg@exept.de>
parents:
3762
diff
changeset
|
3359 |
|
8309f42ebf29
+ installAllAsAutoloaded function
Claus Gittinger <cg@exept.de>
parents:
3762
diff
changeset
|
3360 |
chunks := ChangeSet fromStream:(s := aFilename asFilename readStream). s close. |
8309f42ebf29
+ installAllAsAutoloaded function
Claus Gittinger <cg@exept.de>
parents:
3762
diff
changeset
|
3361 |
chunks |
8309f42ebf29
+ installAllAsAutoloaded function
Claus Gittinger <cg@exept.de>
parents:
3762
diff
changeset
|
3362 |
select:[:eachChunk | eachChunk isClassDefinitionChange] |
8309f42ebf29
+ installAllAsAutoloaded function
Claus Gittinger <cg@exept.de>
parents:
3762
diff
changeset
|
3363 |
thenDo:[:eachClassChunk | eachClassChunk installAsAutoloadedClassIfNotPrivate]. |
8309f42ebf29
+ installAllAsAutoloaded function
Claus Gittinger <cg@exept.de>
parents:
3762
diff
changeset
|
3364 |
! |
8309f42ebf29
+ installAllAsAutoloaded function
Claus Gittinger <cg@exept.de>
parents:
3762
diff
changeset
|
3365 |
|
1964 | 3366 |
loadImageAndPerform:aSelectorOrBlock |
1853 | 3367 |
|img path| |
3368 |
||
3369 |
self selectedFilesDo:[:fileName | |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3370 |
path := currentDirectory filenameFor:fileName. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3371 |
path isDirectory ifFalse:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3372 |
img := Image fromFile:(path pathName). |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3373 |
img notNil ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3374 |
aSelectorOrBlock isSymbol ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3375 |
img perform:aSelectorOrBlock |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3376 |
] ifFalse:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3377 |
aSelectorOrBlock value:img |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3378 |
] |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3379 |
] ifFalse:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3380 |
self warn:'unknown format: ' , fileName |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3381 |
] |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3382 |
] |
1853 | 3383 |
]. |
3384 |
||
3385 |
"Modified: / 17.9.1995 / 17:41:24 / claus" |
|
3386 |
"Modified: / 18.9.1997 / 17:05:04 / stefan" |
|
3387 |
"Created: / 26.8.1998 / 16:20:18 / cg" |
|
3388 |
! |
|
3389 |
||
172 | 3390 |
newDirectory |
3391 |
"ask for and create a new directory" |
|
3392 |
||
3393 |
|queryBox| |
|
3394 |
||
3395 |
queryBox := FilenameEnterBox |
|
3280 | 3396 |
title:(resources at:'Create new directory:') withCRs |
3397 |
okText:(resources at:'Create') |
|
3398 |
action:[:newName | self doCreateDirectory:newName]. |
|
172 | 3399 |
queryBox showAtPointer |
1162 | 3400 |
|
3401 |
"Modified: 23.4.1997 / 13:04:27 / cg" |
|
172 | 3402 |
! |
3403 |
||
3404 |
newFile |
|
3405 |
"ask for and create a new file" |
|
3406 |
||
3407 |
|sel queryBox| |
|
3408 |
||
3409 |
queryBox := FilenameEnterBox |
|
3280 | 3410 |
title:(resources at:'Create new file:') withCRs |
3411 |
okText:(resources at:'Create') |
|
2512
35d2092df60f
autoselect a new created file
Claus Gittinger <cg@exept.de>
parents:
2504
diff
changeset
|
3412 |
action:[:newName | newName isEmpty ifFalse:[ |
35d2092df60f
autoselect a new created file
Claus Gittinger <cg@exept.de>
parents:
2504
diff
changeset
|
3413 |
self doCreateFile:newName. |
35d2092df60f
autoselect a new created file
Claus Gittinger <cg@exept.de>
parents:
2504
diff
changeset
|
3414 |
self selectFile:newName. |
35d2092df60f
autoselect a new created file
Claus Gittinger <cg@exept.de>
parents:
2504
diff
changeset
|
3415 |
] |
35d2092df60f
autoselect a new created file
Claus Gittinger <cg@exept.de>
parents:
2504
diff
changeset
|
3416 |
]. |
172 | 3417 |
sel := subView selection. |
3418 |
sel notNil ifTrue:[ |
|
2512
35d2092df60f
autoselect a new created file
Claus Gittinger <cg@exept.de>
parents:
2504
diff
changeset
|
3419 |
queryBox initialText:(sel asString) |
172 | 3420 |
]. |
3421 |
queryBox showAtPointer |
|
381 | 3422 |
|
1396 | 3423 |
"Modified: / 23.4.1997 / 13:04:38 / cg" |
3424 |
"Modified: / 16.1.1998 / 16:54:00 / stefan" |
|
172 | 3425 |
! |
3426 |
||
1834 | 3427 |
newHardLink |
3428 |
"ask for and create a hard link (unix only)" |
|
3429 |
||
3747
d30bc1e54f15
Remove unused vars and asFilename sends
Stefan Vogel <sv@exept.de>
parents:
3746
diff
changeset
|
3430 |
|sel box orgName1 name1 name2 f1 f2 err if1 if2| |
1834 | 3431 |
|
3432 |
sel := self getSelectedFileName. |
|
3433 |
||
3434 |
orgName1 := ''. |
|
3435 |
(sel size > 0) ifTrue:[ |
|
2868 | 3436 |
(currentDirectory construct:sel) isDirectory ifFalse:[ |
3437 |
orgName1 := sel |
|
3438 |
] |
|
1834 | 3439 |
]. |
3440 |
||
3441 |
name1 := orgName1 asValue. |
|
3442 |
name2 := '' asValue. |
|
3443 |
||
3444 |
box := DialogBox new. |
|
2035
307ed5143d8b
national language stuff - again
Claus Gittinger <cg@exept.de>
parents:
2031
diff
changeset
|
3445 |
(box addTextLabel:(resources string:'Create hard link from:')) adjust:#left. |
3747
d30bc1e54f15
Remove unused vars and asFilename sends
Stefan Vogel <sv@exept.de>
parents:
3746
diff
changeset
|
3446 |
if1 := box addFilenameInputFieldOn:name1 in:currentDirectory tabable:true. |
2035
307ed5143d8b
national language stuff - again
Claus Gittinger <cg@exept.de>
parents:
2031
diff
changeset
|
3447 |
(box addTextLabel:(resources string:'to:')) adjust:#left. |
3747
d30bc1e54f15
Remove unused vars and asFilename sends
Stefan Vogel <sv@exept.de>
parents:
3746
diff
changeset
|
3448 |
if2 := box addFilenameInputFieldOn:name2 in:currentDirectory tabable:true. |
1834 | 3449 |
|
2048 | 3450 |
box addAbortAndOkButtons. |
1834 | 3451 |
|
3452 |
orgName1 size > 0 ifTrue:[ |
|
2868 | 3453 |
box focusOnField:if2. |
1834 | 3454 |
]. |
3455 |
box showAtPointer. |
|
3456 |
||
3457 |
box accepted ifTrue:[ |
|
2868 | 3458 |
name1 := name1 value. |
3459 |
(name1 size == 0) ifTrue:[ |
|
3460 |
err := 'no name entered'. |
|
3461 |
] ifFalse:[ |
|
3462 |
f1 := name1 asFilename. |
|
3463 |
name2 := name2 value. |
|
3464 |
(name2 size == 0) ifTrue:[ |
|
3465 |
err := 'no name entered'. |
|
3466 |
] ifFalse:[ |
|
3467 |
f2 := name2 asFilename. |
|
3468 |
f2 exists ifTrue:[ |
|
3469 |
err := '''%2'' already exists'. |
|
3470 |
] ifFalse:[ |
|
3471 |
f1 exists ifFalse:[ |
|
3472 |
err := '''%1'' does not exist'. |
|
3473 |
] ifTrue:[ |
|
3474 |
f1 isDirectory ifTrue:[ |
|
3475 |
err := '''%1'' is a directory'. |
|
3476 |
] ifFalse:[ |
|
3477 |
ErrorSignal handle:[:ex | |
|
3478 |
err := ex errorString |
|
3479 |
] do:[ |
|
3480 |
OperatingSystem createHardLinkFrom:name1 to:name2 |
|
3481 |
] |
|
3482 |
] |
|
3483 |
] |
|
3484 |
] |
|
3485 |
] |
|
3486 |
]. |
|
3487 |
||
3488 |
err notNil ifTrue:[ |
|
3489 |
self warn:(resources string:err with:(name1 ? '') allBold with:(name2 ? '') allBold). |
|
3490 |
^ self |
|
3491 |
]. |
|
1834 | 3492 |
]. |
3493 |
||
3494 |
"Modified: / 13.8.1998 / 21:47:01 / cg" |
|
3495 |
! |
|
3496 |
||
3497 |
newSoftLink |
|
3498 |
"ask for and create a soft link (unix only)" |
|
3499 |
||
3747
d30bc1e54f15
Remove unused vars and asFilename sends
Stefan Vogel <sv@exept.de>
parents:
3746
diff
changeset
|
3500 |
|sel box orgName1 name1 name2 f1 f2 err if1 if2| |
1834 | 3501 |
|
3502 |
sel := self getSelectedFileName. |
|
3503 |
||
3504 |
orgName1 := ''. |
|
3505 |
(sel size > 0) ifTrue:[ |
|
2868 | 3506 |
orgName1 := sel |
1834 | 3507 |
]. |
3508 |
||
3509 |
name1 := orgName1 asValue. |
|
3510 |
name2 := '' asValue. |
|
3511 |
||
3512 |
box := DialogBox new. |
|
3513 |
(box addTextLabel:'Create symbolic link to:') adjust:#left. |
|
3747
d30bc1e54f15
Remove unused vars and asFilename sends
Stefan Vogel <sv@exept.de>
parents:
3746
diff
changeset
|
3514 |
if1 := box addFilenameInputFieldOn:name1 in:currentDirectory tabable:true. |
1834 | 3515 |
(box addTextLabel:'as:') adjust:#left. |
3747
d30bc1e54f15
Remove unused vars and asFilename sends
Stefan Vogel <sv@exept.de>
parents:
3746
diff
changeset
|
3516 |
if2 := box addFilenameInputFieldOn:name2 in:currentDirectory tabable:true. |
1834 | 3517 |
|
2048 | 3518 |
box addAbortAndOkButtons. |
1834 | 3519 |
|
3520 |
orgName1 size > 0 ifTrue:[ |
|
2868 | 3521 |
box focusOnField:if2. |
1834 | 3522 |
]. |
3523 |
box showAtPointer. |
|
3524 |
||
3525 |
box accepted ifTrue:[ |
|
2868 | 3526 |
name1 := name1 value. |
3527 |
(name1 size == 0) ifTrue:[ |
|
3528 |
err := 'no name entered'. |
|
3529 |
] ifFalse:[ |
|
3530 |
f1 := name1 asFilename. |
|
3531 |
name2 := name2 value. |
|
3532 |
(name2 size == 0) ifTrue:[ |
|
3533 |
err := 'no name entered'. |
|
3534 |
] ifFalse:[ |
|
3535 |
f2 := name2 asFilename. |
|
3536 |
f2 exists ifTrue:[ |
|
3537 |
err := '''%2'' already exists'. |
|
3538 |
] ifFalse:[ |
|
3539 |
f1 exists ifFalse:[ |
|
3540 |
err := '''%1'' does not exist (link created anyway)'. |
|
3541 |
]. |
|
3542 |
ErrorSignal handle:[:ex | |
|
3543 |
err := ex errorString |
|
3544 |
] do:[ |
|
3545 |
OperatingSystem createSymbolicLinkFrom:name1 to:name2 |
|
3546 |
] |
|
3547 |
] |
|
3548 |
] |
|
3549 |
]. |
|
3550 |
||
3551 |
err notNil ifTrue:[ |
|
3552 |
self warn:(resources string:err with:(name1 ? '') allBold with:(name2 ? '') allBold). |
|
3553 |
^ self |
|
3554 |
]. |
|
1834 | 3555 |
]. |
3556 |
||
3557 |
"Modified: / 13.8.1998 / 21:26:59 / cg" |
|
3558 |
"Created: / 13.8.1998 / 21:47:14 / cg" |
|
3559 |
! |
|
3560 |
||
2186 | 3561 |
openASN1Browser |
3562 |
self openTool:OSI::ASN1Browser |
|
3563 |
||
3564 |
"Modified: / 7.9.1998 / 21:31:58 / cg" |
|
3565 |
! |
|
3566 |
||
1286
2a464093d865
added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents:
1272
diff
changeset
|
3567 |
openAppletViewer |
2a464093d865
added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents:
1272
diff
changeset
|
3568 |
|numItems| |
2a464093d865
added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents:
1272
diff
changeset
|
3569 |
|
2a464093d865
added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents:
1272
diff
changeset
|
3570 |
(numItems := fileListView selection size) > 2 ifTrue:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3571 |
(self |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3572 |
confirm:(resources string:'open for each of the %1 items ?' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3573 |
with:numItems)) ifFalse:[^ self]. |
1286
2a464093d865
added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents:
1272
diff
changeset
|
3574 |
]. |
2a464093d865
added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents:
1272
diff
changeset
|
3575 |
|
1942 | 3576 |
Java startupJavaSystem. |
3577 |
"/ Java markAllClassesUninitialized. |
|
3578 |
"/ Java initAllStaticFields. |
|
3579 |
"/ Java initAllClasses. |
|
1286
2a464093d865
added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents:
1272
diff
changeset
|
3580 |
|
2a464093d865
added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents:
1272
diff
changeset
|
3581 |
self selectedFilesDo:[:fileName | |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3582 |
|p path| |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3583 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3584 |
path := currentDirectory filenameFor:fileName. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3585 |
path isDirectory ifFalse:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3586 |
p := Java |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3587 |
javaProcessForMainOf:(Java classForName:'sun.applet.AppletViewer') |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3588 |
argumentString:path pathName. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3589 |
p resume. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3590 |
] |
1286
2a464093d865
added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents:
1272
diff
changeset
|
3591 |
]. |
2a464093d865
added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents:
1272
diff
changeset
|
3592 |
|
1942 | 3593 |
"Modified: / 18.9.1997 / 17:00:59 / stefan" |
3594 |
"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
|
3595 |
! |
2a464093d865
added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents:
1272
diff
changeset
|
3596 |
|
2814 | 3597 |
openCBrowser |
3272 | 3598 |
self withWaitCursorDo:[ |
3767 | 3599 |
CBrowser::Browser openIn:currentDirectory. |
3272 | 3600 |
] |
2814 | 3601 |
! |
3602 |
||
172 | 3603 |
openChangesBrowser |
3604 |
"open a change browser on the selected file(s)" |
|
3605 |
||
1939
5947fefec5af
care for newChangesBrowser setting
Claus Gittinger <cg@exept.de>
parents:
1933
diff
changeset
|
3606 |
self openTool:(UserPreferences current changesBrowserClass) |
5947fefec5af
care for newChangesBrowser setting
Claus Gittinger <cg@exept.de>
parents:
1933
diff
changeset
|
3607 |
|
5947fefec5af
care for newChangesBrowser setting
Claus Gittinger <cg@exept.de>
parents:
1933
diff
changeset
|
3608 |
"Modified: / 17.10.1998 / 14:39:15 / cg" |
172 | 3609 |
! |
3610 |
||
252 | 3611 |
openDiffView |
3612 |
"open a diff-view" |
|
3613 |
||
1736
36cab4d1d655
remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents:
1735
diff
changeset
|
3614 |
|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
|
3615 |
|
2969
1ec854b0f2fd
openDiff-viewer - allow two-file-selection
Claus Gittinger <cg@exept.de>
parents:
2956
diff
changeset
|
3616 |
sel := fileListView selection. |
1ec854b0f2fd
openDiff-viewer - allow two-file-selection
Claus Gittinger <cg@exept.de>
parents:
2956
diff
changeset
|
3617 |
(sel size == 2) ifTrue:[ |
1ec854b0f2fd
openDiff-viewer - allow two-file-selection
Claus Gittinger <cg@exept.de>
parents:
2956
diff
changeset
|
3618 |
name1 := fileList at:sel first. |
1ec854b0f2fd
openDiff-viewer - allow two-file-selection
Claus Gittinger <cg@exept.de>
parents:
2956
diff
changeset
|
3619 |
name2 := fileList at:sel last. |
1ec854b0f2fd
openDiff-viewer - allow two-file-selection
Claus Gittinger <cg@exept.de>
parents:
2956
diff
changeset
|
3620 |
] ifFalse:[ |
1ec854b0f2fd
openDiff-viewer - allow two-file-selection
Claus Gittinger <cg@exept.de>
parents:
2956
diff
changeset
|
3621 |
sel := self getSelectedFileName. |
1ec854b0f2fd
openDiff-viewer - allow two-file-selection
Claus Gittinger <cg@exept.de>
parents:
2956
diff
changeset
|
3622 |
|
1ec854b0f2fd
openDiff-viewer - allow two-file-selection
Claus Gittinger <cg@exept.de>
parents:
2956
diff
changeset
|
3623 |
orgName1 := ''. |
1ec854b0f2fd
openDiff-viewer - allow two-file-selection
Claus Gittinger <cg@exept.de>
parents:
2956
diff
changeset
|
3624 |
(sel size > 0 |
1ec854b0f2fd
openDiff-viewer - allow two-file-selection
Claus Gittinger <cg@exept.de>
parents:
2956
diff
changeset
|
3625 |
and:[lastFileDiffDirectory notNil |
1ec854b0f2fd
openDiff-viewer - allow two-file-selection
Claus Gittinger <cg@exept.de>
parents:
2956
diff
changeset
|
3626 |
and:[lastFileDiffDirectory asFilename isDirectory]]) ifTrue:[ |
1ec854b0f2fd
openDiff-viewer - allow two-file-selection
Claus Gittinger <cg@exept.de>
parents:
2956
diff
changeset
|
3627 |
f := lastFileDiffDirectory asFilename construct:sel. |
1ec854b0f2fd
openDiff-viewer - allow two-file-selection
Claus Gittinger <cg@exept.de>
parents:
2956
diff
changeset
|
3628 |
(f exists |
1ec854b0f2fd
openDiff-viewer - allow two-file-selection
Claus Gittinger <cg@exept.de>
parents:
2956
diff
changeset
|
3629 |
and:[f isReadable]) ifTrue:[ |
1ec854b0f2fd
openDiff-viewer - allow two-file-selection
Claus Gittinger <cg@exept.de>
parents:
2956
diff
changeset
|
3630 |
orgName1 := f name |
1ec854b0f2fd
openDiff-viewer - allow two-file-selection
Claus Gittinger <cg@exept.de>
parents:
2956
diff
changeset
|
3631 |
] |
1ec854b0f2fd
openDiff-viewer - allow two-file-selection
Claus Gittinger <cg@exept.de>
parents:
2956
diff
changeset
|
3632 |
]. |
1ec854b0f2fd
openDiff-viewer - allow two-file-selection
Claus Gittinger <cg@exept.de>
parents:
2956
diff
changeset
|
3633 |
name1 := orgName1 asValue. |
1ec854b0f2fd
openDiff-viewer - allow two-file-selection
Claus Gittinger <cg@exept.de>
parents:
2956
diff
changeset
|
3634 |
name2 := self getSelectedFileName asValue. |
1ec854b0f2fd
openDiff-viewer - allow two-file-selection
Claus Gittinger <cg@exept.de>
parents:
2956
diff
changeset
|
3635 |
]. |
1ec854b0f2fd
openDiff-viewer - allow two-file-selection
Claus Gittinger <cg@exept.de>
parents:
2956
diff
changeset
|
3636 |
|
252 | 3637 |
here := currentDirectory pathName. |
3638 |
||
3639 |
box := DialogBox new. |
|
1852 | 3640 |
(box addTextLabel:'show difference between:\\file1 (empty for views contents):' withCRs) adjust:#left. |
252 | 3641 |
box addFilenameInputFieldOn:name1 in:here tabable:true. |
1852 | 3642 |
(box addTextLabel:'and file2:') adjust:#left. |
252 | 3643 |
box addFilenameInputFieldOn:name2 in:here tabable:true. |
3644 |
||
2048 | 3645 |
box addAbortAndOkButtons. |
252 | 3646 |
|
3647 |
box showAtPointer. |
|
3648 |
||
3649 |
box accepted ifTrue:[ |
|
2140
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3650 |
name1 := name1 value. |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3651 |
(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
|
3652 |
"/ text1 := subView contents. |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3653 |
text1 := subView list asStringCollection withTabs. |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3654 |
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
|
3655 |
name1 := nil. |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3656 |
l1 := 'browser contents' |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3657 |
] ifFalse:[ |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3658 |
name1 := currentDirectory filenameFor:name1. |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3659 |
name1 isReadable ifFalse:[ |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3660 |
nm := name1. |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3661 |
name1 exists ifFalse:[ |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3662 |
err := '%1 does not exist'. |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3663 |
] ifTrue:[ |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3664 |
err := '%1 is not readable' |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3665 |
]. |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3666 |
]. |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3667 |
l1 := name1 pathName |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3668 |
]. |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3669 |
|
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3670 |
name2 := currentDirectory filenameFor:name2 value. |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3671 |
err isNil ifTrue:[ |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3672 |
name2 isReadable ifFalse:[ |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3673 |
nm := name2. |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3674 |
name2 exists ifFalse:[ |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3675 |
err := '%1 does not exist'. |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3676 |
] ifTrue:[ |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3677 |
err := '%1 is not readable' |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3678 |
]. |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3679 |
]. |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3680 |
]. |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3681 |
err notNil ifTrue:[ |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3682 |
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
|
3683 |
^ self |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3684 |
]. |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3685 |
|
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3686 |
self withWaitCursorDo:[ |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3687 |
(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
|
3688 |
lastFileDiffDirectory := name1 directoryName |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3689 |
]. |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3690 |
name1 notNil ifTrue:[ |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3691 |
text1 := name1 contents. |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3692 |
]. |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3693 |
text2 := name2 contents. |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3694 |
text1 = text2 ifTrue:[ |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3695 |
self information:'same contents' |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3696 |
] ifFalse:[ |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3697 |
d := DiffTextView |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3698 |
openOn:text1 label:l1 |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3699 |
and:text2 label:name2 pathName. |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3700 |
d label:'file differences'. |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3701 |
] |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3702 |
] |
252 | 3703 |
]. |
3704 |
||
1735
57ebbb06fcd7
only show an infoBox, if files have the same contents
Claus Gittinger <cg@exept.de>
parents:
1732
diff
changeset
|
3705 |
"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
|
3706 |
"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
|
3707 |
"Modified: / 5.5.1999 / 16:04:10 / cg" |
267 | 3708 |
! |
3709 |
||
3710 |
openEditor |
|
3711 |
self openTool:EditTextView |
|
3712 |
! |
|
3713 |
||
3714 |
openHTMLReader |
|
1874 | 3715 |
self openTool:HTMLDocumentView ignoreDirectories:false |
3716 |
||
3717 |
"Modified: / 7.9.1998 / 21:31:58 / cg" |
|
267 | 3718 |
! |
3719 |
||
1834 | 3720 |
openImageEditor |
1874 | 3721 |
[self loadImageAndPerform:#edit] fork |
1834 | 3722 |
|
3723 |
"Modified: / 17.9.1995 / 17:41:24 / claus" |
|
3724 |
"Modified: / 18.9.1997 / 17:05:04 / stefan" |
|
3725 |
"Created: / 13.8.1998 / 22:07:09 / cg" |
|
1874 | 3726 |
"Modified: / 7.9.1998 / 21:31:41 / cg" |
1834 | 3727 |
! |
3728 |
||
267 | 3729 |
openImageInspector |
1874 | 3730 |
[self loadImageAndPerform:#inspect] fork |
1853 | 3731 |
|
3732 |
"Modified: / 17.9.1995 / 17:41:24 / claus" |
|
3733 |
"Modified: / 18.9.1997 / 17:05:04 / stefan" |
|
1874 | 3734 |
"Modified: / 7.9.1998 / 21:31:30 / cg" |
267 | 3735 |
! |
3736 |
||
1964 | 3737 |
openImagePreview |
3738 |
[self loadImageAndPerform:[:img | |
|
3661 | 3739 |
|i top viewer imgFileName| |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3740 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3741 |
top := StandardSystemView new. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3742 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3743 |
viewer := ImageView origin:0.0@0.0 corner:1.0@1.0 in:top. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3744 |
i := img. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3745 |
top extent:200@200. |
3661 | 3746 |
imgFileName := img fileName asFilename. |
3747 |
top label:(imgFileName directoryName asFilename baseName , '/' , imgFileName baseName). |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3748 |
top openAndWait. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3749 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3750 |
(i width > 200 or:[i height > 200]) ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3751 |
i := i magnifiedPreservingRatioTo:200@200. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3752 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3753 |
viewer image:i. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3754 |
]. |
1964 | 3755 |
] fork |
1969 | 3756 |
|
3757 |
"Modified: / 4.12.1998 / 15:49:03 / cg" |
|
1964 | 3758 |
! |
3759 |
||
3001 | 3760 |
openMP3Player |
3761 |
|file| |
|
3762 |
||
3763 |
file := self getSelectedFileName. |
|
3764 |
(file isNil) ifTrue:[ |
|
3765 |
^ self. |
|
3766 |
]. |
|
3767 |
file := currentDirectory filenameFor:file. |
|
3768 |
(MP3PlayerApplication ? SaugFix::MP3PlayerApplication) playSong:file. |
|
3769 |
! |
|
3770 |
||
1994 | 3771 |
openSelectedFilename |
3772 |
|sel| |
|
3773 |
||
3774 |
sel := subView selection. |
|
3775 |
sel notNil ifTrue:[ |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3776 |
sel := sel asString withoutSeparators. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3777 |
sel asFilename exists ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3778 |
self doOpenFile:sel viaDoubleClick:false |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3779 |
] |
1994 | 3780 |
]. |
3781 |
||
3782 |
"Created: / 4.2.1999 / 17:40:42 / cg" |
|
3783 |
"Modified: / 4.2.1999 / 17:47:06 / cg" |
|
3784 |
! |
|
3785 |
||
3536 | 3786 |
openSlideShow |
3787 |
CodingExamples_GUI::SlideShow openIn:currentDirectory |
|
3788 |
||
3789 |
"Created: / 29.12.2001 / 21:56:34 / cg" |
|
3790 |
! |
|
3791 |
||
2825
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
3792 |
openSnapshotImageBrowser |
2844 | 3793 |
^ self openTool:SystemBrowser with:#openOnSnapShotImage: ignoreDirectories:true |
3794 |
! |
|
2825
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
3795 |
|
1731 | 3796 |
openTerminal |
1732 | 3797 |
VT100TerminalView openShellIn:currentDirectory |
1731 | 3798 |
|
3799 |
"Created: / 20.7.1998 / 18:18:15 / cg" |
|
1732 | 3800 |
"Modified: / 20.7.1998 / 18:32:28 / cg" |
1731 | 3801 |
! |
3802 |
||
267 | 3803 |
openTool:aToolClass |
3804 |
"open a tool on the selected file(s)" |
|
3805 |
||
2015 | 3806 |
^ self openTool:aToolClass ignoreDirectories:true |
1874 | 3807 |
|
3808 |
"Modified: / 7.9.1998 / 19:32:10 / cg" |
|
3809 |
! |
|
3810 |
||
3811 |
openTool:aToolClass ignoreDirectories:ignoreDirs |
|
3812 |
"open a tool on the selected file(s)" |
|
3813 |
||
2825
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
3814 |
^ self |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
3815 |
openTool:aToolClass |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
3816 |
with:#openOn: |
2844 | 3817 |
ignoreDirectories:ignoreDirs |
3818 |
! |
|
2825
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
3819 |
|
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
3820 |
openTool:aToolClass with:aSelector ignoreDirectories:ignoreDirs |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
3821 |
"open a tool on the selected file(s)" |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
3822 |
|
2015 | 3823 |
|numItems path tool| |
865
48395e8ecca9
remember executeCommand actions in history as well.
Claus Gittinger <cg@exept.de>
parents:
851
diff
changeset
|
3824 |
|
1883 | 3825 |
aToolClass isNil ifTrue:[ |
2170 | 3826 |
self warn:'Sorry, that tool seems to be not available'. |
3827 |
^ nil. |
|
1883 | 3828 |
]. |
3829 |
||
865
48395e8ecca9
remember executeCommand actions in history as well.
Claus Gittinger <cg@exept.de>
parents:
851
diff
changeset
|
3830 |
(numItems := fileListView selection size) > 2 ifTrue:[ |
2170 | 3831 |
(self |
3832 |
confirm:(resources string:'open for each of the %1 items ?' |
|
3833 |
with:numItems)) ifFalse:[^ self]. |
|
865
48395e8ecca9
remember executeCommand actions in history as well.
Claus Gittinger <cg@exept.de>
parents:
851
diff
changeset
|
3834 |
]. |
48395e8ecca9
remember executeCommand actions in history as well.
Claus Gittinger <cg@exept.de>
parents:
851
diff
changeset
|
3835 |
|
3272 | 3836 |
self withWaitCursorDo:[ |
3837 |
self selectedFilesDo:[:fileName | |
|
3838 |
path := currentDirectory filenameFor:fileName. |
|
3461 | 3839 |
(ignoreDirs not or:[path isDirectory not]) ifTrue:[ |
3840 |
path isAbsolute ifTrue:[ |
|
3841 |
path := path getName. |
|
3842 |
] ifFalse:[ |
|
3843 |
path := path pathName. |
|
3844 |
]. |
|
3845 |
tool := aToolClass perform:aSelector with:path. |
|
3272 | 3846 |
] |
3847 |
]. |
|
267 | 3848 |
]. |
2015 | 3849 |
^ tool |
865
48395e8ecca9
remember executeCommand actions in history as well.
Claus Gittinger <cg@exept.de>
parents:
851
diff
changeset
|
3850 |
|
1874 | 3851 |
"Modified: / 18.9.1997 / 17:06:18 / stefan" |
3852 |
"Created: / 7.9.1998 / 19:31:49 / cg" |
|
2844 | 3853 |
"Modified: / 25.5.1999 / 16:30:35 / cg" |
3854 |
! |
|
1156
f3df28086973
dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents:
1154
diff
changeset
|
3855 |
|
1853 | 3856 |
openZipTool |
2015 | 3857 |
|zipTool| |
3858 |
||
2170 | 3859 |
(zipTool := self openTool:ZipTool) notNil ifTrue:[ |
3860 |
zipTool initialExtractDirectory:currentDirectory |
|
3861 |
]. |
|
1853 | 3862 |
|
3863 |
"Created: / 26.8.1998 / 16:20:55 / cg" |
|
2170 | 3864 |
"Modified: / 25.5.1999 / 16:30:54 / cg" |
1853 | 3865 |
! |
3866 |
||
2567
dd029fea485d
added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents:
2562
diff
changeset
|
3867 |
readAbbrevFile |
3398 | 3868 |
"read the abbrev file and install classes found there as autoloaded classes" |
3869 |
||
3747
d30bc1e54f15
Remove unused vars and asFilename sends
Stefan Vogel <sv@exept.de>
parents:
3746
diff
changeset
|
3870 |
|sel| |
d30bc1e54f15
Remove unused vars and asFilename sends
Stefan Vogel <sv@exept.de>
parents:
3746
diff
changeset
|
3871 |
|
3555 | 3872 |
sel := fileListView selection. |
3873 |
sel size == 0 ifTrue:[ |
|
3747
d30bc1e54f15
Remove unused vars and asFilename sends
Stefan Vogel <sv@exept.de>
parents:
3746
diff
changeset
|
3874 |
Smalltalk installAutoloadedClassesFrom:(currentDirectory construct:'abbrev.stc'). |
3555 | 3875 |
^ self |
3876 |
]. |
|
3877 |
sel do:[:eachIndex | |
|
3878 |
|f| |
|
3879 |
||
3880 |
f := fileList at:eachIndex ifAbsent:nil. |
|
3747
d30bc1e54f15
Remove unused vars and asFilename sends
Stefan Vogel <sv@exept.de>
parents:
3746
diff
changeset
|
3881 |
f := currentDirectory construct:f. |
3555 | 3882 |
f isDirectory ifTrue:[ |
3883 |
f := f construct:'abbrev.stc' |
|
3884 |
]. |
|
3885 |
Smalltalk installAutoloadedClassesFrom:f. |
|
3886 |
]. |
|
2567
dd029fea485d
added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents:
2562
diff
changeset
|
3887 |
! |
dd029fea485d
added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents:
2562
diff
changeset
|
3888 |
|
2951
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
3889 |
revisitFile:aFileName |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
3890 |
|lineNr| |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
3891 |
|
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
3892 |
(self askIfModified:'contents has not been saved.\\Modifications will be lost when you proceed.' |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
3893 |
yesButton:'proceed') ifFalse:[ ^self ]. |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
3894 |
|
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
3895 |
self doChangeCurrentDirectoryTo:aFileName asFilename directory updateHistory:false. |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
3896 |
lineNr := fileList indexOf:aFileName asFilename baseName. |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
3897 |
fileListView selection:lineNr. |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
3898 |
self fileGet:true. |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
3899 |
|
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
3900 |
! |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
3901 |
|
1156
f3df28086973
dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents:
1154
diff
changeset
|
3902 |
showOrHideTabView |
f3df28086973
dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents:
1154
diff
changeset
|
3903 |
"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
|
3904 |
|
1834 | 3905 |
showingDetails value "showLongList" ifTrue:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3906 |
tabRulerView isNil ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3907 |
self createTabRulerIn:scrollView superView. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3908 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3909 |
tabRulerView beVisible. |
1758 | 3910 |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3911 |
false "self is3D" ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3912 |
scrollView topInset:(tabRulerView superView height). |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3913 |
tabRulerView superView leftInset:(fileListView originRelativeTo:scrollView) x. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3914 |
] ifFalse:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3915 |
scrollView topInset:(tabRulerView height). |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3916 |
tabRulerView leftInset:(fileListView originRelativeTo:scrollView) x. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3917 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3918 |
tabRulerView hiddenTabs:#(1). |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3919 |
tabRulerView fixedTabs:#(1). |
1156
f3df28086973
dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents:
1154
diff
changeset
|
3920 |
] ifFalse:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3921 |
tabRulerView notNil ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3922 |
tabRulerView beInvisible. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3923 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3924 |
scrollView topInset:0 |
1156
f3df28086973
dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents:
1154
diff
changeset
|
3925 |
]. |
f3df28086973
dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents:
1154
diff
changeset
|
3926 |
tabSpec := nil. |
f3df28086973
dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents:
1154
diff
changeset
|
3927 |
|
1758 | 3928 |
"Created: / 19.4.1997 / 09:50:02 / cg" |
1834 | 3929 |
"Modified: / 4.8.1998 / 13:44:14 / cg" |
172 | 3930 |
! ! |
3931 |
||
3328 | 3932 |
!FileBrowser methodsFor:'help'! |
172 | 3933 |
|
3934 |
helpTextFor:aComponent |
|
3935 |
|s| |
|
3936 |
||
3937 |
aComponent == subView ifTrue:[ |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3938 |
s := 'HELP_SUBVIEW' |
172 | 3939 |
]. |
3940 |
aComponent == fileListView ifTrue:[ |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3941 |
s := 'HELP_FILELIST' |
172 | 3942 |
]. |
3943 |
aComponent == filterField ifTrue:[ |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3944 |
s := 'HELP_FILTER' |
172 | 3945 |
]. |
3946 |
aComponent == labelView ifTrue:[ |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3947 |
s := 'HELP_PATHFIELD' |
172 | 3948 |
]. |
3949 |
aComponent == commandView ifTrue:[ |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3950 |
s := 'HELP_COMMANDVIEW' |
172 | 3951 |
]. |
3952 |
s notNil ifTrue:[ |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3953 |
^ resources string:s |
172 | 3954 |
]. |
3955 |
^ nil |
|
3956 |
! ! |
|
3957 |
||
2116 | 3958 |
!FileBrowser methodsFor:'initialize / release'! |
36 | 3959 |
|
1758 | 3960 |
createTabRulerIn:topFrame |
3961 |
|v| |
|
3962 |
||
3963 |
false "self is3D" ifTrue:[ |
|
2256
3ea6c549b035
let the tabRuler scroll with the fileList.
Claus Gittinger <cg@exept.de>
parents:
2255
diff
changeset
|
3964 |
v := View in:topFrame. |
3ea6c549b035
let the tabRuler scroll with the fileList.
Claus Gittinger <cg@exept.de>
parents:
2255
diff
changeset
|
3965 |
v level:-1. |
3ea6c549b035
let the tabRuler scroll with the fileList.
Claus Gittinger <cg@exept.de>
parents:
2255
diff
changeset
|
3966 |
tabRulerView := TabSpecRuler in:v. |
3ea6c549b035
let the tabRuler scroll with the fileList.
Claus Gittinger <cg@exept.de>
parents:
2255
diff
changeset
|
3967 |
tabRulerView level:1. |
3ea6c549b035
let the tabRuler scroll with the fileList.
Claus Gittinger <cg@exept.de>
parents:
2255
diff
changeset
|
3968 |
v origin:(0.0@0.0) corner:(1.0@10). |
3ea6c549b035
let the tabRuler scroll with the fileList.
Claus Gittinger <cg@exept.de>
parents:
2255
diff
changeset
|
3969 |
tabRulerView origin:(0.0@0.0) corner:(1.0@1.0). |
1758 | 3970 |
] ifFalse:[ |
2256
3ea6c549b035
let the tabRuler scroll with the fileList.
Claus Gittinger <cg@exept.de>
parents:
2255
diff
changeset
|
3971 |
tabRulerView := TabSpecRuler in:topFrame. |
3ea6c549b035
let the tabRuler scroll with the fileList.
Claus Gittinger <cg@exept.de>
parents:
2255
diff
changeset
|
3972 |
tabRulerView origin:(0.0@0.0) corner:(1.0@10). |
1758 | 3973 |
]. |
3974 |
tabRulerView borderWidth:0. |
|
3975 |
tabRulerView synchronousOperation:true. |
|
2256
3ea6c549b035
let the tabRuler scroll with the fileList.
Claus Gittinger <cg@exept.de>
parents:
2255
diff
changeset
|
3976 |
tabRulerView masterView:scrollView scrolledView |
1758 | 3977 |
|
3978 |
"Created: / 27.7.1998 / 20:23:10 / cg" |
|
3979 |
"Modified: / 27.7.1998 / 20:30:10 / cg" |
|
3980 |
! |
|
3981 |
||
172 | 3982 |
currentDirectory:aDirectoryPath |
3983 |
"set the directory to be browsed" |
|
3984 |
||
2216
b84ee099f484
dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
3985 |
|newDirectory| |
b84ee099f484
dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
3986 |
|
b84ee099f484
dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
3987 |
newDirectory := aDirectoryPath asFilename. |
b84ee099f484
dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
3988 |
newDirectory = currentDirectory ifTrue:[ |
b84ee099f484
dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
3989 |
^ self |
b84ee099f484
dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
3990 |
]. |
b84ee099f484
dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
3991 |
|
3747
d30bc1e54f15
Remove unused vars and asFilename sends
Stefan Vogel <sv@exept.de>
parents:
3746
diff
changeset
|
3992 |
currentDirectory := newDirectory. |
172 | 3993 |
self changed:#path. |
1327 | 3994 |
|
172 | 3995 |
" |
3996 |
tell my subview (whatever that is) to start its file-dialog |
|
3997 |
(i.e. save-as etc.) in that directory |
|
3998 |
" |
|
3999 |
(subView respondsTo:#directoryForFileDialog:) ifTrue:[ |
|
2216
b84ee099f484
dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
4000 |
subView directoryForFileDialog:currentDirectory |
172 | 4001 |
] |
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
4002 |
|
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
4003 |
"Modified: 16.9.1997 / 14:56:17 / stefan" |
1327 | 4004 |
"Modified: 21.9.1997 / 11:28:49 / cg" |
172 | 4005 |
! |
4006 |
||
2116 | 4007 |
destroy |
4008 |
"destroy view and boxes" |
|
4009 |
||
4010 |
ObjectMemory removeDependent:self. |
|
4011 |
self stopUpdateProcess. |
|
4012 |
self stopImageRenderProcess. |
|
4013 |
checkBlock := nil. |
|
4014 |
super destroy |
|
4015 |
||
4016 |
"Modified: 19.4.1997 / 13:51:48 / cg" |
|
4017 |
! |
|
4018 |
||
172 | 4019 |
focusSequence |
4020 |
"return the sequence in which ALT-CursorRight steps focus" |
|
4021 |
||
4022 |
|fs| |
|
4023 |
||
2688
9bb22571f558
include menuPanel in focusSequence
Claus Gittinger <cg@exept.de>
parents:
2676
diff
changeset
|
4024 |
fs := Array |
9bb22571f558
include menuPanel in focusSequence
Claus Gittinger <cg@exept.de>
parents:
2676
diff
changeset
|
4025 |
with:menuPanel |
9bb22571f558
include menuPanel in focusSequence
Claus Gittinger <cg@exept.de>
parents:
2676
diff
changeset
|
4026 |
with:labelView |
9bb22571f558
include menuPanel in focusSequence
Claus Gittinger <cg@exept.de>
parents:
2676
diff
changeset
|
4027 |
with:filterField |
9bb22571f558
include menuPanel in focusSequence
Claus Gittinger <cg@exept.de>
parents:
2676
diff
changeset
|
4028 |
with:fileListView |
9bb22571f558
include menuPanel in focusSequence
Claus Gittinger <cg@exept.de>
parents:
2676
diff
changeset
|
4029 |
with:subView. |
172 | 4030 |
|
4031 |
commandView notNil ifTrue:[ |
|
2688
9bb22571f558
include menuPanel in focusSequence
Claus Gittinger <cg@exept.de>
parents:
2676
diff
changeset
|
4032 |
fs := fs copyWith:commandView |
172 | 4033 |
]. |
4034 |
^fs |
|
4035 |
! |
|
4036 |
||
4037 |
initEvents |
|
4038 |
super initEvents. |
|
4039 |
self enableEvent:#visibilityChange. |
|
4040 |
! |
|
4041 |
||
36 | 4042 |
initialize |
1102 | 4043 |
|frame spacing halfSpacing v topFrame labelFrame filterModel |
3527 | 4044 |
mH lowerFrame| |
36 | 4045 |
|
4046 |
super initialize. |
|
4047 |
||
819
b78a26650047
initialize fileEncoding to #iso8859
Claus Gittinger <cg@exept.de>
parents:
807
diff
changeset
|
4048 |
fileEncoding := #iso8859. "/ native ST/X encoding |
386
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
4049 |
|
52 | 4050 |
"if true, will replace leading spaces by tabs on |
4051 |
file write. If false, they will be written as spaces |
|
4052 |
" |
|
4053 |
compressTabs := resources at:'COMPRESS_TABS' default:true. |
|
4054 |
||
4055 |
" |
|
4056 |
showing long or short by default |
|
4057 |
" |
|
1834 | 4058 |
"/ showLongList := resources at:'LONG_LIST' default:false. |
4059 |
showingDetails := (resources at:'LONG_LIST' default:false) asValue. |
|
4060 |
showingDetails onChangeSend:#detailsSettingChanged to:self. |
|
52 | 4061 |
|
4062 |
" |
|
4063 |
show hidden files or not ? |
|
4064 |
" |
|
1834 | 4065 |
"/ showDotFiles := resources at:'SHOW_DOT_FILES' default:false. |
4066 |
showingHiddenFiles := (resources at:'SHOW_DOT_FILES' default:false) asValue. |
|
4067 |
showingHiddenFiles onChangeSend:#updateCurrentDirectory to:self. |
|
4068 |
||
2031 | 4069 |
" |
4070 |
showing small icons by default |
|
4071 |
" |
|
4072 |
showingBigImagePreview := (resources at:'BIG_IMAGE_PREVIEW' default:false) asValue. |
|
4073 |
showingBigImagePreview onChangeSend:#bigImagePreviewSettingChanged to:self. |
|
4074 |
||
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4075 |
showingTimeAndDate := (resources at:'SHOW_TIME_AND_DATE' default:false) asValue. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4076 |
showingTimeAndDate onChangeSend:#updateCurrentDirectory to:self. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4077 |
|
1834 | 4078 |
sortByWhat := #name asValue. |
4079 |
sortByWhat onChangeSend:#sortChanged to:self. |
|
4080 |
||
4081 |
sortCaseless := (Filename isCaseSensitive not) asValue. |
|
4082 |
sortCaseless onChangeSend:#updateCurrentDirectory to:self. |
|
52 | 4083 |
|
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
4084 |
dosEOLMode := false asValue. |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
4085 |
|
45 | 4086 |
lockUpdate := false. |
4087 |
||
132 | 4088 |
CommandHistory isNil ifTrue:[ |
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
4089 |
CommandHistory := OrderedCollection new. |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
4090 |
CommandHistorySize := 50 |
132 | 4091 |
]. |
36 | 4092 |
DirectoryHistory isNil ifTrue:[ |
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
4093 |
DirectoryHistory := OrderedCollection new. |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
4094 |
DirectoryHistoryWhere := OrderedCollection new. |
2951
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
4095 |
]. |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
4096 |
VisitedFileHistory isNil ifTrue:[ |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
4097 |
VisitedFileHistory := OrderedCollection new. |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
4098 |
]. |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
4099 |
HistorySize isNil ifTrue:[ |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
4100 |
HistorySize := 15 |
36 | 4101 |
]. |
132 | 4102 |
commandIndex := 0. |
36 | 4103 |
|
1784
329e3a904236
ask MIMETypes when mapping suffixes to icons.
Claus Gittinger <cg@exept.de>
parents:
1758
diff
changeset
|
4104 |
icons := Dictionary new. |
1495 | 4105 |
|
4106 |
Icons isNil ifTrue:[ |
|
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
4107 |
self class initializeIcons |
1495 | 4108 |
]. |
4109 |
||
36 | 4110 |
myName := (resources string:self class name). |
4111 |
self label:myName. |
|
45 | 4112 |
|
1834 | 4113 |
menuPanel := MenuPanel in:self. |
3242 | 4114 |
"/ menuPanel level:1. |
1834 | 4115 |
menuPanel verticalLayout:false. |
4116 |
menuPanel receiver:self. |
|
4117 |
menuPanel menu:(self pullDownMenu). |
|
2050 | 4118 |
|
1834 | 4119 |
mH := menuPanel preferredExtent y. |
1846
6b66290db627
geometry fixes for win95 style
Claus Gittinger <cg@exept.de>
parents:
1845
diff
changeset
|
4120 |
menuPanel origin:(0.0 @ 0.0) corner:(1.0 @ (mH)). |
1834 | 4121 |
|
93 | 4122 |
labelFrame := View |
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
4123 |
origin:(0.0 @ mH) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
4124 |
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
|
4125 |
in:self. |
52 | 4126 |
|
3759
366d5ebc3f89
Use #isWindowsStyle instead of comparing to style name.
Stefan Vogel <sv@exept.de>
parents:
3747
diff
changeset
|
4127 |
(styleSheet name = #st80 or:[styleSheet isWindowsStyle]) ifTrue:[ |
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
4128 |
labelFrame level:1. |
1879 | 4129 |
"/ labelFrame rightInset:-1. |
45 | 4130 |
]. |
36 | 4131 |
|
4132 |
spacing := ViewSpacing. |
|
4133 |
halfSpacing := spacing // 2. |
|
4134 |
||
1100
d9382b49c62d
Use #pushEvent: for timer handling.
Stefan Vogel <sv@exept.de>
parents:
1091
diff
changeset
|
4135 |
" |
d9382b49c62d
Use #pushEvent: for timer handling.
Stefan Vogel <sv@exept.de>
parents:
1091
diff
changeset
|
4136 |
checkBlock is executed by the Processor every checkDelta seconds. |
d9382b49c62d
Use #pushEvent: for timer handling.
Stefan Vogel <sv@exept.de>
parents:
1091
diff
changeset
|
4137 |
We use #pushEvent: to perform the directory update |
d9382b49c62d
Use #pushEvent: for timer handling.
Stefan Vogel <sv@exept.de>
parents:
1091
diff
changeset
|
4138 |
in our windowgroups process. |
d9382b49c62d
Use #pushEvent: for timer handling.
Stefan Vogel <sv@exept.de>
parents:
1091
diff
changeset
|
4139 |
" |
d9382b49c62d
Use #pushEvent: for timer handling.
Stefan Vogel <sv@exept.de>
parents:
1091
diff
changeset
|
4140 |
checkBlock := [self pushEvent:#checkIfDirectoryHasChanged]. |
45 | 4141 |
checkDelta := resources at:'CHECK_DELTA' default:10. |
2220
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
4142 |
doAutoUpdate := true asValue. |
36 | 4143 |
|
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
4144 |
currentDirectory := Filename currentDirectory. |
36 | 4145 |
|
344
3f881dbee13a
use a model for the filter field
Claus Gittinger <cg@exept.de>
parents:
333
diff
changeset
|
4146 |
filterModel := '*' asValue. |
45 | 4147 |
filterField := EditField in:labelFrame. |
1071 | 4148 |
filterField |
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
4149 |
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
|
4150 |
corner:(1.0 @ (filterField heightIncludingBorder + halfSpacing) ). |
1846
6b66290db627
geometry fixes for win95 style
Claus Gittinger <cg@exept.de>
parents:
1845
diff
changeset
|
4151 |
filterField rightInset:(ViewSpacing - halfSpacing). |
344
3f881dbee13a
use a model for the filter field
Claus Gittinger <cg@exept.de>
parents:
333
diff
changeset
|
4152 |
filterField model:filterModel. |
45 | 4153 |
|
1846
6b66290db627
geometry fixes for win95 style
Claus Gittinger <cg@exept.de>
parents:
1845
diff
changeset
|
4154 |
labelFrame corner:(1.0 @ (mH + ViewSpacing + filterField height + halfSpacing)). |
6b66290db627
geometry fixes for win95 style
Claus Gittinger <cg@exept.de>
parents:
1845
diff
changeset
|
4155 |
|
36 | 4156 |
self initializeFilterPattern. |
344
3f881dbee13a
use a model for the filter field
Claus Gittinger <cg@exept.de>
parents:
333
diff
changeset
|
4157 |
filterModel onChangeSend:#filterPatternChanged to:self. |
3f881dbee13a
use a model for the filter field
Claus Gittinger <cg@exept.de>
parents:
333
diff
changeset
|
4158 |
"/ filterField leaveAction:[:key | fileListView scrollToTop. self updateCurrentDirectory]. |
36 | 4159 |
|
1327 | 4160 |
"/ labelView := Label in:labelFrame. |
4161 |
"/ labelView origin:(halfSpacing @ halfSpacing) |
|
4162 |
"/ extent:[((width // 4 * 3) - spacing - borderWidth) |
|
4163 |
"/ @ |
|
4164 |
"/ (filterField heightIncludingBorder) |
|
4165 |
"/ "(font height + font descent)" |
|
4166 |
"/ ]. |
|
4167 |
"/ labelView adjust:#right. |
|
4168 |
"/ labelView borderWidth:0. |
|
4169 |
"/ labelView model:self; menu:#labelMenu; aspect:#path; labelMessage:#path. |
|
4170 |
"/ labelFrame model:self; menu:#labelMenu. |
|
4171 |
||
4172 |
labelView := FilenameEditField in:labelFrame. |
|
4173 |
labelView |
|
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
4174 |
origin:(halfSpacing @ (halfSpacing)) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
4175 |
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
|
4176 |
@ |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
4177 |
(filterField heightIncludingBorder) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
4178 |
"(font height + font descent)" |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
4179 |
]. |
1834 | 4180 |
labelView menu:#labelMenu; |
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
4181 |
aspect:#path; changeMessage:#pathChanged:. |
1327 | 4182 |
labelView model:self. |
2216
b84ee099f484
dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
4183 |
labelView acceptOnExpand:true. |
1327 | 4184 |
labelView backgroundColor:(labelFrame viewBackground). |
73 | 4185 |
labelFrame model:self; menu:#labelMenu. |
1329 | 4186 |
labelView cursorType:#solidCaret; cursorTypeNoFocus:#none. |
4187 |
labelView level:0. |
|
4188 |
labelView borderWidth:0. |
|
4189 |
||
4190 |
killButton := Button label:(resources string:'kill') in:self. |
|
4191 |
"/ killButton origin:(halfSpacing @ halfSpacing) |
|
4192 |
"/ extent:(killButton width @ filterField height). |
|
4193 |
killButton origin:(halfSpacing @ 1.0). |
|
4194 |
killButton topInset:(killButton height negated). |
|
4195 |
killButton beInvisible. |
|
4196 |
||
4197 |
pauseToggle := Toggle label:(resources string:'pause') in:self. |
|
4198 |
"/ pauseToggle origin:((killButton corner x + 50) @ halfSpacing) |
|
4199 |
"/ extent:(pauseToggle width @ filterField height). |
|
4200 |
pauseToggle origin:((killButton corner x + ViewSpacing + 20) @ 1.0). |
|
4201 |
pauseToggle topInset:(pauseToggle height negated). |
|
4202 |
pauseToggle beInvisible. |
|
36 | 4203 |
|
132 | 4204 |
self initializeCommandViewIn:self. |
4205 |
||
4206 |
"/ frame := VariableVerticalPanel |
|
4207 |
"/ origin:[frame borderWidth negated |
|
4208 |
"/ @ |
|
4209 |
"/ labelFrame height |
|
4210 |
"/ "/ (labelView height + labelView origin y + spacing) |
|
4211 |
"/ ] |
|
4212 |
"/ corner:(1.0 @ 1.0) |
|
4213 |
"/ in:self. |
|
4214 |
||
1834 | 4215 |
frame := VariableVerticalPanel origin:0.0@mH corner:1.0@1.0 in:self. |
2739 | 4216 |
frame snapMode:#both. |
132 | 4217 |
frame topInset:labelFrame height. |
4218 |
commandView notNil ifTrue:[ |
|
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
4219 |
frame bottomInset:(commandView height + spacing + spacing) |
132 | 4220 |
]. |
36 | 4221 |
|
1102 | 4222 |
topFrame := View in:frame. |
36 | 4223 |
topFrame origin:(0.0 @ 0.0) corner:(1.0 @ 0.3). |
4224 |
||
1758 | 4225 |
false ifTrue:[ |
4226 |
self createTabRulerIn:topFrame. |
|
4227 |
]. |
|
1102 | 4228 |
|
4229 |
scrollView := ScrollableView in:topFrame. |
|
2252 | 4230 |
scrollView |
2255
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
4231 |
verticalScrollable:true; |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
4232 |
verticalMini:false; |
2252 | 4233 |
horizontalScrollable:true; |
4234 |
horizontalMini:true; |
|
4235 |
autoHideHorizontalScrollBar:true; |
|
2255
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
4236 |
autoHideVerticalScrollBar:false; |
2252 | 4237 |
origin:(0.0 @ 0.0) corner:(1.0 @ 1.0). |
1102 | 4238 |
|
4239 |
fileListView := SelectionInListView new. |
|
4240 |
scrollView scrolledView:fileListView. |
|
36 | 4241 |
fileListView action:[:lineNr | self fileSelect:lineNr]. |
1326 | 4242 |
fileListView doubleClickAction:[:lineNr | self fileDoubleClick:lineNr]. |
36 | 4243 |
fileListView multipleSelectOk:true. |
1010 | 4244 |
fileListView delegate:self. |
98 | 4245 |
fileListView menuHolder:self; menuPerformer:self; menuMessage:#fileListMenu. |
1122
970fc7e88639
support drag out of my list.
Claus Gittinger <cg@exept.de>
parents:
1120
diff
changeset
|
4246 |
fileListView allowDrag:true. |
1156
f3df28086973
dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents:
1154
diff
changeset
|
4247 |
fileListView dragObjectConverter:[:obj | |
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
4248 |
|dir nm path idx| |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
4249 |
|
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
4250 |
nm := obj theObject asString. |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
4251 |
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
|
4252 |
idx == 0 ifTrue:[ |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
4253 |
"/ cannot happen ... |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
4254 |
nil |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
4255 |
] ifFalse:[ |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
4256 |
nm := fileList at:idx. |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
4257 |
dir := currentDirectory pathName asFilename. |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
4258 |
path := dir constructString:nm. |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
4259 |
DropObject newFile:path. |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
4260 |
] |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
4261 |
]. |
1158
ea2cd788ef59
delay tabView origin setting
Claus Gittinger <cg@exept.de>
parents:
1157
diff
changeset
|
4262 |
|
ea2cd788ef59
delay tabView origin setting
Claus Gittinger <cg@exept.de>
parents:
1157
diff
changeset
|
4263 |
"/ sigh - must be delayed - origin is not yet fixe |
ea2cd788ef59
delay tabView origin setting
Claus Gittinger <cg@exept.de>
parents:
1157
diff
changeset
|
4264 |
"/ tabRulerView leftInset:(fileListView originRelativeTo:scrollView) x. |
ea2cd788ef59
delay tabView origin setting
Claus Gittinger <cg@exept.de>
parents:
1157
diff
changeset
|
4265 |
"/ self showOrHideTabView. |
1102 | 4266 |
|
2094 | 4267 |
lowerFrame := View in:frame. |
4268 |
lowerFrame origin:(0.0 @ 0.3) corner:(1.0 @ 1.0). |
|
4269 |
||
4270 |
v := self initializeSubViewIn:lowerFrame. |
|
4271 |
||
36 | 4272 |
subView := v scrolledView. |
4273 |
(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
|
4274 |
subView directoryForFileDialog:currentDirectory |
36 | 4275 |
]. |
4276 |
||
1329 | 4277 |
"/ buttonPanel := HorizontalPanelView in:self. |
4278 |
"/ buttonPanel horizontalLayout:#leftSpace. |
|
4279 |
"/ buttonPanel verticalSpace:0. |
|
4280 |
"/ "/ buttonPanel verticalLayout:#top. |
|
4281 |
"/ buttonPanel borderWidth:0. |
|
4282 |
"/ |
|
4283 |
"/ buttonPanel |
|
4284 |
"/ origin:(0.5 @ halfSpacing) |
|
4285 |
"/ extent:[((width // 4) - spacing - borderWidth) |
|
4286 |
"/ @ |
|
4287 |
"/ (buttonPanel preferredExtent y max:(labelView height)) |
|
4288 |
"/ ]. |
|
4289 |
"/ "/ buttonPanel level:-1. |
|
4290 |
"/ |
|
4291 |
"/ upButton := Button in:buttonPanel. |
|
4292 |
"/ img := Image fromFile:'bitmaps/xpmBitmaps/document_images/tiny_yellow_dir_up.xpm'. |
|
4293 |
"/ upButton label:(img ? 'up'). |
|
4294 |
"/ upButton action:[self changeToParentDirectory]. |
|
1328 | 4295 |
|
36 | 4296 |
ObjectMemory addDependent:self. |
132 | 4297 |
|
1758 | 4298 |
"Modified: / 6.9.1995 / 20:26:06 / claus" |
4299 |
"Modified: / 16.9.1997 / 14:52:46 / stefan" |
|
2252 | 4300 |
"Modified: / 12.7.1999 / 12:59:47 / cg" |
36 | 4301 |
! |
4302 |
||
132 | 4303 |
initializeCommandViewIn:frame |
4304 |
"set up the command view - can be redefined in subclasses as empty, |
|
4305 |
if no commandView is wanted" |
|
4306 |
||
4307 |
||
4308 |
commandView := EditField origin:0.0@1.0 corner:1.0@1.0 in:frame. |
|
3499 | 4309 |
"/ commandView allInset:ViewSpacing//2. |
132 | 4310 |
commandView topInset:(commandView preferredExtent y negated - ViewSpacing). |
4311 |
||
133 | 4312 |
"/ commandView contents:'** no commands which require input here **'. |
132 | 4313 |
|
142 | 4314 |
commandView entryCompletionBlock:[:contents | |
2998
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
4315 |
|newString| |
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
4316 |
|
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
4317 |
newString := self entryCompletion:contents. |
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
4318 |
newString notNil ifTrue:[ |
2803
5c913909a56b
fileNameCompletion now does exactly that;
Claus Gittinger <cg@exept.de>
parents:
2796
diff
changeset
|
4319 |
commandView contents:newString. |
5c913909a56b
fileNameCompletion now does exactly that;
Claus Gittinger <cg@exept.de>
parents:
2796
diff
changeset
|
4320 |
commandView cursorToEndOfLine. |
2998
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
4321 |
]. |
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
4322 |
]. |
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
4323 |
|
132 | 4324 |
commandView leaveAction:[:key | |
2522
036e46c50ac9
care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents:
2512
diff
changeset
|
4325 |
|cmd nCmd empty| |
036e46c50ac9
care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents:
2512
diff
changeset
|
4326 |
|
036e46c50ac9
care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents:
2512
diff
changeset
|
4327 |
(key == #CursorDown |
036e46c50ac9
care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents:
2512
diff
changeset
|
4328 |
or:[key == #CursorUp]) ifTrue:[ |
036e46c50ac9
care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents:
2512
diff
changeset
|
4329 |
nCmd := CommandHistory size. |
036e46c50ac9
care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents:
2512
diff
changeset
|
4330 |
nCmd == 0 ifTrue:[ |
036e46c50ac9
care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents:
2512
diff
changeset
|
4331 |
empty := true |
036e46c50ac9
care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents:
2512
diff
changeset
|
4332 |
] ifFalse:[ |
036e46c50ac9
care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents:
2512
diff
changeset
|
4333 |
key == #CursorUp ifTrue:[ |
036e46c50ac9
care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents:
2512
diff
changeset
|
4334 |
commandIndex == nCmd ifTrue:[ |
036e46c50ac9
care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents:
2512
diff
changeset
|
4335 |
commandView flash. |
036e46c50ac9
care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents:
2512
diff
changeset
|
4336 |
]. |
036e46c50ac9
care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents:
2512
diff
changeset
|
4337 |
commandIndex := (commandIndex + 1) min:nCmd |
036e46c50ac9
care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents:
2512
diff
changeset
|
4338 |
] ifFalse:[ |
036e46c50ac9
care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents:
2512
diff
changeset
|
4339 |
commandIndex == 1 ifTrue:[ |
036e46c50ac9
care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents:
2512
diff
changeset
|
4340 |
commandView flash. |
036e46c50ac9
care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents:
2512
diff
changeset
|
4341 |
empty := true. |
036e46c50ac9
care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents:
2512
diff
changeset
|
4342 |
]. |
036e46c50ac9
care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents:
2512
diff
changeset
|
4343 |
commandIndex := (commandIndex - 1) max:1. |
036e46c50ac9
care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents:
2512
diff
changeset
|
4344 |
]. |
036e46c50ac9
care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents:
2512
diff
changeset
|
4345 |
]. |
036e46c50ac9
care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents:
2512
diff
changeset
|
4346 |
empty == true ifTrue:[ |
036e46c50ac9
care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents:
2512
diff
changeset
|
4347 |
commandView contents:nil |
036e46c50ac9
care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents:
2512
diff
changeset
|
4348 |
] ifFalse:[ |
036e46c50ac9
care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents:
2512
diff
changeset
|
4349 |
commandView contents:(CommandHistory at:commandIndex). |
036e46c50ac9
care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents:
2512
diff
changeset
|
4350 |
] |
036e46c50ac9
care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents:
2512
diff
changeset
|
4351 |
]. |
036e46c50ac9
care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents:
2512
diff
changeset
|
4352 |
key == #Return ifTrue:[ |
036e46c50ac9
care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents:
2512
diff
changeset
|
4353 |
cmd := commandView contents string. |
036e46c50ac9
care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents:
2512
diff
changeset
|
4354 |
|
036e46c50ac9
care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents:
2512
diff
changeset
|
4355 |
subView insertLine:( |
036e46c50ac9
care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents:
2512
diff
changeset
|
4356 |
Text string:('>> ' , cmd) |
036e46c50ac9
care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents:
2512
diff
changeset
|
4357 |
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
|
4358 |
"/ ColoredListEntry string:('>> ' , cmd) color:Color blue |
2522
036e46c50ac9
care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents:
2512
diff
changeset
|
4359 |
) |
036e46c50ac9
care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents:
2512
diff
changeset
|
4360 |
before:(subView cursorLine). |
036e46c50ac9
care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents:
2512
diff
changeset
|
4361 |
subView cursorDown:1. |
133 | 4362 |
|
4363 |
"/ subView insertStringAtCursor:cmd. |
|
4364 |
"/ subView insertCharAtCursor:(Character cr). |
|
132 | 4365 |
|
2522
036e46c50ac9
care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents:
2512
diff
changeset
|
4366 |
(cmd notNil and:[cmd notEmpty]) ifTrue:[ |
036e46c50ac9
care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents:
2512
diff
changeset
|
4367 |
self class addToCommandHistory:cmd for:nil. |
036e46c50ac9
care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents:
2512
diff
changeset
|
4368 |
self doExecuteCommand:cmd replace:false. |
036e46c50ac9
care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents:
2512
diff
changeset
|
4369 |
commandView contents:nil. |
036e46c50ac9
care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents:
2512
diff
changeset
|
4370 |
commandIndex := 0 |
036e46c50ac9
care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents:
2512
diff
changeset
|
4371 |
] |
036e46c50ac9
care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents:
2512
diff
changeset
|
4372 |
] |
132 | 4373 |
]. |
4374 |
||
3499 | 4375 |
"Modified: / 7.9.1995 / 15:48:45 / claus" |
4376 |
"Modified: / 18.9.1997 / 16:55:01 / stefan" |
|
4377 |
"Modified: / 10.12.2001 / 23:57:25 / cg" |
|
132 | 4378 |
! |
4379 |
||
172 | 4380 |
initializeFilterPattern |
4381 |
"set an initial matchpattern - can be redefined in subclasses" |
|
4382 |
||
344
3f881dbee13a
use a model for the filter field
Claus Gittinger <cg@exept.de>
parents:
333
diff
changeset
|
4383 |
filterField model value:'*' |
172 | 4384 |
! |
4385 |
||
4386 |
initializeSubViewIn:frame |
|
4387 |
"set up the contents view - can be redefined in subclasses for |
|
4388 |
different view types (SoundFileBrowser/ImageBrowsers etc.)" |
|
4389 |
||
2094 | 4390 |
|textView| |
4391 |
||
4392 |
textView := HVScrollableView |
|
2572
bdb14ce83fd0
also provide the currentFileInDirectory in doIts.
Claus Gittinger <cg@exept.de>
parents:
2567
diff
changeset
|
4393 |
for:CodeView |
bdb14ce83fd0
also provide the currentFileInDirectory in doIts.
Claus Gittinger <cg@exept.de>
parents:
2567
diff
changeset
|
4394 |
miniScrollerH:true |
bdb14ce83fd0
also provide the currentFileInDirectory in doIts.
Claus Gittinger <cg@exept.de>
parents:
2567
diff
changeset
|
4395 |
miniScrollerV:false |
bdb14ce83fd0
also provide the currentFileInDirectory in doIts.
Claus Gittinger <cg@exept.de>
parents:
2567
diff
changeset
|
4396 |
in:frame. |
2094 | 4397 |
textView origin:(0.0 @ 0.0) corner:(1.0 @ 1.0). |
4398 |
||
2095 | 4399 |
"/ imagePreviewView := HVScrollableView |
4400 |
"/ for:ImageView |
|
4401 |
"/ miniScrollerH:true |
|
4402 |
"/ miniScrollerV:false |
|
4403 |
"/ in:frame. |
|
4404 |
"/ imagePreviewView origin:(0.0 @ 0.0) corner:(1.0 @ 1.0). |
|
4405 |
"/ |
|
4406 |
"/ imagePreviewView beInvisible. |
|
2094 | 4407 |
|
2572
bdb14ce83fd0
also provide the currentFileInDirectory in doIts.
Claus Gittinger <cg@exept.de>
parents:
2567
diff
changeset
|
4408 |
textView doItAction:[:theCode | |
bdb14ce83fd0
also provide the currentFileInDirectory in doIts.
Claus Gittinger <cg@exept.de>
parents:
2567
diff
changeset
|
4409 |
PositionableStream currentFileInDirectoryQuerySignal |
3747
d30bc1e54f15
Remove unused vars and asFilename sends
Stefan Vogel <sv@exept.de>
parents:
3746
diff
changeset
|
4410 |
answer:currentDirectory |
2572
bdb14ce83fd0
also provide the currentFileInDirectory in doIts.
Claus Gittinger <cg@exept.de>
parents:
2567
diff
changeset
|
4411 |
do:[ |
bdb14ce83fd0
also provide the currentFileInDirectory in doIts.
Claus Gittinger <cg@exept.de>
parents:
2567
diff
changeset
|
4412 |
Compiler |
bdb14ce83fd0
also provide the currentFileInDirectory in doIts.
Claus Gittinger <cg@exept.de>
parents:
2567
diff
changeset
|
4413 |
evaluate:theCode |
bdb14ce83fd0
also provide the currentFileInDirectory in doIts.
Claus Gittinger <cg@exept.de>
parents:
2567
diff
changeset
|
4414 |
in:nil |
bdb14ce83fd0
also provide the currentFileInDirectory in doIts.
Claus Gittinger <cg@exept.de>
parents:
2567
diff
changeset
|
4415 |
receiver:nil |
2607 | 4416 |
notifying:textView |
2572
bdb14ce83fd0
also provide the currentFileInDirectory in doIts.
Claus Gittinger <cg@exept.de>
parents:
2567
diff
changeset
|
4417 |
logged:true |
bdb14ce83fd0
also provide the currentFileInDirectory in doIts.
Claus Gittinger <cg@exept.de>
parents:
2567
diff
changeset
|
4418 |
ifFail:nil |
bdb14ce83fd0
also provide the currentFileInDirectory in doIts.
Claus Gittinger <cg@exept.de>
parents:
2567
diff
changeset
|
4419 |
] |
bdb14ce83fd0
also provide the currentFileInDirectory in doIts.
Claus Gittinger <cg@exept.de>
parents:
2567
diff
changeset
|
4420 |
]. |
bdb14ce83fd0
also provide the currentFileInDirectory in doIts.
Claus Gittinger <cg@exept.de>
parents:
2567
diff
changeset
|
4421 |
|
2094 | 4422 |
^ textView. |
1158
ea2cd788ef59
delay tabView origin setting
Claus Gittinger <cg@exept.de>
parents:
1157
diff
changeset
|
4423 |
! |
ea2cd788ef59
delay tabView origin setting
Claus Gittinger <cg@exept.de>
parents:
1157
diff
changeset
|
4424 |
|
1247 | 4425 |
postRealize |
4426 |
super postRealize. |
|
1158
ea2cd788ef59
delay tabView origin setting
Claus Gittinger <cg@exept.de>
parents:
1157
diff
changeset
|
4427 |
self showOrHideTabView. |
ea2cd788ef59
delay tabView origin setting
Claus Gittinger <cg@exept.de>
parents:
1157
diff
changeset
|
4428 |
|
1247 | 4429 |
"Created: 24.7.1997 / 18:13:46 / cg" |
172 | 4430 |
! ! |
4431 |
||
1834 | 4432 |
!FileBrowser methodsFor:'menu actions'! |
4433 |
||
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4434 |
addBookmark |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4435 |
self addBookmark:currentDirectory asFilename pathName |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4436 |
! |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4437 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4438 |
addBookmark:path |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4439 |
|idx| |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4440 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4441 |
DirectoryBookmarks isNil ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4442 |
DirectoryBookmarks := OrderedCollection new |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4443 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4444 |
idx := DirectoryBookmarks indexOf:path. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4445 |
idx == 0 ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4446 |
"/ DirectoryBookmarks size >= HistorySize ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4447 |
"/ DirectoryBookmarks removeLast. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4448 |
"/ ]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4449 |
DirectoryBookmarks addLast:path. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4450 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4451 |
! |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4452 |
|
1950 | 4453 |
copyCommandHistory |
4454 |
"copy the command history to the clipBoard" |
|
4455 |
||
4456 |
self setTextSelection:(CommandHistory asStringCollection asString). |
|
4457 |
||
4458 |
"Modified: / 29.10.1998 / 12:17:14 / cg" |
|
4459 |
! |
|
4460 |
||
1837 | 4461 |
copyFileList |
4462 |
"copy fileList to the clipBoard" |
|
4463 |
||
4464 |
self setTextSelection:(fileListView list |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4465 |
collect:[:l | |ll| |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4466 |
ll := l string withoutSeparators. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4467 |
(ll endsWith:' ...') ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4468 |
ll copyWithoutLast:4 |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4469 |
] ifFalse:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4470 |
ll |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4471 |
] |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4472 |
]) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4473 |
asStringCollection asString. |
1837 | 4474 |
|
4475 |
"Modified: / 17.8.1998 / 10:13:10 / cg" |
|
4476 |
! |
|
4477 |
||
1920
adffddc8cfc2
added #copyFilename (to clipboard)
Claus Gittinger <cg@exept.de>
parents:
1912
diff
changeset
|
4478 |
copySelectedFileName |
adffddc8cfc2
added #copyFilename (to clipboard)
Claus Gittinger <cg@exept.de>
parents:
1912
diff
changeset
|
4479 |
"copy the selected filename to the clipBoard (for easy paste)" |
adffddc8cfc2
added #copyFilename (to clipboard)
Claus Gittinger <cg@exept.de>
parents:
1912
diff
changeset
|
4480 |
|
adffddc8cfc2
added #copyFilename (to clipboard)
Claus Gittinger <cg@exept.de>
parents:
1912
diff
changeset
|
4481 |
|sel fileName| |
adffddc8cfc2
added #copyFilename (to clipboard)
Claus Gittinger <cg@exept.de>
parents:
1912
diff
changeset
|
4482 |
|
adffddc8cfc2
added #copyFilename (to clipboard)
Claus Gittinger <cg@exept.de>
parents:
1912
diff
changeset
|
4483 |
sel := fileListView selection. |
adffddc8cfc2
added #copyFilename (to clipboard)
Claus Gittinger <cg@exept.de>
parents:
1912
diff
changeset
|
4484 |
sel size == 1 ifTrue:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4485 |
fileName := fileList at:sel first. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4486 |
self setTextSelection:fileName |
1920
adffddc8cfc2
added #copyFilename (to clipboard)
Claus Gittinger <cg@exept.de>
parents:
1912
diff
changeset
|
4487 |
]. |
adffddc8cfc2
added #copyFilename (to clipboard)
Claus Gittinger <cg@exept.de>
parents:
1912
diff
changeset
|
4488 |
! |
adffddc8cfc2
added #copyFilename (to clipboard)
Claus Gittinger <cg@exept.de>
parents:
1912
diff
changeset
|
4489 |
|
3010 | 4490 |
copySelectedPathName |
4491 |
"copy the selected files pathname to the clipBoard (for easy paste)" |
|
4492 |
||
4493 |
|sel fileName| |
|
4494 |
||
4495 |
sel := fileListView selection. |
|
4496 |
sel size == 1 ifTrue:[ |
|
4497 |
fileName := currentDirectory constructString:(fileList at:sel first). |
|
4498 |
self setTextSelection:fileName |
|
4499 |
]. |
|
4500 |
! |
|
4501 |
||
2562
da7680fe8407
first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents:
2550
diff
changeset
|
4502 |
createProjectAndOpenProjectBrowser |
da7680fe8407
first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents:
2550
diff
changeset
|
4503 |
|nm f s| |
da7680fe8407
first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents:
2550
diff
changeset
|
4504 |
|
da7680fe8407
first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents:
2550
diff
changeset
|
4505 |
nm := currentDirectory baseName. |
da7680fe8407
first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents:
2550
diff
changeset
|
4506 |
f := (currentDirectory construct:nm) withSuffix:'prj'. |
da7680fe8407
first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents:
2550
diff
changeset
|
4507 |
f exists ifTrue:[ |
da7680fe8407
first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents:
2550
diff
changeset
|
4508 |
self warn:'A file named ' , f baseName , ' alredy exists.'. |
da7680fe8407
first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents:
2550
diff
changeset
|
4509 |
^ self. |
da7680fe8407
first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents:
2550
diff
changeset
|
4510 |
]. |
da7680fe8407
first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents:
2550
diff
changeset
|
4511 |
s := f writeStream. |
da7680fe8407
first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents:
2550
diff
changeset
|
4512 |
s nextPutAll:' |
da7680fe8407
first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents:
2550
diff
changeset
|
4513 |
name ''' , nm , ''' |
da7680fe8407
first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents:
2550
diff
changeset
|
4514 |
type #classLibrary |
da7680fe8407
first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents:
2550
diff
changeset
|
4515 |
package #''private:' , nm , ''' |
da7680fe8407
first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents:
2550
diff
changeset
|
4516 |
prerequisites nil |
da7680fe8407
first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents:
2550
diff
changeset
|
4517 |
|
da7680fe8407
first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents:
2550
diff
changeset
|
4518 |
classes #( ) |
da7680fe8407
first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents:
2550
diff
changeset
|
4519 |
'. |
da7680fe8407
first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents:
2550
diff
changeset
|
4520 |
s close. |
da7680fe8407
first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents:
2550
diff
changeset
|
4521 |
ProjectBrowser openOnFile:f. |
da7680fe8407
first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents:
2550
diff
changeset
|
4522 |
! |
da7680fe8407
first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents:
2550
diff
changeset
|
4523 |
|
1834 | 4524 |
menuExit |
4525 |
self closeRequest |
|
4526 |
||
4527 |
"Created: / 4.8.1998 / 13:41:38 / cg" |
|
4528 |
! |
|
4529 |
||
4530 |
menuOSCommand |
|
4531 |
self fileExecute |
|
4532 |
||
4533 |
"Created: / 4.8.1998 / 14:06:54 / cg" |
|
4534 |
! |
|
4535 |
||
4536 |
menuShowFileBrowserDocumentation |
|
4537 |
||
4538 |
"Created: / 4.8.1998 / 14:03:57 / cg" |
|
4539 |
! |
|
4540 |
||
4541 |
openAboutThisApplication |
|
4542 |
"opens an about box for this application." |
|
4543 |
||
3503 | 4544 |
DialogBox aboutClass:self class. |
4545 |
"/ |rev myClass clsRev msg| |
|
4546 |
"/ |
|
4547 |
"/ rev := ''. |
|
4548 |
"/ myClass := self class. |
|
4549 |
"/ |
|
4550 |
"/ (clsRev := myClass revision) notNil ifTrue: [rev := ' (rev: ', clsRev printString, ')']. |
|
4551 |
"/ |
|
4552 |
"/ msg := '\' withCRs , myClass name asBoldText, rev. |
|
4553 |
"/ |
|
4554 |
"/ AboutBox isNil ifTrue:[ |
|
4555 |
"/ "/ this handles bad installations of ST/X, |
|
4556 |
"/ "/ where the AboutBox is missing. |
|
4557 |
"/ "/ (May vanish in the future) |
|
4558 |
"/ ^ self information:msg |
|
4559 |
"/ ]. |
|
4560 |
"/ |
|
4561 |
"/ Dialog |
|
4562 |
"/ about:(resources string:msg) |
|
4563 |
"/ label:(resources string:'About FileBrowser') |
|
4564 |
"/ icon:self class defaultIcon |
|
4565 |
"/ |
|
4566 |
"/ "Modified: / 17.11.2001 / 23:07:25 / cg" |
|
1834 | 4567 |
! |
4568 |
||
4569 |
openHTMLDocument:relativeDocPath |
|
4570 |
HTMLDocumentView openFullOnDocumentationFile:relativeDocPath |
|
4571 |
||
4572 |
"Created: / 4.8.1998 / 14:06:10 / cg" |
|
4573 |
! |
|
4574 |
||
4575 |
pullDownMenu |
|
4576 |
"return the top (pullDown) menu" |
|
4577 |
||
4578 |
<resource: #programMenu> |
|
4579 |
||
3330 | 4580 |
^ self menuFromSpec:self class menuSpec. |
4581 |
"/ |m| |
|
4582 |
"/ |
|
4583 |
"/ m := self class menuSpec. |
|
4584 |
"/ m := m decodeAsLiteralArray. |
|
4585 |
"/ m receiver:self. |
|
4586 |
"/ m findGuiResourcesIn:self. |
|
4587 |
"/ ^ m. |
|
1834 | 4588 |
|
4589 |
"Modified: / 14.8.1998 / 14:09:12 / cg" |
|
4590 |
"Created: / 14.8.1998 / 14:14:16 / cg" |
|
4591 |
! |
|
4592 |
||
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4593 |
removeBookmark |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4594 |
DirectoryBookmarks isNil ifTrue:[ ^ self]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4595 |
DirectoryBookmarks remove:(currentDirectory asFilename pathName) ifAbsent:nil. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4596 |
! |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4597 |
|
1834 | 4598 |
showAboutSTX |
4599 |
ToolApplicationModel openAboutSTX |
|
4600 |
||
4601 |
"Created: / 14.8.1998 / 13:18:41 / cg" |
|
4602 |
! |
|
4603 |
||
4604 |
sortChanged |
|
2020 | 4605 |
"/ Transcript show:'fBrowser:'; showCR:sortByWhat value. |
1834 | 4606 |
self updateCurrentDirectory |
4607 |
||
4608 |
"Created: / 14.8.1998 / 16:17:20 / cg" |
|
4609 |
"Modified: / 14.8.1998 / 16:44:00 / cg" |
|
4610 |
! ! |
|
4611 |
||
2102 | 4612 |
!FileBrowser methodsFor:'menu actions - cvs'! |
4613 |
||
3467 | 4614 |
cvsAddAndCommitSelection |
4615 |
"add files (or all in current directory) and commit" |
|
4616 |
||
4617 |
self cvsAddSelectionWithCommit:true |
|
4618 |
! |
|
4619 |
||
2424 | 4620 |
cvsAddSelection |
4621 |
"add files (or all in current directory)" |
|
4622 |
||
3467 | 4623 |
self cvsAddSelectionWithCommit:false |
4624 |
! |
|
4625 |
||
4626 |
cvsAddSelectionWithCommit:withCommit |
|
4627 |
"add files (or all in current directory) with optional commit" |
|
4628 |
||
2424 | 4629 |
|sel log| |
4630 |
||
4631 |
log := Dialog |
|
4632 |
requestText:(resources string:'enter initial log message') |
|
4633 |
lines:10 |
|
4634 |
columns:70 |
|
4635 |
initialAnswer:nil. |
|
4636 |
||
4637 |
log notNil ifTrue:[ |
|
4638 |
sel := fileListView selection. |
|
4639 |
sel size > 0 ifTrue:[ |
|
4640 |
sel := sel collect:[:rawIndex | fileList at:rawIndex]. |
|
4641 |
sel do:[:fn | |
|
4642 |
self |
|
4643 |
doExecuteCommand:('cvs add -m ''' , log , ''' ' , fn) replace:false |
|
4644 |
] |
|
4645 |
] ifFalse:[ |
|
4646 |
self |
|
4647 |
doExecuteCommand:('cvs add -l -m ''' , log , ''' *') replace:false |
|
4648 |
]. |
|
3467 | 4649 |
withCommit ifTrue:[ |
4650 |
self doExecuteCommand:('cvs commit -l -m ''' , log , '''') replace:false |
|
4651 |
] |
|
2424 | 4652 |
] |
4653 |
! |
|
4654 |
||
2386 | 4655 |
cvsCommitSelection |
4656 |
"commit files (or all in current directory)" |
|
4657 |
||
2956 | 4658 |
|nSel sel log msg| |
4659 |
||
4660 |
nSel := fileListView selection size. |
|
4661 |
nSel == 1 ifTrue:[ |
|
4662 |
msg := resources string:'enter log message for checkIn of ''%1''' with:(fileList at:fileListView selection first) |
|
4663 |
] ifFalse:[ |
|
4664 |
nSel > 1 ifTrue:[ |
|
4665 |
msg := resources string:'enter log message for %1 files to checkIn' with:nSel printString |
|
4666 |
] ifFalse:[ |
|
4667 |
msg := resources string:'enter log message for checkIn' |
|
4668 |
] |
|
4669 |
]. |
|
2386 | 4670 |
|
4671 |
log := Dialog |
|
2956 | 4672 |
requestText:msg |
2386 | 4673 |
lines:10 |
4674 |
columns:70 |
|
4675 |
initialAnswer:nil. |
|
4676 |
||
4677 |
log notNil ifTrue:[ |
|
4678 |
sel := fileListView selection. |
|
4679 |
sel size > 0 ifTrue:[ |
|
4680 |
sel := sel collect:[:rawIndex | fileList at:rawIndex]. |
|
4681 |
sel do:[:fn | |
|
4682 |
self |
|
4683 |
doExecuteCommand:('cvs commit -m ''' , log , ''' ' , fn) replace:false |
|
4684 |
] |
|
4685 |
] ifFalse:[ |
|
4686 |
self |
|
4687 |
doExecuteCommand:('cvs commit -l -m ''' , log , '''') replace:false |
|
4688 |
]. |
|
4689 |
] |
|
4690 |
||
4691 |
"Modified: / 16.12.1998 / 17:30:31 / cg" |
|
4692 |
! |
|
4693 |
||
2102 | 4694 |
cvsRemoveFileAndContainer |
4695 |
"remove the selected file(s) and their CVS containers. |
|
4696 |
Query if user really wants to really remove them." |
|
4697 |
||
4698 |
|sel q| |
|
4699 |
||
4700 |
sel := fileListView selection. |
|
4701 |
sel size > 0 ifTrue:[ |
|
2868 | 4702 |
sel := sel collect:[:rawIndex | fileList at:rawIndex]. |
4703 |
sel size > 1 ifTrue:[ |
|
2939 | 4704 |
q := resources string:'Remove %1 selected files and their CVS containers ?' with:(sel size) |
2868 | 4705 |
] ifFalse:[ |
2939 | 4706 |
q := resources string:'Remove ''%1'' and its CVS container ?' with:(sel first allBold) |
2868 | 4707 |
]. |
4708 |
(self sensor shiftDown |
|
4709 |
or:[self ask:q yesButton:'remove']) ifTrue:[ |
|
4710 |
self withCursor:(Cursor wait) do:[ |
|
4711 |
self doRemoveAndRemoveFromCVS:sel |
|
4712 |
] |
|
4713 |
] |
|
2102 | 4714 |
] |
4715 |
||
4716 |
"Modified: / 16.12.1998 / 17:30:31 / cg" |
|
4717 |
! |
|
4718 |
||
4719 |
cvsUpdateDirectoryLocal |
|
4720 |
"update this directory" |
|
4721 |
||
4722 |
self |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4723 |
doExecuteCommand:'cvs upd -l' replace:false |
2102 | 4724 |
|
4725 |
"Modified: / 16.12.1998 / 17:30:31 / cg" |
|
4726 |
! |
|
4727 |
||
4728 |
cvsUpdateDirectoryRecursive |
|
4729 |
"update this directory" |
|
4730 |
||
4731 |
self |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4732 |
doExecuteCommand:'cvs upd -d' replace:false |
2102 | 4733 |
|
4734 |
"Modified: / 16.12.1998 / 17:30:31 / cg" |
|
4735 |
! |
|
4736 |
||
4737 |
cvsUpdateSelection |
|
4738 |
"update selected files" |
|
4739 |
||
4740 |
|sel| |
|
4741 |
||
4742 |
sel := fileListView selection. |
|
4743 |
sel size > 0 ifTrue:[ |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4744 |
sel := sel collect:[:rawIndex | fileList at:rawIndex]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4745 |
sel do:[:fn | |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4746 |
self |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4747 |
doExecuteCommand:('cvs upd ' , fn) replace:false |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4748 |
] |
2102 | 4749 |
]. |
4750 |
! |
|
4751 |
||
4752 |
doRemoveAndRemoveFromCVS:filesToRemove |
|
4753 |
"remove the selected file(s) and their CVS containers - no questions asked" |
|
4754 |
||
4755 |
|msg idx needUpdate toRemove updateRunning yesToAll| |
|
4756 |
||
4757 |
updateRunning := listUpdateProcess notNil. |
|
4758 |
self stopUpdateProcess. |
|
4759 |
toRemove := OrderedCollection new. |
|
4760 |
||
4761 |
"/ |
|
4762 |
"/ did the directory change in the meanwhile ? |
|
4763 |
"/ |
|
4764 |
needUpdate := (currentDirectory modificationTime > timeOfLastCheck). |
|
4765 |
||
4766 |
yesToAll := false. |
|
4767 |
lockUpdate := true. |
|
4768 |
[ |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4769 |
filesToRemove do:[:fileName | |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4770 |
|f| |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4771 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4772 |
f := currentDirectory construct:fileName. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4773 |
OperatingSystem accessDeniedErrorSignal handle:[:ex| |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4774 |
"was not able to remove it" |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4775 |
msg := (resources string:'cannot remove ''%1'' !!' with:fileName). |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4776 |
self showAlert:msg with:(OperatingSystem lastErrorString) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4777 |
] do:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4778 |
|answer contents| |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4779 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4780 |
(f isSymbolicLink not) ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4781 |
self |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4782 |
doExecuteCommand:('cvs remove -f ' , f baseName) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4783 |
replace:false. |
2102 | 4784 |
|
4785 |
" |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4786 |
self show:nil |
2102 | 4787 |
" |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4788 |
idx := fileList indexOf:fileName. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4789 |
idx ~~ 0 ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4790 |
toRemove add:idx. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4791 |
] |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4792 |
] |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4793 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4794 |
]. |
3596
9761af1f3f72
#valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents:
3568
diff
changeset
|
4795 |
] ensure:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4796 |
lockUpdate := false. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4797 |
fileListView setSelection:nil. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4798 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4799 |
"/ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4800 |
"/ remove reverse - otherwise indices are wrong |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4801 |
"/ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4802 |
toRemove sort. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4803 |
toRemove reverseDo:[:idx | |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4804 |
fileList removeIndex:idx. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4805 |
fileListView removeIndex:idx. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4806 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4807 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4808 |
updateRunning ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4809 |
self updateCurrentDirectory |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4810 |
] ifFalse:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4811 |
" |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4812 |
install a new check after some time |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4813 |
" |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4814 |
needUpdate ifFalse:[timeOfLastCheck := AbsoluteTime now]. |
3520
83cf11e1bf32
schedule checkBlock for the right process
Claus Gittinger <cg@exept.de>
parents:
3503
diff
changeset
|
4815 |
self scheduleCheckBlock. |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4816 |
] |
2102 | 4817 |
]. |
4818 |
||
4819 |
self |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4820 |
doExecuteCommand:('cvs commit -m ''removed via FileBrowser''') |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4821 |
replace:false. |
2102 | 4822 |
|
4823 |
"Modified: / 21.10.1998 / 17:02:11 / cg" |
|
4824 |
! ! |
|
4825 |
||
172 | 4826 |
!FileBrowser methodsFor:'misc user interaction'! |
4827 |
||
1786 | 4828 |
closeRequest |
4829 |
"exit FileBrowser" |
|
4830 |
||
3251 | 4831 |
(self askIfModified:'Contents has not been saved.\\Modifications will be lost when FileBrowser is closed.' |
4832 |
yesButton:'Close') |
|
1786 | 4833 |
ifTrue:[ |
3251 | 4834 |
"/ self windowGroup closeDownViews. |
4835 |
super closeRequest |
|
1786 | 4836 |
] |
4837 |
||
4838 |
"Created: / 3.8.1998 / 19:55:06 / cg" |
|
1834 | 4839 |
"Modified: / 4.8.1998 / 18:21:03 / cg" |
1786 | 4840 |
! |
4841 |
||
1339
4b712d8c1738
Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents:
1336
diff
changeset
|
4842 |
discardChangesDialog |
4b712d8c1738
Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents:
1336
diff
changeset
|
4843 |
"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
|
4844 |
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
|
4845 |
|
3658 | 4846 |
^ self askIfModified:'Contents has not been saved.\\Modifications will be lost when directory is changed.' |
4847 |
yesButton:'Change' |
|
1339
4b712d8c1738
Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents:
1336
diff
changeset
|
4848 |
|
4b712d8c1738
Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents:
1336
diff
changeset
|
4849 |
"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
|
4850 |
! |
4b712d8c1738
Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents:
1336
diff
changeset
|
4851 |
|
2998
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
4852 |
entryCompletion:contents |
3527 | 4853 |
|newString lastWord expandedWord idx onlyOne addSpace fn| |
2998
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
4854 |
|
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
4855 |
"/ find the last word. |
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
4856 |
"/ used to be 'contents asCollectionOfWords last', |
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
4857 |
"/ but we have to care for escaped spaces here (unix) ... |
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
4858 |
|
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
4859 |
idx := contents size. |
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
4860 |
OperatingSystem isUNIXlike ifFalse:[ |
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
4861 |
"/ under MSDOS, the backslash is a directory separator |
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
4862 |
idx := contents lastIndexOf:Character space startingAt:idx. |
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
4863 |
] ifTrue:[ |
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
4864 |
"/ under UNIX, the backslash is a special character escape |
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
4865 |
idx := idx + 1. |
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
4866 |
[ |
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
4867 |
idx := contents lastIndexOf:Character space startingAt:idx-1. |
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
4868 |
] doWhile:[ |
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
4869 |
idx > 1 and:[ (contents at:idx-1) = $\ ] |
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
4870 |
]. |
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
4871 |
]. |
3185 | 4872 |
"/ idx == 0 ifTrue:[ |
4873 |
"/ commandView flash. |
|
4874 |
"/ ^ nil. |
|
4875 |
"/ ]. |
|
2998
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
4876 |
|
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
4877 |
lastWord := contents copyFrom:idx + 1. |
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
4878 |
OperatingSystem isUNIXlike ifTrue:[ |
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
4879 |
(lastWord includes:$\) ifTrue:[ |
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
4880 |
lastWord := lastWord copyReplaceAll:$\ withAll:''. |
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
4881 |
]. |
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
4882 |
]. |
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
4883 |
|
3020 | 4884 |
onlyOne := true. |
2998
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
4885 |
expandedWord := Filename |
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
4886 |
filenameCompletionFor:lastWord |
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
4887 |
directory:currentDirectory |
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
4888 |
directoriesOnly:false |
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
4889 |
filesOnly:false |
3020 | 4890 |
ifMultiple:[:dir | onlyOne := false. commandView flash.]. |
4891 |
||
4892 |
addSpace := false. |
|
4893 |
onlyOne ifTrue:[ |
|
3022 | 4894 |
fn := currentDirectory construct:expandedWord. |
4895 |
(fn exists and:[fn isDirectory not]) ifTrue:[ |
|
3020 | 4896 |
addSpace := true. |
4897 |
]. |
|
4898 |
]. |
|
2998
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
4899 |
|
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
4900 |
OperatingSystem isUNIXlike ifTrue:[ |
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
4901 |
expandedWord := expandedWord copyReplaceAll:(Character space) withAll:'\ '. |
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
4902 |
expandedWord := expandedWord copyReplaceAll:($') withAll:'\'''. |
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
4903 |
expandedWord := expandedWord copyReplaceAll:($() withAll:'\('. |
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
4904 |
expandedWord := expandedWord copyReplaceAll:($)) withAll:'\)'. |
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
4905 |
expandedWord := expandedWord copyReplaceAll:($[) withAll:'\['. |
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
4906 |
expandedWord := expandedWord copyReplaceAll:($]) withAll:'\]'. |
2999 | 4907 |
expandedWord := expandedWord copyReplaceAll:($&) withAll:'\&'. |
4908 |
expandedWord := expandedWord copyReplaceAll:($|) withAll:'\|'. |
|
4909 |
expandedWord := expandedWord copyReplaceAll:($;) withAll:'\;'. |
|
2998
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
4910 |
]. |
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
4911 |
|
3020 | 4912 |
addSpace ifTrue:[ |
4913 |
expandedWord := expandedWord , ' ' |
|
4914 |
]. |
|
2998
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
4915 |
newString := (contents copyTo:idx) , expandedWord. |
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
4916 |
|
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
4917 |
^ newString |
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
4918 |
! |
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
4919 |
|
346 | 4920 |
filterPatternChanged |
1911
6d1b77eda98f
check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents:
1903
diff
changeset
|
4921 |
fileListView scrollToTop. |
6d1b77eda98f
check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents:
1903
diff
changeset
|
4922 |
fileListView deselect. |
346 | 4923 |
self updateCurrentDirectory |
1911
6d1b77eda98f
check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents:
1903
diff
changeset
|
4924 |
|
6d1b77eda98f
check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents:
1903
diff
changeset
|
4925 |
"Modified: / 3.10.1998 / 18:23:34 / cg" |
346 | 4926 |
! |
4927 |
||
172 | 4928 |
update:what with:someArgument from:changedObject |
4929 |
realized ifFalse:[^ self]. |
|
36 | 4930 |
|
172 | 4931 |
(what == #aboutToExit) ifTrue:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4932 |
"system wants to shut down this |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4933 |
- if text was modified, pop up, and ask user and save if requested." |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4934 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4935 |
(subView modified and:[subView contentsWasSaved not]) ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4936 |
self raiseDeiconified. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4937 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4938 |
(self |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4939 |
ask:(resources at:'FileBrowser:\\contents has not been saved.\\Save before exiting ?') |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4940 |
yesButton:'save' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4941 |
noButton:'don''t save') |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4942 |
ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4943 |
subView acceptAction notNil ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4944 |
subView accept |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4945 |
] ifFalse:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4946 |
subView save |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4947 |
] |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4948 |
] |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4949 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4950 |
^ self |
172 | 4951 |
]. |
4952 |
changedObject == tabSpec ifTrue:[ |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4953 |
fileListView invalidate |
172 | 4954 |
]. |
380 | 4955 |
|
585
be0241bf7268
use #invalidate instead of #redraw
Claus Gittinger <cg@exept.de>
parents:
564
diff
changeset
|
4956 |
"Modified: 29.5.1996 / 16:13:43 / cg" |
172 | 4957 |
! ! |
4958 |
||
4959 |
!FileBrowser methodsFor:'pathField user interaction'! |
|
4960 |
||
1271 | 4961 |
addDirToJavaClassPath |
4962 |
"add the current path to javas classPath |
|
4963 |
(only available with ST/J System" |
|
4964 |
||
4965 |
Java addToClassPath:currentDirectory pathName |
|
4966 |
||
4967 |
"Modified: 14.12.1996 / 15:37:47 / cg" |
|
4968 |
"Created: 1.8.1997 / 21:25:22 / cg" |
|
4969 |
! |
|
4970 |
||
1272 | 4971 |
addDirToJavaSourcePath |
4972 |
"add the current path to javas sourcePath |
|
4973 |
(only available with ST/J System" |
|
4974 |
||
4975 |
Java addToSourcePath:currentDirectory pathName |
|
4976 |
||
4977 |
"Modified: 14.12.1996 / 15:37:47 / cg" |
|
4978 |
"Created: 2.8.1997 / 14:11:19 / cg" |
|
4979 |
! |
|
4980 |
||
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4981 |
bookmarksMenuSpec |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4982 |
"return the bookmarksMenu for the path label" |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4983 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4984 |
<resource: #programMenu> |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4985 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4986 |
^ self menuFromSpec:(self class bookmarksMenuSpec). |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4987 |
! |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4988 |
|
172 | 4989 |
changeCurrentDirectory |
4990 |
"if text was modified show a queryBox, |
|
1329 | 4991 |
otherwise ask for & change to that directory" |
172 | 4992 |
|
3658 | 4993 |
"/ self discardChangesDialog ifTrue:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4994 |
self queryForDirectoryToChange |
3658 | 4995 |
"/ ] |
1329 | 4996 |
|
4997 |
"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
|
4998 |
"Modified: 2.10.1997 / 14:09:02 / stefan" |
36 | 4999 |
! |
5000 |
||
172 | 5001 |
changeDirectoryTo:aDirectoryName |
5002 |
"sent from label menu to change back to a previous directory" |
|
132 | 5003 |
|
1339
4b712d8c1738
Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents:
1336
diff
changeset
|
5004 |
self discardChangesDialog ifTrue:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5005 |
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
|
5006 |
]. |
4b712d8c1738
Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents:
1336
diff
changeset
|
5007 |
|
1737 | 5008 |
"Modified: / 2.10.1997 / 14:09:24 / stefan" |
5009 |
"Modified: / 21.7.1998 / 16:38:03 / cg" |
|
172 | 5010 |
! |
5011 |
||
1329 | 5012 |
changeToDefaultDirectory |
5013 |
"if text was modified show a queryBox, |
|
5014 |
otherwise change immediately to the default directory" |
|
5015 |
||
1339
4b712d8c1738
Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents:
1336
diff
changeset
|
5016 |
self discardChangesDialog ifTrue:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5017 |
self doChangeToDefaultDirectory |
1329 | 5018 |
] |
5019 |
||
5020 |
"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
|
5021 |
"Modified: 2.10.1997 / 14:09:33 / stefan" |
1329 | 5022 |
! |
5023 |
||
172 | 5024 |
changeToHomeDirectory |
5025 |
"if text was modified show a queryBox, |
|
1329 | 5026 |
otherwise change immediately to the home directory" |
132 | 5027 |
|
1339
4b712d8c1738
Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents:
1336
diff
changeset
|
5028 |
self discardChangesDialog ifTrue:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5029 |
self doChangeToHomeDirectory |
172 | 5030 |
] |
1329 | 5031 |
|
5032 |
"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
|
5033 |
"Modified: 2.10.1997 / 14:09:42 / stefan" |
172 | 5034 |
! |
45 | 5035 |
|
172 | 5036 |
changeToParentDirectory |
5037 |
"if text was modified show a queryBox, |
|
1329 | 5038 |
otherwise change immediately to the parent directory" |
45 | 5039 |
|
1339
4b712d8c1738
Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents:
1336
diff
changeset
|
5040 |
self discardChangesDialog ifTrue:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5041 |
self doChangeToParentDirectory |
36 | 5042 |
] |
1329 | 5043 |
|
5044 |
"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
|
5045 |
"Modified: 2.10.1997 / 14:09:55 / stefan" |
98 | 5046 |
! |
5047 |
||
172 | 5048 |
copyPath |
5049 |
"copy current path into cut & paste buffer" |
|
5050 |
||
873 | 5051 |
self setTextSelection:currentDirectory pathName |
5052 |
||
5053 |
"Modified: 14.12.1996 / 15:37:47 / cg" |
|
172 | 5054 |
! |
5055 |
||
1893
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
5056 |
fileAddToJavaClassPath |
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
5057 |
"add the current path to javas classPath |
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
5058 |
(only available with ST/J System" |
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
5059 |
|
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
5060 |
|f| |
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
5061 |
|
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
5062 |
f := self getSelectedFileName. |
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
5063 |
f isNil ifTrue:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5064 |
^ self addDirToJavaClassPath |
1893
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
5065 |
]. |
3747
d30bc1e54f15
Remove unused vars and asFilename sends
Stefan Vogel <sv@exept.de>
parents:
3746
diff
changeset
|
5066 |
f := currentDirectory construct:f. |
1893
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
5067 |
Java addToClassPath:(f pathName) |
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
5068 |
|
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
5069 |
"Created: / 9.11.1998 / 05:41:34 / cg" |
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
5070 |
"Modified: / 9.11.1998 / 05:56:00 / cg" |
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
5071 |
! |
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
5072 |
|
2368 | 5073 |
fileAddToJavaSourcePath |
5074 |
"add the current path to javas sourcePath |
|
5075 |
(only available with ST/J System" |
|
5076 |
||
5077 |
|f| |
|
5078 |
||
5079 |
f := self getSelectedFileName. |
|
5080 |
f isNil ifTrue:[ |
|
5081 |
^ self addDirToJavaSourcePath |
|
5082 |
]. |
|
3747
d30bc1e54f15
Remove unused vars and asFilename sends
Stefan Vogel <sv@exept.de>
parents:
3746
diff
changeset
|
5083 |
f := currentDirectory construct:f. |
2368 | 5084 |
Java addToSourcePath:(f pathName) |
5085 |
||
5086 |
"Created: / 9.11.1998 / 05:41:34 / cg" |
|
5087 |
"Modified: / 9.11.1998 / 05:56:00 / cg" |
|
5088 |
! |
|
5089 |
||
1893
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
5090 |
fileRemoveFromJavaClassPath |
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
5091 |
"remove the current path from javas classPath |
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
5092 |
(only available with ST/J System" |
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
5093 |
|
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
5094 |
|f| |
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
5095 |
|
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
5096 |
f := self getSelectedFileName. |
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
5097 |
f isNil ifTrue:[ |
2368 | 5098 |
^ self removeDirFromJavaClassPath |
1893
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
5099 |
]. |
3747
d30bc1e54f15
Remove unused vars and asFilename sends
Stefan Vogel <sv@exept.de>
parents:
3746
diff
changeset
|
5100 |
f := currentDirectory construct:f. |
1893
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
5101 |
Java removeFromClassPath:(f pathName) |
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
5102 |
|
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
5103 |
"Created: / 9.11.1998 / 05:42:05 / cg" |
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
5104 |
"Modified: / 9.11.1998 / 05:56:14 / cg" |
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
5105 |
! |
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
5106 |
|
2368 | 5107 |
fileRemoveFromJavaSourcePath |
5108 |
"remove the current path from javas sourcePath |
|
5109 |
(only available with ST/J System" |
|
5110 |
||
5111 |
|f| |
|
5112 |
||
5113 |
f := self getSelectedFileName. |
|
5114 |
f isNil ifTrue:[ |
|
5115 |
^ self removeDirFromJavaSourcePath |
|
5116 |
]. |
|
3747
d30bc1e54f15
Remove unused vars and asFilename sends
Stefan Vogel <sv@exept.de>
parents:
3746
diff
changeset
|
5117 |
f := currentDirectory construct:f. |
2368 | 5118 |
Java removeFromSourcePath:(f pathName) |
5119 |
||
5120 |
"Created: / 9.11.1998 / 05:42:05 / cg" |
|
5121 |
"Modified: / 9.11.1998 / 05:56:14 / cg" |
|
5122 |
! |
|
5123 |
||
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5124 |
historyMenuSpec |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5125 |
"return the historyMenu for the path label" |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5126 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5127 |
<resource: #programMenu> |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5128 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5129 |
^ self menuFromSpec:(self class historyMenuSpec). |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5130 |
! |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5131 |
|
172 | 5132 |
labelMenu |
1040 | 5133 |
"return the popUpMenu for the path label" |
5134 |
||
1235
13610578a5d2
resource flag: #menu -> #programMenu
Claus Gittinger <cg@exept.de>
parents:
1227
diff
changeset
|
5135 |
<resource: #programMenu> |
1040 | 5136 |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5137 |
^ self menuFromSpec:(self class directoryMenuSpec). |
1834 | 5138 |
! |
5139 |
||
5140 |
labelMenu_old |
|
5141 |
"return the popUpMenu for the path label" |
|
5142 |
||
5143 |
<resource: #programMenu> |
|
5144 |
||
1737 | 5145 |
|items menu currentIndex| |
1736
36cab4d1d655
remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents:
1735
diff
changeset
|
5146 |
|
36cab4d1d655
remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents:
1735
diff
changeset
|
5147 |
items := #( |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5148 |
('copy path' copyPath ) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5149 |
('-' ) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5150 |
('up' changeToParentDirectory ) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5151 |
('back' changeToPreviousDirectory ) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5152 |
('change to home-directory' changeToHomeDirectory ) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5153 |
('change to default-directory' changeToDefaultDirectory ) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5154 |
('change directory ...' changeCurrentDirectory ) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5155 |
). |
1400 | 5156 |
|
5157 |
(JavaClassReader notNil and:[JavaClassReader isLoaded]) ifTrue:[ |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5158 |
items := items , #( |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5159 |
( '-') |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5160 |
( 'add to JavaClassPath' addDirToJavaClassPath) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5161 |
( 'add to JavaSourcePath' addDirToJavaSourcePath) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5162 |
( 'remove from JavaClassPath' removeDirFromJavaClassPath) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5163 |
( 'remove from JavaSourcePath' removeDirFromJavaSourcePath) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5164 |
). |
1271 | 5165 |
]. |
5166 |
||
172 | 5167 |
DirectoryHistory size > 0 ifTrue:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5168 |
items := items copyWith:#('-'). |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5169 |
items := items , |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5170 |
(DirectoryHistory |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5171 |
collect:[:dirName | |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5172 |
Array |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5173 |
with:dirName |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5174 |
with:#changeDirectoryTo: |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5175 |
with:nil |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5176 |
with:dirName |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5177 |
] |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5178 |
). |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5179 |
currentIndex := items findFirst:[:i | (i at:1) = currentDirectory pathName]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5180 |
currentIndex == 0 ifTrue:[currentIndex := nil]. |
123 | 5181 |
]. |
172 | 5182 |
|
5183 |
menu := PopUpMenu |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5184 |
itemList:items |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5185 |
resources:resources. |
172 | 5186 |
|
5187 |
previousDirectory isNil ifTrue:[ |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5188 |
menu disable:#changeToPreviousDirectory. |
132 | 5189 |
]. |
1737 | 5190 |
currentIndex notNil ifTrue:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5191 |
menu disable:currentIndex |
1737 | 5192 |
]. |
1400 | 5193 |
(JavaClassReader notNil and:[JavaClassReader isLoaded]) ifTrue:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5194 |
(Java classPath includes:currentDirectory pathName) ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5195 |
menu disable:#addDirToJavaClassPath |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5196 |
] ifFalse:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5197 |
menu disable:#removeDirFromJavaClassPath |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5198 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5199 |
(Java sourcePath includes:currentDirectory pathName) ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5200 |
menu disable:#addDirToJavaSourcePath |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5201 |
] ifFalse:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5202 |
menu disable:#removeDirFromJavaSourcePath |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5203 |
]. |
1393 | 5204 |
]. |
172 | 5205 |
^menu. |
1040 | 5206 |
|
1737 | 5207 |
"Modified: / 21.7.1998 / 16:43:25 / cg" |
1834 | 5208 |
"Created: / 14.8.1998 / 12:10:02 / cg" |
172 | 5209 |
! |
5210 |
||
1327 | 5211 |
pathChanged:newPath |
1339
4b712d8c1738
Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents:
1336
diff
changeset
|
5212 |
"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
|
5213 |
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
|
5214 |
|
2135
88eb91efc5dd
care for caseless systems when entering a fileName
Claus Gittinger <cg@exept.de>
parents:
2129
diff
changeset
|
5215 |
|f name lcName idx| |
1339
4b712d8c1738
Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents:
1336
diff
changeset
|
5216 |
|
4b712d8c1738
Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents:
1336
diff
changeset
|
5217 |
self discardChangesDialog ifTrue:[ |
2216
b84ee099f484
dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
5218 |
f := newPath asFilename. |
b84ee099f484
dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
5219 |
(f isDirectory) ifTrue:[ |
b84ee099f484
dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
5220 |
self changeDirectoryTo:newPath |
b84ee099f484
dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
5221 |
] ifFalse:[ |
b84ee099f484
dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
5222 |
self changeDirectoryTo:(f directoryName). |
b84ee099f484
dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
5223 |
"/ self changed:#path. |
b84ee099f484
dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
5224 |
name := f baseName. |
b84ee099f484
dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
5225 |
idx := fileList indexOf:name. |
b84ee099f484
dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
5226 |
idx = 0 ifTrue:[ |
b84ee099f484
dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
5227 |
lcName := name asLowercase. |
b84ee099f484
dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
5228 |
f class isCaseSensitive ifFalse:[ |
b84ee099f484
dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
5229 |
idx := fileList findFirst:[:nm | nm asLowercase = lcName]. |
b84ee099f484
dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
5230 |
] |
b84ee099f484
dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
5231 |
]. |
b84ee099f484
dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
5232 |
fileListView selection:idx. |
b84ee099f484
dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
5233 |
self fileSelect:name. |
b84ee099f484
dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
5234 |
self fileGet:true. |
b84ee099f484
dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
5235 |
]. |
1339
4b712d8c1738
Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents:
1336
diff
changeset
|
5236 |
] ifFalse:[ |
2216
b84ee099f484
dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
5237 |
self changed:#path. |
2135
88eb91efc5dd
care for caseless systems when entering a fileName
Claus Gittinger <cg@exept.de>
parents:
2129
diff
changeset
|
5238 |
]. |
88eb91efc5dd
care for caseless systems when entering a fileName
Claus Gittinger <cg@exept.de>
parents:
2129
diff
changeset
|
5239 |
|
88eb91efc5dd
care for caseless systems when entering a fileName
Claus Gittinger <cg@exept.de>
parents:
2129
diff
changeset
|
5240 |
"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
|
5241 |
"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
|
5242 |
"Modified: / 30.4.1999 / 11:19:29 / cg" |
1327 | 5243 |
! |
5244 |
||
172 | 5245 |
queryForDirectoryToChange |
5246 |
"query for new directory" |
|
123 | 5247 |
|
1168
b157f3712548
care for nil returns from userName/groupName * time queries
Claus Gittinger <cg@exept.de>
parents:
1166
diff
changeset
|
5248 |
|queryBox dirName| |
98 | 5249 |
|
172 | 5250 |
queryBox := FilenameEnterBox |
3658 | 5251 |
title:(resources at:'Change directory to:') withCRs |
5252 |
okText:(resources at:'Change') |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5253 |
action:[:newName | dirName := newName]. |
172 | 5254 |
"/ queryBox initialText:''. |
1168
b157f3712548
care for nil returns from userName/groupName * time queries
Claus Gittinger <cg@exept.de>
parents:
1166
diff
changeset
|
5255 |
queryBox showAtPointer. |
b157f3712548
care for nil returns from userName/groupName * time queries
Claus Gittinger <cg@exept.de>
parents:
1166
diff
changeset
|
5256 |
queryBox destroy. |
3658 | 5257 |
dirName size == 0 ifTrue:[^ self]. |
5258 |
||
5259 |
self discardChangesDialog ifTrue:[ |
|
5260 |
self doChangeCurrentDirectoryTo:dirName updateHistory:true. |
|
5261 |
]. |
|
1168
b157f3712548
care for nil returns from userName/groupName * time queries
Claus Gittinger <cg@exept.de>
parents:
1166
diff
changeset
|
5262 |
|
b157f3712548
care for nil returns from userName/groupName * time queries
Claus Gittinger <cg@exept.de>
parents:
1166
diff
changeset
|
5263 |
"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
|
5264 |
"Modified: 28.4.1997 / 22:30:40 / dq" |
1271 | 5265 |
! |
5266 |
||
5267 |
removeDirFromJavaClassPath |
|
5268 |
"remove the current path from javas classPath |
|
5269 |
(only available with ST/J System" |
|
5270 |
||
5271 |
Java removeFromClassPath:currentDirectory pathName |
|
5272 |
||
5273 |
"Modified: 14.12.1996 / 15:37:47 / cg" |
|
5274 |
"Created: 1.8.1997 / 21:25:36 / cg" |
|
1272 | 5275 |
! |
5276 |
||
5277 |
removeDirFromJavaSourcePath |
|
5278 |
"remove the current path from javas sourcePath |
|
5279 |
(only available with ST/J System" |
|
5280 |
||
5281 |
Java removeFromSourcePath:currentDirectory pathName |
|
5282 |
||
5283 |
"Modified: 14.12.1996 / 15:37:47 / cg" |
|
5284 |
"Created: 2.8.1997 / 14:11:41 / cg" |
|
36 | 5285 |
! ! |
5286 |
||
5287 |
!FileBrowser methodsFor:'private'! |
|
5288 |
||
172 | 5289 |
ask:question yesButton:yesButtonText |
5290 |
"common method to ask a yes/no question; return true or false" |
|
36 | 5291 |
|
3209 | 5292 |
^ self ask:question yesButton:yesButtonText noButton:'Cancel' |
172 | 5293 |
! |
93 | 5294 |
|
172 | 5295 |
ask:question yesButton:yesButtonText noButton:noButtonText |
36 | 5296 |
"common method to ask a yes/no question" |
5297 |
||
380 | 5298 |
^ Dialog |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5299 |
confirm:question withCRs |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5300 |
yesLabel:(resources at:yesButtonText) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5301 |
noLabel:(resources at:noButtonText) |
37 | 5302 |
|
380 | 5303 |
"Modified: 21.2.1996 / 01:19:21 / cg" |
36 | 5304 |
! |
5305 |
||
1142
9066d7d02a3a
remember last executed command per suffix; offer this as default.
Claus Gittinger <cg@exept.de>
parents:
1141
diff
changeset
|
5306 |
askForCommandFor:fileName thenDo:aBlock |
172 | 5307 |
"setup and launch a querybox to ask for unix command. |
5308 |
Then evaluate aBlock passing the command-string as argument." |
|
93 | 5309 |
|
1834 | 5310 |
|box osName| |
5311 |
||
5312 |
osName := OperatingSystem platformName. |
|
93 | 5313 |
|
172 | 5314 |
box := FilenameEnterBox |
3280 | 5315 |
title:(resources string:'Execute %1 command:' with:osName) |
5316 |
okText:(resources string:'Execute') |
|
5317 |
action:aBlock. |
|
79 | 5318 |
|
172 | 5319 |
fileName notNil ifTrue:[ |
3280 | 5320 |
self initialCommandFor:fileName into:box. |
172 | 5321 |
]. |
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
5322 |
box directory:currentDirectory. |
1142
9066d7d02a3a
remember last executed command per suffix; offer this as default.
Claus Gittinger <cg@exept.de>
parents:
1141
diff
changeset
|
5323 |
box showAtPointer. |
9066d7d02a3a
remember last executed command per suffix; offer this as default.
Claus Gittinger <cg@exept.de>
parents:
1141
diff
changeset
|
5324 |
box destroy. |
36 | 5325 |
|
1834 | 5326 |
"Modified: / 7.9.1995 / 10:31:54 / claus" |
5327 |
"Modified: / 16.9.1997 / 15:35:10 / stefan" |
|
5328 |
"Modified: / 14.8.1998 / 14:12:52 / cg" |
|
36 | 5329 |
! |
5330 |
||
98 | 5331 |
askIfModified:question yesButton:yesButtonText |
5332 |
"tell user, that code has been modified - let her confirm" |
|
5333 |
||
5334 |
(subView modified not or:[subView contentsWasSaved]) ifTrue:[ |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5335 |
^ true |
98 | 5336 |
]. |
1340 | 5337 |
(self ask:(resources string:question) yesButton:yesButtonText) ifTrue:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5338 |
"/ reset modified flag so question is asked only once |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5339 |
subView modified:false. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5340 |
^ true |
1340 | 5341 |
]. |
5342 |
^ false |
|
1339
4b712d8c1738
Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents:
1336
diff
changeset
|
5343 |
|
4b712d8c1738
Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents:
1336
diff
changeset
|
5344 |
"Modified: 2.10.1997 / 14:23:47 / stefan" |
98 | 5345 |
! |
5346 |
||
1162 | 5347 |
getSelectedFileName |
5348 |
"returns the currently selected file; shows an error if |
|
5349 |
multiple files are selected" |
|
5350 |
||
5351 |
|sel| |
|
5352 |
||
5353 |
sel := fileListView selection. |
|
5354 |
(sel size > 1) ifTrue:[ |
|
2791 | 5355 |
self onlyOneSelection |
1162 | 5356 |
] ifFalse:[ |
2791 | 5357 |
sel size > 0 ifTrue:[ |
5358 |
^ fileList at:sel first ifAbsent:nil |
|
5359 |
] |
|
1162 | 5360 |
]. |
5361 |
^ nil |
|
1911
6d1b77eda98f
check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents:
1903
diff
changeset
|
5362 |
|
6d1b77eda98f
check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents:
1903
diff
changeset
|
5363 |
"Modified: / 3.10.1998 / 18:21:23 / cg" |
1162 | 5364 |
! |
5365 |
||
5366 |
onlyOneSelection |
|
5367 |
"show a warning, that only one file must be selected for |
|
5368 |
this operation" |
|
5369 |
||
5370 |
self warn:'exactly one file must be selected !!' |
|
5371 |
! |
|
5372 |
||
3520
83cf11e1bf32
schedule checkBlock for the right process
Claus Gittinger <cg@exept.de>
parents:
3503
diff
changeset
|
5373 |
scheduleCheckBlock |
83cf11e1bf32
schedule checkBlock for the right process
Claus Gittinger <cg@exept.de>
parents:
3503
diff
changeset
|
5374 |
Processor removeTimedBlock:checkBlock. |
3568 | 5375 |
self windowGroup isNil ifTrue:[ |
5376 |
"/ not yet opened |
|
5377 |
Processor |
|
5378 |
addTimedBlock:checkBlock |
|
5379 |
afterSeconds:checkDelta |
|
5380 |
] ifFalse:[ |
|
5381 |
Processor |
|
5382 |
addTimedBlock:checkBlock |
|
5383 |
for:(self windowGroup process) |
|
5384 |
afterSeconds:checkDelta |
|
5385 |
] |
|
3520
83cf11e1bf32
schedule checkBlock for the right process
Claus Gittinger <cg@exept.de>
parents:
3503
diff
changeset
|
5386 |
! |
83cf11e1bf32
schedule checkBlock for the right process
Claus Gittinger <cg@exept.de>
parents:
3503
diff
changeset
|
5387 |
|
2512
35d2092df60f
autoselect a new created file
Claus Gittinger <cg@exept.de>
parents:
2504
diff
changeset
|
5388 |
selectFile:aFilename |
35d2092df60f
autoselect a new created file
Claus Gittinger <cg@exept.de>
parents:
2504
diff
changeset
|
5389 |
(currentDirectory filenameFor:aFilename) exists ifTrue:[ |
35d2092df60f
autoselect a new created file
Claus Gittinger <cg@exept.de>
parents:
2504
diff
changeset
|
5390 |
fileListView selection:(fileList indexOf:aFilename). |
35d2092df60f
autoselect a new created file
Claus Gittinger <cg@exept.de>
parents:
2504
diff
changeset
|
5391 |
self fileDoubleClick:fileListView selection. |
35d2092df60f
autoselect a new created file
Claus Gittinger <cg@exept.de>
parents:
2504
diff
changeset
|
5392 |
]. |
35d2092df60f
autoselect a new created file
Claus Gittinger <cg@exept.de>
parents:
2504
diff
changeset
|
5393 |
! |
35d2092df60f
autoselect a new created file
Claus Gittinger <cg@exept.de>
parents:
2504
diff
changeset
|
5394 |
|
1162 | 5395 |
selectedFilesDo:aBlock |
5396 |
"evaluate aBlock on all selected files; |
|
5397 |
show a wait cursor while doing this" |
|
5398 |
||
1969 | 5399 |
|sel action| |
1162 | 5400 |
|
5401 |
sel := fileListView selection. |
|
5402 |
sel notNil ifTrue:[ |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5403 |
sel := sel collect:[:aSelectionIndex | |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5404 |
|nm| |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5405 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5406 |
nm := fileList at:aSelectionIndex ifAbsent:nil. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5407 |
nm notNil ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5408 |
nm := nm string. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5409 |
(nm endsWith:' ...') ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5410 |
nm := (nm copyWithoutLast:4) withoutSpaces |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5411 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5412 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5413 |
nm |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5414 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5415 |
action := [ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5416 |
sel do:[:nm | |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5417 |
nm notNil ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5418 |
aBlock value:nm |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5419 |
] |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5420 |
] |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5421 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5422 |
Processor activeProcess == self windowGroup process ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5423 |
self withWaitCursorDo:action |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5424 |
] ifFalse:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5425 |
action value |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5426 |
] |
1162 | 5427 |
] |
5428 |
||
1974 | 5429 |
"Modified: / 16.12.1998 / 17:30:57 / cg" |
1162 | 5430 |
! |
5431 |
||
5432 |
show:something |
|
5433 |
"show something in subview and undef acceptAction" |
|
5434 |
||
5435 |
subView contents:something. |
|
5436 |
subView acceptAction:nil. |
|
5437 |
subView modified:false. |
|
5438 |
currentFileName := nil |
|
5439 |
! |
|
5440 |
||
5441 |
showAlert:aString with:anErrorString |
|
5442 |
"show an alertbox, displaying the last Unix-error" |
|
5443 |
||
5444 |
|msg| |
|
5445 |
||
5446 |
anErrorString isNil ifTrue:[ |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5447 |
msg := aString |
1162 | 5448 |
] ifFalse:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5449 |
msg := aString , '\\(' , anErrorString , ')' |
1162 | 5450 |
]. |
5451 |
self warn:msg withCRs |
|
5452 |
! |
|
5453 |
||
5454 |
withoutHiddenFiles:aCollection |
|
5455 |
"remove hidden files (i.e. those that start with '.') from |
|
5456 |
the list in aCollection" |
|
5457 |
||
5458 |
|newCollection| |
|
5459 |
||
5460 |
newCollection := aCollection species new. |
|
5461 |
aCollection do:[:fname | |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5462 |
|ignore| |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5463 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5464 |
ignore := false. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5465 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5466 |
((fname startsWith:'.') and:[fname ~= '..']) ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5467 |
showingHiddenFiles value "showDotFiles" ifFalse:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5468 |
ignore := true |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5469 |
] |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5470 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5471 |
ignore ifFalse:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5472 |
newCollection add:fname |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5473 |
] |
1162 | 5474 |
]. |
5475 |
^ newCollection |
|
5476 |
||
1834 | 5477 |
"Modified: / 4.8.1998 / 13:46:27 / cg" |
1162 | 5478 |
! ! |
5479 |
||
5480 |
!FileBrowser methodsFor:'private - actions & command execution'! |
|
5481 |
||
5482 |
binaryFileAction:aFilename |
|
5483 |
"for some binary files, if double clicked, we can do some useful |
|
5484 |
action ..." |
|
5485 |
||
2385 | 5486 |
|cmd| |
5487 |
||
5488 |
(aFilename asFilename hasSuffix:'pdf') ifTrue:[ |
|
2434
5cf8d286f680
dont crash if DefaultCommandPerMIME is undefined
Claus Gittinger <cg@exept.de>
parents:
2430
diff
changeset
|
5489 |
DefaultCommandPerMIME isNil ifTrue:[ |
5cf8d286f680
dont crash if DefaultCommandPerMIME is undefined
Claus Gittinger <cg@exept.de>
parents:
2430
diff
changeset
|
5490 |
self class initializeDefaultCommands |
5cf8d286f680
dont crash if DefaultCommandPerMIME is undefined
Claus Gittinger <cg@exept.de>
parents:
2430
diff
changeset
|
5491 |
]. |
2385 | 5492 |
cmd := DefaultCommandPerMIME at:'application/pdf' ifAbsent:nil. |
5493 |
cmd notNil ifTrue:[ |
|
3654 | 5494 |
(OperatingSystem |
5495 |
executeCommand:(cmd bindWith:aFilename with:Display displayName) |
|
3747
d30bc1e54f15
Remove unused vars and asFilename sends
Stefan Vogel <sv@exept.de>
parents:
3746
diff
changeset
|
5496 |
inDirectory:currentDirectory) |
2385 | 5497 |
ifTrue:[^true]. |
5498 |
]. |
|
5499 |
]. |
|
5500 |
||
1330 | 5501 |
(currentDirectory construct:aFilename) isExecutableProgram ifTrue:[ |
3747
d30bc1e54f15
Remove unused vars and asFilename sends
Stefan Vogel <sv@exept.de>
parents:
3746
diff
changeset
|
5502 |
(OperatingSystem executeCommand:aFilename inDirectory:currentDirectory) |
2385 | 5503 |
ifTrue:[^true]. |
1162 | 5504 |
]. |
5505 |
^ self imageAction:aFilename |
|
5506 |
||
5507 |
"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
|
5508 |
"Modified: 18.9.1997 / 17:18:04 / stefan" |
1162 | 5509 |
! |
5510 |
||
1358 | 5511 |
doExecuteCommand:commandArg replace:replace |
1162 | 5512 |
"execute a unix command inserting the output of the command. |
5513 |
If replace is true, all text is replaced by the commands output; |
|
5514 |
otherwise, its inserted as selected text at the cursor position." |
|
5515 |
||
3527 | 5516 |
|command stream line lnr myProcess startLine startCol stopSignal |
1983
50157c992ef9
subprocess name of button event handler
Claus Gittinger <cg@exept.de>
parents:
1981
diff
changeset
|
5517 |
pauseSignal access stillReplacing pauseHolder lowerFrameView |
50157c992ef9
subprocess name of button event handler
Claus Gittinger <cg@exept.de>
parents:
1981
diff
changeset
|
5518 |
buttonWindowGroup| |
1162 | 5519 |
|
1358 | 5520 |
command := commandArg asString. |
5521 |
||
1162 | 5522 |
access := Semaphore forMutualExclusion name:'accessLock'. |
5523 |
stopSignal := Signal new. |
|
1335
4f8ee6e1d8e1
Use signal instead polling for pauseButton in #doExecuteCommand:replace:.
Stefan Vogel <sv@exept.de>
parents:
1334
diff
changeset
|
5524 |
pauseSignal := Signal new. |
1162 | 5525 |
|
5526 |
" |
|
1298
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
5527 |
The following is tricky: |
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
5528 |
the pauseToggle & killButton will |
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
5529 |
be handled by their own windowGroup process. |
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
5530 |
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
|
5531 |
I myself am reading the commands output. |
1162 | 5532 |
" |
1298
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
5533 |
|
1329 | 5534 |
commandView beInvisible. |
5535 |
||
1298
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
5536 |
" |
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
5537 |
must take kill & pauseButtons out of my group |
1162 | 5538 |
" |
1298
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
5539 |
killButton windowGroup:nil. |
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
5540 |
pauseToggle windowGroup:nil. |
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
5541 |
|
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
5542 |
" |
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
5543 |
bring them to front, and turn hidden-mode off |
1162 | 5544 |
" |
1298
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
5545 |
killButton raise; beVisible. |
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
5546 |
pauseToggle raise; beVisible. |
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
5547 |
|
1162 | 5548 |
" |
1298
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
5549 |
kill will make me raise the stopSignal when pressed |
1162 | 5550 |
" |
5551 |
killButton |
|
3025 | 5552 |
action:[ |
5553 |
stream notNil ifTrue:[ |
|
5554 |
access critical:[ |
|
5555 |
myProcess interruptWith:[stopSignal raiseRequest]. |
|
5556 |
] |
|
5557 |
] |
|
5558 |
]. |
|
1298
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
5559 |
|
1162 | 5560 |
" |
1298
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
5561 |
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
|
5562 |
" |
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
5563 |
pauseHolder := false asValue. |
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
5564 |
pauseToggle model:pauseHolder. |
1335
4f8ee6e1d8e1
Use signal instead polling for pauseButton in #doExecuteCommand:replace:.
Stefan Vogel <sv@exept.de>
parents:
1334
diff
changeset
|
5565 |
pauseToggle pressAction:[ |
3025 | 5566 |
stream notNil ifTrue:[ |
5567 |
access critical:[ |
|
5568 |
myProcess interruptWith:[pauseSignal raiseRequest]. |
|
5569 |
] |
|
5570 |
] |
|
1335
4f8ee6e1d8e1
Use signal instead polling for pauseButton in #doExecuteCommand:replace:.
Stefan Vogel <sv@exept.de>
parents:
1334
diff
changeset
|
5571 |
]. |
4f8ee6e1d8e1
Use signal instead polling for pauseButton in #doExecuteCommand:replace:.
Stefan Vogel <sv@exept.de>
parents:
1334
diff
changeset
|
5572 |
|
1298
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
5573 |
|
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
5574 |
" |
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
5575 |
start kill button under its own windowgroup |
1162 | 5576 |
" |
5577 |
killButton openAutonomous. |
|
1983
50157c992ef9
subprocess name of button event handler
Claus Gittinger <cg@exept.de>
parents:
1981
diff
changeset
|
5578 |
buttonWindowGroup := killButton windowGroup. |
50157c992ef9
subprocess name of button event handler
Claus Gittinger <cg@exept.de>
parents:
1981
diff
changeset
|
5579 |
buttonWindowGroup process name:'FileBrowser sub'. |
50157c992ef9
subprocess name of button event handler
Claus Gittinger <cg@exept.de>
parents:
1981
diff
changeset
|
5580 |
buttonWindowGroup process processGroupId:(Processor activeProcess id). |
1298
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
5581 |
|
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
5582 |
" |
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
5583 |
and add the pauseToggle to its windowGroup |
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
5584 |
" |
1983
50157c992ef9
subprocess name of button event handler
Claus Gittinger <cg@exept.de>
parents:
1981
diff
changeset
|
5585 |
pauseToggle windowGroup:buttonWindowGroup. |
1298
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
5586 |
|
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
5587 |
|
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
5588 |
lowerFrameView := subView superView. |
1162 | 5589 |
|
5590 |
" |
|
5591 |
go fork a pipe and read it |
|
5592 |
" |
|
5593 |
self label:(myName , ': executing ' , (command copyTo:(20 min:command size)) , ' ...'). |
|
5594 |
[ |
|
5595 |
self withWaitCursorDo:[ |
|
3025 | 5596 |
stopSignal catch:[ |
5597 |
pauseSignal handle:[:ex| |
|
5598 |
|noPauseSema| |
|
5599 |
||
5600 |
"/ |
|
5601 |
"/ allow interaction with |
|
5602 |
"/ the codeView via the other windowGroup |
|
5603 |
"/ |
|
5604 |
lowerFrameView windowGroup:buttonWindowGroup. |
|
5605 |
||
5606 |
"/ |
|
5607 |
"/ wait for pause to be turned off |
|
5608 |
"/ |
|
5609 |
noPauseSema := Semaphore new. |
|
5610 |
pauseHolder onChangeSend:#signal to:noPauseSema. |
|
5611 |
noPauseSema wait. |
|
5612 |
||
5613 |
"/ |
|
5614 |
"/ no interaction with the codeView ... |
|
5615 |
"/ |
|
5616 |
lowerFrameView windowGroup:(self windowGroup). |
|
5617 |
ex proceed. |
|
5618 |
] do:[ |
|
5619 |
startLine := subView cursorLine. |
|
5620 |
startCol := subView cursorCol. |
|
5621 |
||
5622 |
" |
|
5623 |
this can be a time consuming operation; therefore lower my priority |
|
5624 |
" |
|
5625 |
myProcess := Processor activeProcess. |
|
1912 | 5626 |
"/ myPriority := myProcess priority. |
5627 |
"/ myProcess priority:(Processor userBackgroundPriority). |
|
5628 |
||
3025 | 5629 |
stream := PipeStream |
5630 |
readingFrom:command |
|
5631 |
errorDisposition:#inline |
|
5632 |
inDirectory:currentDirectory. |
|
5633 |
stream notNil ifTrue:[ |
|
5634 |
[ |
|
5635 |
|codeView lines noPauseSema enc| |
|
5636 |
||
5637 |
enc := fileEncoding. |
|
5638 |
enc == #iso8859 ifTrue:[ |
|
5639 |
enc := nil |
|
5640 |
]. |
|
5641 |
||
5642 |
stream buffered:true. |
|
5643 |
codeView := subView. |
|
5644 |
codeView unselect. |
|
5645 |
||
5646 |
replace ifTrue:[ |
|
5647 |
codeView list:nil. |
|
5648 |
lnr := 1. |
|
5649 |
]. |
|
5650 |
||
5651 |
stillReplacing := replace. |
|
5652 |
||
3027 | 5653 |
[ |
3029 | 5654 |
stream readWaitWithTimeout:1. |
5655 |
stream atEnd not |
|
3027 | 5656 |
] whileTrue:[ |
3025 | 5657 |
" |
5658 |
data available; read up to 100 lines |
|
5659 |
and insert as a single junk. This speeds up |
|
5660 |
display of long output (less line-scrolling). |
|
5661 |
" |
|
5662 |
lines := OrderedCollection new:100. |
|
5663 |
||
5664 |
[ |
|
5665 |
line := stream nextLine. |
|
5666 |
line notNil ifTrue:[ |
|
5667 |
enc notNil ifTrue:[ |
|
5668 |
line := line decodeFrom:enc |
|
5669 |
]. |
|
5670 |
lines add:line |
|
5671 |
]. |
|
5672 |
] doWhile:[ |
|
3027 | 5673 |
stream pid notNil |
5674 |
and:[stream canReadWithoutBlocking |
|
3025 | 5675 |
and:[stream atEnd not |
3027 | 5676 |
and:[lines size < 100]]] |
3025 | 5677 |
]. |
5678 |
||
5679 |
" |
|
5680 |
need this critical section; otherwise, |
|
5681 |
we could get the signal while waiting for |
|
5682 |
an expose event ... |
|
5683 |
" |
|
5684 |
access critical:[ |
|
5685 |
lines size > 0 ifTrue:[ |
|
5686 |
stillReplacing ifTrue:[ |
|
5687 |
lines do:[:line | |
|
5688 |
codeView at:lnr put:line withTabsExpanded. |
|
5689 |
codeView cursorToBottom; cursorDown:1. |
|
5690 |
lnr := lnr + 1. |
|
5691 |
lnr > codeView list size ifTrue:[ |
|
5692 |
stillReplacing := false |
|
5693 |
] |
|
5694 |
]. |
|
5695 |
] ifFalse:[ |
|
5696 |
codeView insertLines:lines before:codeView cursorLine. |
|
5697 |
codeView cursorDown:lines size. |
|
5698 |
] |
|
5699 |
]. |
|
5700 |
]. |
|
5701 |
||
5702 |
" |
|
5703 |
give others running at same prio a chance too |
|
5704 |
(especially other FileBrowsers doing the same) |
|
5705 |
" |
|
5706 |
Processor yield |
|
5707 |
]. |
|
3596
9761af1f3f72
#valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents:
3568
diff
changeset
|
5708 |
] ensure:[ |
3025 | 5709 |
stream shutDown "close". stream := nil. |
5710 |
]. |
|
5711 |
||
5712 |
"/ |
|
5713 |
"/ the command could have changed the directory |
|
5714 |
"/ |
|
5715 |
self updateCurrentDirectoryIfChanged |
|
5716 |
]. |
|
5717 |
replace ifTrue:[ |
|
5718 |
subView modified:false. |
|
5719 |
]. |
|
5720 |
] |
|
5721 |
] |
|
1162 | 5722 |
] |
3596
9761af1f3f72
#valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents:
3568
diff
changeset
|
5723 |
] ensure:[ |
3025 | 5724 |
|wg| |
5725 |
||
5726 |
self label:myName; iconLabel:myName. |
|
1912 | 5727 |
"/ myProcess notNil ifTrue:[myProcess priority:myPriority]. |
5728 |
||
3025 | 5729 |
" |
5730 |
hide the button, and make sure it will stay |
|
5731 |
hidden when we are realized again |
|
5732 |
" |
|
5733 |
killButton beInvisible. |
|
5734 |
pauseToggle beInvisible. |
|
5735 |
||
5736 |
commandView beVisible. |
|
5737 |
||
5738 |
" |
|
5739 |
remove the killButton from its group |
|
5740 |
(otherwise, it will be destroyed when we shut down the group) |
|
5741 |
" |
|
5742 |
wg := killButton windowGroup. |
|
5743 |
killButton windowGroup:nil. |
|
5744 |
pauseToggle windowGroup:nil. |
|
5745 |
||
5746 |
" |
|
5747 |
shut down the kill buttons windowgroup |
|
5748 |
" |
|
5749 |
wg notNil ifTrue:[ |
|
5750 |
wg process terminate. |
|
5751 |
]. |
|
5752 |
" |
|
5753 |
clear its action (actually not needed, but |
|
5754 |
releases reference to thisContext earlier) |
|
5755 |
" |
|
5756 |
killButton action:nil. |
|
5757 |
pauseToggle pressAction:nil. |
|
5758 |
"/ |
|
5759 |
"/ allow interaction with the codeView |
|
5760 |
"/ (bring it back into my group) |
|
5761 |
"/ |
|
5762 |
lowerFrameView windowGroup:(self windowGroup). |
|
1162 | 5763 |
]. |
5764 |
||
5765 |
currentFileName isNil ifTrue:[ |
|
3025 | 5766 |
subView modified:false. |
1162 | 5767 |
]. |
5768 |
||
5769 |
subView size > 10000 ifTrue:[ |
|
3025 | 5770 |
self warn:'text quite large now - please cut off some lines' |
1162 | 5771 |
] |
5772 |
||
1358 | 5773 |
"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
|
5774 |
"Modified: / 6.3.1998 / 17:32:03 / stefan" |
1933 | 5775 |
"Modified: / 15.10.1998 / 12:37:52 / cg" |
1162 | 5776 |
! |
5777 |
||
5778 |
imageAction:aFilename |
|
5779 |
"for some image files, if double clicked, we can do some useful |
|
5780 |
action ..." |
|
5781 |
||
3729 | 5782 |
|file img errmsg| |
5783 |
||
5784 |
file := currentDirectory construct:aFilename. |
|
5785 |
||
5786 |
(Image isImageFileSuffix:(file suffix)) |
|
1162 | 5787 |
ifTrue:[ |
3729 | 5788 |
Image imageLoadErrorSignal handle:[:ex | |
5789 |
"/ ex signal ~~ Image badImageFormatQuerySignal |
|
5790 |
"/ ifTrue:[ |
|
5791 |
errmsg := ex errorString |
|
5792 |
"/ ] |
|
2158
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5793 |
] do:[ |
3729 | 5794 |
img := Image fromFile:file. |
2158
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5795 |
]. |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5796 |
img notNil ifTrue:[ |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5797 |
ImageEditor openOnImage:img. |
1410 | 5798 |
"/ img inspect. |
2158
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5799 |
^ true |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5800 |
]. |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5801 |
errmsg notNil ifTrue:[ |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5802 |
self warn:errmsg. |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5803 |
] |
1162 | 5804 |
]. |
5805 |
^ false |
|
5806 |
||
2158
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5807 |
"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
|
5808 |
"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
|
5809 |
"Modified: / 18.5.1999 / 15:45:06 / cg" |
1162 | 5810 |
! |
5811 |
||
5812 |
initialCommandFor:fileName into:aBox |
|
5813 |
"set a useful initial command for execute box." |
|
5814 |
||
2345 | 5815 |
|mime cmd select path suffix| |
5816 |
||
5817 |
path := currentDirectory filenameFor:fileName. |
|
3743 | 5818 |
suffix := fileName asFilename suffix. |
3746 | 5819 |
DefaultCommandPerSuffix notNil ifTrue:[ |
5820 |
cmd := DefaultCommandPerSuffix at:suffix ifAbsent:nil. |
|
5821 |
cmd notNil ifTrue:[ |
|
5822 |
aBox initialText:(cmd , ' ' , fileName) selectFrom:1 to:cmd size. |
|
5823 |
^ self |
|
5824 |
]. |
|
3743 | 5825 |
]. |
5826 |
mime := MIMETypes mimeTypeForSuffix:suffix. |
|
2345 | 5827 |
"/ mime notNil ifTrue:[ |
5828 |
"/ cmd := self initialCommandForMIME:mime file:path |
|
5829 |
"/ ]. |
|
1162 | 5830 |
|
5831 |
"/ XXX should be changed to take stuff from a config file |
|
5832 |
"/ XXX or from resources. |
|
5833 |
||
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
5834 |
(path type == #regular) ifTrue:[ |
2345 | 5835 |
path isExecutableProgram ifTrue:[ |
5836 |
aBox initialText:(fileName , ' <arguments>'). |
|
5837 |
^ self |
|
5838 |
]. |
|
5839 |
||
5840 |
select := true. |
|
5841 |
||
5842 |
"some heuristics - my personal preferences ... |
|
5843 |
(actually this should come from a configfile)" |
|
5844 |
||
5845 |
(fileName endsWith:'akefile') ifTrue:[ |
|
5846 |
aBox initialText:'make target' selectFrom:6 to:11. |
|
5847 |
^ self |
|
5848 |
]. |
|
5849 |
||
2346 | 5850 |
DefaultCommandPerMIME isNil ifTrue:[ |
5851 |
self class initializeDefaultCommands |
|
5852 |
]. |
|
5853 |
||
5854 |
cmd := DefaultCommandPerMIME at:mime ifAbsent:nil. |
|
5855 |
cmd notNil ifTrue:[ |
|
5856 |
select := false |
|
5857 |
]. |
|
5858 |
||
5859 |
cmd isNil ifTrue:[ |
|
5860 |
||
5861 |
suffix := path suffix. |
|
5862 |
(suffix = 'C') ifTrue:[ |
|
2345 | 5863 |
cmd := 'g++ -c %1'. |
5864 |
select := 6. |
|
2346 | 5865 |
] ifFalse:[ |
5866 |
suffix := suffix asLowercase. |
|
5867 |
||
5868 |
(suffix = 'taz') ifTrue:[ |
|
5869 |
aBox initialText:'zcat %1 | tar tvf -'. |
|
5870 |
select := false. |
|
5871 |
]. |
|
5872 |
(suffix = 'tar') ifTrue:[ |
|
5873 |
cmd := 'tar tvf %1'. |
|
5874 |
select := 7. |
|
5875 |
]. |
|
5876 |
(suffix = 'zoo') ifTrue:[ |
|
5877 |
cmd := 'zoo -list %1'. |
|
5878 |
select := 9. |
|
5879 |
]. |
|
5880 |
(suffix = 'zip') ifTrue:[ |
|
5881 |
cmd := 'unzip -l %1'. |
|
5882 |
select := 8. |
|
5883 |
]. |
|
5884 |
(suffix = 'jar') ifTrue:[ |
|
5885 |
cmd := 'unzip -l %1'. |
|
5886 |
select := 8. |
|
5887 |
]. |
|
5888 |
(suffix = 'z') ifTrue:[ |
|
5889 |
(fileName asLowercase endsWith:'tar.z') ifTrue:[ |
|
5890 |
cmd := 'zcat %1 | tar tvf -'. |
|
5891 |
select := false. |
|
5892 |
] ifFalse:[ |
|
5893 |
cmd := 'uncompress %1' |
|
5894 |
]. |
|
5895 |
]. |
|
5896 |
(suffix = 'gz') ifTrue:[ |
|
5897 |
(fileName asLowercase endsWith:'tar.gz') ifTrue:[ |
|
5898 |
cmd := ('gunzip < %1 | tar tvf -' ). |
|
5899 |
select := false. |
|
5900 |
] ifFalse:[ |
|
5901 |
cmd := 'gunzip %1'. |
|
5902 |
]. |
|
5903 |
]. |
|
5904 |
(suffix = 'html') ifTrue:[ |
|
5905 |
cmd := 'netscape %1' |
|
5906 |
]. |
|
5907 |
(suffix = 'htm') ifTrue:[ |
|
5908 |
cmd := 'netscape %1' |
|
5909 |
]. |
|
5910 |
(suffix = 'uue') ifTrue:[ |
|
5911 |
cmd := 'uudecode %1' |
|
5912 |
]. |
|
5913 |
(suffix = 'c') ifTrue:[ |
|
5914 |
cmd := 'cc -c %1'. |
|
5915 |
select := 5. |
|
5916 |
]. |
|
5917 |
(suffix = 'cc') ifTrue:[ |
|
5918 |
cmd := 'g++ -c %1'. |
|
5919 |
select := 6. |
|
5920 |
]. |
|
5921 |
(suffix = 'xbm') ifTrue:[ |
|
5922 |
cmd := 'bitmap %1' |
|
5923 |
]. |
|
5924 |
(suffix = 'ps') ifTrue:[ |
|
5925 |
cmd := 'ghostview %1' |
|
5926 |
]. |
|
5927 |
((suffix = '1') or:[suffix = 'man']) ifTrue:[ |
|
5928 |
cmd := 'nroff -man %1'. |
|
5929 |
select := 10. |
|
5930 |
]. |
|
2345 | 5931 |
]. |
5932 |
]. |
|
5933 |
||
5934 |
cmd isNil ifTrue:[ |
|
5935 |
DefaultCommandPerSuffix isNil ifTrue:[ |
|
5936 |
cmd := '<cmd>' |
|
5937 |
] ifFalse:[ |
|
5938 |
cmd := DefaultCommandPerSuffix |
|
5939 |
at:suffix |
|
5940 |
ifAbsent:'<cmd>'. |
|
5941 |
]. |
|
5942 |
cmd := cmd , ' %1'. |
|
5943 |
]. |
|
5944 |
||
5945 |
cmd := cmd bindWith:fileName. |
|
5946 |
select == false ifTrue:[ |
|
5947 |
aBox initialText:cmd |
|
5948 |
] ifFalse:[ |
|
5949 |
select class == Interval ifTrue:[ |
|
5950 |
aBox initialText:cmd selectFrom:select start to:select stop |
|
5951 |
] ifFalse:[ |
|
5952 |
select isInteger ifFalse:[ |
|
5953 |
select := (cmd indexOf:Character space ifAbsent:[cmd size + 1]) - 1. |
|
5954 |
]. |
|
5955 |
aBox initialText:cmd selectFrom:1 to:select |
|
5956 |
]. |
|
5957 |
] |
|
1162 | 5958 |
] |
5959 |
||
1542 | 5960 |
"Modified: / 24.9.1997 / 16:34:52 / stefan" |
5961 |
"Modified: / 9.4.1998 / 17:15:57 / cg" |
|
1162 | 5962 |
! |
5963 |
||
5964 |
nonBinaryFileAction:aFilename |
|
5965 |
"for some nonBinary files, if double clicked, we can do some useful |
|
5966 |
action ..." |
|
5967 |
||
1493 | 5968 |
|fullPath| |
1162 | 5969 |
|
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
5970 |
fullPath := currentDirectory filenameFor:aFilename. |
2550 | 5971 |
((fullPath hasSuffix:'htm') |
5972 |
or:[(fullPath hasSuffix:'HTM') |
|
5973 |
or:[(fullPath hasSuffix:'html') |
|
5974 |
or:[(fullPath hasSuffix:'HTML')]]]) ifTrue:[ |
|
2385 | 5975 |
HTMLDocumentView openOn:fullPath pathName. |
5976 |
^ true |
|
2091 | 5977 |
]. |
5978 |
((fullPath hasSuffix:'prj') |
|
5979 |
and:[ProjectBrowser notNil]) ifTrue:[ |
|
2385 | 5980 |
ProjectBrowser openOnFile:fullPath pathName. |
5981 |
^ true |
|
1162 | 5982 |
]. |
5983 |
||
5984 |
OperatingSystem isUNIXlike ifTrue:[ |
|
2385 | 5985 |
(#('.man' '.1' '.2' '.3') findFirst:[:suff | fullPath hasSuffix:suff]) ~~ 0 |
5986 |
ifTrue:[ |
|
5987 |
HTMLDocumentView openFullOnText:(HTMLDocGenerator manPageForFile:fullPath pathName). |
|
5988 |
^ true |
|
5989 |
]. |
|
1162 | 5990 |
]. |
5991 |
^ self imageAction:aFilename |
|
5992 |
||
5993 |
"Created: 19.6.1996 / 09:36:38 / cg" |
|
5994 |
"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
|
5995 |
"Modified: 18.9.1997 / 16:58:40 / stefan" |
1162 | 5996 |
! ! |
5997 |
||
5998 |
!FileBrowser methodsFor:'private - directory stuff'! |
|
5999 |
||
1371
a80db8d0e311
remember directory in history when entering (not when leaving)
Claus Gittinger <cg@exept.de>
parents:
1358
diff
changeset
|
6000 |
addToHistory:path |
2951
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
6001 |
self class addToHistory:path |
1371
a80db8d0e311
remember directory in history when entering (not when leaving)
Claus Gittinger <cg@exept.de>
parents:
1358
diff
changeset
|
6002 |
! |
a80db8d0e311
remember directory in history when entering (not when leaving)
Claus Gittinger <cg@exept.de>
parents:
1358
diff
changeset
|
6003 |
|
172 | 6004 |
changeToPreviousDirectory |
6005 |
"if text was modified show a queryBox, |
|
6006 |
otherwise change immediately to previous directory." |
|
93 | 6007 |
|
172 | 6008 |
previousDirectory isNil ifTrue:[^ self]. |
1339
4b712d8c1738
Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents:
1336
diff
changeset
|
6009 |
self discardChangesDialog ifTrue:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6010 |
self doChangeCurrentDirectoryTo:previousDirectory updateHistory:false |
172 | 6011 |
] |
1339
4b712d8c1738
Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents:
1336
diff
changeset
|
6012 |
|
4b712d8c1738
Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents:
1336
diff
changeset
|
6013 |
"Modified: 2.10.1997 / 14:13:40 / stefan" |
36 | 6014 |
! |
6015 |
||
98 | 6016 |
checkIfDirectoryHasChanged |
6017 |
"every checkDelta secs, check if directoy has changed and update the list if so. |
|
6018 |
Also, we check if the file shown has been touched in the meanwhile (for example, |
|
6019 |
from another browser) and say 'outdated' in the label if so. |
|
6020 |
This avoids confusion if the same file is being edited by two browsers. (or other editors). |
|
6021 |
If the text shown in the codeView has been edited, 'modified' is shown. |
|
6022 |
" |
|
6023 |
||
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
6024 |
|oldSelection nOld newState msg newLabel t| |
98 | 6025 |
|
6026 |
shown ifTrue:[ |
|
2220
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
6027 |
currentDirectory notNil ifTrue:[ |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
6028 |
(lockUpdate or:[doAutoUpdate value not]) ifTrue:[ |
3520
83cf11e1bf32
schedule checkBlock for the right process
Claus Gittinger <cg@exept.de>
parents:
3503
diff
changeset
|
6029 |
self scheduleCheckBlock. |
2220
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
6030 |
^ self |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
6031 |
]. |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
6032 |
|
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
6033 |
subView modified ifTrue:[ |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
6034 |
newState := ' (modified)' |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
6035 |
]. |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
6036 |
|
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
6037 |
(currentDirectory isReadable) ifTrue:[ |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
6038 |
Processor removeTimedBlock:checkBlock. |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
6039 |
|
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
6040 |
t := currentDirectory modificationTime. |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
6041 |
(t notNil and:[t > timeOfLastCheck]) ifTrue:[ |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
6042 |
nOld := fileListView numberOfSelections. |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
6043 |
oldSelection := fileListView selectionValue. |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
6044 |
self updateCurrentDirectory. |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
6045 |
nOld ~~ 0 ifTrue:[ |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
6046 |
nOld > 1 ifTrue:[ |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
6047 |
oldSelection do:[:element | |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
6048 |
fileListView addElementToSelection:element |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
6049 |
] |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
6050 |
] ifFalse:[ |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
6051 |
fileListView selectElementWithoutScroll:oldSelection |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
6052 |
] |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
6053 |
]. |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
6054 |
] ifFalse:[ |
3520
83cf11e1bf32
schedule checkBlock for the right process
Claus Gittinger <cg@exept.de>
parents:
3503
diff
changeset
|
6055 |
self scheduleCheckBlock. |
2220
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
6056 |
]. |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
6057 |
|
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
6058 |
currentFileName notNil ifTrue:[ |
3399 | 6059 |
|f mod| |
2220
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
6060 |
f := currentDirectory construct:currentFileName. |
3399 | 6061 |
(f exists not or:[(mod := f modificationTime) isNil]) ifTrue:[ |
2220
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
6062 |
newState := ' (removed)'. |
3399 | 6063 |
] ifFalse:[ |
6064 |
mod > timeOfFileRead ifTrue:[ |
|
2220
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
6065 |
newState := ' (outdated)'. |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
6066 |
subView modified ifTrue:[ |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
6067 |
newState := ' (modified & outdated)' |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
6068 |
] |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
6069 |
]. |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
6070 |
]. |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
6071 |
]. |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
6072 |
] ifFalse:[ |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
6073 |
" |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
6074 |
if the directory has been deleted, or is not readable ... |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
6075 |
" |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
6076 |
(currentDirectory exists) ifFalse:[ |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
6077 |
msg := 'FileBrowser:\\directory %1 is gone ?!!?' |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
6078 |
] ifTrue:[ |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
6079 |
msg := 'FileBrowser:\\directory %1 is no longer readable ?!!?' |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
6080 |
]. |
3417
1fee40dd5af4
win32: do not x-laet backslash in a filename to cr in warnbox
Claus Gittinger <cg@exept.de>
parents:
3414
diff
changeset
|
6081 |
"/ sigh - avoid translating backslashes in WIN-filenames |
3528 | 6082 |
msg := (resources string:msg) withCRs. |
6083 |
Dialog warn:(msg bindWith:currentDirectory pathName allBold). |
|
2220
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
6084 |
|
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
6085 |
fileListView contents:nil. |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
6086 |
newLabel := myName , ': directory is gone !!'. |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
6087 |
]. |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
6088 |
|
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
6089 |
newState notNil ifTrue:[ |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
6090 |
newLabel := myName. |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
6091 |
currentFileName notNil ifTrue:[ |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
6092 |
newLabel := newLabel , ': ' , currentFileName |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
6093 |
]. |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
6094 |
newLabel := newLabel , newState. |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
6095 |
]. |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
6096 |
newLabel notNil ifTrue:[ |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
6097 |
self label:newLabel. |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
6098 |
] |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
6099 |
] |
98 | 6100 |
] |
1168
b157f3712548
care for nil returns from userName/groupName * time queries
Claus Gittinger <cg@exept.de>
parents:
1166
diff
changeset
|
6101 |
|
1380
547d31bfa12c
warning string fixed when directory vanishes
Claus Gittinger <cg@exept.de>
parents:
1374
diff
changeset
|
6102 |
"Modified: / 28.4.1997 / 22:31:02 / dq" |
547d31bfa12c
warning string fixed when directory vanishes
Claus Gittinger <cg@exept.de>
parents:
1374
diff
changeset
|
6103 |
"Modified: / 16.9.1997 / 15:17:15 / stefan" |
3417
1fee40dd5af4
win32: do not x-laet backslash in a filename to cr in warnbox
Claus Gittinger <cg@exept.de>
parents:
3414
diff
changeset
|
6104 |
"Modified: / 15.11.2001 / 21:27:05 / cg" |
98 | 6105 |
! |
6106 |
||
172 | 6107 |
doChangeCurrentDirectoryTo:fileName updateHistory:updateHistory |
6108 |
"verify argument is name of a readable & executable directory |
|
6109 |
and if so, go there" |
|
6110 |
||
1317 | 6111 |
|msg path idx f| |
172 | 6112 |
|
6113 |
self label:myName; iconLabel:myName. |
|
6114 |
fileName notNil ifTrue:[ |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6115 |
(f := fileName asFilename) isAbsolute ifFalse:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6116 |
f := currentDirectory filenameFor:fileName. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6117 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6118 |
f := f asAbsoluteFilename. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6119 |
(f isDirectory) ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6120 |
(f isReadable) ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6121 |
(f isExecutable) ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6122 |
path := currentDirectory pathName. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6123 |
previousDirectory := path. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6124 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6125 |
" |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6126 |
remember where we are positioned in the fileList |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6127 |
(in case we want to return) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6128 |
" |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6129 |
idx := DirectoryHistory indexOf:path. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6130 |
idx ~~ 0 ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6131 |
DirectoryHistoryWhere at:idx put:fileListView firstLineShown |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6132 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6133 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6134 |
updateHistory ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6135 |
self addToHistory:path. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6136 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6137 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6138 |
self setCurrentDirectory:(f pathName). |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6139 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6140 |
"/ fetch the new path. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6141 |
path := currentDirectory pathName. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6142 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6143 |
" |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6144 |
if we have already been there, look for the |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6145 |
position offset, and scroll the fileList |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6146 |
" |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6147 |
idx := DirectoryHistory indexOf:path. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6148 |
idx ~~ 0 ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6149 |
|pos| |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6150 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6151 |
pos := DirectoryHistoryWhere at:idx. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6152 |
pos notNil ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6153 |
fileListView scrollToLine:pos. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6154 |
] |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6155 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6156 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6157 |
updateHistory ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6158 |
self addToHistory:path. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6159 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6160 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6161 |
^ self |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6162 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6163 |
msg := 'cannot change directory to ''%1'' !!' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6164 |
] ifFalse:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6165 |
msg := 'cannot read directory ''%1'' !!' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6166 |
] |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6167 |
] ifFalse:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6168 |
OperatingSystem isVMSlike ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6169 |
"/ cannot tell if it exists or is simply invisible ... |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6170 |
msg := '''%1'' is not a directory or unreadable !!' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6171 |
] ifFalse:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6172 |
msg := '''%1'' is not a directory !!' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6173 |
] |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6174 |
]. |
3528 | 6175 |
msg := (resources string:msg) withCRs. |
6176 |
Dialog warn:(msg bindWith:fileName allBold). |
|
172 | 6177 |
] |
1166
0029f77ccea7
when updating the directoryList,
Claus Gittinger <cg@exept.de>
parents:
1162
diff
changeset
|
6178 |
|
1371
a80db8d0e311
remember directory in history when entering (not when leaving)
Claus Gittinger <cg@exept.de>
parents:
1358
diff
changeset
|
6179 |
"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
|
6180 |
"Modified: / 27.4.1999 / 17:10:14 / cg" |
1329 | 6181 |
! |
6182 |
||
6183 |
doChangeToDefaultDirectory |
|
6184 |
"go to parent directory" |
|
6185 |
||
6186 |
self doChangeCurrentDirectoryTo:(Filename currentDirectory pathName) updateHistory:true |
|
6187 |
||
6188 |
"Created: 21.9.1997 / 23:45:59 / cg" |
|
172 | 6189 |
! |
6190 |
||
6191 |
doChangeToHomeDirectory |
|
6192 |
"go to home directory" |
|
6193 |
||
6194 |
self doChangeCurrentDirectoryTo:(OperatingSystem getHomeDirectory) updateHistory:true |
|
6195 |
! |
|
6196 |
||
6197 |
doChangeToParentDirectory |
|
1317 | 6198 |
"go to parent directory" |
36 | 6199 |
|
172 | 6200 |
self doChangeCurrentDirectoryTo:'..' updateHistory:true |
6201 |
! |
|
6202 |
||
6203 |
doCreateDirectory:newName |
|
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
6204 |
|f| |
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
6205 |
|
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
6206 |
f := currentDirectory filenameFor:newName. |
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
6207 |
f exists ifTrue:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6208 |
self warn:'%1 already exists.' with:newName. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6209 |
^ self |
172 | 6210 |
]. |
6211 |
||
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
6212 |
f makeDirectory ifTrue:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6213 |
self updateCurrentDirectory |
172 | 6214 |
] ifFalse:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6215 |
self showAlert:(resources string:'cannot create directory ''%1'' !!' with:newName) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6216 |
with:(OperatingSystem lastErrorString) |
172 | 6217 |
] |
1157
667a57034e40
only update if the directory did change (after execute command)
Claus Gittinger <cg@exept.de>
parents:
1156
diff
changeset
|
6218 |
|
1988 | 6219 |
"Modified: / 18.9.1997 / 17:21:25 / stefan" |
6220 |
"Modified: / 30.1.1999 / 16:24:12 / cg" |
|
172 | 6221 |
! |
6222 |
||
1162 | 6223 |
setCurrentDirectory:aPathName |
6224 |
"setup for another directory" |
|
6225 |
||
6226 |
|newDirectory| |
|
6227 |
||
6228 |
aPathName isEmpty ifTrue:[^ self]. |
|
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
6229 |
newDirectory := currentDirectory filenameFor:aPathName. |
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
6230 |
newDirectory isDirectory ifTrue:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6231 |
self currentDirectory:newDirectory. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6232 |
currentFileName notNil ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6233 |
fileListView contents:nil. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6234 |
currentFileName := nil. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6235 |
] ifFalse:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6236 |
fileListView setSelection:nil. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6237 |
fileListView scrollToTop. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6238 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6239 |
self updateCurrentDirectory. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6240 |
self showInfo. |
172 | 6241 |
] |
294 | 6242 |
|
1162 | 6243 |
"Modified: 21.9.1995 / 11:22:45 / claus" |
6244 |
"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
|
6245 |
"Modified: 18.9.1997 / 17:08:07 / stefan" |
912
dae70963b64c
define language specific commentStrings
Claus Gittinger <cg@exept.de>
parents:
874
diff
changeset
|
6246 |
! |
dae70963b64c
define language specific commentStrings
Claus Gittinger <cg@exept.de>
parents:
874
diff
changeset
|
6247 |
|
1162 | 6248 |
updateCurrentDirectoryIfChanged |
1837 | 6249 |
|t| |
6250 |
||
1975 | 6251 |
OperatingSystem isMSDOSlike ifTrue:[ |
2636 | 6252 |
"/ workaround: DOS has no directory modifiation time ... |
6253 |
self updateCurrentDirectory. |
|
6254 |
^ self |
|
1975 | 6255 |
]. |
6256 |
||
1837 | 6257 |
((t := currentDirectory modificationTime) isNil |
6258 |
or:[t > timeOfLastCheck]) ifTrue:[ |
|
2636 | 6259 |
self updateCurrentDirectory |
1162 | 6260 |
] |
6261 |
||
1837 | 6262 |
"Modified: / 16.9.1997 / 15:35:52 / stefan" |
1975 | 6263 |
"Modified: / 16.12.1998 / 22:55:44 / cg" |
1162 | 6264 |
! ! |
6265 |
||
6266 |
!FileBrowser methodsFor:'private - encoding'! |
|
172 | 6267 |
|
395 | 6268 |
guessEncodingFrom:aBuffer |
988 | 6269 |
"look for a string |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6270 |
encoding #name |
988 | 6271 |
or: |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6272 |
encoding: name |
1209 | 6273 |
within the given buffer |
6274 |
(which is usually the first few bytes of a textFile). |
|
6275 |
If thats not found, use heuristics (in CharacterArray) to guess." |
|
988 | 6276 |
|
395 | 6277 |
|n "{Class: SmallInteger }" |
1209 | 6278 |
binary idx s w enc| |
395 | 6279 |
|
6280 |
binary := false. |
|
6281 |
n := aBuffer size. |
|
6282 |
||
1223 | 6283 |
(idx := aBuffer findString:'charset=') ~~ 0 ifTrue:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6284 |
s := ReadStream on:aBuffer. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6285 |
s position:idx + 8. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6286 |
s skipSeparators. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6287 |
w := s upToSeparator. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6288 |
w notNil ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6289 |
(idx := w indexOf:$") ~~ 0 ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6290 |
w := w copyTo:idx-1 |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6291 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6292 |
^ w asSymbol |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6293 |
]. |
1223 | 6294 |
]. |
807 | 6295 |
(idx := aBuffer findString:'encoding') ~~ 0 ifTrue:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6296 |
s := ReadStream on:aBuffer. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6297 |
s position:idx + 8. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6298 |
s skipSeparators. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6299 |
s peek == $: ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6300 |
s next. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6301 |
s skipSeparators. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6302 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6303 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6304 |
s peek == $# ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6305 |
s next. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6306 |
s skipSeparators. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6307 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6308 |
w := s upToSeparator. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6309 |
w notNil ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6310 |
^ w asSymbol |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6311 |
]. |
807 | 6312 |
]. |
6313 |
||
395 | 6314 |
1 to:n do:[:i | |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6315 |
(aBuffer at:i) isPrintable ifFalse:[binary := true]. |
395 | 6316 |
]. |
807 | 6317 |
|
395 | 6318 |
binary ifTrue:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6319 |
"/ look for JIS7 / EUC encoding |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6320 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6321 |
enc := CharacterArray guessEncodingFrom:aBuffer. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6322 |
enc notNil ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6323 |
^ enc |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6324 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6325 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6326 |
"/ if the encoding has been set to any non iso setting, |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6327 |
"/ assume its what we defined ... |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6328 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6329 |
(('iso*' match:fileEncoding) or:['ascii*' match:fileEncoding]) ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6330 |
^ #binary |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6331 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6332 |
^ fileEncoding ? #binary |
395 | 6333 |
]. |
6334 |
^ #ascii |
|
6335 |
||
6336 |
"Created: 26.2.1996 / 17:43:08 / cg" |
|
1223 | 6337 |
"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
|
6338 |
! |
02d5bbd925dd
allow decoding errors to be ignored
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
6339 |
|
02d5bbd925dd
allow decoding errors to be ignored
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
6340 |
preferredFontEncodingFor:fileEncoding |
02d5bbd925dd
allow decoding errors to be ignored
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
6341 |
"given a file encoding, return corresponding preferred fontEncoding |
02d5bbd925dd
allow decoding errors to be ignored
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
6342 |
match pattern" |
02d5bbd925dd
allow decoding errors to be ignored
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
6343 |
|
1223 | 6344 |
|fe| |
6345 |
||
6346 |
fe := MIMETypes fontForCharset:fileEncoding. |
|
6347 |
fe notNil ifTrue:[^ fe]. |
|
1221 | 6348 |
^ 'iso8859*' |
1214
02d5bbd925dd
allow decoding errors to be ignored
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
6349 |
|
02d5bbd925dd
allow decoding errors to be ignored
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
6350 |
"Created: 28.6.1997 / 20:47:35 / cg" |
1223 | 6351 |
"Modified: 1.7.1997 / 00:04:56 / cg" |
395 | 6352 |
! |
6353 |
||
1140 | 6354 |
validateFontEncodingFor:newEncoding ask:ask |
6355 |
"if required, query user if he/she wants to change to another font, |
|
6356 |
which is able to display text encoded as specified by newEncoding" |
|
6357 |
||
1214
02d5bbd925dd
allow decoding errors to be ignored
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
6358 |
|fontsEncoding msg filter f defaultFont pref| |
1140 | 6359 |
|
6360 |
fontsEncoding := subView font encoding. |
|
6361 |
||
1221 | 6362 |
pref := self preferredFontEncodingFor:newEncoding. |
6363 |
||
6364 |
(pref match:fontsEncoding) ifTrue:[ |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6365 |
^ self |
1140 | 6366 |
]. |
1221 | 6367 |
"/ stupid ... |
6368 |
pref = 'ascii*' ifTrue:[ |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6369 |
(fontsEncoding match:'iso8859*') ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6370 |
^ self |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6371 |
] |
1140 | 6372 |
]. |
6373 |
||
1221 | 6374 |
filter := [:f | |coding| |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6375 |
(coding := f encoding) notNil |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6376 |
and:[pref match:coding]]. |
1221 | 6377 |
|
6378 |
defaultFont := TextView defaultFont onDevice:device. |
|
6379 |
(pref match:(defaultFont encoding)) ifFalse:[ |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6380 |
defaultFont := nil. |
1140 | 6381 |
]. |
6382 |
||
1221 | 6383 |
defaultFont isNil ifTrue:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6384 |
(pref = 'ascii*' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6385 |
or:[pref = 'iso8859*']) ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6386 |
defaultFont := FontDescription family:'courier' face:'medium' style:'roman' size:12 |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6387 |
] |
1221 | 6388 |
]. |
6389 |
||
6390 |
defaultFont isNil ifTrue:[ |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6391 |
defaultFont := device |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6392 |
listOfAvailableFonts |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6393 |
detect:[:f | filter value:f] |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6394 |
ifNone:nil. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6395 |
defaultFont isNil ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6396 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6397 |
"/ flush list, and refetch font list |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6398 |
"/ (in case someone just changed the font path ...) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6399 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6400 |
device flushListOfAvailableFonts. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6401 |
defaultFont := device |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6402 |
listOfAvailableFonts |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6403 |
detect:[:f | filter value:f] |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6404 |
ifNone:nil. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6405 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6406 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6407 |
defaultFont isNil ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6408 |
self warn:'your display does not seem to provide any ' , newEncoding , '-encoded font.'. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6409 |
^ self. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6410 |
] |
1221 | 6411 |
]. |
6412 |
||
6413 |
msg := 'switch to a %1 encoded font ?'. |
|
6414 |
(ask not or:[self confirm:(resources string:msg with:pref) withCRs]) |
|
6415 |
ifTrue:[ |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6416 |
self withWaitCursorDo:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6417 |
f := FontPanel |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6418 |
fontFromUserInitial:defaultFont |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6419 |
title:(resources string:'font selection') |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6420 |
filter:filter. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6421 |
f notNil ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6422 |
subView font:f |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6423 |
] |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6424 |
] |
1140 | 6425 |
] |
6426 |
||
6427 |
"Created: 26.10.1996 / 12:06:54 / cg" |
|
1221 | 6428 |
"Modified: 30.6.1997 / 17:46:46 / cg" |
1162 | 6429 |
! ! |
6430 |
||
6431 |
!FileBrowser methodsFor:'private - file stuff'! |
|
6432 |
||
6433 |
doCreateFile:newName |
|
6434 |
"create an empty file" |
|
6435 |
||
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
6436 |
|aStream f| |
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
6437 |
|
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
6438 |
f := currentDirectory filenameFor:newName. |
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
6439 |
f exists ifTrue:[ |
3421 | 6440 |
(self |
6441 |
ask:(resources string:'%1 already exists\\truncate ?' with:newName) |
|
6442 |
yesButton:'truncate' |
|
6443 |
) ifFalse:[^ self]. |
|
1162 | 6444 |
]. |
6445 |
||
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
6446 |
FileStream openErrorSignal handle:[:ex| |
3421 | 6447 |
^ self showAlert:(resources string:'Cannot create file ''%1'' !!' with:newName) |
6448 |
with:(FileStream lastErrorString) |
|
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
6449 |
] do:[ |
3421 | 6450 |
aStream := f newReadWriteStream. |
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
6451 |
]. |
1162 | 6452 |
aStream notNil ifTrue:[ |
3421 | 6453 |
aStream close. |
6454 |
self updateCurrentDirectoryIfChanged |
|
1162 | 6455 |
] ifFalse:[ |
3421 | 6456 |
self showAlert:(resources string:'Cannot create file ''%1'' !!' with:newName) |
6457 |
with:(FileStream lastErrorString) |
|
1162 | 6458 |
] |
6459 |
||
3421 | 6460 |
"Modified: / 18.9.1997 / 17:21:45 / stefan" |
6461 |
"Modified: / 16.11.2001 / 00:44:49 / cg" |
|
1140 | 6462 |
! |
6463 |
||
1162 | 6464 |
doFileGet:viaDoubleClick |
6465 |
"get selected file - show contents in subView. |
|
6466 |
This is invoked either by the 'get file' menu item, or via double click. |
|
6467 |
When invoked via the menu (viaDoubleClick argument is false), |
|
6468 |
the automatic file action is not performed - instead, the file is always |
|
6469 |
shown in the codeView (if possible). |
|
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
6470 |
This distinction was done to allow xpm or xbm files (which have an automatic |
1162 | 6471 |
action) to be edited." |
6472 |
||
1994 | 6473 |
|fileName| |
6474 |
||
6475 |
fileName := self getSelectedFileName. |
|
6476 |
fileName notNil ifTrue:[ |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6477 |
self doOpenFile:fileName viaDoubleClick:viaDoubleClick |
1162 | 6478 |
] |
6479 |
||
1955
e10babdbf077
before accepting, see if the file is outdated and warn if so.
Claus Gittinger <cg@exept.de>
parents:
1950
diff
changeset
|
6480 |
"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
|
6481 |
"Modified: / 18.9.1997 / 17:35:31 / stefan" |
1994 | 6482 |
"Modified: / 4.2.1999 / 17:43:51 / cg" |
1162 | 6483 |
! |
6484 |
||
2166
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6485 |
doFindFileNamed:namePatterns ignoreCase:ignCaseInName containingString:contentsString ignoreCaseInContents:ignCaseInString sameContentsAsFile:filenameToCompareContentsOrNil sameContentsAs:bytesToCompareContentsOrNil in:aDirectory |
1965 | 6486 |
|dir subDirs nameMatches contentsMatches lines contentsToCompare| |
6487 |
||
6488 |
bytesToCompareContentsOrNil notNil ifTrue:[ |
|
2166
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6489 |
contentsToCompare := bytesToCompareContentsOrNil |
1965 | 6490 |
]. |
1933 | 6491 |
|
6492 |
subDirs := OrderedCollection new. |
|
6493 |
||
6494 |
dir := aDirectory asFilename. |
|
6495 |
self label:myName , '- searching ' , dir name. |
|
6496 |
(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
|
6497 |
|f| |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6498 |
|
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6499 |
f := dir construct:fn. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6500 |
f isDirectory ifTrue:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6501 |
f isSymbolicLink ifFalse:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6502 |
subDirs add:f |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6503 |
] |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6504 |
] ifFalse:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6505 |
(nameMatches := namePatterns isNil) ifFalse:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6506 |
ignCaseInName ifTrue:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6507 |
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
|
6508 |
] ifFalse:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6509 |
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
|
6510 |
] |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6511 |
]. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6512 |
nameMatches ifTrue:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6513 |
filenameToCompareContentsOrNil notNil ifTrue:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6514 |
"/ contents compare ... |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6515 |
contentsMatches := false. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6516 |
f pathName ~= filenameToCompareContentsOrNil pathName ifTrue:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6517 |
f fileSize == filenameToCompareContentsOrNil fileSize ifTrue:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6518 |
contentsToCompare isNil ifTrue:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6519 |
filenameToCompareContentsOrNil fileSize < (512*1024) ifTrue:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6520 |
contentsToCompare := filenameToCompareContentsOrNil binaryContentsOfEntireFile |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6521 |
] |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6522 |
]. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6523 |
contentsToCompare isNil ifTrue:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6524 |
"/ too large - compare block-wise ... |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6525 |
contentsMatches := (filenameToCompareContentsOrNil sameContentsAs:f). |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6526 |
] ifFalse:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6527 |
contentsMatches := contentsToCompare = (f binaryContentsOfEntireFile). |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6528 |
] |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6529 |
]. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6530 |
] ifFalse:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6531 |
f isSymbolicLink ifTrue:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6532 |
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
|
6533 |
subView cursorDown. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6534 |
] |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6535 |
] |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6536 |
] ifFalse:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6537 |
"/ string search ... |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6538 |
(contentsMatches := contentsString isNil) ifFalse:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6539 |
(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
|
6540 |
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
|
6541 |
subView cursorDown. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6542 |
] ifTrue:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6543 |
f fileSize > (4024*1024) ifTrue:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6544 |
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
|
6545 |
subView cursorDown. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6546 |
] ifFalse:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6547 |
Stream lineTooLongErrorSignal handle:[:ex | |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6548 |
|cont| |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6549 |
|
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6550 |
"/ 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
|
6551 |
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
|
6552 |
ignCaseInString ifTrue:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6553 |
contentsMatches := cont asLowercase includesString:contentsString |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6554 |
] ifFalse:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6555 |
contentsMatches := cont includesString:contentsString |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6556 |
]. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6557 |
] do:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6558 |
lines := f contents ? #(). |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6559 |
ignCaseInString ifTrue:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6560 |
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
|
6561 |
] ifFalse:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6562 |
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
|
6563 |
]. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6564 |
]. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6565 |
]. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6566 |
]. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6567 |
]. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6568 |
]. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6569 |
contentsMatches ifTrue:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6570 |
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
|
6571 |
subView cursorDown. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6572 |
] |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6573 |
] |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6574 |
] |
1933 | 6575 |
]. |
6576 |
||
6577 |
subDirs do:[:dir | |
|
2166
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6578 |
self |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6579 |
doFindFileNamed:namePatterns |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6580 |
ignoreCase:ignCaseInName |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6581 |
containingString:contentsString |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6582 |
ignoreCaseInContents:ignCaseInString |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6583 |
sameContentsAsFile:filenameToCompareContentsOrNil |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6584 |
sameContentsAs:contentsToCompare |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6585 |
in:dir |
1933 | 6586 |
]. |
6587 |
||
6588 |
"Created: / 15.10.1998 / 11:37:15 / cg" |
|
6589 |
"Modified: / 15.10.1998 / 12:50:48 / cg" |
|
6590 |
! |
|
6591 |
||
1994 | 6592 |
doOpenFile:fileName viaDoubleClick:viaDoubleClick |
6593 |
"get selected file - show contents in subView. |
|
6594 |
This is invoked either by the 'get file' menu item, or via double click. |
|
6595 |
When invoked via the menu (viaDoubleClick argument is false), |
|
6596 |
the automatic file action is not performed - instead, the file is always |
|
6597 |
shown in the codeView (if possible). |
|
6598 |
This distinction was done to allow xpm or xbm files (which have an automatic |
|
6599 |
action) to be edited." |
|
6600 |
||
6601 |
|iconLbl winLbl f| |
|
6602 |
||
6603 |
self withReadCursorDo:[ |
|
2139 | 6604 |
(f := fileName asFilename) isAbsolute ifFalse:[ |
6605 |
f := currentDirectory construct:fileName. |
|
6606 |
]. |
|
6607 |
f isDirectory ifTrue:[ |
|
6608 |
self doChangeCurrentDirectoryTo:fileName updateHistory:true. |
|
6609 |
winLbl := myName. |
|
6610 |
iconLbl := myName |
|
6611 |
] ifFalse:[ |
|
6612 |
f exists ifFalse:[ |
|
2868 | 6613 |
Dialog warn:(resources string:'oops, ''%1'' is gone or unreadable.' withCRs with:f pathName allBold). |
2139 | 6614 |
^ self |
6615 |
]. |
|
6616 |
timeOfFileRead := f modificationTime. |
|
6617 |
self showFile:fileName insert:false encoding:fileEncoding doubleClick:viaDoubleClick. |
|
6618 |
currentFileName := fileName. |
|
6619 |
||
6620 |
self fileTypeSpecificActions. |
|
6621 |
||
6622 |
subView acceptAction:[:theCode | |
|
3498
5c5fff5b60bf
in doAccept: care for file being removed in the meantime
Claus Gittinger <cg@exept.de>
parents:
3478
diff
changeset
|
6623 |
|filesModificationTime| |
5c5fff5b60bf
in doAccept: care for file being removed in the meantime
Claus Gittinger <cg@exept.de>
parents:
3478
diff
changeset
|
6624 |
|
5c5fff5b60bf
in doAccept: care for file being removed in the meantime
Claus Gittinger <cg@exept.de>
parents:
3478
diff
changeset
|
6625 |
filesModificationTime := f modificationTime. |
5c5fff5b60bf
in doAccept: care for file being removed in the meantime
Claus Gittinger <cg@exept.de>
parents:
3478
diff
changeset
|
6626 |
(filesModificationTime isNil |
5c5fff5b60bf
in doAccept: care for file being removed in the meantime
Claus Gittinger <cg@exept.de>
parents:
3478
diff
changeset
|
6627 |
or:[filesModificationTime <= timeOfFileRead |
5c5fff5b60bf
in doAccept: care for file being removed in the meantime
Claus Gittinger <cg@exept.de>
parents:
3478
diff
changeset
|
6628 |
or:[(self |
3796 | 6629 |
ask:(resources at:'FileBrowser:\\The 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 ?') |
6630 |
yesButton:(resources string:'Save') |
|
6631 |
noButton:(resources string:'Cancel'))]]) |
|
3498
5c5fff5b60bf
in doAccept: care for file being removed in the meantime
Claus Gittinger <cg@exept.de>
parents:
3478
diff
changeset
|
6632 |
ifTrue:[ |
2139 | 6633 |
self withCursor:(Cursor write) do:[ |
6634 |
self writeFile:fileName text:theCode encoding:fileEncoding. |
|
6635 |
timeOfFileRead := f modificationTime. |
|
6636 |
self label:myName , ': ' , currentFileName |
|
6637 |
] |
|
6638 |
] |
|
6639 |
]. |
|
6640 |
||
6641 |
winLbl := myName , ': ' , fileName. |
|
6642 |
f isWritable ifFalse:[ |
|
6643 |
winLbl := winLbl , ' (readonly)' |
|
6644 |
]. |
|
6645 |
iconLbl := fileName |
|
6646 |
]. |
|
6647 |
self label:winLbl. |
|
6648 |
self iconLabel:iconLbl. |
|
1994 | 6649 |
] |
6650 |
||
6651 |
"Created: / 4.2.1999 / 17:43:26 / cg" |
|
2139 | 6652 |
"Modified: / 3.5.1999 / 20:32:27 / ps" |
3498
5c5fff5b60bf
in doAccept: care for file being removed in the meantime
Claus Gittinger <cg@exept.de>
parents:
3478
diff
changeset
|
6653 |
"Modified: / 10.12.2001 / 14:33:38 / cg" |
1994 | 6654 |
! |
6655 |
||
1961
f81295571da7
care for updating listView while removing (get selection before)
Claus Gittinger <cg@exept.de>
parents:
1956
diff
changeset
|
6656 |
doRemove:filesToRemove |
1162 | 6657 |
"remove the selected file(s) - no questions asked" |
6658 |
||
3420 | 6659 |
|msg needUpdate toRemove updateRunning yesToAll mTime| |
1162 | 6660 |
|
3281 | 6661 |
self withWaitCursorDo:[ |
6662 |
updateRunning := listUpdateProcess notNil. |
|
6663 |
self stopUpdateProcess. |
|
6664 |
toRemove := OrderedCollection new. |
|
2772
84029fca1f3d
use removeFile (a bit faster) if known to be a file
Claus Gittinger <cg@exept.de>
parents:
2771
diff
changeset
|
6665 |
|
84029fca1f3d
use removeFile (a bit faster) if known to be a file
Claus Gittinger <cg@exept.de>
parents:
2771
diff
changeset
|
6666 |
"/ |
3281 | 6667 |
"/ did the directory change in the meanwhile ? |
2772
84029fca1f3d
use removeFile (a bit faster) if known to be a file
Claus Gittinger <cg@exept.de>
parents:
2771
diff
changeset
|
6668 |
"/ |
3281 | 6669 |
mTime := currentDirectory modificationTime. |
6670 |
needUpdate := mTime notNil and:[mTime > timeOfLastCheck]. |
|
6671 |
||
6672 |
yesToAll := false. |
|
6673 |
lockUpdate := true. |
|
6674 |
[ |
|
6675 |
filesToRemove keysAndValuesDo:[:idx :fileName | |
|
6676 |
|f| |
|
6677 |
||
6678 |
f := currentDirectory construct:fileName. |
|
6679 |
OperatingSystem accessDeniedErrorSignal handle:[:ex| |
|
6680 |
"was not able to remove it" |
|
3419 | 6681 |
msg := (resources string:'Cannot remove ''%1'' !!' with:fileName). |
3281 | 6682 |
self showAlert:msg with:(OperatingSystem lastErrorString) |
6683 |
] do:[ |
|
6684 |
|answer contents i| |
|
6685 |
||
6686 |
(f isSymbolicLink not and:[f isDirectory]) ifTrue:[ |
|
6687 |
contents := f directoryContents. |
|
6688 |
contents isEmpty ifTrue:[ |
|
6689 |
f remove |
|
6690 |
] ifFalse:[ |
|
6691 |
yesToAll ifFalse:[ |
|
6692 |
idx == filesToRemove size ifTrue:[ |
|
6693 |
answer := Dialog |
|
3419 | 6694 |
confirmWithCancel:(resources string:'Directory ''%1'' is not empty\remove anyway ?' with:fileName allBold) withCRs |
6695 |
labels:(resources array:#('Cancel' 'Remove')) |
|
3281 | 6696 |
values:#(false true) |
6697 |
default:2. |
|
6698 |
] ifFalse:[ |
|
6699 |
answer := Dialog |
|
3419 | 6700 |
confirmWithCancel:(resources string:'Directory ''%1'' is not empty\remove anyway ?' with:fileName allBold) withCRs |
3697
e2f7d8dec6e2
menu items/button labels uppercase-first
Claus Gittinger <cg@exept.de>
parents:
3691
diff
changeset
|
6701 |
labels:(resources array:#('Cancel' 'Remove All' 'Remove')) |
3281 | 6702 |
values:#(false #removeAll true) |
6703 |
default:3. |
|
6704 |
]. |
|
6705 |
answer == false ifTrue:[ |
|
6706 |
^ self |
|
6707 |
]. |
|
6708 |
answer == #removeAll ifTrue:[ |
|
6709 |
yesToAll := true |
|
6710 |
]. |
|
6711 |
]. |
|
6712 |
f recursiveRemove |
|
6713 |
]. |
|
6714 |
] ifFalse:[ |
|
6715 |
f removeFile. |
|
6716 |
]. |
|
6717 |
" |
|
6718 |
self show:nil |
|
6719 |
" |
|
6720 |
i := fileList indexOf:fileName. |
|
6721 |
i ~~ 0 ifTrue:[ |
|
6722 |
toRemove add:i. |
|
6723 |
] |
|
6724 |
]. |
|
6725 |
]. |
|
3596
9761af1f3f72
#valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents:
3568
diff
changeset
|
6726 |
] ensure:[ |
3281 | 6727 |
lockUpdate := false. |
6728 |
fileListView setSelection:nil. |
|
6729 |
||
6730 |
"/ |
|
6731 |
"/ remove reverse - otherwise indices are wrong |
|
6732 |
"/ |
|
6733 |
toRemove sort. |
|
6734 |
toRemove reverseDo:[:idx | |
|
6735 |
fileList removeIndex:idx. |
|
6736 |
fileListView removeIndex:idx. |
|
6737 |
]. |
|
6738 |
||
6739 |
updateRunning ifTrue:[ |
|
6740 |
self updateCurrentDirectory |
|
6741 |
] ifFalse:[ |
|
6742 |
" |
|
6743 |
install a new check after some time |
|
6744 |
" |
|
6745 |
needUpdate ifFalse:[timeOfLastCheck := AbsoluteTime now]. |
|
3520
83cf11e1bf32
schedule checkBlock for the right process
Claus Gittinger <cg@exept.de>
parents:
3503
diff
changeset
|
6746 |
self scheduleCheckBlock. |
3281 | 6747 |
] |
2772
84029fca1f3d
use removeFile (a bit faster) if known to be a file
Claus Gittinger <cg@exept.de>
parents:
2771
diff
changeset
|
6748 |
] |
1162 | 6749 |
] |
6750 |
||
1374
b3a1e95a6220
Do not ask for nonempty directory if remove target is a symlink
Stefan Vogel <sv@exept.de>
parents:
1371
diff
changeset
|
6751 |
"Modified: / 20.11.1997 / 17:39:14 / stefan" |
3420 | 6752 |
"Modified: / 16.11.2001 / 00:43:40 / cg" |
1162 | 6753 |
! |
6754 |
||
6755 |
doRename:oldName to:newName |
|
1331
73e712c85588
Handle errors when renaming files.
Stefan Vogel <sv@exept.de>
parents:
1330
diff
changeset
|
6756 |
"rename a file (or directory)" |
1162 | 6757 |
|
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
6758 |
|old new| |
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
6759 |
|
2989 | 6760 |
(oldName isNil or:[newName isNil]) ifTrue:[ |
6761 |
^ self |
|
6762 |
]. |
|
6763 |
(oldName isBlank or:[newName isBlank]) ifTrue:[ |
|
6764 |
^ self |
|
6765 |
]. |
|
6766 |
(oldName = newName) ifTrue:[ |
|
6767 |
^ self |
|
6768 |
]. |
|
6769 |
||
6770 |
old := currentDirectory filenameFor:oldName. |
|
6771 |
new := currentDirectory filenameFor:newName. |
|
6772 |
||
6773 |
OperatingSystem errorSignal handle:[:ex| |
|
3421 | 6774 |
self showAlert:(resources string:'Cannot rename file ''%1'' to %2 !!' |
2989 | 6775 |
with:oldName with:newName) |
6776 |
with:(OperatingSystem lastErrorString) |
|
6777 |
] do:[ |
|
6778 |
new exists ifTrue:[ |
|
6779 |
(self confirm:(resources string:'''%1'' already exists - rename (i.e. overwrite) anyway ?' with:new baseName allBold)) |
|
6780 |
ifFalse:[ |
|
6781 |
^ self |
|
6782 |
] |
|
6783 |
]. |
|
6784 |
old renameTo:new. |
|
6785 |
]. |
|
3206 | 6786 |
|
3007 | 6787 |
self updateCurrentDirectory |
6788 |
"/ self updateCurrentDirectoryIfChanged. |
|
1162 | 6789 |
|
1911
6d1b77eda98f
check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents:
1903
diff
changeset
|
6790 |
"Modified: / 24.9.1997 / 09:20:00 / stefan" |
3421 | 6791 |
"Modified: / 16.11.2001 / 00:44:27 / cg" |
1162 | 6792 |
! ! |
6793 |
||
6794 |
!FileBrowser methodsFor:'private - file type & info'! |
|
6795 |
||
6796 |
fileCommentStrings |
|
6797 |
"return a useful comment definition; based upon the fileName for now" |
|
6798 |
||
3015
84b5619bd78d
comment strings functionality moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
3013
diff
changeset
|
6799 |
^ MIMETypes commentStringsForFilename:currentFileName |
3072 | 6800 |
ifUnknown:[ |
6801 |
"/ st: |
|
6802 |
#('"/' ('"' '"')) |
|
6803 |
] |
|
1162 | 6804 |
! |
6805 |
||
6806 |
fileTypeSpecificActions |
|
6807 |
"any special fileTypeSpecific actions are done here, |
|
6808 |
when a new file is selected" |
|
6809 |
||
6810 |
|commentStrings| |
|
6811 |
||
6812 |
commentStrings := self fileCommentStrings. |
|
6813 |
commentStrings notNil ifTrue:[ |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6814 |
subView perform:#commentStrings: with:commentStrings ifNotUnderstood:nil |
1162 | 6815 |
]. |
6816 |
||
6817 |
"Modified: 7.1.1997 / 20:30:54 / cg" |
|
6818 |
! |
|
6819 |
||
6820 |
getFileInfoString:longInfo |
|
6821 |
"get stat info on selected file - return a string which can be |
|
6822 |
shown in a box" |
|
6823 |
||
3747
d30bc1e54f15
Remove unused vars and asFilename sends
Stefan Vogel <sv@exept.de>
parents:
3746
diff
changeset
|
6824 |
|fileName f text info fileOutput type modeBits modeString s ts| |
1162 | 6825 |
|
6826 |
fileName := self getSelectedFileName. |
|
6827 |
fileName isNil ifTrue:[^ nil]. |
|
6828 |
||
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
6829 |
f := currentDirectory construct:fileName. |
1162 | 6830 |
info := f info. |
6831 |
||
6832 |
info isNil ifTrue:[ |
|
3421 | 6833 |
self showAlert:(resources string:'Cannot get info of ''%1'' !!' with:fileName) |
6834 |
with:(OperatingSystem lastErrorString). |
|
6835 |
^ nil |
|
1162 | 6836 |
]. |
6837 |
||
6838 |
text := StringCollection new. |
|
6839 |
f isSymbolicLink ifTrue:[ |
|
3421 | 6840 |
text add:(resources string:'symbolic link to: %1' with:(f linkInfo path)) |
1162 | 6841 |
]. |
6842 |
||
6843 |
type := info type. |
|
6844 |
(longInfo and:[type == #regular]) ifTrue:[ |
|
3747
d30bc1e54f15
Remove unused vars and asFilename sends
Stefan Vogel <sv@exept.de>
parents:
3746
diff
changeset
|
6845 |
fileOutput := (currentDirectory construct:fileName) fileType. |
1162 | 6846 |
]. |
6847 |
||
6848 |
s := (resources at:'type: '). |
|
6849 |
fileOutput isNil ifTrue:[ |
|
3421 | 6850 |
s := s , type asString |
1162 | 6851 |
] ifFalse:[ |
3421 | 6852 |
s := s , 'regular (' , fileOutput , ')' |
1162 | 6853 |
]. |
6854 |
text add:s. |
|
6855 |
text add:(resources string:'size: %1' with:(info size) printString). |
|
6856 |
||
6857 |
modeBits := info mode. |
|
6858 |
modeString := self getModeString:modeBits. |
|
6859 |
longInfo ifTrue:[ |
|
3421 | 6860 |
text add:(resources string:'access: %1 (%2)' |
6861 |
with:modeString |
|
6862 |
with:(modeBits printStringRadix:8)) |
|
1162 | 6863 |
] ifFalse:[ |
3421 | 6864 |
text add:(resources string:'access: %1' with:modeString) |
1162 | 6865 |
]. |
6866 |
text add:(resources string:'owner: %1' |
|
3421 | 6867 |
with:(OperatingSystem getUserNameFromID:(info uid))). |
1162 | 6868 |
longInfo ifTrue:[ |
3421 | 6869 |
text add:(resources string:'group: %1' |
6870 |
with:(OperatingSystem getGroupNameFromID:(info gid))). |
|
6871 |
||
6872 |
ts := info accessed. |
|
6873 |
text add:(resources string:'last access: %1 %2' |
|
6874 |
with:(ts asTime printString) |
|
6875 |
with:(ts asDate printString)). |
|
6876 |
||
6877 |
ts := info modified. |
|
6878 |
text add:(resources string:'last modification: %1 %2' |
|
6879 |
with:(ts asTime printString) |
|
6880 |
with:(ts asDate printString)). |
|
1162 | 6881 |
]. |
6882 |
^ text asString |
|
6883 |
||
3421 | 6884 |
"Modified: / 8.9.1995 / 11:59:28 / claus" |
6885 |
"Modified: / 18.9.1997 / 16:34:31 / stefan" |
|
6886 |
"Modified: / 16.11.2001 / 00:45:11 / cg" |
|
1162 | 6887 |
! |
6888 |
||
6889 |
getInfoFile |
|
6890 |
"get filename of a description-file (.dir.info, README etc.); |
|
6891 |
This file is automatically shown when a directory is enterred. |
|
6892 |
You can add more names below if you like." |
|
6893 |
||
6894 |
#( |
|
6895 |
'.dir.info' |
|
6896 |
'README' |
|
6897 |
'ReadMe' |
|
6898 |
'Readme' |
|
6899 |
'readme' |
|
6900 |
'read.me' |
|
6901 |
'Read.me' |
|
6902 |
'READ.ME' |
|
1272 | 6903 |
'README.TXT' |
6904 |
'readme.txt' |
|
6905 |
'Readme.txt' |
|
1307 | 6906 |
'Info.txt' |
6907 |
'info.txt' |
|
6908 |
'INFO.TXT' |
|
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
6909 |
) do:[:f | |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6910 |
|n| |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6911 |
n := currentDirectory construct:f. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6912 |
(n isReadable and:[n isDirectory not]) ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6913 |
^ f. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6914 |
] |
1140 | 6915 |
]. |
1162 | 6916 |
^ nil |
6917 |
||
1272 | 6918 |
"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
|
6919 |
"Modified: 16.9.1997 / 15:26:53 / stefan" |
1162 | 6920 |
! |
6921 |
||
6922 |
getModeString:modeBits |
|
6923 |
"convert file-mode bits into a more user-friendly string. |
|
6924 |
This is wrong here - should be moved into OperatingSystem." |
|
6925 |
||
6926 |
^ self getModeString:modeBits |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6927 |
with:#( 'owner:' $r $w $x |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6928 |
' group:' $r $w $x |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6929 |
' others:' $r $w $x ) |
1140 | 6930 |
! |
6931 |
||
1162 | 6932 |
getModeString:modeBits with:texts |
6933 |
"convert file-mode bits into a more user-friendly string. |
|
6934 |
This is wrong here - should be moved into OperatingSystem." |
|
6935 |
||
6936 |
|bits modeString| |
|
6937 |
||
6938 |
bits := modeBits bitAnd:8r777. |
|
6939 |
modeString := ''. |
|
6940 |
||
6941 |
#( nil 8r400 8r200 8r100 nil 8r040 8r020 8r010 nil 8r004 8r002 8r001 ) |
|
6942 |
with: texts do:[:bitMask :access | |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6943 |
|ch| |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6944 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6945 |
bitMask isNil ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6946 |
modeString := modeString , (resources string:access) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6947 |
] ifFalse:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6948 |
(bits bitAnd:bitMask) == 0 ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6949 |
ch := $- |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6950 |
] ifFalse:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6951 |
ch := access |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6952 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6953 |
modeString := modeString copyWith:ch |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6954 |
] |
633
4630175ed31e
double click on .htm / .html files open a viewer;
Claus Gittinger <cg@exept.de>
parents:
585
diff
changeset
|
6955 |
]. |
1162 | 6956 |
^ modeString |
6957 |
! |
|
6958 |
||
6959 |
showInfo |
|
6960 |
"show directory info when dir has changed" |
|
6961 |
||
6962 |
|info txt| |
|
6963 |
||
6964 |
info := self getInfoFile. |
|
6965 |
info notNil ifTrue:[ |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6966 |
txt := self readFile:info |
1162 | 6967 |
]. |
6968 |
self show:txt. |
|
6969 |
! |
|
6970 |
||
6971 |
sizePrintString:size |
|
6972 |
"helper for update-directory to return a string with a files size. |
|
6973 |
This one gives the size in byte, Kb or Mb depending on size. |
|
6974 |
If you dont like this, just uncomment the first statement below." |
|
6975 |
||
6976 |
|unitString n| |
|
6977 |
||
6978 |
" |
|
6979 |
^ size printString. |
|
6980 |
" |
|
6981 |
unitString := ''. |
|
6982 |
size < (500 * 1024) ifTrue:[ |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6983 |
size < 1024 ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6984 |
n := size |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6985 |
] ifFalse:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6986 |
n := (size * 10 // 1024 / 10.0). |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6987 |
unitString := ' Kb' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6988 |
] |
1162 | 6989 |
] ifFalse:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6990 |
n := (size * 10 // 1024 // 1024 / 10.0). |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6991 |
unitString := ' Mb' |
1162 | 6992 |
]. |
6993 |
^ (n printStringLeftPaddedTo:5) , unitString. |
|
6994 |
! ! |
|
6995 |
||
6996 |
!FileBrowser methodsFor:'private - file-I/O'! |
|
6997 |
||
6998 |
readFile:fileName |
|
6999 |
"read in the file, answer its contents as StringCollection" |
|
7000 |
||
7001 |
^ self readFile:fileName lineDelimiter:Character cr encoding:nil |
|
7002 |
||
7003 |
"Modified: 22.2.1996 / 14:57:08 / cg" |
|
7004 |
! |
|
7005 |
||
7006 |
readFile:fileName lineDelimiter:aCharacter encoding:encoding |
|
7007 |
"read in the file, return its contents as StringCollection. |
|
7008 |
The files lines are delimited by aCharacter. |
|
7009 |
If encoding is nonNil, the file is assumed to be coded according to |
|
7010 |
that symbol, and #decodeString: should be able to convert it." |
|
7011 |
||
1994 | 7012 |
|f stream text msg sz| |
7013 |
||
7014 |
(f := fileName asFilename) isAbsolute ifFalse:[ |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7015 |
f := (currentDirectory construct:fileName) |
1994 | 7016 |
]. |
7017 |
stream := f readStream. |
|
1162 | 7018 |
stream isNil ifTrue:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7019 |
msg := (resources string:'cannot read file ''%1'' !!' with:fileName). |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7020 |
self showAlert:msg with:(FileStream lastErrorString). |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7021 |
^ nil |
1162 | 7022 |
]. |
7023 |
||
7024 |
" |
|
7025 |
for very big files, give ObjectMemory a hint, to preallocate more |
|
7026 |
" |
|
1311 | 7027 |
(sz := stream fileSize) > 1000000 ifTrue:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7028 |
Processor activeProcess withPriority:Processor userBackgroundPriority do:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7029 |
ObjectMemory announceSpaceNeed:(sz + (sz // 5)) "/ add 20% for tab expansion |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7030 |
]. |
1162 | 7031 |
]. |
7032 |
||
7033 |
text := self readStream:stream lineDelimiter:aCharacter encoding:encoding. |
|
7034 |
stream close. |
|
7035 |
^ text |
|
7036 |
||
1994 | 7037 |
"Created: / 22.2.1996 / 14:56:48 / cg" |
7038 |
"Modified: / 18.9.1997 / 17:06:54 / stefan" |
|
7039 |
"Modified: / 4.2.1999 / 17:52:18 / cg" |
|
1162 | 7040 |
! |
7041 |
||
7042 |
readStream:aStream |
|
7043 |
"read in from aStream, answer its contents as StringCollection" |
|
7044 |
||
7045 |
^ self readStream:aStream lineDelimiter:Character cr encoding:nil |
|
7046 |
||
7047 |
"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
|
7048 |
! |
4630175ed31e
double click on .htm / .html files open a viewer;
Claus Gittinger <cg@exept.de>
parents:
585
diff
changeset
|
7049 |
|
1162 | 7050 |
readStream:aStream lineDelimiter:aCharacter encoding:encoding |
7051 |
"read from aStream, answer its contents as StringCollection. |
|
7052 |
The files lines are delimited by aCharacter. |
|
7053 |
If encoding is nonNil, the file is assumed to be coded according to |
|
7054 |
that symbol, and #decodeString: should be able to convert it." |
|
7055 |
||
7056 |
|text line enc| |
|
7057 |
||
7058 |
text := StringCollection new. |
|
7059 |
||
7060 |
enc := encoding. |
|
7061 |
enc == #iso8859 ifTrue:[ |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7062 |
enc := nil |
1162 | 7063 |
]. |
7064 |
||
7065 |
aCharacter == Character cr ifTrue:[ |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7066 |
FileStream lineTooLongErrorSignal handle:[:ex | |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7067 |
|s partialLine| |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7068 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7069 |
s := ex parameter at:1. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7070 |
partialLine := ex parameter at:2. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7071 |
ex proceedWith:(partialLine , s upTo:aCharacter) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7072 |
] do:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7073 |
[aStream atEnd] whileFalse:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7074 |
line := aStream nextLine withTabsExpanded. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7075 |
enc notNil ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7076 |
line := line decodeFrom:enc |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7077 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7078 |
text add:line |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7079 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7080 |
]. |
1162 | 7081 |
] ifFalse:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7082 |
[aStream atEnd] whileFalse:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7083 |
line := (aStream upTo:aCharacter) withTabsExpanded. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7084 |
enc notNil ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7085 |
line := line decodeFrom:enc |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7086 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7087 |
text add:line |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7088 |
]. |
633
4630175ed31e
double click on .htm / .html files open a viewer;
Claus Gittinger <cg@exept.de>
parents:
585
diff
changeset
|
7089 |
]. |
1162 | 7090 |
^ text |
7091 |
||
1994 | 7092 |
"Created: / 22.2.1996 / 14:58:25 / cg" |
7093 |
"Modified: / 5.2.1999 / 00:53:22 / cg" |
|
1162 | 7094 |
! |
7095 |
||
7096 |
showFile:fileName |
|
7097 |
"show contents of fileName in subView" |
|
7098 |
||
1689 | 7099 |
fileListView selection:(fileList indexOf:fileName). |
7100 |
self fileGet |
|
7101 |
||
7102 |
"Modified: / 17.6.1998 / 11:26:13 / cg" |
|
1162 | 7103 |
! |
7104 |
||
7105 |
showFile:fileName insert:insert encoding:encoding |
|
7106 |
"show/insert contents of fileName in subView" |
|
7107 |
||
7108 |
^ self |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7109 |
showFile:fileName insert:insert encoding:encoding doubleClick:false |
1162 | 7110 |
|
7111 |
"Modified: 19.6.1996 / 09:40:19 / cg" |
|
7112 |
! |
|
7113 |
||
3414 | 7114 |
showFile:fileNameString insert:insert encoding:encoding doubleClick:viaDoubleClick |
1162 | 7115 |
"show/insert contents of fileName in subView" |
7116 |
||
3527 | 7117 |
|path buffer s n ok convert text msg eol guess action enc |
3414 | 7118 |
fontsEncoding pref failWarning f answer fileName| |
7119 |
||
7120 |
fileName := fileNameString asFilename. |
|
7121 |
||
7122 |
fileName isAbsolute ifFalse:[ |
|
7123 |
path := currentDirectory filenameFor:fileNameString. |
|
1994 | 7124 |
] ifTrue:[ |
3414 | 7125 |
path := fileName asAbsoluteFilename |
1994 | 7126 |
]. |
7127 |
||
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
7128 |
(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
|
7129 |
"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
|
7130 |
path exists ifFalse:[ |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
7131 |
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
|
7132 |
] ifTrue:[ |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
7133 |
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
|
7134 |
]. |
3528 | 7135 |
msg := (resources string:msg) withCRs. |
7136 |
Dialog warn:(msg bindWith:fileNameString allBold). |
|
2158
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
7137 |
^ self |
1162 | 7138 |
]. |
7139 |
||
7140 |
"/ |
|
7141 |
"/ check if file is a text file |
|
7142 |
"/ |
|
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
7143 |
s := path readStream. |
1162 | 7144 |
s isNil ifTrue:[ |
3697
e2f7d8dec6e2
menu items/button labels uppercase-first
Claus Gittinger <cg@exept.de>
parents:
3691
diff
changeset
|
7145 |
self showAlert:(resources string:'Cannot read file ''%1'' !!' with:fileNameString) |
2158
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
7146 |
with:(FileStream lastErrorString). |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
7147 |
^ nil |
1162 | 7148 |
]. |
7149 |
||
1222
f2952fc3ced9
look at more when guessing the encoding
Claus Gittinger <cg@exept.de>
parents:
1221
diff
changeset
|
7150 |
buffer := String new:4096. |
f2952fc3ced9
look at more when guessing the encoding
Claus Gittinger <cg@exept.de>
parents:
1221
diff
changeset
|
7151 |
n := s nextBytes:4096 into:buffer. |
1162 | 7152 |
s close. |
7153 |
||
7154 |
enc := encoding. |
|
7155 |
ok := true. |
|
7156 |
guess := self guessEncodingFrom:buffer. |
|
7157 |
||
7158 |
guess == #binary ifTrue:[ |
|
2158
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
7159 |
ok := false. |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
7160 |
viaDoubleClick ifTrue:[ |
3414 | 7161 |
(self binaryFileAction:fileNameString) ifTrue:[^ self]. |
2158
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
7162 |
]. |
3414 | 7163 |
answer := self confirmWithCancel:(resources string:'''%1'' seems to be a binary file (or unsupported format) - show anyway ?' with:fileNameString). |
3061 | 7164 |
answer == false ifTrue:[^ self]. |
7165 |
answer isNil ifTrue:[AbortSignal raise]. |
|
1162 | 7166 |
] ifFalse:[ |
2158
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
7167 |
viaDoubleClick ifTrue:[ |
3414 | 7168 |
(self nonBinaryFileAction:fileNameString) ifTrue:[^ self]. |
2158
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
7169 |
]. |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
7170 |
|
3413 | 7171 |
fontsEncoding := subView font encoding ? 'unknown'. |
2158
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
7172 |
pref := self preferredFontEncodingFor:guess. |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
7173 |
|
3381
2a0331ea6dfc
stupid encoding question eliminated
Claus Gittinger <cg@exept.de>
parents:
3342
diff
changeset
|
7174 |
ok := pref asLowercase match:fontsEncoding asLowercase. |
2158
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
7175 |
ok ifFalse:[ |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
7176 |
pref = 'iso8859*' ifTrue:[ |
3381
2a0331ea6dfc
stupid encoding question eliminated
Claus Gittinger <cg@exept.de>
parents:
3342
diff
changeset
|
7177 |
ok := 'ascii*' match:fontsEncoding asLowercase |
2158
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
7178 |
] |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
7179 |
]. |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
7180 |
ok ifTrue:[ |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
7181 |
fileEncoding := guess. |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
7182 |
enc := guess. |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
7183 |
] ifFalse:[ |
2779 | 7184 |
doNotShowFontDialog == true ifTrue:[ |
7185 |
action := #show |
|
7186 |
] ifFalse:[ |
|
3414 | 7187 |
action := Dialog choose:(resources string:'''%1'' seems to require a %2 font.' with:fileNameString with:pref) |
3697
e2f7d8dec6e2
menu items/button labels uppercase-first
Claus Gittinger <cg@exept.de>
parents:
3691
diff
changeset
|
7188 |
labels:(resources array:#('Cancel' 'Show' 'Dont Ask Again' 'Change Font')) |
2779 | 7189 |
values:#(nil #show #showAlways #encoding) |
7190 |
default:#encoding. |
|
7191 |
]. |
|
7192 |
action == #showAlways ifTrue:[ |
|
7193 |
doNotShowFontDialog := true. |
|
7194 |
action := #show. |
|
7195 |
]. |
|
2158
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
7196 |
action isNil ifTrue:[^ self]. |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
7197 |
action == #encoding ifTrue:[ |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
7198 |
fileEncoding := guess asSymbol. |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
7199 |
subView externalEncoding:fileEncoding. |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
7200 |
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
|
7201 |
] ifFalse:[ |
2779 | 7202 |
doNotShowFontDialog ~~ true ifTrue:[ |
7203 |
self information:(resources string:'Individual characters may be invisible/wrong in this font.') |
|
7204 |
] |
|
2158
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
7205 |
]. |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
7206 |
enc := fileEncoding. |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
7207 |
]. |
1162 | 7208 |
]. |
7209 |
||
7210 |
convert := false. |
|
1329 | 7211 |
"/ ok ifTrue:[ |
7212 |
"/ "/ |
|
7213 |
"/ "/ check if line delimiter is a cr |
|
7214 |
"/ "/ |
|
7215 |
"/ i := buffer indexOf:Character cr. |
|
7216 |
"/ i == 0 ifTrue:[ |
|
7217 |
"/ "/ |
|
7218 |
"/ "/ no newline found - try cr |
|
7219 |
"/ "/ |
|
7220 |
"/ i := buffer indexOf:(Character value:13). |
|
7221 |
"/ i ~~ 0 ifTrue:[ |
|
3414 | 7222 |
"/ convert := self confirm:(resources string:'''%1'' seems to have CR as line delimiter - convert to NL ?' with:fileNameString). |
1329 | 7223 |
"/ ] |
7224 |
"/ ] |
|
7225 |
"/ ]. |
|
1162 | 7226 |
|
7227 |
insert ifFalse:[ |
|
2158
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
7228 |
"/ release old text first |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
7229 |
"/ - 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
|
7230 |
"/ (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
|
7231 |
"/ 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
|
7232 |
|
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
7233 |
subView contents:nil. |
1162 | 7234 |
]. |
7235 |
||
7236 |
convert ifTrue:[ |
|
2158
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
7237 |
eol := Character value:13 |
1162 | 7238 |
] ifFalse:[ |
2158
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
7239 |
eol := Character cr |
1162 | 7240 |
]. |
1212 | 7241 |
|
1214
02d5bbd925dd
allow decoding errors to be ignored
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
7242 |
failWarning := false. |
1212 | 7243 |
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
|
7244 |
|errStr| |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
7245 |
|
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
7246 |
failWarning ifFalse:[ |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
7247 |
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
|
7248 |
(self confirm:(resources |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
7249 |
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
|
7250 |
with:errStr) withCRs) |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
7251 |
ifFalse:[ |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
7252 |
^ self |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
7253 |
]. |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
7254 |
failWarning := true. |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
7255 |
]. |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
7256 |
ex proceed. |
1212 | 7257 |
] do:[ |
3414 | 7258 |
text := self readFile:fileNameString lineDelimiter:eol encoding:enc. |
1212 | 7259 |
]. |
1162 | 7260 |
|
7261 |
insert ifFalse:[ |
|
3414 | 7262 |
(f := fileName) isAbsolute ifFalse:[ |
7263 |
f := (currentDirectory construct:fileNameString) |
|
2951
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
7264 |
]. |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
7265 |
self class addToVisitedFileHistory:f pathName. |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
7266 |
|
2158
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
7267 |
self show:text |
1162 | 7268 |
] ifTrue:[ |
2158
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
7269 |
subView insertSelectedStringAtCursor:text asString |
1162 | 7270 |
]. |
7271 |
||
1994 | 7272 |
"Created: / 19.6.1996 / 09:39:52 / cg" |
7273 |
"Modified: / 18.9.1997 / 17:10:20 / stefan" |
|
3414 | 7274 |
"Modified: / 15.11.2001 / 17:15:27 / cg" |
1162 | 7275 |
! |
7276 |
||
7277 |
writeFile:fileName text:someText encoding:encoding |
|
1353 | 7278 |
|stream errReason msg startNr nLines string| |
7279 |
||
7280 |
errReason := ''. |
|
7281 |
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
|
7282 |
errReason := ex errorString. |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
7283 |
ex return. |
1353 | 7284 |
] do:[ |
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
7285 |
stream := (currentDirectory filenameFor:fileName) writeStream. |
1353 | 7286 |
]. |
1162 | 7287 |
stream isNil ifTrue:[ |
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
7288 |
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
|
7289 |
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
|
7290 |
^ self. |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
7291 |
]. |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
7292 |
|
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
7293 |
dosEOLMode value == true ifTrue:[ |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
7294 |
stream eolMode:#crlf. |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
7295 |
"/ must do it lineWise ... |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
7296 |
someText asStringCollection do:[:line | |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
7297 |
line notNil ifTrue:[ |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
7298 |
stream nextPutAll:line |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
7299 |
]. |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
7300 |
stream cr |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
7301 |
] |
1162 | 7302 |
] ifFalse:[ |
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
7303 |
(someText isString) ifTrue:[ |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
7304 |
stream nextPutAll:someText. |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
7305 |
] ifFalse:[ |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
7306 |
"/ |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
7307 |
"/ 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
|
7308 |
"/ 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
|
7309 |
"/ 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
|
7310 |
"/ |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
7311 |
startNr := 1. |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
7312 |
nLines := someText size. |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
7313 |
[startNr <= nLines] whileTrue:[ |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
7314 |
string := someText asStringWithCRsFrom:startNr |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
7315 |
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
|
7316 |
compressTabs:compressTabs. |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
7317 |
encoding notNil ifTrue:[ |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
7318 |
string := string encodeInto:encoding |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
7319 |
]. |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
7320 |
stream nextPutAll:string. |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
7321 |
startNr := startNr + 1000 + 1. |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
7322 |
]. |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
7323 |
]. |
1353 | 7324 |
]. |
7325 |
||
7326 |
stream close. |
|
7327 |
subView modified:false |
|
1162 | 7328 |
|
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
7329 |
"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
|
7330 |
"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
|
7331 |
"Modified: / 6.5.1999 / 11:45:50 / cg" |
1140 | 7332 |
! ! |
7333 |
||
7334 |
!FileBrowser methodsFor:'private - presentation'! |
|
7335 |
||
7336 |
defineTabulatorsForLongList |
|
7337 |
"define the tabs for the long list" |
|
7338 |
||
7339 |
tabSpec := TabulatorSpecification new. |
|
7340 |
tabSpec unit:#inch. |
|
7341 |
"/ tabSpec positions:#(0 0.25 2.3 4.3 5.3 6.0 6.5). |
|
7342 |
tabSpec widths: #(0.25 2 2.0 1 0.5 0.5 1"any"). |
|
7343 |
" icon name mode owner group size type" |
|
7344 |
tabSpec align: #(#left #left #left #right #right #decimal #left). |
|
7345 |
tabSpec addDependent:self. |
|
7346 |
||
7347 |
tabRulerView tabulatorSpecification:tabSpec. |
|
7348 |
||
7349 |
"Modified: 17.4.1997 / 02:56:07 / cg" |
|
172 | 7350 |
! |
7351 |
||
1140 | 7352 |
defineTabulatorsForShortList |
7353 |
"define the tabs for the short list" |
|
7354 |
||
7355 |
tabSpec := TabulatorSpecification new. |
|
7356 |
tabSpec unit:#inch. |
|
7357 |
"/ tabSpec positions:#(0 0.25 ). |
|
7358 |
tabSpec widths: #(0.25 2 ). |
|
7359 |
" icon name" |
|
7360 |
tabSpec align: #(#left #left). |
|
7361 |
tabSpec addDependent:self. |
|
7362 |
||
1758 | 7363 |
tabRulerView notNil ifTrue:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7364 |
tabRulerView tabulatorSpecification:tabSpec. |
1758 | 7365 |
]. |
7366 |
||
7367 |
"Created: / 17.4.1997 / 02:51:41 / cg" |
|
7368 |
"Modified: / 27.7.1998 / 20:23:34 / cg" |
|
1140 | 7369 |
! |
7370 |
||
7371 |
iconForFile:aFilenameString |
|
1147 | 7372 |
"given a fileName, return an appropriate icon" |
7373 |
||
1784
329e3a904236
ask MIMETypes when mapping suffixes to icons.
Claus Gittinger <cg@exept.de>
parents:
1758
diff
changeset
|
7374 |
|f icn key key2 suff mimeType| |
1140 | 7375 |
|
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
7376 |
f := currentDirectory construct:aFilenameString. |
1140 | 7377 |
f isDirectory ifTrue:[ |
2187
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
7378 |
f isSymbolicLink ifTrue:[ |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
7379 |
key := #directoryLink |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
7380 |
] ifFalse:[ |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
7381 |
key := #directory. |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
7382 |
(f isReadable not or:[f isExecutable not]) ifTrue:[ |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
7383 |
key := #directoryLocked |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
7384 |
]. |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
7385 |
] |
1147 | 7386 |
] ifFalse:[ |
2187
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
7387 |
f isSymbolicLink ifTrue:[ |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
7388 |
f isReadable not ifTrue:[ |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
7389 |
key := #fileLocked |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
7390 |
] ifFalse:[ |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
7391 |
key := #fileLink |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
7392 |
] |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
7393 |
] ifFalse:[ |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
7394 |
key := key2 := #file. |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
7395 |
f isExecutableProgram ifTrue:[ |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
7396 |
key := key2 := #executableFile |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
7397 |
]. |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
7398 |
(f isReadable not) ifTrue:[ |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
7399 |
key := #fileLocked |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
7400 |
] ifFalse:[ |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
7401 |
suff := f suffix. |
2504 | 7402 |
(suff = 'bak' or:[suff = 'sav']) ifTrue:[ |
7403 |
suff := f withoutSuffix suffix. |
|
7404 |
]. |
|
7405 |
suff size > 0 ifTrue:[ |
|
7406 |
mimeType := MIMETypes mimeTypeForSuffix:suff. |
|
7407 |
mimeType notNil ifTrue:[ |
|
7408 |
(mimeType startsWith:'image/') ifTrue:[ |
|
7409 |
key := #imageFile |
|
7410 |
] ifFalse:[ |
|
7411 |
(mimeType startsWith:'text/') ifTrue:[ |
|
7412 |
key := #textFile |
|
7413 |
] |
|
2187
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
7414 |
] |
2504 | 7415 |
]. |
2187
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
7416 |
]. |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
7417 |
]. |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
7418 |
]. |
1141 | 7419 |
]. |
1147 | 7420 |
|
1784
329e3a904236
ask MIMETypes when mapping suffixes to icons.
Claus Gittinger <cg@exept.de>
parents:
1758
diff
changeset
|
7421 |
"/ local (device) icons |
329e3a904236
ask MIMETypes when mapping suffixes to icons.
Claus Gittinger <cg@exept.de>
parents:
1758
diff
changeset
|
7422 |
icons notNil ifTrue:[ |
2187
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
7423 |
mimeType notNil ifTrue:[ |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
7424 |
icn := icons at:mimeType ifAbsent:nil. |
2796 | 7425 |
] ifFalse:[ |
7426 |
icn := icons at:key ifAbsent:nil. |
|
2187
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
7427 |
]. |
2796 | 7428 |
icn notNil ifTrue:[^ icn]. |
1141 | 7429 |
]. |
1495 | 7430 |
|
1784
329e3a904236
ask MIMETypes when mapping suffixes to icons.
Claus Gittinger <cg@exept.de>
parents:
1758
diff
changeset
|
7431 |
"/ global icons |
329e3a904236
ask MIMETypes when mapping suffixes to icons.
Claus Gittinger <cg@exept.de>
parents:
1758
diff
changeset
|
7432 |
|
329e3a904236
ask MIMETypes when mapping suffixes to icons.
Claus Gittinger <cg@exept.de>
parents:
1758
diff
changeset
|
7433 |
Icons notNil ifTrue:[ |
2187
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
7434 |
mimeType notNil ifTrue:[ |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
7435 |
icn := Icons at:mimeType ifAbsent:nil. |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
7436 |
"/ sight - check for parent-MIME types ... |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
7437 |
|
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
7438 |
[icn isNil and:[mimeType includes:$/]] whileTrue:[ |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
7439 |
mimeType := mimeType copyTo:(mimeType lastIndexOf:$/) - 1. |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
7440 |
icn := Icons at:mimeType ifAbsent:nil. |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
7441 |
]. |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
7442 |
]. |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
7443 |
icn notNil ifTrue:[ |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
7444 |
key := mimeType |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
7445 |
] ifFalse:[ |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
7446 |
icn := Icons at:key ifAbsent:nil. |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
7447 |
]. |
1784
329e3a904236
ask MIMETypes when mapping suffixes to icons.
Claus Gittinger <cg@exept.de>
parents:
1758
diff
changeset
|
7448 |
]. |
1495 | 7449 |
|
1253 | 7450 |
icn isNil ifTrue:[ |
2187
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
7451 |
( (key := key2) isNil |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
7452 |
or:[(icn := icons at:key ifAbsent:nil) notNil |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
7453 |
or:[(icn := Icons at:key ifAbsent:nil) isNil]] |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
7454 |
) ifTrue:[ |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
7455 |
^ icn |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
7456 |
] |
1253 | 7457 |
]. |
1495 | 7458 |
|
1784
329e3a904236
ask MIMETypes when mapping suffixes to icons.
Claus Gittinger <cg@exept.de>
parents:
1758
diff
changeset
|
7459 |
"/ remember device icon |
329e3a904236
ask MIMETypes when mapping suffixes to icons.
Claus Gittinger <cg@exept.de>
parents:
1758
diff
changeset
|
7460 |
icn := icn copy onDevice:device. |
1495 | 7461 |
icn clearMaskedPixels. |
7462 |
icons at:key put:icn. |
|
1239
e58e2cb6639a
allow specification of icons from resource file.
Claus Gittinger <cg@exept.de>
parents:
1235
diff
changeset
|
7463 |
^ icn |
1141 | 7464 |
|
1746
68a187e3f30f
another icon for executable files.
Claus Gittinger <cg@exept.de>
parents:
1737
diff
changeset
|
7465 |
"Modified: / 18.9.1997 / 16:35:28 / stefan" |
2504 | 7466 |
"Modified: / 23.12.1999 / 22:28:00 / cg" |
36 | 7467 |
! |
7468 |
||
2094 | 7469 |
stopImageRenderProcess |
7470 |
imageRenderProcess notNil ifTrue:[ |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7471 |
imageRenderProcess terminate. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7472 |
imageRenderProcess := nil |
2094 | 7473 |
]. |
7474 |
||
7475 |
"Created: 19.4.1997 / 13:51:34 / cg" |
|
7476 |
! |
|
7477 |
||
1156
f3df28086973
dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents:
1154
diff
changeset
|
7478 |
stopUpdateProcess |
f3df28086973
dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents:
1154
diff
changeset
|
7479 |
Processor removeTimedBlock:checkBlock. |
f3df28086973
dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents:
1154
diff
changeset
|
7480 |
listUpdateProcess notNil ifTrue:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7481 |
listUpdateProcess terminate. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7482 |
listUpdateProcess := nil. |
1156
f3df28086973
dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents:
1154
diff
changeset
|
7483 |
]. |
f3df28086973
dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents:
1154
diff
changeset
|
7484 |
|
f3df28086973
dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents:
1154
diff
changeset
|
7485 |
"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
|
7486 |
! |
f3df28086973
dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents:
1154
diff
changeset
|
7487 |
|
36 | 7488 |
updateCurrentDirectory |
7489 |
"update listView with directory contents" |
|
7490 |
||
49 | 7491 |
"the code below may look somewhat complex - |
7492 |
it reads the directory first for the names, |
|
1151
194b10bad6da
great asynchronous list update;
Claus Gittinger <cg@exept.de>
parents:
1147
diff
changeset
|
7493 |
then (in followup sweeps over the files) gets the |
194b10bad6da
great asynchronous list update;
Claus Gittinger <cg@exept.de>
parents:
1147
diff
changeset
|
7494 |
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
|
7495 |
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
|
7496 |
(i.e. stat-calls) may take long - especially on NFS-mounted directories. |
49 | 7497 |
The file reading is done at lower priority, to let user continue |
7498 |
his work in other views. However, to be fair to other fileBrowser, |
|
7499 |
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
|
7500 |
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
|
7501 |
Therefore, browsers which read short directories will finish first. |
49 | 7502 |
ST/X users love this behavior ;-) |
7503 |
" |
|
7504 |
||
3665 | 7505 |
|files matchPattern list passDone ignoreCase oldSelection newSelection times types| |
3419 | 7506 |
|
294 | 7507 |
self withReadCursorDo:[ |
2255
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7508 |
self stopUpdateProcess. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7509 |
|
2636 | 7510 |
timeOfLastCheck := currentDirectory modificationTime. |
2255
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7511 |
|
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7512 |
files := currentDirectory asFilename fullDirectoryContents. |
1329 | 7513 |
|
7514 |
"/ (files includes:(Filename parentDirectoryName)) ifTrue:[ |
|
7515 |
"/ upButton enable. |
|
7516 |
"/ ] ifFalse:[ |
|
7517 |
"/ upButton disable. |
|
7518 |
"/ ]. |
|
7519 |
||
2255
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7520 |
"/ show files which are either directories |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7521 |
"/ or match the current pattern |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7522 |
|
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7523 |
matchPattern := filterField contents. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7524 |
(matchPattern notNil and:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7525 |
matchPattern isEmpty not and:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7526 |
matchPattern ~= '*']]) ifTrue:[ |
2498
77c52f2004a4
care for case-insensitive systems in pattern-match (windows)
Claus Gittinger <cg@exept.de>
parents:
2492
diff
changeset
|
7527 |
ignoreCase := Filename isCaseSensitive not. |
2255
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7528 |
files := files select:[:aName | |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7529 |
((currentDirectory construct:aName) isDirectory) |
2498
77c52f2004a4
care for case-insensitive systems in pattern-match (windows)
Claus Gittinger <cg@exept.de>
parents:
2492
diff
changeset
|
7530 |
or:[matchPattern compoundMatch:aName ignoreCase:ignoreCase] |
2255
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7531 |
]. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7532 |
]. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7533 |
|
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7534 |
files size == 0 ifTrue:[ |
3528 | 7535 |
Dialog warn:((resources string:'Directory ''%1'' is gone.') |
7536 |
withCRs |
|
7537 |
bindWith:currentDirectory pathName allBold). |
|
2255
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7538 |
^ self |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7539 |
]. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7540 |
(sortByWhat value == #name) ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7541 |
sortCaseless value == true ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7542 |
files sort:[:a :b | a asLowercase < b asLowercase] |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7543 |
] ifFalse:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7544 |
files sort. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7545 |
] |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7546 |
] ifFalse:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7547 |
(sortByWhat value == #time) ifTrue:[ |
3665 | 7548 |
times := Dictionary new. |
7549 |
files do:[:fn | |t f| |
|
7550 |
f := currentDirectory construct:fn. |
|
7551 |
t := f isSymbolicLink |
|
7552 |
ifFalse:[f modificationTime] |
|
7553 |
ifTrue:[f linkInfo modified]. |
|
7554 |
t isNil ifTrue:[t := AbsoluteTime now]. |
|
7555 |
times at:fn put:t. |
|
7556 |
]. |
|
2255
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7557 |
files sort:[:a :b | |f1 f2 t1 t2| |
3665 | 7558 |
t1 := times at:a. |
7559 |
t2 := times at:b. |
|
7560 |
||
7561 |
"/ f1 := (currentDirectory construct:a). |
|
7562 |
"/ f2 := (currentDirectory construct:b). |
|
7563 |
"/ t1 := f1 isSymbolicLink |
|
7564 |
"/ ifFalse:[f1 modificationTime] |
|
7565 |
"/ ifTrue:[f1 linkInfo modified]. |
|
7566 |
"/ t2 := f2 isSymbolicLink |
|
7567 |
"/ ifFalse:[f2 modificationTime] |
|
7568 |
"/ ifTrue:[f2 linkInfo modified]. |
|
7569 |
"/ t1 := t1 ? (AbsoluteTime now). |
|
7570 |
"/ t2 := t2 ? (AbsoluteTime now). |
|
2255
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7571 |
t1 > t2 |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7572 |
] |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7573 |
] ifFalse:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7574 |
(sortByWhat value == #type) ifTrue:[ |
3665 | 7575 |
types := Dictionary new. |
7576 |
files do:[:fn | |t f| |
|
7577 |
f := currentDirectory construct:fn. |
|
7578 |
t := f type ? #xbadLink. |
|
7579 |
types at:fn put:t. |
|
7580 |
]. |
|
2255
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7581 |
files sort:[:a :b | |f1 f2 t1 t2 suff1 suff2| |
3665 | 7582 |
t1 := types at:a. |
7583 |
t2 := types at:b. |
|
7584 |
"/ f1 := (currentDirectory construct:a). |
|
7585 |
"/ f2 := (currentDirectory construct:b). |
|
7586 |
"/ t1 := f1 type ? #xbadLink. |
|
7587 |
"/ t2 := f2 type ? #xbadLink. |
|
2255
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7588 |
t1 = t2 ifTrue:[ |
3665 | 7589 |
f1 := (currentDirectory construct:a). |
7590 |
f2 := (currentDirectory construct:b). |
|
2255
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7591 |
suff1 := f1 suffix. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7592 |
suff2 := f2 suffix. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7593 |
suff1 = suff2 ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7594 |
sortCaseless value == true ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7595 |
a asLowercase < b asLowercase |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7596 |
] ifFalse:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7597 |
a < b |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7598 |
] |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7599 |
] ifFalse:[ |
3665 | 7600 |
suff1 asLowercase = suff2 asLowercase ifTrue:[ |
7601 |
sortCaseless value == true ifTrue:[ |
|
7602 |
a asLowercase < b asLowercase |
|
7603 |
] ifFalse:[ |
|
7604 |
a < b |
|
7605 |
] |
|
7606 |
] ifFalse:[ |
|
7607 |
suff1 asLowercase < suff2 asLowercase |
|
7608 |
] |
|
2255
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7609 |
] |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7610 |
] ifFalse:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7611 |
t1 < t2 |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7612 |
] |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7613 |
] |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7614 |
] |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7615 |
] |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7616 |
]. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7617 |
|
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7618 |
files := self withoutHiddenFiles:files. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7619 |
fileList := files copy. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7620 |
|
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7621 |
tabSpec isNil ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7622 |
showingDetails value "showLongList" ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7623 |
self defineTabulatorsForLongList |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7624 |
] ifFalse:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7625 |
self defineTabulatorsForShortList |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7626 |
]. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7627 |
]. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7628 |
|
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7629 |
"/ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7630 |
"/ first show all the names - this can be done fast ... |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7631 |
"/ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7632 |
list := files collect:[:fileName | |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7633 |
|entry| |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7634 |
|
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7635 |
entry := MultiColListEntry new. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7636 |
entry tabulatorSpecification:tabSpec. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7637 |
entry colAt:1 put:nil. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7638 |
entry colAt:2 put:fileName. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7639 |
]. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7640 |
|
3206 | 7641 |
oldSelection := fileListView selectionValue. |
2255
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7642 |
fileListView setList:list expandTabs:false. |
3206 | 7643 |
newSelection := oldSelection collect:[:nm | list indexOf:nm]. |
7644 |
fileListView selectWithoutScroll:newSelection. |
|
7645 |
||
2255
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7646 |
passDone := Array new:list size withAll:0. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7647 |
|
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7648 |
" |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7649 |
this is a time consuming operation (especially, if reading an |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7650 |
NFS-mounted directory); therefore, start a low prio process, |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7651 |
which fills in the remaining fields in the fileList ... |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7652 |
" |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7653 |
|
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7654 |
listUpdateProcess := [ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7655 |
|prevUid prevGid fileNameString nameString groupString |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7656 |
modeString info line len |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7657 |
anyImages lineIndex aFileName |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7658 |
entry typ f p typeString done endIndex |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7659 |
state stopAtEnd nextState img prevFirstLine prevLastLine |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7660 |
numVisible dirSuffix prevWidth t| |
2255
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7661 |
|
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7662 |
dirSuffix := Filename directorySuffix. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7663 |
dirSuffix size > 0 ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7664 |
dirSuffix := '.' , dirSuffix asLowercase. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7665 |
]. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7666 |
|
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7667 |
"/ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7668 |
"/ then walk over the files, adding more info |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7669 |
"/ (since we have to stat each file, this may take a while longer) |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7670 |
"/ Visible items are always filled first. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7671 |
|
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7672 |
"/ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7673 |
"/ the state machine |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7674 |
"/ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7675 |
nextState := IdentityDictionary new. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7676 |
showingDetails value "showLongList" ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7677 |
nextState add:(#visibleIcons -> #visibleAttributes). |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7678 |
nextState add:(#visibleAttributes -> #visibleTypes). |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7679 |
nextState add:(#visibleTypes -> #visibleImages). |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7680 |
nextState add:(#visibleImages -> #nextPageIcons). |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7681 |
|
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7682 |
nextState add:(#nextPageIcons -> #nextPageAttributes). |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7683 |
nextState add:(#nextPageAttributes -> #nextPageTypes). |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7684 |
nextState add:(#nextPageTypes -> #nextPageImages). |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7685 |
nextState add:(#nextPageImages -> #previousPageIcons). |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7686 |
|
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7687 |
nextState add:(#previousPageIcons -> #previousPageAttributes). |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7688 |
nextState add:(#previousPageAttributes -> #previousPageTypes). |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7689 |
nextState add:(#previousPageTypes -> #previousPageImages). |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7690 |
nextState add:(#previousPageImages -> #remainingIcons). |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7691 |
|
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7692 |
nextState add:(#remainingIcons -> #remainingAttributes). |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7693 |
nextState add:(#remainingAttributes -> #remainingTypes). |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7694 |
nextState add:(#remainingTypes -> #remainingImages). |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7695 |
nextState add:(#remainingImages -> nil). |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7696 |
] ifFalse:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7697 |
nextState add:(#visibleIcons -> #nextPageIcons). |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7698 |
nextState add:(#nextPageIcons -> #previousPageIcons). |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7699 |
nextState add:(#previousPageIcons -> #remainingIcons). |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7700 |
nextState add:(#remainingIcons -> nil). |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7701 |
]. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7702 |
|
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7703 |
anyImages := false. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7704 |
|
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7705 |
lineIndex := prevFirstLine := fileListView firstLineShown. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7706 |
endIndex := prevLastLine := fileListView lastLineShown. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7707 |
endIndex := endIndex min:(files size). |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7708 |
state := #visibleIcons. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7709 |
|
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7710 |
done := false. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7711 |
[done] whileFalse:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7712 |
"/ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7713 |
"/ if multiple FileBrowsers are reading, let others |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7714 |
"/ make some progress too |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7715 |
"/ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7716 |
Processor yield. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7717 |
|
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7718 |
"/ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7719 |
"/ could be destroyed in the meanwhile ... |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7720 |
"/ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7721 |
realized ifFalse:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7722 |
listUpdateProcess := nil. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7723 |
Processor activeProcess terminate |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7724 |
]. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7725 |
|
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7726 |
((prevFirstLine ~~ fileListView firstLineShown) |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7727 |
or:[prevLastLine ~~ fileListView lastLineShown]) ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7728 |
"/ start all over again |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7729 |
lineIndex := prevFirstLine := fileListView firstLineShown. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7730 |
endIndex := prevLastLine := fileListView lastLineShown. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7731 |
endIndex := endIndex min:(files size). |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7732 |
state := #visibleIcons. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7733 |
]. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7734 |
|
2257
02dc5c0000e1
oops - must send size-changeNotification manually
Claus Gittinger <cg@exept.de>
parents:
2256
diff
changeset
|
7735 |
showingDetails value ifTrue:[ |
02dc5c0000e1
oops - must send size-changeNotification manually
Claus Gittinger <cg@exept.de>
parents:
2256
diff
changeset
|
7736 |
prevWidth := fileListView widthOfContents. |
02dc5c0000e1
oops - must send size-changeNotification manually
Claus Gittinger <cg@exept.de>
parents:
2256
diff
changeset
|
7737 |
]. |
02dc5c0000e1
oops - must send size-changeNotification manually
Claus Gittinger <cg@exept.de>
parents:
2256
diff
changeset
|
7738 |
|
2255
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7739 |
(lineIndex between:1 and:(files size)) ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7740 |
|
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7741 |
"/ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7742 |
"/ expand the next entry ... |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7743 |
"/ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7744 |
aFileName := files at:lineIndex. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7745 |
entry := fileListView at:lineIndex. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7746 |
f := currentDirectory construct:aFileName. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7747 |
|
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7748 |
(state endsWith:'Icons') ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7749 |
"/ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7750 |
"/ pass 1 - icons |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7751 |
"/ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7752 |
(passDone at:lineIndex) < 1 ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7753 |
(f isDirectory |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7754 |
and:[(aFileName ~= '..') and:[aFileName ~= '.']] |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7755 |
) ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7756 |
|
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7757 |
"/ the following suffix cutOff is not really required, |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7758 |
"/ but makes the list look better on VMS ... |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7759 |
fileNameString := aFileName. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7760 |
dirSuffix notNil ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7761 |
(aFileName asLowercase endsWith:dirSuffix) ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7762 |
fileNameString := aFileName copyWithoutLast:(dirSuffix size). |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7763 |
] |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7764 |
]. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7765 |
fileNameString := fileNameString , ' ...' |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7766 |
] ifFalse:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7767 |
fileNameString := aFileName. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7768 |
OperatingSystem isVMSlike ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7769 |
(aFileName endsWith:'.') ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7770 |
aFileName ~= '..' ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7771 |
fileNameString := aFileName copyWithoutLast:1 |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7772 |
] |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7773 |
] |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7774 |
] |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7775 |
]. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7776 |
|
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7777 |
showingDetails value "showLongList" ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7778 |
len := fileNameString size. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7779 |
(len > 20) ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7780 |
fileNameString := (fileNameString contractTo:20) |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7781 |
]. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7782 |
]. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7783 |
|
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7784 |
entry colAt:1 put:(self iconForFile:aFileName). |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7785 |
entry colAt:2 put:fileNameString. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7786 |
|
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7787 |
"/fileListView at:lineIndex put:entry. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7788 |
fileListView withoutRedrawAt:lineIndex put:entry. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7789 |
fileListView invalidateLine:lineIndex. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7790 |
|
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7791 |
anyImages ifFalse:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7792 |
(Image isImageFileSuffix:(aFileName asFilename suffix)) |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7793 |
ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7794 |
anyImages := true |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7795 |
] |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7796 |
]. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7797 |
passDone at:lineIndex put:1 |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7798 |
] |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7799 |
]. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7800 |
|
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7801 |
(state endsWith:'Attributes') ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7802 |
"/ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7803 |
"/ pass 2 - everything except fileType (which takes very long) |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7804 |
"/ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7805 |
(passDone at:lineIndex) < 2 ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7806 |
info := f info. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7807 |
info isNil ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7808 |
"not accessable - usually a symlink, |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7809 |
to a nonexisting/nonreadable file |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7810 |
" |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7811 |
f isSymbolicLink ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7812 |
p := f linkInfo path. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7813 |
typeString := 'broken symbolic link to ' , p |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7814 |
] ifFalse:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7815 |
typeString := 'unknown' |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7816 |
]. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7817 |
] ifFalse:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7818 |
typ := (info type). |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7819 |
|
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7820 |
modeString := self getModeString:(info at:#mode) |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7821 |
with:#( '' $r $w $x |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7822 |
' ' $r $w $x |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7823 |
' ' $r $w $x ). |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7824 |
entry colAt:3 put:modeString. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7825 |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7826 |
showingTimeAndDate value ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7827 |
t := f isSymbolicLink |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7828 |
ifFalse:[f modificationTime] |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7829 |
ifTrue:[f linkInfo modified]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7830 |
entry colAt:4 put:t asDate printString. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7831 |
entry colAt:5 put:t asTime printString. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7832 |
] ifFalse:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7833 |
((info uid) ~~ prevUid) ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7834 |
prevUid := (info uid). |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7835 |
nameString := OperatingSystem getUserNameFromID:prevUid. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7836 |
nameString := nameString contractTo:10. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7837 |
nameString := nameString , (String new:(10 - nameString size)) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7838 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7839 |
nameString isNil ifTrue:[nameString := '???']. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7840 |
entry colAt:4 put:nameString withoutSpaces. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7841 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7842 |
((info gid) ~~ prevGid) ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7843 |
prevGid := (info gid). |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7844 |
groupString := OperatingSystem getGroupNameFromID:prevGid. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7845 |
groupString := groupString contractTo:10. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7846 |
groupString := groupString , (String new:(10 - groupString size)) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7847 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7848 |
groupString isNil ifTrue:[groupString := '???']. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7849 |
entry colAt:5 put:groupString withoutSpaces. |
2255
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7850 |
]. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7851 |
|
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7852 |
(typ == #regular) ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7853 |
entry colAt:6 put:(self sizePrintString:(info size)). |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7854 |
]. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7855 |
|
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7856 |
f isSymbolicLink ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7857 |
p := f linkInfo path. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7858 |
typeString := 'symbolic link to ' , p |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7859 |
] ifFalse:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7860 |
typeString := typ asString |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7861 |
]. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7862 |
]. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7863 |
entry colAt:7 put:typeString. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7864 |
|
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7865 |
"/ fileListView at:lineIndex put:entry. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7866 |
fileListView withoutRedrawAt:lineIndex put:entry. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7867 |
fileListView invalidateLine:lineIndex. |
2257
02dc5c0000e1
oops - must send size-changeNotification manually
Claus Gittinger <cg@exept.de>
parents:
2256
diff
changeset
|
7868 |
|
2255
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7869 |
passDone at:lineIndex put:2. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7870 |
]. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7871 |
]. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7872 |
|
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7873 |
(state endsWith:'Types') ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7874 |
"/ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7875 |
"/ pass 3: add fileType |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7876 |
"/ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7877 |
(passDone at:lineIndex) < 3 ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7878 |
info := f info. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7879 |
info notNil ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7880 |
f isSymbolicLink ifFalse:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7881 |
(Image isImageFileSuffix:(f suffix)) ifFalse:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7882 |
typeString := f fileType. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7883 |
|
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7884 |
entry colAt:7 put:typeString. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7885 |
"/ fileListView at:lineIndex put:entry |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7886 |
fileListView withoutRedrawAt:lineIndex put:entry. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7887 |
fileListView invalidateLine:lineIndex. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7888 |
]. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7889 |
]. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7890 |
]. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7891 |
|
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7892 |
passDone at:lineIndex put:3 |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7893 |
]. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7894 |
]. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7895 |
|
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7896 |
(state endsWith:'Images') ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7897 |
"/ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7898 |
"/ pass 4: read images |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7899 |
"/ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7900 |
(passDone at:lineIndex) < 4 ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7901 |
(Image isImageFileSuffix:(f suffix)) ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7902 |
f isDirectory ifFalse:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7903 |
img := Image fromFile:(f pathName). |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7904 |
img notNil ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7905 |
showingBigImagePreview value == true ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7906 |
img := img magnifiedTo:32@32. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7907 |
] ifFalse:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7908 |
img := img magnifiedTo:16@16. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7909 |
]. |
2339 | 7910 |
img := img onDevice:self device. |
2255
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7911 |
entry colAt:7 put:img. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7912 |
"/ fileListView at:lineIndex put:entry |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7913 |
fileListView withoutRedrawAt:lineIndex put:entry. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7914 |
fileListView invalidateLine:lineIndex. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7915 |
] |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7916 |
] |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7917 |
]. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7918 |
passDone at:lineIndex put:4 |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7919 |
]. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7920 |
]. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7921 |
]. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7922 |
|
2257
02dc5c0000e1
oops - must send size-changeNotification manually
Claus Gittinger <cg@exept.de>
parents:
2256
diff
changeset
|
7923 |
showingDetails value ifTrue:[ |
02dc5c0000e1
oops - must send size-changeNotification manually
Claus Gittinger <cg@exept.de>
parents:
2256
diff
changeset
|
7924 |
fileListView widthOfContents ~~ prevWidth ifTrue:[ |
02dc5c0000e1
oops - must send size-changeNotification manually
Claus Gittinger <cg@exept.de>
parents:
2256
diff
changeset
|
7925 |
fileListView contentsChanged. |
02dc5c0000e1
oops - must send size-changeNotification manually
Claus Gittinger <cg@exept.de>
parents:
2256
diff
changeset
|
7926 |
] |
02dc5c0000e1
oops - must send size-changeNotification manually
Claus Gittinger <cg@exept.de>
parents:
2256
diff
changeset
|
7927 |
]. |
02dc5c0000e1
oops - must send size-changeNotification manually
Claus Gittinger <cg@exept.de>
parents:
2256
diff
changeset
|
7928 |
|
2255
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7929 |
"/ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7930 |
"/ advance to the next line |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7931 |
"/ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7932 |
lineIndex := lineIndex + 1. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7933 |
lineIndex > endIndex ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7934 |
"/ finished this round ... |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7935 |
"/ see what we are going for ... |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7936 |
numVisible := (fileListView lastLineShown - fileListView firstLineShown + 1). |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7937 |
|
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7938 |
state := nextState at:state ifAbsent:nil. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7939 |
|
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7940 |
state isNil ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7941 |
done := true |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7942 |
] ifFalse:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7943 |
(state startsWith:'visible') ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7944 |
lineIndex := fileListView firstLineShown. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7945 |
endIndex := fileListView lastLineShown. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7946 |
endIndex := endIndex min:(files size). |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7947 |
] ifFalse:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7948 |
(state startsWith:'nextPage') ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7949 |
lineIndex := fileListView lastLineShown + 1. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7950 |
endIndex := lineIndex + numVisible. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7951 |
endIndex := endIndex min:(files size). |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7952 |
lineIndex := lineIndex min:(files size). |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7953 |
] ifFalse:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7954 |
(state startsWith:'previousPage') ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7955 |
endIndex := fileListView firstLineShown - 1. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7956 |
lineIndex := endIndex - numVisible. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7957 |
lineIndex := lineIndex max:1. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7958 |
endIndex := endIndex min:(files size). |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7959 |
endIndex := endIndex max:1. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7960 |
] ifFalse:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7961 |
"/ remaining |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7962 |
lineIndex := 1. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7963 |
endIndex := files size. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7964 |
] |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7965 |
] |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7966 |
] |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7967 |
] |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7968 |
] |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7969 |
]. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7970 |
|
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7971 |
listUpdateProcess := nil. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7972 |
|
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7973 |
] forkAt:(Processor activePriority - 1). |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7974 |
|
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7975 |
" |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7976 |
install a new check after some time |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7977 |
" |
3520
83cf11e1bf32
schedule checkBlock for the right process
Claus Gittinger <cg@exept.de>
parents:
3503
diff
changeset
|
7978 |
self scheduleCheckBlock. |
36 | 7979 |
] |
142 | 7980 |
|
1487
c8d32d8b039c
oops - dont sort a nil object
Claus Gittinger <cg@exept.de>
parents:
1481
diff
changeset
|
7981 |
"Modified: / 21.9.1995 / 11:40:23 / claus" |
c8d32d8b039c
oops - dont sort a nil object
Claus Gittinger <cg@exept.de>
parents:
1481
diff
changeset
|
7982 |
"Modified: / 28.4.1997 / 22:30:30 / dq" |
c8d32d8b039c
oops - dont sort a nil object
Claus Gittinger <cg@exept.de>
parents:
1481
diff
changeset
|
7983 |
"Modified: / 18.9.1997 / 18:28:30 / stefan" |
3419 | 7984 |
"Modified: / 15.11.2001 / 23:49:03 / cg" |
386
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
7985 |
! ! |
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
7986 |
|
172 | 7987 |
!FileBrowser methodsFor:'queries'! |
73 | 7988 |
|
1700
5067b3c4cafa
added access to fileName (kludge to fileIn RefactoryBrowser)
Claus Gittinger <cg@exept.de>
parents:
1689
diff
changeset
|
7989 |
fileName |
1702
962056a31c06
remember the current file during fileIn,
Claus Gittinger <cg@exept.de>
parents:
1700
diff
changeset
|
7990 |
"return my current fileName - during fileIn, the file |
962056a31c06
remember the current file during fileIn,
Claus Gittinger <cg@exept.de>
parents:
1700
diff
changeset
|
7991 |
which is being loaded is returned. |
962056a31c06
remember the current file during fileIn,
Claus Gittinger <cg@exept.de>
parents:
1700
diff
changeset
|
7992 |
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
|
7993 |
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
|
7994 |
|
962056a31c06
remember the current file during fileIn,
Claus Gittinger <cg@exept.de>
parents:
1700
diff
changeset
|
7995 |
|f| |
962056a31c06
remember the current file during fileIn,
Claus Gittinger <cg@exept.de>
parents:
1700
diff
changeset
|
7996 |
|
962056a31c06
remember the current file during fileIn,
Claus Gittinger <cg@exept.de>
parents:
1700
diff
changeset
|
7997 |
f := currentFileInFileName ? currentFileName. |
962056a31c06
remember the current file during fileIn,
Claus Gittinger <cg@exept.de>
parents:
1700
diff
changeset
|
7998 |
f isNil ifTrue:[^ nil]. |
962056a31c06
remember the current file during fileIn,
Claus Gittinger <cg@exept.de>
parents:
1700
diff
changeset
|
7999 |
^ self path asFilename construct:f |
1700
5067b3c4cafa
added access to fileName (kludge to fileIn RefactoryBrowser)
Claus Gittinger <cg@exept.de>
parents:
1689
diff
changeset
|
8000 |
|
5067b3c4cafa
added access to fileName (kludge to fileIn RefactoryBrowser)
Claus Gittinger <cg@exept.de>
parents:
1689
diff
changeset
|
8001 |
" |
5067b3c4cafa
added access to fileName (kludge to fileIn RefactoryBrowser)
Claus Gittinger <cg@exept.de>
parents:
1689
diff
changeset
|
8002 |
(FileBrowser openOnFileNamed:'Makefile') fileName |
5067b3c4cafa
added access to fileName (kludge to fileIn RefactoryBrowser)
Claus Gittinger <cg@exept.de>
parents:
1689
diff
changeset
|
8003 |
" |
5067b3c4cafa
added access to fileName (kludge to fileIn RefactoryBrowser)
Claus Gittinger <cg@exept.de>
parents:
1689
diff
changeset
|
8004 |
|
1702
962056a31c06
remember the current file during fileIn,
Claus Gittinger <cg@exept.de>
parents:
1700
diff
changeset
|
8005 |
"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
|
8006 |
! |
5067b3c4cafa
added access to fileName (kludge to fileIn RefactoryBrowser)
Claus Gittinger <cg@exept.de>
parents:
1689
diff
changeset
|
8007 |
|
172 | 8008 |
path |
8009 |
"return my currentDirectories pathName; |
|
1329 | 8010 |
sent from the pathField to aquire the pathname when I changed directory" |
8011 |
||
8012 |
"/ somewhat tricky: first ask it for the full pathName, |
|
8013 |
"/ then convert it to a directory name |
|
8014 |
"/ (which only makes a difference on VMS) |
|
8015 |
||
3747
d30bc1e54f15
Remove unused vars and asFilename sends
Stefan Vogel <sv@exept.de>
parents:
3746
diff
changeset
|
8016 |
^ currentDirectory pathName "/ asFilename osNameForDirectory |
1828 | 8017 |
|
8018 |
"Modified: / 12.8.1998 / 14:45:48 / cg" |
|
49 | 8019 |
! ! |
8020 |
||
763
94a8d188b52d
care for the nameSpace Query when loading binary classes
Claus Gittinger <cg@exept.de>
parents:
749
diff
changeset
|
8021 |
!FileBrowser class methodsFor:'documentation'! |
203 | 8022 |
|
8023 |
version |
|
3860 | 8024 |
^ '$Header: /cvs/stx/stx/libtool/FileBrowser.st,v 1.490 2002-09-10 14:02:13 penk Exp $' |
381 | 8025 |
! ! |