author | penk |
Wed, 11 Sep 2002 14:55:33 +0200 | |
changeset 3861 | 8d5fcf90ae5f |
parent 3860 | 8c491484ea20 |
child 3862 | eee340e1a930 |
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 |
|
3861 | 21 |
icons matchedIcons listUpdateProcess currentFileInFileName |
3454 | 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 |
|
3861 | 28 |
MatchedIcons DefaultCommandPerSuffix DefaultCommandPerMIME |
29 |
VisitedFileHistory 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 |
3861 | 157 |
self halt. |
2676 | 158 |
Icons isNil ifTrue:[ |
159 |
self initializeIcons |
|
160 |
]. |
|
161 |
^ Icons |
|
162 |
! |
|
163 |
||
2346 | 164 |
initializeDefaultCommands |
165 |
DefaultCommandPerMIME := Dictionary new. |
|
166 |
||
167 |
DefaultCommandPerMIME at:'application/x-tar-compressed' put:'gunzip < %1 | tar tvf -'. |
|
3654 | 168 |
DefaultCommandPerMIME at:'application/pdf' put:'acroread -display %2 %1'. |
2346 | 169 |
|
170 |
" |
|
171 |
self initializeDefaultCommands |
|
172 |
" |
|
173 |
||
174 |
"Modified: / 1.8.1998 / 17:39:27 / cg" |
|
175 |
! |
|
176 |
||
3860 | 177 |
initializeFileTypeIcons |
1239
e58e2cb6639a
allow specification of icons from resource file.
Claus Gittinger <cg@exept.de>
parents:
1235
diff
changeset
|
178 |
|resources| |
e58e2cb6639a
allow specification of icons from resource file.
Claus Gittinger <cg@exept.de>
parents:
1235
diff
changeset
|
179 |
|
e58e2cb6639a
allow specification of icons from resource file.
Claus Gittinger <cg@exept.de>
parents:
1235
diff
changeset
|
180 |
resources := self classResources. |
e58e2cb6639a
allow specification of icons from resource file.
Claus Gittinger <cg@exept.de>
parents:
1235
diff
changeset
|
181 |
|
1147 | 182 |
#( |
2187
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
183 |
"/ internal-type to icon mappings. |
3860 | 184 |
(#directory 'ICON_DIRECTORY' 'tiny_yellow_dir.xpm' ) |
3861 | 185 |
(#directoryOpen 'ICON_DIRECTORY_OPEN' 'tiny_yellow_dir_open.xpm' ) |
3860 | 186 |
(#directoryLocked 'ICON_DIRECTORY_LOCKED' 'tiny_yellow_dir_locked.xpm' ) |
187 |
(#directoryLink 'ICON_DIRECTORY_LINK' 'tiny_yellow_dir_link.xpm' ) |
|
188 |
(#file 'ICON_FILE' 'tiny_file_plain.xpm' ) |
|
189 |
(#fileLink 'ICON_FILE_LINK' 'tiny_file_link.xpm' ) |
|
190 |
(#fileLocked 'ICON_FILE_LOCKED' 'tiny_file_lock.xpm' ) |
|
191 |
(#imageFile 'ICON_IMAGE_FILE' 'tiny_file_pix.xpm' ) |
|
192 |
(#textFile 'ICON_TEXT_FILE' 'tiny_file_text.xpm' ) |
|
193 |
(#executableFile 'ICON_EXECUTABLEFILE' 'tiny_file_exec.xpm' ) |
|
194 |
(#deviceFile 'ICON_DEVICE_FILE' 'tiny_file_device.xpm' ) |
|
195 |
(#binaryFile 'ICON_BINARY_FILE' 'tiny_file_binary.xpm' ) |
|
196 |
(#compressedFile 'ICON_COMPRESSED_FILE' 'tiny_file_compressed.xpm' ) |
|
197 |
(#compressedArchive 'ICON_COMPRESSED_ARCHIVE' 'tiny_file_tar_compressed.xpm' ) |
|
198 |
(#archive 'ICON_ARCHIVE' 'tiny_file_tar.xpm' ) |
|
199 |
(#specialFile 'ICON_SPECIALFILE' 'tiny_file_special.xpm' ) |
|
200 |
||
3861 | 201 |
(#addOnLocked 'ICON_ADDON_LOCKED' 'tiny_addOn_lock.xpm' ) |
202 |
(#addOnLinked 'ICON_ADDON_LINKED' 'tiny_addOn_link.xpm' ) |
|
203 |
||
3860 | 204 |
(#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
|
205 |
) do:[:entry | |
2491
0222b19ee371
new icon search (search under goodies package)
Claus Gittinger <cg@exept.de>
parents:
2476
diff
changeset
|
206 |
|key resource defaultName nm img| |
2187
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
207 |
|
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
208 |
key := entry at:1. |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
209 |
resource := entry at:2. |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
210 |
defaultName := entry at:3. |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
211 |
|
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
212 |
resource notNil ifTrue:[ |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
213 |
nm := resources at:resource default:nil. |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
214 |
]. |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
215 |
nm isNil ifTrue:[ |
2491
0222b19ee371
new icon search (search under goodies package)
Claus Gittinger <cg@exept.de>
parents:
2476
diff
changeset
|
216 |
nm := 'xpmBitmaps/document_images/' , defaultName |
2187
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
217 |
]. |
2492
055eef2763e3
moved icon search to smalltalk utility method
Claus Gittinger <cg@exept.de>
parents:
2491
diff
changeset
|
218 |
Icons at:key put:(Smalltalk imageFromFileNamed:nm forClass:self). |
1147 | 219 |
] |
220 |
||
221 |
" |
|
3860 | 222 |
self initializeFileTypeIcons |
223 |
" |
|
224 |
! |
|
225 |
||
226 |
initializeIcons |
|
227 |
Icons := Dictionary new. |
|
3861 | 228 |
MatchedIcons := OrderedCollection new. |
3860 | 229 |
self initializeFileTypeIcons. |
230 |
self initializeMimeTypeIcons. |
|
231 |
||
232 |
" |
|
1178
f5f4d0c605db
lazy initialization of Icons
Claus Gittinger <cg@exept.de>
parents:
1173
diff
changeset
|
233 |
self initializeIcons |
1147 | 234 |
" |
235 |
||
1784
329e3a904236
ask MIMETypes when mapping suffixes to icons.
Claus Gittinger <cg@exept.de>
parents:
1758
diff
changeset
|
236 |
"Modified: / 1.8.1998 / 17:39:27 / cg" |
3860 | 237 |
! |
238 |
||
239 |
initializeMimeTypeIcons |
|
240 |
#( |
|
241 |
"/ mime-type to icon mappings. |
|
3861 | 242 |
"/ 'image/jpeg' 'tiny_file_pix.xpm' |
243 |
"/ 'image/gif' 'tiny_file_pix.xpm' |
|
244 |
"/ 'image/tiff' 'tiny_file_pix.xpm' |
|
245 |
"/ 'image/x-xbitmap' 'tiny_file_pix.xpm' |
|
246 |
"/ 'image/x-xpixmap' 'tiny_file_pix.xpm' |
|
247 |
"/ 'image/x-png' 'tiny_file_pix.xpm' |
|
248 |
"/ 'image/x-photo-cd' 'tiny_file_pix.xpm' |
|
249 |
"/ 'image/x-MS-bmp' 'tiny_file_pix.xpm' |
|
250 |
"/ 'image/x-rgb' 'tiny_file_pix.xpm' |
|
251 |
"/ 'image/x-portable-pixmap' 'tiny_file_pix.xpm' |
|
252 |
"/ 'image/x-portable-graymap' 'tiny_file_pix.xpm' |
|
253 |
"/ 'image/x-portable-bitmap' 'tiny_file_pix.xpm' |
|
254 |
"/ 'image/x-portable-anymap' 'tiny_file_pix.xpm' |
|
255 |
"/ 'image/x-xwindowdump' 'tiny_file_pix.xpm' |
|
256 |
"/ 'image/x-cmu-raster' 'tiny_file_pix.xpm' |
|
257 |
"/ 'image/x-targa' 'tiny_file_pix.xpm' |
|
258 |
'image/*' 'tiny_file_pix.xpm' |
|
3860 | 259 |
|
260 |
"/ misc text ... |
|
261 |
||
3861 | 262 |
"/ 'text/html' 'tiny_file_text.xpm' |
263 |
"/ 'text/plain' 'tiny_file_text.xpm' |
|
264 |
'text/*' 'tiny_file_text.xpm' |
|
3860 | 265 |
|
266 |
'application/postscript' 'tiny_file_postscript.xpm' |
|
267 |
'application/pdf' 'tiny_file_pdf.xpm' |
|
3861 | 268 |
'application/rtf' 'tiny_file_rtf.xpm' |
3860 | 269 |
|
270 |
"/ video formats ... |
|
271 |
||
3861 | 272 |
"/ 'video/x-sgi-movie' 'tiny_file_movie.xpm' |
273 |
"/ 'video/x-msvideo' 'tiny_file_movie.xpm' |
|
274 |
"/ 'video/quicktime' 'tiny_file_movie.xpm' |
|
275 |
"/ 'video/x-mpeg2' 'tiny_file_movie.xpm' |
|
276 |
"/ 'video/mpeg' 'tiny_file_movie.xpm' |
|
277 |
'video/*' 'tiny_file_movie.xpm' |
|
3860 | 278 |
|
279 |
"/ audio formats ... |
|
280 |
||
3861 | 281 |
"/ 'audio/x-pn-realaudio' 'tiny_file_sound.xpm' |
282 |
"/ 'audio/x-mpeg' 'tiny_file_sound.xpm' |
|
283 |
"/ 'audio/x-mp3' 'tiny_file_sound.xpm' |
|
284 |
"/ 'audio/x-wav' 'tiny_file_sound.xpm' |
|
285 |
"/ 'audio/x-aiff' 'tiny_file_sound.xpm' |
|
286 |
"/ 'audio/basic' 'tiny_file_sound.xpm' |
|
287 |
"/ 'audio/x-shockwave-flash' 'tiny_file_sound.xpm' |
|
288 |
'audio/*' 'tiny_file_sound.xpm' |
|
3860 | 289 |
|
290 |
"/ misc stuff |
|
291 |
'application/winword' 'tiny_file_text.xpm' |
|
292 |
||
293 |
"/ progr. languages |
|
294 |
'application/x-smalltalk-source' 'tiny_file_st.xpm' |
|
295 |
'application/x-smalltalk-source-sif' 'tiny_file_text.xpm' |
|
296 |
'application/x-c-source' 'tiny_file_text.xpm' |
|
297 |
'application/x-cpp-source' 'tiny_file_text.xpm' |
|
298 |
'application/x-javascript' 'tiny_file_text.xpm' |
|
299 |
'application/x-java-source' 'tiny_file_java.xpm' |
|
3861 | 300 |
|
3860 | 301 |
'application/x-sh' 'tiny_file_text.xpm' |
302 |
'application/x-csh' 'tiny_file_text.xpm' |
|
303 |
'application/x-tcl' 'tiny_file_text.xpm' |
|
304 |
'application/x-perl' 'tiny_file_text.xpm' |
|
305 |
'application/x-make' 'tiny_file_text.xpm' |
|
306 |
'application/x-batch-script' 'tiny_file_text.xpm' |
|
307 |
'application/x-asn1-source' 'tiny_file_text.xpm' |
|
308 |
||
309 |
"/ compressors / archivers |
|
310 |
'application/x-tar' 'tiny_file_archive.xpm' |
|
311 |
'application/x-gtar' 'tiny_file_archive.xpm' |
|
312 |
'application/x-tar-compressed' 'tiny_file_compressed_archive.xpm' |
|
313 |
'application/x-zip-compressed' 'tiny_file_compressed_archive.xpm' |
|
314 |
'application/x-gzip-compressed' 'tiny_file_compressed_archive.xpm' |
|
315 |
'application/x-cpio' 'tiny_file_archive.xpm' |
|
316 |
'application/x-shar' 'tiny_file_archive.xpm' |
|
317 |
'application/java-archive' 'tiny_file_archive.xpm' |
|
3861 | 318 |
|
319 |
'*' 'tiny_file_plain.xpm' |
|
320 |
) pairWiseDo:[:mimeTypePattern :fileName | |
|
3860 | 321 |
| nm | |
322 |
||
323 |
nm := 'xpmBitmaps/document_images/' , fileName. |
|
3861 | 324 |
mimeTypePattern includesMatchCharacters ifTrue:[ |
325 |
MatchedIcons add:(mimeTypePattern-> (Smalltalk imageFromFileNamed:nm forClass:self)). |
|
326 |
] ifFalse:[ |
|
327 |
Icons at:mimeTypePattern put:(Smalltalk imageFromFileNamed:nm forClass:self). |
|
328 |
] |
|
3860 | 329 |
] |
330 |
||
331 |
" |
|
332 |
self initializeMimeTypeIcons |
|
333 |
" |
|
1145
0464625bbdbb
read directory in a subprocess.
Claus Gittinger <cg@exept.de>
parents:
1144
diff
changeset
|
334 |
! ! |
0464625bbdbb
read directory in a subprocess.
Claus Gittinger <cg@exept.de>
parents:
1144
diff
changeset
|
335 |
|
763
94a8d188b52d
care for the nameSpace Query when loading binary classes
Claus Gittinger <cg@exept.de>
parents:
749
diff
changeset
|
336 |
!FileBrowser class methodsFor:'defaults'! |
73 | 337 |
|
338 |
defaultIcon |
|
1147 | 339 |
"return the file browsers default window icon" |
340 |
||
1287 | 341 |
<resource: #style (#FILEBROWSER_ICON #FILEBROWSER_ICON_FILE)> |
342 |
||
343 |
|nm i res| |
|
1147 | 344 |
|
345 |
(i := DefaultIcon) isNil ifTrue:[ |
|
2339 | 346 |
res := self classResources. |
347 |
i := res at:'FILEBROWSER_ICON' default:nil. |
|
348 |
i isNil ifTrue:[ |
|
349 |
nm := res at:'FILEBROWSER_ICON_FILE' default:'FBrowser.xbm'. |
|
2476 | 350 |
i := Smalltalk imageFromFileNamed:nm forClass:self. |
2339 | 351 |
i isNil ifTrue:[ |
2453
63c50508c4cd
try my bitmaps in package directory
Claus Gittinger <cg@exept.de>
parents:
2447
diff
changeset
|
352 |
i := StandardSystemView defaultIcon |
2339 | 353 |
] |
354 |
]. |
|
355 |
i notNil ifTrue:[ |
|
356 |
DefaultIcon := i := i onDevice:Display |
|
357 |
] |
|
1145
0464625bbdbb
read directory in a subprocess.
Claus Gittinger <cg@exept.de>
parents:
1144
diff
changeset
|
358 |
]. |
0464625bbdbb
read directory in a subprocess.
Claus Gittinger <cg@exept.de>
parents:
1144
diff
changeset
|
359 |
^ i |
0464625bbdbb
read directory in a subprocess.
Claus Gittinger <cg@exept.de>
parents:
1144
diff
changeset
|
360 |
|
1147 | 361 |
"Modified: 19.3.1997 / 20:48:34 / ca" |
1287 | 362 |
"Modified: 15.8.1997 / 15:27:19 / cg" |
73 | 363 |
! ! |
364 |
||
2951
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
365 |
!FileBrowser class methodsFor:'history'! |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
366 |
|
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
367 |
addToCommandHistory:aCommandString for:aFilename |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
368 |
|cmd suffix| |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
369 |
|
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
370 |
(aCommandString notNil and:[aCommandString notEmpty]) ifTrue:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
371 |
CommandHistory notNil ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
372 |
CommandHistory addFirst:aCommandString. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
373 |
CommandHistory size > CommandHistorySize ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
374 |
CommandHistory removeLast |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
375 |
] |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
376 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
377 |
aFilename notNil ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
378 |
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
|
379 |
DefaultCommandPerSuffix isNil ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
380 |
DefaultCommandPerSuffix := Dictionary new. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
381 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
382 |
suffix := aFilename asFilename suffix. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
383 |
suffix notNil ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
384 |
DefaultCommandPerSuffix at:suffix put:cmd. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
385 |
] |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
386 |
] |
2951
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
387 |
] |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
388 |
|
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
389 |
"Created: 14.11.1996 / 14:58:13 / cg" |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
390 |
! |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
391 |
|
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
392 |
addToHistory:path |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
393 |
|pos idx| |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
394 |
|
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
395 |
idx := DirectoryHistory indexOf:path. |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
396 |
idx == 0 ifTrue:[ |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
397 |
DirectoryHistory size >= HistorySize ifTrue:[ |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
398 |
DirectoryHistory removeLast. |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
399 |
DirectoryHistoryWhere removeLast |
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 |
] ifFalse:[ |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
402 |
"already been there before; move the entry to |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
403 |
the beginning, so it will fall out later." |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
404 |
|
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
405 |
DirectoryHistory removeIndex:idx. |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
406 |
pos := DirectoryHistoryWhere at:idx. |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
407 |
DirectoryHistoryWhere removeIndex:idx. |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
408 |
]. |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
409 |
DirectoryHistory addFirst:path. |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
410 |
DirectoryHistoryWhere addFirst:pos. |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
411 |
|
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
412 |
"Created: / 8.11.1997 / 17:16:29 / cg" |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
413 |
! |
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 |
addToVisitedFileHistory:path |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
416 |
|idx| |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
417 |
|
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
418 |
idx := VisitedFileHistory indexOf:path. |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
419 |
idx == 0 ifTrue:[ |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
420 |
VisitedFileHistory size >= HistorySize ifTrue:[ |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
421 |
VisitedFileHistory removeLast. |
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 |
] ifFalse:[ |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
424 |
"already been there before; move the entry to |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
425 |
the beginning, so it will fall out later." |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
426 |
|
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
427 |
VisitedFileHistory removeIndex:idx. |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
428 |
]. |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
429 |
VisitedFileHistory addFirst:path. |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
430 |
! ! |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
431 |
|
1933 | 432 |
!FileBrowser class methodsFor:'interface specs'! |
433 |
||
434 |
fileSearchDialogSpec |
|
435 |
"This resource specification was automatically generated |
|
436 |
by the UIPainter of ST/X." |
|
437 |
||
438 |
"Do not manually edit this!! If it is corrupted, |
|
439 |
the UIPainter may not be able to read the specification." |
|
440 |
||
441 |
" |
|
442 |
UIPainter new openOnClass:FileBrowser andSelector:#fileSearchDialogSpec |
|
443 |
" |
|
444 |
||
445 |
<resource: #canvas> |
|
446 |
||
447 |
^ |
|
448 |
||
449 |
#(#FullSpec |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
450 |
#window: |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
451 |
#(#WindowSpec |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
452 |
#name: 'File Search' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
453 |
#layout: #(#LayoutFrame 4 0 50 0 315 0 349 0) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
454 |
#level: 0 |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
455 |
#label: 'File Search' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
456 |
#min: #(#Point 10 10) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
457 |
#max: #(#Point 1280 1024) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
458 |
#bounds: #(#Rectangle 4 50 316 350) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
459 |
#usePreferredExtent: false |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
460 |
#returnIsOKInDialog: true |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
461 |
#escapeIsCancelInDialog: true |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
462 |
) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
463 |
#component: |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
464 |
#(#SpecCollection |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
465 |
#collection: |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
466 |
#( |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
467 |
#(#LabelSpec |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
468 |
#name: 'Label1' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
469 |
#layout: #(#LayoutFrame 0 0 10 0 0 1 32 0) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
470 |
#label: 'Search for files named:' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
471 |
#translateLabel: true |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
472 |
#adjust: #left |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
473 |
) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
474 |
#(#InputFieldSpec |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
475 |
#name: 'EntryField1' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
476 |
#layout: #(#LayoutFrame 10 0 36 0 305 0 58 0) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
477 |
#tabable: true |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
478 |
#model: #namePatternHolder |
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 |
#(#CheckBoxSpec |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
481 |
#name: 'CheckBox1' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
482 |
#layout: #(#LayoutFrame 7 0 66 0 143 0 88 0) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
483 |
#tabable: true |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
484 |
#model: #ignoreCaseInName |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
485 |
#label: 'Ignore case' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
486 |
#translateLabel: true |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
487 |
) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
488 |
#(#LabelSpec |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
489 |
#name: 'Label2' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
490 |
#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
|
491 |
#label: 'Containing the string:' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
492 |
#translateLabel: true |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
493 |
#adjust: #left |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
494 |
) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
495 |
#(#InputFieldSpec |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
496 |
#name: 'EntryField2' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
497 |
#layout: #(#LayoutFrame 10 0 133 0 305 0 155 0) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
498 |
#enableChannel: #notSearchForSameContents |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
499 |
#tabable: true |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
500 |
#model: #contentsPatternHolder |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
501 |
) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
502 |
#(#CheckBoxSpec |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
503 |
#name: 'CheckBox2' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
504 |
#layout: #(#LayoutFrame 6 0 163 0 142 0 185 0) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
505 |
#enableChannel: #notSearchForSameContents |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
506 |
#tabable: true |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
507 |
#model: #ignoreCaseInContents |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
508 |
#label: 'Ignore case' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
509 |
#translateLabel: true |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
510 |
) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
511 |
#(#LabelSpec |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
512 |
#name: 'Label3' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
513 |
#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
|
514 |
#label: 'Containing same contents as selected:' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
515 |
#translateLabel: true |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
516 |
#adjust: #left |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
517 |
) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
518 |
#(#DividerSpec |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
519 |
#name: 'Separator1' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
520 |
#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
|
521 |
) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
522 |
#(#CheckToggleSpec |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
523 |
#name: 'CheckToggle1' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
524 |
#layout: #(#LayoutOrigin -25 1 225 0) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
525 |
#tabable: true |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
526 |
#model: #searchForSameContents |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
527 |
#enableChannel: #searchForSameContentsEnabled |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
528 |
#isTriggerOnDown: true |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
529 |
#showLamp: false |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
530 |
#lampColor: #(#Color 100.0 100.0 0.0) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
531 |
) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
532 |
#(#HorizontalPanelViewSpec |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
533 |
#name: 'HorizontalPanel1' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
534 |
#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
|
535 |
#component: |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
536 |
#(#SpecCollection |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
537 |
#collection: |
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: 'Button1' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
541 |
#label: 'Cancel' |
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: #cancel |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
545 |
#extent: #(#Point 151 25) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
546 |
) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
547 |
#(#ActionButtonSpec |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
548 |
#name: 'Button2' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
549 |
#label: 'Search' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
550 |
#translateLabel: true |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
551 |
#tabable: true |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
552 |
#model: #accept |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
553 |
#isDefault: true |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
554 |
#extent: #(#Point 152 25) |
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 |
) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
557 |
) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
558 |
#horizontalLayout: #fitSpace |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
559 |
#verticalLayout: #centerMax |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
560 |
#horizontalSpace: 3 |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
561 |
#verticalSpace: 3 |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
562 |
) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
563 |
) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
564 |
) |
1933 | 565 |
) |
566 |
! ! |
|
567 |
||
1834 | 568 |
!FileBrowser class methodsFor:'menu specs'! |
569 |
||
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
570 |
baseBookmarksMenuSpec |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
571 |
"This resource specification was automatically generated |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
572 |
by the MenuEditor of ST/X." |
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 |
"Do not manually edit this!! If it is corrupted, |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
575 |
the MenuEditor may not be able to read the specification." |
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 |
MenuEditor new openOnClass:FileBrowser andSelector:#baseBookmarksMenuSpec |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
579 |
(Menu new fromLiteralArrayEncoding:(FileBrowser baseBookmarksMenuSpec)) startUp |
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 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
582 |
<resource: #menu> |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
583 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
584 |
^ |
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 |
#(#Menu |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
587 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
588 |
#( |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
589 |
#(#MenuItem |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
590 |
#label: 'Add Bookmark' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
591 |
#translateLabel: true |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
592 |
#value: #addBookmark |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
593 |
) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
594 |
#(#MenuItem |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
595 |
#label: 'Remove Bookmark' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
596 |
#translateLabel: true |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
597 |
#value: #removeBookmark |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
598 |
#enabled: #hasBookmarksToRemove |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
599 |
) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
600 |
) nil |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
601 |
nil |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
602 |
) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
603 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
604 |
"Created: / 4.8.1998 / 17:21:16 / cg" |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
605 |
"Modified: / 14.8.1998 / 19:19:06 / cg" |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
606 |
! |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
607 |
|
1834 | 608 |
baseDirectoryMenuSpec |
609 |
"This resource specification was automatically generated |
|
610 |
by the MenuEditor of ST/X." |
|
611 |
||
612 |
"Do not manually edit this!! If it is corrupted, |
|
613 |
the MenuEditor may not be able to read the specification." |
|
614 |
||
615 |
" |
|
616 |
MenuEditor new openOnClass:FileBrowser andSelector:#directoryMenuSpec |
|
617 |
(Menu new fromLiteralArrayEncoding:(FileBrowser directoryMenuSpec)) startUp |
|
618 |
" |
|
619 |
||
620 |
<resource: #menu> |
|
621 |
||
622 |
^ |
|
623 |
||
624 |
#(#Menu |
|
625 |
||
3448
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: 'Copy Path' |
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: #copyPath |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
631 |
) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
632 |
#(#MenuItem |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
633 |
#label: '-' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
634 |
) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
635 |
#(#MenuItem |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
636 |
#label: 'Up' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
637 |
#translateLabel: true |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
638 |
#value: #changeToParentDirectory |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
639 |
#enabled: #currentDirectoryIsNotTop |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
640 |
) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
641 |
#(#MenuItem |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
642 |
#label: 'Back' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
643 |
#translateLabel: true |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
644 |
#value: #changeToPreviousDirectory |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
645 |
) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
646 |
#(#MenuItem |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
647 |
#label: 'Home' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
648 |
#translateLabel: true |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
649 |
#value: #changeToHomeDirectory |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
650 |
) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
651 |
#(#MenuItem |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
652 |
#label: 'Default' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
653 |
#translateLabel: true |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
654 |
#value: #changeToDefaultDirectory |
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: 'Goto...' |
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 |
#value: #changeCurrentDirectory |
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 |
#(#MenuItem |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
662 |
#label: '-' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
663 |
) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
664 |
#(#MenuItem |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
665 |
#label: 'Bookmarks' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
666 |
#translateLabel: true |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
667 |
#submenuChannel: #bookmarksMenuSpec |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
668 |
) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
669 |
) nil |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
670 |
nil |
1834 | 671 |
) |
672 |
||
673 |
"Created: / 4.8.1998 / 17:21:16 / cg" |
|
1835 | 674 |
"Modified: / 14.8.1998 / 19:19:06 / cg" |
1834 | 675 |
! |
676 |
||
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
677 |
bookmarksMenuSpec |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
678 |
"This resource specification was automatically generated |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
679 |
by the MenuEditor of ST/X." |
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 |
"Do not manually edit this!! If it is corrupted, |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
682 |
the MenuEditor may not be able to read the specification." |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
683 |
|
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 |
MenuEditor new openOnClass:FileBrowser andSelector:#bookmarksMenuSpec |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
686 |
(Menu new fromLiteralArrayEncoding:(FileBrowser bookmarksMenuSpec)) startUp |
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 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
689 |
<resource: #programMenu> |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
690 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
691 |
|m| |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
692 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
693 |
m := self baseBookmarksMenuSpec. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
694 |
m := m decodeAsLiteralArray. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
695 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
696 |
"/ add the history items ... |
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 |
DirectoryBookmarks size > 0 ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
699 |
m addItem:(MenuItem labeled:'-'). |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
700 |
DirectoryBookmarks do:[:dirName | |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
701 |
m addItem:((MenuItem label:dirName value:#changeDirectoryTo:) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
702 |
argument:dirName; |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
703 |
yourself). |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
704 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
705 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
706 |
^ m |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
707 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
708 |
"Modified: / 17.8.1998 / 10:13:05 / cg" |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
709 |
! |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
710 |
|
1834 | 711 |
directoryMenuSpec |
712 |
"This resource specification was automatically generated |
|
713 |
by the MenuEditor of ST/X." |
|
714 |
||
715 |
"Do not manually edit this!! If it is corrupted, |
|
716 |
the MenuEditor may not be able to read the specification." |
|
717 |
||
718 |
" |
|
719 |
MenuEditor new openOnClass:FileBrowser andSelector:#directoryMenuSpec |
|
720 |
(Menu new fromLiteralArrayEncoding:(FileBrowser directoryMenuSpec)) startUp |
|
721 |
" |
|
722 |
||
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
723 |
<resource: #menu> |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
724 |
|
3658 | 725 |
^ |
726 |
#(#Menu |
|
727 |
#( |
|
728 |
#(#MenuItem |
|
729 |
#label: 'Copy Path' |
|
730 |
#translateLabel: true |
|
731 |
#value: #copyPath |
|
732 |
) |
|
733 |
#(#MenuItem |
|
734 |
#label: '-' |
|
735 |
) |
|
736 |
#(#MenuItem |
|
737 |
#label: 'Up' |
|
738 |
#translateLabel: true |
|
739 |
#value: #changeToParentDirectory |
|
740 |
#enabled: #currentDirectoryIsNotTop |
|
741 |
) |
|
742 |
#(#MenuItem |
|
743 |
#label: 'Goto...' |
|
744 |
#translateLabel: true |
|
745 |
#value: #changeCurrentDirectory |
|
746 |
) |
|
747 |
#(#MenuItem |
|
748 |
#label: '-' |
|
749 |
) |
|
750 |
#(#MenuItem |
|
751 |
#label: 'Back' |
|
752 |
#translateLabel: true |
|
753 |
#value: #changeToPreviousDirectory |
|
754 |
) |
|
755 |
#(#MenuItem |
|
756 |
#label: '-' |
|
757 |
) |
|
758 |
#(#MenuItem |
|
759 |
#label: 'Default' |
|
760 |
#translateLabel: true |
|
761 |
#value: #changeToDefaultDirectory |
|
762 |
) |
|
763 |
#(#MenuItem |
|
764 |
#label: 'Home' |
|
765 |
#translateLabel: true |
|
766 |
#value: #changeToHomeDirectory |
|
767 |
) |
|
768 |
#(#MenuItem |
|
769 |
#label: 'Bookmarks' |
|
770 |
#translateLabel: true |
|
771 |
#submenuChannel: #bookmarksMenuSpec |
|
772 |
) |
|
773 |
#(#MenuItem |
|
774 |
#label: '-' |
|
775 |
) |
|
776 |
#(#MenuItem |
|
777 |
#label: 'Visited Directories' |
|
778 |
#translateLabel: true |
|
779 |
#submenuChannel: #historyMenuSpec |
|
780 |
) |
|
781 |
) |
|
782 |
nil |
|
783 |
nil |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
784 |
) |
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 |
historyMenuSpec |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
788 |
"This resource specification was automatically generated |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
789 |
by the MenuEditor of ST/X." |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
790 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
791 |
"Do not manually edit this!! If it is corrupted, |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
792 |
the MenuEditor may not be able to read the specification." |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
793 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
794 |
" |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
795 |
MenuEditor new openOnClass:FileBrowser andSelector:#directoryMenuSpec |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
796 |
(Menu new fromLiteralArrayEncoding:(FileBrowser directoryMenuSpec)) startUp |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
797 |
" |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
798 |
|
1834 | 799 |
<resource: #programMenu> |
800 |
||
2035
307ed5143d8b
national language stuff - again
Claus Gittinger <cg@exept.de>
parents:
2031
diff
changeset
|
801 |
|m| |
307ed5143d8b
national language stuff - again
Claus Gittinger <cg@exept.de>
parents:
2031
diff
changeset
|
802 |
|
1834 | 803 |
"/ add the history items ... |
804 |
||
1835 | 805 |
DirectoryHistory size > 0 ifTrue:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
806 |
m := Menu new. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
807 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
808 |
DirectoryHistory do:[:dirName | |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
809 |
m addItem:((MenuItem label:dirName value:#changeDirectoryTo:) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
810 |
argument:dirName; |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
811 |
yourself). |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
812 |
]. |
3454 | 813 |
]. |
814 |
||
2035
307ed5143d8b
national language stuff - again
Claus Gittinger <cg@exept.de>
parents:
2031
diff
changeset
|
815 |
^ m |
1834 | 816 |
|
1837 | 817 |
"Modified: / 17.8.1998 / 10:13:05 / cg" |
1834 | 818 |
! |
819 |
||
820 |
menuPopUp |
|
821 |
"This resource specification was automatically generated |
|
822 |
by the MenuEditor of ST/X." |
|
823 |
||
824 |
"Do not manually edit this!! If it is corrupted, |
|
825 |
the MenuEditor may not be able to read the specification." |
|
826 |
||
827 |
" |
|
828 |
MenuEditor new openOnClass:FileBrowser andSelector:#menuPopUp |
|
829 |
(Menu new fromLiteralArrayEncoding:(FileBrowser menuPopUp)) startUp |
|
830 |
" |
|
831 |
||
832 |
<resource: #menu> |
|
833 |
||
2185 | 834 |
^ |
835 |
#(#Menu |
|
836 |
#( |
|
837 |
#(#MenuItem |
|
838 |
#label: 'Spawn' |
|
839 |
#translateLabel: true |
|
840 |
#value: #fileSpawn |
|
841 |
) |
|
842 |
#(#MenuItem |
|
843 |
#label: '-' |
|
844 |
) |
|
845 |
#(#MenuItem |
|
846 |
#label: 'Get Contents' |
|
847 |
#translateLabel: true |
|
848 |
#value: #fileGet |
|
849 |
#enabled: #hasSelection |
|
850 |
) |
|
851 |
#(#MenuItem |
|
852 |
#label: 'Insert Contents' |
|
853 |
#translateLabel: true |
|
854 |
#value: #fileInsert |
|
855 |
#enabled: #hasSelection |
|
856 |
) |
|
857 |
#(#MenuItem |
|
858 |
#label: 'FileIn' |
|
859 |
#translateLabel: true |
|
860 |
#value: #fileFileIn |
|
861 |
#enabled: #hasSelection |
|
2825
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
862 |
#shortcutKeyCharacter: #Accept |
2185 | 863 |
) |
864 |
#(#MenuItem |
|
865 |
#label: '-' |
|
866 |
) |
|
867 |
#(#MenuItem |
|
3172 | 868 |
#label: 'New' |
2185 | 869 |
#translateLabel: true |
3172 | 870 |
#submenu: |
871 |
#(#Menu |
|
872 |
#( |
|
873 |
#(#MenuItem |
|
874 |
#label: 'Directory...' |
|
875 |
#translateLabel: true |
|
876 |
#value: #newDirectory |
|
877 |
) |
|
878 |
#(#MenuItem |
|
879 |
#label: 'File...' |
|
880 |
#translateLabel: true |
|
881 |
#value: #newFile |
|
882 |
) |
|
883 |
#(#MenuItem |
|
884 |
#label: 'Hard Link...' |
|
885 |
#translateLabel: true |
|
886 |
#isVisible: #systemIsUnix |
|
887 |
#value: #newHardLink |
|
888 |
) |
|
889 |
#(#MenuItem |
|
890 |
#label: 'Symbolic Link...' |
|
891 |
#translateLabel: true |
|
892 |
#isVisible: #systemIsUnix |
|
893 |
#value: #newSoftLink |
|
894 |
) |
|
895 |
) |
|
896 |
nil |
|
897 |
nil |
|
898 |
) |
|
2185 | 899 |
) |
900 |
#(#MenuItem |
|
901 |
#label: 'Remove...' |
|
902 |
#translateLabel: true |
|
903 |
#value: #fileRemove |
|
904 |
#enabled: #hasSelection |
|
2543 | 905 |
#shortcutKeyCharacter: #Cut |
2185 | 906 |
) |
907 |
#(#MenuItem |
|
908 |
#label: 'Rename...' |
|
909 |
#translateLabel: true |
|
910 |
#value: #fileRename |
|
911 |
#enabled: #hasSelection |
|
2825
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
912 |
#shortcutKeyCharacter: #Replace |
2185 | 913 |
) |
914 |
#(#MenuItem |
|
915 |
#label: '-' |
|
916 |
) |
|
917 |
#(#MenuItem |
|
3172 | 918 |
#label: 'Properties...' |
2185 | 919 |
#translateLabel: true |
3172 | 920 |
#value: #fileGetLongInfo |
921 |
#enabled: #hasSelection |
|
2185 | 922 |
) |
923 |
#(#MenuItem |
|
3172 | 924 |
#label: '-' |
925 |
) |
|
926 |
#(#MenuItem |
|
927 |
#label: 'Tools' |
|
2185 | 928 |
#translateLabel: true |
3172 | 929 |
#submenuChannel: #toolsMenuSpec |
930 |
#shortcutKeyCharacter: #Ctrl |
|
2185 | 931 |
) |
932 |
#(#MenuItem |
|
933 |
#label: '-' |
|
934 |
) |
|
935 |
#(#MenuItem |
|
936 |
#label: 'Update' |
|
937 |
#translateLabel: true |
|
938 |
#value: #updateCurrentDirectory |
|
939 |
) |
|
940 |
) |
|
941 |
nil |
|
942 |
nil |
|
2844 | 943 |
) |
944 |
! |
|
1834 | 945 |
|
946 |
menuSpec |
|
947 |
"This resource specification was automatically generated |
|
948 |
by the MenuEditor of ST/X." |
|
949 |
||
950 |
"Do not manually edit this!! If it is corrupted, |
|
951 |
the MenuEditor may not be able to read the specification." |
|
952 |
||
953 |
" |
|
954 |
MenuEditor new openOnClass:FileBrowser andSelector:#menuSpec |
|
955 |
(Menu new fromLiteralArrayEncoding:(FileBrowser menuSpec)) startUp |
|
956 |
" |
|
957 |
||
958 |
<resource: #menu> |
|
959 |
||
2102 | 960 |
^ |
961 |
#(#Menu |
|
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
962 |
#( |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
963 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
964 |
#label: 'File' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
965 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
966 |
#submenu: |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
967 |
#(#Menu |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
968 |
#( |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
969 |
#(#MenuItem |
2951
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
970 |
#label: 'Spawn' |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
971 |
#translateLabel: true |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
972 |
#value: #fileSpawn |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
973 |
) |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
974 |
#(#MenuItem |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
975 |
#label: '-' |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
976 |
) |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
977 |
#(#MenuItem |
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
978 |
#label: 'Open' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
979 |
#translateLabel: true |
3213 | 980 |
#isVisible: false |
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
981 |
#value: #menuOpen |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
982 |
#enabled: #hasSelection |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
983 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
984 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
985 |
#label: 'Open selected Filename' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
986 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
987 |
#isVisible: #hasFilenameSelectionInCodeView |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
988 |
#value: #openSelectedFilename |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
989 |
#enabled: #hasFilenameSelectionInCodeView |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
990 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
991 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
992 |
#label: 'FileIn' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
993 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
994 |
#value: #fileFileIn |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
995 |
#enabled: #hasSelection |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
996 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
997 |
#(#MenuItem |
3465
f52e089ca838
added fileIntoNameSpace menu item
Claus Gittinger <cg@exept.de>
parents:
3461
diff
changeset
|
998 |
#label: 'FileInTo NameSpace...' |
f52e089ca838
added fileIntoNameSpace menu item
Claus Gittinger <cg@exept.de>
parents:
3461
diff
changeset
|
999 |
#translateLabel: true |
f52e089ca838
added fileIntoNameSpace menu item
Claus Gittinger <cg@exept.de>
parents:
3461
diff
changeset
|
1000 |
#value: #fileFileInToNameSpace |
f52e089ca838
added fileIntoNameSpace menu item
Claus Gittinger <cg@exept.de>
parents:
3461
diff
changeset
|
1001 |
#enabled: #hasSelection |
f52e089ca838
added fileIntoNameSpace menu item
Claus Gittinger <cg@exept.de>
parents:
3461
diff
changeset
|
1002 |
) |
f52e089ca838
added fileIntoNameSpace menu item
Claus Gittinger <cg@exept.de>
parents:
3461
diff
changeset
|
1003 |
#(#MenuItem |
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1004 |
#label: '-' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1005 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1006 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1007 |
#label: 'New' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1008 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1009 |
#submenu: |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1010 |
#(#Menu |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1011 |
#( |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1012 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1013 |
#label: 'Directory...' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1014 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1015 |
#value: #newDirectory |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1016 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1017 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1018 |
#label: 'File...' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1019 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1020 |
#value: #newFile |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1021 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1022 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1023 |
#label: 'Hard Link...' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1024 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1025 |
#isVisible: #systemIsUnix |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1026 |
#value: #newHardLink |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1027 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1028 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1029 |
#label: 'Symbolic Link...' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1030 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1031 |
#isVisible: #systemIsUnix |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1032 |
#value: #newSoftLink |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1033 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1034 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1035 |
nil |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1036 |
nil |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1037 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1038 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1039 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1040 |
#label: 'Remove' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1041 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1042 |
#value: #fileRemove |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1043 |
#enabled: #hasSelection |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1044 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1045 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1046 |
#label: 'Rename' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1047 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1048 |
#value: #fileRename |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1049 |
#enabled: #hasSelection |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1050 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1051 |
#(#MenuItem |
2143 | 1052 |
#label: '-' |
1053 |
) |
|
1054 |
#(#MenuItem |
|
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1055 |
#label: 'Properties...' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1056 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1057 |
#value: #fileGetLongInfo |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1058 |
#enabled: #hasSelection |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1059 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1060 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1061 |
#label: '-' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1062 |
#isVisible: #javaSupportLoaded |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1063 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1064 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1065 |
#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
|
1066 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1067 |
#isVisible: #javaSupportLoaded |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1068 |
#value: #fileAddToJavaClassPath |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1069 |
#enabled: #canAddToClassPath |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1070 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1071 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1072 |
#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
|
1073 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1074 |
#isVisible: #javaSupportLoaded |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1075 |
#value: #fileRemoveFromJavaClassPath |
2368 | 1076 |
#enabled: #canRemoveFromClassPath |
1077 |
) |
|
1078 |
#(#MenuItem |
|
1079 |
#label: 'Add to Java SourcePath' |
|
1080 |
#translateLabel: true |
|
1081 |
#isVisible: #javaSupportLoaded |
|
1082 |
#value: #fileAddToJavaSourcePath |
|
1083 |
#enabled: #canAddToSourcePath |
|
1084 |
) |
|
1085 |
#(#MenuItem |
|
1086 |
#label: 'Remove from Java SourcePath' |
|
1087 |
#translateLabel: true |
|
1088 |
#isVisible: #javaSupportLoaded |
|
1089 |
#value: #fileRemoveFromJavaSourcePath |
|
1090 |
#enabled: #canRemoveFromSourcePath |
|
2142
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 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1093 |
#label: '-' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1094 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1095 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1096 |
#label: 'Exit' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1097 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1098 |
#value: #menuExit |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1099 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1100 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1101 |
nil |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1102 |
nil |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1103 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1104 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1105 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1106 |
#label: 'Directory' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1107 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1108 |
#submenuChannel: #directoryMenuSpec |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1109 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1110 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1111 |
#label: 'Edit' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1112 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1113 |
#submenu: |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1114 |
#(#Menu |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1115 |
#( |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1116 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1117 |
#label: 'Get Contents' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1118 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1119 |
#value: #fileGet |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1120 |
#enabled: #hasSelection |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1121 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1122 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1123 |
#label: 'Insert Contents' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1124 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1125 |
#value: #fileInsert |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1126 |
#enabled: #hasSelection |
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: '-' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1130 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1131 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1132 |
#label: 'Copy File List' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1133 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1134 |
#value: #copyFileList |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1135 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1136 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1137 |
#label: 'Copy Selected Filename' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1138 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1139 |
#value: #copySelectedFileName |
3010 | 1140 |
#enabled: #hasSelection |
1141 |
) |
|
1142 |
#(#MenuItem |
|
1143 |
#label: 'Copy Selected Pathname' |
|
1144 |
#translateLabel: true |
|
1145 |
#value: #copySelectedPathName |
|
1146 |
#enabled: #hasSelection |
|
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1147 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1148 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1149 |
#label: 'Copy Command History' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1150 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1151 |
#value: #copyCommandHistory |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1152 |
) |
2951
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
1153 |
#(#MenuItem |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
1154 |
#label: '-' |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
1155 |
) |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
1156 |
#(#MenuItem |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
1157 |
#label: 'Visited Files' |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
1158 |
#translateLabel: true |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
1159 |
#submenuChannel: #visitedFileMenuSpec |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
1160 |
) |
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1161 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1162 |
nil |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1163 |
nil |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1164 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1165 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1166 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1167 |
#label: 'View' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1168 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1169 |
#submenu: |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1170 |
#(#Menu |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1171 |
#( |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1172 |
#(#MenuItem |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1173 |
#label: 'Show Details' |
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1174 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1175 |
#indication: #showingDetails |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1176 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1177 |
#(#MenuItem |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1178 |
#label: 'Show Time && Date' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1179 |
#translateLabel: true |
3658 | 1180 |
#enabled: #showingDetails |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1181 |
#indication: #showingTimeAndDate |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1182 |
) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1183 |
#(#MenuItem |
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1184 |
#label: 'Show Hidden Files' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1185 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1186 |
#indication: #showingHiddenFiles |
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 |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1189 |
#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
|
1190 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1191 |
#indication: #showingBigImagePreview |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1192 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1193 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1194 |
#label: '-' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1195 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1196 |
#(#MenuItem |
2155 | 1197 |
#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
|
1198 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1199 |
#choice: #sortByWhat |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1200 |
#choiceValue: #name |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1201 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1202 |
#(#MenuItem |
2155 | 1203 |
#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
|
1204 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1205 |
#choice: #sortByWhat |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1206 |
#choiceValue: #type |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1207 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1208 |
#(#MenuItem |
2155 | 1209 |
#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
|
1210 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1211 |
#choice: #sortByWhat |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1212 |
#choiceValue: #time |
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 |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1215 |
#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
|
1216 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1217 |
#indication: #sortCaseless |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1218 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1219 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1220 |
#label: '-' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1221 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1222 |
#(#MenuItem |
3172 | 1223 |
#label: 'Encoding...' |
1224 |
#translateLabel: true |
|
1225 |
#value: #fileEncoding |
|
1226 |
) |
|
1227 |
#(#MenuItem |
|
1228 |
#label: 'DOS EndOfLine Mode' |
|
1229 |
#translateLabel: true |
|
1230 |
#indication: #dosEOLMode |
|
1231 |
) |
|
1232 |
#(#MenuItem |
|
1233 |
#label: '-' |
|
1234 |
) |
|
1235 |
#(#MenuItem |
|
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1236 |
#label: 'Update' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1237 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1238 |
#value: #updateCurrentDirectory |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1239 |
) |
2220
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
1240 |
#(#MenuItem |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
1241 |
#label: 'AutoUpdate' |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
1242 |
#translateLabel: true |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
1243 |
#indication: #autoUpdate |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
1244 |
) |
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1245 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1246 |
nil |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1247 |
nil |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1248 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1249 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1250 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1251 |
#label: 'Tools' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1252 |
#translateLabel: true |
2825
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1253 |
#submenuChannel: #toolsMenuSpec |
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1254 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1255 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1256 |
#label: 'CVS' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1257 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1258 |
#submenu: |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1259 |
#(#Menu |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1260 |
#( |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1261 |
#(#MenuItem |
3691
f5d9ed09899b
menu texts: standard headline case
Claus Gittinger <cg@exept.de>
parents:
3665
diff
changeset
|
1262 |
#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
|
1263 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1264 |
#value: #cvsUpdateSelection |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1265 |
#enabled: #hasSelection |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1266 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1267 |
#(#MenuItem |
3691
f5d9ed09899b
menu texts: standard headline case
Claus Gittinger <cg@exept.de>
parents:
3665
diff
changeset
|
1268 |
#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
|
1269 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1270 |
#value: #cvsUpdateDirectoryLocal |
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 |
3691
f5d9ed09899b
menu texts: standard headline case
Claus Gittinger <cg@exept.de>
parents:
3665
diff
changeset
|
1273 |
#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
|
1274 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1275 |
#value: #cvsUpdateDirectoryRecursive |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1276 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1277 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1278 |
#label: '-' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1279 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1280 |
#(#MenuItem |
2386 | 1281 |
#label: 'Commit...' |
1282 |
#translateLabel: true |
|
1283 |
#value: #cvsCommitSelection |
|
1284 |
) |
|
1285 |
#(#MenuItem |
|
3467 | 1286 |
#label: 'Add && Commit...' |
2424 | 1287 |
#translateLabel: true |
3467 | 1288 |
#value: #cvsAddAndCommitSelection |
2424 | 1289 |
) |
1290 |
#(#MenuItem |
|
2386 | 1291 |
#label: '-' |
1292 |
) |
|
1293 |
#(#MenuItem |
|
3691
f5d9ed09899b
menu texts: standard headline case
Claus Gittinger <cg@exept.de>
parents:
3665
diff
changeset
|
1294 |
#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
|
1295 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1296 |
#value: #cvsRemoveFileAndContainer |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1297 |
#enabled: #canRemoveCVSContainer |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1298 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1299 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1300 |
nil |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1301 |
nil |
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 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1304 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1305 |
#label: 'Help' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1306 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1307 |
#startGroup: #right |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1308 |
#submenu: |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1309 |
#(#Menu |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1310 |
#( |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1311 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1312 |
#label: 'FileBrowser Documentation' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1313 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1314 |
#value: #openHTMLDocument: |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1315 |
#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
|
1316 |
) |
3213 | 1317 |
#(#MenuItem |
1318 |
#label: '-' |
|
1319 |
) |
|
1320 |
#(#MenuItem |
|
1321 |
#label: 'About FileBrowser...' |
|
1322 |
#translateLabel: true |
|
1323 |
#value: #openAboutThisApplication |
|
1324 |
) |
|
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1325 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1326 |
nil |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1327 |
nil |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1328 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1329 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1330 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1331 |
nil |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1332 |
nil |
1834 | 1333 |
) |
2825
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 |
toolsMenuSpec |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1337 |
"This resource specification was automatically generated |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1338 |
by the MenuEditor of ST/X." |
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 |
"Do not manually edit this!! If it is corrupted, |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1341 |
the MenuEditor may not be able to read the specification." |
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 |
" |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1344 |
MenuEditor new openOnClass:FileBrowser andSelector:#toolsMenuSpec |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1345 |
(Menu new fromLiteralArrayEncoding:(FileBrowser toolsMenuSpec)) startUp |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1346 |
" |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1347 |
|
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1348 |
<resource: #menu> |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1349 |
|
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 |
#(#Menu |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1352 |
#( |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1353 |
#(#MenuItem |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1354 |
#label: 'Unix Command...' |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1355 |
#translateLabel: true |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1356 |
#isVisible: #systemIsUnix |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1357 |
#value: #menuOSCommand |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1358 |
) |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1359 |
#(#MenuItem |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1360 |
#label: 'DOS Command...' |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1361 |
#translateLabel: true |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1362 |
#isVisible: #systemIsDOS |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1363 |
#value: #menuOSCommand |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1364 |
) |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1365 |
#(#MenuItem |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1366 |
#label: 'VMS Command...' |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1367 |
#translateLabel: true |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1368 |
#isVisible: #systemIsVMS |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1369 |
#value: #menuOSCommand |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1370 |
) |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1371 |
#(#MenuItem |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1372 |
#label: 'Shell Terminal' |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1373 |
#translateLabel: true |
3398 | 1374 |
#isVisible: #canDoTerminalAndSystemIsUnix |
1375 |
#value: #openTerminal |
|
1376 |
#enabled: #canDoTerminal |
|
1377 |
) |
|
1378 |
#(#MenuItem |
|
1379 |
#label: 'DOS Terminal' |
|
1380 |
#translateLabel: true |
|
1381 |
#isVisible: #canDoTerminalAndSystemIsDOS |
|
2825
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1382 |
#value: #openTerminal |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1383 |
#enabled: #canDoTerminal |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1384 |
) |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1385 |
#(#MenuItem |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1386 |
#label: '-' |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1387 |
) |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1388 |
#(#MenuItem |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1389 |
#label: 'Changes Browser' |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1390 |
#translateLabel: true |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1391 |
#value: #openChangesBrowser |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1392 |
#enabled: #hasSelection |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1393 |
) |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1394 |
#(#MenuItem |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1395 |
#label: 'Snapshot Image Browser' |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1396 |
#translateLabel: true |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1397 |
#value: #openSnapshotImageBrowser |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1398 |
#enabled: #hasSnapshotSelection |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1399 |
) |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1400 |
#(#MenuItem |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1401 |
#label: 'Create Smalltalk Project' |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1402 |
#translateLabel: true |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1403 |
#value: #createProjectAndOpenProjectBrowser |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1404 |
#enabled: #canCreateNewProject |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1405 |
) |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1406 |
#(#MenuItem |
3765
8309f42ebf29
+ installAllAsAutoloaded function
Claus Gittinger <cg@exept.de>
parents:
3762
diff
changeset
|
1407 |
#label: 'Install Autoloaded' |
2825
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1408 |
#translateLabel: true |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1409 |
#value: #readAbbrevFile |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1410 |
#enabled: #canReadAbbrevFile |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1411 |
) |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1412 |
#(#MenuItem |
3814 | 1413 |
#label: 'Install All as Autoloaded' |
3765
8309f42ebf29
+ installAllAsAutoloaded function
Claus Gittinger <cg@exept.de>
parents:
3762
diff
changeset
|
1414 |
#translateLabel: true |
8309f42ebf29
+ installAllAsAutoloaded function
Claus Gittinger <cg@exept.de>
parents:
3762
diff
changeset
|
1415 |
#value: #installAllAsAutoloaded |
8309f42ebf29
+ installAllAsAutoloaded function
Claus Gittinger <cg@exept.de>
parents:
3762
diff
changeset
|
1416 |
#enabled: #anySTFilesPresent |
8309f42ebf29
+ installAllAsAutoloaded function
Claus Gittinger <cg@exept.de>
parents:
3762
diff
changeset
|
1417 |
) |
8309f42ebf29
+ installAllAsAutoloaded function
Claus Gittinger <cg@exept.de>
parents:
3762
diff
changeset
|
1418 |
#(#MenuItem |
2825
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1419 |
#label: 'Editor' |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1420 |
#translateLabel: true |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1421 |
#value: #openEditor |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1422 |
#enabled: #hasSelection |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1423 |
) |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1424 |
#(#MenuItem |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1425 |
#label: 'HTML Reader' |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1426 |
#translateLabel: true |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1427 |
#value: #openHTMLReader |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1428 |
#enabled: #hasSelection |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1429 |
) |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1430 |
#(#MenuItem |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1431 |
#label: 'ASN1 Browser' |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1432 |
#translateLabel: true |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1433 |
#isVisible: #hasASN1 |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1434 |
#value: #openASN1Browser |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1435 |
#enabled: #hasASN1AndSelection |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1436 |
) |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1437 |
#(#MenuItem |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1438 |
#label: 'C Browser' |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1439 |
#translateLabel: true |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1440 |
#isVisible: #hasCBrowser |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1441 |
#value: #openCBrowser |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1442 |
#enabled: #hasCBrowser |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1443 |
) |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1444 |
#(#MenuItem |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1445 |
#label: 'Applet Viewer' |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1446 |
#translateLabel: true |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1447 |
#isVisible: #hasJava |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1448 |
#value: #openAppletViewer |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1449 |
#enabled: #hasJavaAndSelection |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1450 |
) |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1451 |
#(#MenuItem |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1452 |
#label: 'Image Inspector' |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1453 |
#translateLabel: true |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1454 |
#value: #openImageInspector |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1455 |
#enabled: #hasSelection |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1456 |
) |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1457 |
#(#MenuItem |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1458 |
#label: 'Image Preview' |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1459 |
#translateLabel: true |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1460 |
#value: #openImagePreview |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1461 |
#enabled: #hasSelection |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1462 |
) |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1463 |
#(#MenuItem |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1464 |
#label: 'Image Editor' |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1465 |
#translateLabel: true |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1466 |
#value: #openImageEditor |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1467 |
#enabled: #hasSelection |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1468 |
) |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1469 |
#(#MenuItem |
3001 | 1470 |
#label: 'MP3 Player' |
1471 |
#translateLabel: true |
|
1472 |
#isVisible: #hasMP3Player |
|
1473 |
#value: #openMP3Player |
|
1474 |
#enabled: #hasMP3PlayerAndSelection |
|
1475 |
) |
|
1476 |
#(#MenuItem |
|
2825
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1477 |
#label: 'ZipFile Tool' |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1478 |
#translateLabel: true |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1479 |
#value: #openZipTool |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1480 |
#enabled: #hasZipFileSelected |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1481 |
) |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1482 |
#(#MenuItem |
3536 | 1483 |
#label: 'SlideShow' |
1484 |
#translateLabel: true |
|
1485 |
#value: #openSlideShow |
|
1486 |
#isVisible: #hasSlideShow |
|
1487 |
) |
|
1488 |
#(#MenuItem |
|
2825
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1489 |
#label: 'File Differences...' |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1490 |
#translateLabel: true |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1491 |
#value: #openDiffView |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1492 |
) |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1493 |
#(#MenuItem |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1494 |
#label: 'Find Duplicate Files' |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1495 |
#translateLabel: true |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1496 |
#value: #fileFindDuplicates |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1497 |
) |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1498 |
#(#MenuItem |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1499 |
#label: 'Find All Duplicate Files (recursive)' |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1500 |
#translateLabel: true |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1501 |
#value: #fileFindAllDuplicates |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1502 |
) |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1503 |
#(#MenuItem |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1504 |
#label: 'Find a File...' |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1505 |
#translateLabel: true |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1506 |
#value: #fileFindFile |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1507 |
) |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1508 |
#(#MenuItem |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1509 |
#label: 'Hex Dump' |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1510 |
#translateLabel: true |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1511 |
#value: #fileHexDump |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1512 |
#enabled: #hasSelection |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1513 |
) |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1514 |
) |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1515 |
nil |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1516 |
nil |
2844 | 1517 |
) |
3398 | 1518 |
|
3536 | 1519 |
"Modified: / 29.12.2001 / 21:59:27 / cg" |
2951
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
1520 |
! |
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 |
visitedFileMenuSpec |
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 |
<resource: #programMenu> |
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 |
|m| |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
1527 |
|
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
1528 |
VisitedFileHistory size == 0 ifTrue:[^ nil]. |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
1529 |
|
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
1530 |
m := Menu new. |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
1531 |
|
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
1532 |
"/ add the history items ... |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
1533 |
|
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
1534 |
VisitedFileHistory do:[:pathName | |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
1535 |
m addItem:((MenuItem label:pathName asFilename baseName value:#revisitFile:) |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
1536 |
argument:pathName; |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
1537 |
yourself). |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
1538 |
]. |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
1539 |
^ m |
2844 | 1540 |
! ! |
1834 | 1541 |
|
3861 | 1542 |
!FileBrowser class methodsFor:'private - presentation'! |
1543 |
||
1544 |
fileTypeFor:aFilename |
|
1545 |
|key| |
|
1546 |
||
1547 |
aFilename isDirectory ifTrue:[ |
|
1548 |
key := #directory. |
|
1549 |
] ifFalse:[ |
|
1550 |
key := #file. |
|
1551 |
aFilename isExecutableProgram ifTrue:[ |
|
1552 |
key := #executableFile |
|
1553 |
]. |
|
1554 |
]. |
|
1555 |
"/ aFilename isDirectory ifTrue:[ |
|
1556 |
"/ aFilename isSymbolicLink ifTrue:[ |
|
1557 |
"/ key := #directoryLink |
|
1558 |
"/ ] ifFalse:[ |
|
1559 |
"/ key := #directory. |
|
1560 |
"/ (aFilename isReadable not or:[aFilename isExecutable not]) ifTrue:[ |
|
1561 |
"/ key := #directoryLocked |
|
1562 |
"/ ]. |
|
1563 |
"/ ] |
|
1564 |
"/ ] ifFalse:[ |
|
1565 |
"/ aFilename isSymbolicLink ifTrue:[ |
|
1566 |
"/ aFilename isReadable not ifTrue:[ |
|
1567 |
"/ key := #fileLocked |
|
1568 |
"/ ] ifFalse:[ |
|
1569 |
"/ key := #fileLink |
|
1570 |
"/ ] |
|
1571 |
"/ ] ifFalse:[ |
|
1572 |
"/ key := #file. |
|
1573 |
"/ aFilename isExecutableProgram ifTrue:[ |
|
1574 |
"/ key := #executableFile |
|
1575 |
"/ ]. |
|
1576 |
"/ (aFilename isReadable not) ifTrue:[ |
|
1577 |
"/ key := #fileLocked |
|
1578 |
"/ ]. |
|
1579 |
"/ ]. |
|
1580 |
"/ ]. |
|
1581 |
||
1582 |
^ key |
|
1583 |
! |
|
1584 |
||
1585 |
getAddOnIconsFor:aFilename |
|
1586 |
"given a fileName, return an appropriate icon" |
|
1587 |
||
1588 |
| addIcns isDirectory isReadable| |
|
1589 |
||
1590 |
addIcns := OrderedCollection new. |
|
1591 |
aFilename isSymbolicLink ifTrue:[ |
|
1592 |
addIcns add:(self iconForKeyMatching:#addOnLinked). |
|
1593 |
]. |
|
1594 |
isDirectory := aFilename isDirectory. |
|
1595 |
isReadable := aFilename isReadable. |
|
1596 |
((isReadable not and:[isDirectory not]) or:[(isDirectory) and:[(isReadable not) or:[aFilename isExecutable not]]]) ifTrue:[ |
|
1597 |
addIcns add:(self iconForKeyMatching:#addOnLocked). |
|
1598 |
]. |
|
1599 |
^ addIcns |
|
1600 |
! |
|
1601 |
||
1602 |
iconForFile:aFilename |
|
1603 |
"given a fileName, return an appropriate icon" |
|
1604 |
||
1605 |
|icn addIcns| |
|
1606 |
||
1607 |
icn := self iconForKeyMatching:(self iconKeyForFile:aFilename). |
|
1608 |
addIcns := self getAddOnIconsFor:aFilename. |
|
1609 |
addIcns notEmpty ifTrue:[ |
|
1610 |
addIcns addFirst:icn. |
|
1611 |
^ MultiImage images:addIcns. |
|
1612 |
]. |
|
1613 |
^ icn |
|
1614 |
! |
|
1615 |
||
1616 |
iconForKeyMatching:mimeTypeOrKey |
|
1617 |
|assoc icn| |
|
1618 |
||
1619 |
icn := Icons at:mimeTypeOrKey ifAbsent:nil. |
|
1620 |
icn notNil ifTrue:[^ icn]. |
|
1621 |
assoc := MatchedIcons detect:[:assoc | assoc key match:mimeTypeOrKey] ifNone:nil. |
|
1622 |
assoc notNil ifTrue:[^ assoc value]. |
|
1623 |
^ nil. |
|
1624 |
! |
|
1625 |
||
1626 |
iconKeyForFile:aFilenameArg |
|
1627 |
"given a fileName, return an appropriate icon" |
|
1628 |
||
1629 |
|aFilename fileType mimeType suffix| |
|
1630 |
||
1631 |
aFilename := aFilenameArg. |
|
1632 |
||
1633 |
fileType := self fileTypeFor:aFilename. |
|
1634 |
||
1635 |
aFilename isDirectory ifFalse:[ |
|
1636 |
"/ aFilename isReadable ifTrue:[ |
|
1637 |
suffix := aFilename suffix. |
|
1638 |
(suffix = 'bak' or:[suffix = 'sav']) ifTrue:[ |
|
1639 |
aFilename := aFilename withoutSuffix. |
|
1640 |
]. |
|
1641 |
mimeType := MIMETypes mimeTypeForFilename:aFilename. |
|
1642 |
"/ ]. |
|
1643 |
]. |
|
1644 |
||
1645 |
^ (mimeType ? fileType). |
|
1646 |
! ! |
|
1647 |
||
2094 | 1648 |
!FileBrowser class methodsFor:'queries'! |
1649 |
||
1650 |
isVisualStartable |
|
2844 | 1651 |
"return true, if this application can be started via #open. |
1652 |
(to allow start of a change browser via double-click in the browser)" |
|
2094 | 1653 |
|
1654 |
^ true |
|
1655 |
! ! |
|
1656 |
||
1834 | 1657 |
!FileBrowser methodsFor:'aspects'! |
1658 |
||
3765
8309f42ebf29
+ installAllAsAutoloaded function
Claus Gittinger <cg@exept.de>
parents:
3762
diff
changeset
|
1659 |
anyFilesPresentWithSuffix:suffix |
8309f42ebf29
+ installAllAsAutoloaded function
Claus Gittinger <cg@exept.de>
parents:
3762
diff
changeset
|
1660 |
^ currentDirectory notNil |
8309f42ebf29
+ installAllAsAutoloaded function
Claus Gittinger <cg@exept.de>
parents:
3762
diff
changeset
|
1661 |
and:[currentDirectory |
8309f42ebf29
+ installAllAsAutoloaded function
Claus Gittinger <cg@exept.de>
parents:
3762
diff
changeset
|
1662 |
directoryContents |
8309f42ebf29
+ installAllAsAutoloaded function
Claus Gittinger <cg@exept.de>
parents:
3762
diff
changeset
|
1663 |
contains:[:f| f asFilename suffix = suffix]] |
8309f42ebf29
+ installAllAsAutoloaded function
Claus Gittinger <cg@exept.de>
parents:
3762
diff
changeset
|
1664 |
! |
8309f42ebf29
+ installAllAsAutoloaded function
Claus Gittinger <cg@exept.de>
parents:
3762
diff
changeset
|
1665 |
|
8309f42ebf29
+ installAllAsAutoloaded function
Claus Gittinger <cg@exept.de>
parents:
3762
diff
changeset
|
1666 |
anySTFilesPresent |
8309f42ebf29
+ installAllAsAutoloaded function
Claus Gittinger <cg@exept.de>
parents:
3762
diff
changeset
|
1667 |
^ self anyFilesPresentWithSuffix:'st' |
8309f42ebf29
+ installAllAsAutoloaded function
Claus Gittinger <cg@exept.de>
parents:
3762
diff
changeset
|
1668 |
! |
8309f42ebf29
+ installAllAsAutoloaded function
Claus Gittinger <cg@exept.de>
parents:
3762
diff
changeset
|
1669 |
|
2220
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
1670 |
autoUpdate |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
1671 |
^ doAutoUpdate |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
1672 |
|
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
1673 |
"Created: / 6.5.1999 / 11:37:25 / cg" |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
1674 |
"Modified: / 6.5.1999 / 11:39:38 / cg" |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
1675 |
! |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
1676 |
|
1893
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
1677 |
canAddToClassPath |
2368 | 1678 |
^ [ |f| |
1679 |
||
1680 |
(Java isNil or:[Java isLoaded not]) ifTrue:[ |
|
1681 |
false |
|
1682 |
] ifFalse:[ |
|
1683 |
f := self singleSelectedFileOrCurrentDirectory. |
|
1684 |
f notNil |
|
1685 |
and:[(Java classPath includes:f pathName) not |
|
1686 |
and:[f isDirectory |
|
1687 |
or:[(f hasSuffix:'jar') |
|
1688 |
or:[(f hasSuffix:'zip')]]]]. |
|
1689 |
] |
|
1690 |
] |
|
1691 |
||
1692 |
"Modified: / 1.2.1999 / 20:38:42 / cg" |
|
1693 |
! |
|
1694 |
||
1695 |
canAddToSourcePath |
|
1696 |
^ [ |f| |
|
1697 |
||
1698 |
(Java isNil or:[Java isLoaded not]) ifTrue:[ |
|
1699 |
false |
|
1700 |
] ifFalse:[ |
|
1701 |
f := self singleSelectedFileOrCurrentDirectory. |
|
1702 |
f notNil |
|
2438 | 1703 |
and:[(Java sourcePath isNil |
1704 |
or:[(Java sourcePath includes:f pathName) not]) |
|
2368 | 1705 |
and:[f isDirectory |
1706 |
or:[(f hasSuffix:'jar') |
|
1707 |
or:[(f hasSuffix:'zip')]]]]. |
|
1708 |
] |
|
1893
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
1709 |
] |
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
1710 |
|
1989 | 1711 |
"Modified: / 1.2.1999 / 20:38:42 / cg" |
1893
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
1712 |
! |
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
1713 |
|
2562
da7680fe8407
first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents:
2550
diff
changeset
|
1714 |
canCreateNewProject |
da7680fe8407
first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents:
2550
diff
changeset
|
1715 |
^ [ |
da7680fe8407
first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents:
2550
diff
changeset
|
1716 |
currentDirectory notNil |
3765
8309f42ebf29
+ installAllAsAutoloaded function
Claus Gittinger <cg@exept.de>
parents:
3762
diff
changeset
|
1717 |
and:[(self anyFilesPresentWithSuffix:'prj') not |
8309f42ebf29
+ installAllAsAutoloaded function
Claus Gittinger <cg@exept.de>
parents:
3762
diff
changeset
|
1718 |
and:[(self anyFilesPresentWithSuffix:'st')]] |
8309f42ebf29
+ installAllAsAutoloaded function
Claus Gittinger <cg@exept.de>
parents:
3762
diff
changeset
|
1719 |
] |
2562
da7680fe8407
first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents:
2550
diff
changeset
|
1720 |
! |
da7680fe8407
first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents:
2550
diff
changeset
|
1721 |
|
2129 | 1722 |
canDoTerminal |
1723 |
^ OperatingSystem isUNIXlike |
|
1724 |
or:[OperatingSystem isMSWINDOWSlike] |
|
1725 |
||
1726 |
"Created: / 4.8.1998 / 13:37:13 / cg" |
|
1727 |
"Modified: / 28.4.1999 / 11:54:17 / cg" |
|
1728 |
! |
|
1729 |
||
3398 | 1730 |
canDoTerminalAndSystemIsDOS |
1731 |
^ self canDoTerminal and:[OperatingSystem isMSWINDOWSlike] |
|
1732 |
||
1733 |
"Created: / 10.11.2001 / 13:10:32 / cg" |
|
1734 |
! |
|
1735 |
||
1736 |
canDoTerminalAndSystemIsUnix |
|
1737 |
^ self canDoTerminal and:[OperatingSystem isUNIXlike] |
|
1738 |
||
1739 |
"Created: / 10.11.2001 / 13:10:46 / cg" |
|
1740 |
! |
|
1741 |
||
2567
dd029fea485d
added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents:
2562
diff
changeset
|
1742 |
canReadAbbrevFile |
3013 | 1743 |
^ [|sel f fn suff ok| |
2567
dd029fea485d
added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents:
2562
diff
changeset
|
1744 |
|
dd029fea485d
added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents:
2562
diff
changeset
|
1745 |
sel := fileListView selection. |
dd029fea485d
added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents:
2562
diff
changeset
|
1746 |
sel size == 1 ifTrue:[ |
dd029fea485d
added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents:
2562
diff
changeset
|
1747 |
f := fileList at:sel first ifAbsent:nil. |
3013 | 1748 |
ok := (f = 'abbrev.stc'). |
1749 |
]. |
|
1750 |
ok ifFalse:[ |
|
1751 |
ok := currentDirectory notNil |
|
3747
d30bc1e54f15
Remove unused vars and asFilename sends
Stefan Vogel <sv@exept.de>
parents:
3746
diff
changeset
|
1752 |
and:[(currentDirectory construct:'abbrev.stc') exists]. |
3013 | 1753 |
]. |
1754 |
ok |
|
2567
dd029fea485d
added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents:
2562
diff
changeset
|
1755 |
] |
dd029fea485d
added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents:
2562
diff
changeset
|
1756 |
|
dd029fea485d
added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents:
2562
diff
changeset
|
1757 |
"Modified: / 30.1.1999 / 19:05:59 / cg" |
dd029fea485d
added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents:
2562
diff
changeset
|
1758 |
"Created: / 29.1.2000 / 13:00:57 / cg" |
dd029fea485d
added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents:
2562
diff
changeset
|
1759 |
! |
dd029fea485d
added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents:
2562
diff
changeset
|
1760 |
|
2101 | 1761 |
canRemoveCVSContainer |
1762 |
^ [ |cvsDir| |
|
1763 |
||
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1764 |
currentDirectory notNil |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1765 |
and:[fileListView selection size > 0 |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1766 |
and:[(cvsDir := currentDirectory construct:'CVS') exists |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1767 |
and:[cvsDir isDirectory]]]] |
2101 | 1768 |
! |
1769 |
||
2368 | 1770 |
canRemoveFromClassPath |
1771 |
^ [ |f| |
|
1772 |
||
1773 |
(Java isNil or:[Java isLoaded not]) ifTrue:[ |
|
1774 |
false |
|
1775 |
] ifFalse:[ |
|
1776 |
f := self singleSelectedFileOrCurrentDirectory. |
|
1777 |
f notNil |
|
1778 |
and:[(Java classPath includes:f pathName) |
|
1779 |
and:[f isDirectory |
|
1780 |
or:[(f hasSuffix:'jar') |
|
1781 |
or:[(f hasSuffix:'zip')]]]] |
|
1782 |
] |
|
1783 |
] |
|
1784 |
||
1785 |
"Modified: / 1.2.1999 / 20:39:25 / cg" |
|
1786 |
! |
|
1787 |
||
1788 |
canRemoveFromSourcePath |
|
1789 |
^ [ |f| |
|
1790 |
||
1791 |
(Java isNil or:[Java isLoaded not]) ifTrue:[ |
|
1792 |
false |
|
1793 |
] ifFalse:[ |
|
1794 |
f := self singleSelectedFileOrCurrentDirectory. |
|
1795 |
f notNil |
|
2438 | 1796 |
and:[(Java sourcePath isNil |
1797 |
or:[(Java sourcePath includes:f pathName)]) |
|
2368 | 1798 |
and:[f isDirectory |
1799 |
or:[(f hasSuffix:'jar') |
|
1800 |
or:[(f hasSuffix:'zip')]]]] |
|
1801 |
] |
|
1893
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
1802 |
] |
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
1803 |
|
1989 | 1804 |
"Modified: / 1.2.1999 / 20:39:25 / cg" |
1893
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
1805 |
! |
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
1806 |
|
1834 | 1807 |
currentDirectoryIsNotTop |
1808 |
^ [currentDirectory notNil and:[currentDirectory isRootDirectory not]] |
|
1809 |
||
1810 |
"Modified: / 4.8.1998 / 14:10:57 / cg" |
|
1811 |
"Created: / 14.8.1998 / 12:07:10 / cg" |
|
1812 |
! |
|
1813 |
||
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1814 |
dosEOLMode |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1815 |
^ dosEOLMode |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1816 |
|
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1817 |
"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
|
1818 |
"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
|
1819 |
! |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1820 |
|
2185 | 1821 |
hasASN1 |
1822 |
^ [ OSI::ASN1Parser notNil |
|
1823 |
and:[OSI::ASN1Parser isLoaded]] |
|
1824 |
||
1825 |
! |
|
1826 |
||
1827 |
hasASN1AndSelection |
|
1828 |
^ [ fileListView selection size > 0 |
|
1829 |
and:[OSI::ASN1Parser notNil |
|
1830 |
and:[OSI::ASN1Parser isLoaded]]] |
|
1831 |
! |
|
1832 |
||
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1833 |
hasBookmarks |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1834 |
^ DirectoryBookmarks size > 0 |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1835 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1836 |
"Created: / 14.8.1998 / 19:17:02 / cg" |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1837 |
"Modified: / 14.8.1998 / 19:17:17 / cg" |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1838 |
! |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1839 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1840 |
hasBookmarksToRemove |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1841 |
^ DirectoryBookmarks size > 0 |
3747
d30bc1e54f15
Remove unused vars and asFilename sends
Stefan Vogel <sv@exept.de>
parents:
3746
diff
changeset
|
1842 |
and:[ DirectoryBookmarks includes:(currentDirectory pathName) ] |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1843 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1844 |
"Created: / 14.8.1998 / 19:17:02 / cg" |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1845 |
"Modified: / 14.8.1998 / 19:17:17 / cg" |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1846 |
! |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1847 |
|
2814 | 1848 |
hasCBrowser |
3767 | 1849 |
^ [ CBrowser::Browser notNil ] |
2814 | 1850 |
! |
1851 |
||
1994 | 1852 |
hasFilenameSelectionInCodeView |
1853 |
^ [ |val sel| |
|
1854 |
||
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1855 |
val := false. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1856 |
sel := subView selection. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1857 |
sel notNil ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1858 |
sel := sel asString withoutSeparators. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1859 |
sel asFilename exists ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1860 |
val := sel asFilename isReadable |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1861 |
] |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1862 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1863 |
val |
1994 | 1864 |
] |
1865 |
||
1866 |
"Created: / 4.2.1999 / 17:34:57 / cg" |
|
1867 |
"Modified: / 4.2.1999 / 17:39:32 / cg" |
|
1868 |
! |
|
1869 |
||
1942 | 1870 |
hasJava |
1871 |
^ [ JavaClassReader notNil |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1872 |
and:[JavaClassReader isLoaded]] |
1942 | 1873 |
|
1874 |
"Modified: / 17.10.1998 / 16:57:14 / cg" |
|
1875 |
"Created: / 17.10.1998 / 22:58:25 / cg" |
|
1876 |
! |
|
1877 |
||
1878 |
hasJavaAndSelection |
|
1879 |
^ [ fileListView selection size > 0 |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1880 |
and:[JavaClassReader notNil |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1881 |
and:[JavaClassReader isLoaded]]] |
1942 | 1882 |
|
1883 |
"Modified: / 17.10.1998 / 16:57:14 / cg" |
|
1884 |
"Created: / 17.10.1998 / 22:58:03 / cg" |
|
1885 |
! |
|
1886 |
||
3001 | 1887 |
hasMP3Player |
1888 |
^ [ MP3PlayerApplication notNil |
|
1889 |
or:[SaugFix::MP3PlayerApplication notNil ]] |
|
1890 |
! |
|
1891 |
||
1892 |
hasMP3PlayerAndSelection |
|
1893 |
^ [ fileListView selection size > 0 |
|
1894 |
and:[ self hasMP3Player value]] |
|
1895 |
! |
|
1896 |
||
1834 | 1897 |
hasSelection |
1898 |
^ [fileListView selection size > 0] |
|
1899 |
||
1900 |
"Created: / 4.8.1998 / 14:10:31 / cg" |
|
1901 |
"Modified: / 4.8.1998 / 14:10:57 / cg" |
|
1902 |
! |
|
1903 |
||
2825
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1904 |
hasSnapshotSelection |
3627 | 1905 |
^ [ |fn| |
1906 |
||
2825
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1907 |
(fileListView selection size == 1) |
3627 | 1908 |
and:[ ((fn := fileListView selectionValue first string withoutSeparators asFilename) hasSuffix:'img') |
1909 |
or:[fn hasSuffix:'sav'] ] |
|
2825
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1910 |
] |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1911 |
|
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1912 |
"Created: / 4.8.1998 / 14:10:31 / cg" |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1913 |
"Modified: / 4.8.1998 / 14:10:57 / cg" |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1914 |
! |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1915 |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1916 |
hasVisitHistory |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1917 |
^ [DirectoryHistory size > 0] |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1918 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1919 |
"Created: / 14.8.1998 / 19:17:02 / cg" |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1920 |
"Modified: / 14.8.1998 / 19:17:17 / cg" |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1921 |
! |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1922 |
|
1853 | 1923 |
hasZipFileSelected |
1988 | 1924 |
^ [|sel f fn suff| |
1925 |
||
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1926 |
sel := fileListView selection. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1927 |
sel size == 1 ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1928 |
f := fileList at:sel first ifAbsent:nil. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1929 |
f notNil ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1930 |
suff := f asFilename suffix asLowercase. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1931 |
suff = 'zip' or:[suff = 'jar'] |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1932 |
] ifFalse:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1933 |
false |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1934 |
] |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1935 |
] ifFalse:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1936 |
false |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1937 |
] |
1853 | 1938 |
] |
1939 |
||
1940 |
"Created: / 26.8.1998 / 16:15:26 / cg" |
|
1988 | 1941 |
"Modified: / 30.1.1999 / 19:05:59 / cg" |
1853 | 1942 |
! |
1943 |
||
1893
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
1944 |
javaSupportLoaded |
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
1945 |
^ [ JavaClassReader notNil |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1946 |
and:[JavaClassReader isLoaded]] |
1893
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
1947 |
|
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
1948 |
"Created: / 9.11.1998 / 05:33:17 / cg" |
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
1949 |
! |
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
1950 |
|
2031 | 1951 |
showingBigImagePreview |
1952 |
^ showingBigImagePreview |
|
1953 |
||
1954 |
"Created: / 14.8.1998 / 14:15:44 / cg" |
|
1955 |
! |
|
1956 |
||
1834 | 1957 |
showingDetails |
1958 |
^ showingDetails |
|
1959 |
||
1960 |
"Created: / 14.8.1998 / 14:15:15 / cg" |
|
1961 |
! |
|
1962 |
||
1963 |
showingHiddenFiles |
|
1964 |
^ showingHiddenFiles |
|
1965 |
||
1966 |
"Created: / 14.8.1998 / 14:15:44 / cg" |
|
1967 |
! |
|
1968 |
||
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1969 |
showingTimeAndDate |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1970 |
^ showingTimeAndDate |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1971 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1972 |
"Created: / 14.8.1998 / 14:15:44 / cg" |
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 |
|
2567
dd029fea485d
added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents:
2562
diff
changeset
|
1975 |
singleSelectedFile |
dd029fea485d
added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents:
2562
diff
changeset
|
1976 |
|f sel| |
dd029fea485d
added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents:
2562
diff
changeset
|
1977 |
|
dd029fea485d
added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents:
2562
diff
changeset
|
1978 |
sel := fileListView selection. |
dd029fea485d
added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents:
2562
diff
changeset
|
1979 |
sel size ~~ 1 ifTrue:[ |
dd029fea485d
added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents:
2562
diff
changeset
|
1980 |
^ nil |
dd029fea485d
added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents:
2562
diff
changeset
|
1981 |
]. |
dd029fea485d
added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents:
2562
diff
changeset
|
1982 |
f := fileList at:sel first ifAbsent:nil. |
dd029fea485d
added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents:
2562
diff
changeset
|
1983 |
f notNil ifTrue:[ |
3747
d30bc1e54f15
Remove unused vars and asFilename sends
Stefan Vogel <sv@exept.de>
parents:
3746
diff
changeset
|
1984 |
^ currentDirectory construct:f |
2567
dd029fea485d
added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents:
2562
diff
changeset
|
1985 |
]. |
dd029fea485d
added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents:
2562
diff
changeset
|
1986 |
^ nil |
dd029fea485d
added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents:
2562
diff
changeset
|
1987 |
|
dd029fea485d
added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents:
2562
diff
changeset
|
1988 |
"Created: / 29.1.2000 / 13:09:09 / cg" |
dd029fea485d
added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents:
2562
diff
changeset
|
1989 |
! |
dd029fea485d
added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents:
2562
diff
changeset
|
1990 |
|
2368 | 1991 |
singleSelectedFileOrCurrentDirectory |
1992 |
|f sel| |
|
1993 |
||
1994 |
sel := fileListView selection. |
|
1995 |
sel size > 1 ifTrue:[ |
|
1996 |
^ nil |
|
1997 |
]. |
|
1998 |
sel size == 0 ifTrue:[ |
|
3747
d30bc1e54f15
Remove unused vars and asFilename sends
Stefan Vogel <sv@exept.de>
parents:
3746
diff
changeset
|
1999 |
^ currentDirectory |
2368 | 2000 |
]. |
2001 |
f := fileList at:sel first ifAbsent:nil. |
|
2002 |
f notNil ifTrue:[ |
|
3747
d30bc1e54f15
Remove unused vars and asFilename sends
Stefan Vogel <sv@exept.de>
parents:
3746
diff
changeset
|
2003 |
^ currentDirectory construct:f |
2368 | 2004 |
]. |
2005 |
^ nil |
|
2006 |
! |
|
2007 |
||
1834 | 2008 |
sortByWhat |
2009 |
^ sortByWhat |
|
2010 |
||
2011 |
"Created: / 14.8.1998 / 15:55:18 / cg" |
|
2012 |
"Modified: / 14.8.1998 / 15:56:08 / cg" |
|
2013 |
! |
|
2014 |
||
2015 |
sortCaseless |
|
2016 |
^ sortCaseless |
|
2017 |
||
2018 |
"Created: / 14.8.1998 / 14:21:21 / cg" |
|
2019 |
! |
|
2020 |
||
2021 |
systemIsDOS |
|
2022 |
^ OperatingSystem isMSDOSlike |
|
2023 |
||
2024 |
"Created: / 4.8.1998 / 13:37:28 / cg" |
|
2025 |
! |
|
2026 |
||
2027 |
systemIsUnix |
|
2028 |
^ OperatingSystem isUNIXlike |
|
2029 |
||
2030 |
"Created: / 4.8.1998 / 13:37:13 / cg" |
|
2031 |
! |
|
2032 |
||
2033 |
systemIsVMS |
|
2034 |
^ OperatingSystem isVMSlike |
|
2035 |
||
2036 |
"Created: / 4.8.1998 / 13:37:37 / cg" |
|
2037 |
! ! |
|
2038 |
||
1119 | 2039 |
!FileBrowser methodsFor:'drag & drop'! |
172 | 2040 |
|
1132
bd2eda432e1d
drop arg is always a collection
Claus Gittinger <cg@exept.de>
parents:
1124
diff
changeset
|
2041 |
canDrop:aCollectionOfDropObjects |
1119 | 2042 |
"I accept fileObjects only" |
2043 |
||
1132
bd2eda432e1d
drop arg is always a collection
Claus Gittinger <cg@exept.de>
parents:
1124
diff
changeset
|
2044 |
aCollectionOfDropObjects do:[:aDropObject | |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2045 |
aDropObject isFileObject ifFalse:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2046 |
aDropObject isTextObject ifFalse:[^ false]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2047 |
] |
1122
970fc7e88639
support drag out of my list.
Claus Gittinger <cg@exept.de>
parents:
1120
diff
changeset
|
2048 |
]. |
1132
bd2eda432e1d
drop arg is always a collection
Claus Gittinger <cg@exept.de>
parents:
1124
diff
changeset
|
2049 |
^ true |
bd2eda432e1d
drop arg is always a collection
Claus Gittinger <cg@exept.de>
parents:
1124
diff
changeset
|
2050 |
|
bd2eda432e1d
drop arg is always a collection
Claus Gittinger <cg@exept.de>
parents:
1124
diff
changeset
|
2051 |
"Modified: 11.4.1997 / 12:41:59 / cg" |
1118 | 2052 |
! |
2053 |
||
1132
bd2eda432e1d
drop arg is always a collection
Claus Gittinger <cg@exept.de>
parents:
1124
diff
changeset
|
2054 |
drop:aCollectionOfDropObjects at:aPoint |
1122
970fc7e88639
support drag out of my list.
Claus Gittinger <cg@exept.de>
parents:
1120
diff
changeset
|
2055 |
"handle drops" |
970fc7e88639
support drag out of my list.
Claus Gittinger <cg@exept.de>
parents:
1120
diff
changeset
|
2056 |
|
3061 | 2057 |
"/ for now ... only allow single drop |
2058 |
aCollectionOfDropObjects size > 1 ifTrue:[ |
|
2059 |
(self confirm:'Drop the last file only ?') ifFalse:[ |
|
2060 |
^ self |
|
2061 |
]. |
|
2062 |
self dropSingleObject:aCollectionOfDropObjects first at:aPoint. |
|
2063 |
^ self |
|
2064 |
]. |
|
3045 | 2065 |
|
1132
bd2eda432e1d
drop arg is always a collection
Claus Gittinger <cg@exept.de>
parents:
1124
diff
changeset
|
2066 |
aCollectionOfDropObjects do:[:aDropObject | |
3045 | 2067 |
self dropSingleObject:aDropObject at:aPoint |
1132
bd2eda432e1d
drop arg is always a collection
Claus Gittinger <cg@exept.de>
parents:
1124
diff
changeset
|
2068 |
] |
bd2eda432e1d
drop arg is always a collection
Claus Gittinger <cg@exept.de>
parents:
1124
diff
changeset
|
2069 |
|
bd2eda432e1d
drop arg is always a collection
Claus Gittinger <cg@exept.de>
parents:
1124
diff
changeset
|
2070 |
"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
|
2071 |
! |
970fc7e88639
support drag out of my list.
Claus Gittinger <cg@exept.de>
parents:
1120
diff
changeset
|
2072 |
|
970fc7e88639
support drag out of my list.
Claus Gittinger <cg@exept.de>
parents:
1120
diff
changeset
|
2073 |
dropSingleObject:someObject at:aPoint |
1119 | 2074 |
"handle drops; if its a directory, change to it. |
1124 | 2075 |
If its a file, change to its directory and select the file. |
2076 |
If its text, paste it into the codeView." |
|
1119 | 2077 |
|
1122
970fc7e88639
support drag out of my list.
Claus Gittinger <cg@exept.de>
parents:
1120
diff
changeset
|
2078 |
|newDir newFile| |
970fc7e88639
support drag out of my list.
Claus Gittinger <cg@exept.de>
parents:
1120
diff
changeset
|
2079 |
|
1124 | 2080 |
someObject isFileObject ifTrue:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2081 |
someObject isDirectory ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2082 |
newDir := someObject theObject pathName. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2083 |
] ifFalse:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2084 |
newDir := someObject theObject directoryName. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2085 |
newFile := someObject theObject baseName. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2086 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2087 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2088 |
newDir notNil ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2089 |
newDir ~= currentDirectory pathName ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2090 |
self changeDirectoryTo:newDir. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2091 |
] |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2092 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2093 |
newFile notNil ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2094 |
newFile ~= currentFileName ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2095 |
fileListView selection:(fileList indexOf:newFile). |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2096 |
self doFileGet:false. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2097 |
] |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2098 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2099 |
^ self |
1122
970fc7e88639
support drag out of my list.
Claus Gittinger <cg@exept.de>
parents:
1120
diff
changeset
|
2100 |
]. |
970fc7e88639
support drag out of my list.
Claus Gittinger <cg@exept.de>
parents:
1120
diff
changeset
|
2101 |
|
1124 | 2102 |
someObject isTextObject ifTrue:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2103 |
subView paste:someObject theObject. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2104 |
^ self |
1118 | 2105 |
]. |
1124 | 2106 |
|
2107 |
"Modified: 6.4.1997 / 14:46:44 / cg" |
|
1119 | 2108 |
! ! |
2109 |
||
2110 |
!FileBrowser methodsFor:'events'! |
|
1118 | 2111 |
|
1010 | 2112 |
handlesKeyPress:key inView:view |
2113 |
"this method is reached via delegation: are we prepared to handle |
|
2114 |
a keyPress in some other view ?" |
|
2115 |
||
2669
677ca47d8d11
cursor-right --> change to previous directory
Claus Gittinger <cg@exept.de>
parents:
2666
diff
changeset
|
2116 |
<resource: #keyboard (#GotoLine #InspectIt #CmdI #Cmdu |
677ca47d8d11
cursor-right --> change to previous directory
Claus Gittinger <cg@exept.de>
parents:
2666
diff
changeset
|
2117 |
#DoIt #Delete #BackSpace #Accept #CmdF #CmdD |
677ca47d8d11
cursor-right --> change to previous directory
Claus Gittinger <cg@exept.de>
parents:
2666
diff
changeset
|
2118 |
#CursorLeft #CursorRight |
677ca47d8d11
cursor-right --> change to previous directory
Claus Gittinger <cg@exept.de>
parents:
2666
diff
changeset
|
2119 |
)> |
1010 | 2120 |
|
2121 |
view == fileListView ifTrue:[ |
|
2543 | 2122 |
(key == #Delete |
2123 |
or:[key == #BackSpace |
|
2124 |
or:[key == #Accept |
|
2125 |
or:[key == #CmdI |
|
2126 |
or:[key == #CmdF |
|
2127 |
or:[key == #CmdD |
|
2128 |
or:[key == #Cmdu |
|
2129 |
or:[key == #Cut |
|
2130 |
or:[key == #Cmdr |
|
2131 |
or:[key == #Replace |
|
2132 |
or:[key == #InspectIt |
|
2133 |
or:[key == #GotoLine |
|
2665
3601bc8c5ae2
cursorLeft - change to parent dir
Claus Gittinger <cg@exept.de>
parents:
2640
diff
changeset
|
2134 |
or:[key == #CursorLeft |
2669
677ca47d8d11
cursor-right --> change to previous directory
Claus Gittinger <cg@exept.de>
parents:
2666
diff
changeset
|
2135 |
or:[key == #CursorRight |
677ca47d8d11
cursor-right --> change to previous directory
Claus Gittinger <cg@exept.de>
parents:
2666
diff
changeset
|
2136 |
or:[key == #DoIt]]]]]]]]]]]]]]) ifTrue:[^ true]. |
1010 | 2137 |
]. |
2138 |
^ false |
|
2139 |
||
1396 | 2140 |
"Created: / 28.1.1997 / 14:03:20 / stefan" |
2141 |
"Modified: / 20.6.1997 / 16:35:01 / cg" |
|
2142 |
"Modified: / 16.1.1998 / 16:50:39 / stefan" |
|
1010 | 2143 |
! |
2144 |
||
2145 |
keyPress:key x:x y:y view:view |
|
2146 |
"this method is reached via delegation from the fileListView" |
|
2147 |
||
2543 | 2148 |
<resource: #keyboard (#GotoLine #InspectIt |
2149 |
#CmdI #Cmdu #DoIt #Delete #BackSpace #Accept |
|
2669
677ca47d8d11
cursor-right --> change to previous directory
Claus Gittinger <cg@exept.de>
parents:
2666
diff
changeset
|
2150 |
#Cmdr #Cut #CursorLeft #CursorRight)> |
2543 | 2151 |
|
2152 |
(key == #Delete |
|
2153 |
or:[key == #Cut |
|
2154 |
or:[key == #BackSpace]]) ifTrue:[ |
|
2155 |
self fileRemove. |
|
2156 |
^ self |
|
1010 | 2157 |
]. |
2158 |
(key == #Accept) ifTrue:[ |
|
2543 | 2159 |
self fileFileIn. |
2160 |
^ self |
|
1010 | 2161 |
]. |
2162 |
(key == #GotoLine) ifTrue:[ |
|
2543 | 2163 |
self fileGet. |
2164 |
^ self |
|
1010 | 2165 |
]. |
2166 |
(key == #DoIt) ifTrue:[ |
|
2543 | 2167 |
self fileExecute. |
2168 |
^ self |
|
1010 | 2169 |
]. |
2170 |
(key == #InspectIt) ifTrue:[ |
|
2543 | 2171 |
self fileGetInfo. |
2172 |
^ self |
|
1010 | 2173 |
]. |
2174 |
(key == #CmdI) ifTrue:[ |
|
2543 | 2175 |
self fileGetLongInfo. |
2176 |
^ self |
|
1010 | 2177 |
]. |
2178 |
(key == #Cmdu) ifTrue:[ |
|
2543 | 2179 |
self updateCurrentDirectory. |
2180 |
^ self |
|
1396 | 2181 |
]. |
2182 |
(key == #CmdF) ifTrue:[ |
|
2543 | 2183 |
self newFile. |
2184 |
^ self |
|
1396 | 2185 |
]. |
2186 |
(key == #CmdD) ifTrue:[ |
|
2543 | 2187 |
self newDirectory. |
2188 |
^ self |
|
2189 |
]. |
|
2190 |
((key == #Cmdr) or:[key == #Replace]) ifTrue:[ |
|
2191 |
self fileRename. |
|
2192 |
^ self |
|
1010 | 2193 |
]. |
2665
3601bc8c5ae2
cursorLeft - change to parent dir
Claus Gittinger <cg@exept.de>
parents:
2640
diff
changeset
|
2194 |
(key == #CursorLeft) ifTrue:[ |
3601bc8c5ae2
cursorLeft - change to parent dir
Claus Gittinger <cg@exept.de>
parents:
2640
diff
changeset
|
2195 |
self changeToParentDirectory. |
3601bc8c5ae2
cursorLeft - change to parent dir
Claus Gittinger <cg@exept.de>
parents:
2640
diff
changeset
|
2196 |
^ self |
3601bc8c5ae2
cursorLeft - change to parent dir
Claus Gittinger <cg@exept.de>
parents:
2640
diff
changeset
|
2197 |
]. |
2669
677ca47d8d11
cursor-right --> change to previous directory
Claus Gittinger <cg@exept.de>
parents:
2666
diff
changeset
|
2198 |
(key == #CursorRight) ifTrue:[ |
677ca47d8d11
cursor-right --> change to previous directory
Claus Gittinger <cg@exept.de>
parents:
2666
diff
changeset
|
2199 |
self changeToPreviousDirectory. |
677ca47d8d11
cursor-right --> change to previous directory
Claus Gittinger <cg@exept.de>
parents:
2666
diff
changeset
|
2200 |
^ self |
677ca47d8d11
cursor-right --> change to previous directory
Claus Gittinger <cg@exept.de>
parents:
2666
diff
changeset
|
2201 |
]. |
1010 | 2202 |
fileListView keyPress:key x:x y:y |
2203 |
||
1396 | 2204 |
"Created: / 28.1.1997 / 14:03:56 / stefan" |
2205 |
"Modified: / 20.6.1997 / 16:35:08 / cg" |
|
2206 |
"Modified: / 16.1.1998 / 16:51:38 / stefan" |
|
1010 | 2207 |
! |
2208 |
||
172 | 2209 |
mapped |
2210 |
super mapped. |
|
2211 |
" |
|
2212 |
whant to know about changed history |
|
2213 |
" |
|
2214 |
self updateCurrentDirectory |
|
2215 |
! |
|
2216 |
||
2217 |
visibilityChange:how |
|
2218 |
|wasVisible| |
|
2219 |
||
2220 |
wasVisible := shown. |
|
2221 |
super visibilityChange:how. |
|
2222 |
(wasVisible not and:[shown]) ifTrue:[ |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2223 |
" |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2224 |
start checking again |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2225 |
" |
3520
83cf11e1bf32
schedule checkBlock for the right process
Claus Gittinger <cg@exept.de>
parents:
3503
diff
changeset
|
2226 |
self scheduleCheckBlock. |
172 | 2227 |
] |
1481 | 2228 |
|
2229 |
"Modified: / 18.2.1998 / 17:57:44 / cg" |
|
172 | 2230 |
! ! |
2231 |
||
2232 |
!FileBrowser methodsFor:'fileList user interaction'! |
|
2233 |
||
2031 | 2234 |
bigImagePreviewSettingChanged |
2235 |
"invoked, when big image preview flag changed" |
|
2236 |
||
2237 |
|fh| |
|
2238 |
||
2239 |
(showingBigImagePreview value == true |
|
2240 |
and:[showingDetails value == true]) ifTrue:[ |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2241 |
fh := fileListView font height. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2242 |
fileListView lineSpacing:(34 - fh max:0). |
2031 | 2243 |
] ifFalse:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2244 |
fileListView clear. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2245 |
self updateCurrentDirectory. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2246 |
fileListView lineSpacing:2. |
2031 | 2247 |
]. |
2248 |
fileListView clear. |
|
2249 |
self updateCurrentDirectory |
|
2250 |
||
2251 |
"Modified: / 4.8.1998 / 13:43:54 / cg" |
|
2252 |
"Created: / 14.8.1998 / 14:17:49 / cg" |
|
2253 |
! |
|
2254 |
||
172 | 2255 |
changeDisplayMode |
2256 |
"toggle from long to short listing (and vice-versa)" |
|
2257 |
||
1834 | 2258 |
showingDetails value:(showingDetails value not). |
2259 |
"/ showLongList := showLongList not. |
|
1156
f3df28086973
dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents:
1154
diff
changeset
|
2260 |
self showOrHideTabView. |
172 | 2261 |
self updateCurrentDirectory |
747 | 2262 |
|
1834 | 2263 |
"Modified: / 4.8.1998 / 13:43:54 / cg" |
172 | 2264 |
! |
2265 |
||
2266 |
changeDotFileVisibility |
|
2267 |
"turn on/off visibility of files whose name starts with '.'" |
|
2268 |
||
1834 | 2269 |
showingHiddenFiles value:(showingHiddenFiles value not). |
2270 |
"/ showDotFiles := showDotFiles not. |
|
172 | 2271 |
self updateCurrentDirectory |
1834 | 2272 |
|
2273 |
"Modified: / 4.8.1998 / 13:45:46 / cg" |
|
2274 |
! |
|
2275 |
||
3281 | 2276 |
confirmAndRemove:fileNames |
2277 |
"remove fileNames with user confirmation. |
|
2278 |
TODO: Should be enhanced, to look for a ~/.trash directory |
|
2279 |
and move files there if it exists (without asking in this case)." |
|
2280 |
||
2281 |
|q doRemove| |
|
2282 |
||
2283 |
"/ do not ask, if shift is pressed |
|
2284 |
fileNames size > 1 ifTrue:[ |
|
2285 |
q := resources string:'Remove %1 selected files ?' with:(fileNames size). |
|
2286 |
doRemove := Dialog |
|
2287 |
confirmWithCancel:q |
|
2288 |
labels:(resources array:#('Cancel' 'Confirm Each' 'Remove')) |
|
2289 |
values:#(false #confirm true) |
|
2290 |
default:3. |
|
2291 |
doRemove isNil ifTrue:[^ self]. |
|
2292 |
doRemove == #confirm ifTrue:[ |
|
2293 |
fileNames do:[:eachFileName | |
|
2294 |
self confirmAndRemove:(Array with:eachFileName). |
|
2295 |
]. |
|
2296 |
^ self. |
|
2297 |
]. |
|
2298 |
] ifFalse:[ |
|
2299 |
q := resources string:'Remove ''%1'' ?' with:(fileNames first allBold). |
|
2300 |
doRemove := self ask:q yesButton:'Remove'. |
|
2301 |
]. |
|
2302 |
||
2303 |
doRemove ifTrue:[ |
|
2304 |
self doRemove:fileNames |
|
2305 |
] |
|
2306 |
! |
|
2307 |
||
1834 | 2308 |
detailsSettingChanged |
2309 |
"invoked, when detail (i.e. long / short) listing flag changed" |
|
2310 |
||
2311 |
self showOrHideTabView. |
|
2031 | 2312 |
self bigImagePreviewSettingChanged |
1834 | 2313 |
|
2314 |
"Modified: / 4.8.1998 / 13:43:54 / cg" |
|
2315 |
"Created: / 14.8.1998 / 14:17:49 / cg" |
|
172 | 2316 |
! |
2317 |
||
1327 | 2318 |
fileDoubleClick:lineNr |
2319 |
"double click on a file - get its contents" |
|
2320 |
||
2321 |
self fileSelect:lineNr. |
|
2322 |
self fileGet:true |
|
2323 |
! |
|
2324 |
||
386
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
2325 |
fileEncoding |
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
2326 |
"open a dialog to allow change of the files character encoding. |
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
2327 |
Files are converted to internal encoding when read, and converted back |
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
2328 |
to this encoding when saved. |
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
2329 |
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
|
2330 |
the internal encoding (which is iso8859). |
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
2331 |
Notice: currently, not too many encodings are supported by the system." |
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
2332 |
|
495
6d6a6b8feb2b
ask characterArray for encodings
Claus Gittinger <cg@exept.de>
parents:
488
diff
changeset
|
2333 |
|dialog list descr encodings encodingNames idx| |
386
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
2334 |
|
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
2335 |
list := SelectionInList new. |
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
2336 |
|
495
6d6a6b8feb2b
ask characterArray for encodings
Claus Gittinger <cg@exept.de>
parents:
488
diff
changeset
|
2337 |
descr := CharacterArray supportedExternalEncodings. |
6d6a6b8feb2b
ask characterArray for encodings
Claus Gittinger <cg@exept.de>
parents:
488
diff
changeset
|
2338 |
encodings := descr at:2. |
6d6a6b8feb2b
ask characterArray for encodings
Claus Gittinger <cg@exept.de>
parents:
488
diff
changeset
|
2339 |
encodingNames := descr at:1. |
6d6a6b8feb2b
ask characterArray for encodings
Claus Gittinger <cg@exept.de>
parents:
488
diff
changeset
|
2340 |
|
6d6a6b8feb2b
ask characterArray for encodings
Claus Gittinger <cg@exept.de>
parents:
488
diff
changeset
|
2341 |
list list:encodingNames. |
386
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
2342 |
list selectionIndex:(encodings indexOf:fileEncoding ifAbsent:1). |
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
2343 |
|
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
2344 |
dialog := Dialog new. |
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
2345 |
|
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
2346 |
dialog addTextLabel:(resources string:'ENCODING_MSG') withCRs. |
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
2347 |
dialog addVerticalSpace. |
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
2348 |
dialog addListBoxOn:list withNumberOfLines:5. |
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
2349 |
|
2048 | 2350 |
dialog addAbortAndOkButtons. |
386
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
2351 |
dialog open. |
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
2352 |
|
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
2353 |
dialog accepted ifTrue:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2354 |
idx := list selectionIndex. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2355 |
fileEncoding := encodings at:idx. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2356 |
subView externalEncoding:fileEncoding. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2357 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2358 |
self validateFontEncodingFor:fileEncoding ask:true. |
386
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
2359 |
]. |
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
2360 |
|
1219 | 2361 |
"Modified: 30.6.1997 / 14:41:12 / cg" |
386
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
2362 |
! |
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
2363 |
|
172 | 2364 |
fileExecute |
2365 |
"if text was modified show a queryBox, |
|
2366 |
otherwise pop up execute box immediately" |
|
2367 |
||
1142
9066d7d02a3a
remember last executed command per suffix; offer this as default.
Claus Gittinger <cg@exept.de>
parents:
1141
diff
changeset
|
2368 |
|action sel fileName| |
172 | 2369 |
|
2370 |
" |
|
2371 |
this replaces everything by the commands output ... |
|
2372 |
" |
|
865
48395e8ecca9
remember executeCommand actions in history as well.
Claus Gittinger <cg@exept.de>
parents:
851
diff
changeset
|
2373 |
action := [:command | |
3252 | 2374 |
self class addToCommandHistory:command for:fileName. |
2375 |
self doExecuteCommand:command replace:true |
|
2376 |
]. |
|
2377 |
||
2378 |
(self askIfModified:'Contents has not been saved.\\Modifications will be lost when command is executed.' |
|
2379 |
yesButton:'Execute') ifFalse:[^ self]. |
|
172 | 2380 |
|
2381 |
"/ " |
|
2382 |
"/ this inserts the commands output ... |
|
2383 |
"/ " |
|
2384 |
"/ action := [:command| self doExecuteCommand:command replace:false]. |
|
2385 |
"/ |
|
1142
9066d7d02a3a
remember last executed command per suffix; offer this as default.
Claus Gittinger <cg@exept.de>
parents:
1141
diff
changeset
|
2386 |
|
9066d7d02a3a
remember last executed command per suffix; offer this as default.
Claus Gittinger <cg@exept.de>
parents:
1141
diff
changeset
|
2387 |
sel := fileListView selection. |
9066d7d02a3a
remember last executed command per suffix; offer this as default.
Claus Gittinger <cg@exept.de>
parents:
1141
diff
changeset
|
2388 |
sel size == 1 ifTrue:[ |
3252 | 2389 |
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
|
2390 |
]. |
9066d7d02a3a
remember last executed command per suffix; offer this as default.
Claus Gittinger <cg@exept.de>
parents:
1141
diff
changeset
|
2391 |
self askForCommandFor:fileName thenDo:action |
865
48395e8ecca9
remember executeCommand actions in history as well.
Claus Gittinger <cg@exept.de>
parents:
851
diff
changeset
|
2392 |
|
48395e8ecca9
remember executeCommand actions in history as well.
Claus Gittinger <cg@exept.de>
parents:
851
diff
changeset
|
2393 |
"Modified: 14.11.1996 / 14:59:34 / cg" |
172 | 2394 |
! |
2395 |
||
2396 |
fileFileIn |
|
2397 |
"fileIn the selected file(s)" |
|
2398 |
||
2399 |
self fileFileInLazy:false |
|
2400 |
! |
|
2401 |
||
3766
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2402 |
fileFileIn:fileName lazy:lazy |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2403 |
"fileIn fileName" |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2404 |
|
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2405 |
|aStream path wasLazy prevCurrentFileName| |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2406 |
|
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2407 |
path := currentDirectory filenameFor:fileName. |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2408 |
path type == #regular ifTrue:[ |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2409 |
prevCurrentFileName := currentFileInFileName. |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2410 |
currentFileInFileName := fileName. |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2411 |
|
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2412 |
(ObjectFileLoader notNil |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2413 |
and:[ObjectFileLoader hasValidBinaryExtension:fileName]) ifTrue:[ |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2414 |
AbortOperationRequest catch:[ |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2415 |
|p| |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2416 |
|
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2417 |
"/ |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2418 |
"/ 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
|
2419 |
"/ |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2420 |
p := path pathName. |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2421 |
(ObjectFileLoader loadedObjectFiles includes:p) ifTrue:[ |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2422 |
(Dialog confirm:(resources |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2423 |
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
|
2424 |
with:p)) ifFalse:[ |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2425 |
^ self |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2426 |
]. |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2427 |
Transcript showCR:'unloading old ' , p , ' ...'. |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2428 |
ObjectFileLoader unloadObjectFile:p. |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2429 |
]. |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2430 |
|
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2431 |
Transcript showCR:'loading ' , p , ' ...'. |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2432 |
ObjectFileLoader loadObjectFile:p. |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2433 |
Class addInfoRecord:('fileIn ' , fileName) |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2434 |
] |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2435 |
] ifFalse:[ ((path hasSuffix:'cls') |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2436 |
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
|
2437 |
"/ loading a binary class file |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2438 |
aStream := path readStream. |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2439 |
aStream notNil ifTrue:[ |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2440 |
aStream fileInBinary. |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2441 |
] |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2442 |
] ifFalse:[ |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2443 |
((path hasSuffix:'class') |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2444 |
or:[(path hasSuffix:'cla')]) ifTrue:[ |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2445 |
"/ loading a java class file |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2446 |
JavaClassReader notNil ifTrue:[ |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2447 |
JavaClassReader loadFile:(path pathName) |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2448 |
] |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2449 |
] ifFalse:[ (path hasSuffix:'sif') ifTrue:[ |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2450 |
"/ 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
|
2451 |
SmalltalkInterchangeSTXFileInManager autoload. |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2452 |
SmalltalkInterchangeFileManager newForFileIn |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2453 |
fileName: path pathName; |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2454 |
fileIn. |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2455 |
] ifFalse:[ (path hasSuffix:'pcl') ifTrue:[ |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2456 |
Parcel isNil ifTrue:[ |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2457 |
self warn:'Parcel support not loaded.' |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2458 |
] ifFalse:[ |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2459 |
Parcel loadParcelFrom: path pathName |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2460 |
] |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2461 |
] ifFalse:[ |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2462 |
"/ 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
|
2463 |
aStream := path readStream. |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2464 |
aStream notNil ifTrue:[ |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2465 |
[ |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2466 |
Class withoutUpdatingChangesDo:[ |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2467 |
wasLazy := Compiler compileLazy:lazy. |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2468 |
aStream fileIn. |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2469 |
]. |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2470 |
Class addInfoRecord:('fileIn ' , fileName) |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2471 |
] ensure:[ |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2472 |
Compiler compileLazy:wasLazy. |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2473 |
aStream close |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2474 |
] |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2475 |
] |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2476 |
]]] |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2477 |
]] |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2478 |
]. |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2479 |
currentFileInFileName := prevCurrentFileName |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2480 |
|
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2481 |
"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
|
2482 |
"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
|
2483 |
! |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2484 |
|
172 | 2485 |
fileFileInLazy |
2486 |
"fileIn the selected file(s). Do a quick load (no compilation)" |
|
2487 |
||
2488 |
self fileFileInLazy:true |
|
2489 |
! |
|
2490 |
||
2491 |
fileFileInLazy:lazy |
|
2492 |
"fileIn the selected file(s)" |
|
2493 |
||
3766
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2494 |
|
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2495 |
fileListView selection size > 1 ifTrue:[ |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2496 |
AbortAllSignal catch:[ |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2497 |
self selectedFilesDo:[:fileName | |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2498 |
AbortSignal catch:[ |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2499 |
self fileFileIn:fileName lazy:lazy. |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2500 |
] |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2501 |
] |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2502 |
]. |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2503 |
^ self. |
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2504 |
]. |
172 | 2505 |
|
2506 |
self selectedFilesDo:[:fileName | |
|
3766
e32fe0b85f6b
allow cancelAll for fileIn with multiple selected files
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
2507 |
self fileFileIn:fileName lazy:lazy. |
172 | 2508 |
] |
2509 |
||
1702
962056a31c06
remember the current file during fileIn,
Claus Gittinger <cg@exept.de>
parents:
1700
diff
changeset
|
2510 |
"Modified: / 19.9.1997 / 23:42:22 / stefan" |
3436
c4fe19deba58
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3421
diff
changeset
|
2511 |
"Modified: / 16.11.2001 / 17:38:34 / cg" |
172 | 2512 |
! |
2513 |
||
3465
f52e089ca838
added fileIntoNameSpace menu item
Claus Gittinger <cg@exept.de>
parents:
3461
diff
changeset
|
2514 |
fileFileInToNameSpace |
f52e089ca838
added fileIntoNameSpace menu item
Claus Gittinger <cg@exept.de>
parents:
3461
diff
changeset
|
2515 |
"fileIn the selected file(s)<into a nameSpace" |
f52e089ca838
added fileIntoNameSpace menu item
Claus Gittinger <cg@exept.de>
parents:
3461
diff
changeset
|
2516 |
|
3786
2cc5b344133b
better box for fileIntoNameSpace
Claus Gittinger <cg@exept.de>
parents:
3767
diff
changeset
|
2517 |
|ns listOfKnownNameSpaces| |
2cc5b344133b
better box for fileIntoNameSpace
Claus Gittinger <cg@exept.de>
parents:
3767
diff
changeset
|
2518 |
|
2cc5b344133b
better box for fileIntoNameSpace
Claus Gittinger <cg@exept.de>
parents:
3767
diff
changeset
|
2519 |
listOfKnownNameSpaces := Set new. |
2cc5b344133b
better box for fileIntoNameSpace
Claus Gittinger <cg@exept.de>
parents:
3767
diff
changeset
|
2520 |
NameSpace |
2cc5b344133b
better box for fileIntoNameSpace
Claus Gittinger <cg@exept.de>
parents:
3767
diff
changeset
|
2521 |
allNamespaces |
2cc5b344133b
better box for fileIntoNameSpace
Claus Gittinger <cg@exept.de>
parents:
3767
diff
changeset
|
2522 |
do:[:eachNameSpace | |
2cc5b344133b
better box for fileIntoNameSpace
Claus Gittinger <cg@exept.de>
parents:
3767
diff
changeset
|
2523 |
listOfKnownNameSpaces add:eachNameSpace name |
2cc5b344133b
better box for fileIntoNameSpace
Claus Gittinger <cg@exept.de>
parents:
3767
diff
changeset
|
2524 |
]. |
2cc5b344133b
better box for fileIntoNameSpace
Claus Gittinger <cg@exept.de>
parents:
3767
diff
changeset
|
2525 |
listOfKnownNameSpaces := listOfKnownNameSpaces asOrderedCollection sort. |
2cc5b344133b
better box for fileIntoNameSpace
Claus Gittinger <cg@exept.de>
parents:
3767
diff
changeset
|
2526 |
|
2cc5b344133b
better box for fileIntoNameSpace
Claus Gittinger <cg@exept.de>
parents:
3767
diff
changeset
|
2527 |
ns := Dialog |
2cc5b344133b
better box for fileIntoNameSpace
Claus Gittinger <cg@exept.de>
parents:
3767
diff
changeset
|
2528 |
request:'During fileIn, new classes are created in nameSpace:' |
3789 | 2529 |
initialAnswer:(lastEnforcedNameSpace ? LastEnforcedNameSpace ? Class nameSpaceQuerySignal query name) |
3786
2cc5b344133b
better box for fileIntoNameSpace
Claus Gittinger <cg@exept.de>
parents:
3767
diff
changeset
|
2530 |
list:listOfKnownNameSpaces. |
2cc5b344133b
better box for fileIntoNameSpace
Claus Gittinger <cg@exept.de>
parents:
3767
diff
changeset
|
2531 |
ns isEmptyOrNil ifTrue:[^ self]. |
2cc5b344133b
better box for fileIntoNameSpace
Claus Gittinger <cg@exept.de>
parents:
3767
diff
changeset
|
2532 |
|
3789 | 2533 |
LastEnforcedNameSpace := lastEnforcedNameSpace := ns. |
3465
f52e089ca838
added fileIntoNameSpace menu item
Claus Gittinger <cg@exept.de>
parents:
3461
diff
changeset
|
2534 |
ns := NameSpace name:ns. |
3786
2cc5b344133b
better box for fileIntoNameSpace
Claus Gittinger <cg@exept.de>
parents:
3767
diff
changeset
|
2535 |
|
3465
f52e089ca838
added fileIntoNameSpace menu item
Claus Gittinger <cg@exept.de>
parents:
3461
diff
changeset
|
2536 |
Class nameSpaceQuerySignal |
f52e089ca838
added fileIntoNameSpace menu item
Claus Gittinger <cg@exept.de>
parents:
3461
diff
changeset
|
2537 |
answer:ns |
f52e089ca838
added fileIntoNameSpace menu item
Claus Gittinger <cg@exept.de>
parents:
3461
diff
changeset
|
2538 |
do:[ self fileFileInLazy:false ] |
f52e089ca838
added fileIntoNameSpace menu item
Claus Gittinger <cg@exept.de>
parents:
3461
diff
changeset
|
2539 |
! |
f52e089ca838
added fileIntoNameSpace menu item
Claus Gittinger <cg@exept.de>
parents:
3461
diff
changeset
|
2540 |
|
1972 | 2541 |
fileFindAllDuplicates |
2542 |
"scan directory and all subdirs for duplicate files" |
|
2543 |
||
2544 |
|fileNames dir infoDir filesBySize |
|
2545 |
result info dirPrefix| |
|
2546 |
||
2547 |
(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
|
2548 |
yesButton:'proceed') ifFalse:[^ self]. |
1972 | 2549 |
|
2550 |
self withWaitCursorDo:[ |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2551 |
result := Dictionary new. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2552 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2553 |
dir := currentDirectory asFilename. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2554 |
self label:myName , '- gathering file names ...'. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2555 |
fileNames := dir recursiveDirectoryContents. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2556 |
fileNames := fileNames collect:[:fn | dir construct:fn]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2557 |
fileNames := fileNames select:[:fn | fn isDirectory not]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2558 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2559 |
self label:myName , '- gathering sizes ...'. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2560 |
infoDir := Dictionary new. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2561 |
fileNames do:[:fn | |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2562 |
infoDir at:fn put:(fn fileSize) |
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 |
"/ for each, get the files size. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2566 |
"/ 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
|
2567 |
"/ compare them ... |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2568 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2569 |
self label:myName , '- preselect possible duplicates ...'. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2570 |
filesBySize := Dictionary new. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2571 |
infoDir keysAndValuesDo:[:fn :sz | |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2572 |
|entry| |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2573 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2574 |
entry := filesBySize at:sz ifAbsentPut:[Set new]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2575 |
entry add:fn. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2576 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2577 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2578 |
"/ any of same size ? |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2579 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2580 |
self label:myName , '- checking for duplicates ...'. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2581 |
filesBySize do:[:entry | |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2582 |
|files| |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2583 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2584 |
entry size > 1 ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2585 |
files := entry asArray. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2586 |
1 to:files size-1 do:[:idx1 | |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2587 |
idx1+1 to:files size do:[:idx2 | |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2588 |
|fn1 fn2| |
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 |
fn1 := files at:idx1. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2591 |
fn2 := files at:idx2. |
1972 | 2592 |
|
2593 |
"/ self label:myName , '- checking ' , fn1 baseName , ' vs. ' , fn2 baseName , ' ...'. |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2594 |
(result at:fn2 ifAbsent:nil) ~= fn1 ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2595 |
"/ compare the files |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2596 |
(fn1 sameContentsAs:fn2) ifTrue:[ |
1972 | 2597 |
"/ 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
|
2598 |
result at:fn1 put:fn2. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2599 |
] |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2600 |
] |
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 |
] |
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 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2606 |
self label:myName , '- sorting ...'. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2607 |
dirPrefix := currentDirectory asFilename pathName. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2608 |
result := result associations. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2609 |
result := result collect:[:assoc | |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2610 |
|f1 f2| |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2611 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2612 |
f1 := assoc key name. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2613 |
f2 := assoc value name. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2614 |
(f1 startsWith:dirPrefix) ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2615 |
f1 := f1 copyFrom:dirPrefix size + 2. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2616 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2617 |
(f2 startsWith:dirPrefix) ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2618 |
f2 := f2 copyFrom:dirPrefix size + 2. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2619 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2620 |
f1 < f2 ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2621 |
f2 -> f1 |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2622 |
] ifFalse:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2623 |
f1 -> f2 |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2624 |
] |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2625 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2626 |
result sort:[:f1 :f2 | f2 value < f1 value]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2627 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2628 |
info := OrderedCollection new. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2629 |
result do:[:assoc | |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2630 |
info add:(assoc key , ' same as ' , assoc value) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2631 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2632 |
info isEmpty ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2633 |
info := 'No duplicate files found.' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2634 |
]. |
1972 | 2635 |
]. |
2636 |
||
2637 |
subView contents:info. |
|
2638 |
self label:myName. |
|
2639 |
||
2640 |
"Created: / 28.11.1998 / 17:47:53 / cg" |
|
2641 |
"Modified: / 10.12.1998 / 17:13:14 / cg" |
|
2642 |
! |
|
2643 |
||
1911
6d1b77eda98f
check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents:
1903
diff
changeset
|
2644 |
fileFindDuplicates |
6d1b77eda98f
check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents:
1903
diff
changeset
|
2645 |
"scan directory for duplicate files" |
6d1b77eda98f
check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents:
1903
diff
changeset
|
2646 |
|
6d1b77eda98f
check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents:
1903
diff
changeset
|
2647 |
|fileNames dir infoDir filesBySize |
6d1b77eda98f
check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents:
1903
diff
changeset
|
2648 |
result info| |
6d1b77eda98f
check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents:
1903
diff
changeset
|
2649 |
|
6d1b77eda98f
check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents:
1903
diff
changeset
|
2650 |
(self askIfModified:'contents has not been saved.\\Modifications will be lost when you proceed.' |
3726 | 2651 |
yesButton:'Proceed') ifFalse:[^ self]. |
1911
6d1b77eda98f
check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents:
1903
diff
changeset
|
2652 |
|
6d1b77eda98f
check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents:
1903
diff
changeset
|
2653 |
self withWaitCursorDo:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2654 |
result := Dictionary new. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2655 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2656 |
dir := currentDirectory asFilename. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2657 |
fileNames := dir directoryContents. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2658 |
fileNames := fileNames collect:[:fn | dir construct:fn]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2659 |
fileNames := fileNames select:[:fn | fn isDirectory not]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2660 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2661 |
infoDir := Dictionary new. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2662 |
fileNames do:[:fn | |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2663 |
infoDir at:fn put:(fn info) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2664 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2665 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2666 |
"/ for each, get the files size. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2667 |
"/ 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
|
2668 |
"/ compare them ... |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2669 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2670 |
filesBySize := Dictionary new. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2671 |
infoDir keysAndValuesDo:[:fn :info | |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2672 |
|sz entry| |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2673 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2674 |
sz := info size. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2675 |
entry := filesBySize at:sz ifAbsentPut:[Set new]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2676 |
entry add:fn. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2677 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2678 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2679 |
"/ any of same size ? |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2680 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2681 |
filesBySize do:[:entry | |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2682 |
|files| |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2683 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2684 |
entry size > 1 ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2685 |
files := entry asArray. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2686 |
1 to:files size-1 do:[:idx1 | |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2687 |
idx1+1 to:files size do:[:idx2 | |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2688 |
|fn1 fn2| |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2689 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2690 |
fn1 := files at:idx1. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2691 |
fn2 := files at:idx2. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2692 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2693 |
(result at:fn2 ifAbsent:nil) ~= fn1 ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2694 |
"/ compare the files |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2695 |
(fn1 sameContentsAs:fn2) ifTrue:[ |
1911
6d1b77eda98f
check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents:
1903
diff
changeset
|
2696 |
"/ 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
|
2697 |
result at:fn1 put:fn2. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2698 |
] |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2699 |
] |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2700 |
] |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2701 |
] |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2702 |
] |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2703 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2704 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2705 |
result := result associations. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2706 |
result := result collect:[:assoc | |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2707 |
|f1 f2| |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2708 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2709 |
f1 := assoc key baseName. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2710 |
f2 := assoc value baseName. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2711 |
f1 < f2 ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2712 |
f2 -> f1 |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2713 |
] ifFalse:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2714 |
f1 -> f2 |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2715 |
] |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2716 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2717 |
result sort:[:f1 :f2 | f2 value < f1 value]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2718 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2719 |
info := OrderedCollection new. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2720 |
result do:[:assoc | |
3556 | 2721 |
|fn1 fn2| |
2722 |
||
2723 |
fn1 := assoc key. |
|
2724 |
fn2 := assoc value. |
|
2725 |
(fn1 includes:Character space) ifTrue:[ |
|
2726 |
fn1 := '"' , fn1 , '"' |
|
2727 |
]. |
|
2728 |
(fn2 includes:Character space) ifTrue:[ |
|
2729 |
fn2 := '"' , fn2 , '"' |
|
2730 |
]. |
|
2731 |
info add:(fn1 , ' same as ' , fn2) |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2732 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2733 |
info isEmpty ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2734 |
info := 'No duplicate files found.' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2735 |
]. |
1911
6d1b77eda98f
check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents:
1903
diff
changeset
|
2736 |
]. |
6d1b77eda98f
check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents:
1903
diff
changeset
|
2737 |
|
6d1b77eda98f
check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents:
1903
diff
changeset
|
2738 |
subView contents:info |
6d1b77eda98f
check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents:
1903
diff
changeset
|
2739 |
|
6d1b77eda98f
check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents:
1903
diff
changeset
|
2740 |
"Created: / 3.10.1998 / 17:59:00 / cg" |
1912 | 2741 |
"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
|
2742 |
! |
6d1b77eda98f
check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents:
1903
diff
changeset
|
2743 |
|
1933 | 2744 |
fileFindFile |
1965 | 2745 |
|sel bindings |
1933 | 2746 |
namePatternHolder contentsPatternHolder |
2747 |
ignoreCaseInName ignoreCaseInContents |
|
2166
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2748 |
namePattern namePatterns contentsPattern |
1965 | 2749 |
searchForSameContentsEnabled searchForSameContents| |
1933 | 2750 |
|
2751 |
(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
|
2752 |
yesButton:'proceed') ifFalse:[^ self]. |
1933 | 2753 |
|
2754 |
subView contents:nil; scrollToTop. |
|
2755 |
||
2756 |
bindings := IdentityDictionary new. |
|
2757 |
bindings at:#namePatternHolder put:(namePatternHolder := '' asValue). |
|
2758 |
bindings at:#contentsPatternHolder put:(contentsPatternHolder := '' asValue). |
|
2759 |
bindings at:#ignoreCaseInName put:(ignoreCaseInName := false asValue). |
|
2760 |
bindings at:#ignoreCaseInContents put:(ignoreCaseInContents := false asValue). |
|
2761 |
||
1965 | 2762 |
searchForSameContentsEnabled := false. |
2763 |
sel := fileListView selectionValue. |
|
2764 |
sel size == 1 ifTrue:[ |
|
2166
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2765 |
searchForSameContentsEnabled := true. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2766 |
sel := sel first string withoutSeparators |
1965 | 2767 |
]. |
2768 |
bindings at:#searchForSameContentsEnabled put:(searchForSameContentsEnabled := searchForSameContentsEnabled asValue). |
|
2769 |
bindings at:#searchForSameContents put:(searchForSameContents := false asValue). |
|
2770 |
bindings at:#notSearchForSameContents put:(BlockValue forLogicalNot:searchForSameContents). |
|
2771 |
||
2772 |
||
1933 | 2773 |
(SimpleDialog new |
2166
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2774 |
openFor:self |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2775 |
interfaceSpec:(self class fileSearchDialogSpec) |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2776 |
withBindings:bindings) ifTrue:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2777 |
|
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2778 |
namePattern := namePatternHolder value. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2779 |
namePattern size == 0 ifTrue:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2780 |
namePatterns := nil |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2781 |
] ifFalse:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2782 |
ignoreCaseInName value ifTrue:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2783 |
namePattern := namePattern asLowercase |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2784 |
]. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2785 |
namePatterns := namePattern asCollectionOfSubstringsSeparatedBy:$; |
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 |
contentsPattern := contentsPatternHolder value. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2788 |
contentsPattern size == 0 ifTrue:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2789 |
contentsPattern := nil |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2790 |
] ifFalse:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2791 |
ignoreCaseInContents value ifTrue:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2792 |
contentsPattern := contentsPattern asLowercase |
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 |
]. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2795 |
|
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2796 |
self withWaitCursorDo:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2797 |
|stopSignal access myProcess lowerFrameView| |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2798 |
|
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2799 |
myProcess := Processor activeProcess. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2800 |
|
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2801 |
access := Semaphore forMutualExclusion name:'accessLock'. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2802 |
stopSignal := Signal new. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2803 |
|
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2804 |
" |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2805 |
The following is tricky: |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2806 |
the pauseToggle & killButton will |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2807 |
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
|
2808 |
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
|
2809 |
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
|
2810 |
" |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2811 |
|
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2812 |
commandView beInvisible. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2813 |
|
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2814 |
" |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2815 |
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
|
2816 |
" |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2817 |
killButton windowGroup:nil. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2818 |
|
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2819 |
" |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2820 |
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
|
2821 |
" |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2822 |
killButton label:(resources string:'stop'). |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2823 |
killButton raise; beVisible. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2824 |
|
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2825 |
" |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2826 |
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
|
2827 |
" |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2828 |
killButton |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2829 |
action:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2830 |
access critical:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2831 |
myProcess interruptWith:[stopSignal raiseRequest]. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2832 |
] |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2833 |
]. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2834 |
|
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2835 |
" |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2836 |
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
|
2837 |
" |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2838 |
killButton openAutonomous. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2839 |
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
|
2840 |
|
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2841 |
lowerFrameView := subView superView. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2842 |
|
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2843 |
[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2844 |
stopSignal catch:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2845 |
searchForSameContents value ifTrue:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2846 |
self |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2847 |
doFindFileNamed:namePatterns |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2848 |
ignoreCase:ignoreCaseInName value |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2849 |
containingString:nil |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2850 |
ignoreCaseInContents:ignoreCaseInContents value |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2851 |
sameContentsAsFile:(currentDirectory asFilename construct:sel) |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2852 |
sameContentsAs:nil |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2853 |
in:currentDirectory. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2854 |
] ifFalse:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2855 |
(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
|
2856 |
self |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2857 |
doFindFileNamed:namePatterns |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2858 |
ignoreCase:ignoreCaseInName value |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2859 |
containingString:contentsPattern |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2860 |
ignoreCaseInContents:ignoreCaseInContents value |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2861 |
sameContentsAsFile:nil |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2862 |
sameContentsAs:nil |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2863 |
in:currentDirectory. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2864 |
] |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2865 |
] |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2866 |
] |
3596
9761af1f3f72
#valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents:
3568
diff
changeset
|
2867 |
] ensure:[ |
2166
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2868 |
|wg| |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2869 |
|
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2870 |
self label:myName; iconLabel:myName. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2871 |
|
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2872 |
" |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2873 |
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
|
2874 |
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
|
2875 |
" |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2876 |
killButton beInvisible. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2877 |
|
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2878 |
commandView beVisible. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2879 |
|
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2880 |
" |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2881 |
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
|
2882 |
(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
|
2883 |
" |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2884 |
wg := killButton windowGroup. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2885 |
killButton windowGroup:nil. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2886 |
|
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2887 |
" |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2888 |
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
|
2889 |
" |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2890 |
wg notNil ifTrue:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2891 |
wg process terminate. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2892 |
]. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2893 |
" |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2894 |
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
|
2895 |
releases reference to thisContext earlier) |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2896 |
" |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2897 |
killButton action:nil. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2898 |
killButton label:(resources string:'kill'). |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2899 |
|
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2900 |
"/ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2901 |
"/ allow interaction with the codeView |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2902 |
"/ (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
|
2903 |
"/ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2904 |
lowerFrameView windowGroup:(self windowGroup). |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2905 |
]. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2906 |
|
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2907 |
]. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2908 |
self label:myName. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2909 |
currentFileName isNil ifTrue:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2910 |
subView modified:false. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2911 |
]. |
1933 | 2912 |
]. |
2913 |
||
2914 |
"Created: / 15.10.1998 / 11:32:57 / cg" |
|
2915 |
"Modified: / 15.10.1998 / 12:41:09 / cg" |
|
2916 |
! |
|
2917 |
||
172 | 2918 |
fileGet |
2919 |
"get contents of selected file into subView. |
|
2920 |
If text was modified show a queryBox, |
|
2921 |
otherwise get it immediately" |
|
2922 |
||
633
4630175ed31e
double click on .htm / .html files open a viewer;
Claus Gittinger <cg@exept.de>
parents:
585
diff
changeset
|
2923 |
self fileGet:false |
4630175ed31e
double click on .htm / .html files open a viewer;
Claus Gittinger <cg@exept.de>
parents:
585
diff
changeset
|
2924 |
|
4630175ed31e
double click on .htm / .html files open a viewer;
Claus Gittinger <cg@exept.de>
parents:
585
diff
changeset
|
2925 |
"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
|
2926 |
! |
4630175ed31e
double click on .htm / .html files open a viewer;
Claus Gittinger <cg@exept.de>
parents:
585
diff
changeset
|
2927 |
|
4630175ed31e
double click on .htm / .html files open a viewer;
Claus Gittinger <cg@exept.de>
parents:
585
diff
changeset
|
2928 |
fileGet:viaDoubleClick |
4630175ed31e
double click on .htm / .html files open a viewer;
Claus Gittinger <cg@exept.de>
parents:
585
diff
changeset
|
2929 |
"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
|
2930 |
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
|
2931 |
otherwise get it immediately" |
4630175ed31e
double click on .htm / .html files open a viewer;
Claus Gittinger <cg@exept.de>
parents:
585
diff
changeset
|
2932 |
|
172 | 2933 |
|fileName msg label| |
2934 |
||
1110
9ec4692e9cda
dont decode string, if the encoding is already iso8859
Claus Gittinger <cg@exept.de>
parents:
1104
diff
changeset
|
2935 |
(subView modified not or:[subView contentsWasSaved]) ifTrue:[ |
3252 | 2936 |
self doFileGet:viaDoubleClick. |
2937 |
^ self |
|
1110
9ec4692e9cda
dont decode string, if the encoding is already iso8859
Claus Gittinger <cg@exept.de>
parents:
1104
diff
changeset
|
2938 |
]. |
172 | 2939 |
fileName := self getSelectedFileName. |
2940 |
fileName notNil ifTrue:[ |
|
3252 | 2941 |
(currentDirectory filenameFor:fileName) isDirectory ifTrue:[ |
2942 |
msg := 'Contents has not been saved.\\Modifications will be lost when directory is changed.'. |
|
2943 |
label := 'Change'. |
|
2944 |
] ifFalse:[ |
|
2945 |
msg := 'Contents has not been saved.\\Modifications will be lost when new file is read.'. |
|
2946 |
label := 'Get'. |
|
2947 |
]. |
|
2948 |
(self ask:(resources at:msg) yesButton:label) ifTrue:[ |
|
2949 |
subView modified:false. |
|
2950 |
self doFileGet:viaDoubleClick |
|
2951 |
] |
|
172 | 2952 |
] |
633
4630175ed31e
double click on .htm / .html files open a viewer;
Claus Gittinger <cg@exept.de>
parents:
585
diff
changeset
|
2953 |
|
4630175ed31e
double click on .htm / .html files open a viewer;
Claus Gittinger <cg@exept.de>
parents:
585
diff
changeset
|
2954 |
"Created: 19.6.1996 / 09:38:35 / cg" |
1162 | 2955 |
"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
|
2956 |
"Modified: 18.9.1997 / 16:27:34 / stefan" |
172 | 2957 |
! |
2958 |
||
2959 |
fileGetInfo |
|
2960 |
"show short file (stat)-info" |
|
2961 |
||
2962 |
self fileGetInfo:false |
|
2963 |
! |
|
2964 |
||
2965 |
fileGetInfo:longInfo |
|
2966 |
"get info on selected file - show it in a box" |
|
2967 |
||
1672
9df905f8bfa3
update fileInfo while showing infoBox
Claus Gittinger <cg@exept.de>
parents:
1628
diff
changeset
|
2968 |
|string box updater| |
172 | 2969 |
|
2970 |
string := self getFileInfoString:longInfo. |
|
2971 |
string notNil ifTrue:[ |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2972 |
box := InfoBox title:string. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2973 |
updater := [ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2974 |
[true] whileTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2975 |
Delay waitForSeconds:2. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2976 |
string := self getFileInfoString:longInfo. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2977 |
box title:string |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2978 |
] |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2979 |
] fork. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2980 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2981 |
box showAtPointer. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2982 |
updater terminate. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2983 |
box destroy |
172 | 2984 |
] |
2985 |
! |
|
2986 |
||
2987 |
fileGetLongInfo |
|
2988 |
"show long stat (file)-info" |
|
2989 |
||
2990 |
self fileGetInfo:true |
|
2991 |
! |
|
2992 |
||
1874 | 2993 |
fileHexDump |
2994 |
"show a hex dump (similar to od -x) |
|
2995 |
Only needed with non-Unix systems." |
|
2996 |
||
3252 | 2997 |
(self askIfModified:'Contents has not been saved.\\Modifications will be lost when hex dump is shown.' |
2998 |
yesButton:'HexDump') ifFalse:[^ self]. |
|
2999 |
||
1874 | 3000 |
self withReadCursorDo:[ |
2666 | 3001 |
|fileName f stream data offs |
2701
78171ebe64f5
less memory need for hexDump
Claus Gittinger <cg@exept.de>
parents:
2688
diff
changeset
|
3002 |
addrDigits col line lineStream asciiLineStream lines| |
2666 | 3003 |
|
3004 |
fileName := self getSelectedFileName. |
|
3005 |
fileName notNil ifTrue:[ |
|
3006 |
f := currentDirectory construct:fileName. |
|
3007 |
f isDirectory ifTrue:[ |
|
3008 |
^ self warn:(resources string:'%1 is a directory.' with:fileName). |
|
3009 |
]. |
|
3010 |
f exists ifFalse:[ |
|
3528 | 3011 |
Dialog warn:(resources string:'oops, ''%1'' is gone or unreadable.' with:fileName). |
2666 | 3012 |
^ self |
3013 |
]. |
|
3014 |
f isReadable ifFalse:[ |
|
3528 | 3015 |
Dialog warn:(resources string:'''%1'' is unreadable.' with:fileName). |
2666 | 3016 |
^ self |
3017 |
]. |
|
3018 |
f fileSize > (512*1024) ifTrue:[ |
|
3019 |
(self confirm:'Warning: the file is big (', (f fileSize//1024) printString , 'Kb). Show anyway ?') |
|
3020 |
ifFalse:[ |
|
3021 |
^ self |
|
3022 |
] |
|
3023 |
]. |
|
3024 |
stream := f readStream binary. |
|
3025 |
data := stream contents. |
|
3026 |
stream close. |
|
3027 |
||
3028 |
subView list:nil. |
|
3029 |
col := 1. |
|
3030 |
offs := 0. |
|
3031 |
lines := StringCollection new. |
|
3032 |
||
3033 |
addrDigits := ((f fileSize + 1) log:16) truncated + 1. |
|
3034 |
||
2701
78171ebe64f5
less memory need for hexDump
Claus Gittinger <cg@exept.de>
parents:
2688
diff
changeset
|
3035 |
lineStream := '' writeStream. |
78171ebe64f5
less memory need for hexDump
Claus Gittinger <cg@exept.de>
parents:
2688
diff
changeset
|
3036 |
asciiLineStream := '' writeStream. |
78171ebe64f5
less memory need for hexDump
Claus Gittinger <cg@exept.de>
parents:
2688
diff
changeset
|
3037 |
|
78171ebe64f5
less memory need for hexDump
Claus Gittinger <cg@exept.de>
parents:
2688
diff
changeset
|
3038 |
lineStream nextPutAll:(offs hexPrintString:addrDigits). |
78171ebe64f5
less memory need for hexDump
Claus Gittinger <cg@exept.de>
parents:
2688
diff
changeset
|
3039 |
lineStream nextPutAll:': '. |
2666 | 3040 |
|
3041 |
data do:[:byte | |
|
2701
78171ebe64f5
less memory need for hexDump
Claus Gittinger <cg@exept.de>
parents:
2688
diff
changeset
|
3042 |
lineStream nextPutAll:(byte hexPrintString:2). |
2666 | 3043 |
(byte between:32 and:127) ifTrue:[ |
2701
78171ebe64f5
less memory need for hexDump
Claus Gittinger <cg@exept.de>
parents:
2688
diff
changeset
|
3044 |
asciiLineStream nextPut:(Character value:byte) |
2666 | 3045 |
] ifFalse:[ |
2701
78171ebe64f5
less memory need for hexDump
Claus Gittinger <cg@exept.de>
parents:
2688
diff
changeset
|
3046 |
asciiLineStream nextPut:$. |
2666 | 3047 |
]. |
3048 |
||
3049 |
offs := offs + 1. |
|
3050 |
col := col + 1. |
|
3051 |
col > 16 ifTrue:[ |
|
2701
78171ebe64f5
less memory need for hexDump
Claus Gittinger <cg@exept.de>
parents:
2688
diff
changeset
|
3052 |
lineStream nextPutAll:' '. |
78171ebe64f5
less memory need for hexDump
Claus Gittinger <cg@exept.de>
parents:
2688
diff
changeset
|
3053 |
lineStream nextPutAll:asciiLineStream contents. |
78171ebe64f5
less memory need for hexDump
Claus Gittinger <cg@exept.de>
parents:
2688
diff
changeset
|
3054 |
lines add:(lineStream contents). |
2666 | 3055 |
(offs bitAnd:16rFF) == 0 ifTrue:[ |
3056 |
lines add:nil |
|
3057 |
]. |
|
2701
78171ebe64f5
less memory need for hexDump
Claus Gittinger <cg@exept.de>
parents:
2688
diff
changeset
|
3058 |
lineStream reset. |
78171ebe64f5
less memory need for hexDump
Claus Gittinger <cg@exept.de>
parents:
2688
diff
changeset
|
3059 |
asciiLineStream reset. |
78171ebe64f5
less memory need for hexDump
Claus Gittinger <cg@exept.de>
parents:
2688
diff
changeset
|
3060 |
|
78171ebe64f5
less memory need for hexDump
Claus Gittinger <cg@exept.de>
parents:
2688
diff
changeset
|
3061 |
lineStream nextPutAll:(offs hexPrintString:addrDigits). |
78171ebe64f5
less memory need for hexDump
Claus Gittinger <cg@exept.de>
parents:
2688
diff
changeset
|
3062 |
lineStream nextPutAll:': '. |
2666 | 3063 |
col := 1. |
3064 |
] ifFalse:[ |
|
2701
78171ebe64f5
less memory need for hexDump
Claus Gittinger <cg@exept.de>
parents:
2688
diff
changeset
|
3065 |
lineStream space |
2666 | 3066 |
] |
3067 |
]. |
|
2701
78171ebe64f5
less memory need for hexDump
Claus Gittinger <cg@exept.de>
parents:
2688
diff
changeset
|
3068 |
line := lineStream contents paddedTo:(3*16 + addrDigits + 1). |
78171ebe64f5
less memory need for hexDump
Claus Gittinger <cg@exept.de>
parents:
2688
diff
changeset
|
3069 |
lines add:(line , ' ' , asciiLineStream contents). |
2666 | 3070 |
self show:lines. |
3071 |
] |
|
1874 | 3072 |
] |
3073 |
||
3074 |
"Modified: / 7.9.1998 / 15:37:47 / cg" |
|
3075 |
! |
|
3076 |
||
172 | 3077 |
fileInsert |
1162 | 3078 |
"insert contents of file at the cursor position" |
172 | 3079 |
|
3080 |
|fileName| |
|
3081 |
||
3082 |
fileName := self getSelectedFileName. |
|
3083 |
fileName notNil ifTrue:[ |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3084 |
self showFile:fileName insert:true encoding:fileEncoding |
172 | 3085 |
] |
386
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
3086 |
|
1162 | 3087 |
"Modified: 23.4.1997 / 13:06:06 / cg" |
172 | 3088 |
! |
3089 |
||
3090 |
fileListMenu |
|
3091 |
"return the menu to show in the fileList" |
|
3092 |
||
1235
13610578a5d2
resource flag: #menu -> #programMenu
Claus Gittinger <cg@exept.de>
parents:
1227
diff
changeset
|
3093 |
<resource: #programMenu> |
1040 | 3094 |
|
3330 | 3095 |
|spec| |
1834 | 3096 |
|
3002 | 3097 |
self sensor ctrlDown ifTrue:[ |
3330 | 3098 |
spec := self class toolsMenuSpec. |
3002 | 3099 |
] ifFalse:[ |
3330 | 3100 |
spec := self class menuPopUp. |
3101 |
]. |
|
3102 |
^ self menuFromSpec:spec. |
|
3103 |
"/ |m| |
|
3104 |
"/ |
|
3105 |
"/ self sensor ctrlDown ifTrue:[ |
|
3106 |
"/ m := self class toolsMenuSpec. |
|
3107 |
"/ ] ifFalse:[ |
|
3108 |
"/ m := self class menuPopUp. |
|
3109 |
"/ ]. |
|
3110 |
"/ m := m decodeAsLiteralArray. |
|
3111 |
"/ m receiver:self. |
|
3112 |
"/ m findGuiResourcesIn:self. |
|
3113 |
"/ ^ m. |
|
1834 | 3114 |
|
3115 |
"Modified: / 14.8.1998 / 14:09:12 / cg" |
|
3116 |
! |
|
3117 |
||
3118 |
fileListMenu_old |
|
3119 |
"return the menu to show in the fileList" |
|
3120 |
||
3121 |
<resource: #programMenu> |
|
3122 |
||
3527 | 3123 |
|items m sel ns| |
1736
36cab4d1d655
remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents:
1735
diff
changeset
|
3124 |
|
36cab4d1d655
remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents:
1735
diff
changeset
|
3125 |
items := #( |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3126 |
('spawn' fileSpawn ) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3127 |
('-' nil ) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3128 |
('get contents' fileGet GotoLine) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3129 |
('insert contents' fileInsert ) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3130 |
('show info' fileGetInfo InspectIt) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3131 |
('show full info' fileGetLongInfo CmdI) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3132 |
). |
1193
568b858d94ce
show current namespace in menus fileIn item
Claus Gittinger <cg@exept.de>
parents:
1189
diff
changeset
|
3133 |
|
568b858d94ce
show current namespace in menus fileIn item
Claus Gittinger <cg@exept.de>
parents:
1189
diff
changeset
|
3134 |
((ns := Project current defaultNameSpace) notNil |
568b858d94ce
show current namespace in menus fileIn item
Claus Gittinger <cg@exept.de>
parents:
1189
diff
changeset
|
3135 |
and:[ns ~~ Smalltalk]) ifTrue:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3136 |
items := items copyWith:(Array |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3137 |
with:(resources string:'fileIn (into ''%1'')' with:(Project current defaultNameSpace name)) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3138 |
with:#fileFileIn |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3139 |
with:#Accept) |
1736
36cab4d1d655
remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents:
1735
diff
changeset
|
3140 |
|
1193
568b858d94ce
show current namespace in menus fileIn item
Claus Gittinger <cg@exept.de>
parents:
1189
diff
changeset
|
3141 |
] ifFalse:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3142 |
items := items copyWith:#( 'fileIn' #fileFileIn #Accept) |
1193
568b858d94ce
show current namespace in menus fileIn item
Claus Gittinger <cg@exept.de>
parents:
1189
diff
changeset
|
3143 |
]. |
568b858d94ce
show current namespace in menus fileIn item
Claus Gittinger <cg@exept.de>
parents:
1189
diff
changeset
|
3144 |
|
1736
36cab4d1d655
remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents:
1735
diff
changeset
|
3145 |
items := items , #( |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3146 |
('-' ) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3147 |
('update' updateCurrentDirectory Cmdu) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3148 |
('-' ) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3149 |
('execute unix command ...' fileExecute DoIt) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3150 |
('st/x tools' stxTools ) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3151 |
('-' ) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3152 |
('remove' fileRemove Delete) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3153 |
('rename ...' fileRename ) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3154 |
('-' ) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3155 |
('display long list' changeDisplayMode ) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3156 |
('show all files' changeDotFileVisibility ) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3157 |
('encoding ...' fileEncoding ) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3158 |
('-' ) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3159 |
('create directory ...' newDirectory CmdD) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3160 |
('create file ...' newFile CmdF) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3161 |
). |
172 | 3162 |
|
3163 |
m := PopUpMenu |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3164 |
itemList:items |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3165 |
resources:resources. |
172 | 3166 |
|
1834 | 3167 |
showingHiddenFiles value "showDotFiles" ifTrue:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3168 |
m labelAt:#changeDotFileVisibility put:(resources string:'hide hidden files') |
172 | 3169 |
]. |
1834 | 3170 |
showingDetails value "showLongList" ifTrue:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3171 |
m labelAt:#changeDisplayMode put:(resources string:'display short list') |
172 | 3172 |
]. |
3173 |
||
1736
36cab4d1d655
remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents:
1735
diff
changeset
|
3174 |
items := #( |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3175 |
('Changes browser' openChangesBrowser ) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3176 |
('Editor' openEditor ) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3177 |
('HTML reader' openHTMLReader ) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3178 |
('Image inspect' openImageInspector ) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3179 |
('show file differences' openDiffView ) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3180 |
). |
1286
2a464093d865
added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents:
1272
diff
changeset
|
3181 |
|
1751 | 3182 |
OperatingSystem isUNIXlike ifTrue:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3183 |
items := items , #( ('terminal' openTerminal )). |
1751 | 3184 |
]. |
3185 |
||
1286
2a464093d865
added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents:
1272
diff
changeset
|
3186 |
JavaInterpreter notNil ifTrue:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3187 |
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
|
3188 |
]. |
2a464093d865
added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents:
1272
diff
changeset
|
3189 |
|
2a464093d865
added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents:
1272
diff
changeset
|
3190 |
m subMenuAt:#stxTools |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3191 |
put:(PopUpMenu |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3192 |
itemList:items |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3193 |
resources:resources). |
1736
36cab4d1d655
remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents:
1735
diff
changeset
|
3194 |
|
36cab4d1d655
remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents:
1735
diff
changeset
|
3195 |
((sel := fileListView selection) isNil |
36cab4d1d655
remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents:
1735
diff
changeset
|
3196 |
or:[sel isEmpty]) ifTrue:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3197 |
m disableAll:#(fileGet fileInsert |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3198 |
fileGetInfo fileGetLongInfo |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3199 |
fileFileIn fileFileInLazy |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3200 |
fileRemove fileRename). |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3201 |
(m subMenuAt:#stxTools) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3202 |
disableAll:#(openChangesBrowser openEditor openHTMLReader openImageInspector) |
865
48395e8ecca9
remember executeCommand actions in history as well.
Claus Gittinger <cg@exept.de>
parents:
851
diff
changeset
|
3203 |
] ifFalse:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3204 |
fileListView selection size > 1 ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3205 |
m disableAll:#( fileGet fileInsert fileGetInfo fileGetLongInfo fileRename ) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3206 |
] |
172 | 3207 |
]. |
3208 |
||
3209 |
^m |
|
252 | 3210 |
|
1396 | 3211 |
"Modified: / 16.1.1998 / 16:42:59 / stefan" |
1834 | 3212 |
"Modified: / 4.8.1998 / 13:45:56 / cg" |
3213 |
"Created: / 13.8.1998 / 20:51:38 / cg" |
|
172 | 3214 |
! |
3215 |
||
3216 |
filePrint |
|
1162 | 3217 |
"send a files contents to the printer (not in the menu)" |
3218 |
||
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
3219 |
|fileName path inStream printStream line| |
172 | 3220 |
|
294 | 3221 |
self withWaitCursorDo:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3222 |
fileName := self getSelectedFileName. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3223 |
fileName notNil ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3224 |
path := currentDirectory filenameFor:fileName. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3225 |
(path type == #regular) ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3226 |
inStream := path readStream. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3227 |
inStream isNil ifFalse:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3228 |
printStream := PrinterStream new. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3229 |
printStream notNil ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3230 |
[inStream atEnd] whileFalse:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3231 |
line := inStream nextLine. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3232 |
printStream nextPutLine:line. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3233 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3234 |
printStream close |
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 |
inStream close |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3237 |
] |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3238 |
] |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3239 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3240 |
0 "compiler hint" |
172 | 3241 |
] |
294 | 3242 |
|
1162 | 3243 |
"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
|
3244 |
"Modified: 18.9.1997 / 16:29:17 / stefan" |
172 | 3245 |
! |
3246 |
||
3247 |
fileRemove |
|
3248 |
"remove the selected file(s). |
|
3281 | 3249 |
Query if user really wants to remove the file, except if |
3250 |
shift-key is pressed. |
|
3251 |
TODO: Should be enhanced, to look for a ~/.trash directory |
|
3252 |
and move files there if it exists (without asking in this case)." |
|
3253 |
||
3254 |
|sel| |
|
172 | 3255 |
|
2094 | 3256 |
sel := fileListView selection. |
3257 |
sel size > 0 ifTrue:[ |
|
2868 | 3258 |
sel := sel collect:[:rawIndex | fileList at:rawIndex]. |
3281 | 3259 |
"/ do not ask, if shift is pressed |
3260 |
self sensor shiftDown ifTrue:[ |
|
3261 |
self doRemove:sel |
|
2868 | 3262 |
] ifFalse:[ |
3281 | 3263 |
self confirmAndRemove:sel |
2868 | 3264 |
]. |
3281 | 3265 |
] |
3266 |
! |
|
3267 |
||
3268 |
fileRemove:fileNames |
|
3269 |
"remove fileNames. |
|
3270 |
Query if user really wants to remove the file, except if |
|
3271 |
shift-key is pressed. |
|
3272 |
TODO: Should be enhanced, to look for a ~/.trash directory |
|
3273 |
and move files there if it exists (without asking in this case)." |
|
3274 |
||
3275 |
|q doRemove| |
|
3276 |
||
3277 |
"/ do not ask, if shift is pressed |
|
3278 |
doRemove := self sensor shiftDown. |
|
3279 |
doRemove ifFalse:[ |
|
3280 |
fileNames size > 1 ifTrue:[ |
|
3281 |
q := resources string:'Remove %1 selected files ?' with:(fileNames size). |
|
3282 |
doRemove := Dialog |
|
3283 |
confirmWithCancel:q |
|
3284 |
labels:(resources array:#('Remove' 'Confirm Each' 'Cancel')) |
|
3285 |
values:#(true #confirm false) |
|
3286 |
default:true. |
|
3287 |
doRemove == #confirm ifTrue:[ |
|
3527 | 3288 |
self halt:'Confirm each not yet implemented'. |
3281 | 3289 |
]. |
3290 |
] ifFalse:[ |
|
3291 |
q := resources string:'Remove ''%1'' ?' with:(fileNames first allBold). |
|
3292 |
doRemove := self ask:q yesButton:'Remove'. |
|
3293 |
]. |
|
3294 |
]. |
|
3295 |
||
3296 |
doRemove ifTrue:[ |
|
3297 |
self withWaitCursorDo:[ |
|
3298 |
self doRemove:fileNames |
|
2868 | 3299 |
] |
172 | 3300 |
] |
3301 |
! |
|
3302 |
||
3303 |
fileRename |
|
3304 |
"rename the selected file(s)" |
|
3305 |
||
3565 | 3306 |
|queryBox b lastNewName lastOldName initialText| |
172 | 3307 |
|
3308 |
queryBox := FilenameEnterBox new. |
|
3280 | 3309 |
queryBox okText:(resources at:'Rename'). |
3059
ced4d5b13ad2
cancelAll if renaming multiple files
Claus Gittinger <cg@exept.de>
parents:
3045
diff
changeset
|
3310 |
fileListView selection size > 1 ifTrue:[ |
3697
e2f7d8dec6e2
menu items/button labels uppercase-first
Claus Gittinger <cg@exept.de>
parents:
3691
diff
changeset
|
3311 |
b := queryBox addAbortButtonLabelled:(resources at:'Cancel All'). |
3059
ced4d5b13ad2
cancelAll if renaming multiple files
Claus Gittinger <cg@exept.de>
parents:
3045
diff
changeset
|
3312 |
b action:[^ self ]. |
ced4d5b13ad2
cancelAll if renaming multiple files
Claus Gittinger <cg@exept.de>
parents:
3045
diff
changeset
|
3313 |
]. |
ced4d5b13ad2
cancelAll if renaming multiple files
Claus Gittinger <cg@exept.de>
parents:
3045
diff
changeset
|
3314 |
|
172 | 3315 |
self selectedFilesDo:[:oldName | |
3280 | 3316 |
queryBox title:(resources string:'Rename ''%1'' to:' with:oldName). |
3066
7daebd50006e
intelligent default in rename
Claus Gittinger <cg@exept.de>
parents:
3061
diff
changeset
|
3317 |
initialText := oldName. |
7daebd50006e
intelligent default in rename
Claus Gittinger <cg@exept.de>
parents:
3061
diff
changeset
|
3318 |
|
3556 | 3319 |
lastNewName notNil ifTrue:[ |
3059
ced4d5b13ad2
cancelAll if renaming multiple files
Claus Gittinger <cg@exept.de>
parents:
3045
diff
changeset
|
3320 |
"/ intelligent default ... |
3565 | 3321 |
initialText := self goodRenameDefaultFor:oldName lastOld:lastOldName lastNew:lastNewName |
3059
ced4d5b13ad2
cancelAll if renaming multiple files
Claus Gittinger <cg@exept.de>
parents:
3045
diff
changeset
|
3322 |
]. |
3565 | 3323 |
queryBox initialText:(initialText ? oldName). |
3059
ced4d5b13ad2
cancelAll if renaming multiple files
Claus Gittinger <cg@exept.de>
parents:
3045
diff
changeset
|
3324 |
queryBox action:[:newName | |
3060 | 3325 |
fileListView removeFromSelection:(fileList indexOf:oldName). |
3059
ced4d5b13ad2
cancelAll if renaming multiple files
Claus Gittinger <cg@exept.de>
parents:
3045
diff
changeset
|
3326 |
self doRename:oldName to:newName. |
ced4d5b13ad2
cancelAll if renaming multiple files
Claus Gittinger <cg@exept.de>
parents:
3045
diff
changeset
|
3327 |
lastOldName := oldName. |
ced4d5b13ad2
cancelAll if renaming multiple files
Claus Gittinger <cg@exept.de>
parents:
3045
diff
changeset
|
3328 |
lastNewName := newName. |
ced4d5b13ad2
cancelAll if renaming multiple files
Claus Gittinger <cg@exept.de>
parents:
3045
diff
changeset
|
3329 |
]. |
ced4d5b13ad2
cancelAll if renaming multiple files
Claus Gittinger <cg@exept.de>
parents:
3045
diff
changeset
|
3330 |
|
ced4d5b13ad2
cancelAll if renaming multiple files
Claus Gittinger <cg@exept.de>
parents:
3045
diff
changeset
|
3331 |
queryBox showAtPointer |
172 | 3332 |
] |
3333 |
! |
|
3334 |
||
3335 |
fileSelect:lineNr |
|
3336 |
"selected a file - do nothing here" |
|
1162 | 3337 |
|
2094 | 3338 |
|fn| |
3339 |
||
2095 | 3340 |
imagePreviewView notNil ifTrue:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3341 |
self stopImageRenderProcess. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3342 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3343 |
fn := self getSelectedFileName. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3344 |
(Image isImageFileSuffix:(fn asFilename suffix)) ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3345 |
imageRenderProcess := [ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3346 |
self loadImageAndPerform:[:img | |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3347 |
imagePreviewView beVisible. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3348 |
imagePreviewView image:img |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3349 |
] |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3350 |
] forkAt:(Processor activePriority - 1). |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3351 |
] ifFalse:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3352 |
imagePreviewView beInvisible |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3353 |
]. |
2095 | 3354 |
] |
1162 | 3355 |
|
3356 |
"Modified: 23.4.1997 / 13:04:55 / cg" |
|
172 | 3357 |
! |
3358 |
||
3359 |
fileSpawn |
|
3360 |
"start another FileBrowser on the selected directory or |
|
3361 |
on the same directory if none is selected." |
|
3362 |
||
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
3363 |
|any path| |
172 | 3364 |
|
3365 |
any := false. |
|
3366 |
self selectedFilesDo:[:fileName | |
|
3025 | 3367 |
path := currentDirectory filenameFor:fileName. |
3368 |
path isDirectory ifTrue:[ |
|
3369 |
self class openOn:(path pathName). |
|
3370 |
any := true |
|
3371 |
] |
|
172 | 3372 |
]. |
3373 |
any ifFalse:[ |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3374 |
"/ access by name, to get most up-to-date version |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3375 |
"/ (if changed in the browser, and the running one is old) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3376 |
(Smalltalk at:(self class name)) |
3747
d30bc1e54f15
Remove unused vars and asFilename sends
Stefan Vogel <sv@exept.de>
parents:
3746
diff
changeset
|
3377 |
openOn:currentDirectory withExtent:self topView extent |
172 | 3378 |
] |
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
3379 |
|
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
3380 |
"Modified: 18.9.1997 / 16:32:39 / stefan" |
172 | 3381 |
! |
3382 |
||
3565 | 3383 |
goodRenameDefaultFor:oldName lastOld:lastOldName lastNew:lastNewName |
3636 | 3384 |
|prefix suffix lastNewSize lastOldSize t |
3635 | 3385 |
lastOldWOSuffix lastNewWOSuffix oldWOSuffix lastOldRest oldRest lastNewRest |
3386 |
lastRemoved lastInserted| |
|
3565 | 3387 |
|
3388 |
lastNewName isNil ifTrue:[ ^ nil]. |
|
3389 |
||
3390 |
lastNewSize := lastNewName size. |
|
3391 |
lastOldSize := lastOldName size. |
|
3392 |
||
3393 |
"/ intelligent default ... |
|
3394 |
(lastNewName endsWith:lastOldName) ifTrue:[ |
|
3395 |
prefix := lastNewName copyTo:(lastNewSize - lastOldSize). |
|
3396 |
^ (prefix , oldName). |
|
3397 |
]. |
|
3398 |
(lastOldName endsWith:lastNewName) ifTrue:[ |
|
3399 |
prefix := lastOldName copyTo:(lastOldSize - lastNewSize). |
|
3400 |
^ (oldName copyFrom:prefix size+1). |
|
3401 |
]. |
|
3402 |
(lastOldName withoutSeparators = lastNewName) ifTrue:[ |
|
3403 |
"/ intelligent default ... |
|
3404 |
^ oldName withoutSeparators. |
|
3405 |
]. |
|
3406 |
(lastNewName startsWith:lastOldName) ifTrue:[ |
|
3407 |
"/ intelligent default ... |
|
3408 |
suffix := lastNewName copyLast:(lastNewSize - lastOldSize). |
|
3409 |
^ (oldName , suffix). |
|
3410 |
]. |
|
3411 |
(lastOldName startsWith:lastNewName) ifTrue:[ |
|
3412 |
suffix := lastOldName copyLast:(lastOldSize - lastNewSize). |
|
3413 |
(oldName endsWith:suffix) ifTrue:[ |
|
3414 |
^ (oldName copyWithoutLast:suffix size). |
|
3415 |
] |
|
3416 |
]. |
|
3417 |
||
3418 |
lastOldWOSuffix := lastOldName asFilename withoutSuffix name. |
|
3419 |
lastNewWOSuffix := lastNewName asFilename withoutSuffix name. |
|
3420 |
oldWOSuffix := oldName asFilename withoutSuffix name. |
|
3421 |
||
3636 | 3422 |
prefix := lastOldWOSuffix commonPrefixWith:oldWOSuffix. |
3565 | 3423 |
(lastNewWOSuffix startsWith:prefix) ifTrue:[ |
3424 |
lastOldRest := lastOldWOSuffix copyFrom:prefix size + 1. |
|
3425 |
lastNewRest := lastNewWOSuffix copyFrom:prefix size + 1. |
|
3426 |
oldRest := oldWOSuffix copyFrom:prefix size + 1. |
|
3427 |
||
3428 |
(lastNewRest endsWith:lastOldRest) ifTrue:[ |
|
3429 |
t := lastNewRest copyWithoutLast:lastOldRest size. |
|
3430 |
^ ((prefix , t , oldRest) asFilename withSuffix:oldName asFilename suffix) name |
|
3431 |
]. |
|
3432 |
]. |
|
3433 |
||
3636 | 3434 |
suffix := lastOldWOSuffix commonSuffixWith:lastNewWOSuffix. |
3635 | 3435 |
suffix size > 0 ifTrue:[ |
3436 |
"/ last change changed something at the beginning |
|
3636 | 3437 |
prefix := oldWOSuffix commonPrefixWith:lastOldWOSuffix. |
3635 | 3438 |
prefix size > 0 ifTrue:[ |
3439 |
"/ this name starts with the same characters |
|
3440 |
lastRemoved := lastOldWOSuffix copyWithoutLast:suffix size. |
|
3441 |
lastInserted := lastNewWOSuffix copyWithoutLast:suffix size. |
|
3442 |
^ lastInserted , (oldName copyFrom:lastRemoved size + 1) |
|
3443 |
]. |
|
3444 |
]. |
|
3445 |
||
3565 | 3446 |
^ nil |
3447 |
! |
|
3448 |
||
3536 | 3449 |
hasSlideShow |
3450 |
^ [CodingExamples_GUI::SlideShow notNil] |
|
3451 |
||
3452 |
"Created: / 29.12.2001 / 21:58:47 / cg" |
|
3453 |
"Modified: / 29.12.2001 / 21:59:01 / cg" |
|
3454 |
! |
|
3455 |
||
3765
8309f42ebf29
+ installAllAsAutoloaded function
Claus Gittinger <cg@exept.de>
parents:
3762
diff
changeset
|
3456 |
installAllAsAutoloaded |
8309f42ebf29
+ installAllAsAutoloaded function
Claus Gittinger <cg@exept.de>
parents:
3762
diff
changeset
|
3457 |
"install all classes found here as autoloaded classes" |
8309f42ebf29
+ installAllAsAutoloaded function
Claus Gittinger <cg@exept.de>
parents:
3762
diff
changeset
|
3458 |
|
8309f42ebf29
+ installAllAsAutoloaded function
Claus Gittinger <cg@exept.de>
parents:
3762
diff
changeset
|
3459 |
currentDirectory directoryContentsDo:[:fileNameString | |
8309f42ebf29
+ installAllAsAutoloaded function
Claus Gittinger <cg@exept.de>
parents:
3762
diff
changeset
|
3460 |
|fn| |
8309f42ebf29
+ installAllAsAutoloaded function
Claus Gittinger <cg@exept.de>
parents:
3762
diff
changeset
|
3461 |
|
8309f42ebf29
+ installAllAsAutoloaded function
Claus Gittinger <cg@exept.de>
parents:
3762
diff
changeset
|
3462 |
fn := (currentDirectory construct:fileNameString). |
8309f42ebf29
+ installAllAsAutoloaded function
Claus Gittinger <cg@exept.de>
parents:
3762
diff
changeset
|
3463 |
(fn hasSuffix:'st') ifTrue:[ |
8309f42ebf29
+ installAllAsAutoloaded function
Claus Gittinger <cg@exept.de>
parents:
3762
diff
changeset
|
3464 |
self installAsAutoloaded:fn |
8309f42ebf29
+ installAllAsAutoloaded function
Claus Gittinger <cg@exept.de>
parents:
3762
diff
changeset
|
3465 |
] |
8309f42ebf29
+ installAllAsAutoloaded function
Claus Gittinger <cg@exept.de>
parents:
3762
diff
changeset
|
3466 |
]. |
8309f42ebf29
+ installAllAsAutoloaded function
Claus Gittinger <cg@exept.de>
parents:
3762
diff
changeset
|
3467 |
! |
8309f42ebf29
+ installAllAsAutoloaded function
Claus Gittinger <cg@exept.de>
parents:
3762
diff
changeset
|
3468 |
|
8309f42ebf29
+ installAllAsAutoloaded function
Claus Gittinger <cg@exept.de>
parents:
3762
diff
changeset
|
3469 |
installAsAutoloaded:aFilename |
8309f42ebf29
+ installAllAsAutoloaded function
Claus Gittinger <cg@exept.de>
parents:
3762
diff
changeset
|
3470 |
"install aFilename as autoloaded class" |
8309f42ebf29
+ installAllAsAutoloaded function
Claus Gittinger <cg@exept.de>
parents:
3762
diff
changeset
|
3471 |
|
8309f42ebf29
+ installAllAsAutoloaded function
Claus Gittinger <cg@exept.de>
parents:
3762
diff
changeset
|
3472 |
|chunks s| |
8309f42ebf29
+ installAllAsAutoloaded function
Claus Gittinger <cg@exept.de>
parents:
3762
diff
changeset
|
3473 |
|
8309f42ebf29
+ installAllAsAutoloaded function
Claus Gittinger <cg@exept.de>
parents:
3762
diff
changeset
|
3474 |
chunks := ChangeSet fromStream:(s := aFilename asFilename readStream). s close. |
8309f42ebf29
+ installAllAsAutoloaded function
Claus Gittinger <cg@exept.de>
parents:
3762
diff
changeset
|
3475 |
chunks |
8309f42ebf29
+ installAllAsAutoloaded function
Claus Gittinger <cg@exept.de>
parents:
3762
diff
changeset
|
3476 |
select:[:eachChunk | eachChunk isClassDefinitionChange] |
8309f42ebf29
+ installAllAsAutoloaded function
Claus Gittinger <cg@exept.de>
parents:
3762
diff
changeset
|
3477 |
thenDo:[:eachClassChunk | eachClassChunk installAsAutoloadedClassIfNotPrivate]. |
8309f42ebf29
+ installAllAsAutoloaded function
Claus Gittinger <cg@exept.de>
parents:
3762
diff
changeset
|
3478 |
! |
8309f42ebf29
+ installAllAsAutoloaded function
Claus Gittinger <cg@exept.de>
parents:
3762
diff
changeset
|
3479 |
|
1964 | 3480 |
loadImageAndPerform:aSelectorOrBlock |
1853 | 3481 |
|img path| |
3482 |
||
3483 |
self selectedFilesDo:[:fileName | |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3484 |
path := currentDirectory filenameFor:fileName. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3485 |
path isDirectory ifFalse:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3486 |
img := Image fromFile:(path pathName). |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3487 |
img notNil ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3488 |
aSelectorOrBlock isSymbol ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3489 |
img perform:aSelectorOrBlock |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3490 |
] ifFalse:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3491 |
aSelectorOrBlock value:img |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3492 |
] |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3493 |
] ifFalse:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3494 |
self warn:'unknown format: ' , fileName |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3495 |
] |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3496 |
] |
1853 | 3497 |
]. |
3498 |
||
3499 |
"Modified: / 17.9.1995 / 17:41:24 / claus" |
|
3500 |
"Modified: / 18.9.1997 / 17:05:04 / stefan" |
|
3501 |
"Created: / 26.8.1998 / 16:20:18 / cg" |
|
3502 |
! |
|
3503 |
||
172 | 3504 |
newDirectory |
3505 |
"ask for and create a new directory" |
|
3506 |
||
3507 |
|queryBox| |
|
3508 |
||
3509 |
queryBox := FilenameEnterBox |
|
3280 | 3510 |
title:(resources at:'Create new directory:') withCRs |
3511 |
okText:(resources at:'Create') |
|
3512 |
action:[:newName | self doCreateDirectory:newName]. |
|
172 | 3513 |
queryBox showAtPointer |
1162 | 3514 |
|
3515 |
"Modified: 23.4.1997 / 13:04:27 / cg" |
|
172 | 3516 |
! |
3517 |
||
3518 |
newFile |
|
3519 |
"ask for and create a new file" |
|
3520 |
||
3521 |
|sel queryBox| |
|
3522 |
||
3523 |
queryBox := FilenameEnterBox |
|
3280 | 3524 |
title:(resources at:'Create new file:') withCRs |
3525 |
okText:(resources at:'Create') |
|
2512
35d2092df60f
autoselect a new created file
Claus Gittinger <cg@exept.de>
parents:
2504
diff
changeset
|
3526 |
action:[:newName | newName isEmpty ifFalse:[ |
35d2092df60f
autoselect a new created file
Claus Gittinger <cg@exept.de>
parents:
2504
diff
changeset
|
3527 |
self doCreateFile:newName. |
35d2092df60f
autoselect a new created file
Claus Gittinger <cg@exept.de>
parents:
2504
diff
changeset
|
3528 |
self selectFile:newName. |
35d2092df60f
autoselect a new created file
Claus Gittinger <cg@exept.de>
parents:
2504
diff
changeset
|
3529 |
] |
35d2092df60f
autoselect a new created file
Claus Gittinger <cg@exept.de>
parents:
2504
diff
changeset
|
3530 |
]. |
172 | 3531 |
sel := subView selection. |
3532 |
sel notNil ifTrue:[ |
|
2512
35d2092df60f
autoselect a new created file
Claus Gittinger <cg@exept.de>
parents:
2504
diff
changeset
|
3533 |
queryBox initialText:(sel asString) |
172 | 3534 |
]. |
3535 |
queryBox showAtPointer |
|
381 | 3536 |
|
1396 | 3537 |
"Modified: / 23.4.1997 / 13:04:38 / cg" |
3538 |
"Modified: / 16.1.1998 / 16:54:00 / stefan" |
|
172 | 3539 |
! |
3540 |
||
1834 | 3541 |
newHardLink |
3542 |
"ask for and create a hard link (unix only)" |
|
3543 |
||
3747
d30bc1e54f15
Remove unused vars and asFilename sends
Stefan Vogel <sv@exept.de>
parents:
3746
diff
changeset
|
3544 |
|sel box orgName1 name1 name2 f1 f2 err if1 if2| |
1834 | 3545 |
|
3546 |
sel := self getSelectedFileName. |
|
3547 |
||
3548 |
orgName1 := ''. |
|
3549 |
(sel size > 0) ifTrue:[ |
|
2868 | 3550 |
(currentDirectory construct:sel) isDirectory ifFalse:[ |
3551 |
orgName1 := sel |
|
3552 |
] |
|
1834 | 3553 |
]. |
3554 |
||
3555 |
name1 := orgName1 asValue. |
|
3556 |
name2 := '' asValue. |
|
3557 |
||
3558 |
box := DialogBox new. |
|
2035
307ed5143d8b
national language stuff - again
Claus Gittinger <cg@exept.de>
parents:
2031
diff
changeset
|
3559 |
(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
|
3560 |
if1 := box addFilenameInputFieldOn:name1 in:currentDirectory tabable:true. |
2035
307ed5143d8b
national language stuff - again
Claus Gittinger <cg@exept.de>
parents:
2031
diff
changeset
|
3561 |
(box addTextLabel:(resources string:'to:')) adjust:#left. |
3747
d30bc1e54f15
Remove unused vars and asFilename sends
Stefan Vogel <sv@exept.de>
parents:
3746
diff
changeset
|
3562 |
if2 := box addFilenameInputFieldOn:name2 in:currentDirectory tabable:true. |
1834 | 3563 |
|
2048 | 3564 |
box addAbortAndOkButtons. |
1834 | 3565 |
|
3566 |
orgName1 size > 0 ifTrue:[ |
|
2868 | 3567 |
box focusOnField:if2. |
1834 | 3568 |
]. |
3569 |
box showAtPointer. |
|
3570 |
||
3571 |
box accepted ifTrue:[ |
|
2868 | 3572 |
name1 := name1 value. |
3573 |
(name1 size == 0) ifTrue:[ |
|
3574 |
err := 'no name entered'. |
|
3575 |
] ifFalse:[ |
|
3576 |
f1 := name1 asFilename. |
|
3577 |
name2 := name2 value. |
|
3578 |
(name2 size == 0) ifTrue:[ |
|
3579 |
err := 'no name entered'. |
|
3580 |
] ifFalse:[ |
|
3581 |
f2 := name2 asFilename. |
|
3582 |
f2 exists ifTrue:[ |
|
3583 |
err := '''%2'' already exists'. |
|
3584 |
] ifFalse:[ |
|
3585 |
f1 exists ifFalse:[ |
|
3586 |
err := '''%1'' does not exist'. |
|
3587 |
] ifTrue:[ |
|
3588 |
f1 isDirectory ifTrue:[ |
|
3589 |
err := '''%1'' is a directory'. |
|
3590 |
] ifFalse:[ |
|
3591 |
ErrorSignal handle:[:ex | |
|
3592 |
err := ex errorString |
|
3593 |
] do:[ |
|
3594 |
OperatingSystem createHardLinkFrom:name1 to:name2 |
|
3595 |
] |
|
3596 |
] |
|
3597 |
] |
|
3598 |
] |
|
3599 |
] |
|
3600 |
]. |
|
3601 |
||
3602 |
err notNil ifTrue:[ |
|
3603 |
self warn:(resources string:err with:(name1 ? '') allBold with:(name2 ? '') allBold). |
|
3604 |
^ self |
|
3605 |
]. |
|
1834 | 3606 |
]. |
3607 |
||
3608 |
"Modified: / 13.8.1998 / 21:47:01 / cg" |
|
3609 |
! |
|
3610 |
||
3611 |
newSoftLink |
|
3612 |
"ask for and create a soft link (unix only)" |
|
3613 |
||
3747
d30bc1e54f15
Remove unused vars and asFilename sends
Stefan Vogel <sv@exept.de>
parents:
3746
diff
changeset
|
3614 |
|sel box orgName1 name1 name2 f1 f2 err if1 if2| |
1834 | 3615 |
|
3616 |
sel := self getSelectedFileName. |
|
3617 |
||
3618 |
orgName1 := ''. |
|
3619 |
(sel size > 0) ifTrue:[ |
|
2868 | 3620 |
orgName1 := sel |
1834 | 3621 |
]. |
3622 |
||
3623 |
name1 := orgName1 asValue. |
|
3624 |
name2 := '' asValue. |
|
3625 |
||
3626 |
box := DialogBox new. |
|
3627 |
(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
|
3628 |
if1 := box addFilenameInputFieldOn:name1 in:currentDirectory tabable:true. |
1834 | 3629 |
(box addTextLabel:'as:') adjust:#left. |
3747
d30bc1e54f15
Remove unused vars and asFilename sends
Stefan Vogel <sv@exept.de>
parents:
3746
diff
changeset
|
3630 |
if2 := box addFilenameInputFieldOn:name2 in:currentDirectory tabable:true. |
1834 | 3631 |
|
2048 | 3632 |
box addAbortAndOkButtons. |
1834 | 3633 |
|
3634 |
orgName1 size > 0 ifTrue:[ |
|
2868 | 3635 |
box focusOnField:if2. |
1834 | 3636 |
]. |
3637 |
box showAtPointer. |
|
3638 |
||
3639 |
box accepted ifTrue:[ |
|
2868 | 3640 |
name1 := name1 value. |
3641 |
(name1 size == 0) ifTrue:[ |
|
3642 |
err := 'no name entered'. |
|
3643 |
] ifFalse:[ |
|
3644 |
f1 := name1 asFilename. |
|
3645 |
name2 := name2 value. |
|
3646 |
(name2 size == 0) ifTrue:[ |
|
3647 |
err := 'no name entered'. |
|
3648 |
] ifFalse:[ |
|
3649 |
f2 := name2 asFilename. |
|
3650 |
f2 exists ifTrue:[ |
|
3651 |
err := '''%2'' already exists'. |
|
3652 |
] ifFalse:[ |
|
3653 |
f1 exists ifFalse:[ |
|
3654 |
err := '''%1'' does not exist (link created anyway)'. |
|
3655 |
]. |
|
3656 |
ErrorSignal handle:[:ex | |
|
3657 |
err := ex errorString |
|
3658 |
] do:[ |
|
3659 |
OperatingSystem createSymbolicLinkFrom:name1 to:name2 |
|
3660 |
] |
|
3661 |
] |
|
3662 |
] |
|
3663 |
]. |
|
3664 |
||
3665 |
err notNil ifTrue:[ |
|
3666 |
self warn:(resources string:err with:(name1 ? '') allBold with:(name2 ? '') allBold). |
|
3667 |
^ self |
|
3668 |
]. |
|
1834 | 3669 |
]. |
3670 |
||
3671 |
"Modified: / 13.8.1998 / 21:26:59 / cg" |
|
3672 |
"Created: / 13.8.1998 / 21:47:14 / cg" |
|
3673 |
! |
|
3674 |
||
2186 | 3675 |
openASN1Browser |
3676 |
self openTool:OSI::ASN1Browser |
|
3677 |
||
3678 |
"Modified: / 7.9.1998 / 21:31:58 / cg" |
|
3679 |
! |
|
3680 |
||
1286
2a464093d865
added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents:
1272
diff
changeset
|
3681 |
openAppletViewer |
2a464093d865
added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents:
1272
diff
changeset
|
3682 |
|numItems| |
2a464093d865
added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents:
1272
diff
changeset
|
3683 |
|
2a464093d865
added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents:
1272
diff
changeset
|
3684 |
(numItems := fileListView selection size) > 2 ifTrue:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3685 |
(self |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3686 |
confirm:(resources string:'open for each of the %1 items ?' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3687 |
with:numItems)) ifFalse:[^ self]. |
1286
2a464093d865
added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents:
1272
diff
changeset
|
3688 |
]. |
2a464093d865
added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents:
1272
diff
changeset
|
3689 |
|
1942 | 3690 |
Java startupJavaSystem. |
3691 |
"/ Java markAllClassesUninitialized. |
|
3692 |
"/ Java initAllStaticFields. |
|
3693 |
"/ Java initAllClasses. |
|
1286
2a464093d865
added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents:
1272
diff
changeset
|
3694 |
|
2a464093d865
added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents:
1272
diff
changeset
|
3695 |
self selectedFilesDo:[:fileName | |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3696 |
|p path| |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3697 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3698 |
path := currentDirectory filenameFor:fileName. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3699 |
path isDirectory ifFalse:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3700 |
p := Java |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3701 |
javaProcessForMainOf:(Java classForName:'sun.applet.AppletViewer') |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3702 |
argumentString:path pathName. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3703 |
p resume. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3704 |
] |
1286
2a464093d865
added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents:
1272
diff
changeset
|
3705 |
]. |
2a464093d865
added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents:
1272
diff
changeset
|
3706 |
|
1942 | 3707 |
"Modified: / 18.9.1997 / 17:00:59 / stefan" |
3708 |
"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
|
3709 |
! |
2a464093d865
added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents:
1272
diff
changeset
|
3710 |
|
2814 | 3711 |
openCBrowser |
3272 | 3712 |
self withWaitCursorDo:[ |
3767 | 3713 |
CBrowser::Browser openIn:currentDirectory. |
3272 | 3714 |
] |
2814 | 3715 |
! |
3716 |
||
172 | 3717 |
openChangesBrowser |
3718 |
"open a change browser on the selected file(s)" |
|
3719 |
||
1939
5947fefec5af
care for newChangesBrowser setting
Claus Gittinger <cg@exept.de>
parents:
1933
diff
changeset
|
3720 |
self openTool:(UserPreferences current changesBrowserClass) |
5947fefec5af
care for newChangesBrowser setting
Claus Gittinger <cg@exept.de>
parents:
1933
diff
changeset
|
3721 |
|
5947fefec5af
care for newChangesBrowser setting
Claus Gittinger <cg@exept.de>
parents:
1933
diff
changeset
|
3722 |
"Modified: / 17.10.1998 / 14:39:15 / cg" |
172 | 3723 |
! |
3724 |
||
252 | 3725 |
openDiffView |
3726 |
"open a diff-view" |
|
3727 |
||
1736
36cab4d1d655
remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents:
1735
diff
changeset
|
3728 |
|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
|
3729 |
|
2969
1ec854b0f2fd
openDiff-viewer - allow two-file-selection
Claus Gittinger <cg@exept.de>
parents:
2956
diff
changeset
|
3730 |
sel := fileListView selection. |
1ec854b0f2fd
openDiff-viewer - allow two-file-selection
Claus Gittinger <cg@exept.de>
parents:
2956
diff
changeset
|
3731 |
(sel size == 2) ifTrue:[ |
1ec854b0f2fd
openDiff-viewer - allow two-file-selection
Claus Gittinger <cg@exept.de>
parents:
2956
diff
changeset
|
3732 |
name1 := fileList at:sel first. |
1ec854b0f2fd
openDiff-viewer - allow two-file-selection
Claus Gittinger <cg@exept.de>
parents:
2956
diff
changeset
|
3733 |
name2 := fileList at:sel last. |
1ec854b0f2fd
openDiff-viewer - allow two-file-selection
Claus Gittinger <cg@exept.de>
parents:
2956
diff
changeset
|
3734 |
] ifFalse:[ |
1ec854b0f2fd
openDiff-viewer - allow two-file-selection
Claus Gittinger <cg@exept.de>
parents:
2956
diff
changeset
|
3735 |
sel := self getSelectedFileName. |
1ec854b0f2fd
openDiff-viewer - allow two-file-selection
Claus Gittinger <cg@exept.de>
parents:
2956
diff
changeset
|
3736 |
|
1ec854b0f2fd
openDiff-viewer - allow two-file-selection
Claus Gittinger <cg@exept.de>
parents:
2956
diff
changeset
|
3737 |
orgName1 := ''. |
1ec854b0f2fd
openDiff-viewer - allow two-file-selection
Claus Gittinger <cg@exept.de>
parents:
2956
diff
changeset
|
3738 |
(sel size > 0 |
1ec854b0f2fd
openDiff-viewer - allow two-file-selection
Claus Gittinger <cg@exept.de>
parents:
2956
diff
changeset
|
3739 |
and:[lastFileDiffDirectory notNil |
1ec854b0f2fd
openDiff-viewer - allow two-file-selection
Claus Gittinger <cg@exept.de>
parents:
2956
diff
changeset
|
3740 |
and:[lastFileDiffDirectory asFilename isDirectory]]) ifTrue:[ |
1ec854b0f2fd
openDiff-viewer - allow two-file-selection
Claus Gittinger <cg@exept.de>
parents:
2956
diff
changeset
|
3741 |
f := lastFileDiffDirectory asFilename construct:sel. |
1ec854b0f2fd
openDiff-viewer - allow two-file-selection
Claus Gittinger <cg@exept.de>
parents:
2956
diff
changeset
|
3742 |
(f exists |
1ec854b0f2fd
openDiff-viewer - allow two-file-selection
Claus Gittinger <cg@exept.de>
parents:
2956
diff
changeset
|
3743 |
and:[f isReadable]) ifTrue:[ |
1ec854b0f2fd
openDiff-viewer - allow two-file-selection
Claus Gittinger <cg@exept.de>
parents:
2956
diff
changeset
|
3744 |
orgName1 := f name |
1ec854b0f2fd
openDiff-viewer - allow two-file-selection
Claus Gittinger <cg@exept.de>
parents:
2956
diff
changeset
|
3745 |
] |
1ec854b0f2fd
openDiff-viewer - allow two-file-selection
Claus Gittinger <cg@exept.de>
parents:
2956
diff
changeset
|
3746 |
]. |
1ec854b0f2fd
openDiff-viewer - allow two-file-selection
Claus Gittinger <cg@exept.de>
parents:
2956
diff
changeset
|
3747 |
name1 := orgName1 asValue. |
1ec854b0f2fd
openDiff-viewer - allow two-file-selection
Claus Gittinger <cg@exept.de>
parents:
2956
diff
changeset
|
3748 |
name2 := self getSelectedFileName asValue. |
1ec854b0f2fd
openDiff-viewer - allow two-file-selection
Claus Gittinger <cg@exept.de>
parents:
2956
diff
changeset
|
3749 |
]. |
1ec854b0f2fd
openDiff-viewer - allow two-file-selection
Claus Gittinger <cg@exept.de>
parents:
2956
diff
changeset
|
3750 |
|
252 | 3751 |
here := currentDirectory pathName. |
3752 |
||
3753 |
box := DialogBox new. |
|
1852 | 3754 |
(box addTextLabel:'show difference between:\\file1 (empty for views contents):' withCRs) adjust:#left. |
252 | 3755 |
box addFilenameInputFieldOn:name1 in:here tabable:true. |
1852 | 3756 |
(box addTextLabel:'and file2:') adjust:#left. |
252 | 3757 |
box addFilenameInputFieldOn:name2 in:here tabable:true. |
3758 |
||
2048 | 3759 |
box addAbortAndOkButtons. |
252 | 3760 |
|
3761 |
box showAtPointer. |
|
3762 |
||
3763 |
box accepted ifTrue:[ |
|
2140
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3764 |
name1 := name1 value. |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3765 |
(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
|
3766 |
"/ text1 := subView contents. |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3767 |
text1 := subView list asStringCollection withTabs. |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3768 |
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
|
3769 |
name1 := nil. |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3770 |
l1 := 'browser contents' |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3771 |
] ifFalse:[ |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3772 |
name1 := currentDirectory filenameFor:name1. |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3773 |
name1 isReadable ifFalse:[ |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3774 |
nm := name1. |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3775 |
name1 exists ifFalse:[ |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3776 |
err := '%1 does not exist'. |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3777 |
] ifTrue:[ |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3778 |
err := '%1 is not readable' |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3779 |
]. |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3780 |
]. |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3781 |
l1 := name1 pathName |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3782 |
]. |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3783 |
|
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3784 |
name2 := currentDirectory filenameFor:name2 value. |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3785 |
err isNil ifTrue:[ |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3786 |
name2 isReadable ifFalse:[ |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3787 |
nm := name2. |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3788 |
name2 exists ifFalse:[ |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3789 |
err := '%1 does not exist'. |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3790 |
] ifTrue:[ |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3791 |
err := '%1 is not readable' |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3792 |
]. |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3793 |
]. |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3794 |
]. |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3795 |
err notNil ifTrue:[ |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3796 |
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
|
3797 |
^ self |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3798 |
]. |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3799 |
|
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3800 |
self withWaitCursorDo:[ |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3801 |
(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
|
3802 |
lastFileDiffDirectory := name1 directoryName |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3803 |
]. |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3804 |
name1 notNil ifTrue:[ |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3805 |
text1 := name1 contents. |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3806 |
]. |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3807 |
text2 := name2 contents. |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3808 |
text1 = text2 ifTrue:[ |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3809 |
self information:'same contents' |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3810 |
] ifFalse:[ |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3811 |
d := DiffTextView |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3812 |
openOn:text1 label:l1 |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3813 |
and:text2 label:name2 pathName. |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3814 |
d label:'file differences'. |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3815 |
] |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3816 |
] |
252 | 3817 |
]. |
3818 |
||
1735
57ebbb06fcd7
only show an infoBox, if files have the same contents
Claus Gittinger <cg@exept.de>
parents:
1732
diff
changeset
|
3819 |
"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
|
3820 |
"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
|
3821 |
"Modified: / 5.5.1999 / 16:04:10 / cg" |
267 | 3822 |
! |
3823 |
||
3824 |
openEditor |
|
3825 |
self openTool:EditTextView |
|
3826 |
! |
|
3827 |
||
3828 |
openHTMLReader |
|
1874 | 3829 |
self openTool:HTMLDocumentView ignoreDirectories:false |
3830 |
||
3831 |
"Modified: / 7.9.1998 / 21:31:58 / cg" |
|
267 | 3832 |
! |
3833 |
||
1834 | 3834 |
openImageEditor |
1874 | 3835 |
[self loadImageAndPerform:#edit] fork |
1834 | 3836 |
|
3837 |
"Modified: / 17.9.1995 / 17:41:24 / claus" |
|
3838 |
"Modified: / 18.9.1997 / 17:05:04 / stefan" |
|
3839 |
"Created: / 13.8.1998 / 22:07:09 / cg" |
|
1874 | 3840 |
"Modified: / 7.9.1998 / 21:31:41 / cg" |
1834 | 3841 |
! |
3842 |
||
267 | 3843 |
openImageInspector |
1874 | 3844 |
[self loadImageAndPerform:#inspect] fork |
1853 | 3845 |
|
3846 |
"Modified: / 17.9.1995 / 17:41:24 / claus" |
|
3847 |
"Modified: / 18.9.1997 / 17:05:04 / stefan" |
|
1874 | 3848 |
"Modified: / 7.9.1998 / 21:31:30 / cg" |
267 | 3849 |
! |
3850 |
||
1964 | 3851 |
openImagePreview |
3852 |
[self loadImageAndPerform:[:img | |
|
3661 | 3853 |
|i top viewer imgFileName| |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3854 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3855 |
top := StandardSystemView new. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3856 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3857 |
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
|
3858 |
i := img. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3859 |
top extent:200@200. |
3661 | 3860 |
imgFileName := img fileName asFilename. |
3861 |
top label:(imgFileName directoryName asFilename baseName , '/' , imgFileName baseName). |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3862 |
top openAndWait. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3863 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3864 |
(i width > 200 or:[i height > 200]) ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3865 |
i := i magnifiedPreservingRatioTo:200@200. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3866 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3867 |
viewer image:i. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3868 |
]. |
1964 | 3869 |
] fork |
1969 | 3870 |
|
3871 |
"Modified: / 4.12.1998 / 15:49:03 / cg" |
|
1964 | 3872 |
! |
3873 |
||
3001 | 3874 |
openMP3Player |
3875 |
|file| |
|
3876 |
||
3877 |
file := self getSelectedFileName. |
|
3878 |
(file isNil) ifTrue:[ |
|
3879 |
^ self. |
|
3880 |
]. |
|
3881 |
file := currentDirectory filenameFor:file. |
|
3882 |
(MP3PlayerApplication ? SaugFix::MP3PlayerApplication) playSong:file. |
|
3883 |
! |
|
3884 |
||
1994 | 3885 |
openSelectedFilename |
3886 |
|sel| |
|
3887 |
||
3888 |
sel := subView selection. |
|
3889 |
sel notNil ifTrue:[ |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3890 |
sel := sel asString withoutSeparators. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3891 |
sel asFilename exists ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3892 |
self doOpenFile:sel viaDoubleClick:false |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3893 |
] |
1994 | 3894 |
]. |
3895 |
||
3896 |
"Created: / 4.2.1999 / 17:40:42 / cg" |
|
3897 |
"Modified: / 4.2.1999 / 17:47:06 / cg" |
|
3898 |
! |
|
3899 |
||
3536 | 3900 |
openSlideShow |
3901 |
CodingExamples_GUI::SlideShow openIn:currentDirectory |
|
3902 |
||
3903 |
"Created: / 29.12.2001 / 21:56:34 / cg" |
|
3904 |
! |
|
3905 |
||
2825
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
3906 |
openSnapshotImageBrowser |
2844 | 3907 |
^ self openTool:SystemBrowser with:#openOnSnapShotImage: ignoreDirectories:true |
3908 |
! |
|
2825
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
3909 |
|
1731 | 3910 |
openTerminal |
1732 | 3911 |
VT100TerminalView openShellIn:currentDirectory |
1731 | 3912 |
|
3913 |
"Created: / 20.7.1998 / 18:18:15 / cg" |
|
1732 | 3914 |
"Modified: / 20.7.1998 / 18:32:28 / cg" |
1731 | 3915 |
! |
3916 |
||
267 | 3917 |
openTool:aToolClass |
3918 |
"open a tool on the selected file(s)" |
|
3919 |
||
2015 | 3920 |
^ self openTool:aToolClass ignoreDirectories:true |
1874 | 3921 |
|
3922 |
"Modified: / 7.9.1998 / 19:32:10 / cg" |
|
3923 |
! |
|
3924 |
||
3925 |
openTool:aToolClass ignoreDirectories:ignoreDirs |
|
3926 |
"open a tool on the selected file(s)" |
|
3927 |
||
2825
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
3928 |
^ self |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
3929 |
openTool:aToolClass |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
3930 |
with:#openOn: |
2844 | 3931 |
ignoreDirectories:ignoreDirs |
3932 |
! |
|
2825
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
3933 |
|
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
3934 |
openTool:aToolClass with:aSelector ignoreDirectories:ignoreDirs |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
3935 |
"open a tool on the selected file(s)" |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
3936 |
|
2015 | 3937 |
|numItems path tool| |
865
48395e8ecca9
remember executeCommand actions in history as well.
Claus Gittinger <cg@exept.de>
parents:
851
diff
changeset
|
3938 |
|
1883 | 3939 |
aToolClass isNil ifTrue:[ |
2170 | 3940 |
self warn:'Sorry, that tool seems to be not available'. |
3941 |
^ nil. |
|
1883 | 3942 |
]. |
3943 |
||
865
48395e8ecca9
remember executeCommand actions in history as well.
Claus Gittinger <cg@exept.de>
parents:
851
diff
changeset
|
3944 |
(numItems := fileListView selection size) > 2 ifTrue:[ |
2170 | 3945 |
(self |
3946 |
confirm:(resources string:'open for each of the %1 items ?' |
|
3947 |
with:numItems)) ifFalse:[^ self]. |
|
865
48395e8ecca9
remember executeCommand actions in history as well.
Claus Gittinger <cg@exept.de>
parents:
851
diff
changeset
|
3948 |
]. |
48395e8ecca9
remember executeCommand actions in history as well.
Claus Gittinger <cg@exept.de>
parents:
851
diff
changeset
|
3949 |
|
3272 | 3950 |
self withWaitCursorDo:[ |
3951 |
self selectedFilesDo:[:fileName | |
|
3952 |
path := currentDirectory filenameFor:fileName. |
|
3461 | 3953 |
(ignoreDirs not or:[path isDirectory not]) ifTrue:[ |
3954 |
path isAbsolute ifTrue:[ |
|
3955 |
path := path getName. |
|
3956 |
] ifFalse:[ |
|
3957 |
path := path pathName. |
|
3958 |
]. |
|
3959 |
tool := aToolClass perform:aSelector with:path. |
|
3272 | 3960 |
] |
3961 |
]. |
|
267 | 3962 |
]. |
2015 | 3963 |
^ tool |
865
48395e8ecca9
remember executeCommand actions in history as well.
Claus Gittinger <cg@exept.de>
parents:
851
diff
changeset
|
3964 |
|
1874 | 3965 |
"Modified: / 18.9.1997 / 17:06:18 / stefan" |
3966 |
"Created: / 7.9.1998 / 19:31:49 / cg" |
|
2844 | 3967 |
"Modified: / 25.5.1999 / 16:30:35 / cg" |
3968 |
! |
|
1156
f3df28086973
dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents:
1154
diff
changeset
|
3969 |
|
1853 | 3970 |
openZipTool |
2015 | 3971 |
|zipTool| |
3972 |
||
2170 | 3973 |
(zipTool := self openTool:ZipTool) notNil ifTrue:[ |
3974 |
zipTool initialExtractDirectory:currentDirectory |
|
3975 |
]. |
|
1853 | 3976 |
|
3977 |
"Created: / 26.8.1998 / 16:20:55 / cg" |
|
2170 | 3978 |
"Modified: / 25.5.1999 / 16:30:54 / cg" |
1853 | 3979 |
! |
3980 |
||
2567
dd029fea485d
added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents:
2562
diff
changeset
|
3981 |
readAbbrevFile |
3398 | 3982 |
"read the abbrev file and install classes found there as autoloaded classes" |
3983 |
||
3747
d30bc1e54f15
Remove unused vars and asFilename sends
Stefan Vogel <sv@exept.de>
parents:
3746
diff
changeset
|
3984 |
|sel| |
d30bc1e54f15
Remove unused vars and asFilename sends
Stefan Vogel <sv@exept.de>
parents:
3746
diff
changeset
|
3985 |
|
3555 | 3986 |
sel := fileListView selection. |
3987 |
sel size == 0 ifTrue:[ |
|
3747
d30bc1e54f15
Remove unused vars and asFilename sends
Stefan Vogel <sv@exept.de>
parents:
3746
diff
changeset
|
3988 |
Smalltalk installAutoloadedClassesFrom:(currentDirectory construct:'abbrev.stc'). |
3555 | 3989 |
^ self |
3990 |
]. |
|
3991 |
sel do:[:eachIndex | |
|
3992 |
|f| |
|
3993 |
||
3994 |
f := fileList at:eachIndex ifAbsent:nil. |
|
3747
d30bc1e54f15
Remove unused vars and asFilename sends
Stefan Vogel <sv@exept.de>
parents:
3746
diff
changeset
|
3995 |
f := currentDirectory construct:f. |
3555 | 3996 |
f isDirectory ifTrue:[ |
3997 |
f := f construct:'abbrev.stc' |
|
3998 |
]. |
|
3999 |
Smalltalk installAutoloadedClassesFrom:f. |
|
4000 |
]. |
|
2567
dd029fea485d
added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents:
2562
diff
changeset
|
4001 |
! |
dd029fea485d
added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents:
2562
diff
changeset
|
4002 |
|
2951
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
4003 |
revisitFile:aFileName |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
4004 |
|lineNr| |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
4005 |
|
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
4006 |
(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
|
4007 |
yesButton:'proceed') ifFalse:[ ^self ]. |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
4008 |
|
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
4009 |
self doChangeCurrentDirectoryTo:aFileName asFilename directory updateHistory:false. |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
4010 |
lineNr := fileList indexOf:aFileName asFilename baseName. |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
4011 |
fileListView selection:lineNr. |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
4012 |
self fileGet:true. |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
4013 |
|
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
4014 |
! |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
4015 |
|
1156
f3df28086973
dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents:
1154
diff
changeset
|
4016 |
showOrHideTabView |
f3df28086973
dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents:
1154
diff
changeset
|
4017 |
"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
|
4018 |
|
1834 | 4019 |
showingDetails value "showLongList" ifTrue:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4020 |
tabRulerView isNil ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4021 |
self createTabRulerIn:scrollView superView. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4022 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4023 |
tabRulerView beVisible. |
1758 | 4024 |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4025 |
false "self is3D" ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4026 |
scrollView topInset:(tabRulerView superView height). |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4027 |
tabRulerView superView leftInset:(fileListView originRelativeTo:scrollView) x. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4028 |
] ifFalse:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4029 |
scrollView topInset:(tabRulerView height). |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4030 |
tabRulerView leftInset:(fileListView originRelativeTo:scrollView) x. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4031 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4032 |
tabRulerView hiddenTabs:#(1). |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4033 |
tabRulerView fixedTabs:#(1). |
1156
f3df28086973
dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents:
1154
diff
changeset
|
4034 |
] ifFalse:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4035 |
tabRulerView notNil ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4036 |
tabRulerView beInvisible. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4037 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4038 |
scrollView topInset:0 |
1156
f3df28086973
dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents:
1154
diff
changeset
|
4039 |
]. |
f3df28086973
dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents:
1154
diff
changeset
|
4040 |
tabSpec := nil. |
f3df28086973
dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents:
1154
diff
changeset
|
4041 |
|
1758 | 4042 |
"Created: / 19.4.1997 / 09:50:02 / cg" |
1834 | 4043 |
"Modified: / 4.8.1998 / 13:44:14 / cg" |
172 | 4044 |
! ! |
4045 |
||
3328 | 4046 |
!FileBrowser methodsFor:'help'! |
172 | 4047 |
|
4048 |
helpTextFor:aComponent |
|
4049 |
|s| |
|
4050 |
||
4051 |
aComponent == subView ifTrue:[ |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4052 |
s := 'HELP_SUBVIEW' |
172 | 4053 |
]. |
4054 |
aComponent == fileListView ifTrue:[ |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4055 |
s := 'HELP_FILELIST' |
172 | 4056 |
]. |
4057 |
aComponent == filterField ifTrue:[ |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4058 |
s := 'HELP_FILTER' |
172 | 4059 |
]. |
4060 |
aComponent == labelView ifTrue:[ |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4061 |
s := 'HELP_PATHFIELD' |
172 | 4062 |
]. |
4063 |
aComponent == commandView ifTrue:[ |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4064 |
s := 'HELP_COMMANDVIEW' |
172 | 4065 |
]. |
4066 |
s notNil ifTrue:[ |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4067 |
^ resources string:s |
172 | 4068 |
]. |
4069 |
^ nil |
|
4070 |
! ! |
|
4071 |
||
2116 | 4072 |
!FileBrowser methodsFor:'initialize / release'! |
36 | 4073 |
|
1758 | 4074 |
createTabRulerIn:topFrame |
4075 |
|v| |
|
4076 |
||
4077 |
false "self is3D" ifTrue:[ |
|
2256
3ea6c549b035
let the tabRuler scroll with the fileList.
Claus Gittinger <cg@exept.de>
parents:
2255
diff
changeset
|
4078 |
v := View in:topFrame. |
3ea6c549b035
let the tabRuler scroll with the fileList.
Claus Gittinger <cg@exept.de>
parents:
2255
diff
changeset
|
4079 |
v level:-1. |
3ea6c549b035
let the tabRuler scroll with the fileList.
Claus Gittinger <cg@exept.de>
parents:
2255
diff
changeset
|
4080 |
tabRulerView := TabSpecRuler in:v. |
3ea6c549b035
let the tabRuler scroll with the fileList.
Claus Gittinger <cg@exept.de>
parents:
2255
diff
changeset
|
4081 |
tabRulerView level:1. |
3ea6c549b035
let the tabRuler scroll with the fileList.
Claus Gittinger <cg@exept.de>
parents:
2255
diff
changeset
|
4082 |
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
|
4083 |
tabRulerView origin:(0.0@0.0) corner:(1.0@1.0). |
1758 | 4084 |
] ifFalse:[ |
2256
3ea6c549b035
let the tabRuler scroll with the fileList.
Claus Gittinger <cg@exept.de>
parents:
2255
diff
changeset
|
4085 |
tabRulerView := TabSpecRuler in:topFrame. |
3ea6c549b035
let the tabRuler scroll with the fileList.
Claus Gittinger <cg@exept.de>
parents:
2255
diff
changeset
|
4086 |
tabRulerView origin:(0.0@0.0) corner:(1.0@10). |
1758 | 4087 |
]. |
4088 |
tabRulerView borderWidth:0. |
|
4089 |
tabRulerView synchronousOperation:true. |
|
2256
3ea6c549b035
let the tabRuler scroll with the fileList.
Claus Gittinger <cg@exept.de>
parents:
2255
diff
changeset
|
4090 |
tabRulerView masterView:scrollView scrolledView |
1758 | 4091 |
|
4092 |
"Created: / 27.7.1998 / 20:23:10 / cg" |
|
4093 |
"Modified: / 27.7.1998 / 20:30:10 / cg" |
|
4094 |
! |
|
4095 |
||
172 | 4096 |
currentDirectory:aDirectoryPath |
4097 |
"set the directory to be browsed" |
|
4098 |
||
2216
b84ee099f484
dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
4099 |
|newDirectory| |
b84ee099f484
dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
4100 |
|
b84ee099f484
dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
4101 |
newDirectory := aDirectoryPath asFilename. |
b84ee099f484
dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
4102 |
newDirectory = currentDirectory ifTrue:[ |
b84ee099f484
dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
4103 |
^ self |
b84ee099f484
dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
4104 |
]. |
b84ee099f484
dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
4105 |
|
3747
d30bc1e54f15
Remove unused vars and asFilename sends
Stefan Vogel <sv@exept.de>
parents:
3746
diff
changeset
|
4106 |
currentDirectory := newDirectory. |
172 | 4107 |
self changed:#path. |
1327 | 4108 |
|
172 | 4109 |
" |
4110 |
tell my subview (whatever that is) to start its file-dialog |
|
4111 |
(i.e. save-as etc.) in that directory |
|
4112 |
" |
|
4113 |
(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
|
4114 |
subView directoryForFileDialog:currentDirectory |
172 | 4115 |
] |
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
4116 |
|
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
4117 |
"Modified: 16.9.1997 / 14:56:17 / stefan" |
1327 | 4118 |
"Modified: 21.9.1997 / 11:28:49 / cg" |
172 | 4119 |
! |
4120 |
||
2116 | 4121 |
destroy |
4122 |
"destroy view and boxes" |
|
4123 |
||
4124 |
ObjectMemory removeDependent:self. |
|
4125 |
self stopUpdateProcess. |
|
4126 |
self stopImageRenderProcess. |
|
4127 |
checkBlock := nil. |
|
4128 |
super destroy |
|
4129 |
||
4130 |
"Modified: 19.4.1997 / 13:51:48 / cg" |
|
4131 |
! |
|
4132 |
||
172 | 4133 |
focusSequence |
4134 |
"return the sequence in which ALT-CursorRight steps focus" |
|
4135 |
||
4136 |
|fs| |
|
4137 |
||
2688
9bb22571f558
include menuPanel in focusSequence
Claus Gittinger <cg@exept.de>
parents:
2676
diff
changeset
|
4138 |
fs := Array |
9bb22571f558
include menuPanel in focusSequence
Claus Gittinger <cg@exept.de>
parents:
2676
diff
changeset
|
4139 |
with:menuPanel |
9bb22571f558
include menuPanel in focusSequence
Claus Gittinger <cg@exept.de>
parents:
2676
diff
changeset
|
4140 |
with:labelView |
9bb22571f558
include menuPanel in focusSequence
Claus Gittinger <cg@exept.de>
parents:
2676
diff
changeset
|
4141 |
with:filterField |
9bb22571f558
include menuPanel in focusSequence
Claus Gittinger <cg@exept.de>
parents:
2676
diff
changeset
|
4142 |
with:fileListView |
9bb22571f558
include menuPanel in focusSequence
Claus Gittinger <cg@exept.de>
parents:
2676
diff
changeset
|
4143 |
with:subView. |
172 | 4144 |
|
4145 |
commandView notNil ifTrue:[ |
|
2688
9bb22571f558
include menuPanel in focusSequence
Claus Gittinger <cg@exept.de>
parents:
2676
diff
changeset
|
4146 |
fs := fs copyWith:commandView |
172 | 4147 |
]. |
4148 |
^fs |
|
4149 |
! |
|
4150 |
||
4151 |
initEvents |
|
4152 |
super initEvents. |
|
4153 |
self enableEvent:#visibilityChange. |
|
4154 |
! |
|
4155 |
||
36 | 4156 |
initialize |
1102 | 4157 |
|frame spacing halfSpacing v topFrame labelFrame filterModel |
3527 | 4158 |
mH lowerFrame| |
36 | 4159 |
|
4160 |
super initialize. |
|
4161 |
||
819
b78a26650047
initialize fileEncoding to #iso8859
Claus Gittinger <cg@exept.de>
parents:
807
diff
changeset
|
4162 |
fileEncoding := #iso8859. "/ native ST/X encoding |
386
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
4163 |
|
52 | 4164 |
"if true, will replace leading spaces by tabs on |
4165 |
file write. If false, they will be written as spaces |
|
4166 |
" |
|
4167 |
compressTabs := resources at:'COMPRESS_TABS' default:true. |
|
4168 |
||
4169 |
" |
|
4170 |
showing long or short by default |
|
4171 |
" |
|
1834 | 4172 |
"/ showLongList := resources at:'LONG_LIST' default:false. |
4173 |
showingDetails := (resources at:'LONG_LIST' default:false) asValue. |
|
4174 |
showingDetails onChangeSend:#detailsSettingChanged to:self. |
|
52 | 4175 |
|
4176 |
" |
|
4177 |
show hidden files or not ? |
|
4178 |
" |
|
1834 | 4179 |
"/ showDotFiles := resources at:'SHOW_DOT_FILES' default:false. |
4180 |
showingHiddenFiles := (resources at:'SHOW_DOT_FILES' default:false) asValue. |
|
4181 |
showingHiddenFiles onChangeSend:#updateCurrentDirectory to:self. |
|
4182 |
||
2031 | 4183 |
" |
4184 |
showing small icons by default |
|
4185 |
" |
|
4186 |
showingBigImagePreview := (resources at:'BIG_IMAGE_PREVIEW' default:false) asValue. |
|
4187 |
showingBigImagePreview onChangeSend:#bigImagePreviewSettingChanged to:self. |
|
4188 |
||
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4189 |
showingTimeAndDate := (resources at:'SHOW_TIME_AND_DATE' default:false) asValue. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4190 |
showingTimeAndDate onChangeSend:#updateCurrentDirectory to:self. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4191 |
|
1834 | 4192 |
sortByWhat := #name asValue. |
4193 |
sortByWhat onChangeSend:#sortChanged to:self. |
|
4194 |
||
4195 |
sortCaseless := (Filename isCaseSensitive not) asValue. |
|
4196 |
sortCaseless onChangeSend:#updateCurrentDirectory to:self. |
|
52 | 4197 |
|
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
4198 |
dosEOLMode := false asValue. |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
4199 |
|
45 | 4200 |
lockUpdate := false. |
4201 |
||
132 | 4202 |
CommandHistory isNil ifTrue:[ |
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
4203 |
CommandHistory := OrderedCollection new. |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
4204 |
CommandHistorySize := 50 |
132 | 4205 |
]. |
36 | 4206 |
DirectoryHistory isNil ifTrue:[ |
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
4207 |
DirectoryHistory := OrderedCollection new. |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
4208 |
DirectoryHistoryWhere := OrderedCollection new. |
2951
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
4209 |
]. |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
4210 |
VisitedFileHistory isNil ifTrue:[ |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
4211 |
VisitedFileHistory := OrderedCollection new. |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
4212 |
]. |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
4213 |
HistorySize isNil ifTrue:[ |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
4214 |
HistorySize := 15 |
36 | 4215 |
]. |
132 | 4216 |
commandIndex := 0. |
36 | 4217 |
|
1784
329e3a904236
ask MIMETypes when mapping suffixes to icons.
Claus Gittinger <cg@exept.de>
parents:
1758
diff
changeset
|
4218 |
icons := Dictionary new. |
3861 | 4219 |
matchedIcons := OrderedCollection new. |
1495 | 4220 |
|
4221 |
Icons isNil ifTrue:[ |
|
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
4222 |
self class initializeIcons |
1495 | 4223 |
]. |
4224 |
||
36 | 4225 |
myName := (resources string:self class name). |
4226 |
self label:myName. |
|
45 | 4227 |
|
1834 | 4228 |
menuPanel := MenuPanel in:self. |
3242 | 4229 |
"/ menuPanel level:1. |
1834 | 4230 |
menuPanel verticalLayout:false. |
4231 |
menuPanel receiver:self. |
|
4232 |
menuPanel menu:(self pullDownMenu). |
|
2050 | 4233 |
|
1834 | 4234 |
mH := menuPanel preferredExtent y. |
1846
6b66290db627
geometry fixes for win95 style
Claus Gittinger <cg@exept.de>
parents:
1845
diff
changeset
|
4235 |
menuPanel origin:(0.0 @ 0.0) corner:(1.0 @ (mH)). |
1834 | 4236 |
|
93 | 4237 |
labelFrame := View |
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
4238 |
origin:(0.0 @ mH) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
4239 |
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
|
4240 |
in:self. |
52 | 4241 |
|
3759
366d5ebc3f89
Use #isWindowsStyle instead of comparing to style name.
Stefan Vogel <sv@exept.de>
parents:
3747
diff
changeset
|
4242 |
(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
|
4243 |
labelFrame level:1. |
1879 | 4244 |
"/ labelFrame rightInset:-1. |
45 | 4245 |
]. |
36 | 4246 |
|
4247 |
spacing := ViewSpacing. |
|
4248 |
halfSpacing := spacing // 2. |
|
4249 |
||
1100
d9382b49c62d
Use #pushEvent: for timer handling.
Stefan Vogel <sv@exept.de>
parents:
1091
diff
changeset
|
4250 |
" |
d9382b49c62d
Use #pushEvent: for timer handling.
Stefan Vogel <sv@exept.de>
parents:
1091
diff
changeset
|
4251 |
checkBlock is executed by the Processor every checkDelta seconds. |
d9382b49c62d
Use #pushEvent: for timer handling.
Stefan Vogel <sv@exept.de>
parents:
1091
diff
changeset
|
4252 |
We use #pushEvent: to perform the directory update |
d9382b49c62d
Use #pushEvent: for timer handling.
Stefan Vogel <sv@exept.de>
parents:
1091
diff
changeset
|
4253 |
in our windowgroups process. |
d9382b49c62d
Use #pushEvent: for timer handling.
Stefan Vogel <sv@exept.de>
parents:
1091
diff
changeset
|
4254 |
" |
d9382b49c62d
Use #pushEvent: for timer handling.
Stefan Vogel <sv@exept.de>
parents:
1091
diff
changeset
|
4255 |
checkBlock := [self pushEvent:#checkIfDirectoryHasChanged]. |
45 | 4256 |
checkDelta := resources at:'CHECK_DELTA' default:10. |
2220
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
4257 |
doAutoUpdate := true asValue. |
36 | 4258 |
|
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
4259 |
currentDirectory := Filename currentDirectory. |
36 | 4260 |
|
344
3f881dbee13a
use a model for the filter field
Claus Gittinger <cg@exept.de>
parents:
333
diff
changeset
|
4261 |
filterModel := '*' asValue. |
45 | 4262 |
filterField := EditField in:labelFrame. |
1071 | 4263 |
filterField |
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
4264 |
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
|
4265 |
corner:(1.0 @ (filterField heightIncludingBorder + halfSpacing) ). |
1846
6b66290db627
geometry fixes for win95 style
Claus Gittinger <cg@exept.de>
parents:
1845
diff
changeset
|
4266 |
filterField rightInset:(ViewSpacing - halfSpacing). |
344
3f881dbee13a
use a model for the filter field
Claus Gittinger <cg@exept.de>
parents:
333
diff
changeset
|
4267 |
filterField model:filterModel. |
45 | 4268 |
|
1846
6b66290db627
geometry fixes for win95 style
Claus Gittinger <cg@exept.de>
parents:
1845
diff
changeset
|
4269 |
labelFrame corner:(1.0 @ (mH + ViewSpacing + filterField height + halfSpacing)). |
6b66290db627
geometry fixes for win95 style
Claus Gittinger <cg@exept.de>
parents:
1845
diff
changeset
|
4270 |
|
36 | 4271 |
self initializeFilterPattern. |
344
3f881dbee13a
use a model for the filter field
Claus Gittinger <cg@exept.de>
parents:
333
diff
changeset
|
4272 |
filterModel onChangeSend:#filterPatternChanged to:self. |
3f881dbee13a
use a model for the filter field
Claus Gittinger <cg@exept.de>
parents:
333
diff
changeset
|
4273 |
"/ filterField leaveAction:[:key | fileListView scrollToTop. self updateCurrentDirectory]. |
36 | 4274 |
|
1327 | 4275 |
"/ labelView := Label in:labelFrame. |
4276 |
"/ labelView origin:(halfSpacing @ halfSpacing) |
|
4277 |
"/ extent:[((width // 4 * 3) - spacing - borderWidth) |
|
4278 |
"/ @ |
|
4279 |
"/ (filterField heightIncludingBorder) |
|
4280 |
"/ "(font height + font descent)" |
|
4281 |
"/ ]. |
|
4282 |
"/ labelView adjust:#right. |
|
4283 |
"/ labelView borderWidth:0. |
|
4284 |
"/ labelView model:self; menu:#labelMenu; aspect:#path; labelMessage:#path. |
|
4285 |
"/ labelFrame model:self; menu:#labelMenu. |
|
4286 |
||
4287 |
labelView := FilenameEditField in:labelFrame. |
|
4288 |
labelView |
|
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
4289 |
origin:(halfSpacing @ (halfSpacing)) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
4290 |
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
|
4291 |
@ |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
4292 |
(filterField heightIncludingBorder) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
4293 |
"(font height + font descent)" |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
4294 |
]. |
1834 | 4295 |
labelView menu:#labelMenu; |
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
4296 |
aspect:#path; changeMessage:#pathChanged:. |
1327 | 4297 |
labelView model:self. |
2216
b84ee099f484
dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
4298 |
labelView acceptOnExpand:true. |
1327 | 4299 |
labelView backgroundColor:(labelFrame viewBackground). |
73 | 4300 |
labelFrame model:self; menu:#labelMenu. |
1329 | 4301 |
labelView cursorType:#solidCaret; cursorTypeNoFocus:#none. |
4302 |
labelView level:0. |
|
4303 |
labelView borderWidth:0. |
|
4304 |
||
4305 |
killButton := Button label:(resources string:'kill') in:self. |
|
4306 |
"/ killButton origin:(halfSpacing @ halfSpacing) |
|
4307 |
"/ extent:(killButton width @ filterField height). |
|
4308 |
killButton origin:(halfSpacing @ 1.0). |
|
4309 |
killButton topInset:(killButton height negated). |
|
4310 |
killButton beInvisible. |
|
4311 |
||
4312 |
pauseToggle := Toggle label:(resources string:'pause') in:self. |
|
4313 |
"/ pauseToggle origin:((killButton corner x + 50) @ halfSpacing) |
|
4314 |
"/ extent:(pauseToggle width @ filterField height). |
|
4315 |
pauseToggle origin:((killButton corner x + ViewSpacing + 20) @ 1.0). |
|
4316 |
pauseToggle topInset:(pauseToggle height negated). |
|
4317 |
pauseToggle beInvisible. |
|
36 | 4318 |
|
132 | 4319 |
self initializeCommandViewIn:self. |
4320 |
||
4321 |
"/ frame := VariableVerticalPanel |
|
4322 |
"/ origin:[frame borderWidth negated |
|
4323 |
"/ @ |
|
4324 |
"/ labelFrame height |
|
4325 |
"/ "/ (labelView height + labelView origin y + spacing) |
|
4326 |
"/ ] |
|
4327 |
"/ corner:(1.0 @ 1.0) |
|
4328 |
"/ in:self. |
|
4329 |
||
1834 | 4330 |
frame := VariableVerticalPanel origin:0.0@mH corner:1.0@1.0 in:self. |
2739 | 4331 |
frame snapMode:#both. |
132 | 4332 |
frame topInset:labelFrame height. |
4333 |
commandView notNil ifTrue:[ |
|
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
4334 |
frame bottomInset:(commandView height + spacing + spacing) |
132 | 4335 |
]. |
36 | 4336 |
|
1102 | 4337 |
topFrame := View in:frame. |
36 | 4338 |
topFrame origin:(0.0 @ 0.0) corner:(1.0 @ 0.3). |
4339 |
||
1758 | 4340 |
false ifTrue:[ |
4341 |
self createTabRulerIn:topFrame. |
|
4342 |
]. |
|
1102 | 4343 |
|
4344 |
scrollView := ScrollableView in:topFrame. |
|
2252 | 4345 |
scrollView |
2255
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
4346 |
verticalScrollable:true; |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
4347 |
verticalMini:false; |
2252 | 4348 |
horizontalScrollable:true; |
4349 |
horizontalMini:true; |
|
4350 |
autoHideHorizontalScrollBar:true; |
|
2255
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
4351 |
autoHideVerticalScrollBar:false; |
2252 | 4352 |
origin:(0.0 @ 0.0) corner:(1.0 @ 1.0). |
1102 | 4353 |
|
4354 |
fileListView := SelectionInListView new. |
|
4355 |
scrollView scrolledView:fileListView. |
|
36 | 4356 |
fileListView action:[:lineNr | self fileSelect:lineNr]. |
1326 | 4357 |
fileListView doubleClickAction:[:lineNr | self fileDoubleClick:lineNr]. |
36 | 4358 |
fileListView multipleSelectOk:true. |
1010 | 4359 |
fileListView delegate:self. |
98 | 4360 |
fileListView menuHolder:self; menuPerformer:self; menuMessage:#fileListMenu. |
1122
970fc7e88639
support drag out of my list.
Claus Gittinger <cg@exept.de>
parents:
1120
diff
changeset
|
4361 |
fileListView allowDrag:true. |
1156
f3df28086973
dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents:
1154
diff
changeset
|
4362 |
fileListView dragObjectConverter:[:obj | |
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
4363 |
|dir nm path idx| |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
4364 |
|
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
4365 |
nm := obj theObject asString. |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
4366 |
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
|
4367 |
idx == 0 ifTrue:[ |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
4368 |
"/ cannot happen ... |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
4369 |
nil |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
4370 |
] ifFalse:[ |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
4371 |
nm := fileList at:idx. |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
4372 |
dir := currentDirectory pathName asFilename. |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
4373 |
path := dir constructString:nm. |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
4374 |
DropObject newFile:path. |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
4375 |
] |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
4376 |
]. |
1158
ea2cd788ef59
delay tabView origin setting
Claus Gittinger <cg@exept.de>
parents:
1157
diff
changeset
|
4377 |
|
ea2cd788ef59
delay tabView origin setting
Claus Gittinger <cg@exept.de>
parents:
1157
diff
changeset
|
4378 |
"/ sigh - must be delayed - origin is not yet fixe |
ea2cd788ef59
delay tabView origin setting
Claus Gittinger <cg@exept.de>
parents:
1157
diff
changeset
|
4379 |
"/ tabRulerView leftInset:(fileListView originRelativeTo:scrollView) x. |
ea2cd788ef59
delay tabView origin setting
Claus Gittinger <cg@exept.de>
parents:
1157
diff
changeset
|
4380 |
"/ self showOrHideTabView. |
1102 | 4381 |
|
2094 | 4382 |
lowerFrame := View in:frame. |
4383 |
lowerFrame origin:(0.0 @ 0.3) corner:(1.0 @ 1.0). |
|
4384 |
||
4385 |
v := self initializeSubViewIn:lowerFrame. |
|
4386 |
||
36 | 4387 |
subView := v scrolledView. |
4388 |
(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
|
4389 |
subView directoryForFileDialog:currentDirectory |
36 | 4390 |
]. |
4391 |
||
1329 | 4392 |
"/ buttonPanel := HorizontalPanelView in:self. |
4393 |
"/ buttonPanel horizontalLayout:#leftSpace. |
|
4394 |
"/ buttonPanel verticalSpace:0. |
|
4395 |
"/ "/ buttonPanel verticalLayout:#top. |
|
4396 |
"/ buttonPanel borderWidth:0. |
|
4397 |
"/ |
|
4398 |
"/ buttonPanel |
|
4399 |
"/ origin:(0.5 @ halfSpacing) |
|
4400 |
"/ extent:[((width // 4) - spacing - borderWidth) |
|
4401 |
"/ @ |
|
4402 |
"/ (buttonPanel preferredExtent y max:(labelView height)) |
|
4403 |
"/ ]. |
|
4404 |
"/ "/ buttonPanel level:-1. |
|
4405 |
"/ |
|
4406 |
"/ upButton := Button in:buttonPanel. |
|
4407 |
"/ img := Image fromFile:'bitmaps/xpmBitmaps/document_images/tiny_yellow_dir_up.xpm'. |
|
4408 |
"/ upButton label:(img ? 'up'). |
|
4409 |
"/ upButton action:[self changeToParentDirectory]. |
|
1328 | 4410 |
|
36 | 4411 |
ObjectMemory addDependent:self. |
132 | 4412 |
|
1758 | 4413 |
"Modified: / 6.9.1995 / 20:26:06 / claus" |
4414 |
"Modified: / 16.9.1997 / 14:52:46 / stefan" |
|
2252 | 4415 |
"Modified: / 12.7.1999 / 12:59:47 / cg" |
36 | 4416 |
! |
4417 |
||
132 | 4418 |
initializeCommandViewIn:frame |
4419 |
"set up the command view - can be redefined in subclasses as empty, |
|
4420 |
if no commandView is wanted" |
|
4421 |
||
4422 |
||
4423 |
commandView := EditField origin:0.0@1.0 corner:1.0@1.0 in:frame. |
|
3499 | 4424 |
"/ commandView allInset:ViewSpacing//2. |
132 | 4425 |
commandView topInset:(commandView preferredExtent y negated - ViewSpacing). |
4426 |
||
133 | 4427 |
"/ commandView contents:'** no commands which require input here **'. |
132 | 4428 |
|
142 | 4429 |
commandView entryCompletionBlock:[:contents | |
2998
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
4430 |
|newString| |
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
4431 |
|
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
4432 |
newString := self entryCompletion:contents. |
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
4433 |
newString notNil ifTrue:[ |
2803
5c913909a56b
fileNameCompletion now does exactly that;
Claus Gittinger <cg@exept.de>
parents:
2796
diff
changeset
|
4434 |
commandView contents:newString. |
5c913909a56b
fileNameCompletion now does exactly that;
Claus Gittinger <cg@exept.de>
parents:
2796
diff
changeset
|
4435 |
commandView cursorToEndOfLine. |
2998
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
4436 |
]. |
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
4437 |
]. |
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
4438 |
|
132 | 4439 |
commandView leaveAction:[:key | |
2522
036e46c50ac9
care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents:
2512
diff
changeset
|
4440 |
|cmd nCmd empty| |
036e46c50ac9
care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents:
2512
diff
changeset
|
4441 |
|
036e46c50ac9
care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents:
2512
diff
changeset
|
4442 |
(key == #CursorDown |
036e46c50ac9
care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents:
2512
diff
changeset
|
4443 |
or:[key == #CursorUp]) ifTrue:[ |
036e46c50ac9
care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents:
2512
diff
changeset
|
4444 |
nCmd := CommandHistory size. |
036e46c50ac9
care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents:
2512
diff
changeset
|
4445 |
nCmd == 0 ifTrue:[ |
036e46c50ac9
care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents:
2512
diff
changeset
|
4446 |
empty := true |
036e46c50ac9
care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents:
2512
diff
changeset
|
4447 |
] ifFalse:[ |
036e46c50ac9
care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents:
2512
diff
changeset
|
4448 |
key == #CursorUp ifTrue:[ |
036e46c50ac9
care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents:
2512
diff
changeset
|
4449 |
commandIndex == nCmd ifTrue:[ |
036e46c50ac9
care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents:
2512
diff
changeset
|
4450 |
commandView flash. |
036e46c50ac9
care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents:
2512
diff
changeset
|
4451 |
]. |
036e46c50ac9
care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents:
2512
diff
changeset
|
4452 |
commandIndex := (commandIndex + 1) min:nCmd |
036e46c50ac9
care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents:
2512
diff
changeset
|
4453 |
] ifFalse:[ |
036e46c50ac9
care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents:
2512
diff
changeset
|
4454 |
commandIndex == 1 ifTrue:[ |
036e46c50ac9
care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents:
2512
diff
changeset
|
4455 |
commandView flash. |
036e46c50ac9
care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents:
2512
diff
changeset
|
4456 |
empty := true. |
036e46c50ac9
care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents:
2512
diff
changeset
|
4457 |
]. |
036e46c50ac9
care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents:
2512
diff
changeset
|
4458 |
commandIndex := (commandIndex - 1) max:1. |
036e46c50ac9
care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents:
2512
diff
changeset
|
4459 |
]. |
036e46c50ac9
care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents:
2512
diff
changeset
|
4460 |
]. |
036e46c50ac9
care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents:
2512
diff
changeset
|
4461 |
empty == true ifTrue:[ |
036e46c50ac9
care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents:
2512
diff
changeset
|
4462 |
commandView contents:nil |
036e46c50ac9
care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents:
2512
diff
changeset
|
4463 |
] ifFalse:[ |
036e46c50ac9
care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents:
2512
diff
changeset
|
4464 |
commandView contents:(CommandHistory at:commandIndex). |
036e46c50ac9
care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents:
2512
diff
changeset
|
4465 |
] |
036e46c50ac9
care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents:
2512
diff
changeset
|
4466 |
]. |
036e46c50ac9
care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents:
2512
diff
changeset
|
4467 |
key == #Return ifTrue:[ |
036e46c50ac9
care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents:
2512
diff
changeset
|
4468 |
cmd := commandView contents string. |
036e46c50ac9
care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents:
2512
diff
changeset
|
4469 |
|
036e46c50ac9
care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents:
2512
diff
changeset
|
4470 |
subView insertLine:( |
036e46c50ac9
care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents:
2512
diff
changeset
|
4471 |
Text string:('>> ' , cmd) |
036e46c50ac9
care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents:
2512
diff
changeset
|
4472 |
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
|
4473 |
"/ 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
|
4474 |
) |
036e46c50ac9
care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents:
2512
diff
changeset
|
4475 |
before:(subView cursorLine). |
036e46c50ac9
care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents:
2512
diff
changeset
|
4476 |
subView cursorDown:1. |
133 | 4477 |
|
4478 |
"/ subView insertStringAtCursor:cmd. |
|
4479 |
"/ subView insertCharAtCursor:(Character cr). |
|
132 | 4480 |
|
2522
036e46c50ac9
care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents:
2512
diff
changeset
|
4481 |
(cmd notNil and:[cmd notEmpty]) ifTrue:[ |
036e46c50ac9
care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents:
2512
diff
changeset
|
4482 |
self class addToCommandHistory:cmd for:nil. |
036e46c50ac9
care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents:
2512
diff
changeset
|
4483 |
self doExecuteCommand:cmd replace:false. |
036e46c50ac9
care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents:
2512
diff
changeset
|
4484 |
commandView contents:nil. |
036e46c50ac9
care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents:
2512
diff
changeset
|
4485 |
commandIndex := 0 |
036e46c50ac9
care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents:
2512
diff
changeset
|
4486 |
] |
036e46c50ac9
care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents:
2512
diff
changeset
|
4487 |
] |
132 | 4488 |
]. |
4489 |
||
3499 | 4490 |
"Modified: / 7.9.1995 / 15:48:45 / claus" |
4491 |
"Modified: / 18.9.1997 / 16:55:01 / stefan" |
|
4492 |
"Modified: / 10.12.2001 / 23:57:25 / cg" |
|
132 | 4493 |
! |
4494 |
||
172 | 4495 |
initializeFilterPattern |
4496 |
"set an initial matchpattern - can be redefined in subclasses" |
|
4497 |
||
344
3f881dbee13a
use a model for the filter field
Claus Gittinger <cg@exept.de>
parents:
333
diff
changeset
|
4498 |
filterField model value:'*' |
172 | 4499 |
! |
4500 |
||
4501 |
initializeSubViewIn:frame |
|
4502 |
"set up the contents view - can be redefined in subclasses for |
|
4503 |
different view types (SoundFileBrowser/ImageBrowsers etc.)" |
|
4504 |
||
2094 | 4505 |
|textView| |
4506 |
||
4507 |
textView := HVScrollableView |
|
2572
bdb14ce83fd0
also provide the currentFileInDirectory in doIts.
Claus Gittinger <cg@exept.de>
parents:
2567
diff
changeset
|
4508 |
for:CodeView |
bdb14ce83fd0
also provide the currentFileInDirectory in doIts.
Claus Gittinger <cg@exept.de>
parents:
2567
diff
changeset
|
4509 |
miniScrollerH:true |
bdb14ce83fd0
also provide the currentFileInDirectory in doIts.
Claus Gittinger <cg@exept.de>
parents:
2567
diff
changeset
|
4510 |
miniScrollerV:false |
bdb14ce83fd0
also provide the currentFileInDirectory in doIts.
Claus Gittinger <cg@exept.de>
parents:
2567
diff
changeset
|
4511 |
in:frame. |
2094 | 4512 |
textView origin:(0.0 @ 0.0) corner:(1.0 @ 1.0). |
4513 |
||
2095 | 4514 |
"/ imagePreviewView := HVScrollableView |
4515 |
"/ for:ImageView |
|
4516 |
"/ miniScrollerH:true |
|
4517 |
"/ miniScrollerV:false |
|
4518 |
"/ in:frame. |
|
4519 |
"/ imagePreviewView origin:(0.0 @ 0.0) corner:(1.0 @ 1.0). |
|
4520 |
"/ |
|
4521 |
"/ imagePreviewView beInvisible. |
|
2094 | 4522 |
|
2572
bdb14ce83fd0
also provide the currentFileInDirectory in doIts.
Claus Gittinger <cg@exept.de>
parents:
2567
diff
changeset
|
4523 |
textView doItAction:[:theCode | |
bdb14ce83fd0
also provide the currentFileInDirectory in doIts.
Claus Gittinger <cg@exept.de>
parents:
2567
diff
changeset
|
4524 |
PositionableStream currentFileInDirectoryQuerySignal |
3747
d30bc1e54f15
Remove unused vars and asFilename sends
Stefan Vogel <sv@exept.de>
parents:
3746
diff
changeset
|
4525 |
answer:currentDirectory |
2572
bdb14ce83fd0
also provide the currentFileInDirectory in doIts.
Claus Gittinger <cg@exept.de>
parents:
2567
diff
changeset
|
4526 |
do:[ |
bdb14ce83fd0
also provide the currentFileInDirectory in doIts.
Claus Gittinger <cg@exept.de>
parents:
2567
diff
changeset
|
4527 |
Compiler |
bdb14ce83fd0
also provide the currentFileInDirectory in doIts.
Claus Gittinger <cg@exept.de>
parents:
2567
diff
changeset
|
4528 |
evaluate:theCode |
bdb14ce83fd0
also provide the currentFileInDirectory in doIts.
Claus Gittinger <cg@exept.de>
parents:
2567
diff
changeset
|
4529 |
in:nil |
bdb14ce83fd0
also provide the currentFileInDirectory in doIts.
Claus Gittinger <cg@exept.de>
parents:
2567
diff
changeset
|
4530 |
receiver:nil |
2607 | 4531 |
notifying:textView |
2572
bdb14ce83fd0
also provide the currentFileInDirectory in doIts.
Claus Gittinger <cg@exept.de>
parents:
2567
diff
changeset
|
4532 |
logged:true |
bdb14ce83fd0
also provide the currentFileInDirectory in doIts.
Claus Gittinger <cg@exept.de>
parents:
2567
diff
changeset
|
4533 |
ifFail:nil |
bdb14ce83fd0
also provide the currentFileInDirectory in doIts.
Claus Gittinger <cg@exept.de>
parents:
2567
diff
changeset
|
4534 |
] |
bdb14ce83fd0
also provide the currentFileInDirectory in doIts.
Claus Gittinger <cg@exept.de>
parents:
2567
diff
changeset
|
4535 |
]. |
bdb14ce83fd0
also provide the currentFileInDirectory in doIts.
Claus Gittinger <cg@exept.de>
parents:
2567
diff
changeset
|
4536 |
|
2094 | 4537 |
^ textView. |
1158
ea2cd788ef59
delay tabView origin setting
Claus Gittinger <cg@exept.de>
parents:
1157
diff
changeset
|
4538 |
! |
ea2cd788ef59
delay tabView origin setting
Claus Gittinger <cg@exept.de>
parents:
1157
diff
changeset
|
4539 |
|
1247 | 4540 |
postRealize |
4541 |
super postRealize. |
|
1158
ea2cd788ef59
delay tabView origin setting
Claus Gittinger <cg@exept.de>
parents:
1157
diff
changeset
|
4542 |
self showOrHideTabView. |
ea2cd788ef59
delay tabView origin setting
Claus Gittinger <cg@exept.de>
parents:
1157
diff
changeset
|
4543 |
|
1247 | 4544 |
"Created: 24.7.1997 / 18:13:46 / cg" |
172 | 4545 |
! ! |
4546 |
||
1834 | 4547 |
!FileBrowser methodsFor:'menu actions'! |
4548 |
||
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4549 |
addBookmark |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4550 |
self addBookmark:currentDirectory asFilename pathName |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4551 |
! |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4552 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4553 |
addBookmark:path |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4554 |
|idx| |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4555 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4556 |
DirectoryBookmarks isNil ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4557 |
DirectoryBookmarks := OrderedCollection new |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4558 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4559 |
idx := DirectoryBookmarks indexOf:path. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4560 |
idx == 0 ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4561 |
"/ DirectoryBookmarks size >= HistorySize ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4562 |
"/ DirectoryBookmarks removeLast. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4563 |
"/ ]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4564 |
DirectoryBookmarks addLast:path. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4565 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4566 |
! |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4567 |
|
1950 | 4568 |
copyCommandHistory |
4569 |
"copy the command history to the clipBoard" |
|
4570 |
||
4571 |
self setTextSelection:(CommandHistory asStringCollection asString). |
|
4572 |
||
4573 |
"Modified: / 29.10.1998 / 12:17:14 / cg" |
|
4574 |
! |
|
4575 |
||
1837 | 4576 |
copyFileList |
4577 |
"copy fileList to the clipBoard" |
|
4578 |
||
4579 |
self setTextSelection:(fileListView list |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4580 |
collect:[:l | |ll| |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4581 |
ll := l string withoutSeparators. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4582 |
(ll endsWith:' ...') ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4583 |
ll copyWithoutLast:4 |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4584 |
] ifFalse:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4585 |
ll |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4586 |
] |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4587 |
]) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4588 |
asStringCollection asString. |
1837 | 4589 |
|
4590 |
"Modified: / 17.8.1998 / 10:13:10 / cg" |
|
4591 |
! |
|
4592 |
||
1920
adffddc8cfc2
added #copyFilename (to clipboard)
Claus Gittinger <cg@exept.de>
parents:
1912
diff
changeset
|
4593 |
copySelectedFileName |
adffddc8cfc2
added #copyFilename (to clipboard)
Claus Gittinger <cg@exept.de>
parents:
1912
diff
changeset
|
4594 |
"copy the selected filename to the clipBoard (for easy paste)" |
adffddc8cfc2
added #copyFilename (to clipboard)
Claus Gittinger <cg@exept.de>
parents:
1912
diff
changeset
|
4595 |
|
adffddc8cfc2
added #copyFilename (to clipboard)
Claus Gittinger <cg@exept.de>
parents:
1912
diff
changeset
|
4596 |
|sel fileName| |
adffddc8cfc2
added #copyFilename (to clipboard)
Claus Gittinger <cg@exept.de>
parents:
1912
diff
changeset
|
4597 |
|
adffddc8cfc2
added #copyFilename (to clipboard)
Claus Gittinger <cg@exept.de>
parents:
1912
diff
changeset
|
4598 |
sel := fileListView selection. |
adffddc8cfc2
added #copyFilename (to clipboard)
Claus Gittinger <cg@exept.de>
parents:
1912
diff
changeset
|
4599 |
sel size == 1 ifTrue:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4600 |
fileName := fileList at:sel first. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4601 |
self setTextSelection:fileName |
1920
adffddc8cfc2
added #copyFilename (to clipboard)
Claus Gittinger <cg@exept.de>
parents:
1912
diff
changeset
|
4602 |
]. |
adffddc8cfc2
added #copyFilename (to clipboard)
Claus Gittinger <cg@exept.de>
parents:
1912
diff
changeset
|
4603 |
! |
adffddc8cfc2
added #copyFilename (to clipboard)
Claus Gittinger <cg@exept.de>
parents:
1912
diff
changeset
|
4604 |
|
3010 | 4605 |
copySelectedPathName |
4606 |
"copy the selected files pathname to the clipBoard (for easy paste)" |
|
4607 |
||
4608 |
|sel fileName| |
|
4609 |
||
4610 |
sel := fileListView selection. |
|
4611 |
sel size == 1 ifTrue:[ |
|
4612 |
fileName := currentDirectory constructString:(fileList at:sel first). |
|
4613 |
self setTextSelection:fileName |
|
4614 |
]. |
|
4615 |
! |
|
4616 |
||
2562
da7680fe8407
first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents:
2550
diff
changeset
|
4617 |
createProjectAndOpenProjectBrowser |
da7680fe8407
first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents:
2550
diff
changeset
|
4618 |
|nm f s| |
da7680fe8407
first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents:
2550
diff
changeset
|
4619 |
|
da7680fe8407
first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents:
2550
diff
changeset
|
4620 |
nm := currentDirectory baseName. |
da7680fe8407
first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents:
2550
diff
changeset
|
4621 |
f := (currentDirectory construct:nm) withSuffix:'prj'. |
da7680fe8407
first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents:
2550
diff
changeset
|
4622 |
f exists ifTrue:[ |
da7680fe8407
first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents:
2550
diff
changeset
|
4623 |
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
|
4624 |
^ self. |
da7680fe8407
first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents:
2550
diff
changeset
|
4625 |
]. |
da7680fe8407
first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents:
2550
diff
changeset
|
4626 |
s := f writeStream. |
da7680fe8407
first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents:
2550
diff
changeset
|
4627 |
s nextPutAll:' |
da7680fe8407
first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents:
2550
diff
changeset
|
4628 |
name ''' , nm , ''' |
da7680fe8407
first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents:
2550
diff
changeset
|
4629 |
type #classLibrary |
da7680fe8407
first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents:
2550
diff
changeset
|
4630 |
package #''private:' , nm , ''' |
da7680fe8407
first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents:
2550
diff
changeset
|
4631 |
prerequisites nil |
da7680fe8407
first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents:
2550
diff
changeset
|
4632 |
|
da7680fe8407
first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents:
2550
diff
changeset
|
4633 |
classes #( ) |
da7680fe8407
first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents:
2550
diff
changeset
|
4634 |
'. |
da7680fe8407
first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents:
2550
diff
changeset
|
4635 |
s close. |
da7680fe8407
first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents:
2550
diff
changeset
|
4636 |
ProjectBrowser openOnFile:f. |
da7680fe8407
first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents:
2550
diff
changeset
|
4637 |
! |
da7680fe8407
first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents:
2550
diff
changeset
|
4638 |
|
1834 | 4639 |
menuExit |
4640 |
self closeRequest |
|
4641 |
||
4642 |
"Created: / 4.8.1998 / 13:41:38 / cg" |
|
4643 |
! |
|
4644 |
||
4645 |
menuOSCommand |
|
4646 |
self fileExecute |
|
4647 |
||
4648 |
"Created: / 4.8.1998 / 14:06:54 / cg" |
|
4649 |
! |
|
4650 |
||
4651 |
menuShowFileBrowserDocumentation |
|
4652 |
||
4653 |
"Created: / 4.8.1998 / 14:03:57 / cg" |
|
4654 |
! |
|
4655 |
||
4656 |
openAboutThisApplication |
|
4657 |
"opens an about box for this application." |
|
4658 |
||
3503 | 4659 |
DialogBox aboutClass:self class. |
4660 |
"/ |rev myClass clsRev msg| |
|
4661 |
"/ |
|
4662 |
"/ rev := ''. |
|
4663 |
"/ myClass := self class. |
|
4664 |
"/ |
|
4665 |
"/ (clsRev := myClass revision) notNil ifTrue: [rev := ' (rev: ', clsRev printString, ')']. |
|
4666 |
"/ |
|
4667 |
"/ msg := '\' withCRs , myClass name asBoldText, rev. |
|
4668 |
"/ |
|
4669 |
"/ AboutBox isNil ifTrue:[ |
|
4670 |
"/ "/ this handles bad installations of ST/X, |
|
4671 |
"/ "/ where the AboutBox is missing. |
|
4672 |
"/ "/ (May vanish in the future) |
|
4673 |
"/ ^ self information:msg |
|
4674 |
"/ ]. |
|
4675 |
"/ |
|
4676 |
"/ Dialog |
|
4677 |
"/ about:(resources string:msg) |
|
4678 |
"/ label:(resources string:'About FileBrowser') |
|
4679 |
"/ icon:self class defaultIcon |
|
4680 |
"/ |
|
4681 |
"/ "Modified: / 17.11.2001 / 23:07:25 / cg" |
|
1834 | 4682 |
! |
4683 |
||
4684 |
openHTMLDocument:relativeDocPath |
|
4685 |
HTMLDocumentView openFullOnDocumentationFile:relativeDocPath |
|
4686 |
||
4687 |
"Created: / 4.8.1998 / 14:06:10 / cg" |
|
4688 |
! |
|
4689 |
||
4690 |
pullDownMenu |
|
4691 |
"return the top (pullDown) menu" |
|
4692 |
||
4693 |
<resource: #programMenu> |
|
4694 |
||
3330 | 4695 |
^ self menuFromSpec:self class menuSpec. |
4696 |
"/ |m| |
|
4697 |
"/ |
|
4698 |
"/ m := self class menuSpec. |
|
4699 |
"/ m := m decodeAsLiteralArray. |
|
4700 |
"/ m receiver:self. |
|
4701 |
"/ m findGuiResourcesIn:self. |
|
4702 |
"/ ^ m. |
|
1834 | 4703 |
|
4704 |
"Modified: / 14.8.1998 / 14:09:12 / cg" |
|
4705 |
"Created: / 14.8.1998 / 14:14:16 / cg" |
|
4706 |
! |
|
4707 |
||
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4708 |
removeBookmark |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4709 |
DirectoryBookmarks isNil ifTrue:[ ^ self]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4710 |
DirectoryBookmarks remove:(currentDirectory asFilename pathName) ifAbsent:nil. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4711 |
! |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4712 |
|
1834 | 4713 |
showAboutSTX |
4714 |
ToolApplicationModel openAboutSTX |
|
4715 |
||
4716 |
"Created: / 14.8.1998 / 13:18:41 / cg" |
|
4717 |
! |
|
4718 |
||
4719 |
sortChanged |
|
2020 | 4720 |
"/ Transcript show:'fBrowser:'; showCR:sortByWhat value. |
1834 | 4721 |
self updateCurrentDirectory |
4722 |
||
4723 |
"Created: / 14.8.1998 / 16:17:20 / cg" |
|
4724 |
"Modified: / 14.8.1998 / 16:44:00 / cg" |
|
4725 |
! ! |
|
4726 |
||
2102 | 4727 |
!FileBrowser methodsFor:'menu actions - cvs'! |
4728 |
||
3467 | 4729 |
cvsAddAndCommitSelection |
4730 |
"add files (or all in current directory) and commit" |
|
4731 |
||
4732 |
self cvsAddSelectionWithCommit:true |
|
4733 |
! |
|
4734 |
||
2424 | 4735 |
cvsAddSelection |
4736 |
"add files (or all in current directory)" |
|
4737 |
||
3467 | 4738 |
self cvsAddSelectionWithCommit:false |
4739 |
! |
|
4740 |
||
4741 |
cvsAddSelectionWithCommit:withCommit |
|
4742 |
"add files (or all in current directory) with optional commit" |
|
4743 |
||
2424 | 4744 |
|sel log| |
4745 |
||
4746 |
log := Dialog |
|
4747 |
requestText:(resources string:'enter initial log message') |
|
4748 |
lines:10 |
|
4749 |
columns:70 |
|
4750 |
initialAnswer:nil. |
|
4751 |
||
4752 |
log notNil ifTrue:[ |
|
4753 |
sel := fileListView selection. |
|
4754 |
sel size > 0 ifTrue:[ |
|
4755 |
sel := sel collect:[:rawIndex | fileList at:rawIndex]. |
|
4756 |
sel do:[:fn | |
|
4757 |
self |
|
4758 |
doExecuteCommand:('cvs add -m ''' , log , ''' ' , fn) replace:false |
|
4759 |
] |
|
4760 |
] ifFalse:[ |
|
4761 |
self |
|
4762 |
doExecuteCommand:('cvs add -l -m ''' , log , ''' *') replace:false |
|
4763 |
]. |
|
3467 | 4764 |
withCommit ifTrue:[ |
4765 |
self doExecuteCommand:('cvs commit -l -m ''' , log , '''') replace:false |
|
4766 |
] |
|
2424 | 4767 |
] |
4768 |
! |
|
4769 |
||
2386 | 4770 |
cvsCommitSelection |
4771 |
"commit files (or all in current directory)" |
|
4772 |
||
2956 | 4773 |
|nSel sel log msg| |
4774 |
||
4775 |
nSel := fileListView selection size. |
|
4776 |
nSel == 1 ifTrue:[ |
|
4777 |
msg := resources string:'enter log message for checkIn of ''%1''' with:(fileList at:fileListView selection first) |
|
4778 |
] ifFalse:[ |
|
4779 |
nSel > 1 ifTrue:[ |
|
4780 |
msg := resources string:'enter log message for %1 files to checkIn' with:nSel printString |
|
4781 |
] ifFalse:[ |
|
4782 |
msg := resources string:'enter log message for checkIn' |
|
4783 |
] |
|
4784 |
]. |
|
2386 | 4785 |
|
4786 |
log := Dialog |
|
2956 | 4787 |
requestText:msg |
2386 | 4788 |
lines:10 |
4789 |
columns:70 |
|
4790 |
initialAnswer:nil. |
|
4791 |
||
4792 |
log notNil ifTrue:[ |
|
4793 |
sel := fileListView selection. |
|
4794 |
sel size > 0 ifTrue:[ |
|
4795 |
sel := sel collect:[:rawIndex | fileList at:rawIndex]. |
|
4796 |
sel do:[:fn | |
|
4797 |
self |
|
4798 |
doExecuteCommand:('cvs commit -m ''' , log , ''' ' , fn) replace:false |
|
4799 |
] |
|
4800 |
] ifFalse:[ |
|
4801 |
self |
|
4802 |
doExecuteCommand:('cvs commit -l -m ''' , log , '''') replace:false |
|
4803 |
]. |
|
4804 |
] |
|
4805 |
||
4806 |
"Modified: / 16.12.1998 / 17:30:31 / cg" |
|
4807 |
! |
|
4808 |
||
2102 | 4809 |
cvsRemoveFileAndContainer |
4810 |
"remove the selected file(s) and their CVS containers. |
|
4811 |
Query if user really wants to really remove them." |
|
4812 |
||
4813 |
|sel q| |
|
4814 |
||
4815 |
sel := fileListView selection. |
|
4816 |
sel size > 0 ifTrue:[ |
|
2868 | 4817 |
sel := sel collect:[:rawIndex | fileList at:rawIndex]. |
4818 |
sel size > 1 ifTrue:[ |
|
2939 | 4819 |
q := resources string:'Remove %1 selected files and their CVS containers ?' with:(sel size) |
2868 | 4820 |
] ifFalse:[ |
2939 | 4821 |
q := resources string:'Remove ''%1'' and its CVS container ?' with:(sel first allBold) |
2868 | 4822 |
]. |
4823 |
(self sensor shiftDown |
|
4824 |
or:[self ask:q yesButton:'remove']) ifTrue:[ |
|
4825 |
self withCursor:(Cursor wait) do:[ |
|
4826 |
self doRemoveAndRemoveFromCVS:sel |
|
4827 |
] |
|
4828 |
] |
|
2102 | 4829 |
] |
4830 |
||
4831 |
"Modified: / 16.12.1998 / 17:30:31 / cg" |
|
4832 |
! |
|
4833 |
||
4834 |
cvsUpdateDirectoryLocal |
|
4835 |
"update this directory" |
|
4836 |
||
4837 |
self |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4838 |
doExecuteCommand:'cvs upd -l' replace:false |
2102 | 4839 |
|
4840 |
"Modified: / 16.12.1998 / 17:30:31 / cg" |
|
4841 |
! |
|
4842 |
||
4843 |
cvsUpdateDirectoryRecursive |
|
4844 |
"update this directory" |
|
4845 |
||
4846 |
self |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4847 |
doExecuteCommand:'cvs upd -d' replace:false |
2102 | 4848 |
|
4849 |
"Modified: / 16.12.1998 / 17:30:31 / cg" |
|
4850 |
! |
|
4851 |
||
4852 |
cvsUpdateSelection |
|
4853 |
"update selected files" |
|
4854 |
||
4855 |
|sel| |
|
4856 |
||
4857 |
sel := fileListView selection. |
|
4858 |
sel size > 0 ifTrue:[ |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4859 |
sel := sel collect:[:rawIndex | fileList at:rawIndex]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4860 |
sel do:[:fn | |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4861 |
self |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4862 |
doExecuteCommand:('cvs upd ' , fn) replace:false |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4863 |
] |
2102 | 4864 |
]. |
4865 |
! |
|
4866 |
||
4867 |
doRemoveAndRemoveFromCVS:filesToRemove |
|
4868 |
"remove the selected file(s) and their CVS containers - no questions asked" |
|
4869 |
||
4870 |
|msg idx needUpdate toRemove updateRunning yesToAll| |
|
4871 |
||
4872 |
updateRunning := listUpdateProcess notNil. |
|
4873 |
self stopUpdateProcess. |
|
4874 |
toRemove := OrderedCollection new. |
|
4875 |
||
4876 |
"/ |
|
4877 |
"/ did the directory change in the meanwhile ? |
|
4878 |
"/ |
|
4879 |
needUpdate := (currentDirectory modificationTime > timeOfLastCheck). |
|
4880 |
||
4881 |
yesToAll := false. |
|
4882 |
lockUpdate := true. |
|
4883 |
[ |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4884 |
filesToRemove do:[:fileName | |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4885 |
|f| |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4886 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4887 |
f := currentDirectory construct:fileName. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4888 |
OperatingSystem accessDeniedErrorSignal handle:[:ex| |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4889 |
"was not able to remove it" |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4890 |
msg := (resources string:'cannot remove ''%1'' !!' with:fileName). |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4891 |
self showAlert:msg with:(OperatingSystem lastErrorString) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4892 |
] do:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4893 |
|answer contents| |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4894 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4895 |
(f isSymbolicLink not) ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4896 |
self |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4897 |
doExecuteCommand:('cvs remove -f ' , f baseName) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4898 |
replace:false. |
2102 | 4899 |
|
4900 |
" |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4901 |
self show:nil |
2102 | 4902 |
" |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4903 |
idx := fileList indexOf:fileName. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4904 |
idx ~~ 0 ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4905 |
toRemove add:idx. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4906 |
] |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4907 |
] |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4908 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4909 |
]. |
3596
9761af1f3f72
#valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents:
3568
diff
changeset
|
4910 |
] ensure:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4911 |
lockUpdate := false. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4912 |
fileListView setSelection:nil. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4913 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4914 |
"/ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4915 |
"/ remove reverse - otherwise indices are wrong |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4916 |
"/ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4917 |
toRemove sort. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4918 |
toRemove reverseDo:[:idx | |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4919 |
fileList removeIndex:idx. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4920 |
fileListView removeIndex:idx. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4921 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4922 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4923 |
updateRunning ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4924 |
self updateCurrentDirectory |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4925 |
] ifFalse:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4926 |
" |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4927 |
install a new check after some time |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4928 |
" |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4929 |
needUpdate ifFalse:[timeOfLastCheck := AbsoluteTime now]. |
3520
83cf11e1bf32
schedule checkBlock for the right process
Claus Gittinger <cg@exept.de>
parents:
3503
diff
changeset
|
4930 |
self scheduleCheckBlock. |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4931 |
] |
2102 | 4932 |
]. |
4933 |
||
4934 |
self |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4935 |
doExecuteCommand:('cvs commit -m ''removed via FileBrowser''') |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4936 |
replace:false. |
2102 | 4937 |
|
4938 |
"Modified: / 21.10.1998 / 17:02:11 / cg" |
|
4939 |
! ! |
|
4940 |
||
172 | 4941 |
!FileBrowser methodsFor:'misc user interaction'! |
4942 |
||
1786 | 4943 |
closeRequest |
4944 |
"exit FileBrowser" |
|
4945 |
||
3251 | 4946 |
(self askIfModified:'Contents has not been saved.\\Modifications will be lost when FileBrowser is closed.' |
4947 |
yesButton:'Close') |
|
1786 | 4948 |
ifTrue:[ |
3251 | 4949 |
"/ self windowGroup closeDownViews. |
4950 |
super closeRequest |
|
1786 | 4951 |
] |
4952 |
||
4953 |
"Created: / 3.8.1998 / 19:55:06 / cg" |
|
1834 | 4954 |
"Modified: / 4.8.1998 / 18:21:03 / cg" |
1786 | 4955 |
! |
4956 |
||
1339
4b712d8c1738
Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents:
1336
diff
changeset
|
4957 |
discardChangesDialog |
4b712d8c1738
Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents:
1336
diff
changeset
|
4958 |
"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
|
4959 |
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
|
4960 |
|
3658 | 4961 |
^ self askIfModified:'Contents has not been saved.\\Modifications will be lost when directory is changed.' |
4962 |
yesButton:'Change' |
|
1339
4b712d8c1738
Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents:
1336
diff
changeset
|
4963 |
|
4b712d8c1738
Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents:
1336
diff
changeset
|
4964 |
"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
|
4965 |
! |
4b712d8c1738
Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents:
1336
diff
changeset
|
4966 |
|
2998
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
4967 |
entryCompletion:contents |
3527 | 4968 |
|newString lastWord expandedWord idx onlyOne addSpace fn| |
2998
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
4969 |
|
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
4970 |
"/ find the last word. |
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
4971 |
"/ used to be 'contents asCollectionOfWords last', |
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
4972 |
"/ but we have to care for escaped spaces here (unix) ... |
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
4973 |
|
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
4974 |
idx := contents size. |
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
4975 |
OperatingSystem isUNIXlike ifFalse:[ |
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
4976 |
"/ under MSDOS, the backslash is a directory separator |
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
4977 |
idx := contents lastIndexOf:Character space startingAt:idx. |
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
4978 |
] ifTrue:[ |
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
4979 |
"/ under UNIX, the backslash is a special character escape |
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
4980 |
idx := idx + 1. |
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
4981 |
[ |
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
4982 |
idx := contents lastIndexOf:Character space startingAt:idx-1. |
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
4983 |
] doWhile:[ |
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
4984 |
idx > 1 and:[ (contents at:idx-1) = $\ ] |
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
4985 |
]. |
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
4986 |
]. |
3185 | 4987 |
"/ idx == 0 ifTrue:[ |
4988 |
"/ commandView flash. |
|
4989 |
"/ ^ nil. |
|
4990 |
"/ ]. |
|
2998
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
4991 |
|
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
4992 |
lastWord := contents copyFrom:idx + 1. |
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
4993 |
OperatingSystem isUNIXlike ifTrue:[ |
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
4994 |
(lastWord includes:$\) ifTrue:[ |
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
4995 |
lastWord := lastWord copyReplaceAll:$\ withAll:''. |
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
4996 |
]. |
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
4997 |
]. |
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
4998 |
|
3020 | 4999 |
onlyOne := true. |
2998
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
5000 |
expandedWord := Filename |
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
5001 |
filenameCompletionFor:lastWord |
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
5002 |
directory:currentDirectory |
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
5003 |
directoriesOnly:false |
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
5004 |
filesOnly:false |
3020 | 5005 |
ifMultiple:[:dir | onlyOne := false. commandView flash.]. |
5006 |
||
5007 |
addSpace := false. |
|
5008 |
onlyOne ifTrue:[ |
|
3022 | 5009 |
fn := currentDirectory construct:expandedWord. |
5010 |
(fn exists and:[fn isDirectory not]) ifTrue:[ |
|
3020 | 5011 |
addSpace := true. |
5012 |
]. |
|
5013 |
]. |
|
2998
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
5014 |
|
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
5015 |
OperatingSystem isUNIXlike ifTrue:[ |
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
5016 |
expandedWord := expandedWord copyReplaceAll:(Character space) withAll:'\ '. |
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
5017 |
expandedWord := expandedWord copyReplaceAll:($') withAll:'\'''. |
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
5018 |
expandedWord := expandedWord copyReplaceAll:($() withAll:'\('. |
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
5019 |
expandedWord := expandedWord copyReplaceAll:($)) withAll:'\)'. |
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
5020 |
expandedWord := expandedWord copyReplaceAll:($[) withAll:'\['. |
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
5021 |
expandedWord := expandedWord copyReplaceAll:($]) withAll:'\]'. |
2999 | 5022 |
expandedWord := expandedWord copyReplaceAll:($&) withAll:'\&'. |
5023 |
expandedWord := expandedWord copyReplaceAll:($|) withAll:'\|'. |
|
5024 |
expandedWord := expandedWord copyReplaceAll:($;) withAll:'\;'. |
|
2998
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
5025 |
]. |
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
5026 |
|
3020 | 5027 |
addSpace ifTrue:[ |
5028 |
expandedWord := expandedWord , ' ' |
|
5029 |
]. |
|
2998
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
5030 |
newString := (contents copyTo:idx) , expandedWord. |
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
5031 |
|
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
5032 |
^ newString |
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
5033 |
! |
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
5034 |
|
346 | 5035 |
filterPatternChanged |
1911
6d1b77eda98f
check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents:
1903
diff
changeset
|
5036 |
fileListView scrollToTop. |
6d1b77eda98f
check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents:
1903
diff
changeset
|
5037 |
fileListView deselect. |
346 | 5038 |
self updateCurrentDirectory |
1911
6d1b77eda98f
check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents:
1903
diff
changeset
|
5039 |
|
6d1b77eda98f
check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents:
1903
diff
changeset
|
5040 |
"Modified: / 3.10.1998 / 18:23:34 / cg" |
346 | 5041 |
! |
5042 |
||
172 | 5043 |
update:what with:someArgument from:changedObject |
5044 |
realized ifFalse:[^ self]. |
|
36 | 5045 |
|
172 | 5046 |
(what == #aboutToExit) ifTrue:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5047 |
"system wants to shut down this |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5048 |
- 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
|
5049 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5050 |
(subView modified and:[subView contentsWasSaved not]) ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5051 |
self raiseDeiconified. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5052 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5053 |
(self |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5054 |
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
|
5055 |
yesButton:'save' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5056 |
noButton:'don''t save') |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5057 |
ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5058 |
subView acceptAction notNil ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5059 |
subView accept |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5060 |
] ifFalse:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5061 |
subView save |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5062 |
] |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5063 |
] |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5064 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5065 |
^ self |
172 | 5066 |
]. |
5067 |
changedObject == tabSpec ifTrue:[ |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5068 |
fileListView invalidate |
172 | 5069 |
]. |
380 | 5070 |
|
585
be0241bf7268
use #invalidate instead of #redraw
Claus Gittinger <cg@exept.de>
parents:
564
diff
changeset
|
5071 |
"Modified: 29.5.1996 / 16:13:43 / cg" |
172 | 5072 |
! ! |
5073 |
||
5074 |
!FileBrowser methodsFor:'pathField user interaction'! |
|
5075 |
||
1271 | 5076 |
addDirToJavaClassPath |
5077 |
"add the current path to javas classPath |
|
5078 |
(only available with ST/J System" |
|
5079 |
||
5080 |
Java addToClassPath:currentDirectory pathName |
|
5081 |
||
5082 |
"Modified: 14.12.1996 / 15:37:47 / cg" |
|
5083 |
"Created: 1.8.1997 / 21:25:22 / cg" |
|
5084 |
! |
|
5085 |
||
1272 | 5086 |
addDirToJavaSourcePath |
5087 |
"add the current path to javas sourcePath |
|
5088 |
(only available with ST/J System" |
|
5089 |
||
5090 |
Java addToSourcePath:currentDirectory pathName |
|
5091 |
||
5092 |
"Modified: 14.12.1996 / 15:37:47 / cg" |
|
5093 |
"Created: 2.8.1997 / 14:11:19 / cg" |
|
5094 |
! |
|
5095 |
||
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5096 |
bookmarksMenuSpec |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5097 |
"return the bookmarksMenu for the path label" |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5098 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5099 |
<resource: #programMenu> |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5100 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5101 |
^ self menuFromSpec:(self class bookmarksMenuSpec). |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5102 |
! |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5103 |
|
172 | 5104 |
changeCurrentDirectory |
5105 |
"if text was modified show a queryBox, |
|
1329 | 5106 |
otherwise ask for & change to that directory" |
172 | 5107 |
|
3658 | 5108 |
"/ self discardChangesDialog ifTrue:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5109 |
self queryForDirectoryToChange |
3658 | 5110 |
"/ ] |
1329 | 5111 |
|
5112 |
"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
|
5113 |
"Modified: 2.10.1997 / 14:09:02 / stefan" |
36 | 5114 |
! |
5115 |
||
172 | 5116 |
changeDirectoryTo:aDirectoryName |
5117 |
"sent from label menu to change back to a previous directory" |
|
132 | 5118 |
|
1339
4b712d8c1738
Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents:
1336
diff
changeset
|
5119 |
self discardChangesDialog ifTrue:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5120 |
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
|
5121 |
]. |
4b712d8c1738
Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents:
1336
diff
changeset
|
5122 |
|
1737 | 5123 |
"Modified: / 2.10.1997 / 14:09:24 / stefan" |
5124 |
"Modified: / 21.7.1998 / 16:38:03 / cg" |
|
172 | 5125 |
! |
5126 |
||
1329 | 5127 |
changeToDefaultDirectory |
5128 |
"if text was modified show a queryBox, |
|
5129 |
otherwise change immediately to the default directory" |
|
5130 |
||
1339
4b712d8c1738
Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents:
1336
diff
changeset
|
5131 |
self discardChangesDialog ifTrue:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5132 |
self doChangeToDefaultDirectory |
1329 | 5133 |
] |
5134 |
||
5135 |
"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
|
5136 |
"Modified: 2.10.1997 / 14:09:33 / stefan" |
1329 | 5137 |
! |
5138 |
||
172 | 5139 |
changeToHomeDirectory |
5140 |
"if text was modified show a queryBox, |
|
1329 | 5141 |
otherwise change immediately to the home directory" |
132 | 5142 |
|
1339
4b712d8c1738
Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents:
1336
diff
changeset
|
5143 |
self discardChangesDialog ifTrue:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5144 |
self doChangeToHomeDirectory |
172 | 5145 |
] |
1329 | 5146 |
|
5147 |
"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
|
5148 |
"Modified: 2.10.1997 / 14:09:42 / stefan" |
172 | 5149 |
! |
45 | 5150 |
|
172 | 5151 |
changeToParentDirectory |
5152 |
"if text was modified show a queryBox, |
|
1329 | 5153 |
otherwise change immediately to the parent directory" |
45 | 5154 |
|
1339
4b712d8c1738
Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents:
1336
diff
changeset
|
5155 |
self discardChangesDialog ifTrue:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5156 |
self doChangeToParentDirectory |
36 | 5157 |
] |
1329 | 5158 |
|
5159 |
"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
|
5160 |
"Modified: 2.10.1997 / 14:09:55 / stefan" |
98 | 5161 |
! |
5162 |
||
172 | 5163 |
copyPath |
5164 |
"copy current path into cut & paste buffer" |
|
5165 |
||
873 | 5166 |
self setTextSelection:currentDirectory pathName |
5167 |
||
5168 |
"Modified: 14.12.1996 / 15:37:47 / cg" |
|
172 | 5169 |
! |
5170 |
||
1893
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
5171 |
fileAddToJavaClassPath |
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
5172 |
"add the current path to javas classPath |
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
5173 |
(only available with ST/J System" |
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
5174 |
|
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
5175 |
|f| |
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
5176 |
|
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
5177 |
f := self getSelectedFileName. |
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
5178 |
f isNil ifTrue:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5179 |
^ self addDirToJavaClassPath |
1893
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
5180 |
]. |
3747
d30bc1e54f15
Remove unused vars and asFilename sends
Stefan Vogel <sv@exept.de>
parents:
3746
diff
changeset
|
5181 |
f := currentDirectory construct:f. |
1893
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
5182 |
Java addToClassPath:(f pathName) |
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
5183 |
|
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
5184 |
"Created: / 9.11.1998 / 05:41:34 / cg" |
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
5185 |
"Modified: / 9.11.1998 / 05:56:00 / cg" |
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
5186 |
! |
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
5187 |
|
2368 | 5188 |
fileAddToJavaSourcePath |
5189 |
"add the current path to javas sourcePath |
|
5190 |
(only available with ST/J System" |
|
5191 |
||
5192 |
|f| |
|
5193 |
||
5194 |
f := self getSelectedFileName. |
|
5195 |
f isNil ifTrue:[ |
|
5196 |
^ self addDirToJavaSourcePath |
|
5197 |
]. |
|
3747
d30bc1e54f15
Remove unused vars and asFilename sends
Stefan Vogel <sv@exept.de>
parents:
3746
diff
changeset
|
5198 |
f := currentDirectory construct:f. |
2368 | 5199 |
Java addToSourcePath:(f pathName) |
5200 |
||
5201 |
"Created: / 9.11.1998 / 05:41:34 / cg" |
|
5202 |
"Modified: / 9.11.1998 / 05:56:00 / cg" |
|
5203 |
! |
|
5204 |
||
1893
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
5205 |
fileRemoveFromJavaClassPath |
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
5206 |
"remove the current path from javas classPath |
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
5207 |
(only available with ST/J System" |
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
5208 |
|
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
5209 |
|f| |
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
5210 |
|
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
5211 |
f := self getSelectedFileName. |
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
5212 |
f isNil ifTrue:[ |
2368 | 5213 |
^ self removeDirFromJavaClassPath |
1893
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
5214 |
]. |
3747
d30bc1e54f15
Remove unused vars and asFilename sends
Stefan Vogel <sv@exept.de>
parents:
3746
diff
changeset
|
5215 |
f := currentDirectory construct:f. |
1893
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
5216 |
Java removeFromClassPath:(f pathName) |
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
5217 |
|
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
5218 |
"Created: / 9.11.1998 / 05:42:05 / cg" |
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
5219 |
"Modified: / 9.11.1998 / 05:56:14 / cg" |
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
5220 |
! |
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
5221 |
|
2368 | 5222 |
fileRemoveFromJavaSourcePath |
5223 |
"remove the current path from javas sourcePath |
|
5224 |
(only available with ST/J System" |
|
5225 |
||
5226 |
|f| |
|
5227 |
||
5228 |
f := self getSelectedFileName. |
|
5229 |
f isNil ifTrue:[ |
|
5230 |
^ self removeDirFromJavaSourcePath |
|
5231 |
]. |
|
3747
d30bc1e54f15
Remove unused vars and asFilename sends
Stefan Vogel <sv@exept.de>
parents:
3746
diff
changeset
|
5232 |
f := currentDirectory construct:f. |
2368 | 5233 |
Java removeFromSourcePath:(f pathName) |
5234 |
||
5235 |
"Created: / 9.11.1998 / 05:42:05 / cg" |
|
5236 |
"Modified: / 9.11.1998 / 05:56:14 / cg" |
|
5237 |
! |
|
5238 |
||
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5239 |
historyMenuSpec |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5240 |
"return the historyMenu for the path label" |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5241 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5242 |
<resource: #programMenu> |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5243 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5244 |
^ self menuFromSpec:(self class historyMenuSpec). |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5245 |
! |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5246 |
|
172 | 5247 |
labelMenu |
1040 | 5248 |
"return the popUpMenu for the path label" |
5249 |
||
1235
13610578a5d2
resource flag: #menu -> #programMenu
Claus Gittinger <cg@exept.de>
parents:
1227
diff
changeset
|
5250 |
<resource: #programMenu> |
1040 | 5251 |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5252 |
^ self menuFromSpec:(self class directoryMenuSpec). |
1834 | 5253 |
! |
5254 |
||
5255 |
labelMenu_old |
|
5256 |
"return the popUpMenu for the path label" |
|
5257 |
||
5258 |
<resource: #programMenu> |
|
5259 |
||
1737 | 5260 |
|items menu currentIndex| |
1736
36cab4d1d655
remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents:
1735
diff
changeset
|
5261 |
|
36cab4d1d655
remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents:
1735
diff
changeset
|
5262 |
items := #( |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5263 |
('copy path' copyPath ) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5264 |
('-' ) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5265 |
('up' changeToParentDirectory ) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5266 |
('back' changeToPreviousDirectory ) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5267 |
('change to home-directory' changeToHomeDirectory ) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5268 |
('change to default-directory' changeToDefaultDirectory ) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5269 |
('change directory ...' changeCurrentDirectory ) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5270 |
). |
1400 | 5271 |
|
5272 |
(JavaClassReader notNil and:[JavaClassReader isLoaded]) ifTrue:[ |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5273 |
items := items , #( |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5274 |
( '-') |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5275 |
( 'add to JavaClassPath' addDirToJavaClassPath) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5276 |
( 'add to JavaSourcePath' addDirToJavaSourcePath) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5277 |
( 'remove from JavaClassPath' removeDirFromJavaClassPath) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5278 |
( 'remove from JavaSourcePath' removeDirFromJavaSourcePath) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5279 |
). |
1271 | 5280 |
]. |
5281 |
||
172 | 5282 |
DirectoryHistory size > 0 ifTrue:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5283 |
items := items copyWith:#('-'). |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5284 |
items := items , |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5285 |
(DirectoryHistory |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5286 |
collect:[:dirName | |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5287 |
Array |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5288 |
with:dirName |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5289 |
with:#changeDirectoryTo: |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5290 |
with:nil |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5291 |
with:dirName |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5292 |
] |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5293 |
). |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5294 |
currentIndex := items findFirst:[:i | (i at:1) = currentDirectory pathName]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5295 |
currentIndex == 0 ifTrue:[currentIndex := nil]. |
123 | 5296 |
]. |
172 | 5297 |
|
5298 |
menu := PopUpMenu |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5299 |
itemList:items |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5300 |
resources:resources. |
172 | 5301 |
|
5302 |
previousDirectory isNil ifTrue:[ |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5303 |
menu disable:#changeToPreviousDirectory. |
132 | 5304 |
]. |
1737 | 5305 |
currentIndex notNil ifTrue:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5306 |
menu disable:currentIndex |
1737 | 5307 |
]. |
1400 | 5308 |
(JavaClassReader notNil and:[JavaClassReader isLoaded]) ifTrue:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5309 |
(Java classPath includes:currentDirectory pathName) ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5310 |
menu disable:#addDirToJavaClassPath |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5311 |
] ifFalse:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5312 |
menu disable:#removeDirFromJavaClassPath |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5313 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5314 |
(Java sourcePath includes:currentDirectory pathName) ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5315 |
menu disable:#addDirToJavaSourcePath |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5316 |
] ifFalse:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5317 |
menu disable:#removeDirFromJavaSourcePath |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5318 |
]. |
1393 | 5319 |
]. |
172 | 5320 |
^menu. |
1040 | 5321 |
|
1737 | 5322 |
"Modified: / 21.7.1998 / 16:43:25 / cg" |
1834 | 5323 |
"Created: / 14.8.1998 / 12:10:02 / cg" |
172 | 5324 |
! |
5325 |
||
1327 | 5326 |
pathChanged:newPath |
1339
4b712d8c1738
Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents:
1336
diff
changeset
|
5327 |
"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
|
5328 |
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
|
5329 |
|
2135
88eb91efc5dd
care for caseless systems when entering a fileName
Claus Gittinger <cg@exept.de>
parents:
2129
diff
changeset
|
5330 |
|f name lcName idx| |
1339
4b712d8c1738
Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents:
1336
diff
changeset
|
5331 |
|
4b712d8c1738
Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents:
1336
diff
changeset
|
5332 |
self discardChangesDialog ifTrue:[ |
2216
b84ee099f484
dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
5333 |
f := newPath asFilename. |
b84ee099f484
dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
5334 |
(f isDirectory) ifTrue:[ |
b84ee099f484
dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
5335 |
self changeDirectoryTo:newPath |
b84ee099f484
dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
5336 |
] ifFalse:[ |
b84ee099f484
dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
5337 |
self changeDirectoryTo:(f directoryName). |
b84ee099f484
dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
5338 |
"/ self changed:#path. |
b84ee099f484
dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
5339 |
name := f baseName. |
b84ee099f484
dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
5340 |
idx := fileList indexOf:name. |
b84ee099f484
dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
5341 |
idx = 0 ifTrue:[ |
b84ee099f484
dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
5342 |
lcName := name asLowercase. |
b84ee099f484
dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
5343 |
f class isCaseSensitive ifFalse:[ |
b84ee099f484
dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
5344 |
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
|
5345 |
] |
b84ee099f484
dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
5346 |
]. |
b84ee099f484
dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
5347 |
fileListView selection:idx. |
b84ee099f484
dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
5348 |
self fileSelect:name. |
b84ee099f484
dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
5349 |
self fileGet:true. |
b84ee099f484
dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
5350 |
]. |
1339
4b712d8c1738
Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents:
1336
diff
changeset
|
5351 |
] ifFalse:[ |
2216
b84ee099f484
dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
5352 |
self changed:#path. |
2135
88eb91efc5dd
care for caseless systems when entering a fileName
Claus Gittinger <cg@exept.de>
parents:
2129
diff
changeset
|
5353 |
]. |
88eb91efc5dd
care for caseless systems when entering a fileName
Claus Gittinger <cg@exept.de>
parents:
2129
diff
changeset
|
5354 |
|
88eb91efc5dd
care for caseless systems when entering a fileName
Claus Gittinger <cg@exept.de>
parents:
2129
diff
changeset
|
5355 |
"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
|
5356 |
"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
|
5357 |
"Modified: / 30.4.1999 / 11:19:29 / cg" |
1327 | 5358 |
! |
5359 |
||
172 | 5360 |
queryForDirectoryToChange |
5361 |
"query for new directory" |
|
123 | 5362 |
|
1168
b157f3712548
care for nil returns from userName/groupName * time queries
Claus Gittinger <cg@exept.de>
parents:
1166
diff
changeset
|
5363 |
|queryBox dirName| |
98 | 5364 |
|
172 | 5365 |
queryBox := FilenameEnterBox |
3658 | 5366 |
title:(resources at:'Change directory to:') withCRs |
5367 |
okText:(resources at:'Change') |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5368 |
action:[:newName | dirName := newName]. |
172 | 5369 |
"/ queryBox initialText:''. |
1168
b157f3712548
care for nil returns from userName/groupName * time queries
Claus Gittinger <cg@exept.de>
parents:
1166
diff
changeset
|
5370 |
queryBox showAtPointer. |
b157f3712548
care for nil returns from userName/groupName * time queries
Claus Gittinger <cg@exept.de>
parents:
1166
diff
changeset
|
5371 |
queryBox destroy. |
3658 | 5372 |
dirName size == 0 ifTrue:[^ self]. |
5373 |
||
5374 |
self discardChangesDialog ifTrue:[ |
|
5375 |
self doChangeCurrentDirectoryTo:dirName updateHistory:true. |
|
5376 |
]. |
|
1168
b157f3712548
care for nil returns from userName/groupName * time queries
Claus Gittinger <cg@exept.de>
parents:
1166
diff
changeset
|
5377 |
|
b157f3712548
care for nil returns from userName/groupName * time queries
Claus Gittinger <cg@exept.de>
parents:
1166
diff
changeset
|
5378 |
"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
|
5379 |
"Modified: 28.4.1997 / 22:30:40 / dq" |
1271 | 5380 |
! |
5381 |
||
5382 |
removeDirFromJavaClassPath |
|
5383 |
"remove the current path from javas classPath |
|
5384 |
(only available with ST/J System" |
|
5385 |
||
5386 |
Java removeFromClassPath:currentDirectory pathName |
|
5387 |
||
5388 |
"Modified: 14.12.1996 / 15:37:47 / cg" |
|
5389 |
"Created: 1.8.1997 / 21:25:36 / cg" |
|
1272 | 5390 |
! |
5391 |
||
5392 |
removeDirFromJavaSourcePath |
|
5393 |
"remove the current path from javas sourcePath |
|
5394 |
(only available with ST/J System" |
|
5395 |
||
5396 |
Java removeFromSourcePath:currentDirectory pathName |
|
5397 |
||
5398 |
"Modified: 14.12.1996 / 15:37:47 / cg" |
|
5399 |
"Created: 2.8.1997 / 14:11:41 / cg" |
|
36 | 5400 |
! ! |
5401 |
||
5402 |
!FileBrowser methodsFor:'private'! |
|
5403 |
||
172 | 5404 |
ask:question yesButton:yesButtonText |
5405 |
"common method to ask a yes/no question; return true or false" |
|
36 | 5406 |
|
3209 | 5407 |
^ self ask:question yesButton:yesButtonText noButton:'Cancel' |
172 | 5408 |
! |
93 | 5409 |
|
172 | 5410 |
ask:question yesButton:yesButtonText noButton:noButtonText |
36 | 5411 |
"common method to ask a yes/no question" |
5412 |
||
380 | 5413 |
^ Dialog |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5414 |
confirm:question withCRs |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5415 |
yesLabel:(resources at:yesButtonText) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5416 |
noLabel:(resources at:noButtonText) |
37 | 5417 |
|
380 | 5418 |
"Modified: 21.2.1996 / 01:19:21 / cg" |
36 | 5419 |
! |
5420 |
||
1142
9066d7d02a3a
remember last executed command per suffix; offer this as default.
Claus Gittinger <cg@exept.de>
parents:
1141
diff
changeset
|
5421 |
askForCommandFor:fileName thenDo:aBlock |
172 | 5422 |
"setup and launch a querybox to ask for unix command. |
5423 |
Then evaluate aBlock passing the command-string as argument." |
|
93 | 5424 |
|
1834 | 5425 |
|box osName| |
5426 |
||
5427 |
osName := OperatingSystem platformName. |
|
93 | 5428 |
|
172 | 5429 |
box := FilenameEnterBox |
3280 | 5430 |
title:(resources string:'Execute %1 command:' with:osName) |
5431 |
okText:(resources string:'Execute') |
|
5432 |
action:aBlock. |
|
79 | 5433 |
|
172 | 5434 |
fileName notNil ifTrue:[ |
3280 | 5435 |
self initialCommandFor:fileName into:box. |
172 | 5436 |
]. |
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
5437 |
box directory:currentDirectory. |
1142
9066d7d02a3a
remember last executed command per suffix; offer this as default.
Claus Gittinger <cg@exept.de>
parents:
1141
diff
changeset
|
5438 |
box showAtPointer. |
9066d7d02a3a
remember last executed command per suffix; offer this as default.
Claus Gittinger <cg@exept.de>
parents:
1141
diff
changeset
|
5439 |
box destroy. |
36 | 5440 |
|
1834 | 5441 |
"Modified: / 7.9.1995 / 10:31:54 / claus" |
5442 |
"Modified: / 16.9.1997 / 15:35:10 / stefan" |
|
5443 |
"Modified: / 14.8.1998 / 14:12:52 / cg" |
|
36 | 5444 |
! |
5445 |
||
98 | 5446 |
askIfModified:question yesButton:yesButtonText |
5447 |
"tell user, that code has been modified - let her confirm" |
|
5448 |
||
5449 |
(subView modified not or:[subView contentsWasSaved]) ifTrue:[ |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5450 |
^ true |
98 | 5451 |
]. |
1340 | 5452 |
(self ask:(resources string:question) yesButton:yesButtonText) ifTrue:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5453 |
"/ reset modified flag so question is asked only once |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5454 |
subView modified:false. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5455 |
^ true |
1340 | 5456 |
]. |
5457 |
^ false |
|
1339
4b712d8c1738
Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents:
1336
diff
changeset
|
5458 |
|
4b712d8c1738
Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents:
1336
diff
changeset
|
5459 |
"Modified: 2.10.1997 / 14:23:47 / stefan" |
98 | 5460 |
! |
5461 |
||
1162 | 5462 |
getSelectedFileName |
5463 |
"returns the currently selected file; shows an error if |
|
5464 |
multiple files are selected" |
|
5465 |
||
5466 |
|sel| |
|
5467 |
||
5468 |
sel := fileListView selection. |
|
5469 |
(sel size > 1) ifTrue:[ |
|
2791 | 5470 |
self onlyOneSelection |
1162 | 5471 |
] ifFalse:[ |
2791 | 5472 |
sel size > 0 ifTrue:[ |
5473 |
^ fileList at:sel first ifAbsent:nil |
|
5474 |
] |
|
1162 | 5475 |
]. |
5476 |
^ nil |
|
1911
6d1b77eda98f
check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents:
1903
diff
changeset
|
5477 |
|
6d1b77eda98f
check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents:
1903
diff
changeset
|
5478 |
"Modified: / 3.10.1998 / 18:21:23 / cg" |
1162 | 5479 |
! |
5480 |
||
5481 |
onlyOneSelection |
|
5482 |
"show a warning, that only one file must be selected for |
|
5483 |
this operation" |
|
5484 |
||
5485 |
self warn:'exactly one file must be selected !!' |
|
5486 |
! |
|
5487 |
||
3520
83cf11e1bf32
schedule checkBlock for the right process
Claus Gittinger <cg@exept.de>
parents:
3503
diff
changeset
|
5488 |
scheduleCheckBlock |
83cf11e1bf32
schedule checkBlock for the right process
Claus Gittinger <cg@exept.de>
parents:
3503
diff
changeset
|
5489 |
Processor removeTimedBlock:checkBlock. |
3568 | 5490 |
self windowGroup isNil ifTrue:[ |
5491 |
"/ not yet opened |
|
5492 |
Processor |
|
5493 |
addTimedBlock:checkBlock |
|
5494 |
afterSeconds:checkDelta |
|
5495 |
] ifFalse:[ |
|
5496 |
Processor |
|
5497 |
addTimedBlock:checkBlock |
|
5498 |
for:(self windowGroup process) |
|
5499 |
afterSeconds:checkDelta |
|
5500 |
] |
|
3520
83cf11e1bf32
schedule checkBlock for the right process
Claus Gittinger <cg@exept.de>
parents:
3503
diff
changeset
|
5501 |
! |
83cf11e1bf32
schedule checkBlock for the right process
Claus Gittinger <cg@exept.de>
parents:
3503
diff
changeset
|
5502 |
|
2512
35d2092df60f
autoselect a new created file
Claus Gittinger <cg@exept.de>
parents:
2504
diff
changeset
|
5503 |
selectFile:aFilename |
35d2092df60f
autoselect a new created file
Claus Gittinger <cg@exept.de>
parents:
2504
diff
changeset
|
5504 |
(currentDirectory filenameFor:aFilename) exists ifTrue:[ |
35d2092df60f
autoselect a new created file
Claus Gittinger <cg@exept.de>
parents:
2504
diff
changeset
|
5505 |
fileListView selection:(fileList indexOf:aFilename). |
35d2092df60f
autoselect a new created file
Claus Gittinger <cg@exept.de>
parents:
2504
diff
changeset
|
5506 |
self fileDoubleClick:fileListView selection. |
35d2092df60f
autoselect a new created file
Claus Gittinger <cg@exept.de>
parents:
2504
diff
changeset
|
5507 |
]. |
35d2092df60f
autoselect a new created file
Claus Gittinger <cg@exept.de>
parents:
2504
diff
changeset
|
5508 |
! |
35d2092df60f
autoselect a new created file
Claus Gittinger <cg@exept.de>
parents:
2504
diff
changeset
|
5509 |
|
1162 | 5510 |
selectedFilesDo:aBlock |
5511 |
"evaluate aBlock on all selected files; |
|
5512 |
show a wait cursor while doing this" |
|
5513 |
||
1969 | 5514 |
|sel action| |
1162 | 5515 |
|
5516 |
sel := fileListView selection. |
|
5517 |
sel notNil ifTrue:[ |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5518 |
sel := sel collect:[:aSelectionIndex | |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5519 |
|nm| |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5520 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5521 |
nm := fileList at:aSelectionIndex ifAbsent:nil. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5522 |
nm notNil ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5523 |
nm := nm string. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5524 |
(nm endsWith:' ...') ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5525 |
nm := (nm copyWithoutLast:4) withoutSpaces |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5526 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5527 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5528 |
nm |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5529 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5530 |
action := [ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5531 |
sel do:[:nm | |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5532 |
nm notNil ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5533 |
aBlock value:nm |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5534 |
] |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5535 |
] |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5536 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5537 |
Processor activeProcess == self windowGroup process ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5538 |
self withWaitCursorDo:action |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5539 |
] ifFalse:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5540 |
action value |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5541 |
] |
1162 | 5542 |
] |
5543 |
||
1974 | 5544 |
"Modified: / 16.12.1998 / 17:30:57 / cg" |
1162 | 5545 |
! |
5546 |
||
5547 |
show:something |
|
5548 |
"show something in subview and undef acceptAction" |
|
5549 |
||
5550 |
subView contents:something. |
|
5551 |
subView acceptAction:nil. |
|
5552 |
subView modified:false. |
|
5553 |
currentFileName := nil |
|
5554 |
! |
|
5555 |
||
5556 |
showAlert:aString with:anErrorString |
|
5557 |
"show an alertbox, displaying the last Unix-error" |
|
5558 |
||
5559 |
|msg| |
|
5560 |
||
5561 |
anErrorString isNil ifTrue:[ |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5562 |
msg := aString |
1162 | 5563 |
] ifFalse:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5564 |
msg := aString , '\\(' , anErrorString , ')' |
1162 | 5565 |
]. |
5566 |
self warn:msg withCRs |
|
5567 |
! |
|
5568 |
||
5569 |
withoutHiddenFiles:aCollection |
|
5570 |
"remove hidden files (i.e. those that start with '.') from |
|
5571 |
the list in aCollection" |
|
5572 |
||
5573 |
|newCollection| |
|
5574 |
||
5575 |
newCollection := aCollection species new. |
|
5576 |
aCollection do:[:fname | |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5577 |
|ignore| |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5578 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5579 |
ignore := false. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5580 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5581 |
((fname startsWith:'.') and:[fname ~= '..']) ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5582 |
showingHiddenFiles value "showDotFiles" ifFalse:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5583 |
ignore := true |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5584 |
] |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5585 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5586 |
ignore ifFalse:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5587 |
newCollection add:fname |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5588 |
] |
1162 | 5589 |
]. |
5590 |
^ newCollection |
|
5591 |
||
1834 | 5592 |
"Modified: / 4.8.1998 / 13:46:27 / cg" |
1162 | 5593 |
! ! |
5594 |
||
5595 |
!FileBrowser methodsFor:'private - actions & command execution'! |
|
5596 |
||
5597 |
binaryFileAction:aFilename |
|
5598 |
"for some binary files, if double clicked, we can do some useful |
|
5599 |
action ..." |
|
5600 |
||
2385 | 5601 |
|cmd| |
5602 |
||
5603 |
(aFilename asFilename hasSuffix:'pdf') ifTrue:[ |
|
2434
5cf8d286f680
dont crash if DefaultCommandPerMIME is undefined
Claus Gittinger <cg@exept.de>
parents:
2430
diff
changeset
|
5604 |
DefaultCommandPerMIME isNil ifTrue:[ |
5cf8d286f680
dont crash if DefaultCommandPerMIME is undefined
Claus Gittinger <cg@exept.de>
parents:
2430
diff
changeset
|
5605 |
self class initializeDefaultCommands |
5cf8d286f680
dont crash if DefaultCommandPerMIME is undefined
Claus Gittinger <cg@exept.de>
parents:
2430
diff
changeset
|
5606 |
]. |
2385 | 5607 |
cmd := DefaultCommandPerMIME at:'application/pdf' ifAbsent:nil. |
5608 |
cmd notNil ifTrue:[ |
|
3654 | 5609 |
(OperatingSystem |
5610 |
executeCommand:(cmd bindWith:aFilename with:Display displayName) |
|
3747
d30bc1e54f15
Remove unused vars and asFilename sends
Stefan Vogel <sv@exept.de>
parents:
3746
diff
changeset
|
5611 |
inDirectory:currentDirectory) |
2385 | 5612 |
ifTrue:[^true]. |
5613 |
]. |
|
5614 |
]. |
|
5615 |
||
1330 | 5616 |
(currentDirectory construct:aFilename) isExecutableProgram ifTrue:[ |
3747
d30bc1e54f15
Remove unused vars and asFilename sends
Stefan Vogel <sv@exept.de>
parents:
3746
diff
changeset
|
5617 |
(OperatingSystem executeCommand:aFilename inDirectory:currentDirectory) |
2385 | 5618 |
ifTrue:[^true]. |
1162 | 5619 |
]. |
5620 |
^ self imageAction:aFilename |
|
5621 |
||
5622 |
"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
|
5623 |
"Modified: 18.9.1997 / 17:18:04 / stefan" |
1162 | 5624 |
! |
5625 |
||
1358 | 5626 |
doExecuteCommand:commandArg replace:replace |
1162 | 5627 |
"execute a unix command inserting the output of the command. |
5628 |
If replace is true, all text is replaced by the commands output; |
|
5629 |
otherwise, its inserted as selected text at the cursor position." |
|
5630 |
||
3527 | 5631 |
|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
|
5632 |
pauseSignal access stillReplacing pauseHolder lowerFrameView |
50157c992ef9
subprocess name of button event handler
Claus Gittinger <cg@exept.de>
parents:
1981
diff
changeset
|
5633 |
buttonWindowGroup| |
1162 | 5634 |
|
1358 | 5635 |
command := commandArg asString. |
5636 |
||
1162 | 5637 |
access := Semaphore forMutualExclusion name:'accessLock'. |
5638 |
stopSignal := Signal new. |
|
1335
4f8ee6e1d8e1
Use signal instead polling for pauseButton in #doExecuteCommand:replace:.
Stefan Vogel <sv@exept.de>
parents:
1334
diff
changeset
|
5639 |
pauseSignal := Signal new. |
1162 | 5640 |
|
5641 |
" |
|
1298
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
5642 |
The following is tricky: |
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
5643 |
the pauseToggle & killButton will |
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
5644 |
be handled by their own windowGroup process. |
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
5645 |
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
|
5646 |
I myself am reading the commands output. |
1162 | 5647 |
" |
1298
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
5648 |
|
1329 | 5649 |
commandView beInvisible. |
5650 |
||
1298
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
5651 |
" |
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
5652 |
must take kill & pauseButtons out of my group |
1162 | 5653 |
" |
1298
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
5654 |
killButton windowGroup:nil. |
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
5655 |
pauseToggle windowGroup:nil. |
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
5656 |
|
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
5657 |
" |
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
5658 |
bring them to front, and turn hidden-mode off |
1162 | 5659 |
" |
1298
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
5660 |
killButton raise; beVisible. |
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
5661 |
pauseToggle raise; beVisible. |
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
5662 |
|
1162 | 5663 |
" |
1298
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
5664 |
kill will make me raise the stopSignal when pressed |
1162 | 5665 |
" |
5666 |
killButton |
|
3025 | 5667 |
action:[ |
5668 |
stream notNil ifTrue:[ |
|
5669 |
access critical:[ |
|
5670 |
myProcess interruptWith:[stopSignal raiseRequest]. |
|
5671 |
] |
|
5672 |
] |
|
5673 |
]. |
|
1298
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
5674 |
|
1162 | 5675 |
" |
1298
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
5676 |
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
|
5677 |
" |
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
5678 |
pauseHolder := false asValue. |
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
5679 |
pauseToggle model:pauseHolder. |
1335
4f8ee6e1d8e1
Use signal instead polling for pauseButton in #doExecuteCommand:replace:.
Stefan Vogel <sv@exept.de>
parents:
1334
diff
changeset
|
5680 |
pauseToggle pressAction:[ |
3025 | 5681 |
stream notNil ifTrue:[ |
5682 |
access critical:[ |
|
5683 |
myProcess interruptWith:[pauseSignal raiseRequest]. |
|
5684 |
] |
|
5685 |
] |
|
1335
4f8ee6e1d8e1
Use signal instead polling for pauseButton in #doExecuteCommand:replace:.
Stefan Vogel <sv@exept.de>
parents:
1334
diff
changeset
|
5686 |
]. |
4f8ee6e1d8e1
Use signal instead polling for pauseButton in #doExecuteCommand:replace:.
Stefan Vogel <sv@exept.de>
parents:
1334
diff
changeset
|
5687 |
|
1298
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
5688 |
|
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
5689 |
" |
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
5690 |
start kill button under its own windowgroup |
1162 | 5691 |
" |
5692 |
killButton openAutonomous. |
|
1983
50157c992ef9
subprocess name of button event handler
Claus Gittinger <cg@exept.de>
parents:
1981
diff
changeset
|
5693 |
buttonWindowGroup := killButton windowGroup. |
50157c992ef9
subprocess name of button event handler
Claus Gittinger <cg@exept.de>
parents:
1981
diff
changeset
|
5694 |
buttonWindowGroup process name:'FileBrowser sub'. |
50157c992ef9
subprocess name of button event handler
Claus Gittinger <cg@exept.de>
parents:
1981
diff
changeset
|
5695 |
buttonWindowGroup process processGroupId:(Processor activeProcess id). |
1298
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
5696 |
|
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
5697 |
" |
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
5698 |
and add the pauseToggle to its windowGroup |
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
5699 |
" |
1983
50157c992ef9
subprocess name of button event handler
Claus Gittinger <cg@exept.de>
parents:
1981
diff
changeset
|
5700 |
pauseToggle windowGroup:buttonWindowGroup. |
1298
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
5701 |
|
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
5702 |
|
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
5703 |
lowerFrameView := subView superView. |
1162 | 5704 |
|
5705 |
" |
|
5706 |
go fork a pipe and read it |
|
5707 |
" |
|
5708 |
self label:(myName , ': executing ' , (command copyTo:(20 min:command size)) , ' ...'). |
|
5709 |
[ |
|
5710 |
self withWaitCursorDo:[ |
|
3025 | 5711 |
stopSignal catch:[ |
5712 |
pauseSignal handle:[:ex| |
|
5713 |
|noPauseSema| |
|
5714 |
||
5715 |
"/ |
|
5716 |
"/ allow interaction with |
|
5717 |
"/ the codeView via the other windowGroup |
|
5718 |
"/ |
|
5719 |
lowerFrameView windowGroup:buttonWindowGroup. |
|
5720 |
||
5721 |
"/ |
|
5722 |
"/ wait for pause to be turned off |
|
5723 |
"/ |
|
5724 |
noPauseSema := Semaphore new. |
|
5725 |
pauseHolder onChangeSend:#signal to:noPauseSema. |
|
5726 |
noPauseSema wait. |
|
5727 |
||
5728 |
"/ |
|
5729 |
"/ no interaction with the codeView ... |
|
5730 |
"/ |
|
5731 |
lowerFrameView windowGroup:(self windowGroup). |
|
5732 |
ex proceed. |
|
5733 |
] do:[ |
|
5734 |
startLine := subView cursorLine. |
|
5735 |
startCol := subView cursorCol. |
|
5736 |
||
5737 |
" |
|
5738 |
this can be a time consuming operation; therefore lower my priority |
|
5739 |
" |
|
5740 |
myProcess := Processor activeProcess. |
|
1912 | 5741 |
"/ myPriority := myProcess priority. |
5742 |
"/ myProcess priority:(Processor userBackgroundPriority). |
|
5743 |
||
3025 | 5744 |
stream := PipeStream |
5745 |
readingFrom:command |
|
5746 |
errorDisposition:#inline |
|
5747 |
inDirectory:currentDirectory. |
|
5748 |
stream notNil ifTrue:[ |
|
5749 |
[ |
|
5750 |
|codeView lines noPauseSema enc| |
|
5751 |
||
5752 |
enc := fileEncoding. |
|
5753 |
enc == #iso8859 ifTrue:[ |
|
5754 |
enc := nil |
|
5755 |
]. |
|
5756 |
||
5757 |
stream buffered:true. |
|
5758 |
codeView := subView. |
|
5759 |
codeView unselect. |
|
5760 |
||
5761 |
replace ifTrue:[ |
|
5762 |
codeView list:nil. |
|
5763 |
lnr := 1. |
|
5764 |
]. |
|
5765 |
||
5766 |
stillReplacing := replace. |
|
5767 |
||
3027 | 5768 |
[ |
3029 | 5769 |
stream readWaitWithTimeout:1. |
5770 |
stream atEnd not |
|
3027 | 5771 |
] whileTrue:[ |
3025 | 5772 |
" |
5773 |
data available; read up to 100 lines |
|
5774 |
and insert as a single junk. This speeds up |
|
5775 |
display of long output (less line-scrolling). |
|
5776 |
" |
|
5777 |
lines := OrderedCollection new:100. |
|
5778 |
||
5779 |
[ |
|
5780 |
line := stream nextLine. |
|
5781 |
line notNil ifTrue:[ |
|
5782 |
enc notNil ifTrue:[ |
|
5783 |
line := line decodeFrom:enc |
|
5784 |
]. |
|
5785 |
lines add:line |
|
5786 |
]. |
|
5787 |
] doWhile:[ |
|
3027 | 5788 |
stream pid notNil |
5789 |
and:[stream canReadWithoutBlocking |
|
3025 | 5790 |
and:[stream atEnd not |
3027 | 5791 |
and:[lines size < 100]]] |
3025 | 5792 |
]. |
5793 |
||
5794 |
" |
|
5795 |
need this critical section; otherwise, |
|
5796 |
we could get the signal while waiting for |
|
5797 |
an expose event ... |
|
5798 |
" |
|
5799 |
access critical:[ |
|
5800 |
lines size > 0 ifTrue:[ |
|
5801 |
stillReplacing ifTrue:[ |
|
5802 |
lines do:[:line | |
|
5803 |
codeView at:lnr put:line withTabsExpanded. |
|
5804 |
codeView cursorToBottom; cursorDown:1. |
|
5805 |
lnr := lnr + 1. |
|
5806 |
lnr > codeView list size ifTrue:[ |
|
5807 |
stillReplacing := false |
|
5808 |
] |
|
5809 |
]. |
|
5810 |
] ifFalse:[ |
|
5811 |
codeView insertLines:lines before:codeView cursorLine. |
|
5812 |
codeView cursorDown:lines size. |
|
5813 |
] |
|
5814 |
]. |
|
5815 |
]. |
|
5816 |
||
5817 |
" |
|
5818 |
give others running at same prio a chance too |
|
5819 |
(especially other FileBrowsers doing the same) |
|
5820 |
" |
|
5821 |
Processor yield |
|
5822 |
]. |
|
3596
9761af1f3f72
#valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents:
3568
diff
changeset
|
5823 |
] ensure:[ |
3025 | 5824 |
stream shutDown "close". stream := nil. |
5825 |
]. |
|
5826 |
||
5827 |
"/ |
|
5828 |
"/ the command could have changed the directory |
|
5829 |
"/ |
|
5830 |
self updateCurrentDirectoryIfChanged |
|
5831 |
]. |
|
5832 |
replace ifTrue:[ |
|
5833 |
subView modified:false. |
|
5834 |
]. |
|
5835 |
] |
|
5836 |
] |
|
1162 | 5837 |
] |
3596
9761af1f3f72
#valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents:
3568
diff
changeset
|
5838 |
] ensure:[ |
3025 | 5839 |
|wg| |
5840 |
||
5841 |
self label:myName; iconLabel:myName. |
|
1912 | 5842 |
"/ myProcess notNil ifTrue:[myProcess priority:myPriority]. |
5843 |
||
3025 | 5844 |
" |
5845 |
hide the button, and make sure it will stay |
|
5846 |
hidden when we are realized again |
|
5847 |
" |
|
5848 |
killButton beInvisible. |
|
5849 |
pauseToggle beInvisible. |
|
5850 |
||
5851 |
commandView beVisible. |
|
5852 |
||
5853 |
" |
|
5854 |
remove the killButton from its group |
|
5855 |
(otherwise, it will be destroyed when we shut down the group) |
|
5856 |
" |
|
5857 |
wg := killButton windowGroup. |
|
5858 |
killButton windowGroup:nil. |
|
5859 |
pauseToggle windowGroup:nil. |
|
5860 |
||
5861 |
" |
|
5862 |
shut down the kill buttons windowgroup |
|
5863 |
" |
|
5864 |
wg notNil ifTrue:[ |
|
5865 |
wg process terminate. |
|
5866 |
]. |
|
5867 |
" |
|
5868 |
clear its action (actually not needed, but |
|
5869 |
releases reference to thisContext earlier) |
|
5870 |
" |
|
5871 |
killButton action:nil. |
|
5872 |
pauseToggle pressAction:nil. |
|
5873 |
"/ |
|
5874 |
"/ allow interaction with the codeView |
|
5875 |
"/ (bring it back into my group) |
|
5876 |
"/ |
|
5877 |
lowerFrameView windowGroup:(self windowGroup). |
|
1162 | 5878 |
]. |
5879 |
||
5880 |
currentFileName isNil ifTrue:[ |
|
3025 | 5881 |
subView modified:false. |
1162 | 5882 |
]. |
5883 |
||
5884 |
subView size > 10000 ifTrue:[ |
|
3025 | 5885 |
self warn:'text quite large now - please cut off some lines' |
1162 | 5886 |
] |
5887 |
||
1358 | 5888 |
"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
|
5889 |
"Modified: / 6.3.1998 / 17:32:03 / stefan" |
1933 | 5890 |
"Modified: / 15.10.1998 / 12:37:52 / cg" |
1162 | 5891 |
! |
5892 |
||
5893 |
imageAction:aFilename |
|
5894 |
"for some image files, if double clicked, we can do some useful |
|
5895 |
action ..." |
|
5896 |
||
3729 | 5897 |
|file img errmsg| |
5898 |
||
5899 |
file := currentDirectory construct:aFilename. |
|
5900 |
||
5901 |
(Image isImageFileSuffix:(file suffix)) |
|
1162 | 5902 |
ifTrue:[ |
3729 | 5903 |
Image imageLoadErrorSignal handle:[:ex | |
5904 |
"/ ex signal ~~ Image badImageFormatQuerySignal |
|
5905 |
"/ ifTrue:[ |
|
5906 |
errmsg := ex errorString |
|
5907 |
"/ ] |
|
2158
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5908 |
] do:[ |
3729 | 5909 |
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
|
5910 |
]. |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5911 |
img notNil ifTrue:[ |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5912 |
ImageEditor openOnImage:img. |
1410 | 5913 |
"/ img inspect. |
2158
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5914 |
^ true |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5915 |
]. |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5916 |
errmsg notNil ifTrue:[ |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5917 |
self warn:errmsg. |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5918 |
] |
1162 | 5919 |
]. |
5920 |
^ false |
|
5921 |
||
2158
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5922 |
"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
|
5923 |
"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
|
5924 |
"Modified: / 18.5.1999 / 15:45:06 / cg" |
1162 | 5925 |
! |
5926 |
||
5927 |
initialCommandFor:fileName into:aBox |
|
5928 |
"set a useful initial command for execute box." |
|
5929 |
||
2345 | 5930 |
|mime cmd select path suffix| |
5931 |
||
5932 |
path := currentDirectory filenameFor:fileName. |
|
3743 | 5933 |
suffix := fileName asFilename suffix. |
3746 | 5934 |
DefaultCommandPerSuffix notNil ifTrue:[ |
5935 |
cmd := DefaultCommandPerSuffix at:suffix ifAbsent:nil. |
|
5936 |
cmd notNil ifTrue:[ |
|
5937 |
aBox initialText:(cmd , ' ' , fileName) selectFrom:1 to:cmd size. |
|
5938 |
^ self |
|
5939 |
]. |
|
3743 | 5940 |
]. |
5941 |
mime := MIMETypes mimeTypeForSuffix:suffix. |
|
2345 | 5942 |
"/ mime notNil ifTrue:[ |
5943 |
"/ cmd := self initialCommandForMIME:mime file:path |
|
5944 |
"/ ]. |
|
1162 | 5945 |
|
5946 |
"/ XXX should be changed to take stuff from a config file |
|
5947 |
"/ XXX or from resources. |
|
5948 |
||
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
5949 |
(path type == #regular) ifTrue:[ |
2345 | 5950 |
path isExecutableProgram ifTrue:[ |
5951 |
aBox initialText:(fileName , ' <arguments>'). |
|
5952 |
^ self |
|
5953 |
]. |
|
5954 |
||
5955 |
select := true. |
|
5956 |
||
5957 |
"some heuristics - my personal preferences ... |
|
5958 |
(actually this should come from a configfile)" |
|
5959 |
||
5960 |
(fileName endsWith:'akefile') ifTrue:[ |
|
5961 |
aBox initialText:'make target' selectFrom:6 to:11. |
|
5962 |
^ self |
|
5963 |
]. |
|
5964 |
||
2346 | 5965 |
DefaultCommandPerMIME isNil ifTrue:[ |
5966 |
self class initializeDefaultCommands |
|
5967 |
]. |
|
5968 |
||
5969 |
cmd := DefaultCommandPerMIME at:mime ifAbsent:nil. |
|
5970 |
cmd notNil ifTrue:[ |
|
5971 |
select := false |
|
5972 |
]. |
|
5973 |
||
5974 |
cmd isNil ifTrue:[ |
|
5975 |
||
5976 |
suffix := path suffix. |
|
5977 |
(suffix = 'C') ifTrue:[ |
|
2345 | 5978 |
cmd := 'g++ -c %1'. |
5979 |
select := 6. |
|
2346 | 5980 |
] ifFalse:[ |
5981 |
suffix := suffix asLowercase. |
|
5982 |
||
5983 |
(suffix = 'taz') ifTrue:[ |
|
5984 |
aBox initialText:'zcat %1 | tar tvf -'. |
|
5985 |
select := false. |
|
5986 |
]. |
|
5987 |
(suffix = 'tar') ifTrue:[ |
|
5988 |
cmd := 'tar tvf %1'. |
|
5989 |
select := 7. |
|
5990 |
]. |
|
5991 |
(suffix = 'zoo') ifTrue:[ |
|
5992 |
cmd := 'zoo -list %1'. |
|
5993 |
select := 9. |
|
5994 |
]. |
|
5995 |
(suffix = 'zip') ifTrue:[ |
|
5996 |
cmd := 'unzip -l %1'. |
|
5997 |
select := 8. |
|
5998 |
]. |
|
5999 |
(suffix = 'jar') ifTrue:[ |
|
6000 |
cmd := 'unzip -l %1'. |
|
6001 |
select := 8. |
|
6002 |
]. |
|
6003 |
(suffix = 'z') ifTrue:[ |
|
6004 |
(fileName asLowercase endsWith:'tar.z') ifTrue:[ |
|
6005 |
cmd := 'zcat %1 | tar tvf -'. |
|
6006 |
select := false. |
|
6007 |
] ifFalse:[ |
|
6008 |
cmd := 'uncompress %1' |
|
6009 |
]. |
|
6010 |
]. |
|
6011 |
(suffix = 'gz') ifTrue:[ |
|
6012 |
(fileName asLowercase endsWith:'tar.gz') ifTrue:[ |
|
6013 |
cmd := ('gunzip < %1 | tar tvf -' ). |
|
6014 |
select := false. |
|
6015 |
] ifFalse:[ |
|
6016 |
cmd := 'gunzip %1'. |
|
6017 |
]. |
|
6018 |
]. |
|
6019 |
(suffix = 'html') ifTrue:[ |
|
6020 |
cmd := 'netscape %1' |
|
6021 |
]. |
|
6022 |
(suffix = 'htm') ifTrue:[ |
|
6023 |
cmd := 'netscape %1' |
|
6024 |
]. |
|
6025 |
(suffix = 'uue') ifTrue:[ |
|
6026 |
cmd := 'uudecode %1' |
|
6027 |
]. |
|
6028 |
(suffix = 'c') ifTrue:[ |
|
6029 |
cmd := 'cc -c %1'. |
|
6030 |
select := 5. |
|
6031 |
]. |
|
6032 |
(suffix = 'cc') ifTrue:[ |
|
6033 |
cmd := 'g++ -c %1'. |
|
6034 |
select := 6. |
|
6035 |
]. |
|
6036 |
(suffix = 'xbm') ifTrue:[ |
|
6037 |
cmd := 'bitmap %1' |
|
6038 |
]. |
|
6039 |
(suffix = 'ps') ifTrue:[ |
|
6040 |
cmd := 'ghostview %1' |
|
6041 |
]. |
|
6042 |
((suffix = '1') or:[suffix = 'man']) ifTrue:[ |
|
6043 |
cmd := 'nroff -man %1'. |
|
6044 |
select := 10. |
|
6045 |
]. |
|
2345 | 6046 |
]. |
6047 |
]. |
|
6048 |
||
6049 |
cmd isNil ifTrue:[ |
|
6050 |
DefaultCommandPerSuffix isNil ifTrue:[ |
|
6051 |
cmd := '<cmd>' |
|
6052 |
] ifFalse:[ |
|
6053 |
cmd := DefaultCommandPerSuffix |
|
6054 |
at:suffix |
|
6055 |
ifAbsent:'<cmd>'. |
|
6056 |
]. |
|
6057 |
cmd := cmd , ' %1'. |
|
6058 |
]. |
|
6059 |
||
6060 |
cmd := cmd bindWith:fileName. |
|
6061 |
select == false ifTrue:[ |
|
6062 |
aBox initialText:cmd |
|
6063 |
] ifFalse:[ |
|
6064 |
select class == Interval ifTrue:[ |
|
6065 |
aBox initialText:cmd selectFrom:select start to:select stop |
|
6066 |
] ifFalse:[ |
|
6067 |
select isInteger ifFalse:[ |
|
6068 |
select := (cmd indexOf:Character space ifAbsent:[cmd size + 1]) - 1. |
|
6069 |
]. |
|
6070 |
aBox initialText:cmd selectFrom:1 to:select |
|
6071 |
]. |
|
6072 |
] |
|
1162 | 6073 |
] |
6074 |
||
1542 | 6075 |
"Modified: / 24.9.1997 / 16:34:52 / stefan" |
6076 |
"Modified: / 9.4.1998 / 17:15:57 / cg" |
|
1162 | 6077 |
! |
6078 |
||
6079 |
nonBinaryFileAction:aFilename |
|
6080 |
"for some nonBinary files, if double clicked, we can do some useful |
|
6081 |
action ..." |
|
6082 |
||
1493 | 6083 |
|fullPath| |
1162 | 6084 |
|
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
6085 |
fullPath := currentDirectory filenameFor:aFilename. |
2550 | 6086 |
((fullPath hasSuffix:'htm') |
6087 |
or:[(fullPath hasSuffix:'HTM') |
|
6088 |
or:[(fullPath hasSuffix:'html') |
|
6089 |
or:[(fullPath hasSuffix:'HTML')]]]) ifTrue:[ |
|
2385 | 6090 |
HTMLDocumentView openOn:fullPath pathName. |
6091 |
^ true |
|
2091 | 6092 |
]. |
6093 |
((fullPath hasSuffix:'prj') |
|
6094 |
and:[ProjectBrowser notNil]) ifTrue:[ |
|
2385 | 6095 |
ProjectBrowser openOnFile:fullPath pathName. |
6096 |
^ true |
|
1162 | 6097 |
]. |
6098 |
||
6099 |
OperatingSystem isUNIXlike ifTrue:[ |
|
2385 | 6100 |
(#('.man' '.1' '.2' '.3') findFirst:[:suff | fullPath hasSuffix:suff]) ~~ 0 |
6101 |
ifTrue:[ |
|
6102 |
HTMLDocumentView openFullOnText:(HTMLDocGenerator manPageForFile:fullPath pathName). |
|
6103 |
^ true |
|
6104 |
]. |
|
1162 | 6105 |
]. |
6106 |
^ self imageAction:aFilename |
|
6107 |
||
6108 |
"Created: 19.6.1996 / 09:36:38 / cg" |
|
6109 |
"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
|
6110 |
"Modified: 18.9.1997 / 16:58:40 / stefan" |
1162 | 6111 |
! ! |
6112 |
||
6113 |
!FileBrowser methodsFor:'private - directory stuff'! |
|
6114 |
||
1371
a80db8d0e311
remember directory in history when entering (not when leaving)
Claus Gittinger <cg@exept.de>
parents:
1358
diff
changeset
|
6115 |
addToHistory:path |
2951
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
6116 |
self class addToHistory:path |
1371
a80db8d0e311
remember directory in history when entering (not when leaving)
Claus Gittinger <cg@exept.de>
parents:
1358
diff
changeset
|
6117 |
! |
a80db8d0e311
remember directory in history when entering (not when leaving)
Claus Gittinger <cg@exept.de>
parents:
1358
diff
changeset
|
6118 |
|
172 | 6119 |
changeToPreviousDirectory |
6120 |
"if text was modified show a queryBox, |
|
6121 |
otherwise change immediately to previous directory." |
|
93 | 6122 |
|
172 | 6123 |
previousDirectory isNil ifTrue:[^ self]. |
1339
4b712d8c1738
Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents:
1336
diff
changeset
|
6124 |
self discardChangesDialog ifTrue:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6125 |
self doChangeCurrentDirectoryTo:previousDirectory updateHistory:false |
172 | 6126 |
] |
1339
4b712d8c1738
Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents:
1336
diff
changeset
|
6127 |
|
4b712d8c1738
Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents:
1336
diff
changeset
|
6128 |
"Modified: 2.10.1997 / 14:13:40 / stefan" |
36 | 6129 |
! |
6130 |
||
98 | 6131 |
checkIfDirectoryHasChanged |
6132 |
"every checkDelta secs, check if directoy has changed and update the list if so. |
|
6133 |
Also, we check if the file shown has been touched in the meanwhile (for example, |
|
6134 |
from another browser) and say 'outdated' in the label if so. |
|
6135 |
This avoids confusion if the same file is being edited by two browsers. (or other editors). |
|
6136 |
If the text shown in the codeView has been edited, 'modified' is shown. |
|
6137 |
" |
|
6138 |
||
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
6139 |
|oldSelection nOld newState msg newLabel t| |
98 | 6140 |
|
6141 |
shown ifTrue:[ |
|
2220
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
6142 |
currentDirectory notNil ifTrue:[ |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
6143 |
(lockUpdate or:[doAutoUpdate value not]) ifTrue:[ |
3520
83cf11e1bf32
schedule checkBlock for the right process
Claus Gittinger <cg@exept.de>
parents:
3503
diff
changeset
|
6144 |
self scheduleCheckBlock. |
2220
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
6145 |
^ self |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
6146 |
]. |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
6147 |
|
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
6148 |
subView modified ifTrue:[ |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
6149 |
newState := ' (modified)' |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
6150 |
]. |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
6151 |
|
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
6152 |
(currentDirectory isReadable) ifTrue:[ |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
6153 |
Processor removeTimedBlock:checkBlock. |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
6154 |
|
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
6155 |
t := currentDirectory modificationTime. |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
6156 |
(t notNil and:[t > timeOfLastCheck]) ifTrue:[ |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
6157 |
nOld := fileListView numberOfSelections. |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
6158 |
oldSelection := fileListView selectionValue. |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
6159 |
self updateCurrentDirectory. |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
6160 |
nOld ~~ 0 ifTrue:[ |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
6161 |
nOld > 1 ifTrue:[ |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
6162 |
oldSelection do:[:element | |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
6163 |
fileListView addElementToSelection:element |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
6164 |
] |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
6165 |
] ifFalse:[ |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
6166 |
fileListView selectElementWithoutScroll:oldSelection |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
6167 |
] |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
6168 |
]. |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
6169 |
] ifFalse:[ |
3520
83cf11e1bf32
schedule checkBlock for the right process
Claus Gittinger <cg@exept.de>
parents:
3503
diff
changeset
|
6170 |
self scheduleCheckBlock. |
2220
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
6171 |
]. |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
6172 |
|
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
6173 |
currentFileName notNil ifTrue:[ |
3399 | 6174 |
|f mod| |
2220
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
6175 |
f := currentDirectory construct:currentFileName. |
3399 | 6176 |
(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
|
6177 |
newState := ' (removed)'. |
3399 | 6178 |
] ifFalse:[ |
6179 |
mod > timeOfFileRead ifTrue:[ |
|
2220
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
6180 |
newState := ' (outdated)'. |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
6181 |
subView modified ifTrue:[ |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
6182 |
newState := ' (modified & outdated)' |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
6183 |
] |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
6184 |
]. |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
6185 |
]. |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
6186 |
]. |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
6187 |
] ifFalse:[ |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
6188 |
" |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
6189 |
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
|
6190 |
" |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
6191 |
(currentDirectory exists) ifFalse:[ |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
6192 |
msg := 'FileBrowser:\\directory %1 is gone ?!!?' |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
6193 |
] ifTrue:[ |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
6194 |
msg := 'FileBrowser:\\directory %1 is no longer readable ?!!?' |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
6195 |
]. |
3417
1fee40dd5af4
win32: do not x-laet backslash in a filename to cr in warnbox
Claus Gittinger <cg@exept.de>
parents:
3414
diff
changeset
|
6196 |
"/ sigh - avoid translating backslashes in WIN-filenames |
3528 | 6197 |
msg := (resources string:msg) withCRs. |
6198 |
Dialog warn:(msg bindWith:currentDirectory pathName allBold). |
|
2220
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
6199 |
|
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
6200 |
fileListView contents:nil. |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
6201 |
newLabel := myName , ': directory is gone !!'. |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
6202 |
]. |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
6203 |
|
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
6204 |
newState notNil ifTrue:[ |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
6205 |
newLabel := myName. |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
6206 |
currentFileName notNil ifTrue:[ |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
6207 |
newLabel := newLabel , ': ' , currentFileName |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
6208 |
]. |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
6209 |
newLabel := newLabel , newState. |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
6210 |
]. |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
6211 |
newLabel notNil ifTrue:[ |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
6212 |
self label:newLabel. |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
6213 |
] |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
6214 |
] |
98 | 6215 |
] |
1168
b157f3712548
care for nil returns from userName/groupName * time queries
Claus Gittinger <cg@exept.de>
parents:
1166
diff
changeset
|
6216 |
|
1380
547d31bfa12c
warning string fixed when directory vanishes
Claus Gittinger <cg@exept.de>
parents:
1374
diff
changeset
|
6217 |
"Modified: / 28.4.1997 / 22:31:02 / dq" |
547d31bfa12c
warning string fixed when directory vanishes
Claus Gittinger <cg@exept.de>
parents:
1374
diff
changeset
|
6218 |
"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
|
6219 |
"Modified: / 15.11.2001 / 21:27:05 / cg" |
98 | 6220 |
! |
6221 |
||
172 | 6222 |
doChangeCurrentDirectoryTo:fileName updateHistory:updateHistory |
6223 |
"verify argument is name of a readable & executable directory |
|
6224 |
and if so, go there" |
|
6225 |
||
1317 | 6226 |
|msg path idx f| |
172 | 6227 |
|
6228 |
self label:myName; iconLabel:myName. |
|
6229 |
fileName notNil ifTrue:[ |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6230 |
(f := fileName asFilename) isAbsolute ifFalse:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6231 |
f := currentDirectory filenameFor:fileName. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6232 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6233 |
f := f asAbsoluteFilename. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6234 |
(f isDirectory) ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6235 |
(f isReadable) ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6236 |
(f isExecutable) ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6237 |
path := currentDirectory pathName. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6238 |
previousDirectory := path. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6239 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6240 |
" |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6241 |
remember where we are positioned in the fileList |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6242 |
(in case we want to return) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6243 |
" |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6244 |
idx := DirectoryHistory indexOf:path. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6245 |
idx ~~ 0 ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6246 |
DirectoryHistoryWhere at:idx put:fileListView firstLineShown |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6247 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6248 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6249 |
updateHistory ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6250 |
self addToHistory:path. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6251 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6252 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6253 |
self setCurrentDirectory:(f pathName). |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6254 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6255 |
"/ fetch the new path. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6256 |
path := currentDirectory pathName. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6257 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6258 |
" |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6259 |
if we have already been there, look for the |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6260 |
position offset, and scroll the fileList |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6261 |
" |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6262 |
idx := DirectoryHistory indexOf:path. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6263 |
idx ~~ 0 ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6264 |
|pos| |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6265 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6266 |
pos := DirectoryHistoryWhere at:idx. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6267 |
pos notNil ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6268 |
fileListView scrollToLine:pos. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6269 |
] |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6270 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6271 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6272 |
updateHistory ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6273 |
self addToHistory:path. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6274 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6275 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6276 |
^ self |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6277 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6278 |
msg := 'cannot change directory to ''%1'' !!' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6279 |
] ifFalse:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6280 |
msg := 'cannot read directory ''%1'' !!' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6281 |
] |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6282 |
] ifFalse:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6283 |
OperatingSystem isVMSlike ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6284 |
"/ cannot tell if it exists or is simply invisible ... |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6285 |
msg := '''%1'' is not a directory or unreadable !!' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6286 |
] ifFalse:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6287 |
msg := '''%1'' is not a directory !!' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6288 |
] |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6289 |
]. |
3528 | 6290 |
msg := (resources string:msg) withCRs. |
6291 |
Dialog warn:(msg bindWith:fileName allBold). |
|
172 | 6292 |
] |
1166
0029f77ccea7
when updating the directoryList,
Claus Gittinger <cg@exept.de>
parents:
1162
diff
changeset
|
6293 |
|
1371
a80db8d0e311
remember directory in history when entering (not when leaving)
Claus Gittinger <cg@exept.de>
parents:
1358
diff
changeset
|
6294 |
"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
|
6295 |
"Modified: / 27.4.1999 / 17:10:14 / cg" |
1329 | 6296 |
! |
6297 |
||
6298 |
doChangeToDefaultDirectory |
|
6299 |
"go to parent directory" |
|
6300 |
||
6301 |
self doChangeCurrentDirectoryTo:(Filename currentDirectory pathName) updateHistory:true |
|
6302 |
||
6303 |
"Created: 21.9.1997 / 23:45:59 / cg" |
|
172 | 6304 |
! |
6305 |
||
6306 |
doChangeToHomeDirectory |
|
6307 |
"go to home directory" |
|
6308 |
||
6309 |
self doChangeCurrentDirectoryTo:(OperatingSystem getHomeDirectory) updateHistory:true |
|
6310 |
! |
|
6311 |
||
6312 |
doChangeToParentDirectory |
|
1317 | 6313 |
"go to parent directory" |
36 | 6314 |
|
172 | 6315 |
self doChangeCurrentDirectoryTo:'..' updateHistory:true |
6316 |
! |
|
6317 |
||
6318 |
doCreateDirectory:newName |
|
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
6319 |
|f| |
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
6320 |
|
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
6321 |
f := currentDirectory filenameFor:newName. |
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
6322 |
f exists ifTrue:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6323 |
self warn:'%1 already exists.' with:newName. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6324 |
^ self |
172 | 6325 |
]. |
6326 |
||
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
6327 |
f makeDirectory ifTrue:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6328 |
self updateCurrentDirectory |
172 | 6329 |
] ifFalse:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6330 |
self showAlert:(resources string:'cannot create directory ''%1'' !!' with:newName) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6331 |
with:(OperatingSystem lastErrorString) |
172 | 6332 |
] |
1157
667a57034e40
only update if the directory did change (after execute command)
Claus Gittinger <cg@exept.de>
parents:
1156
diff
changeset
|
6333 |
|
1988 | 6334 |
"Modified: / 18.9.1997 / 17:21:25 / stefan" |
6335 |
"Modified: / 30.1.1999 / 16:24:12 / cg" |
|
172 | 6336 |
! |
6337 |
||
1162 | 6338 |
setCurrentDirectory:aPathName |
6339 |
"setup for another directory" |
|
6340 |
||
6341 |
|newDirectory| |
|
6342 |
||
6343 |
aPathName isEmpty ifTrue:[^ self]. |
|
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
6344 |
newDirectory := currentDirectory filenameFor:aPathName. |
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
6345 |
newDirectory isDirectory ifTrue:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6346 |
self currentDirectory:newDirectory. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6347 |
currentFileName notNil ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6348 |
fileListView contents:nil. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6349 |
currentFileName := nil. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6350 |
] ifFalse:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6351 |
fileListView setSelection:nil. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6352 |
fileListView scrollToTop. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6353 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6354 |
self updateCurrentDirectory. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6355 |
self showInfo. |
172 | 6356 |
] |
294 | 6357 |
|
1162 | 6358 |
"Modified: 21.9.1995 / 11:22:45 / claus" |
6359 |
"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
|
6360 |
"Modified: 18.9.1997 / 17:08:07 / stefan" |
912
dae70963b64c
define language specific commentStrings
Claus Gittinger <cg@exept.de>
parents:
874
diff
changeset
|
6361 |
! |
dae70963b64c
define language specific commentStrings
Claus Gittinger <cg@exept.de>
parents:
874
diff
changeset
|
6362 |
|
1162 | 6363 |
updateCurrentDirectoryIfChanged |
1837 | 6364 |
|t| |
6365 |
||
1975 | 6366 |
OperatingSystem isMSDOSlike ifTrue:[ |
2636 | 6367 |
"/ workaround: DOS has no directory modifiation time ... |
6368 |
self updateCurrentDirectory. |
|
6369 |
^ self |
|
1975 | 6370 |
]. |
6371 |
||
1837 | 6372 |
((t := currentDirectory modificationTime) isNil |
6373 |
or:[t > timeOfLastCheck]) ifTrue:[ |
|
2636 | 6374 |
self updateCurrentDirectory |
1162 | 6375 |
] |
6376 |
||
1837 | 6377 |
"Modified: / 16.9.1997 / 15:35:52 / stefan" |
1975 | 6378 |
"Modified: / 16.12.1998 / 22:55:44 / cg" |
1162 | 6379 |
! ! |
6380 |
||
6381 |
!FileBrowser methodsFor:'private - encoding'! |
|
172 | 6382 |
|
395 | 6383 |
guessEncodingFrom:aBuffer |
988 | 6384 |
"look for a string |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6385 |
encoding #name |
988 | 6386 |
or: |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6387 |
encoding: name |
1209 | 6388 |
within the given buffer |
6389 |
(which is usually the first few bytes of a textFile). |
|
6390 |
If thats not found, use heuristics (in CharacterArray) to guess." |
|
988 | 6391 |
|
395 | 6392 |
|n "{Class: SmallInteger }" |
1209 | 6393 |
binary idx s w enc| |
395 | 6394 |
|
6395 |
binary := false. |
|
6396 |
n := aBuffer size. |
|
6397 |
||
1223 | 6398 |
(idx := aBuffer findString:'charset=') ~~ 0 ifTrue:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6399 |
s := ReadStream on:aBuffer. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6400 |
s position:idx + 8. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6401 |
s skipSeparators. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6402 |
w := s upToSeparator. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6403 |
w notNil ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6404 |
(idx := w indexOf:$") ~~ 0 ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6405 |
w := w copyTo:idx-1 |
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 |
^ w asSymbol |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6408 |
]. |
1223 | 6409 |
]. |
807 | 6410 |
(idx := aBuffer findString:'encoding') ~~ 0 ifTrue:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6411 |
s := ReadStream on:aBuffer. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6412 |
s position:idx + 8. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6413 |
s skipSeparators. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6414 |
s peek == $: ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6415 |
s next. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6416 |
s skipSeparators. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6417 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6418 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6419 |
s peek == $# ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6420 |
s next. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6421 |
s skipSeparators. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6422 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6423 |
w := s upToSeparator. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6424 |
w notNil ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6425 |
^ w asSymbol |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6426 |
]. |
807 | 6427 |
]. |
6428 |
||
395 | 6429 |
1 to:n do:[:i | |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6430 |
(aBuffer at:i) isPrintable ifFalse:[binary := true]. |
395 | 6431 |
]. |
807 | 6432 |
|
395 | 6433 |
binary ifTrue:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6434 |
"/ look for JIS7 / EUC encoding |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6435 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6436 |
enc := CharacterArray guessEncodingFrom:aBuffer. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6437 |
enc notNil ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6438 |
^ enc |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6439 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6440 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6441 |
"/ if the encoding has been set to any non iso setting, |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6442 |
"/ assume its what we defined ... |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6443 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6444 |
(('iso*' match:fileEncoding) or:['ascii*' match:fileEncoding]) ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6445 |
^ #binary |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6446 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6447 |
^ fileEncoding ? #binary |
395 | 6448 |
]. |
6449 |
^ #ascii |
|
6450 |
||
6451 |
"Created: 26.2.1996 / 17:43:08 / cg" |
|
1223 | 6452 |
"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
|
6453 |
! |
02d5bbd925dd
allow decoding errors to be ignored
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
6454 |
|
02d5bbd925dd
allow decoding errors to be ignored
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
6455 |
preferredFontEncodingFor:fileEncoding |
02d5bbd925dd
allow decoding errors to be ignored
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
6456 |
"given a file encoding, return corresponding preferred fontEncoding |
02d5bbd925dd
allow decoding errors to be ignored
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
6457 |
match pattern" |
02d5bbd925dd
allow decoding errors to be ignored
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
6458 |
|
1223 | 6459 |
|fe| |
6460 |
||
6461 |
fe := MIMETypes fontForCharset:fileEncoding. |
|
6462 |
fe notNil ifTrue:[^ fe]. |
|
1221 | 6463 |
^ 'iso8859*' |
1214
02d5bbd925dd
allow decoding errors to be ignored
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
6464 |
|
02d5bbd925dd
allow decoding errors to be ignored
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
6465 |
"Created: 28.6.1997 / 20:47:35 / cg" |
1223 | 6466 |
"Modified: 1.7.1997 / 00:04:56 / cg" |
395 | 6467 |
! |
6468 |
||
1140 | 6469 |
validateFontEncodingFor:newEncoding ask:ask |
6470 |
"if required, query user if he/she wants to change to another font, |
|
6471 |
which is able to display text encoded as specified by newEncoding" |
|
6472 |
||
1214
02d5bbd925dd
allow decoding errors to be ignored
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
6473 |
|fontsEncoding msg filter f defaultFont pref| |
1140 | 6474 |
|
6475 |
fontsEncoding := subView font encoding. |
|
6476 |
||
1221 | 6477 |
pref := self preferredFontEncodingFor:newEncoding. |
6478 |
||
6479 |
(pref match:fontsEncoding) ifTrue:[ |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6480 |
^ self |
1140 | 6481 |
]. |
1221 | 6482 |
"/ stupid ... |
6483 |
pref = 'ascii*' ifTrue:[ |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6484 |
(fontsEncoding match:'iso8859*') ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6485 |
^ self |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6486 |
] |
1140 | 6487 |
]. |
6488 |
||
1221 | 6489 |
filter := [:f | |coding| |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6490 |
(coding := f encoding) notNil |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6491 |
and:[pref match:coding]]. |
1221 | 6492 |
|
6493 |
defaultFont := TextView defaultFont onDevice:device. |
|
6494 |
(pref match:(defaultFont encoding)) ifFalse:[ |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6495 |
defaultFont := nil. |
1140 | 6496 |
]. |
6497 |
||
1221 | 6498 |
defaultFont isNil ifTrue:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6499 |
(pref = 'ascii*' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6500 |
or:[pref = 'iso8859*']) ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6501 |
defaultFont := FontDescription family:'courier' face:'medium' style:'roman' size:12 |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6502 |
] |
1221 | 6503 |
]. |
6504 |
||
6505 |
defaultFont isNil ifTrue:[ |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6506 |
defaultFont := device |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6507 |
listOfAvailableFonts |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6508 |
detect:[:f | filter value:f] |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6509 |
ifNone:nil. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6510 |
defaultFont isNil ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6511 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6512 |
"/ flush list, and refetch font list |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6513 |
"/ (in case someone just changed the font path ...) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6514 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6515 |
device flushListOfAvailableFonts. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6516 |
defaultFont := device |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6517 |
listOfAvailableFonts |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6518 |
detect:[:f | filter value:f] |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6519 |
ifNone:nil. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6520 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6521 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6522 |
defaultFont isNil ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6523 |
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
|
6524 |
^ self. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6525 |
] |
1221 | 6526 |
]. |
6527 |
||
6528 |
msg := 'switch to a %1 encoded font ?'. |
|
6529 |
(ask not or:[self confirm:(resources string:msg with:pref) withCRs]) |
|
6530 |
ifTrue:[ |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6531 |
self withWaitCursorDo:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6532 |
f := FontPanel |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6533 |
fontFromUserInitial:defaultFont |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6534 |
title:(resources string:'font selection') |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6535 |
filter:filter. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6536 |
f notNil ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6537 |
subView font:f |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6538 |
] |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6539 |
] |
1140 | 6540 |
] |
6541 |
||
6542 |
"Created: 26.10.1996 / 12:06:54 / cg" |
|
1221 | 6543 |
"Modified: 30.6.1997 / 17:46:46 / cg" |
1162 | 6544 |
! ! |
6545 |
||
6546 |
!FileBrowser methodsFor:'private - file stuff'! |
|
6547 |
||
6548 |
doCreateFile:newName |
|
6549 |
"create an empty file" |
|
6550 |
||
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
6551 |
|aStream f| |
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
6552 |
|
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
6553 |
f := currentDirectory filenameFor:newName. |
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
6554 |
f exists ifTrue:[ |
3421 | 6555 |
(self |
6556 |
ask:(resources string:'%1 already exists\\truncate ?' with:newName) |
|
6557 |
yesButton:'truncate' |
|
6558 |
) ifFalse:[^ self]. |
|
1162 | 6559 |
]. |
6560 |
||
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
6561 |
FileStream openErrorSignal handle:[:ex| |
3421 | 6562 |
^ self showAlert:(resources string:'Cannot create file ''%1'' !!' with:newName) |
6563 |
with:(FileStream lastErrorString) |
|
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
6564 |
] do:[ |
3421 | 6565 |
aStream := f newReadWriteStream. |
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
6566 |
]. |
1162 | 6567 |
aStream notNil ifTrue:[ |
3421 | 6568 |
aStream close. |
6569 |
self updateCurrentDirectoryIfChanged |
|
1162 | 6570 |
] ifFalse:[ |
3421 | 6571 |
self showAlert:(resources string:'Cannot create file ''%1'' !!' with:newName) |
6572 |
with:(FileStream lastErrorString) |
|
1162 | 6573 |
] |
6574 |
||
3421 | 6575 |
"Modified: / 18.9.1997 / 17:21:45 / stefan" |
6576 |
"Modified: / 16.11.2001 / 00:44:49 / cg" |
|
1140 | 6577 |
! |
6578 |
||
1162 | 6579 |
doFileGet:viaDoubleClick |
6580 |
"get selected file - show contents in subView. |
|
6581 |
This is invoked either by the 'get file' menu item, or via double click. |
|
6582 |
When invoked via the menu (viaDoubleClick argument is false), |
|
6583 |
the automatic file action is not performed - instead, the file is always |
|
6584 |
shown in the codeView (if possible). |
|
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
6585 |
This distinction was done to allow xpm or xbm files (which have an automatic |
1162 | 6586 |
action) to be edited." |
6587 |
||
1994 | 6588 |
|fileName| |
6589 |
||
6590 |
fileName := self getSelectedFileName. |
|
6591 |
fileName notNil ifTrue:[ |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6592 |
self doOpenFile:fileName viaDoubleClick:viaDoubleClick |
1162 | 6593 |
] |
6594 |
||
1955
e10babdbf077
before accepting, see if the file is outdated and warn if so.
Claus Gittinger <cg@exept.de>
parents:
1950
diff
changeset
|
6595 |
"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
|
6596 |
"Modified: / 18.9.1997 / 17:35:31 / stefan" |
1994 | 6597 |
"Modified: / 4.2.1999 / 17:43:51 / cg" |
1162 | 6598 |
! |
6599 |
||
2166
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6600 |
doFindFileNamed:namePatterns ignoreCase:ignCaseInName containingString:contentsString ignoreCaseInContents:ignCaseInString sameContentsAsFile:filenameToCompareContentsOrNil sameContentsAs:bytesToCompareContentsOrNil in:aDirectory |
1965 | 6601 |
|dir subDirs nameMatches contentsMatches lines contentsToCompare| |
6602 |
||
6603 |
bytesToCompareContentsOrNil notNil ifTrue:[ |
|
2166
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6604 |
contentsToCompare := bytesToCompareContentsOrNil |
1965 | 6605 |
]. |
1933 | 6606 |
|
6607 |
subDirs := OrderedCollection new. |
|
6608 |
||
6609 |
dir := aDirectory asFilename. |
|
6610 |
self label:myName , '- searching ' , dir name. |
|
6611 |
(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
|
6612 |
|f| |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6613 |
|
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6614 |
f := dir construct:fn. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6615 |
f isDirectory ifTrue:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6616 |
f isSymbolicLink ifFalse:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6617 |
subDirs add:f |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6618 |
] |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6619 |
] ifFalse:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6620 |
(nameMatches := namePatterns isNil) ifFalse:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6621 |
ignCaseInName ifTrue:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6622 |
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
|
6623 |
] ifFalse:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6624 |
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
|
6625 |
] |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6626 |
]. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6627 |
nameMatches ifTrue:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6628 |
filenameToCompareContentsOrNil notNil ifTrue:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6629 |
"/ contents compare ... |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6630 |
contentsMatches := false. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6631 |
f pathName ~= filenameToCompareContentsOrNil pathName ifTrue:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6632 |
f fileSize == filenameToCompareContentsOrNil fileSize ifTrue:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6633 |
contentsToCompare isNil ifTrue:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6634 |
filenameToCompareContentsOrNil fileSize < (512*1024) ifTrue:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6635 |
contentsToCompare := filenameToCompareContentsOrNil binaryContentsOfEntireFile |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6636 |
] |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6637 |
]. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6638 |
contentsToCompare isNil ifTrue:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6639 |
"/ too large - compare block-wise ... |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6640 |
contentsMatches := (filenameToCompareContentsOrNil sameContentsAs:f). |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6641 |
] ifFalse:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6642 |
contentsMatches := contentsToCompare = (f binaryContentsOfEntireFile). |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6643 |
] |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6644 |
]. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6645 |
] ifFalse:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6646 |
f isSymbolicLink ifTrue:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6647 |
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
|
6648 |
subView cursorDown. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6649 |
] |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6650 |
] |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6651 |
] ifFalse:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6652 |
"/ string search ... |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6653 |
(contentsMatches := contentsString isNil) ifFalse:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6654 |
(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
|
6655 |
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
|
6656 |
subView cursorDown. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6657 |
] ifTrue:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6658 |
f fileSize > (4024*1024) ifTrue:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6659 |
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
|
6660 |
subView cursorDown. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6661 |
] ifFalse:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6662 |
Stream lineTooLongErrorSignal handle:[:ex | |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6663 |
|cont| |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6664 |
|
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6665 |
"/ 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
|
6666 |
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
|
6667 |
ignCaseInString ifTrue:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6668 |
contentsMatches := cont asLowercase includesString:contentsString |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6669 |
] ifFalse:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6670 |
contentsMatches := cont includesString:contentsString |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6671 |
]. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6672 |
] do:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6673 |
lines := f contents ? #(). |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6674 |
ignCaseInString ifTrue:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6675 |
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
|
6676 |
] ifFalse:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6677 |
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
|
6678 |
]. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6679 |
]. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6680 |
]. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6681 |
]. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6682 |
]. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6683 |
]. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6684 |
contentsMatches ifTrue:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6685 |
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
|
6686 |
subView cursorDown. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6687 |
] |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6688 |
] |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6689 |
] |
1933 | 6690 |
]. |
6691 |
||
6692 |
subDirs do:[:dir | |
|
2166
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6693 |
self |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6694 |
doFindFileNamed:namePatterns |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6695 |
ignoreCase:ignCaseInName |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6696 |
containingString:contentsString |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6697 |
ignoreCaseInContents:ignCaseInString |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6698 |
sameContentsAsFile:filenameToCompareContentsOrNil |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6699 |
sameContentsAs:contentsToCompare |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6700 |
in:dir |
1933 | 6701 |
]. |
6702 |
||
6703 |
"Created: / 15.10.1998 / 11:37:15 / cg" |
|
6704 |
"Modified: / 15.10.1998 / 12:50:48 / cg" |
|
6705 |
! |
|
6706 |
||
1994 | 6707 |
doOpenFile:fileName viaDoubleClick:viaDoubleClick |
6708 |
"get selected file - show contents in subView. |
|
6709 |
This is invoked either by the 'get file' menu item, or via double click. |
|
6710 |
When invoked via the menu (viaDoubleClick argument is false), |
|
6711 |
the automatic file action is not performed - instead, the file is always |
|
6712 |
shown in the codeView (if possible). |
|
6713 |
This distinction was done to allow xpm or xbm files (which have an automatic |
|
6714 |
action) to be edited." |
|
6715 |
||
6716 |
|iconLbl winLbl f| |
|
6717 |
||
6718 |
self withReadCursorDo:[ |
|
2139 | 6719 |
(f := fileName asFilename) isAbsolute ifFalse:[ |
6720 |
f := currentDirectory construct:fileName. |
|
6721 |
]. |
|
6722 |
f isDirectory ifTrue:[ |
|
6723 |
self doChangeCurrentDirectoryTo:fileName updateHistory:true. |
|
6724 |
winLbl := myName. |
|
6725 |
iconLbl := myName |
|
6726 |
] ifFalse:[ |
|
6727 |
f exists ifFalse:[ |
|
2868 | 6728 |
Dialog warn:(resources string:'oops, ''%1'' is gone or unreadable.' withCRs with:f pathName allBold). |
2139 | 6729 |
^ self |
6730 |
]. |
|
6731 |
timeOfFileRead := f modificationTime. |
|
6732 |
self showFile:fileName insert:false encoding:fileEncoding doubleClick:viaDoubleClick. |
|
6733 |
currentFileName := fileName. |
|
6734 |
||
6735 |
self fileTypeSpecificActions. |
|
6736 |
||
6737 |
subView acceptAction:[:theCode | |
|
3498
5c5fff5b60bf
in doAccept: care for file being removed in the meantime
Claus Gittinger <cg@exept.de>
parents:
3478
diff
changeset
|
6738 |
|filesModificationTime| |
5c5fff5b60bf
in doAccept: care for file being removed in the meantime
Claus Gittinger <cg@exept.de>
parents:
3478
diff
changeset
|
6739 |
|
5c5fff5b60bf
in doAccept: care for file being removed in the meantime
Claus Gittinger <cg@exept.de>
parents:
3478
diff
changeset
|
6740 |
filesModificationTime := f modificationTime. |
5c5fff5b60bf
in doAccept: care for file being removed in the meantime
Claus Gittinger <cg@exept.de>
parents:
3478
diff
changeset
|
6741 |
(filesModificationTime isNil |
5c5fff5b60bf
in doAccept: care for file being removed in the meantime
Claus Gittinger <cg@exept.de>
parents:
3478
diff
changeset
|
6742 |
or:[filesModificationTime <= timeOfFileRead |
5c5fff5b60bf
in doAccept: care for file being removed in the meantime
Claus Gittinger <cg@exept.de>
parents:
3478
diff
changeset
|
6743 |
or:[(self |
3796 | 6744 |
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 ?') |
6745 |
yesButton:(resources string:'Save') |
|
6746 |
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
|
6747 |
ifTrue:[ |
2139 | 6748 |
self withCursor:(Cursor write) do:[ |
6749 |
self writeFile:fileName text:theCode encoding:fileEncoding. |
|
6750 |
timeOfFileRead := f modificationTime. |
|
6751 |
self label:myName , ': ' , currentFileName |
|
6752 |
] |
|
6753 |
] |
|
6754 |
]. |
|
6755 |
||
6756 |
winLbl := myName , ': ' , fileName. |
|
6757 |
f isWritable ifFalse:[ |
|
6758 |
winLbl := winLbl , ' (readonly)' |
|
6759 |
]. |
|
6760 |
iconLbl := fileName |
|
6761 |
]. |
|
6762 |
self label:winLbl. |
|
6763 |
self iconLabel:iconLbl. |
|
1994 | 6764 |
] |
6765 |
||
6766 |
"Created: / 4.2.1999 / 17:43:26 / cg" |
|
2139 | 6767 |
"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
|
6768 |
"Modified: / 10.12.2001 / 14:33:38 / cg" |
1994 | 6769 |
! |
6770 |
||
1961
f81295571da7
care for updating listView while removing (get selection before)
Claus Gittinger <cg@exept.de>
parents:
1956
diff
changeset
|
6771 |
doRemove:filesToRemove |
1162 | 6772 |
"remove the selected file(s) - no questions asked" |
6773 |
||
3420 | 6774 |
|msg needUpdate toRemove updateRunning yesToAll mTime| |
1162 | 6775 |
|
3281 | 6776 |
self withWaitCursorDo:[ |
6777 |
updateRunning := listUpdateProcess notNil. |
|
6778 |
self stopUpdateProcess. |
|
6779 |
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
|
6780 |
|
84029fca1f3d
use removeFile (a bit faster) if known to be a file
Claus Gittinger <cg@exept.de>
parents:
2771
diff
changeset
|
6781 |
"/ |
3281 | 6782 |
"/ 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
|
6783 |
"/ |
3281 | 6784 |
mTime := currentDirectory modificationTime. |
6785 |
needUpdate := mTime notNil and:[mTime > timeOfLastCheck]. |
|
6786 |
||
6787 |
yesToAll := false. |
|
6788 |
lockUpdate := true. |
|
6789 |
[ |
|
6790 |
filesToRemove keysAndValuesDo:[:idx :fileName | |
|
6791 |
|f| |
|
6792 |
||
6793 |
f := currentDirectory construct:fileName. |
|
6794 |
OperatingSystem accessDeniedErrorSignal handle:[:ex| |
|
6795 |
"was not able to remove it" |
|
3419 | 6796 |
msg := (resources string:'Cannot remove ''%1'' !!' with:fileName). |
3281 | 6797 |
self showAlert:msg with:(OperatingSystem lastErrorString) |
6798 |
] do:[ |
|
6799 |
|answer contents i| |
|
6800 |
||
6801 |
(f isSymbolicLink not and:[f isDirectory]) ifTrue:[ |
|
6802 |
contents := f directoryContents. |
|
6803 |
contents isEmpty ifTrue:[ |
|
6804 |
f remove |
|
6805 |
] ifFalse:[ |
|
6806 |
yesToAll ifFalse:[ |
|
6807 |
idx == filesToRemove size ifTrue:[ |
|
6808 |
answer := Dialog |
|
3419 | 6809 |
confirmWithCancel:(resources string:'Directory ''%1'' is not empty\remove anyway ?' with:fileName allBold) withCRs |
6810 |
labels:(resources array:#('Cancel' 'Remove')) |
|
3281 | 6811 |
values:#(false true) |
6812 |
default:2. |
|
6813 |
] ifFalse:[ |
|
6814 |
answer := Dialog |
|
3419 | 6815 |
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
|
6816 |
labels:(resources array:#('Cancel' 'Remove All' 'Remove')) |
3281 | 6817 |
values:#(false #removeAll true) |
6818 |
default:3. |
|
6819 |
]. |
|
6820 |
answer == false ifTrue:[ |
|
6821 |
^ self |
|
6822 |
]. |
|
6823 |
answer == #removeAll ifTrue:[ |
|
6824 |
yesToAll := true |
|
6825 |
]. |
|
6826 |
]. |
|
6827 |
f recursiveRemove |
|
6828 |
]. |
|
6829 |
] ifFalse:[ |
|
6830 |
f removeFile. |
|
6831 |
]. |
|
6832 |
" |
|
6833 |
self show:nil |
|
6834 |
" |
|
6835 |
i := fileList indexOf:fileName. |
|
6836 |
i ~~ 0 ifTrue:[ |
|
6837 |
toRemove add:i. |
|
6838 |
] |
|
6839 |
]. |
|
6840 |
]. |
|
3596
9761af1f3f72
#valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents:
3568
diff
changeset
|
6841 |
] ensure:[ |
3281 | 6842 |
lockUpdate := false. |
6843 |
fileListView setSelection:nil. |
|
6844 |
||
6845 |
"/ |
|
6846 |
"/ remove reverse - otherwise indices are wrong |
|
6847 |
"/ |
|
6848 |
toRemove sort. |
|
6849 |
toRemove reverseDo:[:idx | |
|
6850 |
fileList removeIndex:idx. |
|
6851 |
fileListView removeIndex:idx. |
|
6852 |
]. |
|
6853 |
||
6854 |
updateRunning ifTrue:[ |
|
6855 |
self updateCurrentDirectory |
|
6856 |
] ifFalse:[ |
|
6857 |
" |
|
6858 |
install a new check after some time |
|
6859 |
" |
|
6860 |
needUpdate ifFalse:[timeOfLastCheck := AbsoluteTime now]. |
|
3520
83cf11e1bf32
schedule checkBlock for the right process
Claus Gittinger <cg@exept.de>
parents:
3503
diff
changeset
|
6861 |
self scheduleCheckBlock. |
3281 | 6862 |
] |
2772
84029fca1f3d
use removeFile (a bit faster) if known to be a file
Claus Gittinger <cg@exept.de>
parents:
2771
diff
changeset
|
6863 |
] |
1162 | 6864 |
] |
6865 |
||
1374
b3a1e95a6220
Do not ask for nonempty directory if remove target is a symlink
Stefan Vogel <sv@exept.de>
parents:
1371
diff
changeset
|
6866 |
"Modified: / 20.11.1997 / 17:39:14 / stefan" |
3420 | 6867 |
"Modified: / 16.11.2001 / 00:43:40 / cg" |
1162 | 6868 |
! |
6869 |
||
6870 |
doRename:oldName to:newName |
|
1331
73e712c85588
Handle errors when renaming files.
Stefan Vogel <sv@exept.de>
parents:
1330
diff
changeset
|
6871 |
"rename a file (or directory)" |
1162 | 6872 |
|
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
6873 |
|old new| |
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
6874 |
|
2989 | 6875 |
(oldName isNil or:[newName isNil]) ifTrue:[ |
6876 |
^ self |
|
6877 |
]. |
|
6878 |
(oldName isBlank or:[newName isBlank]) ifTrue:[ |
|
6879 |
^ self |
|
6880 |
]. |
|
6881 |
(oldName = newName) ifTrue:[ |
|
6882 |
^ self |
|
6883 |
]. |
|
6884 |
||
6885 |
old := currentDirectory filenameFor:oldName. |
|
6886 |
new := currentDirectory filenameFor:newName. |
|
6887 |
||
6888 |
OperatingSystem errorSignal handle:[:ex| |
|
3421 | 6889 |
self showAlert:(resources string:'Cannot rename file ''%1'' to %2 !!' |
2989 | 6890 |
with:oldName with:newName) |
6891 |
with:(OperatingSystem lastErrorString) |
|
6892 |
] do:[ |
|
6893 |
new exists ifTrue:[ |
|
6894 |
(self confirm:(resources string:'''%1'' already exists - rename (i.e. overwrite) anyway ?' with:new baseName allBold)) |
|
6895 |
ifFalse:[ |
|
6896 |
^ self |
|
6897 |
] |
|
6898 |
]. |
|
6899 |
old renameTo:new. |
|
6900 |
]. |
|
3206 | 6901 |
|
3007 | 6902 |
self updateCurrentDirectory |
6903 |
"/ self updateCurrentDirectoryIfChanged. |
|
1162 | 6904 |
|
1911
6d1b77eda98f
check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents:
1903
diff
changeset
|
6905 |
"Modified: / 24.9.1997 / 09:20:00 / stefan" |
3421 | 6906 |
"Modified: / 16.11.2001 / 00:44:27 / cg" |
1162 | 6907 |
! ! |
6908 |
||
6909 |
!FileBrowser methodsFor:'private - file type & info'! |
|
6910 |
||
6911 |
fileCommentStrings |
|
6912 |
"return a useful comment definition; based upon the fileName for now" |
|
6913 |
||
3015
84b5619bd78d
comment strings functionality moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
3013
diff
changeset
|
6914 |
^ MIMETypes commentStringsForFilename:currentFileName |
3072 | 6915 |
ifUnknown:[ |
6916 |
"/ st: |
|
6917 |
#('"/' ('"' '"')) |
|
6918 |
] |
|
1162 | 6919 |
! |
6920 |
||
6921 |
fileTypeSpecificActions |
|
6922 |
"any special fileTypeSpecific actions are done here, |
|
6923 |
when a new file is selected" |
|
6924 |
||
6925 |
|commentStrings| |
|
6926 |
||
6927 |
commentStrings := self fileCommentStrings. |
|
6928 |
commentStrings notNil ifTrue:[ |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6929 |
subView perform:#commentStrings: with:commentStrings ifNotUnderstood:nil |
1162 | 6930 |
]. |
6931 |
||
6932 |
"Modified: 7.1.1997 / 20:30:54 / cg" |
|
6933 |
! |
|
6934 |
||
6935 |
getFileInfoString:longInfo |
|
6936 |
"get stat info on selected file - return a string which can be |
|
6937 |
shown in a box" |
|
6938 |
||
3747
d30bc1e54f15
Remove unused vars and asFilename sends
Stefan Vogel <sv@exept.de>
parents:
3746
diff
changeset
|
6939 |
|fileName f text info fileOutput type modeBits modeString s ts| |
1162 | 6940 |
|
6941 |
fileName := self getSelectedFileName. |
|
6942 |
fileName isNil ifTrue:[^ nil]. |
|
6943 |
||
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
6944 |
f := currentDirectory construct:fileName. |
1162 | 6945 |
info := f info. |
6946 |
||
6947 |
info isNil ifTrue:[ |
|
3421 | 6948 |
self showAlert:(resources string:'Cannot get info of ''%1'' !!' with:fileName) |
6949 |
with:(OperatingSystem lastErrorString). |
|
6950 |
^ nil |
|
1162 | 6951 |
]. |
6952 |
||
6953 |
text := StringCollection new. |
|
6954 |
f isSymbolicLink ifTrue:[ |
|
3421 | 6955 |
text add:(resources string:'symbolic link to: %1' with:(f linkInfo path)) |
1162 | 6956 |
]. |
6957 |
||
6958 |
type := info type. |
|
6959 |
(longInfo and:[type == #regular]) ifTrue:[ |
|
3747
d30bc1e54f15
Remove unused vars and asFilename sends
Stefan Vogel <sv@exept.de>
parents:
3746
diff
changeset
|
6960 |
fileOutput := (currentDirectory construct:fileName) fileType. |
1162 | 6961 |
]. |
6962 |
||
6963 |
s := (resources at:'type: '). |
|
6964 |
fileOutput isNil ifTrue:[ |
|
3421 | 6965 |
s := s , type asString |
1162 | 6966 |
] ifFalse:[ |
3421 | 6967 |
s := s , 'regular (' , fileOutput , ')' |
1162 | 6968 |
]. |
6969 |
text add:s. |
|
6970 |
text add:(resources string:'size: %1' with:(info size) printString). |
|
6971 |
||
6972 |
modeBits := info mode. |
|
6973 |
modeString := self getModeString:modeBits. |
|
6974 |
longInfo ifTrue:[ |
|
3421 | 6975 |
text add:(resources string:'access: %1 (%2)' |
6976 |
with:modeString |
|
6977 |
with:(modeBits printStringRadix:8)) |
|
1162 | 6978 |
] ifFalse:[ |
3421 | 6979 |
text add:(resources string:'access: %1' with:modeString) |
1162 | 6980 |
]. |
6981 |
text add:(resources string:'owner: %1' |
|
3421 | 6982 |
with:(OperatingSystem getUserNameFromID:(info uid))). |
1162 | 6983 |
longInfo ifTrue:[ |
3421 | 6984 |
text add:(resources string:'group: %1' |
6985 |
with:(OperatingSystem getGroupNameFromID:(info gid))). |
|
6986 |
||
6987 |
ts := info accessed. |
|
6988 |
text add:(resources string:'last access: %1 %2' |
|
6989 |
with:(ts asTime printString) |
|
6990 |
with:(ts asDate printString)). |
|
6991 |
||
6992 |
ts := info modified. |
|
6993 |
text add:(resources string:'last modification: %1 %2' |
|
6994 |
with:(ts asTime printString) |
|
6995 |
with:(ts asDate printString)). |
|
1162 | 6996 |
]. |
6997 |
^ text asString |
|
6998 |
||
3421 | 6999 |
"Modified: / 8.9.1995 / 11:59:28 / claus" |
7000 |
"Modified: / 18.9.1997 / 16:34:31 / stefan" |
|
7001 |
"Modified: / 16.11.2001 / 00:45:11 / cg" |
|
1162 | 7002 |
! |
7003 |
||
7004 |
getInfoFile |
|
7005 |
"get filename of a description-file (.dir.info, README etc.); |
|
7006 |
This file is automatically shown when a directory is enterred. |
|
7007 |
You can add more names below if you like." |
|
7008 |
||
7009 |
#( |
|
7010 |
'.dir.info' |
|
7011 |
'README' |
|
7012 |
'ReadMe' |
|
7013 |
'Readme' |
|
7014 |
'readme' |
|
7015 |
'read.me' |
|
7016 |
'Read.me' |
|
7017 |
'READ.ME' |
|
1272 | 7018 |
'README.TXT' |
7019 |
'readme.txt' |
|
7020 |
'Readme.txt' |
|
1307 | 7021 |
'Info.txt' |
7022 |
'info.txt' |
|
7023 |
'INFO.TXT' |
|
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
7024 |
) do:[:f | |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7025 |
|n| |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7026 |
n := currentDirectory construct:f. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7027 |
(n isReadable and:[n isDirectory not]) ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7028 |
^ f. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7029 |
] |
1140 | 7030 |
]. |
1162 | 7031 |
^ nil |
7032 |
||
1272 | 7033 |
"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
|
7034 |
"Modified: 16.9.1997 / 15:26:53 / stefan" |
1162 | 7035 |
! |
7036 |
||
7037 |
getModeString:modeBits |
|
7038 |
"convert file-mode bits into a more user-friendly string. |
|
7039 |
This is wrong here - should be moved into OperatingSystem." |
|
7040 |
||
7041 |
^ self getModeString:modeBits |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7042 |
with:#( 'owner:' $r $w $x |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7043 |
' group:' $r $w $x |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7044 |
' others:' $r $w $x ) |
1140 | 7045 |
! |
7046 |
||
1162 | 7047 |
getModeString:modeBits with:texts |
7048 |
"convert file-mode bits into a more user-friendly string. |
|
7049 |
This is wrong here - should be moved into OperatingSystem." |
|
7050 |
||
7051 |
|bits modeString| |
|
7052 |
||
7053 |
bits := modeBits bitAnd:8r777. |
|
7054 |
modeString := ''. |
|
7055 |
||
7056 |
#( nil 8r400 8r200 8r100 nil 8r040 8r020 8r010 nil 8r004 8r002 8r001 ) |
|
7057 |
with: texts do:[:bitMask :access | |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7058 |
|ch| |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7059 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7060 |
bitMask isNil ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7061 |
modeString := modeString , (resources string:access) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7062 |
] ifFalse:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7063 |
(bits bitAnd:bitMask) == 0 ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7064 |
ch := $- |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7065 |
] ifFalse:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7066 |
ch := access |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7067 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7068 |
modeString := modeString copyWith:ch |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7069 |
] |
633
4630175ed31e
double click on .htm / .html files open a viewer;
Claus Gittinger <cg@exept.de>
parents:
585
diff
changeset
|
7070 |
]. |
1162 | 7071 |
^ modeString |
7072 |
! |
|
7073 |
||
7074 |
showInfo |
|
7075 |
"show directory info when dir has changed" |
|
7076 |
||
7077 |
|info txt| |
|
7078 |
||
7079 |
info := self getInfoFile. |
|
7080 |
info notNil ifTrue:[ |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7081 |
txt := self readFile:info |
1162 | 7082 |
]. |
7083 |
self show:txt. |
|
7084 |
! |
|
7085 |
||
7086 |
sizePrintString:size |
|
7087 |
"helper for update-directory to return a string with a files size. |
|
7088 |
This one gives the size in byte, Kb or Mb depending on size. |
|
7089 |
If you dont like this, just uncomment the first statement below." |
|
7090 |
||
7091 |
|unitString n| |
|
7092 |
||
7093 |
" |
|
7094 |
^ size printString. |
|
7095 |
" |
|
7096 |
unitString := ''. |
|
7097 |
size < (500 * 1024) ifTrue:[ |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7098 |
size < 1024 ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7099 |
n := size |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7100 |
] ifFalse:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7101 |
n := (size * 10 // 1024 / 10.0). |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7102 |
unitString := ' Kb' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7103 |
] |
1162 | 7104 |
] ifFalse:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7105 |
n := (size * 10 // 1024 // 1024 / 10.0). |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7106 |
unitString := ' Mb' |
1162 | 7107 |
]. |
7108 |
^ (n printStringLeftPaddedTo:5) , unitString. |
|
7109 |
! ! |
|
7110 |
||
7111 |
!FileBrowser methodsFor:'private - file-I/O'! |
|
7112 |
||
7113 |
readFile:fileName |
|
7114 |
"read in the file, answer its contents as StringCollection" |
|
7115 |
||
7116 |
^ self readFile:fileName lineDelimiter:Character cr encoding:nil |
|
7117 |
||
7118 |
"Modified: 22.2.1996 / 14:57:08 / cg" |
|
7119 |
! |
|
7120 |
||
7121 |
readFile:fileName lineDelimiter:aCharacter encoding:encoding |
|
7122 |
"read in the file, return its contents as StringCollection. |
|
7123 |
The files lines are delimited by aCharacter. |
|
7124 |
If encoding is nonNil, the file is assumed to be coded according to |
|
7125 |
that symbol, and #decodeString: should be able to convert it." |
|
7126 |
||
1994 | 7127 |
|f stream text msg sz| |
7128 |
||
7129 |
(f := fileName asFilename) isAbsolute ifFalse:[ |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7130 |
f := (currentDirectory construct:fileName) |
1994 | 7131 |
]. |
7132 |
stream := f readStream. |
|
1162 | 7133 |
stream isNil ifTrue:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7134 |
msg := (resources string:'cannot read file ''%1'' !!' with:fileName). |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7135 |
self showAlert:msg with:(FileStream lastErrorString). |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7136 |
^ nil |
1162 | 7137 |
]. |
7138 |
||
7139 |
" |
|
7140 |
for very big files, give ObjectMemory a hint, to preallocate more |
|
7141 |
" |
|
1311 | 7142 |
(sz := stream fileSize) > 1000000 ifTrue:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7143 |
Processor activeProcess withPriority:Processor userBackgroundPriority do:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7144 |
ObjectMemory announceSpaceNeed:(sz + (sz // 5)) "/ add 20% for tab expansion |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7145 |
]. |
1162 | 7146 |
]. |
7147 |
||
7148 |
text := self readStream:stream lineDelimiter:aCharacter encoding:encoding. |
|
7149 |
stream close. |
|
7150 |
^ text |
|
7151 |
||
1994 | 7152 |
"Created: / 22.2.1996 / 14:56:48 / cg" |
7153 |
"Modified: / 18.9.1997 / 17:06:54 / stefan" |
|
7154 |
"Modified: / 4.2.1999 / 17:52:18 / cg" |
|
1162 | 7155 |
! |
7156 |
||
7157 |
readStream:aStream |
|
7158 |
"read in from aStream, answer its contents as StringCollection" |
|
7159 |
||
7160 |
^ self readStream:aStream lineDelimiter:Character cr encoding:nil |
|
7161 |
||
7162 |
"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
|
7163 |
! |
4630175ed31e
double click on .htm / .html files open a viewer;
Claus Gittinger <cg@exept.de>
parents:
585
diff
changeset
|
7164 |
|
1162 | 7165 |
readStream:aStream lineDelimiter:aCharacter encoding:encoding |
7166 |
"read from aStream, answer its contents as StringCollection. |
|
7167 |
The files lines are delimited by aCharacter. |
|
7168 |
If encoding is nonNil, the file is assumed to be coded according to |
|
7169 |
that symbol, and #decodeString: should be able to convert it." |
|
7170 |
||
7171 |
|text line enc| |
|
7172 |
||
7173 |
text := StringCollection new. |
|
7174 |
||
7175 |
enc := encoding. |
|
7176 |
enc == #iso8859 ifTrue:[ |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7177 |
enc := nil |
1162 | 7178 |
]. |
7179 |
||
7180 |
aCharacter == Character cr ifTrue:[ |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7181 |
FileStream lineTooLongErrorSignal handle:[:ex | |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7182 |
|s partialLine| |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7183 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7184 |
s := ex parameter at:1. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7185 |
partialLine := ex parameter at:2. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7186 |
ex proceedWith:(partialLine , s upTo:aCharacter) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7187 |
] do:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7188 |
[aStream atEnd] whileFalse:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7189 |
line := aStream nextLine withTabsExpanded. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7190 |
enc notNil ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7191 |
line := line decodeFrom:enc |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7192 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7193 |
text add:line |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7194 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7195 |
]. |
1162 | 7196 |
] ifFalse:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7197 |
[aStream atEnd] whileFalse:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7198 |
line := (aStream upTo:aCharacter) withTabsExpanded. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7199 |
enc notNil ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7200 |
line := line decodeFrom:enc |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7201 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7202 |
text add:line |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7203 |
]. |
633
4630175ed31e
double click on .htm / .html files open a viewer;
Claus Gittinger <cg@exept.de>
parents:
585
diff
changeset
|
7204 |
]. |
1162 | 7205 |
^ text |
7206 |
||
1994 | 7207 |
"Created: / 22.2.1996 / 14:58:25 / cg" |
7208 |
"Modified: / 5.2.1999 / 00:53:22 / cg" |
|
1162 | 7209 |
! |
7210 |
||
7211 |
showFile:fileName |
|
7212 |
"show contents of fileName in subView" |
|
7213 |
||
1689 | 7214 |
fileListView selection:(fileList indexOf:fileName). |
7215 |
self fileGet |
|
7216 |
||
7217 |
"Modified: / 17.6.1998 / 11:26:13 / cg" |
|
1162 | 7218 |
! |
7219 |
||
7220 |
showFile:fileName insert:insert encoding:encoding |
|
7221 |
"show/insert contents of fileName in subView" |
|
7222 |
||
7223 |
^ self |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7224 |
showFile:fileName insert:insert encoding:encoding doubleClick:false |
1162 | 7225 |
|
7226 |
"Modified: 19.6.1996 / 09:40:19 / cg" |
|
7227 |
! |
|
7228 |
||
3414 | 7229 |
showFile:fileNameString insert:insert encoding:encoding doubleClick:viaDoubleClick |
1162 | 7230 |
"show/insert contents of fileName in subView" |
7231 |
||
3527 | 7232 |
|path buffer s n ok convert text msg eol guess action enc |
3414 | 7233 |
fontsEncoding pref failWarning f answer fileName| |
7234 |
||
7235 |
fileName := fileNameString asFilename. |
|
7236 |
||
7237 |
fileName isAbsolute ifFalse:[ |
|
7238 |
path := currentDirectory filenameFor:fileNameString. |
|
1994 | 7239 |
] ifTrue:[ |
3414 | 7240 |
path := fileName asAbsoluteFilename |
1994 | 7241 |
]. |
7242 |
||
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
7243 |
(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
|
7244 |
"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
|
7245 |
path exists ifFalse:[ |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
7246 |
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
|
7247 |
] ifTrue:[ |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
7248 |
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
|
7249 |
]. |
3528 | 7250 |
msg := (resources string:msg) withCRs. |
7251 |
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
|
7252 |
^ self |
1162 | 7253 |
]. |
7254 |
||
7255 |
"/ |
|
7256 |
"/ check if file is a text file |
|
7257 |
"/ |
|
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
7258 |
s := path readStream. |
1162 | 7259 |
s isNil ifTrue:[ |
3697
e2f7d8dec6e2
menu items/button labels uppercase-first
Claus Gittinger <cg@exept.de>
parents:
3691
diff
changeset
|
7260 |
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
|
7261 |
with:(FileStream lastErrorString). |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
7262 |
^ nil |
1162 | 7263 |
]. |
7264 |
||
1222
f2952fc3ced9
look at more when guessing the encoding
Claus Gittinger <cg@exept.de>
parents:
1221
diff
changeset
|
7265 |
buffer := String new:4096. |
f2952fc3ced9
look at more when guessing the encoding
Claus Gittinger <cg@exept.de>
parents:
1221
diff
changeset
|
7266 |
n := s nextBytes:4096 into:buffer. |
1162 | 7267 |
s close. |
7268 |
||
7269 |
enc := encoding. |
|
7270 |
ok := true. |
|
7271 |
guess := self guessEncodingFrom:buffer. |
|
7272 |
||
7273 |
guess == #binary ifTrue:[ |
|
2158
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
7274 |
ok := false. |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
7275 |
viaDoubleClick ifTrue:[ |
3414 | 7276 |
(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
|
7277 |
]. |
3414 | 7278 |
answer := self confirmWithCancel:(resources string:'''%1'' seems to be a binary file (or unsupported format) - show anyway ?' with:fileNameString). |
3061 | 7279 |
answer == false ifTrue:[^ self]. |
7280 |
answer isNil ifTrue:[AbortSignal raise]. |
|
1162 | 7281 |
] ifFalse:[ |
2158
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
7282 |
viaDoubleClick ifTrue:[ |
3414 | 7283 |
(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
|
7284 |
]. |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
7285 |
|
3413 | 7286 |
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
|
7287 |
pref := self preferredFontEncodingFor:guess. |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
7288 |
|
3381
2a0331ea6dfc
stupid encoding question eliminated
Claus Gittinger <cg@exept.de>
parents:
3342
diff
changeset
|
7289 |
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
|
7290 |
ok ifFalse:[ |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
7291 |
pref = 'iso8859*' ifTrue:[ |
3381
2a0331ea6dfc
stupid encoding question eliminated
Claus Gittinger <cg@exept.de>
parents:
3342
diff
changeset
|
7292 |
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
|
7293 |
] |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
7294 |
]. |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
7295 |
ok ifTrue:[ |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
7296 |
fileEncoding := guess. |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
7297 |
enc := guess. |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
7298 |
] ifFalse:[ |
2779 | 7299 |
doNotShowFontDialog == true ifTrue:[ |
7300 |
action := #show |
|
7301 |
] ifFalse:[ |
|
3414 | 7302 |
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
|
7303 |
labels:(resources array:#('Cancel' 'Show' 'Dont Ask Again' 'Change Font')) |
2779 | 7304 |
values:#(nil #show #showAlways #encoding) |
7305 |
default:#encoding. |
|
7306 |
]. |
|
7307 |
action == #showAlways ifTrue:[ |
|
7308 |
doNotShowFontDialog := true. |
|
7309 |
action := #show. |
|
7310 |
]. |
|
2158
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
7311 |
action isNil ifTrue:[^ self]. |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
7312 |
action == #encoding ifTrue:[ |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
7313 |
fileEncoding := guess asSymbol. |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
7314 |
subView externalEncoding:fileEncoding. |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
7315 |
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
|
7316 |
] ifFalse:[ |
2779 | 7317 |
doNotShowFontDialog ~~ true ifTrue:[ |
7318 |
self information:(resources string:'Individual characters may be invisible/wrong in this font.') |
|
7319 |
] |
|
2158
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
7320 |
]. |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
7321 |
enc := fileEncoding. |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
7322 |
]. |
1162 | 7323 |
]. |
7324 |
||
7325 |
convert := false. |
|
1329 | 7326 |
"/ ok ifTrue:[ |
7327 |
"/ "/ |
|
7328 |
"/ "/ check if line delimiter is a cr |
|
7329 |
"/ "/ |
|
7330 |
"/ i := buffer indexOf:Character cr. |
|
7331 |
"/ i == 0 ifTrue:[ |
|
7332 |
"/ "/ |
|
7333 |
"/ "/ no newline found - try cr |
|
7334 |
"/ "/ |
|
7335 |
"/ i := buffer indexOf:(Character value:13). |
|
7336 |
"/ i ~~ 0 ifTrue:[ |
|
3414 | 7337 |
"/ convert := self confirm:(resources string:'''%1'' seems to have CR as line delimiter - convert to NL ?' with:fileNameString). |
1329 | 7338 |
"/ ] |
7339 |
"/ ] |
|
7340 |
"/ ]. |
|
1162 | 7341 |
|
7342 |
insert ifFalse:[ |
|
2158
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
7343 |
"/ release old text first |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
7344 |
"/ - 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
|
7345 |
"/ (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
|
7346 |
"/ 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
|
7347 |
|
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
7348 |
subView contents:nil. |
1162 | 7349 |
]. |
7350 |
||
7351 |
convert ifTrue:[ |
|
2158
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
7352 |
eol := Character value:13 |
1162 | 7353 |
] ifFalse:[ |
2158
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
7354 |
eol := Character cr |
1162 | 7355 |
]. |
1212 | 7356 |
|
1214
02d5bbd925dd
allow decoding errors to be ignored
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
7357 |
failWarning := false. |
1212 | 7358 |
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
|
7359 |
|errStr| |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
7360 |
|
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
7361 |
failWarning ifFalse:[ |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
7362 |
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
|
7363 |
(self confirm:(resources |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
7364 |
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
|
7365 |
with:errStr) withCRs) |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
7366 |
ifFalse:[ |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
7367 |
^ self |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
7368 |
]. |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
7369 |
failWarning := true. |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
7370 |
]. |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
7371 |
ex proceed. |
1212 | 7372 |
] do:[ |
3414 | 7373 |
text := self readFile:fileNameString lineDelimiter:eol encoding:enc. |
1212 | 7374 |
]. |
1162 | 7375 |
|
7376 |
insert ifFalse:[ |
|
3414 | 7377 |
(f := fileName) isAbsolute ifFalse:[ |
7378 |
f := (currentDirectory construct:fileNameString) |
|
2951
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
7379 |
]. |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
7380 |
self class addToVisitedFileHistory:f pathName. |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
7381 |
|
2158
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
7382 |
self show:text |
1162 | 7383 |
] ifTrue:[ |
2158
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
7384 |
subView insertSelectedStringAtCursor:text asString |
1162 | 7385 |
]. |
7386 |
||
1994 | 7387 |
"Created: / 19.6.1996 / 09:39:52 / cg" |
7388 |
"Modified: / 18.9.1997 / 17:10:20 / stefan" |
|
3414 | 7389 |
"Modified: / 15.11.2001 / 17:15:27 / cg" |
1162 | 7390 |
! |
7391 |
||
7392 |
writeFile:fileName text:someText encoding:encoding |
|
1353 | 7393 |
|stream errReason msg startNr nLines string| |
7394 |
||
7395 |
errReason := ''. |
|
7396 |
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
|
7397 |
errReason := ex errorString. |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
7398 |
ex return. |
1353 | 7399 |
] do:[ |
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
7400 |
stream := (currentDirectory filenameFor:fileName) writeStream. |
1353 | 7401 |
]. |
1162 | 7402 |
stream isNil ifTrue:[ |
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
7403 |
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
|
7404 |
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
|
7405 |
^ self. |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
7406 |
]. |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
7407 |
|
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
7408 |
dosEOLMode value == true ifTrue:[ |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
7409 |
stream eolMode:#crlf. |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
7410 |
"/ must do it lineWise ... |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
7411 |
someText asStringCollection do:[:line | |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
7412 |
line notNil ifTrue:[ |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
7413 |
stream nextPutAll:line |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
7414 |
]. |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
7415 |
stream cr |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
7416 |
] |
1162 | 7417 |
] ifFalse:[ |
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
7418 |
(someText isString) ifTrue:[ |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
7419 |
stream nextPutAll:someText. |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
7420 |
] ifFalse:[ |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
7421 |
"/ |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
7422 |
"/ 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
|
7423 |
"/ 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
|
7424 |
"/ 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
|
7425 |
"/ |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
7426 |
startNr := 1. |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
7427 |
nLines := someText size. |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
7428 |
[startNr <= nLines] whileTrue:[ |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
7429 |
string := someText asStringWithCRsFrom:startNr |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
7430 |
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
|
7431 |
compressTabs:compressTabs. |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
7432 |
encoding notNil ifTrue:[ |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
7433 |
string := string encodeInto:encoding |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
7434 |
]. |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
7435 |
stream nextPutAll:string. |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
7436 |
startNr := startNr + 1000 + 1. |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
7437 |
]. |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
7438 |
]. |
1353 | 7439 |
]. |
7440 |
||
7441 |
stream close. |
|
7442 |
subView modified:false |
|
1162 | 7443 |
|
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
7444 |
"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
|
7445 |
"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
|
7446 |
"Modified: / 6.5.1999 / 11:45:50 / cg" |
1140 | 7447 |
! ! |
7448 |
||
7449 |
!FileBrowser methodsFor:'private - presentation'! |
|
7450 |
||
7451 |
defineTabulatorsForLongList |
|
7452 |
"define the tabs for the long list" |
|
7453 |
||
7454 |
tabSpec := TabulatorSpecification new. |
|
7455 |
tabSpec unit:#inch. |
|
7456 |
"/ tabSpec positions:#(0 0.25 2.3 4.3 5.3 6.0 6.5). |
|
7457 |
tabSpec widths: #(0.25 2 2.0 1 0.5 0.5 1"any"). |
|
7458 |
" icon name mode owner group size type" |
|
7459 |
tabSpec align: #(#left #left #left #right #right #decimal #left). |
|
7460 |
tabSpec addDependent:self. |
|
7461 |
||
7462 |
tabRulerView tabulatorSpecification:tabSpec. |
|
7463 |
||
7464 |
"Modified: 17.4.1997 / 02:56:07 / cg" |
|
172 | 7465 |
! |
7466 |
||
1140 | 7467 |
defineTabulatorsForShortList |
7468 |
"define the tabs for the short list" |
|
7469 |
||
7470 |
tabSpec := TabulatorSpecification new. |
|
7471 |
tabSpec unit:#inch. |
|
7472 |
"/ tabSpec positions:#(0 0.25 ). |
|
7473 |
tabSpec widths: #(0.25 2 ). |
|
7474 |
" icon name" |
|
7475 |
tabSpec align: #(#left #left). |
|
7476 |
tabSpec addDependent:self. |
|
7477 |
||
1758 | 7478 |
tabRulerView notNil ifTrue:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7479 |
tabRulerView tabulatorSpecification:tabSpec. |
1758 | 7480 |
]. |
7481 |
||
7482 |
"Created: / 17.4.1997 / 02:51:41 / cg" |
|
7483 |
"Modified: / 27.7.1998 / 20:23:34 / cg" |
|
1140 | 7484 |
! |
7485 |
||
3861 | 7486 |
iconForFile:aFilename |
1147 | 7487 |
"given a fileName, return an appropriate icon" |
7488 |
||
3861 | 7489 |
|icn addIcns| |
7490 |
||
7491 |
icn := self iconForKeyMatching:(self class iconKeyForFile:aFilename). |
|
7492 |
addIcns := self class getAddOnIconsFor:aFilename. |
|
7493 |
addIcns notEmpty ifTrue:[ |
|
7494 |
addIcns addFirst:icn. |
|
7495 |
^ MultiImage images:addIcns. |
|
7496 |
]. |
|
7497 |
^ icn |
|
7498 |
! |
|
7499 |
||
7500 |
iconForKeyMatching:mimeTypeOrKey |
|
7501 |
|assoc icn| |
|
7502 |
||
7503 |
icn := icons at:mimeTypeOrKey ifAbsent:nil. |
|
7504 |
icn notNil ifTrue:[^ icn]. |
|
7505 |
assoc := matchedIcons detect:[:assoc | assoc key match:mimeTypeOrKey] ifNone:nil. |
|
7506 |
assoc notNil ifTrue:[^ assoc value]. |
|
1495 | 7507 |
|
1784
329e3a904236
ask MIMETypes when mapping suffixes to icons.
Claus Gittinger <cg@exept.de>
parents:
1758
diff
changeset
|
7508 |
"/ global icons |
329e3a904236
ask MIMETypes when mapping suffixes to icons.
Claus Gittinger <cg@exept.de>
parents:
1758
diff
changeset
|
7509 |
|
329e3a904236
ask MIMETypes when mapping suffixes to icons.
Claus Gittinger <cg@exept.de>
parents:
1758
diff
changeset
|
7510 |
Icons notNil ifTrue:[ |
3861 | 7511 |
icn := Icons at:mimeTypeOrKey ifAbsent:nil. |
2187
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
7512 |
icn notNil ifTrue:[ |
3861 | 7513 |
icn := icn copy onDevice:device. |
7514 |
icn clearMaskedPixels. |
|
7515 |
icons at:mimeTypeOrKey put:icn. |
|
7516 |
^ icn |
|
2187
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
7517 |
]. |
3861 | 7518 |
|
7519 |
assoc := MatchedIcons detect:[:assoc | assoc key match:mimeTypeOrKey] ifNone:nil. |
|
7520 |
assoc notNil ifTrue:[ |
|
7521 |
icn := assoc value copy onDevice:device. |
|
7522 |
icn clearMaskedPixels. |
|
7523 |
matchedIcons add:(assoc key -> icn). |
|
2187
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
7524 |
^ icn |
3861 | 7525 |
]. |
7526 |
]. |
|
7527 |
||
7528 |
^ nil |
|
36 | 7529 |
! |
7530 |
||
2094 | 7531 |
stopImageRenderProcess |
7532 |
imageRenderProcess notNil ifTrue:[ |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7533 |
imageRenderProcess terminate. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7534 |
imageRenderProcess := nil |
2094 | 7535 |
]. |
7536 |
||
7537 |
"Created: 19.4.1997 / 13:51:34 / cg" |
|
7538 |
! |
|
7539 |
||
1156
f3df28086973
dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents:
1154
diff
changeset
|
7540 |
stopUpdateProcess |
f3df28086973
dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents:
1154
diff
changeset
|
7541 |
Processor removeTimedBlock:checkBlock. |
f3df28086973
dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents:
1154
diff
changeset
|
7542 |
listUpdateProcess notNil ifTrue:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7543 |
listUpdateProcess terminate. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7544 |
listUpdateProcess := nil. |
1156
f3df28086973
dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents:
1154
diff
changeset
|
7545 |
]. |
f3df28086973
dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents:
1154
diff
changeset
|
7546 |
|
f3df28086973
dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents:
1154
diff
changeset
|
7547 |
"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
|
7548 |
! |
f3df28086973
dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents:
1154
diff
changeset
|
7549 |
|
36 | 7550 |
updateCurrentDirectory |
7551 |
"update listView with directory contents" |
|
7552 |
||
49 | 7553 |
"the code below may look somewhat complex - |
7554 |
it reads the directory first for the names, |
|
1151
194b10bad6da
great asynchronous list update;
Claus Gittinger <cg@exept.de>
parents:
1147
diff
changeset
|
7555 |
then (in followup sweeps over the files) gets the |
194b10bad6da
great asynchronous list update;
Claus Gittinger <cg@exept.de>
parents:
1147
diff
changeset
|
7556 |
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
|
7557 |
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
|
7558 |
(i.e. stat-calls) may take long - especially on NFS-mounted directories. |
49 | 7559 |
The file reading is done at lower priority, to let user continue |
7560 |
his work in other views. However, to be fair to other fileBrowser, |
|
7561 |
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
|
7562 |
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
|
7563 |
Therefore, browsers which read short directories will finish first. |
49 | 7564 |
ST/X users love this behavior ;-) |
7565 |
" |
|
7566 |
||
3665 | 7567 |
|files matchPattern list passDone ignoreCase oldSelection newSelection times types| |
3419 | 7568 |
|
294 | 7569 |
self withReadCursorDo:[ |
2255
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7570 |
self stopUpdateProcess. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7571 |
|
2636 | 7572 |
timeOfLastCheck := currentDirectory modificationTime. |
2255
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7573 |
|
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7574 |
files := currentDirectory asFilename fullDirectoryContents. |
1329 | 7575 |
|
7576 |
"/ (files includes:(Filename parentDirectoryName)) ifTrue:[ |
|
7577 |
"/ upButton enable. |
|
7578 |
"/ ] ifFalse:[ |
|
7579 |
"/ upButton disable. |
|
7580 |
"/ ]. |
|
7581 |
||
2255
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7582 |
"/ show files which are either directories |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7583 |
"/ or match the current pattern |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7584 |
|
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7585 |
matchPattern := filterField contents. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7586 |
(matchPattern notNil and:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7587 |
matchPattern isEmpty not and:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7588 |
matchPattern ~= '*']]) ifTrue:[ |
2498
77c52f2004a4
care for case-insensitive systems in pattern-match (windows)
Claus Gittinger <cg@exept.de>
parents:
2492
diff
changeset
|
7589 |
ignoreCase := Filename isCaseSensitive not. |
2255
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7590 |
files := files select:[:aName | |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7591 |
((currentDirectory construct:aName) isDirectory) |
2498
77c52f2004a4
care for case-insensitive systems in pattern-match (windows)
Claus Gittinger <cg@exept.de>
parents:
2492
diff
changeset
|
7592 |
or:[matchPattern compoundMatch:aName ignoreCase:ignoreCase] |
2255
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7593 |
]. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7594 |
]. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7595 |
|
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7596 |
files size == 0 ifTrue:[ |
3528 | 7597 |
Dialog warn:((resources string:'Directory ''%1'' is gone.') |
7598 |
withCRs |
|
7599 |
bindWith:currentDirectory pathName allBold). |
|
2255
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7600 |
^ self |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7601 |
]. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7602 |
(sortByWhat value == #name) ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7603 |
sortCaseless value == true ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7604 |
files sort:[:a :b | a asLowercase < b asLowercase] |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7605 |
] ifFalse:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7606 |
files sort. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7607 |
] |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7608 |
] ifFalse:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7609 |
(sortByWhat value == #time) ifTrue:[ |
3665 | 7610 |
times := Dictionary new. |
7611 |
files do:[:fn | |t f| |
|
7612 |
f := currentDirectory construct:fn. |
|
7613 |
t := f isSymbolicLink |
|
7614 |
ifFalse:[f modificationTime] |
|
7615 |
ifTrue:[f linkInfo modified]. |
|
7616 |
t isNil ifTrue:[t := AbsoluteTime now]. |
|
7617 |
times at:fn put:t. |
|
7618 |
]. |
|
2255
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7619 |
files sort:[:a :b | |f1 f2 t1 t2| |
3665 | 7620 |
t1 := times at:a. |
7621 |
t2 := times at:b. |
|
7622 |
||
7623 |
"/ f1 := (currentDirectory construct:a). |
|
7624 |
"/ f2 := (currentDirectory construct:b). |
|
7625 |
"/ t1 := f1 isSymbolicLink |
|
7626 |
"/ ifFalse:[f1 modificationTime] |
|
7627 |
"/ ifTrue:[f1 linkInfo modified]. |
|
7628 |
"/ t2 := f2 isSymbolicLink |
|
7629 |
"/ ifFalse:[f2 modificationTime] |
|
7630 |
"/ ifTrue:[f2 linkInfo modified]. |
|
7631 |
"/ t1 := t1 ? (AbsoluteTime now). |
|
7632 |
"/ t2 := t2 ? (AbsoluteTime now). |
|
2255
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7633 |
t1 > t2 |
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 |
] ifFalse:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7636 |
(sortByWhat value == #type) ifTrue:[ |
3665 | 7637 |
types := Dictionary new. |
7638 |
files do:[:fn | |t f| |
|
7639 |
f := currentDirectory construct:fn. |
|
7640 |
t := f type ? #xbadLink. |
|
7641 |
types at:fn put:t. |
|
7642 |
]. |
|
2255
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7643 |
files sort:[:a :b | |f1 f2 t1 t2 suff1 suff2| |
3665 | 7644 |
t1 := types at:a. |
7645 |
t2 := types at:b. |
|
7646 |
"/ f1 := (currentDirectory construct:a). |
|
7647 |
"/ f2 := (currentDirectory construct:b). |
|
7648 |
"/ t1 := f1 type ? #xbadLink. |
|
7649 |
"/ t2 := f2 type ? #xbadLink. |
|
2255
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7650 |
t1 = t2 ifTrue:[ |
3665 | 7651 |
f1 := (currentDirectory construct:a). |
7652 |
f2 := (currentDirectory construct:b). |
|
2255
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7653 |
suff1 := f1 suffix. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7654 |
suff2 := f2 suffix. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7655 |
suff1 = suff2 ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7656 |
sortCaseless value == true ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7657 |
a asLowercase < b asLowercase |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7658 |
] ifFalse:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7659 |
a < b |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7660 |
] |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7661 |
] ifFalse:[ |
3665 | 7662 |
suff1 asLowercase = suff2 asLowercase ifTrue:[ |
7663 |
sortCaseless value == true ifTrue:[ |
|
7664 |
a asLowercase < b asLowercase |
|
7665 |
] ifFalse:[ |
|
7666 |
a < b |
|
7667 |
] |
|
7668 |
] ifFalse:[ |
|
7669 |
suff1 asLowercase < suff2 asLowercase |
|
7670 |
] |
|
2255
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 |
] ifFalse:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7673 |
t1 < t2 |
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 |
] |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7676 |
] |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7677 |
] |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7678 |
]. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7679 |
|
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7680 |
files := self withoutHiddenFiles:files. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7681 |
fileList := files copy. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7682 |
|
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7683 |
tabSpec isNil ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7684 |
showingDetails value "showLongList" ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7685 |
self defineTabulatorsForLongList |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7686 |
] ifFalse:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7687 |
self defineTabulatorsForShortList |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7688 |
]. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7689 |
]. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7690 |
|
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 |
"/ 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
|
7693 |
"/ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7694 |
list := files collect:[:fileName | |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7695 |
|entry| |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7696 |
|
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7697 |
entry := MultiColListEntry new. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7698 |
entry tabulatorSpecification:tabSpec. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7699 |
entry colAt:1 put:nil. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7700 |
entry colAt:2 put:fileName. |
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 |
|
3206 | 7703 |
oldSelection := fileListView selectionValue. |
2255
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7704 |
fileListView setList:list expandTabs:false. |
3206 | 7705 |
newSelection := oldSelection collect:[:nm | list indexOf:nm]. |
7706 |
fileListView selectWithoutScroll:newSelection. |
|
7707 |
||
2255
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7708 |
passDone := Array new:list size withAll:0. |
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 |
" |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7711 |
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
|
7712 |
NFS-mounted directory); therefore, start a low prio process, |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7713 |
which fills in the remaining fields in the fileList ... |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7714 |
" |
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 |
listUpdateProcess := [ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7717 |
|prevUid prevGid fileNameString nameString groupString |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7718 |
modeString info line len |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7719 |
anyImages lineIndex aFileName |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7720 |
entry typ f p typeString done endIndex |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7721 |
state stopAtEnd nextState img prevFirstLine prevLastLine |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7722 |
numVisible dirSuffix prevWidth t| |
2255
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7723 |
|
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7724 |
dirSuffix := Filename directorySuffix. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7725 |
dirSuffix size > 0 ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7726 |
dirSuffix := '.' , dirSuffix asLowercase. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7727 |
]. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7728 |
|
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7729 |
"/ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7730 |
"/ then walk over the files, adding more info |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7731 |
"/ (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
|
7732 |
"/ Visible items are always filled first. |
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 |
"/ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7735 |
"/ the state machine |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7736 |
"/ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7737 |
nextState := IdentityDictionary new. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7738 |
showingDetails value "showLongList" ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7739 |
nextState add:(#visibleIcons -> #visibleAttributes). |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7740 |
nextState add:(#visibleAttributes -> #visibleTypes). |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7741 |
nextState add:(#visibleTypes -> #visibleImages). |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7742 |
nextState add:(#visibleImages -> #nextPageIcons). |
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 |
nextState add:(#nextPageIcons -> #nextPageAttributes). |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7745 |
nextState add:(#nextPageAttributes -> #nextPageTypes). |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7746 |
nextState add:(#nextPageTypes -> #nextPageImages). |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7747 |
nextState add:(#nextPageImages -> #previousPageIcons). |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7748 |
|
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7749 |
nextState add:(#previousPageIcons -> #previousPageAttributes). |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7750 |
nextState add:(#previousPageAttributes -> #previousPageTypes). |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7751 |
nextState add:(#previousPageTypes -> #previousPageImages). |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7752 |
nextState add:(#previousPageImages -> #remainingIcons). |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7753 |
|
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7754 |
nextState add:(#remainingIcons -> #remainingAttributes). |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7755 |
nextState add:(#remainingAttributes -> #remainingTypes). |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7756 |
nextState add:(#remainingTypes -> #remainingImages). |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7757 |
nextState add:(#remainingImages -> nil). |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7758 |
] ifFalse:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7759 |
nextState add:(#visibleIcons -> #nextPageIcons). |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7760 |
nextState add:(#nextPageIcons -> #previousPageIcons). |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7761 |
nextState add:(#previousPageIcons -> #remainingIcons). |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7762 |
nextState add:(#remainingIcons -> nil). |
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 |
anyImages := false. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7766 |
|
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7767 |
lineIndex := prevFirstLine := fileListView firstLineShown. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7768 |
endIndex := prevLastLine := fileListView lastLineShown. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7769 |
endIndex := endIndex min:(files size). |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7770 |
state := #visibleIcons. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7771 |
|
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7772 |
done := false. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7773 |
[done] whileFalse:[ |
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 |
"/ if multiple FileBrowsers are reading, let others |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7776 |
"/ make some progress too |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7777 |
"/ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7778 |
Processor yield. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7779 |
|
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7780 |
"/ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7781 |
"/ could be destroyed in the meanwhile ... |
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 |
realized ifFalse:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7784 |
listUpdateProcess := nil. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7785 |
Processor activeProcess terminate |
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 |
|
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7788 |
((prevFirstLine ~~ fileListView firstLineShown) |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7789 |
or:[prevLastLine ~~ fileListView lastLineShown]) ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7790 |
"/ start all over again |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7791 |
lineIndex := prevFirstLine := fileListView firstLineShown. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7792 |
endIndex := prevLastLine := fileListView lastLineShown. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7793 |
endIndex := endIndex min:(files size). |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7794 |
state := #visibleIcons. |
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 |
|
2257
02dc5c0000e1
oops - must send size-changeNotification manually
Claus Gittinger <cg@exept.de>
parents:
2256
diff
changeset
|
7797 |
showingDetails value ifTrue:[ |
02dc5c0000e1
oops - must send size-changeNotification manually
Claus Gittinger <cg@exept.de>
parents:
2256
diff
changeset
|
7798 |
prevWidth := fileListView widthOfContents. |
02dc5c0000e1
oops - must send size-changeNotification manually
Claus Gittinger <cg@exept.de>
parents:
2256
diff
changeset
|
7799 |
]. |
02dc5c0000e1
oops - must send size-changeNotification manually
Claus Gittinger <cg@exept.de>
parents:
2256
diff
changeset
|
7800 |
|
2255
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7801 |
(lineIndex between:1 and:(files size)) 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 |
"/ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7804 |
"/ expand the next entry ... |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7805 |
"/ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7806 |
aFileName := files at:lineIndex. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7807 |
entry := fileListView at:lineIndex. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7808 |
f := currentDirectory construct:aFileName. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7809 |
|
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7810 |
(state endsWith:'Icons') ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7811 |
"/ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7812 |
"/ pass 1 - icons |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7813 |
"/ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7814 |
(passDone at:lineIndex) < 1 ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7815 |
(f isDirectory |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7816 |
and:[(aFileName ~= '..') and:[aFileName ~= '.']] |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7817 |
) ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7818 |
|
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7819 |
"/ the following suffix cutOff is not really required, |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7820 |
"/ but makes the list look better on VMS ... |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7821 |
fileNameString := aFileName. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7822 |
dirSuffix notNil ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7823 |
(aFileName asLowercase endsWith:dirSuffix) ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7824 |
fileNameString := aFileName copyWithoutLast:(dirSuffix size). |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7825 |
] |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7826 |
]. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7827 |
fileNameString := fileNameString , ' ...' |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7828 |
] ifFalse:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7829 |
fileNameString := aFileName. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7830 |
OperatingSystem isVMSlike ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7831 |
(aFileName endsWith:'.') ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7832 |
aFileName ~= '..' ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7833 |
fileNameString := aFileName copyWithoutLast:1 |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7834 |
] |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7835 |
] |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7836 |
] |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7837 |
]. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7838 |
|
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7839 |
showingDetails value "showLongList" ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7840 |
len := fileNameString size. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7841 |
(len > 20) ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7842 |
fileNameString := (fileNameString contractTo:20) |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7843 |
]. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7844 |
]. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7845 |
|
3861 | 7846 |
entry colAt:1 put:(self iconForFile:(currentDirectory construct:aFileName)). |
2255
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7847 |
entry colAt:2 put:fileNameString. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7848 |
|
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7849 |
"/fileListView at:lineIndex put:entry. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7850 |
fileListView withoutRedrawAt:lineIndex put:entry. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7851 |
fileListView invalidateLine:lineIndex. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7852 |
|
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7853 |
anyImages ifFalse:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7854 |
(Image isImageFileSuffix:(aFileName asFilename suffix)) |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7855 |
ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7856 |
anyImages := true |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7857 |
] |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7858 |
]. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7859 |
passDone at:lineIndex put:1 |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7860 |
] |
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 |
(state endsWith:'Attributes') ifTrue:[ |
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 |
"/ pass 2 - everything except fileType (which takes very long) |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7866 |
"/ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7867 |
(passDone at:lineIndex) < 2 ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7868 |
info := f info. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7869 |
info isNil ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7870 |
"not accessable - usually a symlink, |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7871 |
to a nonexisting/nonreadable file |
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 |
f isSymbolicLink ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7874 |
p := f linkInfo path. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7875 |
typeString := 'broken symbolic link to ' , p |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7876 |
] ifFalse:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7877 |
typeString := 'unknown' |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7878 |
]. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7879 |
] ifFalse:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7880 |
typ := (info type). |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7881 |
|
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7882 |
modeString := self getModeString:(info at:#mode) |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7883 |
with:#( '' $r $w $x |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7884 |
' ' $r $w $x |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7885 |
' ' $r $w $x ). |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7886 |
entry colAt:3 put:modeString. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7887 |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7888 |
showingTimeAndDate value ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7889 |
t := f isSymbolicLink |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7890 |
ifFalse:[f modificationTime] |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7891 |
ifTrue:[f linkInfo modified]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7892 |
entry colAt:4 put:t asDate printString. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7893 |
entry colAt:5 put:t asTime printString. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7894 |
] ifFalse:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7895 |
((info uid) ~~ prevUid) ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7896 |
prevUid := (info uid). |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7897 |
nameString := OperatingSystem getUserNameFromID:prevUid. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7898 |
nameString := nameString contractTo:10. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7899 |
nameString := nameString , (String new:(10 - nameString size)) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7900 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7901 |
nameString isNil ifTrue:[nameString := '???']. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7902 |
entry colAt:4 put:nameString withoutSpaces. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7903 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7904 |
((info gid) ~~ prevGid) ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7905 |
prevGid := (info gid). |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7906 |
groupString := OperatingSystem getGroupNameFromID:prevGid. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7907 |
groupString := groupString contractTo:10. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7908 |
groupString := groupString , (String new:(10 - groupString size)) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7909 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7910 |
groupString isNil ifTrue:[groupString := '???']. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7911 |
entry colAt:5 put:groupString withoutSpaces. |
2255
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7912 |
]. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7913 |
|
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7914 |
(typ == #regular) ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7915 |
entry colAt:6 put:(self sizePrintString:(info size)). |
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 |
f isSymbolicLink ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7919 |
p := f linkInfo path. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7920 |
typeString := 'symbolic link to ' , p |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7921 |
] ifFalse:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7922 |
typeString := typ asString |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7923 |
]. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7924 |
]. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7925 |
entry colAt:7 put:typeString. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7926 |
|
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7927 |
"/ fileListView at:lineIndex put:entry. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7928 |
fileListView withoutRedrawAt:lineIndex put:entry. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7929 |
fileListView invalidateLine:lineIndex. |
2257
02dc5c0000e1
oops - must send size-changeNotification manually
Claus Gittinger <cg@exept.de>
parents:
2256
diff
changeset
|
7930 |
|
2255
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7931 |
passDone at:lineIndex put:2. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7932 |
]. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7933 |
]. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7934 |
|
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7935 |
(state endsWith:'Types') ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7936 |
"/ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7937 |
"/ pass 3: add fileType |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7938 |
"/ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7939 |
(passDone at:lineIndex) < 3 ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7940 |
info := f info. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7941 |
info notNil ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7942 |
f isSymbolicLink ifFalse:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7943 |
(Image isImageFileSuffix:(f suffix)) ifFalse:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7944 |
typeString := f fileType. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7945 |
|
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7946 |
entry colAt:7 put:typeString. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7947 |
"/ fileListView at:lineIndex put:entry |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7948 |
fileListView withoutRedrawAt:lineIndex put:entry. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7949 |
fileListView invalidateLine:lineIndex. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7950 |
]. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7951 |
]. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7952 |
]. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7953 |
|
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7954 |
passDone at:lineIndex put:3 |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7955 |
]. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7956 |
]. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7957 |
|
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7958 |
(state endsWith:'Images') ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7959 |
"/ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7960 |
"/ pass 4: read images |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7961 |
"/ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7962 |
(passDone at:lineIndex) < 4 ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7963 |
(Image isImageFileSuffix:(f suffix)) ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7964 |
f isDirectory ifFalse:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7965 |
img := Image fromFile:(f pathName). |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7966 |
img notNil ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7967 |
showingBigImagePreview value == true ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7968 |
img := img magnifiedTo:32@32. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7969 |
] ifFalse:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7970 |
img := img magnifiedTo:16@16. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7971 |
]. |
2339 | 7972 |
img := img onDevice:self device. |
2255
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7973 |
entry colAt:7 put:img. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7974 |
"/ fileListView at:lineIndex put:entry |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7975 |
fileListView withoutRedrawAt:lineIndex put:entry. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7976 |
fileListView invalidateLine:lineIndex. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7977 |
] |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7978 |
] |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7979 |
]. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7980 |
passDone at:lineIndex put:4 |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7981 |
]. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7982 |
]. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7983 |
]. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7984 |
|
2257
02dc5c0000e1
oops - must send size-changeNotification manually
Claus Gittinger <cg@exept.de>
parents:
2256
diff
changeset
|
7985 |
showingDetails value ifTrue:[ |
02dc5c0000e1
oops - must send size-changeNotification manually
Claus Gittinger <cg@exept.de>
parents:
2256
diff
changeset
|
7986 |
fileListView widthOfContents ~~ prevWidth ifTrue:[ |
02dc5c0000e1
oops - must send size-changeNotification manually
Claus Gittinger <cg@exept.de>
parents:
2256
diff
changeset
|
7987 |
fileListView contentsChanged. |
02dc5c0000e1
oops - must send size-changeNotification manually
Claus Gittinger <cg@exept.de>
parents:
2256
diff
changeset
|
7988 |
] |
02dc5c0000e1
oops - must send size-changeNotification manually
Claus Gittinger <cg@exept.de>
parents:
2256
diff
changeset
|
7989 |
]. |
02dc5c0000e1
oops - must send size-changeNotification manually
Claus Gittinger <cg@exept.de>
parents:
2256
diff
changeset
|
7990 |
|
2255
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7991 |
"/ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7992 |
"/ advance to the next line |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7993 |
"/ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7994 |
lineIndex := lineIndex + 1. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7995 |
lineIndex > endIndex ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7996 |
"/ finished this round ... |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7997 |
"/ see what we are going for ... |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7998 |
numVisible := (fileListView lastLineShown - fileListView firstLineShown + 1). |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7999 |
|
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
8000 |
state := nextState at:state ifAbsent:nil. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
8001 |
|
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
8002 |
state isNil ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
8003 |
done := true |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
8004 |
] ifFalse:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
8005 |
(state startsWith:'visible') ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
8006 |
lineIndex := fileListView firstLineShown. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
8007 |
endIndex := fileListView lastLineShown. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
8008 |
endIndex := endIndex min:(files size). |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
8009 |
] ifFalse:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
8010 |
(state startsWith:'nextPage') ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
8011 |
lineIndex := fileListView lastLineShown + 1. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
8012 |
endIndex := lineIndex + numVisible. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
8013 |
endIndex := endIndex min:(files size). |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
8014 |
lineIndex := lineIndex min:(files size). |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
8015 |
] ifFalse:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
8016 |
(state startsWith:'previousPage') ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
8017 |
endIndex := fileListView firstLineShown - 1. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
8018 |
lineIndex := endIndex - numVisible. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
8019 |
lineIndex := lineIndex max:1. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
8020 |
endIndex := endIndex min:(files size). |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
8021 |
endIndex := endIndex max:1. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
8022 |
] ifFalse:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
8023 |
"/ remaining |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
8024 |
lineIndex := 1. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
8025 |
endIndex := files size. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
8026 |
] |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
8027 |
] |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
8028 |
] |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
8029 |
] |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
8030 |
] |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
8031 |
]. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
8032 |
|
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
8033 |
listUpdateProcess := nil. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
8034 |
|
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
8035 |
] forkAt:(Processor activePriority - 1). |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
8036 |
|
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
8037 |
" |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
8038 |
install a new check after some time |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
8039 |
" |
3520
83cf11e1bf32
schedule checkBlock for the right process
Claus Gittinger <cg@exept.de>
parents:
3503
diff
changeset
|
8040 |
self scheduleCheckBlock. |
36 | 8041 |
] |
142 | 8042 |
|
1487
c8d32d8b039c
oops - dont sort a nil object
Claus Gittinger <cg@exept.de>
parents:
1481
diff
changeset
|
8043 |
"Modified: / 21.9.1995 / 11:40:23 / claus" |
c8d32d8b039c
oops - dont sort a nil object
Claus Gittinger <cg@exept.de>
parents:
1481
diff
changeset
|
8044 |
"Modified: / 28.4.1997 / 22:30:30 / dq" |
c8d32d8b039c
oops - dont sort a nil object
Claus Gittinger <cg@exept.de>
parents:
1481
diff
changeset
|
8045 |
"Modified: / 18.9.1997 / 18:28:30 / stefan" |
3419 | 8046 |
"Modified: / 15.11.2001 / 23:49:03 / cg" |
386
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
8047 |
! ! |
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
8048 |
|
172 | 8049 |
!FileBrowser methodsFor:'queries'! |
73 | 8050 |
|
1700
5067b3c4cafa
added access to fileName (kludge to fileIn RefactoryBrowser)
Claus Gittinger <cg@exept.de>
parents:
1689
diff
changeset
|
8051 |
fileName |
1702
962056a31c06
remember the current file during fileIn,
Claus Gittinger <cg@exept.de>
parents:
1700
diff
changeset
|
8052 |
"return my current fileName - during fileIn, the file |
962056a31c06
remember the current file during fileIn,
Claus Gittinger <cg@exept.de>
parents:
1700
diff
changeset
|
8053 |
which is being loaded is returned. |
962056a31c06
remember the current file during fileIn,
Claus Gittinger <cg@exept.de>
parents:
1700
diff
changeset
|
8054 |
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
|
8055 |
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
|
8056 |
|
962056a31c06
remember the current file during fileIn,
Claus Gittinger <cg@exept.de>
parents:
1700
diff
changeset
|
8057 |
|f| |
962056a31c06
remember the current file during fileIn,
Claus Gittinger <cg@exept.de>
parents:
1700
diff
changeset
|
8058 |
|
962056a31c06
remember the current file during fileIn,
Claus Gittinger <cg@exept.de>
parents:
1700
diff
changeset
|
8059 |
f := currentFileInFileName ? currentFileName. |
962056a31c06
remember the current file during fileIn,
Claus Gittinger <cg@exept.de>
parents:
1700
diff
changeset
|
8060 |
f isNil ifTrue:[^ nil]. |
962056a31c06
remember the current file during fileIn,
Claus Gittinger <cg@exept.de>
parents:
1700
diff
changeset
|
8061 |
^ self path asFilename construct:f |
1700
5067b3c4cafa
added access to fileName (kludge to fileIn RefactoryBrowser)
Claus Gittinger <cg@exept.de>
parents:
1689
diff
changeset
|
8062 |
|
5067b3c4cafa
added access to fileName (kludge to fileIn RefactoryBrowser)
Claus Gittinger <cg@exept.de>
parents:
1689
diff
changeset
|
8063 |
" |
5067b3c4cafa
added access to fileName (kludge to fileIn RefactoryBrowser)
Claus Gittinger <cg@exept.de>
parents:
1689
diff
changeset
|
8064 |
(FileBrowser openOnFileNamed:'Makefile') fileName |
5067b3c4cafa
added access to fileName (kludge to fileIn RefactoryBrowser)
Claus Gittinger <cg@exept.de>
parents:
1689
diff
changeset
|
8065 |
" |
5067b3c4cafa
added access to fileName (kludge to fileIn RefactoryBrowser)
Claus Gittinger <cg@exept.de>
parents:
1689
diff
changeset
|
8066 |
|
1702
962056a31c06
remember the current file during fileIn,
Claus Gittinger <cg@exept.de>
parents:
1700
diff
changeset
|
8067 |
"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
|
8068 |
! |
5067b3c4cafa
added access to fileName (kludge to fileIn RefactoryBrowser)
Claus Gittinger <cg@exept.de>
parents:
1689
diff
changeset
|
8069 |
|
172 | 8070 |
path |
8071 |
"return my currentDirectories pathName; |
|
1329 | 8072 |
sent from the pathField to aquire the pathname when I changed directory" |
8073 |
||
8074 |
"/ somewhat tricky: first ask it for the full pathName, |
|
8075 |
"/ then convert it to a directory name |
|
8076 |
"/ (which only makes a difference on VMS) |
|
8077 |
||
3747
d30bc1e54f15
Remove unused vars and asFilename sends
Stefan Vogel <sv@exept.de>
parents:
3746
diff
changeset
|
8078 |
^ currentDirectory pathName "/ asFilename osNameForDirectory |
1828 | 8079 |
|
8080 |
"Modified: / 12.8.1998 / 14:45:48 / cg" |
|
49 | 8081 |
! ! |
8082 |
||
763
94a8d188b52d
care for the nameSpace Query when loading binary classes
Claus Gittinger <cg@exept.de>
parents:
749
diff
changeset
|
8083 |
!FileBrowser class methodsFor:'documentation'! |
203 | 8084 |
|
8085 |
version |
|
3861 | 8086 |
^ '$Header: /cvs/stx/stx/libtool/FileBrowser.st,v 1.491 2002-09-11 12:55:33 penk Exp $' |
381 | 8087 |
! ! |