author | Claus Gittinger <cg@exept.de> |
Mon, 28 Jun 1999 10:46:13 +0200 | |
changeset 2216 | b84ee099f484 |
parent 2187 | 59aff09bfc2d |
child 2220 | 1ec72aa513c8 |
permissions | -rw-r--r-- |
36 | 1 |
" |
2 |
COPYRIGHT (c) 1991 by Claus Gittinger |
|
1317 | 3 |
All Rights Reserved |
36 | 4 |
|
5 |
This software is furnished under a license and may be used |
|
6 |
only in accordance with the terms of that license and with the |
|
7 |
inclusion of the above copyright notice. This software may not |
|
8 |
be provided or otherwise made available to, or used by, any |
|
9 |
other person. No title to or ownership of the software is |
|
10 |
hereby transferred. |
|
11 |
" |
|
12 |
||
13 |
StandardSystemView subclass:#FileBrowser |
|
1010 | 14 |
instanceVariableNames:'labelView filterField fileListView subView currentDirectory |
1834 | 15 |
fileList checkBlock checkDelta timeOfLastCheck myName killButton |
16 |
pauseToggle compressTabs lockUpdate previousDirectory |
|
17 |
currentFileName timeOfFileRead tabSpec commandView commandIndex |
|
18 |
fileEncoding tabRulerView scrollView icons listUpdateProcess |
|
19 |
currentFileInFileName lastFileDiffDirectory sortByWhat |
|
2031 | 20 |
sortCaseless showingDetails showingHiddenFiles |
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
21 |
showingBigImagePreview imagePreviewView imageRenderProcess |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
22 |
dosEOLMode' |
1010 | 23 |
classVariableNames:'DirectoryHistory DirectoryHistoryWhere HistorySize DefaultIcon |
1142
9066d7d02a3a
remember last executed command per suffix; offer this as default.
Claus Gittinger <cg@exept.de>
parents:
1141
diff
changeset
|
24 |
CommandHistory CommandHistorySize Icons DefaultCommandPerSuffix' |
1010 | 25 |
poolDictionaries:'' |
26 |
category:'Interface-Browsers' |
|
36 | 27 |
! |
28 |
||
763
94a8d188b52d
care for the nameSpace Query when loading binary classes
Claus Gittinger <cg@exept.de>
parents:
749
diff
changeset
|
29 |
!FileBrowser class methodsFor:'documentation'! |
36 | 30 |
|
31 |
copyright |
|
32 |
" |
|
33 |
COPYRIGHT (c) 1991 by Claus Gittinger |
|
1317 | 34 |
All Rights Reserved |
36 | 35 |
|
36 |
This software is furnished under a license and may be used |
|
37 |
only in accordance with the terms of that license and with the |
|
38 |
inclusion of the above copyright notice. This software may not |
|
39 |
be provided or otherwise made available to, or used by, any |
|
40 |
other person. No title to or ownership of the software is |
|
41 |
hereby transferred. |
|
42 |
" |
|
43 |
! |
|
44 |
||
45 |
documentation |
|
46 |
" |
|
47 |
this used to be a very simple demo application, |
|
48 |
but migrated into a quite nice tool, includes all kinds of |
|
49 |
warning and information boxes, background processes for directory- |
|
50 |
reading and internationalized strings. A good example for beginners, |
|
100 | 51 |
on how to do things .... (and maybe how not to do things ;-, since some |
52 |
stuff is historic and was implemented at times when better mechanisms |
|
53 |
were not available) |
|
52 | 54 |
|
36 | 55 |
See additional information in 'doc/misc/fbrowser.doc'. |
45 | 56 |
|
52 | 57 |
WARNING: files edited with FileBrowser will have leading spaces (multiple-8) |
2138 | 58 |
being replaced by tabs. If tabs are to be preserved at other |
59 |
positions (for example, sendmail-config files) they will be |
|
60 |
corrupt after being written. |
|
508 | 61 |
|
62 |
[instance variables]: |
|
63 |
||
2138 | 64 |
checkDelta <Integer> number of seconds of check interval |
65 |
(looks ever so often if shown directory |
|
66 |
has changed). You may make this number |
|
67 |
higher, if your network-times are |
|
68 |
incorrect and thus, the filebrowser |
|
69 |
checks too often. |
|
70 |
||
71 |
compressTabs <Boolean> if true, leading spaces will be |
|
72 |
replaced by tabs when saving text |
|
52 | 73 |
|
74 |
some of the defaults (long/short list etc.) can be set by the resource file; |
|
75 |
see FileBrowser>>initialize for more details.. |
|
508 | 76 |
|
77 |
[author:] |
|
2138 | 78 |
Claus Gittinger |
2031 | 79 |
|
80 |
[start with:] |
|
2138 | 81 |
FileBrowser open |
36 | 82 |
" |
203 | 83 |
! ! |
36 | 84 |
|
763
94a8d188b52d
care for the nameSpace Query when loading binary classes
Claus Gittinger <cg@exept.de>
parents:
749
diff
changeset
|
85 |
!FileBrowser class methodsFor:'instance creation'! |
36 | 86 |
|
87 |
openOn:aDirectoryPath |
|
88 |
"start a new FileBrowser in a pathname" |
|
89 |
||
90 |
^ (self new currentDirectory:aDirectoryPath) open |
|
91 |
||
52 | 92 |
" |
93 |
FileBrowser openOn:'aDirectoryPath' |
|
94 |
FileBrowser openOn:'/etc' |
|
95 |
FileBrowser openOn:'..' |
|
96 |
FileBrowser openOn:'.' |
|
97 |
" |
|
93 | 98 |
! |
99 |
||
100 |
openOnFileNamed:aFilename |
|
101 |
"start a new FileBrowser on a file" |
|
102 |
||
103 |
|f browser| |
|
104 |
||
105 |
f := aFilename asFilename. |
|
1124 | 106 |
f isDirectory ifTrue:[ |
1868 | 107 |
^ self openOn:aFilename |
1124 | 108 |
]. |
1689 | 109 |
|
93 | 110 |
browser := self new. |
111 |
browser currentDirectory:f directoryName. |
|
1689 | 112 |
browser updateCurrentDirectory. |
93 | 113 |
browser showFile:f baseName. |
1689 | 114 |
|
115 |
^ browser open. |
|
93 | 116 |
|
117 |
" |
|
118 |
FileBrowser openOnFileNamed:'Makefile' |
|
119 |
FileBrowser openOnFileNamed:'../Makefile' |
|
120 |
FileBrowser openOnFileNamed:'/tmp/foo' |
|
121 |
" |
|
1124 | 122 |
|
1689 | 123 |
"Modified: / 17.6.1998 / 11:25:29 / cg" |
36 | 124 |
! ! |
125 |
||
1145
0464625bbdbb
read directory in a subprocess.
Claus Gittinger <cg@exept.de>
parents:
1144
diff
changeset
|
126 |
!FileBrowser class methodsFor:'class initialization'! |
0464625bbdbb
read directory in a subprocess.
Claus Gittinger <cg@exept.de>
parents:
1144
diff
changeset
|
127 |
|
1178
f5f4d0c605db
lazy initialization of Icons
Claus Gittinger <cg@exept.de>
parents:
1173
diff
changeset
|
128 |
initializeIcons |
1239
e58e2cb6639a
allow specification of icons from resource file.
Claus Gittinger <cg@exept.de>
parents:
1235
diff
changeset
|
129 |
|resources| |
e58e2cb6639a
allow specification of icons from resource file.
Claus Gittinger <cg@exept.de>
parents:
1235
diff
changeset
|
130 |
|
e58e2cb6639a
allow specification of icons from resource file.
Claus Gittinger <cg@exept.de>
parents:
1235
diff
changeset
|
131 |
resources := self classResources. |
e58e2cb6639a
allow specification of icons from resource file.
Claus Gittinger <cg@exept.de>
parents:
1235
diff
changeset
|
132 |
|
1784
329e3a904236
ask MIMETypes when mapping suffixes to icons.
Claus Gittinger <cg@exept.de>
parents:
1758
diff
changeset
|
133 |
Icons := Dictionary new. |
1145
0464625bbdbb
read directory in a subprocess.
Claus Gittinger <cg@exept.de>
parents:
1144
diff
changeset
|
134 |
|
1147 | 135 |
#( |
2187
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
136 |
"/ internal-type to icon mappings. |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
137 |
(#directory 'ICON_DIRECTORY' 'tiny_yellow_dir.xpm' ) |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
138 |
(#directoryLocked 'ICON_DIRECTORY_LOCKED' 'tiny_yellow_dir_locked.xpm') |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
139 |
(#directoryLink 'ICON_DIRECTORY_LINK' 'tiny_yellow_dir_link.xpm' ) |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
140 |
(#file 'ICON_FILE' 'tiny_file_plain.xpm' ) |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
141 |
(#fileLink 'ICON_FILE_LINK' 'tiny_file_link.xpm' ) |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
142 |
(#fileLocked 'ICON_FILE_LOCKED' 'tiny_file_lock.xpm' ) |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
143 |
(#imageFile 'ICON_IMAGE_FILE' 'tiny_file_pix.xpm' ) |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
144 |
(#textFile 'ICON_TEXT_FILE' 'tiny_file_text.xpm' ) |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
145 |
(#executableFile 'ICON_EXECUTABLEFILE' 'tiny_file_exec.xpm' ) |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
146 |
|
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
147 |
"/ mime-type to icon mappings. |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
148 |
('text/plain' nil 'tiny_file_text.xpm' ) |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
149 |
('text/html' nil 'tiny_file_text.xpm' ) |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
150 |
('application/postscript' nil 'tiny_file_st.xpm' ) |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
151 |
('application/x-smalltalk-source' nil 'tiny_file_st.xpm' ) |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
152 |
('image' nil 'tiny_file_pix.xpm' ) |
1239
e58e2cb6639a
allow specification of icons from resource file.
Claus Gittinger <cg@exept.de>
parents:
1235
diff
changeset
|
153 |
) do:[:entry | |
2187
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
154 |
|key resource defaultName nm| |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
155 |
|
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
156 |
key := entry at:1. |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
157 |
resource := entry at:2. |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
158 |
defaultName := entry at:3. |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
159 |
|
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
160 |
resource notNil ifTrue:[ |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
161 |
nm := resources at:resource default:nil. |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
162 |
]. |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
163 |
nm isNil ifTrue:[ |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
164 |
nm := 'bitmaps/xpmBitmaps/document_images/' , defaultName |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
165 |
]. |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
166 |
Icons at:key put:(Image fromFile:nm). |
1147 | 167 |
] |
168 |
||
169 |
" |
|
1178
f5f4d0c605db
lazy initialization of Icons
Claus Gittinger <cg@exept.de>
parents:
1173
diff
changeset
|
170 |
self initializeIcons |
1147 | 171 |
" |
172 |
||
1784
329e3a904236
ask MIMETypes when mapping suffixes to icons.
Claus Gittinger <cg@exept.de>
parents:
1758
diff
changeset
|
173 |
"Modified: / 1.8.1998 / 17:39:27 / cg" |
1145
0464625bbdbb
read directory in a subprocess.
Claus Gittinger <cg@exept.de>
parents:
1144
diff
changeset
|
174 |
! ! |
0464625bbdbb
read directory in a subprocess.
Claus Gittinger <cg@exept.de>
parents:
1144
diff
changeset
|
175 |
|
865
48395e8ecca9
remember executeCommand actions in history as well.
Claus Gittinger <cg@exept.de>
parents:
851
diff
changeset
|
176 |
!FileBrowser class methodsFor:'command history'! |
48395e8ecca9
remember executeCommand actions in history as well.
Claus Gittinger <cg@exept.de>
parents:
851
diff
changeset
|
177 |
|
1142
9066d7d02a3a
remember last executed command per suffix; offer this as default.
Claus Gittinger <cg@exept.de>
parents:
1141
diff
changeset
|
178 |
addToCommandHistory:aCommandString for:aFilename |
9066d7d02a3a
remember last executed command per suffix; offer this as default.
Claus Gittinger <cg@exept.de>
parents:
1141
diff
changeset
|
179 |
|cmd suffix| |
9066d7d02a3a
remember last executed command per suffix; offer this as default.
Claus Gittinger <cg@exept.de>
parents:
1141
diff
changeset
|
180 |
|
865
48395e8ecca9
remember executeCommand actions in history as well.
Claus Gittinger <cg@exept.de>
parents:
851
diff
changeset
|
181 |
(aCommandString notNil and:[aCommandString notEmpty]) ifTrue:[ |
1317 | 182 |
CommandHistory notNil ifTrue:[ |
183 |
CommandHistory addFirst:aCommandString. |
|
184 |
CommandHistory size > CommandHistorySize ifTrue:[ |
|
185 |
CommandHistory removeLast |
|
186 |
] |
|
187 |
]. |
|
188 |
aFilename notNil ifTrue:[ |
|
189 |
cmd := aCommandString copyTo:(aCommandString indexOf:Character space ifAbsent:[aCommandString size + 1])-1. |
|
190 |
DefaultCommandPerSuffix isNil ifTrue:[ |
|
191 |
DefaultCommandPerSuffix := Dictionary new. |
|
192 |
]. |
|
193 |
suffix := aFilename asFilename suffix. |
|
194 |
suffix notNil ifTrue:[ |
|
195 |
DefaultCommandPerSuffix at:suffix put:cmd. |
|
196 |
] |
|
197 |
] |
|
865
48395e8ecca9
remember executeCommand actions in history as well.
Claus Gittinger <cg@exept.de>
parents:
851
diff
changeset
|
198 |
] |
48395e8ecca9
remember executeCommand actions in history as well.
Claus Gittinger <cg@exept.de>
parents:
851
diff
changeset
|
199 |
|
48395e8ecca9
remember executeCommand actions in history as well.
Claus Gittinger <cg@exept.de>
parents:
851
diff
changeset
|
200 |
"Created: 14.11.1996 / 14:58:13 / cg" |
48395e8ecca9
remember executeCommand actions in history as well.
Claus Gittinger <cg@exept.de>
parents:
851
diff
changeset
|
201 |
! ! |
48395e8ecca9
remember executeCommand actions in history as well.
Claus Gittinger <cg@exept.de>
parents:
851
diff
changeset
|
202 |
|
763
94a8d188b52d
care for the nameSpace Query when loading binary classes
Claus Gittinger <cg@exept.de>
parents:
749
diff
changeset
|
203 |
!FileBrowser class methodsFor:'defaults'! |
73 | 204 |
|
205 |
defaultIcon |
|
1147 | 206 |
"return the file browsers default window icon" |
207 |
||
1287 | 208 |
<resource: #style (#FILEBROWSER_ICON #FILEBROWSER_ICON_FILE)> |
209 |
||
210 |
|nm i res| |
|
1147 | 211 |
|
212 |
(i := DefaultIcon) isNil ifTrue:[ |
|
1317 | 213 |
res := self classResources. |
214 |
i := res at:'FILEBROWSER_ICON' default:nil. |
|
215 |
i isNil ifTrue:[ |
|
216 |
nm := res at:'FILEBROWSER_ICON_FILE' default:'FBrowser.xbm'. |
|
217 |
i := Image fromFile:nm resolution:100. |
|
218 |
i isNil ifTrue:[ |
|
219 |
i := Image fromFile:('bitmaps/' , nm) resolution:100. |
|
220 |
i isNil ifTrue:[ |
|
221 |
i := StandardSystemView defaultIcon |
|
222 |
] |
|
223 |
] |
|
224 |
]. |
|
225 |
i notNil ifTrue:[ |
|
226 |
DefaultIcon := i := i on:Display |
|
227 |
] |
|
1145
0464625bbdbb
read directory in a subprocess.
Claus Gittinger <cg@exept.de>
parents:
1144
diff
changeset
|
228 |
]. |
0464625bbdbb
read directory in a subprocess.
Claus Gittinger <cg@exept.de>
parents:
1144
diff
changeset
|
229 |
^ i |
0464625bbdbb
read directory in a subprocess.
Claus Gittinger <cg@exept.de>
parents:
1144
diff
changeset
|
230 |
|
1147 | 231 |
"Modified: 19.3.1997 / 20:48:34 / ca" |
1287 | 232 |
"Modified: 15.8.1997 / 15:27:19 / cg" |
73 | 233 |
! ! |
234 |
||
1933 | 235 |
!FileBrowser class methodsFor:'interface specs'! |
236 |
||
237 |
fileSearchDialogSpec |
|
238 |
"This resource specification was automatically generated |
|
239 |
by the UIPainter of ST/X." |
|
240 |
||
241 |
"Do not manually edit this!! If it is corrupted, |
|
242 |
the UIPainter may not be able to read the specification." |
|
243 |
||
244 |
" |
|
245 |
UIPainter new openOnClass:FileBrowser andSelector:#fileSearchDialogSpec |
|
246 |
" |
|
247 |
||
248 |
<resource: #canvas> |
|
249 |
||
250 |
^ |
|
251 |
||
252 |
#(#FullSpec |
|
2138 | 253 |
#window: |
254 |
#(#WindowSpec |
|
255 |
#name: 'File Search' |
|
256 |
#layout: #(#LayoutFrame 4 0 50 0 315 0 349 0) |
|
257 |
#level: 0 |
|
258 |
#label: 'File Search' |
|
259 |
#min: #(#Point 10 10) |
|
260 |
#max: #(#Point 1280 1024) |
|
261 |
#bounds: #(#Rectangle 4 50 316 350) |
|
262 |
#usePreferredExtent: false |
|
263 |
#returnIsOKInDialog: true |
|
264 |
#escapeIsCancelInDialog: true |
|
265 |
) |
|
266 |
#component: |
|
267 |
#(#SpecCollection |
|
268 |
#collection: |
|
269 |
#( |
|
270 |
#(#LabelSpec |
|
271 |
#name: 'Label1' |
|
272 |
#layout: #(#LayoutFrame 0 0 10 0 0 1 32 0) |
|
273 |
#label: 'Search for files named:' |
|
274 |
#translateLabel: true |
|
275 |
#adjust: #left |
|
276 |
) |
|
277 |
#(#InputFieldSpec |
|
278 |
#name: 'EntryField1' |
|
279 |
#layout: #(#LayoutFrame 10 0 36 0 305 0 58 0) |
|
280 |
#tabable: true |
|
281 |
#model: #namePatternHolder |
|
282 |
) |
|
283 |
#(#CheckBoxSpec |
|
284 |
#name: 'CheckBox1' |
|
285 |
#layout: #(#LayoutFrame 7 0 66 0 143 0 88 0) |
|
286 |
#tabable: true |
|
287 |
#model: #ignoreCaseInName |
|
288 |
#label: 'Ignore case' |
|
289 |
#translateLabel: true |
|
290 |
) |
|
291 |
#(#LabelSpec |
|
292 |
#name: 'Label2' |
|
293 |
#layout: #(#LayoutFrame 0 0.0 107 0 0 1.0 129 0) |
|
294 |
#label: 'Containing the string:' |
|
295 |
#translateLabel: true |
|
296 |
#adjust: #left |
|
297 |
) |
|
298 |
#(#InputFieldSpec |
|
299 |
#name: 'EntryField2' |
|
300 |
#layout: #(#LayoutFrame 10 0 133 0 305 0 155 0) |
|
301 |
#enableChannel: #notSearchForSameContents |
|
302 |
#tabable: true |
|
303 |
#model: #contentsPatternHolder |
|
304 |
) |
|
305 |
#(#CheckBoxSpec |
|
306 |
#name: 'CheckBox2' |
|
307 |
#layout: #(#LayoutFrame 6 0 163 0 142 0 185 0) |
|
308 |
#enableChannel: #notSearchForSameContents |
|
309 |
#tabable: true |
|
310 |
#model: #ignoreCaseInContents |
|
311 |
#label: 'Ignore case' |
|
312 |
#translateLabel: true |
|
313 |
) |
|
314 |
#(#LabelSpec |
|
315 |
#name: 'Label3' |
|
316 |
#layout: #(#LayoutFrame 0 0.0 223 0 -30 1.0 245 0) |
|
317 |
#label: 'Containing same contents as selected:' |
|
318 |
#translateLabel: true |
|
319 |
#adjust: #left |
|
320 |
) |
|
321 |
#(#DividerSpec |
|
322 |
#name: 'Separator1' |
|
323 |
#layout: #(#LayoutFrame 0 0.0 97 0 0 1.0 101 0) |
|
324 |
) |
|
325 |
#(#CheckToggleSpec |
|
326 |
#name: 'CheckToggle1' |
|
327 |
#layout: #(#LayoutOrigin -25 1 225 0) |
|
328 |
#tabable: true |
|
329 |
#model: #searchForSameContents |
|
330 |
#enableChannel: #searchForSameContentsEnabled |
|
331 |
#isTriggerOnDown: true |
|
332 |
#showLamp: false |
|
333 |
#lampColor: #(#Color 100.0 100.0 0.0) |
|
334 |
) |
|
335 |
#(#HorizontalPanelViewSpec |
|
336 |
#name: 'HorizontalPanel1' |
|
337 |
#layout: #(#LayoutFrame 0 0.0 -30 1 0 1.0 0 1.0) |
|
338 |
#component: |
|
339 |
#(#SpecCollection |
|
340 |
#collection: |
|
341 |
#( |
|
342 |
#(#ActionButtonSpec |
|
343 |
#name: 'Button1' |
|
344 |
#label: 'Cancel' |
|
345 |
#translateLabel: true |
|
346 |
#tabable: true |
|
347 |
#model: #cancel |
|
348 |
#extent: #(#Point 151 25) |
|
349 |
) |
|
350 |
#(#ActionButtonSpec |
|
351 |
#name: 'Button2' |
|
352 |
#label: 'Search' |
|
353 |
#translateLabel: true |
|
354 |
#tabable: true |
|
355 |
#model: #accept |
|
356 |
#isDefault: true |
|
357 |
#extent: #(#Point 152 25) |
|
358 |
) |
|
359 |
) |
|
360 |
) |
|
361 |
#horizontalLayout: #fitSpace |
|
362 |
#verticalLayout: #centerMax |
|
363 |
#horizontalSpace: 3 |
|
364 |
#verticalSpace: 3 |
|
365 |
) |
|
366 |
) |
|
367 |
) |
|
1933 | 368 |
) |
369 |
! ! |
|
370 |
||
1834 | 371 |
!FileBrowser class methodsFor:'menu specs'! |
372 |
||
373 |
baseDirectoryMenuSpec |
|
374 |
"This resource specification was automatically generated |
|
375 |
by the MenuEditor of ST/X." |
|
376 |
||
377 |
"Do not manually edit this!! If it is corrupted, |
|
378 |
the MenuEditor may not be able to read the specification." |
|
379 |
||
380 |
" |
|
381 |
MenuEditor new openOnClass:FileBrowser andSelector:#directoryMenuSpec |
|
382 |
(Menu new fromLiteralArrayEncoding:(FileBrowser directoryMenuSpec)) startUp |
|
383 |
" |
|
384 |
||
385 |
<resource: #menu> |
|
386 |
||
387 |
^ |
|
388 |
||
389 |
#(#Menu |
|
390 |
||
1868 | 391 |
#( |
392 |
#(#MenuItem |
|
393 |
#label: 'Copy Path' |
|
394 |
#translateLabel: true |
|
395 |
#value: #copyPath |
|
396 |
) |
|
397 |
#(#MenuItem |
|
398 |
#label: '-' |
|
399 |
) |
|
400 |
#(#MenuItem |
|
401 |
#label: 'Up' |
|
402 |
#translateLabel: true |
|
403 |
#value: #changeToParentDirectory |
|
404 |
#enabled: #currentDirectoryIsNotTop |
|
405 |
) |
|
406 |
#(#MenuItem |
|
407 |
#label: 'Back' |
|
408 |
#translateLabel: true |
|
409 |
#value: #changeToPreviousDirectory |
|
410 |
) |
|
411 |
#(#MenuItem |
|
412 |
#label: 'Home' |
|
413 |
#translateLabel: true |
|
414 |
#value: #changeToHomeDirectory |
|
415 |
) |
|
416 |
#(#MenuItem |
|
417 |
#label: 'Default' |
|
418 |
#translateLabel: true |
|
419 |
#value: #changeToDefaultDirectory |
|
420 |
) |
|
421 |
#(#MenuItem |
|
422 |
#label: 'Goto...' |
|
423 |
#translateLabel: true |
|
424 |
#value: #changeCurrentDirectory |
|
425 |
) |
|
426 |
) nil |
|
427 |
nil |
|
1834 | 428 |
) |
429 |
||
430 |
"Created: / 4.8.1998 / 17:21:16 / cg" |
|
1835 | 431 |
"Modified: / 14.8.1998 / 19:19:06 / cg" |
1834 | 432 |
! |
433 |
||
434 |
directoryMenuSpec |
|
435 |
"This resource specification was automatically generated |
|
436 |
by the MenuEditor of ST/X." |
|
437 |
||
438 |
"Do not manually edit this!! If it is corrupted, |
|
439 |
the MenuEditor may not be able to read the specification." |
|
440 |
||
441 |
" |
|
442 |
MenuEditor new openOnClass:FileBrowser andSelector:#directoryMenuSpec |
|
443 |
(Menu new fromLiteralArrayEncoding:(FileBrowser directoryMenuSpec)) startUp |
|
444 |
" |
|
445 |
||
446 |
<resource: #programMenu> |
|
447 |
||
2035
307ed5143d8b
national language stuff - again
Claus Gittinger <cg@exept.de>
parents:
2031
diff
changeset
|
448 |
|m| |
307ed5143d8b
national language stuff - again
Claus Gittinger <cg@exept.de>
parents:
2031
diff
changeset
|
449 |
|
307ed5143d8b
national language stuff - again
Claus Gittinger <cg@exept.de>
parents:
2031
diff
changeset
|
450 |
m := self baseDirectoryMenuSpec. |
307ed5143d8b
national language stuff - again
Claus Gittinger <cg@exept.de>
parents:
2031
diff
changeset
|
451 |
m := m decodeAsLiteralArray. |
1834 | 452 |
|
453 |
"/ add the history items ... |
|
454 |
||
1835 | 455 |
DirectoryHistory size > 0 ifTrue:[ |
2138 | 456 |
m addItem:(MenuItem labeled:'-'). |
457 |
DirectoryHistory do:[:dirName | |
|
458 |
m addItem:((MenuItem label:dirName value:#changeDirectoryTo:) |
|
459 |
argument:dirName; |
|
460 |
yourself). |
|
461 |
]. |
|
1834 | 462 |
]. |
463 |
||
2035
307ed5143d8b
national language stuff - again
Claus Gittinger <cg@exept.de>
parents:
2031
diff
changeset
|
464 |
m findGuiResourcesIn:self. |
307ed5143d8b
national language stuff - again
Claus Gittinger <cg@exept.de>
parents:
2031
diff
changeset
|
465 |
^ m |
1834 | 466 |
|
1837 | 467 |
"Modified: / 17.8.1998 / 10:13:05 / cg" |
1834 | 468 |
! |
469 |
||
470 |
menuPopUp |
|
471 |
"This resource specification was automatically generated |
|
472 |
by the MenuEditor of ST/X." |
|
473 |
||
474 |
"Do not manually edit this!! If it is corrupted, |
|
475 |
the MenuEditor may not be able to read the specification." |
|
476 |
||
477 |
" |
|
478 |
MenuEditor new openOnClass:FileBrowser andSelector:#menuPopUp |
|
479 |
(Menu new fromLiteralArrayEncoding:(FileBrowser menuPopUp)) startUp |
|
480 |
" |
|
481 |
||
482 |
<resource: #menu> |
|
483 |
||
2185 | 484 |
^ |
485 |
#(#Menu |
|
486 |
#( |
|
487 |
#(#MenuItem |
|
488 |
#label: 'Spawn' |
|
489 |
#translateLabel: true |
|
490 |
#value: #fileSpawn |
|
491 |
) |
|
492 |
#(#MenuItem |
|
493 |
#label: '-' |
|
494 |
) |
|
495 |
#(#MenuItem |
|
496 |
#label: 'Get Contents' |
|
497 |
#translateLabel: true |
|
498 |
#value: #fileGet |
|
499 |
#enabled: #hasSelection |
|
500 |
) |
|
501 |
#(#MenuItem |
|
502 |
#label: 'Insert Contents' |
|
503 |
#translateLabel: true |
|
504 |
#value: #fileInsert |
|
505 |
#enabled: #hasSelection |
|
506 |
) |
|
507 |
#(#MenuItem |
|
508 |
#label: 'FileIn' |
|
509 |
#translateLabel: true |
|
510 |
#value: #fileFileIn |
|
511 |
#enabled: #hasSelection |
|
512 |
) |
|
513 |
#(#MenuItem |
|
514 |
#label: '-' |
|
515 |
) |
|
516 |
#(#MenuItem |
|
517 |
#label: 'Unix Command...' |
|
518 |
#translateLabel: true |
|
519 |
#isVisible: #systemIsUnix |
|
520 |
#value: #menuOSCommand |
|
521 |
) |
|
522 |
#(#MenuItem |
|
523 |
#label: 'DOS Command...' |
|
524 |
#translateLabel: true |
|
525 |
#isVisible: #systemIsDOS |
|
526 |
#value: #menuOSCommand |
|
527 |
) |
|
528 |
#(#MenuItem |
|
529 |
#label: 'VMS Command...' |
|
530 |
#translateLabel: true |
|
531 |
#isVisible: #systemIsVMS |
|
532 |
#value: #menuOSCommand |
|
533 |
) |
|
534 |
#(#MenuItem |
|
535 |
#label: 'ST/X Tools' |
|
536 |
#translateLabel: true |
|
537 |
#submenu: |
|
538 |
#(#Menu |
|
539 |
#( |
|
540 |
#(#MenuItem |
|
541 |
#label: 'Changes Browser' |
|
542 |
#translateLabel: true |
|
543 |
#value: #openChangesBrowser |
|
544 |
#enabled: #hasSelection |
|
545 |
) |
|
546 |
#(#MenuItem |
|
547 |
#label: 'Editor' |
|
548 |
#translateLabel: true |
|
549 |
#value: #openEditor |
|
550 |
#enabled: #hasSelection |
|
551 |
) |
|
552 |
#(#MenuItem |
|
553 |
#label: 'HTML Reader' |
|
554 |
#translateLabel: true |
|
555 |
#value: #openHTMLReader |
|
556 |
#enabled: #hasSelection |
|
557 |
) |
|
558 |
#(#MenuItem |
|
559 |
#label: 'ASN1 Browser' |
|
560 |
#translateLabel: true |
|
561 |
#isVisible: #hasASN1Browser |
|
562 |
#value: #openASN1Browser |
|
563 |
#enabled: #hasASN1AndSelection |
|
564 |
) |
|
565 |
#(#MenuItem |
|
566 |
#label: 'Applet Viewer' |
|
567 |
#translateLabel: true |
|
568 |
#isVisible: #hasJava |
|
569 |
#value: #openAppletViewer |
|
570 |
#enabled: #hasJavaAndSelection |
|
571 |
) |
|
572 |
#(#MenuItem |
|
573 |
#label: 'Image Inspect' |
|
574 |
#translateLabel: true |
|
575 |
#value: #openImageInspector |
|
576 |
#enabled: #hasSelection |
|
577 |
) |
|
578 |
#(#MenuItem |
|
579 |
#label: 'Image Preview' |
|
580 |
#translateLabel: true |
|
581 |
#value: #openImagePreview |
|
582 |
#enabled: #hasSelection |
|
583 |
) |
|
584 |
#(#MenuItem |
|
585 |
#label: 'Image Editor' |
|
586 |
#translateLabel: true |
|
587 |
#value: #openImageEditor |
|
588 |
#enabled: #hasSelection |
|
589 |
) |
|
590 |
#(#MenuItem |
|
591 |
#label: 'ZipFile Tool' |
|
592 |
#translateLabel: true |
|
593 |
#value: #openZipTool |
|
594 |
#enabled: #hasZipFileSelected |
|
595 |
) |
|
596 |
#(#MenuItem |
|
597 |
#label: 'Hex Dump' |
|
598 |
#translateLabel: true |
|
599 |
#value: #fileHexDump |
|
600 |
) |
|
601 |
#(#MenuItem |
|
602 |
#label: 'Show File Differences' |
|
603 |
#translateLabel: true |
|
604 |
#value: #openDiffView |
|
605 |
) |
|
606 |
#(#MenuItem |
|
607 |
#label: 'Terminal' |
|
608 |
#translateLabel: true |
|
609 |
#isVisible: #systemIsUnix |
|
610 |
#value: #openTerminal |
|
611 |
#enabled: #systemIsUnix |
|
612 |
) |
|
613 |
) |
|
614 |
nil |
|
615 |
nil |
|
616 |
) |
|
617 |
) |
|
618 |
#(#MenuItem |
|
619 |
#label: '-' |
|
620 |
) |
|
621 |
#(#MenuItem |
|
622 |
#label: 'Remove...' |
|
623 |
#translateLabel: true |
|
624 |
#value: #fileRemove |
|
625 |
#enabled: #hasSelection |
|
626 |
) |
|
627 |
#(#MenuItem |
|
628 |
#label: 'Rename...' |
|
629 |
#translateLabel: true |
|
630 |
#value: #fileRename |
|
631 |
#enabled: #hasSelection |
|
632 |
) |
|
633 |
#(#MenuItem |
|
634 |
#label: '-' |
|
635 |
) |
|
636 |
#(#MenuItem |
|
637 |
#label: 'New Directory...' |
|
638 |
#translateLabel: true |
|
639 |
#value: #newDirectory |
|
640 |
) |
|
641 |
#(#MenuItem |
|
642 |
#label: 'New File...' |
|
643 |
#translateLabel: true |
|
644 |
#value: #newFile |
|
645 |
) |
|
646 |
#(#MenuItem |
|
647 |
#label: '-' |
|
648 |
) |
|
649 |
#(#MenuItem |
|
650 |
#label: 'Update' |
|
651 |
#translateLabel: true |
|
652 |
#value: #updateCurrentDirectory |
|
653 |
) |
|
654 |
) |
|
655 |
nil |
|
656 |
nil |
|
1834 | 657 |
) |
658 |
! |
|
659 |
||
660 |
menuSpec |
|
661 |
"This resource specification was automatically generated |
|
662 |
by the MenuEditor of ST/X." |
|
663 |
||
664 |
"Do not manually edit this!! If it is corrupted, |
|
665 |
the MenuEditor may not be able to read the specification." |
|
666 |
||
667 |
" |
|
668 |
MenuEditor new openOnClass:FileBrowser andSelector:#menuSpec |
|
669 |
(Menu new fromLiteralArrayEncoding:(FileBrowser menuSpec)) startUp |
|
670 |
" |
|
671 |
||
672 |
<resource: #menu> |
|
673 |
||
2102 | 674 |
^ |
675 |
#(#Menu |
|
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
676 |
#( |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
677 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
678 |
#label: 'About' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
679 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
680 |
#labelImage: #(#ResourceRetriever #ToolApplicationModel #menuIcon) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
681 |
#submenu: |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
682 |
#(#Menu |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
683 |
#( |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
684 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
685 |
#label: 'About Smalltalk/X...' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
686 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
687 |
#value: #showAboutSTX |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
688 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
689 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
690 |
#label: '-' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
691 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
692 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
693 |
#label: 'About FileBrowser...' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
694 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
695 |
#value: #openAboutThisApplication |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
696 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
697 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
698 |
nil |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
699 |
nil |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
700 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
701 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
702 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
703 |
#label: 'File' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
704 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
705 |
#submenu: |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
706 |
#(#Menu |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
707 |
#( |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
708 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
709 |
#label: 'Open' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
710 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
711 |
#value: #menuOpen |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
712 |
#enabled: #hasSelection |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
713 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
714 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
715 |
#label: 'Open selected Filename' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
716 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
717 |
#isVisible: #hasFilenameSelectionInCodeView |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
718 |
#value: #openSelectedFilename |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
719 |
#enabled: #hasFilenameSelectionInCodeView |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
720 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
721 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
722 |
#label: 'FileIn' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
723 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
724 |
#value: #fileFileIn |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
725 |
#enabled: #hasSelection |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
726 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
727 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
728 |
#label: '-' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
729 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
730 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
731 |
#label: 'New' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
732 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
733 |
#submenu: |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
734 |
#(#Menu |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
735 |
#( |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
736 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
737 |
#label: 'Directory...' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
738 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
739 |
#value: #newDirectory |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
740 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
741 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
742 |
#label: 'File...' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
743 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
744 |
#value: #newFile |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
745 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
746 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
747 |
#label: 'Hard Link...' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
748 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
749 |
#isVisible: #systemIsUnix |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
750 |
#value: #newHardLink |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
751 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
752 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
753 |
#label: 'Symbolic Link...' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
754 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
755 |
#isVisible: #systemIsUnix |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
756 |
#value: #newSoftLink |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
757 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
758 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
759 |
nil |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
760 |
nil |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
761 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
762 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
763 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
764 |
#label: 'Remove' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
765 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
766 |
#value: #fileRemove |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
767 |
#enabled: #hasSelection |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
768 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
769 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
770 |
#label: 'Rename' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
771 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
772 |
#value: #fileRename |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
773 |
#enabled: #hasSelection |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
774 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
775 |
#(#MenuItem |
2143 | 776 |
#label: '-' |
777 |
) |
|
778 |
#(#MenuItem |
|
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
779 |
#label: 'Properties...' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
780 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
781 |
#value: #fileGetLongInfo |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
782 |
#enabled: #hasSelection |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
783 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
784 |
#(#MenuItem |
2143 | 785 |
#label: 'Encoding...' |
786 |
#translateLabel: true |
|
787 |
#value: #fileEncoding |
|
788 |
) |
|
789 |
#(#MenuItem |
|
790 |
#label: 'DOS EndOfLine Mode' |
|
791 |
#translateLabel: true |
|
792 |
#indication: #dosEOLMode |
|
793 |
) |
|
794 |
#(#MenuItem |
|
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
795 |
#label: '-' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
796 |
#isVisible: #javaSupportLoaded |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
797 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
798 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
799 |
#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
|
800 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
801 |
#isVisible: #javaSupportLoaded |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
802 |
#value: #fileAddToJavaClassPath |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
803 |
#enabled: #canAddToClassPath |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
804 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
805 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
806 |
#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
|
807 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
808 |
#isVisible: #javaSupportLoaded |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
809 |
#value: #fileRemoveFromJavaClassPath |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
810 |
#enabled: #canRemoveToClassPath |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
811 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
812 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
813 |
#label: '-' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
814 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
815 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
816 |
#label: 'Spawn' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
817 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
818 |
#value: #fileSpawn |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
819 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
820 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
821 |
#label: '-' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
822 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
823 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
824 |
#label: 'Exit' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
825 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
826 |
#value: #menuExit |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
827 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
828 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
829 |
nil |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
830 |
nil |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
831 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
832 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
833 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
834 |
#label: 'Directory' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
835 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
836 |
#submenuChannel: #directoryMenuSpec |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
837 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
838 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
839 |
#label: 'Edit' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
840 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
841 |
#submenu: |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
842 |
#(#Menu |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
843 |
#( |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
844 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
845 |
#label: 'Get Contents' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
846 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
847 |
#value: #fileGet |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
848 |
#enabled: #hasSelection |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
849 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
850 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
851 |
#label: 'Insert Contents' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
852 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
853 |
#value: #fileInsert |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
854 |
#enabled: #hasSelection |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
855 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
856 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
857 |
#label: '-' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
858 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
859 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
860 |
#label: 'Copy File List' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
861 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
862 |
#value: #copyFileList |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
863 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
864 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
865 |
#label: 'Copy Selected Filename' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
866 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
867 |
#value: #copySelectedFileName |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
868 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
869 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
870 |
#label: 'Copy Command History' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
871 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
872 |
#value: #copyCommandHistory |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
873 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
874 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
875 |
nil |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
876 |
nil |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
877 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
878 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
879 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
880 |
#label: 'View' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
881 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
882 |
#submenu: |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
883 |
#(#Menu |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
884 |
#( |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
885 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
886 |
#label: 'Details' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
887 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
888 |
#indication: #showingDetails |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
889 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
890 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
891 |
#label: 'Show Hidden Files' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
892 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
893 |
#indication: #showingHiddenFiles |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
894 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
895 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
896 |
#label: 'Big Image Preview' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
897 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
898 |
#indication: #showingBigImagePreview |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
899 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
900 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
901 |
#label: '-' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
902 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
903 |
#(#MenuItem |
2155 | 904 |
#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
|
905 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
906 |
#choice: #sortByWhat |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
907 |
#choiceValue: #name |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
908 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
909 |
#(#MenuItem |
2155 | 910 |
#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
|
911 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
912 |
#choice: #sortByWhat |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
913 |
#choiceValue: #type |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
914 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
915 |
#(#MenuItem |
2155 | 916 |
#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
|
917 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
918 |
#choice: #sortByWhat |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
919 |
#choiceValue: #time |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
920 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
921 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
922 |
#label: 'Ignore Case' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
923 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
924 |
#enabled: #sortByName |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
925 |
#indication: #sortCaseless |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
926 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
927 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
928 |
#label: '-' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
929 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
930 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
931 |
#label: 'Update' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
932 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
933 |
#value: #updateCurrentDirectory |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
934 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
935 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
936 |
nil |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
937 |
nil |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
938 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
939 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
940 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
941 |
#label: 'Tools' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
942 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
943 |
#submenu: |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
944 |
#(#Menu |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
945 |
#( |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
946 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
947 |
#label: 'Unix Command' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
948 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
949 |
#isVisible: #systemIsUnix |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
950 |
#value: #menuOSCommand |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
951 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
952 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
953 |
#label: 'DOS Command' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
954 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
955 |
#isVisible: #systemIsDOS |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
956 |
#value: #menuOSCommand |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
957 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
958 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
959 |
#label: 'VMS Command' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
960 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
961 |
#isVisible: #systemIsVMS |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
962 |
#value: #menuOSCommand |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
963 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
964 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
965 |
#label: '-' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
966 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
967 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
968 |
#label: 'Changes Browser' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
969 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
970 |
#value: #openChangesBrowser |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
971 |
#enabled: #hasSelection |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
972 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
973 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
974 |
#label: 'Editor' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
975 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
976 |
#value: #openEditor |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
977 |
#enabled: #hasSelection |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
978 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
979 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
980 |
#label: 'HTML Reader' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
981 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
982 |
#value: #openHTMLReader |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
983 |
#enabled: #hasSelection |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
984 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
985 |
#(#MenuItem |
2185 | 986 |
#label: 'ASN1 Browser' |
987 |
#translateLabel: true |
|
988 |
#isVisible: #hasASN1 |
|
989 |
#value: #openASN1Browser |
|
990 |
#enabled: #hasASN1AndSelection |
|
991 |
) |
|
992 |
#(#MenuItem |
|
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
993 |
#label: 'Applet Viewer' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
994 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
995 |
#isVisible: #hasJava |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
996 |
#value: #openAppletViewer |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
997 |
#enabled: #hasJavaAndSelection |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
998 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
999 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1000 |
#label: 'Image Inspector' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1001 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1002 |
#value: #openImageInspector |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1003 |
#enabled: #hasSelection |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1004 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1005 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1006 |
#label: 'Image Preview' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1007 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1008 |
#value: #openImagePreview |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1009 |
#enabled: #hasSelection |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1010 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1011 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1012 |
#label: 'Image Editor' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1013 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1014 |
#value: #openImageEditor |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1015 |
#enabled: #hasSelection |
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: 'ZipFile Tool' |
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: #openZipTool |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1021 |
#enabled: #hasZipFileSelected |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1022 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1023 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1024 |
#label: 'File Differences...' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1025 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1026 |
#value: #openDiffView |
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: 'Find Duplicate Files' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1030 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1031 |
#value: #fileFindDuplicates |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1032 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1033 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1034 |
#label: 'Find All Duplicate Files (recursive)' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1035 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1036 |
#value: #fileFindAllDuplicates |
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 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1039 |
#label: 'Find a File...' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1040 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1041 |
#value: #fileFindFile |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1042 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1043 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1044 |
#label: 'Hex Dump' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1045 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1046 |
#value: #fileHexDump |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1047 |
#enabled: #hasSelection |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1048 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1049 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1050 |
#label: 'Shell Terminal' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1051 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1052 |
#isVisible: #canDoTerminal |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1053 |
#value: #openTerminal |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1054 |
#enabled: #canDoTerminal |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1055 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1056 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1057 |
nil |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1058 |
nil |
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 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1061 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1062 |
#label: 'CVS' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1063 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1064 |
#submenu: |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1065 |
#(#Menu |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1066 |
#( |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1067 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1068 |
#label: 'Update selected files/directories' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1069 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1070 |
#value: #cvsUpdateSelection |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1071 |
#enabled: #hasSelection |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1072 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1073 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1074 |
#label: 'Update directory local' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1075 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1076 |
#value: #cvsUpdateDirectoryLocal |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1077 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1078 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1079 |
#label: 'Update directory recursive' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1080 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1081 |
#value: #cvsUpdateDirectoryRecursive |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1082 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1083 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1084 |
#label: '-' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1085 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1086 |
#(#MenuItem |
2145 | 1087 |
#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
|
1088 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1089 |
#value: #cvsRemoveFileAndContainer |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1090 |
#enabled: #canRemoveCVSContainer |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1091 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1092 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1093 |
nil |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1094 |
nil |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1095 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1096 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1097 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1098 |
#label: 'Help' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1099 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1100 |
#startGroup: #right |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1101 |
#submenu: |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1102 |
#(#Menu |
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 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1105 |
#label: 'FileBrowser Documentation' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1106 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1107 |
#value: #openHTMLDocument: |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1108 |
#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
|
1109 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1110 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1111 |
nil |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1112 |
nil |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1113 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1114 |
) |
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 |
nil |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1117 |
nil |
1834 | 1118 |
) |
1119 |
! ! |
|
1120 |
||
2094 | 1121 |
!FileBrowser class methodsFor:'queries'! |
1122 |
||
1123 |
isVisualStartable |
|
1124 |
"return true, if this application can be started via #open" |
|
1125 |
||
1126 |
^ true |
|
1127 |
||
1128 |
||
1129 |
! ! |
|
1130 |
||
1834 | 1131 |
!FileBrowser methodsFor:'aspects'! |
1132 |
||
1893
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
1133 |
canAddToClassPath |
1988 | 1134 |
^ [ |f sel| |
1893
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
1135 |
|
2138 | 1136 |
(Java isNil or:[Java isLoaded not]) ifTrue:[ |
1137 |
false |
|
1138 |
] ifFalse:[ |
|
1139 |
sel := fileListView selection. |
|
1140 |
sel size > 1 ifTrue:[ |
|
1141 |
false |
|
1142 |
] ifFalse:[ |
|
1143 |
sel size == 0 ifTrue:[ |
|
1144 |
f := currentDirectory asFilename |
|
1145 |
] ifFalse:[ |
|
1146 |
f := fileList at:sel first ifAbsent:nil. |
|
1147 |
f notNil ifTrue:[ |
|
1148 |
f := currentDirectory asFilename construct:f |
|
1149 |
]. |
|
1150 |
]. |
|
1151 |
f notNil |
|
1152 |
and:[(Java classPath includes:f pathName) not |
|
1153 |
and:[f isDirectory |
|
1154 |
or:[(f hasSuffix:'jar') |
|
1155 |
or:[(f hasSuffix:'zip')]]]]. |
|
1156 |
] |
|
1157 |
] |
|
1893
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
1158 |
] |
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
1159 |
|
1989 | 1160 |
"Modified: / 1.2.1999 / 20:38:42 / cg" |
1893
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
1161 |
! |
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
1162 |
|
2129 | 1163 |
canDoTerminal |
1164 |
^ OperatingSystem isUNIXlike |
|
1165 |
or:[OperatingSystem isMSWINDOWSlike] |
|
1166 |
||
1167 |
"Created: / 4.8.1998 / 13:37:13 / cg" |
|
1168 |
"Modified: / 28.4.1999 / 11:54:17 / cg" |
|
1169 |
! |
|
1170 |
||
2101 | 1171 |
canRemoveCVSContainer |
1172 |
^ [ |cvsDir| |
|
1173 |
||
2138 | 1174 |
currentDirectory notNil |
1175 |
and:[fileListView selection size > 0 |
|
1176 |
and:[(cvsDir := currentDirectory construct:'CVS') exists |
|
1177 |
and:[cvsDir isDirectory]]]] |
|
2101 | 1178 |
! |
1179 |
||
1893
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
1180 |
canRemoveToClassPath |
1988 | 1181 |
^ [ |f sel| |
1893
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
1182 |
|
2138 | 1183 |
(Java isNil or:[Java isLoaded not]) ifTrue:[ |
1184 |
false |
|
1185 |
] ifFalse:[ |
|
1186 |
sel := fileListView selection. |
|
1187 |
sel size > 1 ifTrue:[ |
|
1188 |
false |
|
1189 |
] ifFalse:[ |
|
1190 |
sel size == 0 ifTrue:[ |
|
1191 |
f := currentDirectory asFilename |
|
1192 |
] ifFalse:[ |
|
1193 |
f := fileList at:sel first ifAbsent:nil. |
|
1194 |
f notNil ifTrue:[ |
|
1195 |
f := currentDirectory asFilename construct:f |
|
1196 |
]. |
|
1197 |
]. |
|
1198 |
f notNil |
|
1199 |
and:[(Java classPath includes:f pathName) |
|
1200 |
and:[f isDirectory |
|
1201 |
or:[(f hasSuffix:'jar') |
|
1202 |
or:[(f hasSuffix:'zip')]]]] |
|
1203 |
] |
|
1204 |
] |
|
1893
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
1205 |
] |
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
1206 |
|
1989 | 1207 |
"Modified: / 1.2.1999 / 20:39:25 / cg" |
1893
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
1208 |
! |
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
1209 |
|
1834 | 1210 |
currentDirectoryIsNotTop |
1211 |
^ [currentDirectory notNil and:[currentDirectory isRootDirectory not]] |
|
1212 |
||
1213 |
"Modified: / 4.8.1998 / 14:10:57 / cg" |
|
1214 |
"Created: / 14.8.1998 / 12:07:10 / cg" |
|
1215 |
! |
|
1216 |
||
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1217 |
dosEOLMode |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1218 |
^ dosEOLMode |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1219 |
|
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1220 |
"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
|
1221 |
"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
|
1222 |
! |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1223 |
|
2185 | 1224 |
hasASN1 |
1225 |
^ [ OSI::ASN1Parser notNil |
|
1226 |
and:[OSI::ASN1Parser isLoaded]] |
|
1227 |
||
1228 |
! |
|
1229 |
||
1230 |
hasASN1AndSelection |
|
1231 |
^ [ fileListView selection size > 0 |
|
1232 |
and:[OSI::ASN1Parser notNil |
|
1233 |
and:[OSI::ASN1Parser isLoaded]]] |
|
1234 |
! |
|
1235 |
||
1994 | 1236 |
hasFilenameSelectionInCodeView |
1237 |
^ [ |val sel| |
|
1238 |
||
2138 | 1239 |
val := false. |
1240 |
sel := subView selection. |
|
1241 |
sel notNil ifTrue:[ |
|
1242 |
sel := sel asString withoutSeparators. |
|
1243 |
sel asFilename exists ifTrue:[ |
|
1244 |
val := sel asFilename isReadable |
|
1245 |
] |
|
1246 |
]. |
|
1247 |
val |
|
1994 | 1248 |
] |
1249 |
||
1250 |
"Created: / 4.2.1999 / 17:34:57 / cg" |
|
1251 |
"Modified: / 4.2.1999 / 17:39:32 / cg" |
|
1252 |
! |
|
1253 |
||
1942 | 1254 |
hasJava |
1255 |
^ [ JavaClassReader notNil |
|
2138 | 1256 |
and:[JavaClassReader isLoaded]] |
1942 | 1257 |
|
1258 |
"Modified: / 17.10.1998 / 16:57:14 / cg" |
|
1259 |
"Created: / 17.10.1998 / 22:58:25 / cg" |
|
1260 |
! |
|
1261 |
||
1262 |
hasJavaAndSelection |
|
1263 |
^ [ fileListView selection size > 0 |
|
2138 | 1264 |
and:[JavaClassReader notNil |
1265 |
and:[JavaClassReader isLoaded]]] |
|
1942 | 1266 |
|
1267 |
"Modified: / 17.10.1998 / 16:57:14 / cg" |
|
1268 |
"Created: / 17.10.1998 / 22:58:03 / cg" |
|
1269 |
! |
|
1270 |
||
1834 | 1271 |
hasSelection |
1272 |
^ [fileListView selection size > 0] |
|
1273 |
||
1274 |
"Created: / 4.8.1998 / 14:10:31 / cg" |
|
1275 |
"Modified: / 4.8.1998 / 14:10:57 / cg" |
|
1276 |
! |
|
1277 |
||
1835 | 1278 |
hasVisitHistory |
1279 |
^ [DirectoryHistory size > 0] |
|
1280 |
||
1281 |
"Created: / 14.8.1998 / 19:17:02 / cg" |
|
1282 |
"Modified: / 14.8.1998 / 19:17:17 / cg" |
|
1283 |
! |
|
1284 |
||
1853 | 1285 |
hasZipFileSelected |
1988 | 1286 |
^ [|sel f fn suff| |
1287 |
||
2138 | 1288 |
sel := fileListView selection. |
1289 |
sel size == 1 ifTrue:[ |
|
1290 |
f := fileList at:sel first ifAbsent:nil. |
|
1291 |
f notNil ifTrue:[ |
|
1292 |
suff := f asFilename suffix asLowercase. |
|
1293 |
suff = 'zip' or:[suff = 'jar'] |
|
1294 |
] ifFalse:[ |
|
1295 |
false |
|
1296 |
] |
|
1297 |
] ifFalse:[ |
|
1298 |
false |
|
1299 |
] |
|
1853 | 1300 |
] |
1301 |
||
1302 |
"Created: / 26.8.1998 / 16:15:26 / cg" |
|
1988 | 1303 |
"Modified: / 30.1.1999 / 19:05:59 / cg" |
1853 | 1304 |
! |
1305 |
||
1893
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
1306 |
javaSupportLoaded |
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
1307 |
^ [ JavaClassReader notNil |
2138 | 1308 |
and:[JavaClassReader isLoaded]] |
1893
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
1309 |
|
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
1310 |
"Created: / 9.11.1998 / 05:33:17 / cg" |
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
1311 |
! |
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
1312 |
|
2031 | 1313 |
showingBigImagePreview |
1314 |
^ showingBigImagePreview |
|
1315 |
||
1316 |
"Created: / 14.8.1998 / 14:15:44 / cg" |
|
1317 |
! |
|
1318 |
||
1834 | 1319 |
showingDetails |
1320 |
^ showingDetails |
|
1321 |
||
1322 |
"Created: / 14.8.1998 / 14:15:15 / cg" |
|
1323 |
! |
|
1324 |
||
1325 |
showingHiddenFiles |
|
1326 |
^ showingHiddenFiles |
|
1327 |
||
1328 |
"Created: / 14.8.1998 / 14:15:44 / cg" |
|
1329 |
! |
|
1330 |
||
1331 |
sortByWhat |
|
1332 |
^ sortByWhat |
|
1333 |
||
1334 |
"Created: / 14.8.1998 / 15:55:18 / cg" |
|
1335 |
"Modified: / 14.8.1998 / 15:56:08 / cg" |
|
1336 |
! |
|
1337 |
||
1338 |
sortCaseless |
|
1339 |
^ sortCaseless |
|
1340 |
||
1341 |
"Created: / 14.8.1998 / 14:21:21 / cg" |
|
1342 |
! |
|
1343 |
||
1344 |
systemIsDOS |
|
1345 |
^ OperatingSystem isMSDOSlike |
|
1346 |
||
1347 |
"Created: / 4.8.1998 / 13:37:28 / cg" |
|
1348 |
! |
|
1349 |
||
1350 |
systemIsUnix |
|
1351 |
^ OperatingSystem isUNIXlike |
|
1352 |
||
1353 |
"Created: / 4.8.1998 / 13:37:13 / cg" |
|
1354 |
! |
|
1355 |
||
1356 |
systemIsVMS |
|
1357 |
^ OperatingSystem isVMSlike |
|
1358 |
||
1359 |
"Created: / 4.8.1998 / 13:37:37 / cg" |
|
1360 |
! ! |
|
1361 |
||
1119 | 1362 |
!FileBrowser methodsFor:'drag & drop'! |
172 | 1363 |
|
1132
bd2eda432e1d
drop arg is always a collection
Claus Gittinger <cg@exept.de>
parents:
1124
diff
changeset
|
1364 |
canDrop:aCollectionOfDropObjects |
1119 | 1365 |
"I accept fileObjects only" |
1366 |
||
1132
bd2eda432e1d
drop arg is always a collection
Claus Gittinger <cg@exept.de>
parents:
1124
diff
changeset
|
1367 |
aCollectionOfDropObjects do:[:aDropObject | |
1317 | 1368 |
aDropObject isFileObject ifFalse:[ |
1369 |
aDropObject isTextObject ifFalse:[^ false]. |
|
1370 |
] |
|
1122
970fc7e88639
support drag out of my list.
Claus Gittinger <cg@exept.de>
parents:
1120
diff
changeset
|
1371 |
]. |
1132
bd2eda432e1d
drop arg is always a collection
Claus Gittinger <cg@exept.de>
parents:
1124
diff
changeset
|
1372 |
^ true |
bd2eda432e1d
drop arg is always a collection
Claus Gittinger <cg@exept.de>
parents:
1124
diff
changeset
|
1373 |
|
bd2eda432e1d
drop arg is always a collection
Claus Gittinger <cg@exept.de>
parents:
1124
diff
changeset
|
1374 |
"Modified: 11.4.1997 / 12:41:59 / cg" |
1118 | 1375 |
! |
1376 |
||
1132
bd2eda432e1d
drop arg is always a collection
Claus Gittinger <cg@exept.de>
parents:
1124
diff
changeset
|
1377 |
drop:aCollectionOfDropObjects at:aPoint |
1122
970fc7e88639
support drag out of my list.
Claus Gittinger <cg@exept.de>
parents:
1120
diff
changeset
|
1378 |
"handle drops" |
970fc7e88639
support drag out of my list.
Claus Gittinger <cg@exept.de>
parents:
1120
diff
changeset
|
1379 |
|
1132
bd2eda432e1d
drop arg is always a collection
Claus Gittinger <cg@exept.de>
parents:
1124
diff
changeset
|
1380 |
aCollectionOfDropObjects do:[:aDropObject | |
1317 | 1381 |
self dropSingleObject:aDropObject at:aPoint |
1132
bd2eda432e1d
drop arg is always a collection
Claus Gittinger <cg@exept.de>
parents:
1124
diff
changeset
|
1382 |
] |
bd2eda432e1d
drop arg is always a collection
Claus Gittinger <cg@exept.de>
parents:
1124
diff
changeset
|
1383 |
|
bd2eda432e1d
drop arg is always a collection
Claus Gittinger <cg@exept.de>
parents:
1124
diff
changeset
|
1384 |
"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
|
1385 |
! |
970fc7e88639
support drag out of my list.
Claus Gittinger <cg@exept.de>
parents:
1120
diff
changeset
|
1386 |
|
970fc7e88639
support drag out of my list.
Claus Gittinger <cg@exept.de>
parents:
1120
diff
changeset
|
1387 |
dropSingleObject:someObject at:aPoint |
1119 | 1388 |
"handle drops; if its a directory, change to it. |
1124 | 1389 |
If its a file, change to its directory and select the file. |
1390 |
If its text, paste it into the codeView." |
|
1119 | 1391 |
|
1122
970fc7e88639
support drag out of my list.
Claus Gittinger <cg@exept.de>
parents:
1120
diff
changeset
|
1392 |
|newDir newFile| |
970fc7e88639
support drag out of my list.
Claus Gittinger <cg@exept.de>
parents:
1120
diff
changeset
|
1393 |
|
1124 | 1394 |
someObject isFileObject ifTrue:[ |
1317 | 1395 |
someObject isDirectory ifTrue:[ |
1396 |
newDir := someObject theObject pathName. |
|
1397 |
] ifFalse:[ |
|
1398 |
newDir := someObject theObject directoryName. |
|
1399 |
newFile := someObject theObject baseName. |
|
1400 |
]. |
|
1401 |
||
1402 |
newDir notNil ifTrue:[ |
|
1403 |
newDir ~= currentDirectory pathName ifTrue:[ |
|
1404 |
self changeDirectoryTo:newDir. |
|
1405 |
] |
|
1406 |
]. |
|
1407 |
newFile notNil ifTrue:[ |
|
1408 |
newFile ~= currentFileName ifTrue:[ |
|
1409 |
fileListView selection:(fileList indexOf:newFile). |
|
1410 |
self doFileGet:false. |
|
1411 |
] |
|
1412 |
]. |
|
1413 |
^ self |
|
1122
970fc7e88639
support drag out of my list.
Claus Gittinger <cg@exept.de>
parents:
1120
diff
changeset
|
1414 |
]. |
970fc7e88639
support drag out of my list.
Claus Gittinger <cg@exept.de>
parents:
1120
diff
changeset
|
1415 |
|
1124 | 1416 |
someObject isTextObject ifTrue:[ |
1317 | 1417 |
subView paste:someObject theObject. |
1418 |
^ self |
|
1118 | 1419 |
]. |
1124 | 1420 |
|
1421 |
"Modified: 6.4.1997 / 14:46:44 / cg" |
|
1119 | 1422 |
! ! |
1423 |
||
1424 |
!FileBrowser methodsFor:'events'! |
|
1118 | 1425 |
|
1010 | 1426 |
handlesKeyPress:key inView:view |
1427 |
"this method is reached via delegation: are we prepared to handle |
|
1428 |
a keyPress in some other view ?" |
|
1429 |
||
1396 | 1430 |
<resource: #keyboard (#GotoLine #InspectIt #CmdI #Cmdu #DoIt #Delete #BackSpace #Accept #CmdF #CmdD)> |
1010 | 1431 |
|
1432 |
view == fileListView ifTrue:[ |
|
1418 | 1433 |
(key == #Delete |
1434 |
or:[key == #BackSpace |
|
1435 |
or:[key == #Accept |
|
1436 |
or:[key == #CmdI |
|
1437 |
or:[key == #CmdF |
|
1438 |
or:[key == #CmdD |
|
1439 |
or:[key == #Cmdu |
|
1440 |
or:[key == #InspectIt |
|
1441 |
or:[key == #GotoLine |
|
1442 |
or:[key == #DoIt]]]]]]]]]) ifTrue:[^ true]. |
|
1010 | 1443 |
]. |
1444 |
^ false |
|
1445 |
||
1396 | 1446 |
"Created: / 28.1.1997 / 14:03:20 / stefan" |
1447 |
"Modified: / 20.6.1997 / 16:35:01 / cg" |
|
1448 |
"Modified: / 16.1.1998 / 16:50:39 / stefan" |
|
1010 | 1449 |
! |
1450 |
||
1451 |
keyPress:key x:x y:y view:view |
|
1452 |
"this method is reached via delegation from the fileListView" |
|
1453 |
||
1454 |
<resource: #keyboard (#GotoLine #InspectIt #CmdI #Cmdu #DoIt #Delete #BackSpace #Accept)> |
|
1455 |
||
1456 |
(key == #Delete or:[key == #BackSpace]) ifTrue:[ |
|
1418 | 1457 |
self fileRemove. |
1458 |
^ self |
|
1010 | 1459 |
]. |
1460 |
(key == #Accept) ifTrue:[ |
|
1418 | 1461 |
self fileFileIn. |
1462 |
^ self |
|
1010 | 1463 |
]. |
1464 |
(key == #GotoLine) ifTrue:[ |
|
1418 | 1465 |
self fileGet. |
1466 |
^ self |
|
1010 | 1467 |
]. |
1468 |
(key == #DoIt) ifTrue:[ |
|
1418 | 1469 |
self fileExecute. |
1470 |
^ self |
|
1010 | 1471 |
]. |
1472 |
(key == #InspectIt) ifTrue:[ |
|
1418 | 1473 |
self fileGetInfo. |
1474 |
^ self |
|
1010 | 1475 |
]. |
1476 |
(key == #CmdI) ifTrue:[ |
|
1418 | 1477 |
self fileGetLongInfo. |
1478 |
^ self |
|
1010 | 1479 |
]. |
1480 |
(key == #Cmdu) ifTrue:[ |
|
1418 | 1481 |
self updateCurrentDirectory. |
1482 |
^ self |
|
1396 | 1483 |
]. |
1484 |
(key == #CmdF) ifTrue:[ |
|
1418 | 1485 |
self newFile. |
1486 |
^ self |
|
1396 | 1487 |
]. |
1488 |
(key == #CmdD) ifTrue:[ |
|
1418 | 1489 |
self newDirectory. |
1490 |
^ self |
|
1010 | 1491 |
]. |
1492 |
fileListView keyPress:key x:x y:y |
|
1493 |
||
1396 | 1494 |
"Created: / 28.1.1997 / 14:03:56 / stefan" |
1495 |
"Modified: / 20.6.1997 / 16:35:08 / cg" |
|
1496 |
"Modified: / 16.1.1998 / 16:51:38 / stefan" |
|
1010 | 1497 |
! |
1498 |
||
172 | 1499 |
mapped |
1500 |
super mapped. |
|
1501 |
" |
|
1502 |
whant to know about changed history |
|
1503 |
" |
|
1504 |
self updateCurrentDirectory |
|
1505 |
! |
|
1506 |
||
1507 |
visibilityChange:how |
|
1508 |
|wasVisible| |
|
1509 |
||
1510 |
wasVisible := shown. |
|
1511 |
super visibilityChange:how. |
|
1512 |
(wasVisible not and:[shown]) ifTrue:[ |
|
1868 | 1513 |
" |
1514 |
start checking again |
|
1515 |
" |
|
1516 |
Processor removeTimedBlock:checkBlock. |
|
1517 |
Processor addTimedBlock:checkBlock afterSeconds:checkDelta. |
|
172 | 1518 |
] |
1481 | 1519 |
|
1520 |
"Modified: / 18.2.1998 / 17:57:44 / cg" |
|
172 | 1521 |
! ! |
1522 |
||
1523 |
!FileBrowser methodsFor:'fileList user interaction'! |
|
1524 |
||
2031 | 1525 |
bigImagePreviewSettingChanged |
1526 |
"invoked, when big image preview flag changed" |
|
1527 |
||
1528 |
|fh| |
|
1529 |
||
1530 |
(showingBigImagePreview value == true |
|
1531 |
and:[showingDetails value == true]) ifTrue:[ |
|
2138 | 1532 |
fh := fileListView font height. |
1533 |
fileListView lineSpacing:(34 - fh max:0). |
|
2031 | 1534 |
] ifFalse:[ |
2138 | 1535 |
fileListView clear. |
1536 |
self updateCurrentDirectory. |
|
1537 |
fileListView lineSpacing:2. |
|
2031 | 1538 |
]. |
1539 |
fileListView clear. |
|
1540 |
self updateCurrentDirectory |
|
1541 |
||
1542 |
"Modified: / 4.8.1998 / 13:43:54 / cg" |
|
1543 |
"Created: / 14.8.1998 / 14:17:49 / cg" |
|
1544 |
! |
|
1545 |
||
172 | 1546 |
changeDisplayMode |
1547 |
"toggle from long to short listing (and vice-versa)" |
|
1548 |
||
1834 | 1549 |
showingDetails value:(showingDetails value not). |
1550 |
"/ showLongList := showLongList not. |
|
1156
f3df28086973
dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents:
1154
diff
changeset
|
1551 |
self showOrHideTabView. |
172 | 1552 |
self updateCurrentDirectory |
747 | 1553 |
|
1834 | 1554 |
"Modified: / 4.8.1998 / 13:43:54 / cg" |
172 | 1555 |
! |
1556 |
||
1557 |
changeDotFileVisibility |
|
1558 |
"turn on/off visibility of files whose name starts with '.'" |
|
1559 |
||
1834 | 1560 |
showingHiddenFiles value:(showingHiddenFiles value not). |
1561 |
"/ showDotFiles := showDotFiles not. |
|
172 | 1562 |
self updateCurrentDirectory |
1834 | 1563 |
|
1564 |
"Modified: / 4.8.1998 / 13:45:46 / cg" |
|
1565 |
! |
|
1566 |
||
1567 |
detailsSettingChanged |
|
1568 |
"invoked, when detail (i.e. long / short) listing flag changed" |
|
1569 |
||
1570 |
self showOrHideTabView. |
|
2031 | 1571 |
self bigImagePreviewSettingChanged |
1834 | 1572 |
|
1573 |
"Modified: / 4.8.1998 / 13:43:54 / cg" |
|
1574 |
"Created: / 14.8.1998 / 14:17:49 / cg" |
|
172 | 1575 |
! |
1576 |
||
1327 | 1577 |
fileDoubleClick:lineNr |
1578 |
"double click on a file - get its contents" |
|
1579 |
||
1580 |
self fileSelect:lineNr. |
|
1581 |
self fileGet:true |
|
1582 |
! |
|
1583 |
||
386
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
1584 |
fileEncoding |
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
1585 |
"open a dialog to allow change of the files character encoding. |
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
1586 |
Files are converted to internal encoding when read, and converted back |
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
1587 |
to this encoding when saved. |
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
1588 |
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
|
1589 |
the internal encoding (which is iso8859). |
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
1590 |
Notice: currently, not too many encodings are supported by the system." |
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
1591 |
|
495
6d6a6b8feb2b
ask characterArray for encodings
Claus Gittinger <cg@exept.de>
parents:
488
diff
changeset
|
1592 |
|dialog list descr encodings encodingNames idx| |
386
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
1593 |
|
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
1594 |
list := SelectionInList new. |
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
1595 |
|
495
6d6a6b8feb2b
ask characterArray for encodings
Claus Gittinger <cg@exept.de>
parents:
488
diff
changeset
|
1596 |
descr := CharacterArray supportedExternalEncodings. |
6d6a6b8feb2b
ask characterArray for encodings
Claus Gittinger <cg@exept.de>
parents:
488
diff
changeset
|
1597 |
encodings := descr at:2. |
6d6a6b8feb2b
ask characterArray for encodings
Claus Gittinger <cg@exept.de>
parents:
488
diff
changeset
|
1598 |
encodingNames := descr at:1. |
6d6a6b8feb2b
ask characterArray for encodings
Claus Gittinger <cg@exept.de>
parents:
488
diff
changeset
|
1599 |
|
6d6a6b8feb2b
ask characterArray for encodings
Claus Gittinger <cg@exept.de>
parents:
488
diff
changeset
|
1600 |
list list:encodingNames. |
386
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
1601 |
list selectionIndex:(encodings indexOf:fileEncoding ifAbsent:1). |
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
1602 |
|
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
1603 |
dialog := Dialog new. |
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
1604 |
|
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
1605 |
dialog addTextLabel:(resources string:'ENCODING_MSG') withCRs. |
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
1606 |
dialog addVerticalSpace. |
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
1607 |
dialog addListBoxOn:list withNumberOfLines:5. |
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
1608 |
|
2048 | 1609 |
dialog addAbortAndOkButtons. |
386
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
1610 |
dialog open. |
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
1611 |
|
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
1612 |
dialog accepted ifTrue:[ |
2138 | 1613 |
idx := list selectionIndex. |
1614 |
fileEncoding := encodings at:idx. |
|
1615 |
subView externalEncoding:fileEncoding. |
|
1616 |
||
1617 |
self validateFontEncodingFor:fileEncoding ask:true. |
|
386
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
1618 |
]. |
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
1619 |
|
1219 | 1620 |
"Modified: 30.6.1997 / 14:41:12 / cg" |
386
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
1621 |
! |
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
1622 |
|
172 | 1623 |
fileExecute |
1624 |
"if text was modified show a queryBox, |
|
1625 |
otherwise pop up execute box immediately" |
|
1626 |
||
1142
9066d7d02a3a
remember last executed command per suffix; offer this as default.
Claus Gittinger <cg@exept.de>
parents:
1141
diff
changeset
|
1627 |
|action sel fileName| |
172 | 1628 |
|
1629 |
" |
|
1630 |
this replaces everything by the commands output ... |
|
1631 |
" |
|
865
48395e8ecca9
remember executeCommand actions in history as well.
Claus Gittinger <cg@exept.de>
parents:
851
diff
changeset
|
1632 |
action := [:command | |
1317 | 1633 |
self class addToCommandHistory:command for:fileName. |
1634 |
self doExecuteCommand:command replace:true |
|
1635 |
]. |
|
172 | 1636 |
|
1637 |
(self askIfModified:'contents has not been saved.\\Modifications will be lost when command is executed.' |
|
1317 | 1638 |
yesButton:'execute') ifFalse:[^ self]. |
172 | 1639 |
|
1640 |
"/ " |
|
1641 |
"/ this inserts the commands output ... |
|
1642 |
"/ " |
|
1643 |
"/ action := [:command| self doExecuteCommand:command replace:false]. |
|
1644 |
"/ |
|
1142
9066d7d02a3a
remember last executed command per suffix; offer this as default.
Claus Gittinger <cg@exept.de>
parents:
1141
diff
changeset
|
1645 |
|
9066d7d02a3a
remember last executed command per suffix; offer this as default.
Claus Gittinger <cg@exept.de>
parents:
1141
diff
changeset
|
1646 |
sel := fileListView selection. |
9066d7d02a3a
remember last executed command per suffix; offer this as default.
Claus Gittinger <cg@exept.de>
parents:
1141
diff
changeset
|
1647 |
sel size == 1 ifTrue:[ |
1317 | 1648 |
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
|
1649 |
]. |
9066d7d02a3a
remember last executed command per suffix; offer this as default.
Claus Gittinger <cg@exept.de>
parents:
1141
diff
changeset
|
1650 |
self askForCommandFor:fileName thenDo:action |
865
48395e8ecca9
remember executeCommand actions in history as well.
Claus Gittinger <cg@exept.de>
parents:
851
diff
changeset
|
1651 |
|
48395e8ecca9
remember executeCommand actions in history as well.
Claus Gittinger <cg@exept.de>
parents:
851
diff
changeset
|
1652 |
"Modified: 14.11.1996 / 14:59:34 / cg" |
172 | 1653 |
! |
1654 |
||
1655 |
fileFileIn |
|
1656 |
"fileIn the selected file(s)" |
|
1657 |
||
1658 |
self fileFileInLazy:false |
|
1659 |
! |
|
1660 |
||
1661 |
fileFileInLazy |
|
1662 |
"fileIn the selected file(s). Do a quick load (no compilation)" |
|
1663 |
||
1664 |
self fileFileInLazy:true |
|
1665 |
! |
|
1666 |
||
1667 |
fileFileInLazy:lazy |
|
1668 |
"fileIn the selected file(s)" |
|
1669 |
||
1702
962056a31c06
remember the current file during fileIn,
Claus Gittinger <cg@exept.de>
parents:
1700
diff
changeset
|
1670 |
|aStream path oldPath wasLazy bos prevCurrentFileName| |
172 | 1671 |
|
1672 |
self selectedFilesDo:[:fileName | |
|
1868 | 1673 |
path := currentDirectory filenameFor:fileName. |
1674 |
path type == #regular ifTrue:[ |
|
1675 |
prevCurrentFileName := currentFileInFileName. |
|
1676 |
currentFileInFileName := fileName. |
|
1677 |
||
1678 |
(ObjectFileLoader notNil |
|
1679 |
and:[ObjectFileLoader hasValidBinaryExtension:fileName]) ifTrue:[ |
|
1680 |
Object abortSignal catch:[ |
|
1681 |
|p| |
|
1682 |
||
1683 |
"/ |
|
1684 |
"/ look if already loaded ... then unload first |
|
1685 |
"/ |
|
1686 |
p := path pathName. |
|
1687 |
(ObjectFileLoader loadedObjectFiles includes:p) ifTrue:[ |
|
1688 |
(Dialog confirm:(resources |
|
1689 |
string:'%1 is already loaded; load anyway ?' |
|
1690 |
with:p)) ifFalse:[ |
|
1691 |
^ self |
|
1692 |
]. |
|
1693 |
Transcript showCR:'unloading old ' , p , ' ...'. |
|
1694 |
ObjectFileLoader unloadObjectFile:p. |
|
1695 |
]. |
|
1696 |
||
1697 |
Transcript showCR:'loading ' , p , ' ...'. |
|
1698 |
ObjectFileLoader loadObjectFile:p. |
|
1699 |
Class addInfoRecord:('fileIn ' , fileName) |
|
1700 |
] |
|
1701 |
] ifFalse:[ |
|
1702 |
(path hasSuffix:'cls') ifTrue:[ |
|
1703 |
aStream := path readStream. |
|
1704 |
aStream notNil ifTrue:[ |
|
1705 |
bos := BinaryObjectStorage onOld:aStream. |
|
1706 |
Class nameSpaceQuerySignal |
|
1707 |
answer:Smalltalk |
|
1708 |
do:[ |
|
1709 |
bos next. |
|
1710 |
]. |
|
1711 |
bos close |
|
1712 |
] |
|
1713 |
] ifFalse:[ |
|
1714 |
((path hasSuffix:'class') |
|
1715 |
or:[(path hasSuffix:'cla')]) ifTrue:[ |
|
1716 |
JavaClassReader notNil ifTrue:[ |
|
1717 |
JavaClassReader loadFile:(path pathName) |
|
1718 |
] |
|
1719 |
] ifFalse:[ |
|
1720 |
aStream := path readStream. |
|
1721 |
aStream notNil ifTrue:[ |
|
1722 |
[ |
|
1723 |
Class withoutUpdatingChangesDo:[ |
|
1724 |
oldPath := Smalltalk systemPath. |
|
1725 |
Smalltalk systemPath:(oldPath copy addFirst:currentDirectory pathName; yourself). |
|
1726 |
wasLazy := Compiler compileLazy:lazy. |
|
1727 |
aStream fileIn. |
|
1728 |
]. |
|
1729 |
Class addInfoRecord:('fileIn ' , fileName) |
|
1730 |
] valueNowOrOnUnwindDo:[ |
|
1731 |
Compiler compileLazy:wasLazy. |
|
1732 |
Smalltalk systemPath:oldPath. |
|
1733 |
aStream close |
|
1734 |
] |
|
1735 |
] |
|
1736 |
] |
|
1737 |
] |
|
1738 |
] |
|
1739 |
]. |
|
1740 |
currentFileInFileName := prevCurrentFileName |
|
172 | 1741 |
] |
1742 |
||
1702
962056a31c06
remember the current file during fileIn,
Claus Gittinger <cg@exept.de>
parents:
1700
diff
changeset
|
1743 |
"Modified: / 19.9.1997 / 23:42:22 / stefan" |
962056a31c06
remember the current file during fileIn,
Claus Gittinger <cg@exept.de>
parents:
1700
diff
changeset
|
1744 |
"Modified: / 18.6.1998 / 15:30:38 / cg" |
172 | 1745 |
! |
1746 |
||
1972 | 1747 |
fileFindAllDuplicates |
1748 |
"scan directory and all subdirs for duplicate files" |
|
1749 |
||
1750 |
|fileNames dir infoDir filesBySize |
|
1751 |
result info dirPrefix| |
|
1752 |
||
1753 |
(self askIfModified:'contents has not been saved.\\Modifications will be lost when you proceed.' |
|
2138 | 1754 |
yesButton:'proceed') ifFalse:[^ self]. |
1972 | 1755 |
|
1756 |
self withWaitCursorDo:[ |
|
2138 | 1757 |
result := Dictionary new. |
1758 |
||
1759 |
dir := currentDirectory asFilename. |
|
1760 |
self label:myName , '- gathering file names ...'. |
|
1761 |
fileNames := dir recursiveDirectoryContents. |
|
1762 |
fileNames := fileNames collect:[:fn | dir construct:fn]. |
|
1763 |
fileNames := fileNames select:[:fn | fn isDirectory not]. |
|
1764 |
||
1765 |
self label:myName , '- gathering sizes ...'. |
|
1766 |
infoDir := Dictionary new. |
|
1767 |
fileNames do:[:fn | |
|
1768 |
infoDir at:fn put:(fn fileSize) |
|
1769 |
]. |
|
1770 |
||
1771 |
"/ for each, get the files size. |
|
1772 |
"/ in a first pass, look for files of the same size and |
|
1773 |
"/ compare them ... |
|
1774 |
||
1775 |
self label:myName , '- preselect possible duplicates ...'. |
|
1776 |
filesBySize := Dictionary new. |
|
1777 |
infoDir keysAndValuesDo:[:fn :sz | |
|
1778 |
|entry| |
|
1779 |
||
1780 |
entry := filesBySize at:sz ifAbsentPut:[Set new]. |
|
1781 |
entry add:fn. |
|
1782 |
]. |
|
1783 |
||
1784 |
"/ any of same size ? |
|
1785 |
||
1786 |
self label:myName , '- checking for duplicates ...'. |
|
1787 |
filesBySize do:[:entry | |
|
1788 |
|files| |
|
1789 |
||
1790 |
entry size > 1 ifTrue:[ |
|
1791 |
files := entry asArray. |
|
1792 |
1 to:files size-1 do:[:idx1 | |
|
1793 |
idx1+1 to:files size do:[:idx2 | |
|
1794 |
|fn1 fn2| |
|
1795 |
||
1796 |
fn1 := files at:idx1. |
|
1797 |
fn2 := files at:idx2. |
|
1972 | 1798 |
|
1799 |
"/ self label:myName , '- checking ' , fn1 baseName , ' vs. ' , fn2 baseName , ' ...'. |
|
2138 | 1800 |
(result at:fn2 ifAbsent:nil) ~= fn1 ifTrue:[ |
1801 |
"/ compare the files |
|
1802 |
(fn1 sameContentsAs:fn2) ifTrue:[ |
|
1972 | 1803 |
"/ Transcript show:'Same: '; show:fn1 baseName; show:' and '; showCR:fn2 baseName. |
2138 | 1804 |
result at:fn1 put:fn2. |
1805 |
] |
|
1806 |
] |
|
1807 |
] |
|
1808 |
] |
|
1809 |
] |
|
1810 |
]. |
|
1811 |
||
1812 |
self label:myName , '- sorting ...'. |
|
1813 |
dirPrefix := currentDirectory asFilename pathName. |
|
1814 |
result := result associations. |
|
1815 |
result := result collect:[:assoc | |
|
1816 |
|f1 f2| |
|
1817 |
||
1818 |
f1 := assoc key name. |
|
1819 |
f2 := assoc value name. |
|
1820 |
(f1 startsWith:dirPrefix) ifTrue:[ |
|
1821 |
f1 := f1 copyFrom:dirPrefix size + 2. |
|
1822 |
]. |
|
1823 |
(f2 startsWith:dirPrefix) ifTrue:[ |
|
1824 |
f2 := f2 copyFrom:dirPrefix size + 2. |
|
1825 |
]. |
|
1826 |
f1 < f2 ifTrue:[ |
|
1827 |
f2 -> f1 |
|
1828 |
] ifFalse:[ |
|
1829 |
f1 -> f2 |
|
1830 |
] |
|
1831 |
]. |
|
1832 |
result sort:[:f1 :f2 | f2 value < f1 value]. |
|
1833 |
||
1834 |
info := OrderedCollection new. |
|
1835 |
result do:[:assoc | |
|
1836 |
info add:(assoc key , ' same as ' , assoc value) |
|
1837 |
]. |
|
1838 |
info isEmpty ifTrue:[ |
|
1839 |
info := 'No duplicate files found.' |
|
1840 |
]. |
|
1972 | 1841 |
]. |
1842 |
||
1843 |
subView contents:info. |
|
1844 |
self label:myName. |
|
1845 |
||
1846 |
"Created: / 28.11.1998 / 17:47:53 / cg" |
|
1847 |
"Modified: / 10.12.1998 / 17:13:14 / cg" |
|
1848 |
! |
|
1849 |
||
1911
6d1b77eda98f
check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents:
1903
diff
changeset
|
1850 |
fileFindDuplicates |
6d1b77eda98f
check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents:
1903
diff
changeset
|
1851 |
"scan directory for duplicate files" |
6d1b77eda98f
check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents:
1903
diff
changeset
|
1852 |
|
6d1b77eda98f
check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents:
1903
diff
changeset
|
1853 |
|fileNames dir infoDir filesBySize |
6d1b77eda98f
check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents:
1903
diff
changeset
|
1854 |
result info| |
6d1b77eda98f
check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents:
1903
diff
changeset
|
1855 |
|
6d1b77eda98f
check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents:
1903
diff
changeset
|
1856 |
(self askIfModified:'contents has not been saved.\\Modifications will be lost when you proceed.' |
2138 | 1857 |
yesButton:'proceed') ifFalse:[^ self]. |
1911
6d1b77eda98f
check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents:
1903
diff
changeset
|
1858 |
|
6d1b77eda98f
check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents:
1903
diff
changeset
|
1859 |
self withWaitCursorDo:[ |
2138 | 1860 |
result := Dictionary new. |
1861 |
||
1862 |
dir := currentDirectory asFilename. |
|
1863 |
fileNames := dir directoryContents. |
|
1864 |
fileNames := fileNames collect:[:fn | dir construct:fn]. |
|
1865 |
fileNames := fileNames select:[:fn | fn isDirectory not]. |
|
1866 |
||
1867 |
infoDir := Dictionary new. |
|
1868 |
fileNames do:[:fn | |
|
1869 |
infoDir at:fn put:(fn info) |
|
1870 |
]. |
|
1871 |
||
1872 |
"/ for each, get the files size. |
|
1873 |
"/ in a first pass, look for files of the same size and |
|
1874 |
"/ compare them ... |
|
1875 |
||
1876 |
filesBySize := Dictionary new. |
|
1877 |
infoDir keysAndValuesDo:[:fn :info | |
|
1878 |
|sz entry| |
|
1879 |
||
1880 |
sz := info size. |
|
1881 |
entry := filesBySize at:sz ifAbsentPut:[Set new]. |
|
1882 |
entry add:fn. |
|
1883 |
]. |
|
1884 |
||
1885 |
"/ any of same size ? |
|
1886 |
||
1887 |
filesBySize do:[:entry | |
|
1888 |
|files| |
|
1889 |
||
1890 |
entry size > 1 ifTrue:[ |
|
1891 |
files := entry asArray. |
|
1892 |
1 to:files size-1 do:[:idx1 | |
|
1893 |
idx1+1 to:files size do:[:idx2 | |
|
1894 |
|fn1 fn2| |
|
1895 |
||
1896 |
fn1 := files at:idx1. |
|
1897 |
fn2 := files at:idx2. |
|
1898 |
||
1899 |
(result at:fn2 ifAbsent:nil) ~= fn1 ifTrue:[ |
|
1900 |
"/ compare the files |
|
1901 |
(fn1 sameContentsAs:fn2) ifTrue:[ |
|
1911
6d1b77eda98f
check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents:
1903
diff
changeset
|
1902 |
"/ Transcript show:'Same: '; show:fn1 baseName; show:' and '; showCR:fn2 baseName. |
2138 | 1903 |
result at:fn1 put:fn2. |
1904 |
] |
|
1905 |
] |
|
1906 |
] |
|
1907 |
] |
|
1908 |
] |
|
1909 |
]. |
|
1910 |
||
1911 |
result := result associations. |
|
1912 |
result := result collect:[:assoc | |
|
1913 |
|f1 f2| |
|
1914 |
||
1915 |
f1 := assoc key baseName. |
|
1916 |
f2 := assoc value baseName. |
|
1917 |
f1 < f2 ifTrue:[ |
|
1918 |
f2 -> f1 |
|
1919 |
] ifFalse:[ |
|
1920 |
f1 -> f2 |
|
1921 |
] |
|
1922 |
]. |
|
1923 |
result sort:[:f1 :f2 | f2 value < f1 value]. |
|
1924 |
||
1925 |
info := OrderedCollection new. |
|
1926 |
result do:[:assoc | |
|
1927 |
info add:(assoc key , ' same as ' , assoc value) |
|
1928 |
]. |
|
1929 |
info isEmpty ifTrue:[ |
|
1930 |
info := 'No duplicate files found.' |
|
1931 |
]. |
|
1911
6d1b77eda98f
check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents:
1903
diff
changeset
|
1932 |
]. |
6d1b77eda98f
check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents:
1903
diff
changeset
|
1933 |
|
6d1b77eda98f
check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents:
1903
diff
changeset
|
1934 |
subView contents:info |
6d1b77eda98f
check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents:
1903
diff
changeset
|
1935 |
|
6d1b77eda98f
check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents:
1903
diff
changeset
|
1936 |
"Created: / 3.10.1998 / 17:59:00 / cg" |
1912 | 1937 |
"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
|
1938 |
! |
6d1b77eda98f
check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents:
1903
diff
changeset
|
1939 |
|
1933 | 1940 |
fileFindFile |
1965 | 1941 |
|sel bindings |
1933 | 1942 |
namePatternHolder contentsPatternHolder |
1943 |
ignoreCaseInName ignoreCaseInContents |
|
2166
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
1944 |
namePattern namePatterns contentsPattern |
1965 | 1945 |
searchForSameContentsEnabled searchForSameContents| |
1933 | 1946 |
|
1947 |
(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
|
1948 |
yesButton:'proceed') ifFalse:[^ self]. |
1933 | 1949 |
|
1950 |
subView contents:nil; scrollToTop. |
|
1951 |
||
1952 |
bindings := IdentityDictionary new. |
|
1953 |
bindings at:#namePatternHolder put:(namePatternHolder := '' asValue). |
|
1954 |
bindings at:#contentsPatternHolder put:(contentsPatternHolder := '' asValue). |
|
1955 |
bindings at:#ignoreCaseInName put:(ignoreCaseInName := false asValue). |
|
1956 |
bindings at:#ignoreCaseInContents put:(ignoreCaseInContents := false asValue). |
|
1957 |
||
1965 | 1958 |
searchForSameContentsEnabled := false. |
1959 |
sel := fileListView selectionValue. |
|
1960 |
sel size == 1 ifTrue:[ |
|
2166
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
1961 |
searchForSameContentsEnabled := true. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
1962 |
sel := sel first string withoutSeparators |
1965 | 1963 |
]. |
1964 |
bindings at:#searchForSameContentsEnabled put:(searchForSameContentsEnabled := searchForSameContentsEnabled asValue). |
|
1965 |
bindings at:#searchForSameContents put:(searchForSameContents := false asValue). |
|
1966 |
bindings at:#notSearchForSameContents put:(BlockValue forLogicalNot:searchForSameContents). |
|
1967 |
||
1968 |
||
1933 | 1969 |
(SimpleDialog new |
2166
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
1970 |
openFor:self |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
1971 |
interfaceSpec:(self class fileSearchDialogSpec) |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
1972 |
withBindings:bindings) ifTrue:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
1973 |
|
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
1974 |
namePattern := namePatternHolder value. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
1975 |
namePattern size == 0 ifTrue:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
1976 |
namePatterns := nil |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
1977 |
] ifFalse:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
1978 |
ignoreCaseInName value ifTrue:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
1979 |
namePattern := namePattern asLowercase |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
1980 |
]. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
1981 |
namePatterns := namePattern asCollectionOfSubstringsSeparatedBy:$; |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
1982 |
]. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
1983 |
contentsPattern := contentsPatternHolder value. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
1984 |
contentsPattern size == 0 ifTrue:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
1985 |
contentsPattern := nil |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
1986 |
] ifFalse:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
1987 |
ignoreCaseInContents value ifTrue:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
1988 |
contentsPattern := contentsPattern asLowercase |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
1989 |
] |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
1990 |
]. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
1991 |
|
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
1992 |
self withWaitCursorDo:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
1993 |
|stopSignal access myProcess lowerFrameView| |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
1994 |
|
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
1995 |
myProcess := Processor activeProcess. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
1996 |
|
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
1997 |
access := Semaphore forMutualExclusion name:'accessLock'. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
1998 |
stopSignal := Signal new. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
1999 |
|
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2000 |
" |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2001 |
The following is tricky: |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2002 |
the pauseToggle & killButton will |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2003 |
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
|
2004 |
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
|
2005 |
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
|
2006 |
" |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2007 |
|
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2008 |
commandView beInvisible. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2009 |
|
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2010 |
" |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2011 |
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
|
2012 |
" |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2013 |
killButton windowGroup:nil. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2014 |
|
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2015 |
" |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2016 |
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
|
2017 |
" |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2018 |
killButton label:(resources string:'stop'). |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2019 |
killButton raise; beVisible. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2020 |
|
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2021 |
" |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2022 |
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
|
2023 |
" |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2024 |
killButton |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2025 |
action:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2026 |
access critical:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2027 |
myProcess interruptWith:[stopSignal raiseRequest]. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2028 |
] |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2029 |
]. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2030 |
|
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2031 |
" |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2032 |
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
|
2033 |
" |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2034 |
killButton openAutonomous. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2035 |
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
|
2036 |
|
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2037 |
lowerFrameView := subView superView. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2038 |
|
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2039 |
[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2040 |
stopSignal catch:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2041 |
searchForSameContents value ifTrue:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2042 |
self |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2043 |
doFindFileNamed:namePatterns |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2044 |
ignoreCase:ignoreCaseInName value |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2045 |
containingString:nil |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2046 |
ignoreCaseInContents:ignoreCaseInContents value |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2047 |
sameContentsAsFile:(currentDirectory asFilename construct:sel) |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2048 |
sameContentsAs:nil |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2049 |
in:currentDirectory. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2050 |
] ifFalse:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2051 |
(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
|
2052 |
self |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2053 |
doFindFileNamed:namePatterns |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2054 |
ignoreCase:ignoreCaseInName value |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2055 |
containingString:contentsPattern |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2056 |
ignoreCaseInContents:ignoreCaseInContents value |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2057 |
sameContentsAsFile:nil |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2058 |
sameContentsAs:nil |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2059 |
in:currentDirectory. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2060 |
] |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2061 |
] |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2062 |
] |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2063 |
] valueNowOrOnUnwindDo:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2064 |
|wg| |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2065 |
|
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2066 |
self label:myName; iconLabel:myName. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2067 |
|
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2068 |
" |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2069 |
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
|
2070 |
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
|
2071 |
" |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2072 |
killButton beInvisible. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2073 |
|
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2074 |
commandView beVisible. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2075 |
|
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2076 |
" |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2077 |
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
|
2078 |
(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
|
2079 |
" |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2080 |
wg := killButton windowGroup. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2081 |
killButton windowGroup:nil. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2082 |
|
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2083 |
" |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2084 |
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
|
2085 |
" |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2086 |
wg notNil ifTrue:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2087 |
wg process terminate. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2088 |
]. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2089 |
" |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2090 |
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
|
2091 |
releases reference to thisContext earlier) |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2092 |
" |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2093 |
killButton action:nil. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2094 |
killButton label:(resources string:'kill'). |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2095 |
|
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2096 |
"/ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2097 |
"/ allow interaction with the codeView |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2098 |
"/ (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
|
2099 |
"/ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2100 |
lowerFrameView windowGroup:(self windowGroup). |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2101 |
]. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2102 |
|
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2103 |
]. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2104 |
self label:myName. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2105 |
currentFileName isNil ifTrue:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2106 |
subView modified:false. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2107 |
]. |
1933 | 2108 |
]. |
2109 |
||
2110 |
"Created: / 15.10.1998 / 11:32:57 / cg" |
|
2111 |
"Modified: / 15.10.1998 / 12:41:09 / cg" |
|
2112 |
! |
|
2113 |
||
172 | 2114 |
fileGet |
2115 |
"get contents of selected file into subView. |
|
2116 |
If text was modified show a queryBox, |
|
2117 |
otherwise get it immediately" |
|
2118 |
||
633
4630175ed31e
double click on .htm / .html files open a viewer;
Claus Gittinger <cg@exept.de>
parents:
585
diff
changeset
|
2119 |
self fileGet:false |
4630175ed31e
double click on .htm / .html files open a viewer;
Claus Gittinger <cg@exept.de>
parents:
585
diff
changeset
|
2120 |
|
4630175ed31e
double click on .htm / .html files open a viewer;
Claus Gittinger <cg@exept.de>
parents:
585
diff
changeset
|
2121 |
"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
|
2122 |
! |
4630175ed31e
double click on .htm / .html files open a viewer;
Claus Gittinger <cg@exept.de>
parents:
585
diff
changeset
|
2123 |
|
4630175ed31e
double click on .htm / .html files open a viewer;
Claus Gittinger <cg@exept.de>
parents:
585
diff
changeset
|
2124 |
fileGet:viaDoubleClick |
4630175ed31e
double click on .htm / .html files open a viewer;
Claus Gittinger <cg@exept.de>
parents:
585
diff
changeset
|
2125 |
"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
|
2126 |
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
|
2127 |
otherwise get it immediately" |
4630175ed31e
double click on .htm / .html files open a viewer;
Claus Gittinger <cg@exept.de>
parents:
585
diff
changeset
|
2128 |
|
172 | 2129 |
|fileName msg label| |
2130 |
||
1110
9ec4692e9cda
dont decode string, if the encoding is already iso8859
Claus Gittinger <cg@exept.de>
parents:
1104
diff
changeset
|
2131 |
(subView modified not or:[subView contentsWasSaved]) ifTrue:[ |
1329 | 2132 |
self doFileGet:viaDoubleClick. |
2133 |
^ self |
|
1110
9ec4692e9cda
dont decode string, if the encoding is already iso8859
Claus Gittinger <cg@exept.de>
parents:
1104
diff
changeset
|
2134 |
]. |
172 | 2135 |
fileName := self getSelectedFileName. |
2136 |
fileName notNil ifTrue:[ |
|
1329 | 2137 |
(currentDirectory filenameFor:fileName) isDirectory ifTrue:[ |
2138 |
msg := 'contents has not been saved.\\Modifications will be lost when directory is changed.'. |
|
2139 |
label := 'change'. |
|
2140 |
] ifFalse:[ |
|
2141 |
msg := 'contents has not been saved.\\Modifications will be lost when new file is read.'. |
|
2142 |
label := 'get'. |
|
2143 |
]. |
|
2144 |
(self ask:(resources at:msg) yesButton:label) ifTrue:[ |
|
2145 |
subView modified:false. |
|
2146 |
self doFileGet:viaDoubleClick |
|
2147 |
] |
|
172 | 2148 |
] |
633
4630175ed31e
double click on .htm / .html files open a viewer;
Claus Gittinger <cg@exept.de>
parents:
585
diff
changeset
|
2149 |
|
4630175ed31e
double click on .htm / .html files open a viewer;
Claus Gittinger <cg@exept.de>
parents:
585
diff
changeset
|
2150 |
"Created: 19.6.1996 / 09:38:35 / cg" |
1162 | 2151 |
"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
|
2152 |
"Modified: 18.9.1997 / 16:27:34 / stefan" |
172 | 2153 |
! |
2154 |
||
2155 |
fileGetInfo |
|
2156 |
"show short file (stat)-info" |
|
2157 |
||
2158 |
self fileGetInfo:false |
|
2159 |
! |
|
2160 |
||
2161 |
fileGetInfo:longInfo |
|
2162 |
"get info on selected file - show it in a box" |
|
2163 |
||
1672
9df905f8bfa3
update fileInfo while showing infoBox
Claus Gittinger <cg@exept.de>
parents:
1628
diff
changeset
|
2164 |
|string box updater| |
172 | 2165 |
|
2166 |
string := self getFileInfoString:longInfo. |
|
2167 |
string notNil ifTrue:[ |
|
1868 | 2168 |
box := InfoBox title:string. |
2169 |
updater := [ |
|
2170 |
[true] whileTrue:[ |
|
2171 |
Delay waitForSeconds:2. |
|
2172 |
string := self getFileInfoString:longInfo. |
|
2173 |
box title:string |
|
2174 |
] |
|
2175 |
] fork. |
|
2176 |
||
2177 |
box showAtPointer. |
|
2178 |
updater terminate. |
|
2179 |
box destroy |
|
172 | 2180 |
] |
2181 |
! |
|
2182 |
||
2183 |
fileGetLongInfo |
|
2184 |
"show long stat (file)-info" |
|
2185 |
||
2186 |
self fileGetInfo:true |
|
2187 |
! |
|
2188 |
||
1874 | 2189 |
fileHexDump |
2190 |
"show a hex dump (similar to od -x) |
|
2191 |
Only needed with non-Unix systems." |
|
2192 |
||
2193 |
self withReadCursorDo:[ |
|
2138 | 2194 |
|fileName f stream data offs |
2195 |
addrDigits col line asciiLine lines| |
|
2196 |
||
2197 |
fileName := self getSelectedFileName. |
|
2198 |
fileName notNil ifTrue:[ |
|
2199 |
f := currentDirectory construct:fileName. |
|
2200 |
f isDirectory ifTrue:[ |
|
2201 |
^ self warn:(resources string:'%1 is a directory.' with:fileName). |
|
2202 |
]. |
|
2203 |
f exists ifFalse:[ |
|
2204 |
self warn:(resources string:'oops, ''%1'' is gone or unreadable.' with:fileName). |
|
2205 |
^ self |
|
2206 |
]. |
|
2207 |
f isReadable ifFalse:[ |
|
2208 |
self warn:(resources string:'''%1'' is unreadable.' with:fileName). |
|
2209 |
^ self |
|
2210 |
]. |
|
2211 |
stream := f readStream binary. |
|
2212 |
data := stream contents. |
|
2213 |
stream close. |
|
2214 |
||
2215 |
subView list:nil. |
|
2216 |
col := 1. |
|
2217 |
offs := 0. |
|
2218 |
lines := StringCollection new. |
|
2219 |
||
2220 |
addrDigits := ((f fileSize + 1) log:16) truncated + 1. |
|
2221 |
||
2222 |
line := (offs hexPrintString:addrDigits) , ': '. |
|
2223 |
asciiLine := ''. |
|
2224 |
||
2225 |
data do:[:byte | |
|
2226 |
line := line , (byte hexPrintString:2). |
|
2227 |
(byte between:32 and:127) ifTrue:[ |
|
2228 |
asciiLine := asciiLine copyWith:(Character value:byte) |
|
2229 |
] ifFalse:[ |
|
2230 |
asciiLine := asciiLine , '.' |
|
2231 |
]. |
|
2232 |
||
2233 |
offs := offs + 1. |
|
2234 |
col := col + 1. |
|
2235 |
col > 16 ifTrue:[ |
|
2236 |
lines add:(line , ' ' , asciiLine). |
|
2237 |
(offs bitAnd:16rFF) == 0 ifTrue:[ |
|
2238 |
lines add:nil |
|
2239 |
]. |
|
2240 |
line := (offs hexPrintString:addrDigits) , ': '. |
|
2241 |
asciiLine := ''. |
|
2242 |
col := 1. |
|
2243 |
] ifFalse:[ |
|
2244 |
line := line , ' ' |
|
2245 |
] |
|
2246 |
]. |
|
2247 |
line := line paddedTo:(3*16 + addrDigits + 1). |
|
2248 |
lines add:(line , ' ' , asciiLine). |
|
2249 |
self show:lines. |
|
2250 |
] |
|
1874 | 2251 |
] |
2252 |
||
2253 |
"Modified: / 7.9.1998 / 15:37:47 / cg" |
|
2254 |
! |
|
2255 |
||
172 | 2256 |
fileInsert |
1162 | 2257 |
"insert contents of file at the cursor position" |
172 | 2258 |
|
2259 |
|fileName| |
|
2260 |
||
2261 |
fileName := self getSelectedFileName. |
|
2262 |
fileName notNil ifTrue:[ |
|
1317 | 2263 |
self showFile:fileName insert:true encoding:fileEncoding |
172 | 2264 |
] |
386
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
2265 |
|
1162 | 2266 |
"Modified: 23.4.1997 / 13:06:06 / cg" |
172 | 2267 |
! |
2268 |
||
2269 |
fileListMenu |
|
2270 |
"return the menu to show in the fileList" |
|
2271 |
||
1235
13610578a5d2
resource flag: #menu -> #programMenu
Claus Gittinger <cg@exept.de>
parents:
1227
diff
changeset
|
2272 |
<resource: #programMenu> |
1040 | 2273 |
|
1834 | 2274 |
|m| |
2275 |
||
2276 |
m := self class menuPopUp. |
|
2277 |
m := m decodeAsLiteralArray. |
|
2278 |
m receiver:self. |
|
2035
307ed5143d8b
national language stuff - again
Claus Gittinger <cg@exept.de>
parents:
2031
diff
changeset
|
2279 |
m findGuiResourcesIn:self. |
1834 | 2280 |
^ m. |
2281 |
||
2282 |
"Modified: / 14.8.1998 / 14:09:12 / cg" |
|
2283 |
! |
|
2284 |
||
2285 |
fileListMenu_old |
|
2286 |
"return the menu to show in the fileList" |
|
2287 |
||
2288 |
<resource: #programMenu> |
|
2289 |
||
1736
36cab4d1d655
remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents:
1735
diff
changeset
|
2290 |
|items m sel ns subMenu subItems| |
36cab4d1d655
remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents:
1735
diff
changeset
|
2291 |
|
36cab4d1d655
remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents:
1735
diff
changeset
|
2292 |
items := #( |
1868 | 2293 |
('spawn' fileSpawn ) |
2294 |
('-' nil ) |
|
2295 |
('get contents' fileGet GotoLine) |
|
2296 |
('insert contents' fileInsert ) |
|
2297 |
('show info' fileGetInfo InspectIt) |
|
2298 |
('show full info' fileGetLongInfo CmdI) |
|
2299 |
). |
|
1193
568b858d94ce
show current namespace in menus fileIn item
Claus Gittinger <cg@exept.de>
parents:
1189
diff
changeset
|
2300 |
|
568b858d94ce
show current namespace in menus fileIn item
Claus Gittinger <cg@exept.de>
parents:
1189
diff
changeset
|
2301 |
((ns := Project current defaultNameSpace) notNil |
568b858d94ce
show current namespace in menus fileIn item
Claus Gittinger <cg@exept.de>
parents:
1189
diff
changeset
|
2302 |
and:[ns ~~ Smalltalk]) ifTrue:[ |
1868 | 2303 |
items := items copyWith:(Array |
2304 |
with:(resources string:'fileIn (into ''%1'')' with:(Project current defaultNameSpace name)) |
|
2305 |
with:#fileFileIn |
|
2306 |
with:#Accept) |
|
1736
36cab4d1d655
remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents:
1735
diff
changeset
|
2307 |
|
1193
568b858d94ce
show current namespace in menus fileIn item
Claus Gittinger <cg@exept.de>
parents:
1189
diff
changeset
|
2308 |
] ifFalse:[ |
1868 | 2309 |
items := items copyWith:#( 'fileIn' #fileFileIn #Accept) |
1193
568b858d94ce
show current namespace in menus fileIn item
Claus Gittinger <cg@exept.de>
parents:
1189
diff
changeset
|
2310 |
]. |
568b858d94ce
show current namespace in menus fileIn item
Claus Gittinger <cg@exept.de>
parents:
1189
diff
changeset
|
2311 |
|
1736
36cab4d1d655
remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents:
1735
diff
changeset
|
2312 |
items := items , #( |
1868 | 2313 |
('-' ) |
2314 |
('update' updateCurrentDirectory Cmdu) |
|
2315 |
('-' ) |
|
2316 |
('execute unix command ...' fileExecute DoIt) |
|
2317 |
('st/x tools' stxTools ) |
|
2318 |
('-' ) |
|
2319 |
('remove' fileRemove Delete) |
|
2320 |
('rename ...' fileRename ) |
|
2321 |
('-' ) |
|
2322 |
('display long list' changeDisplayMode ) |
|
2323 |
('show all files' changeDotFileVisibility ) |
|
2324 |
('encoding ...' fileEncoding ) |
|
2325 |
('-' ) |
|
2326 |
('create directory ...' newDirectory CmdD) |
|
2327 |
('create file ...' newFile CmdF) |
|
2328 |
). |
|
172 | 2329 |
|
2330 |
m := PopUpMenu |
|
1868 | 2331 |
itemList:items |
2332 |
resources:resources. |
|
172 | 2333 |
|
1834 | 2334 |
showingHiddenFiles value "showDotFiles" ifTrue:[ |
1868 | 2335 |
m labelAt:#changeDotFileVisibility put:(resources string:'hide hidden files') |
172 | 2336 |
]. |
1834 | 2337 |
showingDetails value "showLongList" ifTrue:[ |
1868 | 2338 |
m labelAt:#changeDisplayMode put:(resources string:'display short list') |
172 | 2339 |
]. |
2340 |
||
1736
36cab4d1d655
remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents:
1735
diff
changeset
|
2341 |
items := #( |
1868 | 2342 |
('Changes browser' openChangesBrowser ) |
2343 |
('Editor' openEditor ) |
|
2344 |
('HTML reader' openHTMLReader ) |
|
2345 |
('Image inspect' openImageInspector ) |
|
2346 |
('show file differences' openDiffView ) |
|
2347 |
). |
|
1286
2a464093d865
added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents:
1272
diff
changeset
|
2348 |
|
1751 | 2349 |
OperatingSystem isUNIXlike ifTrue:[ |
1868 | 2350 |
items := items , #( ('terminal' openTerminal )). |
1751 | 2351 |
]. |
2352 |
||
1286
2a464093d865
added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents:
1272
diff
changeset
|
2353 |
JavaInterpreter notNil ifTrue:[ |
1868 | 2354 |
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
|
2355 |
]. |
2a464093d865
added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents:
1272
diff
changeset
|
2356 |
|
2a464093d865
added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents:
1272
diff
changeset
|
2357 |
m subMenuAt:#stxTools |
1868 | 2358 |
put:(PopUpMenu |
2359 |
itemList:items |
|
2360 |
resources:resources). |
|
1736
36cab4d1d655
remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents:
1735
diff
changeset
|
2361 |
|
36cab4d1d655
remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents:
1735
diff
changeset
|
2362 |
((sel := fileListView selection) isNil |
36cab4d1d655
remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents:
1735
diff
changeset
|
2363 |
or:[sel isEmpty]) ifTrue:[ |
1868 | 2364 |
m disableAll:#(fileGet fileInsert |
2365 |
fileGetInfo fileGetLongInfo |
|
2366 |
fileFileIn fileFileInLazy |
|
2367 |
fileRemove fileRename). |
|
2368 |
(m subMenuAt:#stxTools) |
|
2369 |
disableAll:#(openChangesBrowser openEditor openHTMLReader openImageInspector) |
|
865
48395e8ecca9
remember executeCommand actions in history as well.
Claus Gittinger <cg@exept.de>
parents:
851
diff
changeset
|
2370 |
] ifFalse:[ |
1868 | 2371 |
fileListView selection size > 1 ifTrue:[ |
2372 |
m disableAll:#( fileGet fileInsert fileGetInfo fileGetLongInfo fileRename ) |
|
2373 |
] |
|
172 | 2374 |
]. |
2375 |
||
2376 |
^m |
|
252 | 2377 |
|
1396 | 2378 |
"Modified: / 16.1.1998 / 16:42:59 / stefan" |
1834 | 2379 |
"Modified: / 4.8.1998 / 13:45:56 / cg" |
2380 |
"Created: / 13.8.1998 / 20:51:38 / cg" |
|
172 | 2381 |
! |
2382 |
||
2383 |
filePrint |
|
1162 | 2384 |
"send a files contents to the printer (not in the menu)" |
2385 |
||
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
2386 |
|fileName path inStream printStream line| |
172 | 2387 |
|
294 | 2388 |
self withWaitCursorDo:[ |
1329 | 2389 |
fileName := self getSelectedFileName. |
2390 |
fileName notNil ifTrue:[ |
|
2391 |
path := currentDirectory filenameFor:fileName. |
|
2392 |
(path type == #regular) ifTrue:[ |
|
2393 |
inStream := path readStream. |
|
2394 |
inStream isNil ifFalse:[ |
|
2395 |
printStream := PrinterStream new. |
|
2396 |
printStream notNil ifTrue:[ |
|
2397 |
[inStream atEnd] whileFalse:[ |
|
2398 |
line := inStream nextLine. |
|
2399 |
printStream nextPutLine:line. |
|
2400 |
]. |
|
2401 |
printStream close |
|
2402 |
]. |
|
2403 |
inStream close |
|
2404 |
] |
|
2405 |
] |
|
2406 |
]. |
|
2407 |
0 "compiler hint" |
|
172 | 2408 |
] |
294 | 2409 |
|
1162 | 2410 |
"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
|
2411 |
"Modified: 18.9.1997 / 16:29:17 / stefan" |
172 | 2412 |
! |
2413 |
||
2414 |
fileRemove |
|
2415 |
"remove the selected file(s). |
|
2416 |
Query if user really wants to remove the file. |
|
2417 |
- should be enhanced, to look for a ~/.trash directory |
|
2418 |
and move files there if it exists (without asking in this case)." |
|
2419 |
||
2420 |
|sel q| |
|
2421 |
||
2094 | 2422 |
sel := fileListView selection. |
2423 |
sel size > 0 ifTrue:[ |
|
2138 | 2424 |
sel := sel collect:[:rawIndex | fileList at:rawIndex]. |
2425 |
sel size > 1 ifTrue:[ |
|
2426 |
q := resources string:'remove %1 selected files ?' with:(sel size) |
|
2427 |
] ifFalse:[ |
|
2428 |
q := resources string:'remove ''%1'' ?' with:(sel first asText allBold) |
|
2429 |
]. |
|
2430 |
(self sensor shiftDown |
|
2431 |
or:[self ask:q yesButton:'remove']) ifTrue:[ |
|
2432 |
self withCursor:(Cursor wait) do:[ |
|
2433 |
self doRemove:sel |
|
2434 |
] |
|
2435 |
] |
|
172 | 2436 |
] |
1974 | 2437 |
|
2438 |
"Modified: / 16.12.1998 / 17:30:31 / cg" |
|
172 | 2439 |
! |
2440 |
||
2441 |
fileRename |
|
2442 |
"rename the selected file(s)" |
|
2443 |
||
2444 |
|queryBox| |
|
2445 |
||
2446 |
queryBox := FilenameEnterBox new. |
|
2447 |
queryBox okText:(resources at:'rename'). |
|
2448 |
self selectedFilesDo:[:oldName | |
|
1317 | 2449 |
queryBox title:(resources string:'rename ''%1'' to:' with:oldName). |
2450 |
queryBox initialText:oldName. |
|
2451 |
queryBox action:[:newName | self doRename:oldName to:newName]. |
|
2452 |
queryBox showAtPointer |
|
172 | 2453 |
] |
2454 |
! |
|
2455 |
||
2456 |
fileSelect:lineNr |
|
2457 |
"selected a file - do nothing here" |
|
1162 | 2458 |
|
2094 | 2459 |
|fn| |
2460 |
||
2095 | 2461 |
imagePreviewView notNil ifTrue:[ |
2138 | 2462 |
self stopImageRenderProcess. |
2463 |
||
2464 |
fn := self getSelectedFileName. |
|
2465 |
(Image isImageFileSuffix:(fn asFilename suffix)) ifTrue:[ |
|
2466 |
imageRenderProcess := [ |
|
2467 |
self loadImageAndPerform:[:img | |
|
2468 |
imagePreviewView beVisible. |
|
2469 |
imagePreviewView image:img |
|
2470 |
] |
|
2471 |
] forkAt:(Processor activePriority - 1). |
|
2472 |
] ifFalse:[ |
|
2473 |
imagePreviewView beInvisible |
|
2474 |
]. |
|
2095 | 2475 |
] |
1162 | 2476 |
|
2477 |
"Modified: 23.4.1997 / 13:04:55 / cg" |
|
172 | 2478 |
! |
2479 |
||
2480 |
fileSpawn |
|
2481 |
"start another FileBrowser on the selected directory or |
|
2482 |
on the same directory if none is selected." |
|
2483 |
||
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
2484 |
|any path| |
172 | 2485 |
|
2486 |
any := false. |
|
2487 |
self selectedFilesDo:[:fileName | |
|
1329 | 2488 |
path := currentDirectory filenameFor:fileName. |
2489 |
path isDirectory ifTrue:[ |
|
2490 |
self class openOn:(path pathName). |
|
2491 |
any := true |
|
2492 |
] |
|
172 | 2493 |
]. |
2494 |
any ifFalse:[ |
|
1329 | 2495 |
self class openOn:currentDirectory pathName |
172 | 2496 |
] |
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
2497 |
|
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
2498 |
"Modified: 18.9.1997 / 16:32:39 / stefan" |
172 | 2499 |
! |
2500 |
||
1964 | 2501 |
loadImageAndPerform:aSelectorOrBlock |
1853 | 2502 |
|img path| |
2503 |
||
2504 |
self selectedFilesDo:[:fileName | |
|
2138 | 2505 |
path := currentDirectory filenameFor:fileName. |
2506 |
path isDirectory ifFalse:[ |
|
2507 |
img := Image fromFile:(path pathName). |
|
2508 |
img notNil ifTrue:[ |
|
2509 |
aSelectorOrBlock isSymbol ifTrue:[ |
|
2510 |
img perform:aSelectorOrBlock |
|
2511 |
] ifFalse:[ |
|
2512 |
aSelectorOrBlock value:img |
|
2513 |
] |
|
2514 |
] ifFalse:[ |
|
2515 |
self warn:'unknown format: ' , fileName |
|
2516 |
] |
|
2517 |
] |
|
1853 | 2518 |
]. |
2519 |
||
2520 |
"Modified: / 17.9.1995 / 17:41:24 / claus" |
|
2521 |
"Modified: / 18.9.1997 / 17:05:04 / stefan" |
|
2522 |
"Created: / 26.8.1998 / 16:20:18 / cg" |
|
2523 |
! |
|
2524 |
||
172 | 2525 |
newDirectory |
2526 |
"ask for and create a new directory" |
|
2527 |
||
2528 |
|queryBox| |
|
2529 |
||
2530 |
queryBox := FilenameEnterBox |
|
1317 | 2531 |
title:(resources at:'create new directory:') withCRs |
2532 |
okText:(resources at:'create') |
|
2533 |
action:[:newName | self doCreateDirectory:newName]. |
|
172 | 2534 |
queryBox showAtPointer |
1162 | 2535 |
|
2536 |
"Modified: 23.4.1997 / 13:04:27 / cg" |
|
172 | 2537 |
! |
2538 |
||
2539 |
newFile |
|
2540 |
"ask for and create a new file" |
|
2541 |
||
2542 |
|sel queryBox| |
|
2543 |
||
2544 |
queryBox := FilenameEnterBox |
|
1418 | 2545 |
title:(resources at:'create new file:') withCRs |
2546 |
okText:(resources at:'create') |
|
2547 |
action:[:newName | newName isEmpty ifFalse:[self doCreateFile:newName]]. |
|
172 | 2548 |
sel := subView selection. |
2549 |
sel notNil ifTrue:[ |
|
1418 | 2550 |
queryBox initialText:(sel asString) |
172 | 2551 |
]. |
2552 |
queryBox showAtPointer |
|
381 | 2553 |
|
1396 | 2554 |
"Modified: / 23.4.1997 / 13:04:38 / cg" |
2555 |
"Modified: / 16.1.1998 / 16:54:00 / stefan" |
|
172 | 2556 |
! |
2557 |
||
1834 | 2558 |
newHardLink |
2559 |
"ask for and create a hard link (unix only)" |
|
2560 |
||
2561 |
|sel box orgName1 name1 name2 f1 f2 f d err nm here l1 if1 if2| |
|
2562 |
||
2563 |
sel := self getSelectedFileName. |
|
2564 |
||
2565 |
orgName1 := ''. |
|
2566 |
(sel size > 0) ifTrue:[ |
|
2138 | 2567 |
(currentDirectory construct:sel) isDirectory ifFalse:[ |
2568 |
orgName1 := sel |
|
2569 |
] |
|
1834 | 2570 |
]. |
2571 |
||
2572 |
name1 := orgName1 asValue. |
|
2573 |
name2 := '' asValue. |
|
2574 |
||
2575 |
box := DialogBox new. |
|
2035
307ed5143d8b
national language stuff - again
Claus Gittinger <cg@exept.de>
parents:
2031
diff
changeset
|
2576 |
(box addTextLabel:(resources string:'Create hard link from:')) adjust:#left. |
1834 | 2577 |
if1 := box addFilenameInputFieldOn:name1 in:here tabable:true. |
2035
307ed5143d8b
national language stuff - again
Claus Gittinger <cg@exept.de>
parents:
2031
diff
changeset
|
2578 |
(box addTextLabel:(resources string:'to:')) adjust:#left. |
1834 | 2579 |
if2 := box addFilenameInputFieldOn:name2 in:here tabable:true. |
2580 |
||
2048 | 2581 |
box addAbortAndOkButtons. |
1834 | 2582 |
|
2583 |
orgName1 size > 0 ifTrue:[ |
|
2138 | 2584 |
box focusOnField:if2. |
1834 | 2585 |
]. |
2586 |
box showAtPointer. |
|
2587 |
||
2588 |
box accepted ifTrue:[ |
|
2138 | 2589 |
name1 := name1 value. |
2590 |
(name1 size == 0) ifTrue:[ |
|
2591 |
err := 'no name entered'. |
|
2592 |
] ifFalse:[ |
|
2593 |
f1 := name1 asFilename. |
|
2594 |
name2 := name2 value. |
|
2595 |
(name2 size == 0) ifTrue:[ |
|
2596 |
err := 'no name entered'. |
|
2597 |
] ifFalse:[ |
|
2598 |
f2 := name2 asFilename. |
|
2599 |
f2 exists ifTrue:[ |
|
2600 |
err := '''%2'' already exists'. |
|
2601 |
] ifFalse:[ |
|
2602 |
f1 exists ifFalse:[ |
|
2603 |
err := '''%1'' does not exist'. |
|
2604 |
] ifTrue:[ |
|
2605 |
f1 isDirectory ifTrue:[ |
|
2606 |
err := '''%1'' is a directory'. |
|
2607 |
] ifFalse:[ |
|
2608 |
ErrorSignal handle:[:ex | |
|
2609 |
err := ex errorString |
|
2610 |
] do:[ |
|
2611 |
OperatingSystem createHardLinkFrom:name1 to:name2 |
|
2612 |
] |
|
2613 |
] |
|
2614 |
] |
|
2615 |
] |
|
2616 |
] |
|
2617 |
]. |
|
2618 |
||
2619 |
err notNil ifTrue:[ |
|
2620 |
self warn:(resources string:err with:(name1 ? '') asText allBold with:(name2 ? '') asText allBold). |
|
2621 |
^ self |
|
2622 |
]. |
|
1834 | 2623 |
]. |
2624 |
||
2625 |
"Modified: / 13.8.1998 / 21:47:01 / cg" |
|
2626 |
! |
|
2627 |
||
2628 |
newSoftLink |
|
2629 |
"ask for and create a soft link (unix only)" |
|
2630 |
||
2631 |
|sel box orgName1 name1 name2 f1 f2 f d err nm here l1 if1 if2| |
|
2632 |
||
2633 |
sel := self getSelectedFileName. |
|
2634 |
||
2635 |
orgName1 := ''. |
|
2636 |
(sel size > 0) ifTrue:[ |
|
2138 | 2637 |
orgName1 := sel |
1834 | 2638 |
]. |
2639 |
||
2640 |
name1 := orgName1 asValue. |
|
2641 |
name2 := '' asValue. |
|
2642 |
||
2643 |
box := DialogBox new. |
|
2644 |
(box addTextLabel:'Create symbolic link to:') adjust:#left. |
|
2645 |
if1 := box addFilenameInputFieldOn:name1 in:here tabable:true. |
|
2646 |
(box addTextLabel:'as:') adjust:#left. |
|
2647 |
if2 := box addFilenameInputFieldOn:name2 in:here tabable:true. |
|
2648 |
||
2048 | 2649 |
box addAbortAndOkButtons. |
1834 | 2650 |
|
2651 |
orgName1 size > 0 ifTrue:[ |
|
2138 | 2652 |
box focusOnField:if2. |
1834 | 2653 |
]. |
2654 |
box showAtPointer. |
|
2655 |
||
2656 |
box accepted ifTrue:[ |
|
2138 | 2657 |
name1 := name1 value. |
2658 |
(name1 size == 0) ifTrue:[ |
|
2659 |
err := 'no name entered'. |
|
2660 |
] ifFalse:[ |
|
2661 |
f1 := name1 asFilename. |
|
2662 |
name2 := name2 value. |
|
2663 |
(name2 size == 0) ifTrue:[ |
|
2664 |
err := 'no name entered'. |
|
2665 |
] ifFalse:[ |
|
2666 |
f2 := name2 asFilename. |
|
2667 |
f2 exists ifTrue:[ |
|
2668 |
err := '''%2'' already exists'. |
|
2669 |
] ifFalse:[ |
|
2670 |
f1 exists ifFalse:[ |
|
2671 |
err := '''%1'' does not exist (link created anyway)'. |
|
2672 |
]. |
|
2673 |
ErrorSignal handle:[:ex | |
|
2674 |
err := ex errorString |
|
2675 |
] do:[ |
|
2676 |
OperatingSystem createSymbolicLinkFrom:name1 to:name2 |
|
2677 |
] |
|
2678 |
] |
|
2679 |
] |
|
2680 |
]. |
|
2681 |
||
2682 |
err notNil ifTrue:[ |
|
2683 |
self warn:(resources string:err with:(name1 ? '') asText allBold with:(name2 ? '') asText allBold). |
|
2684 |
^ self |
|
2685 |
]. |
|
1834 | 2686 |
]. |
2687 |
||
2688 |
"Modified: / 13.8.1998 / 21:26:59 / cg" |
|
2689 |
"Created: / 13.8.1998 / 21:47:14 / cg" |
|
2690 |
! |
|
2691 |
||
2186 | 2692 |
openASN1Browser |
2693 |
self openTool:OSI::ASN1Browser |
|
2694 |
||
2695 |
"Modified: / 7.9.1998 / 21:31:58 / cg" |
|
2696 |
! |
|
2697 |
||
1286
2a464093d865
added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents:
1272
diff
changeset
|
2698 |
openAppletViewer |
2a464093d865
added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents:
1272
diff
changeset
|
2699 |
|numItems| |
2a464093d865
added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents:
1272
diff
changeset
|
2700 |
|
2a464093d865
added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents:
1272
diff
changeset
|
2701 |
(numItems := fileListView selection size) > 2 ifTrue:[ |
2138 | 2702 |
(self |
2703 |
confirm:(resources string:'open for each of the %1 items ?' |
|
2704 |
with:numItems)) ifFalse:[^ self]. |
|
1286
2a464093d865
added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents:
1272
diff
changeset
|
2705 |
]. |
2a464093d865
added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents:
1272
diff
changeset
|
2706 |
|
1942 | 2707 |
Java startupJavaSystem. |
2708 |
"/ Java markAllClassesUninitialized. |
|
2709 |
"/ Java initAllStaticFields. |
|
2710 |
"/ Java initAllClasses. |
|
1286
2a464093d865
added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents:
1272
diff
changeset
|
2711 |
|
2a464093d865
added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents:
1272
diff
changeset
|
2712 |
self selectedFilesDo:[:fileName | |
2138 | 2713 |
|p path| |
2714 |
||
2715 |
path := currentDirectory filenameFor:fileName. |
|
2716 |
path isDirectory ifFalse:[ |
|
2717 |
p := Java |
|
2718 |
javaProcessForMainOf:(Java classForName:'sun.applet.AppletViewer') |
|
2719 |
argumentString:path pathName. |
|
2720 |
p resume. |
|
2721 |
] |
|
1286
2a464093d865
added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents:
1272
diff
changeset
|
2722 |
]. |
2a464093d865
added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents:
1272
diff
changeset
|
2723 |
|
1942 | 2724 |
"Modified: / 18.9.1997 / 17:00:59 / stefan" |
2725 |
"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
|
2726 |
! |
2a464093d865
added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents:
1272
diff
changeset
|
2727 |
|
172 | 2728 |
openChangesBrowser |
2729 |
"open a change browser on the selected file(s)" |
|
2730 |
||
1939
5947fefec5af
care for newChangesBrowser setting
Claus Gittinger <cg@exept.de>
parents:
1933
diff
changeset
|
2731 |
self openTool:(UserPreferences current changesBrowserClass) |
5947fefec5af
care for newChangesBrowser setting
Claus Gittinger <cg@exept.de>
parents:
1933
diff
changeset
|
2732 |
|
5947fefec5af
care for newChangesBrowser setting
Claus Gittinger <cg@exept.de>
parents:
1933
diff
changeset
|
2733 |
"Modified: / 17.10.1998 / 14:39:15 / cg" |
172 | 2734 |
! |
2735 |
||
252 | 2736 |
openDiffView |
2737 |
"open a diff-view" |
|
2738 |
||
1736
36cab4d1d655
remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents:
1735
diff
changeset
|
2739 |
|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
|
2740 |
|
36cab4d1d655
remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents:
1735
diff
changeset
|
2741 |
sel := self getSelectedFileName. |
36cab4d1d655
remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents:
1735
diff
changeset
|
2742 |
|
36cab4d1d655
remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents:
1735
diff
changeset
|
2743 |
orgName1 := ''. |
36cab4d1d655
remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents:
1735
diff
changeset
|
2744 |
(sel size > 0 |
36cab4d1d655
remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents:
1735
diff
changeset
|
2745 |
and:[lastFileDiffDirectory notNil |
36cab4d1d655
remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents:
1735
diff
changeset
|
2746 |
and:[lastFileDiffDirectory asFilename isDirectory]]) ifTrue:[ |
2140
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
2747 |
f := lastFileDiffDirectory asFilename construct:sel. |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
2748 |
(f exists |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
2749 |
and:[f isReadable]) ifTrue:[ |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
2750 |
orgName1 := f name |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
2751 |
] |
1736
36cab4d1d655
remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents:
1735
diff
changeset
|
2752 |
]. |
36cab4d1d655
remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents:
1735
diff
changeset
|
2753 |
|
36cab4d1d655
remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents:
1735
diff
changeset
|
2754 |
name1 := orgName1 asValue. |
252 | 2755 |
name2 := self getSelectedFileName asValue. |
2756 |
here := currentDirectory pathName. |
|
2757 |
||
2758 |
box := DialogBox new. |
|
1852 | 2759 |
(box addTextLabel:'show difference between:\\file1 (empty for views contents):' withCRs) adjust:#left. |
252 | 2760 |
box addFilenameInputFieldOn:name1 in:here tabable:true. |
1852 | 2761 |
(box addTextLabel:'and file2:') adjust:#left. |
252 | 2762 |
box addFilenameInputFieldOn:name2 in:here tabable:true. |
2763 |
||
2048 | 2764 |
box addAbortAndOkButtons. |
252 | 2765 |
|
2766 |
box showAtPointer. |
|
2767 |
||
2768 |
box accepted ifTrue:[ |
|
2140
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
2769 |
name1 := name1 value. |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
2770 |
(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
|
2771 |
"/ text1 := subView contents. |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
2772 |
text1 := subView list asStringCollection withTabs. |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
2773 |
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
|
2774 |
name1 := nil. |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
2775 |
l1 := 'browser contents' |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
2776 |
] ifFalse:[ |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
2777 |
name1 := currentDirectory filenameFor:name1. |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
2778 |
name1 isReadable ifFalse:[ |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
2779 |
nm := name1. |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
2780 |
name1 exists ifFalse:[ |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
2781 |
err := '%1 does not exist'. |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
2782 |
] ifTrue:[ |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
2783 |
err := '%1 is not readable' |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
2784 |
]. |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
2785 |
]. |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
2786 |
l1 := name1 pathName |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
2787 |
]. |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
2788 |
|
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
2789 |
name2 := currentDirectory filenameFor:name2 value. |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
2790 |
err isNil ifTrue:[ |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
2791 |
name2 isReadable ifFalse:[ |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
2792 |
nm := name2. |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
2793 |
name2 exists ifFalse:[ |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
2794 |
err := '%1 does not exist'. |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
2795 |
] ifTrue:[ |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
2796 |
err := '%1 is not readable' |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
2797 |
]. |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
2798 |
]. |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
2799 |
]. |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
2800 |
err notNil ifTrue:[ |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
2801 |
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
|
2802 |
^ self |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
2803 |
]. |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
2804 |
|
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
2805 |
self withWaitCursorDo:[ |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
2806 |
(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
|
2807 |
lastFileDiffDirectory := name1 directoryName |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
2808 |
]. |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
2809 |
name1 notNil ifTrue:[ |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
2810 |
text1 := name1 contents. |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
2811 |
]. |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
2812 |
text2 := name2 contents. |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
2813 |
text1 = text2 ifTrue:[ |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
2814 |
self information:'same contents' |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
2815 |
] ifFalse:[ |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
2816 |
d := DiffTextView |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
2817 |
openOn:text1 label:l1 |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
2818 |
and:text2 label:name2 pathName. |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
2819 |
d label:'file differences'. |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
2820 |
] |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
2821 |
] |
252 | 2822 |
]. |
2823 |
||
1735
57ebbb06fcd7
only show an infoBox, if files have the same contents
Claus Gittinger <cg@exept.de>
parents:
1732
diff
changeset
|
2824 |
"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
|
2825 |
"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
|
2826 |
"Modified: / 5.5.1999 / 16:04:10 / cg" |
267 | 2827 |
! |
2828 |
||
2829 |
openEditor |
|
2830 |
self openTool:EditTextView |
|
2831 |
! |
|
2832 |
||
2833 |
openHTMLReader |
|
1874 | 2834 |
self openTool:HTMLDocumentView ignoreDirectories:false |
2835 |
||
2836 |
"Modified: / 7.9.1998 / 21:31:58 / cg" |
|
267 | 2837 |
! |
2838 |
||
1834 | 2839 |
openImageEditor |
1874 | 2840 |
[self loadImageAndPerform:#edit] fork |
1834 | 2841 |
|
2842 |
"Modified: / 17.9.1995 / 17:41:24 / claus" |
|
2843 |
"Modified: / 18.9.1997 / 17:05:04 / stefan" |
|
2844 |
"Created: / 13.8.1998 / 22:07:09 / cg" |
|
1874 | 2845 |
"Modified: / 7.9.1998 / 21:31:41 / cg" |
1834 | 2846 |
! |
2847 |
||
267 | 2848 |
openImageInspector |
1874 | 2849 |
[self loadImageAndPerform:#inspect] fork |
1853 | 2850 |
|
2851 |
"Modified: / 17.9.1995 / 17:41:24 / claus" |
|
2852 |
"Modified: / 18.9.1997 / 17:05:04 / stefan" |
|
1874 | 2853 |
"Modified: / 7.9.1998 / 21:31:30 / cg" |
267 | 2854 |
! |
2855 |
||
1964 | 2856 |
openImagePreview |
2857 |
[self loadImageAndPerform:[:img | |
|
2138 | 2858 |
|i top viewer| |
2859 |
||
2860 |
top := StandardSystemView new. |
|
2861 |
||
2862 |
viewer := ImageView origin:0.0@0.0 corner:1.0@1.0 in:top. |
|
2863 |
i := img. |
|
2864 |
top extent:200@200. |
|
2865 |
top label:(img fileName asFilename directoryName asFilename baseName , '/' , img fileName asFilename baseName). |
|
2866 |
top openAndWait. |
|
2867 |
||
2868 |
(i width > 200 or:[i height > 200]) ifTrue:[ |
|
2869 |
i := i magnifiedPreservingRatioTo:200@200. |
|
2870 |
]. |
|
2871 |
viewer image:i. |
|
2872 |
]. |
|
1964 | 2873 |
] fork |
1969 | 2874 |
|
2875 |
"Modified: / 4.12.1998 / 15:49:03 / cg" |
|
1964 | 2876 |
! |
2877 |
||
1994 | 2878 |
openSelectedFilename |
2879 |
|sel| |
|
2880 |
||
2881 |
sel := subView selection. |
|
2882 |
sel notNil ifTrue:[ |
|
2138 | 2883 |
sel := sel asString withoutSeparators. |
2884 |
sel asFilename exists ifTrue:[ |
|
2885 |
self doOpenFile:sel viaDoubleClick:false |
|
2886 |
] |
|
1994 | 2887 |
]. |
2888 |
||
2889 |
"Created: / 4.2.1999 / 17:40:42 / cg" |
|
2890 |
"Modified: / 4.2.1999 / 17:47:06 / cg" |
|
2891 |
! |
|
2892 |
||
1731 | 2893 |
openTerminal |
1732 | 2894 |
VT100TerminalView openShellIn:currentDirectory |
1731 | 2895 |
|
2896 |
"Created: / 20.7.1998 / 18:18:15 / cg" |
|
1732 | 2897 |
"Modified: / 20.7.1998 / 18:32:28 / cg" |
1731 | 2898 |
! |
2899 |
||
267 | 2900 |
openTool:aToolClass |
2901 |
"open a tool on the selected file(s)" |
|
2902 |
||
2015 | 2903 |
^ self openTool:aToolClass ignoreDirectories:true |
1874 | 2904 |
|
2905 |
"Modified: / 7.9.1998 / 19:32:10 / cg" |
|
2906 |
! |
|
2907 |
||
2908 |
openTool:aToolClass ignoreDirectories:ignoreDirs |
|
2909 |
"open a tool on the selected file(s)" |
|
2910 |
||
2015 | 2911 |
|numItems path tool| |
865
48395e8ecca9
remember executeCommand actions in history as well.
Claus Gittinger <cg@exept.de>
parents:
851
diff
changeset
|
2912 |
|
1883 | 2913 |
aToolClass isNil ifTrue:[ |
2170 | 2914 |
self warn:'Sorry, that tool seems to be not available'. |
2915 |
^ nil. |
|
1883 | 2916 |
]. |
2917 |
||
865
48395e8ecca9
remember executeCommand actions in history as well.
Claus Gittinger <cg@exept.de>
parents:
851
diff
changeset
|
2918 |
(numItems := fileListView selection size) > 2 ifTrue:[ |
2170 | 2919 |
(self |
2920 |
confirm:(resources string:'open for each of the %1 items ?' |
|
2921 |
with:numItems)) ifFalse:[^ self]. |
|
865
48395e8ecca9
remember executeCommand actions in history as well.
Claus Gittinger <cg@exept.de>
parents:
851
diff
changeset
|
2922 |
]. |
48395e8ecca9
remember executeCommand actions in history as well.
Claus Gittinger <cg@exept.de>
parents:
851
diff
changeset
|
2923 |
|
267 | 2924 |
self selectedFilesDo:[:fileName | |
2170 | 2925 |
path := currentDirectory filenameFor:fileName. |
2926 |
(ignoreDirs not |
|
2927 |
or:[path isDirectory not]) ifTrue:[ |
|
2928 |
tool := aToolClass openOn:(path pathName). |
|
2929 |
] |
|
267 | 2930 |
]. |
2015 | 2931 |
^ tool |
865
48395e8ecca9
remember executeCommand actions in history as well.
Claus Gittinger <cg@exept.de>
parents:
851
diff
changeset
|
2932 |
|
1874 | 2933 |
"Modified: / 18.9.1997 / 17:06:18 / stefan" |
2934 |
"Created: / 7.9.1998 / 19:31:49 / cg" |
|
2170 | 2935 |
"Modified: / 25.5.1999 / 16:30:35 / cg" |
1156
f3df28086973
dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents:
1154
diff
changeset
|
2936 |
! |
f3df28086973
dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents:
1154
diff
changeset
|
2937 |
|
1853 | 2938 |
openZipTool |
2015 | 2939 |
|zipTool| |
2940 |
||
2170 | 2941 |
(zipTool := self openTool:ZipTool) notNil ifTrue:[ |
2942 |
zipTool initialExtractDirectory:currentDirectory |
|
2943 |
]. |
|
1853 | 2944 |
|
2945 |
"Created: / 26.8.1998 / 16:20:55 / cg" |
|
2170 | 2946 |
"Modified: / 25.5.1999 / 16:30:54 / cg" |
1853 | 2947 |
! |
2948 |
||
1156
f3df28086973
dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents:
1154
diff
changeset
|
2949 |
showOrHideTabView |
f3df28086973
dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents:
1154
diff
changeset
|
2950 |
"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
|
2951 |
|
1834 | 2952 |
showingDetails value "showLongList" ifTrue:[ |
1868 | 2953 |
tabRulerView isNil ifTrue:[ |
2954 |
self createTabRulerIn:scrollView superView. |
|
2955 |
]. |
|
2956 |
tabRulerView beVisible. |
|
1758 | 2957 |
|
1868 | 2958 |
false "self is3D" ifTrue:[ |
2959 |
scrollView topInset:(tabRulerView superView height). |
|
2960 |
tabRulerView superView leftInset:(fileListView originRelativeTo:scrollView) x. |
|
2961 |
] ifFalse:[ |
|
2962 |
scrollView topInset:(tabRulerView height). |
|
2963 |
tabRulerView leftInset:(fileListView originRelativeTo:scrollView) x. |
|
2964 |
]. |
|
2965 |
tabRulerView hiddenTabs:#(1). |
|
2966 |
tabRulerView fixedTabs:#(1). |
|
1156
f3df28086973
dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents:
1154
diff
changeset
|
2967 |
] ifFalse:[ |
1868 | 2968 |
tabRulerView notNil ifTrue:[ |
2969 |
tabRulerView beInvisible. |
|
2970 |
]. |
|
2971 |
scrollView topInset:0 |
|
1156
f3df28086973
dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents:
1154
diff
changeset
|
2972 |
]. |
f3df28086973
dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents:
1154
diff
changeset
|
2973 |
tabSpec := nil. |
f3df28086973
dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents:
1154
diff
changeset
|
2974 |
|
1758 | 2975 |
"Created: / 19.4.1997 / 09:50:02 / cg" |
1834 | 2976 |
"Modified: / 4.8.1998 / 13:44:14 / cg" |
172 | 2977 |
! ! |
2978 |
||
2979 |
!FileBrowser methodsFor:'help '! |
|
2980 |
||
2981 |
helpTextFor:aComponent |
|
2982 |
|s| |
|
2983 |
||
2984 |
aComponent == subView ifTrue:[ |
|
1317 | 2985 |
s := 'HELP_SUBVIEW' |
172 | 2986 |
]. |
2987 |
aComponent == fileListView ifTrue:[ |
|
1317 | 2988 |
s := 'HELP_FILELIST' |
172 | 2989 |
]. |
2990 |
aComponent == filterField ifTrue:[ |
|
1317 | 2991 |
s := 'HELP_FILTER' |
172 | 2992 |
]. |
2993 |
aComponent == labelView ifTrue:[ |
|
1317 | 2994 |
s := 'HELP_PATHFIELD' |
172 | 2995 |
]. |
2996 |
aComponent == commandView ifTrue:[ |
|
1317 | 2997 |
s := 'HELP_COMMANDVIEW' |
172 | 2998 |
]. |
2999 |
s notNil ifTrue:[ |
|
1317 | 3000 |
^ resources string:s |
172 | 3001 |
]. |
3002 |
^ nil |
|
3003 |
! ! |
|
3004 |
||
2116 | 3005 |
!FileBrowser methodsFor:'initialize / release'! |
36 | 3006 |
|
1758 | 3007 |
createTabRulerIn:topFrame |
3008 |
|v| |
|
3009 |
||
3010 |
false "self is3D" ifTrue:[ |
|
1868 | 3011 |
v := View in:topFrame. |
3012 |
v level:-1. |
|
3013 |
tabRulerView := TabSpecRuler in:v. |
|
3014 |
tabRulerView level:1. |
|
3015 |
v origin:(0.0@0.0) corner:(1.0@10). |
|
3016 |
tabRulerView origin:(0.0@0.0) corner:(1.0@1.0). |
|
1758 | 3017 |
] ifFalse:[ |
1868 | 3018 |
tabRulerView := TabSpecRuler in:topFrame. |
3019 |
tabRulerView origin:(0.0@0.0) corner:(1.0@10). |
|
1758 | 3020 |
]. |
3021 |
tabRulerView borderWidth:0. |
|
3022 |
tabRulerView synchronousOperation:true. |
|
3023 |
||
3024 |
"Created: / 27.7.1998 / 20:23:10 / cg" |
|
3025 |
"Modified: / 27.7.1998 / 20:30:10 / cg" |
|
3026 |
! |
|
3027 |
||
172 | 3028 |
currentDirectory:aDirectoryPath |
3029 |
"set the directory to be browsed" |
|
3030 |
||
2216
b84ee099f484
dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
3031 |
|newDirectory| |
b84ee099f484
dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
3032 |
|
b84ee099f484
dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
3033 |
newDirectory := aDirectoryPath asFilename. |
b84ee099f484
dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
3034 |
newDirectory = currentDirectory ifTrue:[ |
b84ee099f484
dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
3035 |
^ self |
b84ee099f484
dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
3036 |
]. |
b84ee099f484
dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
3037 |
|
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
3038 |
currentDirectory := aDirectoryPath asFilename. |
172 | 3039 |
self changed:#path. |
1327 | 3040 |
|
172 | 3041 |
" |
3042 |
tell my subview (whatever that is) to start its file-dialog |
|
3043 |
(i.e. save-as etc.) in that directory |
|
3044 |
" |
|
3045 |
(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
|
3046 |
subView directoryForFileDialog:currentDirectory |
172 | 3047 |
] |
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
3048 |
|
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
3049 |
"Modified: 16.9.1997 / 14:56:17 / stefan" |
1327 | 3050 |
"Modified: 21.9.1997 / 11:28:49 / cg" |
172 | 3051 |
! |
3052 |
||
2116 | 3053 |
destroy |
3054 |
"destroy view and boxes" |
|
3055 |
||
3056 |
ObjectMemory removeDependent:self. |
|
3057 |
self stopUpdateProcess. |
|
3058 |
self stopImageRenderProcess. |
|
3059 |
checkBlock := nil. |
|
3060 |
super destroy |
|
3061 |
||
3062 |
"Modified: 19.4.1997 / 13:51:48 / cg" |
|
3063 |
! |
|
3064 |
||
172 | 3065 |
focusSequence |
3066 |
"return the sequence in which ALT-CursorRight steps focus" |
|
3067 |
||
3068 |
|fs| |
|
3069 |
||
3070 |
fs := Array |
|
1418 | 3071 |
with:labelView |
1317 | 3072 |
with:filterField |
3073 |
with:fileListView |
|
3074 |
with:subView. |
|
172 | 3075 |
|
3076 |
commandView notNil ifTrue:[ |
|
1317 | 3077 |
fs := fs copyWith:commandView |
172 | 3078 |
]. |
3079 |
^fs |
|
3080 |
! |
|
3081 |
||
3082 |
initEvents |
|
3083 |
super initEvents. |
|
3084 |
self enableEvent:#visibilityChange. |
|
3085 |
! |
|
3086 |
||
36 | 3087 |
initialize |
1102 | 3088 |
|frame spacing halfSpacing v topFrame labelFrame filterModel |
2094 | 3089 |
buttonPanel img mH menuPanel lowerFrame| |
36 | 3090 |
|
3091 |
super initialize. |
|
3092 |
||
819
b78a26650047
initialize fileEncoding to #iso8859
Claus Gittinger <cg@exept.de>
parents:
807
diff
changeset
|
3093 |
fileEncoding := #iso8859. "/ native ST/X encoding |
386
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
3094 |
|
52 | 3095 |
"if true, will replace leading spaces by tabs on |
3096 |
file write. If false, they will be written as spaces |
|
3097 |
" |
|
3098 |
compressTabs := resources at:'COMPRESS_TABS' default:true. |
|
3099 |
||
3100 |
" |
|
3101 |
showing long or short by default |
|
3102 |
" |
|
1834 | 3103 |
"/ showLongList := resources at:'LONG_LIST' default:false. |
3104 |
showingDetails := (resources at:'LONG_LIST' default:false) asValue. |
|
3105 |
showingDetails onChangeSend:#detailsSettingChanged to:self. |
|
52 | 3106 |
|
3107 |
" |
|
3108 |
show hidden files or not ? |
|
3109 |
" |
|
1834 | 3110 |
"/ showDotFiles := resources at:'SHOW_DOT_FILES' default:false. |
3111 |
showingHiddenFiles := (resources at:'SHOW_DOT_FILES' default:false) asValue. |
|
3112 |
showingHiddenFiles onChangeSend:#updateCurrentDirectory to:self. |
|
3113 |
||
2031 | 3114 |
" |
3115 |
showing small icons by default |
|
3116 |
" |
|
3117 |
showingBigImagePreview := (resources at:'BIG_IMAGE_PREVIEW' default:false) asValue. |
|
3118 |
showingBigImagePreview onChangeSend:#bigImagePreviewSettingChanged to:self. |
|
3119 |
||
1834 | 3120 |
sortByWhat := #name asValue. |
3121 |
sortByWhat onChangeSend:#sortChanged to:self. |
|
3122 |
||
3123 |
sortCaseless := (Filename isCaseSensitive not) asValue. |
|
3124 |
sortCaseless onChangeSend:#updateCurrentDirectory to:self. |
|
52 | 3125 |
|
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
3126 |
dosEOLMode := false asValue. |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
3127 |
|
45 | 3128 |
lockUpdate := false. |
3129 |
||
132 | 3130 |
CommandHistory isNil ifTrue:[ |
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
3131 |
CommandHistory := OrderedCollection new. |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
3132 |
CommandHistorySize := 50 |
132 | 3133 |
]. |
36 | 3134 |
DirectoryHistory isNil ifTrue:[ |
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
3135 |
DirectoryHistory := OrderedCollection new. |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
3136 |
DirectoryHistoryWhere := OrderedCollection new. |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
3137 |
HistorySize := 15. |
36 | 3138 |
]. |
132 | 3139 |
commandIndex := 0. |
36 | 3140 |
|
1784
329e3a904236
ask MIMETypes when mapping suffixes to icons.
Claus Gittinger <cg@exept.de>
parents:
1758
diff
changeset
|
3141 |
icons := Dictionary new. |
1495 | 3142 |
|
3143 |
Icons isNil ifTrue:[ |
|
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
3144 |
self class initializeIcons |
1495 | 3145 |
]. |
3146 |
||
36 | 3147 |
myName := (resources string:self class name). |
3148 |
self label:myName. |
|
45 | 3149 |
|
1834 | 3150 |
menuPanel := MenuPanel in:self. |
1835 | 3151 |
menuPanel level:1. |
1834 | 3152 |
menuPanel verticalLayout:false. |
3153 |
menuPanel receiver:self. |
|
3154 |
menuPanel menu:(self pullDownMenu). |
|
2050 | 3155 |
|
1834 | 3156 |
mH := menuPanel preferredExtent y. |
1846
6b66290db627
geometry fixes for win95 style
Claus Gittinger <cg@exept.de>
parents:
1845
diff
changeset
|
3157 |
menuPanel origin:(0.0 @ 0.0) corner:(1.0 @ (mH)). |
1834 | 3158 |
|
93 | 3159 |
labelFrame := View |
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
3160 |
origin:(0.0 @ mH) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
3161 |
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
|
3162 |
in:self. |
52 | 3163 |
|
1846
6b66290db627
geometry fixes for win95 style
Claus Gittinger <cg@exept.de>
parents:
1845
diff
changeset
|
3164 |
(styleSheet name = #st80 or:[styleSheet name == #win95]) ifTrue:[ |
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
3165 |
labelFrame level:1. |
1879 | 3166 |
"/ labelFrame rightInset:-1. |
45 | 3167 |
]. |
36 | 3168 |
|
3169 |
spacing := ViewSpacing. |
|
3170 |
halfSpacing := spacing // 2. |
|
3171 |
||
1100
d9382b49c62d
Use #pushEvent: for timer handling.
Stefan Vogel <sv@exept.de>
parents:
1091
diff
changeset
|
3172 |
" |
d9382b49c62d
Use #pushEvent: for timer handling.
Stefan Vogel <sv@exept.de>
parents:
1091
diff
changeset
|
3173 |
checkBlock is executed by the Processor every checkDelta seconds. |
d9382b49c62d
Use #pushEvent: for timer handling.
Stefan Vogel <sv@exept.de>
parents:
1091
diff
changeset
|
3174 |
We use #pushEvent: to perform the directory update |
d9382b49c62d
Use #pushEvent: for timer handling.
Stefan Vogel <sv@exept.de>
parents:
1091
diff
changeset
|
3175 |
in our windowgroups process. |
d9382b49c62d
Use #pushEvent: for timer handling.
Stefan Vogel <sv@exept.de>
parents:
1091
diff
changeset
|
3176 |
" |
d9382b49c62d
Use #pushEvent: for timer handling.
Stefan Vogel <sv@exept.de>
parents:
1091
diff
changeset
|
3177 |
checkBlock := [self pushEvent:#checkIfDirectoryHasChanged]. |
45 | 3178 |
checkDelta := resources at:'CHECK_DELTA' default:10. |
36 | 3179 |
|
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
3180 |
currentDirectory := Filename currentDirectory. |
36 | 3181 |
|
344
3f881dbee13a
use a model for the filter field
Claus Gittinger <cg@exept.de>
parents:
333
diff
changeset
|
3182 |
filterModel := '*' asValue. |
45 | 3183 |
filterField := EditField in:labelFrame. |
1071 | 3184 |
filterField |
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
3185 |
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
|
3186 |
corner:(1.0 @ (filterField heightIncludingBorder + halfSpacing) ). |
1846
6b66290db627
geometry fixes for win95 style
Claus Gittinger <cg@exept.de>
parents:
1845
diff
changeset
|
3187 |
filterField rightInset:(ViewSpacing - halfSpacing). |
344
3f881dbee13a
use a model for the filter field
Claus Gittinger <cg@exept.de>
parents:
333
diff
changeset
|
3188 |
filterField model:filterModel. |
45 | 3189 |
|
1846
6b66290db627
geometry fixes for win95 style
Claus Gittinger <cg@exept.de>
parents:
1845
diff
changeset
|
3190 |
labelFrame corner:(1.0 @ (mH + ViewSpacing + filterField height + halfSpacing)). |
6b66290db627
geometry fixes for win95 style
Claus Gittinger <cg@exept.de>
parents:
1845
diff
changeset
|
3191 |
|
36 | 3192 |
self initializeFilterPattern. |
344
3f881dbee13a
use a model for the filter field
Claus Gittinger <cg@exept.de>
parents:
333
diff
changeset
|
3193 |
filterModel onChangeSend:#filterPatternChanged to:self. |
3f881dbee13a
use a model for the filter field
Claus Gittinger <cg@exept.de>
parents:
333
diff
changeset
|
3194 |
"/ filterField leaveAction:[:key | fileListView scrollToTop. self updateCurrentDirectory]. |
36 | 3195 |
|
1327 | 3196 |
"/ labelView := Label in:labelFrame. |
3197 |
"/ labelView origin:(halfSpacing @ halfSpacing) |
|
3198 |
"/ extent:[((width // 4 * 3) - spacing - borderWidth) |
|
3199 |
"/ @ |
|
3200 |
"/ (filterField heightIncludingBorder) |
|
3201 |
"/ "(font height + font descent)" |
|
3202 |
"/ ]. |
|
3203 |
"/ labelView adjust:#right. |
|
3204 |
"/ labelView borderWidth:0. |
|
3205 |
"/ labelView model:self; menu:#labelMenu; aspect:#path; labelMessage:#path. |
|
3206 |
"/ labelFrame model:self; menu:#labelMenu. |
|
3207 |
||
3208 |
labelView := FilenameEditField in:labelFrame. |
|
3209 |
labelView |
|
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
3210 |
origin:(halfSpacing @ (halfSpacing)) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
3211 |
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
|
3212 |
@ |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
3213 |
(filterField heightIncludingBorder) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
3214 |
"(font height + font descent)" |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
3215 |
]. |
1834 | 3216 |
labelView menu:#labelMenu; |
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
3217 |
aspect:#path; changeMessage:#pathChanged:. |
1327 | 3218 |
labelView model:self. |
2216
b84ee099f484
dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
3219 |
labelView acceptOnExpand:true. |
1327 | 3220 |
labelView backgroundColor:(labelFrame viewBackground). |
73 | 3221 |
labelFrame model:self; menu:#labelMenu. |
1329 | 3222 |
labelView cursorType:#solidCaret; cursorTypeNoFocus:#none. |
3223 |
labelView level:0. |
|
3224 |
labelView borderWidth:0. |
|
3225 |
||
3226 |
killButton := Button label:(resources string:'kill') in:self. |
|
3227 |
"/ killButton origin:(halfSpacing @ halfSpacing) |
|
3228 |
"/ extent:(killButton width @ filterField height). |
|
3229 |
killButton origin:(halfSpacing @ 1.0). |
|
3230 |
killButton topInset:(killButton height negated). |
|
3231 |
killButton beInvisible. |
|
3232 |
||
3233 |
pauseToggle := Toggle label:(resources string:'pause') in:self. |
|
3234 |
"/ pauseToggle origin:((killButton corner x + 50) @ halfSpacing) |
|
3235 |
"/ extent:(pauseToggle width @ filterField height). |
|
3236 |
pauseToggle origin:((killButton corner x + ViewSpacing + 20) @ 1.0). |
|
3237 |
pauseToggle topInset:(pauseToggle height negated). |
|
3238 |
pauseToggle beInvisible. |
|
36 | 3239 |
|
132 | 3240 |
self initializeCommandViewIn:self. |
3241 |
||
3242 |
"/ frame := VariableVerticalPanel |
|
3243 |
"/ origin:[frame borderWidth negated |
|
3244 |
"/ @ |
|
3245 |
"/ labelFrame height |
|
3246 |
"/ "/ (labelView height + labelView origin y + spacing) |
|
3247 |
"/ ] |
|
3248 |
"/ corner:(1.0 @ 1.0) |
|
3249 |
"/ in:self. |
|
3250 |
||
1834 | 3251 |
frame := VariableVerticalPanel origin:0.0@mH corner:1.0@1.0 in:self. |
132 | 3252 |
frame topInset:labelFrame height. |
3253 |
commandView notNil ifTrue:[ |
|
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
3254 |
frame bottomInset:(commandView height + spacing + spacing) |
132 | 3255 |
]. |
36 | 3256 |
|
1102 | 3257 |
topFrame := View in:frame. |
36 | 3258 |
topFrame origin:(0.0 @ 0.0) corner:(1.0 @ 0.3). |
3259 |
||
1758 | 3260 |
false ifTrue:[ |
3261 |
self createTabRulerIn:topFrame. |
|
3262 |
]. |
|
1102 | 3263 |
|
3264 |
scrollView := ScrollableView in:topFrame. |
|
3265 |
scrollView origin:(0.0 @ 0.0) corner:(1.0 @ 1.0). |
|
3266 |
||
3267 |
fileListView := SelectionInListView new. |
|
3268 |
scrollView scrolledView:fileListView. |
|
36 | 3269 |
fileListView action:[:lineNr | self fileSelect:lineNr]. |
1326 | 3270 |
fileListView doubleClickAction:[:lineNr | self fileDoubleClick:lineNr]. |
36 | 3271 |
fileListView multipleSelectOk:true. |
1010 | 3272 |
fileListView delegate:self. |
98 | 3273 |
fileListView menuHolder:self; menuPerformer:self; menuMessage:#fileListMenu. |
1122
970fc7e88639
support drag out of my list.
Claus Gittinger <cg@exept.de>
parents:
1120
diff
changeset
|
3274 |
fileListView allowDrag:true. |
1156
f3df28086973
dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents:
1154
diff
changeset
|
3275 |
fileListView dragObjectConverter:[:obj | |
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
3276 |
|dir nm path idx| |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
3277 |
|
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
3278 |
nm := obj theObject asString. |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
3279 |
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
|
3280 |
idx == 0 ifTrue:[ |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
3281 |
"/ cannot happen ... |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
3282 |
nil |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
3283 |
] ifFalse:[ |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
3284 |
nm := fileList at:idx. |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
3285 |
dir := currentDirectory pathName asFilename. |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
3286 |
path := dir constructString:nm. |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
3287 |
DropObject newFile:path. |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
3288 |
] |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
3289 |
]. |
1158
ea2cd788ef59
delay tabView origin setting
Claus Gittinger <cg@exept.de>
parents:
1157
diff
changeset
|
3290 |
|
ea2cd788ef59
delay tabView origin setting
Claus Gittinger <cg@exept.de>
parents:
1157
diff
changeset
|
3291 |
"/ sigh - must be delayed - origin is not yet fixe |
ea2cd788ef59
delay tabView origin setting
Claus Gittinger <cg@exept.de>
parents:
1157
diff
changeset
|
3292 |
"/ tabRulerView leftInset:(fileListView originRelativeTo:scrollView) x. |
ea2cd788ef59
delay tabView origin setting
Claus Gittinger <cg@exept.de>
parents:
1157
diff
changeset
|
3293 |
"/ self showOrHideTabView. |
1102 | 3294 |
|
2094 | 3295 |
lowerFrame := View in:frame. |
3296 |
lowerFrame origin:(0.0 @ 0.3) corner:(1.0 @ 1.0). |
|
3297 |
||
3298 |
v := self initializeSubViewIn:lowerFrame. |
|
3299 |
||
36 | 3300 |
subView := v scrolledView. |
3301 |
(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
|
3302 |
subView directoryForFileDialog:currentDirectory |
36 | 3303 |
]. |
3304 |
||
1329 | 3305 |
"/ buttonPanel := HorizontalPanelView in:self. |
3306 |
"/ buttonPanel horizontalLayout:#leftSpace. |
|
3307 |
"/ buttonPanel verticalSpace:0. |
|
3308 |
"/ "/ buttonPanel verticalLayout:#top. |
|
3309 |
"/ buttonPanel borderWidth:0. |
|
3310 |
"/ |
|
3311 |
"/ buttonPanel |
|
3312 |
"/ origin:(0.5 @ halfSpacing) |
|
3313 |
"/ extent:[((width // 4) - spacing - borderWidth) |
|
3314 |
"/ @ |
|
3315 |
"/ (buttonPanel preferredExtent y max:(labelView height)) |
|
3316 |
"/ ]. |
|
3317 |
"/ "/ buttonPanel level:-1. |
|
3318 |
"/ |
|
3319 |
"/ upButton := Button in:buttonPanel. |
|
3320 |
"/ img := Image fromFile:'bitmaps/xpmBitmaps/document_images/tiny_yellow_dir_up.xpm'. |
|
3321 |
"/ upButton label:(img ? 'up'). |
|
3322 |
"/ upButton action:[self changeToParentDirectory]. |
|
1328 | 3323 |
|
36 | 3324 |
ObjectMemory addDependent:self. |
132 | 3325 |
|
1758 | 3326 |
"Modified: / 6.9.1995 / 20:26:06 / claus" |
3327 |
"Modified: / 16.9.1997 / 14:52:46 / stefan" |
|
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
3328 |
"Modified: / 6.5.1999 / 11:38:08 / cg" |
36 | 3329 |
! |
3330 |
||
132 | 3331 |
initializeCommandViewIn:frame |
3332 |
"set up the command view - can be redefined in subclasses as empty, |
|
3333 |
if no commandView is wanted" |
|
3334 |
||
3335 |
||
3336 |
commandView := EditField origin:0.0@1.0 corner:1.0@1.0 in:frame. |
|
1303 | 3337 |
commandView allInset:ViewSpacing//2. |
132 | 3338 |
commandView topInset:(commandView preferredExtent y negated - ViewSpacing). |
3339 |
||
133 | 3340 |
"/ commandView contents:'** no commands which require input here **'. |
132 | 3341 |
|
142 | 3342 |
commandView entryCompletionBlock:[:contents | |
1329 | 3343 |
|newString| |
3344 |
||
3345 |
newString := Filename |
|
3346 |
filenameCompletionFor:contents |
|
3347 |
directory:currentDirectory |
|
3348 |
directoriesOnly:false |
|
3349 |
filesOnly:false |
|
3350 |
ifMultiple:[:dir | commandView flash.]. |
|
3351 |
commandView contents:newString. |
|
3352 |
commandView cursorToEndOfLine. |
|
132 | 3353 |
]. |
3354 |
commandView leaveAction:[:key | |
|
1329 | 3355 |
|cmd nCmd empty| |
3356 |
||
3357 |
(key == #CursorDown |
|
3358 |
or:[key == #CursorUp]) ifTrue:[ |
|
3359 |
nCmd := CommandHistory size. |
|
3360 |
nCmd == 0 ifTrue:[ |
|
3361 |
empty := true |
|
3362 |
] ifFalse:[ |
|
3363 |
key == #CursorUp ifTrue:[ |
|
3364 |
commandIndex == nCmd ifTrue:[ |
|
3365 |
commandView flash. |
|
3366 |
]. |
|
3367 |
commandIndex := (commandIndex + 1) min:nCmd |
|
3368 |
] ifFalse:[ |
|
3369 |
commandIndex == 1 ifTrue:[ |
|
3370 |
commandView flash. |
|
3371 |
empty := true. |
|
3372 |
]. |
|
3373 |
commandIndex := (commandIndex - 1) max:1. |
|
3374 |
]. |
|
3375 |
]. |
|
3376 |
empty == true ifTrue:[ |
|
3377 |
commandView contents:nil |
|
3378 |
] ifFalse:[ |
|
3379 |
commandView contents:(CommandHistory at:commandIndex). |
|
3380 |
] |
|
3381 |
]. |
|
3382 |
key == #Return ifTrue:[ |
|
3383 |
cmd := commandView contents. |
|
3384 |
||
3385 |
subView insertLine:( |
|
3386 |
Text string:('>> ' , cmd) |
|
3387 |
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
|
3388 |
"/ ColoredListEntry string:('>> ' , cmd) color:Color blue |
1329 | 3389 |
) |
3390 |
before:(subView cursorLine). |
|
3391 |
subView cursorDown:1. |
|
133 | 3392 |
|
3393 |
"/ subView insertStringAtCursor:cmd. |
|
3394 |
"/ subView insertCharAtCursor:(Character cr). |
|
132 | 3395 |
|
1329 | 3396 |
(cmd notNil and:[cmd notEmpty]) ifTrue:[ |
3397 |
self class addToCommandHistory:cmd for:nil. |
|
3398 |
self doExecuteCommand:cmd replace:false. |
|
3399 |
commandView contents:nil. |
|
3400 |
commandIndex := 0 |
|
3401 |
] |
|
3402 |
] |
|
132 | 3403 |
]. |
3404 |
||
133 | 3405 |
"Modified: 7.9.1995 / 15:48:45 / claus" |
1303 | 3406 |
"Modified: 30.8.1997 / 19:22:52 / cg" |
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
3407 |
"Modified: 18.9.1997 / 16:55:01 / stefan" |
132 | 3408 |
! |
3409 |
||
172 | 3410 |
initializeFilterPattern |
3411 |
"set an initial matchpattern - can be redefined in subclasses" |
|
3412 |
||
344
3f881dbee13a
use a model for the filter field
Claus Gittinger <cg@exept.de>
parents:
333
diff
changeset
|
3413 |
filterField model value:'*' |
172 | 3414 |
! |
3415 |
||
3416 |
initializeSubViewIn:frame |
|
3417 |
"set up the contents view - can be redefined in subclasses for |
|
3418 |
different view types (SoundFileBrowser/ImageBrowsers etc.)" |
|
3419 |
||
2094 | 3420 |
|textView| |
3421 |
||
3422 |
textView := HVScrollableView |
|
2138 | 3423 |
for:CodeView |
3424 |
miniScrollerH:true |
|
3425 |
miniScrollerV:false |
|
3426 |
in:frame. |
|
2094 | 3427 |
textView origin:(0.0 @ 0.0) corner:(1.0 @ 1.0). |
3428 |
||
2095 | 3429 |
"/ imagePreviewView := HVScrollableView |
3430 |
"/ for:ImageView |
|
3431 |
"/ miniScrollerH:true |
|
3432 |
"/ miniScrollerV:false |
|
3433 |
"/ in:frame. |
|
3434 |
"/ imagePreviewView origin:(0.0 @ 0.0) corner:(1.0 @ 1.0). |
|
3435 |
"/ |
|
3436 |
"/ imagePreviewView beInvisible. |
|
2094 | 3437 |
|
3438 |
^ textView. |
|
1158
ea2cd788ef59
delay tabView origin setting
Claus Gittinger <cg@exept.de>
parents:
1157
diff
changeset
|
3439 |
! |
ea2cd788ef59
delay tabView origin setting
Claus Gittinger <cg@exept.de>
parents:
1157
diff
changeset
|
3440 |
|
1247 | 3441 |
postRealize |
3442 |
super postRealize. |
|
1158
ea2cd788ef59
delay tabView origin setting
Claus Gittinger <cg@exept.de>
parents:
1157
diff
changeset
|
3443 |
self showOrHideTabView. |
ea2cd788ef59
delay tabView origin setting
Claus Gittinger <cg@exept.de>
parents:
1157
diff
changeset
|
3444 |
|
1247 | 3445 |
"Created: 24.7.1997 / 18:13:46 / cg" |
172 | 3446 |
! ! |
3447 |
||
1834 | 3448 |
!FileBrowser methodsFor:'menu actions'! |
3449 |
||
1950 | 3450 |
copyCommandHistory |
3451 |
"copy the command history to the clipBoard" |
|
3452 |
||
3453 |
self setTextSelection:(CommandHistory asStringCollection asString). |
|
3454 |
||
3455 |
"Modified: / 29.10.1998 / 12:17:14 / cg" |
|
3456 |
! |
|
3457 |
||
1837 | 3458 |
copyFileList |
3459 |
"copy fileList to the clipBoard" |
|
3460 |
||
3461 |
self setTextSelection:(fileListView list |
|
1868 | 3462 |
collect:[:l | |ll| |
3463 |
ll := l string withoutSeparators. |
|
3464 |
(ll endsWith:' ...') ifTrue:[ |
|
3465 |
ll copyWithoutLast:4 |
|
3466 |
] ifFalse:[ |
|
3467 |
ll |
|
3468 |
] |
|
3469 |
]) |
|
3470 |
asStringCollection asString. |
|
1837 | 3471 |
|
3472 |
"Modified: / 17.8.1998 / 10:13:10 / cg" |
|
3473 |
! |
|
3474 |
||
1920
adffddc8cfc2
added #copyFilename (to clipboard)
Claus Gittinger <cg@exept.de>
parents:
1912
diff
changeset
|
3475 |
copySelectedFileName |
adffddc8cfc2
added #copyFilename (to clipboard)
Claus Gittinger <cg@exept.de>
parents:
1912
diff
changeset
|
3476 |
"copy the selected filename to the clipBoard (for easy paste)" |
adffddc8cfc2
added #copyFilename (to clipboard)
Claus Gittinger <cg@exept.de>
parents:
1912
diff
changeset
|
3477 |
|
adffddc8cfc2
added #copyFilename (to clipboard)
Claus Gittinger <cg@exept.de>
parents:
1912
diff
changeset
|
3478 |
|sel fileName| |
adffddc8cfc2
added #copyFilename (to clipboard)
Claus Gittinger <cg@exept.de>
parents:
1912
diff
changeset
|
3479 |
|
adffddc8cfc2
added #copyFilename (to clipboard)
Claus Gittinger <cg@exept.de>
parents:
1912
diff
changeset
|
3480 |
sel := fileListView selection. |
adffddc8cfc2
added #copyFilename (to clipboard)
Claus Gittinger <cg@exept.de>
parents:
1912
diff
changeset
|
3481 |
sel size == 1 ifTrue:[ |
2138 | 3482 |
fileName := fileList at:sel first. |
3483 |
self setTextSelection:fileName |
|
1920
adffddc8cfc2
added #copyFilename (to clipboard)
Claus Gittinger <cg@exept.de>
parents:
1912
diff
changeset
|
3484 |
]. |
adffddc8cfc2
added #copyFilename (to clipboard)
Claus Gittinger <cg@exept.de>
parents:
1912
diff
changeset
|
3485 |
! |
adffddc8cfc2
added #copyFilename (to clipboard)
Claus Gittinger <cg@exept.de>
parents:
1912
diff
changeset
|
3486 |
|
1834 | 3487 |
menuExit |
3488 |
self closeRequest |
|
3489 |
||
3490 |
"Created: / 4.8.1998 / 13:41:38 / cg" |
|
3491 |
! |
|
3492 |
||
3493 |
menuOSCommand |
|
3494 |
self fileExecute |
|
3495 |
||
3496 |
"Created: / 4.8.1998 / 14:06:54 / cg" |
|
3497 |
! |
|
3498 |
||
3499 |
menuOpen |
|
3500 |
"same as a double-click" |
|
3501 |
||
3502 |
"Modified: / 4.8.1998 / 13:42:14 / cg" |
|
3503 |
! |
|
3504 |
||
3505 |
menuShowFileBrowserDocumentation |
|
3506 |
||
3507 |
"Created: / 4.8.1998 / 14:03:57 / cg" |
|
3508 |
! |
|
3509 |
||
3510 |
openAboutThisApplication |
|
3511 |
"opens an about box for this application." |
|
3512 |
||
3513 |
|rev box myClass clsRev image msg| |
|
3514 |
||
3515 |
rev := ''. |
|
3516 |
myClass := self class. |
|
3517 |
||
3518 |
(clsRev := myClass revision) notNil ifTrue: [rev := ' (rev: ', clsRev printString, ')']. |
|
3519 |
||
3520 |
msg := '\' withCRs , myClass name asBoldText, rev. |
|
3521 |
||
3522 |
AboutBox isNil ifTrue:[ |
|
1868 | 3523 |
"/ this handles bad installations of ST/X, |
3524 |
"/ where the AboutBox is missing. |
|
3525 |
"/ (May vanish in the future) |
|
3526 |
^ self information:msg |
|
1834 | 3527 |
]. |
3528 |
||
3529 |
box := AboutBox title:msg. |
|
3530 |
||
3531 |
image := self class defaultIcon. |
|
3532 |
image notNil ifTrue:[ |
|
1868 | 3533 |
box image:image |
1834 | 3534 |
]. |
3535 |
box label:'About This Application'. |
|
3536 |
box autoHideAfter:10 with:[]. |
|
3537 |
box showAtPointer. |
|
3538 |
||
3539 |
"Modified: / 14.8.1998 / 13:20:24 / cg" |
|
3540 |
! |
|
3541 |
||
3542 |
openHTMLDocument:relativeDocPath |
|
3543 |
HTMLDocumentView openFullOnDocumentationFile:relativeDocPath |
|
3544 |
||
3545 |
"Created: / 4.8.1998 / 14:06:10 / cg" |
|
3546 |
! |
|
3547 |
||
3548 |
pullDownMenu |
|
3549 |
"return the top (pullDown) menu" |
|
3550 |
||
3551 |
<resource: #programMenu> |
|
3552 |
||
3553 |
|m| |
|
3554 |
||
3555 |
m := self class menuSpec. |
|
3556 |
m := m decodeAsLiteralArray. |
|
3557 |
m receiver:self. |
|
2035
307ed5143d8b
national language stuff - again
Claus Gittinger <cg@exept.de>
parents:
2031
diff
changeset
|
3558 |
m findGuiResourcesIn:self. |
1834 | 3559 |
^ m. |
3560 |
||
3561 |
"Modified: / 14.8.1998 / 14:09:12 / cg" |
|
3562 |
"Created: / 14.8.1998 / 14:14:16 / cg" |
|
3563 |
! |
|
3564 |
||
3565 |
showAboutSTX |
|
3566 |
ToolApplicationModel openAboutSTX |
|
3567 |
||
3568 |
"Created: / 14.8.1998 / 13:18:41 / cg" |
|
3569 |
! |
|
3570 |
||
3571 |
sortChanged |
|
2020 | 3572 |
"/ Transcript show:'fBrowser:'; showCR:sortByWhat value. |
1834 | 3573 |
self updateCurrentDirectory |
3574 |
||
3575 |
"Created: / 14.8.1998 / 16:17:20 / cg" |
|
3576 |
"Modified: / 14.8.1998 / 16:44:00 / cg" |
|
3577 |
! ! |
|
3578 |
||
2102 | 3579 |
!FileBrowser methodsFor:'menu actions - cvs'! |
3580 |
||
3581 |
cvsRemoveFileAndContainer |
|
3582 |
"remove the selected file(s) and their CVS containers. |
|
3583 |
Query if user really wants to really remove them." |
|
3584 |
||
3585 |
|sel q| |
|
3586 |
||
3587 |
sel := fileListView selection. |
|
3588 |
sel size > 0 ifTrue:[ |
|
2138 | 3589 |
sel := sel collect:[:rawIndex | fileList at:rawIndex]. |
3590 |
sel size > 1 ifTrue:[ |
|
3591 |
q := resources string:'remove %1 selected files and CVS containers ?' with:(sel size) |
|
3592 |
] ifFalse:[ |
|
3593 |
q := resources string:'remove ''%1'' and CVS container ?' with:(sel first asText allBold) |
|
3594 |
]. |
|
3595 |
(self sensor shiftDown |
|
3596 |
or:[self ask:q yesButton:'remove']) ifTrue:[ |
|
3597 |
self withCursor:(Cursor wait) do:[ |
|
3598 |
self doRemoveAndRemoveFromCVS:sel |
|
3599 |
] |
|
3600 |
] |
|
2102 | 3601 |
] |
3602 |
||
3603 |
"Modified: / 16.12.1998 / 17:30:31 / cg" |
|
3604 |
! |
|
3605 |
||
3606 |
cvsUpdateDirectoryLocal |
|
3607 |
"update this directory" |
|
3608 |
||
3609 |
self |
|
2138 | 3610 |
doExecuteCommand:'cvs upd -l' replace:false |
2102 | 3611 |
|
3612 |
"Modified: / 16.12.1998 / 17:30:31 / cg" |
|
3613 |
! |
|
3614 |
||
3615 |
cvsUpdateDirectoryRecursive |
|
3616 |
"update this directory" |
|
3617 |
||
3618 |
self |
|
2138 | 3619 |
doExecuteCommand:'cvs upd -d' replace:false |
2102 | 3620 |
|
3621 |
"Modified: / 16.12.1998 / 17:30:31 / cg" |
|
3622 |
! |
|
3623 |
||
3624 |
cvsUpdateSelection |
|
3625 |
"update selected files" |
|
3626 |
||
3627 |
|sel| |
|
3628 |
||
3629 |
sel := fileListView selection. |
|
3630 |
sel size > 0 ifTrue:[ |
|
2138 | 3631 |
sel := sel collect:[:rawIndex | fileList at:rawIndex]. |
3632 |
sel do:[:fn | |
|
3633 |
self |
|
3634 |
doExecuteCommand:('cvs upd ' , fn) replace:false |
|
3635 |
] |
|
2102 | 3636 |
]. |
3637 |
! |
|
3638 |
||
3639 |
doRemoveAndRemoveFromCVS:filesToRemove |
|
3640 |
"remove the selected file(s) and their CVS containers - no questions asked" |
|
3641 |
||
3642 |
|msg idx needUpdate toRemove updateRunning yesToAll| |
|
3643 |
||
3644 |
updateRunning := listUpdateProcess notNil. |
|
3645 |
self stopUpdateProcess. |
|
3646 |
toRemove := OrderedCollection new. |
|
3647 |
||
3648 |
"/ |
|
3649 |
"/ did the directory change in the meanwhile ? |
|
3650 |
"/ |
|
3651 |
needUpdate := (currentDirectory modificationTime > timeOfLastCheck). |
|
3652 |
||
3653 |
yesToAll := false. |
|
3654 |
lockUpdate := true. |
|
3655 |
[ |
|
2138 | 3656 |
filesToRemove do:[:fileName | |
3657 |
|f| |
|
3658 |
||
3659 |
f := currentDirectory construct:fileName. |
|
3660 |
OperatingSystem accessDeniedErrorSignal handle:[:ex| |
|
3661 |
"was not able to remove it" |
|
3662 |
msg := (resources string:'cannot remove ''%1'' !!' with:fileName). |
|
3663 |
self showAlert:msg with:(OperatingSystem lastErrorString) |
|
3664 |
] do:[ |
|
3665 |
|answer contents| |
|
3666 |
||
3667 |
(f isSymbolicLink not) ifTrue:[ |
|
3668 |
self |
|
3669 |
doExecuteCommand:('cvs remove -f ' , f baseName) |
|
3670 |
replace:false. |
|
2102 | 3671 |
|
3672 |
" |
|
2138 | 3673 |
self show:nil |
2102 | 3674 |
" |
2138 | 3675 |
idx := fileList indexOf:fileName. |
3676 |
idx ~~ 0 ifTrue:[ |
|
3677 |
toRemove add:idx. |
|
3678 |
] |
|
3679 |
] |
|
3680 |
]. |
|
3681 |
]. |
|
2102 | 3682 |
] valueNowOrOnUnwindDo:[ |
2138 | 3683 |
lockUpdate := false. |
3684 |
fileListView setSelection:nil. |
|
3685 |
||
3686 |
"/ |
|
3687 |
"/ remove reverse - otherwise indices are wrong |
|
3688 |
"/ |
|
3689 |
toRemove sort. |
|
3690 |
toRemove reverseDo:[:idx | |
|
3691 |
fileList removeIndex:idx. |
|
3692 |
fileListView removeIndex:idx. |
|
3693 |
]. |
|
3694 |
||
3695 |
updateRunning ifTrue:[ |
|
3696 |
self updateCurrentDirectory |
|
3697 |
] ifFalse:[ |
|
3698 |
" |
|
3699 |
install a new check after some time |
|
3700 |
" |
|
3701 |
needUpdate ifFalse:[timeOfLastCheck := AbsoluteTime now]. |
|
3702 |
Processor removeTimedBlock:checkBlock. |
|
3703 |
Processor addTimedBlock:checkBlock afterSeconds:checkDelta. |
|
3704 |
] |
|
2102 | 3705 |
]. |
3706 |
||
3707 |
self |
|
2138 | 3708 |
doExecuteCommand:('cvs commit -m ''removed via FileBrowser''') |
3709 |
replace:false. |
|
2102 | 3710 |
|
3711 |
"Modified: / 21.10.1998 / 17:02:11 / cg" |
|
3712 |
! ! |
|
3713 |
||
172 | 3714 |
!FileBrowser methodsFor:'misc user interaction'! |
3715 |
||
1786 | 3716 |
closeRequest |
3717 |
"exit FileBrowser" |
|
3718 |
||
3719 |
(self askIfModified:'contents has not been saved.\\Modifications will be lost when FileBrowser is closed.' |
|
1868 | 3720 |
yesButton:'close') |
1786 | 3721 |
ifTrue:[ |
1868 | 3722 |
"/ self windowGroup closeDownViews. |
3723 |
super closeRequest |
|
1786 | 3724 |
] |
3725 |
||
3726 |
"Created: / 3.8.1998 / 19:55:06 / cg" |
|
1834 | 3727 |
"Modified: / 4.8.1998 / 18:21:03 / cg" |
1786 | 3728 |
! |
3729 |
||
1339
4b712d8c1738
Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents:
1336
diff
changeset
|
3730 |
discardChangesDialog |
4b712d8c1738
Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents:
1336
diff
changeset
|
3731 |
"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
|
3732 |
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
|
3733 |
|
4b712d8c1738
Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents:
1336
diff
changeset
|
3734 |
^ self askIfModified:'contents has not been saved.\\Modifications will be lost when directory is changed.' |
1393 | 3735 |
yesButton:'change' |
1339
4b712d8c1738
Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents:
1336
diff
changeset
|
3736 |
|
4b712d8c1738
Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents:
1336
diff
changeset
|
3737 |
"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
|
3738 |
! |
4b712d8c1738
Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents:
1336
diff
changeset
|
3739 |
|
346 | 3740 |
filterPatternChanged |
1911
6d1b77eda98f
check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents:
1903
diff
changeset
|
3741 |
fileListView scrollToTop. |
6d1b77eda98f
check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents:
1903
diff
changeset
|
3742 |
fileListView deselect. |
346 | 3743 |
self updateCurrentDirectory |
1911
6d1b77eda98f
check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents:
1903
diff
changeset
|
3744 |
|
6d1b77eda98f
check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents:
1903
diff
changeset
|
3745 |
"Modified: / 3.10.1998 / 18:23:34 / cg" |
346 | 3746 |
! |
3747 |
||
172 | 3748 |
update:what with:someArgument from:changedObject |
3749 |
realized ifFalse:[^ self]. |
|
36 | 3750 |
|
172 | 3751 |
(what == #aboutToExit) ifTrue:[ |
1317 | 3752 |
"system wants to shut down this |
3753 |
- if text was modified, pop up, and ask user and save if requested." |
|
3754 |
||
3755 |
(subView modified and:[subView contentsWasSaved not]) ifTrue:[ |
|
3756 |
self raiseDeiconified. |
|
3757 |
||
3758 |
(self |
|
3759 |
ask:(resources at:'FileBrowser:\\contents has not been saved.\\Save before exiting ?') |
|
3760 |
yesButton:'save' |
|
3761 |
noButton:'don''t save') |
|
3762 |
ifTrue:[ |
|
3763 |
subView acceptAction notNil ifTrue:[ |
|
3764 |
subView accept |
|
3765 |
] ifFalse:[ |
|
3766 |
subView save |
|
3767 |
] |
|
3768 |
] |
|
3769 |
]. |
|
3770 |
^ self |
|
172 | 3771 |
]. |
3772 |
changedObject == tabSpec ifTrue:[ |
|
1317 | 3773 |
fileListView invalidate |
172 | 3774 |
]. |
380 | 3775 |
|
585
be0241bf7268
use #invalidate instead of #redraw
Claus Gittinger <cg@exept.de>
parents:
564
diff
changeset
|
3776 |
"Modified: 29.5.1996 / 16:13:43 / cg" |
172 | 3777 |
! ! |
3778 |
||
3779 |
!FileBrowser methodsFor:'pathField user interaction'! |
|
3780 |
||
1271 | 3781 |
addDirToJavaClassPath |
3782 |
"add the current path to javas classPath |
|
3783 |
(only available with ST/J System" |
|
3784 |
||
3785 |
Java addToClassPath:currentDirectory pathName |
|
3786 |
||
3787 |
"Modified: 14.12.1996 / 15:37:47 / cg" |
|
3788 |
"Created: 1.8.1997 / 21:25:22 / cg" |
|
3789 |
! |
|
3790 |
||
1272 | 3791 |
addDirToJavaSourcePath |
3792 |
"add the current path to javas sourcePath |
|
3793 |
(only available with ST/J System" |
|
3794 |
||
3795 |
Java addToSourcePath:currentDirectory pathName |
|
3796 |
||
3797 |
"Modified: 14.12.1996 / 15:37:47 / cg" |
|
3798 |
"Created: 2.8.1997 / 14:11:19 / cg" |
|
3799 |
! |
|
3800 |
||
172 | 3801 |
changeCurrentDirectory |
3802 |
"if text was modified show a queryBox, |
|
1329 | 3803 |
otherwise ask for & change to that directory" |
172 | 3804 |
|
1339
4b712d8c1738
Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents:
1336
diff
changeset
|
3805 |
self discardChangesDialog ifTrue:[ |
1393 | 3806 |
self queryForDirectoryToChange |
36 | 3807 |
] |
1329 | 3808 |
|
3809 |
"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
|
3810 |
"Modified: 2.10.1997 / 14:09:02 / stefan" |
36 | 3811 |
! |
3812 |
||
172 | 3813 |
changeDirectoryTo:aDirectoryName |
3814 |
"sent from label menu to change back to a previous directory" |
|
132 | 3815 |
|
1339
4b712d8c1738
Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents:
1336
diff
changeset
|
3816 |
self discardChangesDialog ifTrue:[ |
1868 | 3817 |
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
|
3818 |
]. |
4b712d8c1738
Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents:
1336
diff
changeset
|
3819 |
|
1737 | 3820 |
"Modified: / 2.10.1997 / 14:09:24 / stefan" |
3821 |
"Modified: / 21.7.1998 / 16:38:03 / cg" |
|
172 | 3822 |
! |
3823 |
||
1329 | 3824 |
changeToDefaultDirectory |
3825 |
"if text was modified show a queryBox, |
|
3826 |
otherwise change immediately to the default directory" |
|
3827 |
||
1339
4b712d8c1738
Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents:
1336
diff
changeset
|
3828 |
self discardChangesDialog ifTrue:[ |
1393 | 3829 |
self doChangeToDefaultDirectory |
1329 | 3830 |
] |
3831 |
||
3832 |
"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
|
3833 |
"Modified: 2.10.1997 / 14:09:33 / stefan" |
1329 | 3834 |
! |
3835 |
||
172 | 3836 |
changeToHomeDirectory |
3837 |
"if text was modified show a queryBox, |
|
1329 | 3838 |
otherwise change immediately to the home directory" |
132 | 3839 |
|
1339
4b712d8c1738
Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents:
1336
diff
changeset
|
3840 |
self discardChangesDialog ifTrue:[ |
1393 | 3841 |
self doChangeToHomeDirectory |
172 | 3842 |
] |
1329 | 3843 |
|
3844 |
"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
|
3845 |
"Modified: 2.10.1997 / 14:09:42 / stefan" |
172 | 3846 |
! |
45 | 3847 |
|
172 | 3848 |
changeToParentDirectory |
3849 |
"if text was modified show a queryBox, |
|
1329 | 3850 |
otherwise change immediately to the parent directory" |
45 | 3851 |
|
1339
4b712d8c1738
Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents:
1336
diff
changeset
|
3852 |
self discardChangesDialog ifTrue:[ |
1393 | 3853 |
self doChangeToParentDirectory |
36 | 3854 |
] |
1329 | 3855 |
|
3856 |
"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
|
3857 |
"Modified: 2.10.1997 / 14:09:55 / stefan" |
98 | 3858 |
! |
3859 |
||
172 | 3860 |
copyPath |
3861 |
"copy current path into cut & paste buffer" |
|
3862 |
||
873 | 3863 |
self setTextSelection:currentDirectory pathName |
3864 |
||
3865 |
"Modified: 14.12.1996 / 15:37:47 / cg" |
|
172 | 3866 |
! |
3867 |
||
1893
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
3868 |
fileAddToJavaClassPath |
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
3869 |
"add the current path to javas classPath |
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
3870 |
(only available with ST/J System" |
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
3871 |
|
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
3872 |
|f| |
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
3873 |
|
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
3874 |
f := self getSelectedFileName. |
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
3875 |
f isNil ifTrue:[ |
2138 | 3876 |
^ self addDirToJavaClassPath |
1893
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
3877 |
]. |
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
3878 |
f := currentDirectory asFilename construct:f. |
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
3879 |
Java addToClassPath:(f pathName) |
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
3880 |
|
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
3881 |
"Created: / 9.11.1998 / 05:41:34 / cg" |
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
3882 |
"Modified: / 9.11.1998 / 05:56:00 / cg" |
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
3883 |
! |
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
3884 |
|
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
3885 |
fileRemoveFromJavaClassPath |
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
3886 |
"remove the current path from javas classPath |
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
3887 |
(only available with ST/J System" |
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
3888 |
|
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
3889 |
|f| |
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
3890 |
|
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
3891 |
f := self getSelectedFileName. |
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
3892 |
f isNil ifTrue:[ |
2138 | 3893 |
^ self removeDirToJavaClassPath |
1893
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
3894 |
]. |
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
3895 |
f := currentDirectory asFilename construct:f. |
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
3896 |
Java removeFromClassPath:(f pathName) |
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
3897 |
|
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
3898 |
"Created: / 9.11.1998 / 05:42:05 / cg" |
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
3899 |
"Modified: / 9.11.1998 / 05:56:14 / cg" |
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
3900 |
! |
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
3901 |
|
172 | 3902 |
labelMenu |
1040 | 3903 |
"return the popUpMenu for the path label" |
3904 |
||
1235
13610578a5d2
resource flag: #menu -> #programMenu
Claus Gittinger <cg@exept.de>
parents:
1227
diff
changeset
|
3905 |
<resource: #programMenu> |
1040 | 3906 |
|
2051 | 3907 |
|m| |
3908 |
||
3909 |
m := self class directoryMenuSpec. |
|
3910 |
m menuPerformer:self. |
|
3911 |
^ m |
|
1834 | 3912 |
|
3913 |
"Modified: / 14.8.1998 / 12:11:16 / cg" |
|
3914 |
! |
|
3915 |
||
3916 |
labelMenu_old |
|
3917 |
"return the popUpMenu for the path label" |
|
3918 |
||
3919 |
<resource: #programMenu> |
|
3920 |
||
1737 | 3921 |
|items menu currentIndex| |
1736
36cab4d1d655
remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents:
1735
diff
changeset
|
3922 |
|
36cab4d1d655
remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents:
1735
diff
changeset
|
3923 |
items := #( |
1868 | 3924 |
('copy path' copyPath ) |
3925 |
('-' ) |
|
3926 |
('up' changeToParentDirectory ) |
|
3927 |
('back' changeToPreviousDirectory ) |
|
3928 |
('change to home-directory' changeToHomeDirectory ) |
|
3929 |
('change to default-directory' changeToDefaultDirectory ) |
|
3930 |
('change directory ...' changeCurrentDirectory ) |
|
3931 |
). |
|
1400 | 3932 |
|
3933 |
(JavaClassReader notNil and:[JavaClassReader isLoaded]) ifTrue:[ |
|
1868 | 3934 |
items := items , #( |
3935 |
( '-') |
|
3936 |
( 'add to JavaClassPath' addDirToJavaClassPath) |
|
3937 |
( 'add to JavaSourcePath' addDirToJavaSourcePath) |
|
3938 |
( 'remove from JavaClassPath' removeDirFromJavaClassPath) |
|
3939 |
( 'remove from JavaSourcePath' removeDirFromJavaSourcePath) |
|
3940 |
). |
|
1271 | 3941 |
]. |
3942 |
||
172 | 3943 |
DirectoryHistory size > 0 ifTrue:[ |
1868 | 3944 |
items := items copyWith:#('-'). |
3945 |
items := items , |
|
3946 |
(DirectoryHistory |
|
3947 |
collect:[:dirName | |
|
3948 |
Array |
|
3949 |
with:dirName |
|
3950 |
with:#changeDirectoryTo: |
|
3951 |
with:nil |
|
3952 |
with:dirName |
|
3953 |
] |
|
3954 |
). |
|
3955 |
currentIndex := items findFirst:[:i | (i at:1) = currentDirectory pathName]. |
|
3956 |
currentIndex == 0 ifTrue:[currentIndex := nil]. |
|
123 | 3957 |
]. |
172 | 3958 |
|
3959 |
menu := PopUpMenu |
|
1868 | 3960 |
itemList:items |
3961 |
resources:resources. |
|
172 | 3962 |
|
3963 |
previousDirectory isNil ifTrue:[ |
|
1868 | 3964 |
menu disable:#changeToPreviousDirectory. |
132 | 3965 |
]. |
1737 | 3966 |
currentIndex notNil ifTrue:[ |
1868 | 3967 |
menu disable:currentIndex |
1737 | 3968 |
]. |
1400 | 3969 |
(JavaClassReader notNil and:[JavaClassReader isLoaded]) ifTrue:[ |
1868 | 3970 |
(Java classPath includes:currentDirectory pathName) ifTrue:[ |
3971 |
menu disable:#addDirToJavaClassPath |
|
3972 |
] ifFalse:[ |
|
3973 |
menu disable:#removeDirFromJavaClassPath |
|
3974 |
]. |
|
3975 |
(Java sourcePath includes:currentDirectory pathName) ifTrue:[ |
|
3976 |
menu disable:#addDirToJavaSourcePath |
|
3977 |
] ifFalse:[ |
|
3978 |
menu disable:#removeDirFromJavaSourcePath |
|
3979 |
]. |
|
1393 | 3980 |
]. |
172 | 3981 |
^menu. |
1040 | 3982 |
|
1737 | 3983 |
"Modified: / 21.7.1998 / 16:43:25 / cg" |
1834 | 3984 |
"Created: / 14.8.1998 / 12:10:02 / cg" |
172 | 3985 |
! |
3986 |
||
1327 | 3987 |
pathChanged:newPath |
1339
4b712d8c1738
Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents:
1336
diff
changeset
|
3988 |
"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
|
3989 |
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
|
3990 |
|
2135
88eb91efc5dd
care for caseless systems when entering a fileName
Claus Gittinger <cg@exept.de>
parents:
2129
diff
changeset
|
3991 |
|f name lcName idx| |
1339
4b712d8c1738
Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents:
1336
diff
changeset
|
3992 |
|
4b712d8c1738
Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents:
1336
diff
changeset
|
3993 |
self discardChangesDialog ifTrue:[ |
2216
b84ee099f484
dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
3994 |
f := newPath asFilename. |
b84ee099f484
dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
3995 |
(f isDirectory) ifTrue:[ |
b84ee099f484
dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
3996 |
self changeDirectoryTo:newPath |
b84ee099f484
dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
3997 |
] ifFalse:[ |
b84ee099f484
dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
3998 |
self changeDirectoryTo:(f directoryName). |
b84ee099f484
dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
3999 |
"/ self changed:#path. |
b84ee099f484
dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
4000 |
name := f baseName. |
b84ee099f484
dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
4001 |
idx := fileList indexOf:name. |
b84ee099f484
dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
4002 |
idx = 0 ifTrue:[ |
b84ee099f484
dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
4003 |
lcName := name asLowercase. |
b84ee099f484
dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
4004 |
f class isCaseSensitive ifFalse:[ |
b84ee099f484
dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
4005 |
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
|
4006 |
] |
b84ee099f484
dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
4007 |
]. |
b84ee099f484
dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
4008 |
fileListView selection:idx. |
b84ee099f484
dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
4009 |
self fileSelect:name. |
b84ee099f484
dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
4010 |
self fileGet:true. |
b84ee099f484
dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
4011 |
]. |
1339
4b712d8c1738
Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents:
1336
diff
changeset
|
4012 |
] ifFalse:[ |
2216
b84ee099f484
dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
4013 |
self changed:#path. |
2135
88eb91efc5dd
care for caseless systems when entering a fileName
Claus Gittinger <cg@exept.de>
parents:
2129
diff
changeset
|
4014 |
]. |
88eb91efc5dd
care for caseless systems when entering a fileName
Claus Gittinger <cg@exept.de>
parents:
2129
diff
changeset
|
4015 |
|
88eb91efc5dd
care for caseless systems when entering a fileName
Claus Gittinger <cg@exept.de>
parents:
2129
diff
changeset
|
4016 |
"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
|
4017 |
"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
|
4018 |
"Modified: / 30.4.1999 / 11:19:29 / cg" |
1327 | 4019 |
! |
4020 |
||
172 | 4021 |
queryForDirectoryToChange |
4022 |
"query for new directory" |
|
123 | 4023 |
|
1168
b157f3712548
care for nil returns from userName/groupName * time queries
Claus Gittinger <cg@exept.de>
parents:
1166
diff
changeset
|
4024 |
|queryBox dirName| |
98 | 4025 |
|
172 | 4026 |
queryBox := FilenameEnterBox |
1317 | 4027 |
title:(resources at:'change directory to:') withCRs |
4028 |
okText:(resources at:'change') |
|
4029 |
action:[:newName | dirName := newName]. |
|
172 | 4030 |
"/ queryBox initialText:''. |
1168
b157f3712548
care for nil returns from userName/groupName * time queries
Claus Gittinger <cg@exept.de>
parents:
1166
diff
changeset
|
4031 |
queryBox showAtPointer. |
b157f3712548
care for nil returns from userName/groupName * time queries
Claus Gittinger <cg@exept.de>
parents:
1166
diff
changeset
|
4032 |
queryBox destroy. |
b157f3712548
care for nil returns from userName/groupName * time queries
Claus Gittinger <cg@exept.de>
parents:
1166
diff
changeset
|
4033 |
self doChangeCurrentDirectoryTo:dirName updateHistory:true. |
b157f3712548
care for nil returns from userName/groupName * time queries
Claus Gittinger <cg@exept.de>
parents:
1166
diff
changeset
|
4034 |
|
b157f3712548
care for nil returns from userName/groupName * time queries
Claus Gittinger <cg@exept.de>
parents:
1166
diff
changeset
|
4035 |
"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
|
4036 |
"Modified: 28.4.1997 / 22:30:40 / dq" |
1271 | 4037 |
! |
4038 |
||
4039 |
removeDirFromJavaClassPath |
|
4040 |
"remove the current path from javas classPath |
|
4041 |
(only available with ST/J System" |
|
4042 |
||
4043 |
Java removeFromClassPath:currentDirectory pathName |
|
4044 |
||
4045 |
"Modified: 14.12.1996 / 15:37:47 / cg" |
|
4046 |
"Created: 1.8.1997 / 21:25:36 / cg" |
|
1272 | 4047 |
! |
4048 |
||
4049 |
removeDirFromJavaSourcePath |
|
4050 |
"remove the current path from javas sourcePath |
|
4051 |
(only available with ST/J System" |
|
4052 |
||
4053 |
Java removeFromSourcePath:currentDirectory pathName |
|
4054 |
||
4055 |
"Modified: 14.12.1996 / 15:37:47 / cg" |
|
4056 |
"Created: 2.8.1997 / 14:11:41 / cg" |
|
36 | 4057 |
! ! |
4058 |
||
4059 |
!FileBrowser methodsFor:'private'! |
|
4060 |
||
172 | 4061 |
ask:question yesButton:yesButtonText |
4062 |
"common method to ask a yes/no question; return true or false" |
|
36 | 4063 |
|
172 | 4064 |
^ self ask:question yesButton:yesButtonText noButton:'cancel' |
4065 |
! |
|
93 | 4066 |
|
172 | 4067 |
ask:question yesButton:yesButtonText noButton:noButtonText |
36 | 4068 |
"common method to ask a yes/no question" |
4069 |
||
380 | 4070 |
^ Dialog |
1317 | 4071 |
confirm:question withCRs |
4072 |
yesLabel:(resources at:yesButtonText) |
|
4073 |
noLabel:(resources at:noButtonText) |
|
37 | 4074 |
|
380 | 4075 |
"Modified: 21.2.1996 / 01:19:21 / cg" |
36 | 4076 |
! |
4077 |
||
1142
9066d7d02a3a
remember last executed command per suffix; offer this as default.
Claus Gittinger <cg@exept.de>
parents:
1141
diff
changeset
|
4078 |
askForCommandFor:fileName thenDo:aBlock |
172 | 4079 |
"setup and launch a querybox to ask for unix command. |
4080 |
Then evaluate aBlock passing the command-string as argument." |
|
93 | 4081 |
|
1834 | 4082 |
|box osName| |
4083 |
||
4084 |
osName := OperatingSystem platformName. |
|
93 | 4085 |
|
172 | 4086 |
box := FilenameEnterBox |
1868 | 4087 |
title:(resources string:'execute %1 command:' with:osName) |
4088 |
okText:(resources string:'execute') |
|
4089 |
action:aBlock. |
|
79 | 4090 |
|
172 | 4091 |
fileName notNil ifTrue:[ |
1868 | 4092 |
self initialCommandFor:fileName into:box. |
172 | 4093 |
]. |
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
4094 |
box directory:currentDirectory. |
1142
9066d7d02a3a
remember last executed command per suffix; offer this as default.
Claus Gittinger <cg@exept.de>
parents:
1141
diff
changeset
|
4095 |
box showAtPointer. |
9066d7d02a3a
remember last executed command per suffix; offer this as default.
Claus Gittinger <cg@exept.de>
parents:
1141
diff
changeset
|
4096 |
box destroy. |
36 | 4097 |
|
1834 | 4098 |
"Modified: / 7.9.1995 / 10:31:54 / claus" |
4099 |
"Modified: / 16.9.1997 / 15:35:10 / stefan" |
|
4100 |
"Modified: / 14.8.1998 / 14:12:52 / cg" |
|
36 | 4101 |
! |
4102 |
||
98 | 4103 |
askIfModified:question yesButton:yesButtonText |
4104 |
"tell user, that code has been modified - let her confirm" |
|
4105 |
||
4106 |
(subView modified not or:[subView contentsWasSaved]) ifTrue:[ |
|
1393 | 4107 |
^ true |
98 | 4108 |
]. |
1340 | 4109 |
(self ask:(resources string:question) yesButton:yesButtonText) ifTrue:[ |
1393 | 4110 |
"/ reset modified flag so question is asked only once |
4111 |
subView modified:false. |
|
4112 |
^ true |
|
1340 | 4113 |
]. |
4114 |
^ false |
|
1339
4b712d8c1738
Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents:
1336
diff
changeset
|
4115 |
|
4b712d8c1738
Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents:
1336
diff
changeset
|
4116 |
"Modified: 2.10.1997 / 14:23:47 / stefan" |
98 | 4117 |
! |
4118 |
||
1162 | 4119 |
getSelectedFileName |
4120 |
"returns the currently selected file; shows an error if |
|
4121 |
multiple files are selected" |
|
4122 |
||
4123 |
|sel| |
|
4124 |
||
4125 |
sel := fileListView selection. |
|
4126 |
(sel size > 1) ifTrue:[ |
|
2138 | 4127 |
self onlyOneSelection |
1162 | 4128 |
] ifFalse:[ |
2138 | 4129 |
sel notNil ifTrue:[ |
4130 |
^ fileList at:sel first ifAbsent:nil |
|
4131 |
] |
|
1162 | 4132 |
]. |
4133 |
^ nil |
|
1911
6d1b77eda98f
check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents:
1903
diff
changeset
|
4134 |
|
6d1b77eda98f
check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents:
1903
diff
changeset
|
4135 |
"Modified: / 3.10.1998 / 18:21:23 / cg" |
1162 | 4136 |
! |
4137 |
||
4138 |
onlyOneSelection |
|
4139 |
"show a warning, that only one file must be selected for |
|
4140 |
this operation" |
|
4141 |
||
4142 |
self warn:'exactly one file must be selected !!' |
|
4143 |
! |
|
4144 |
||
4145 |
selectedFilesDo:aBlock |
|
4146 |
"evaluate aBlock on all selected files; |
|
4147 |
show a wait cursor while doing this" |
|
4148 |
||
1969 | 4149 |
|sel action| |
1162 | 4150 |
|
4151 |
sel := fileListView selection. |
|
4152 |
sel notNil ifTrue:[ |
|
2138 | 4153 |
sel := sel collect:[:aSelectionIndex | |
4154 |
|nm| |
|
4155 |
||
4156 |
nm := fileList at:aSelectionIndex ifAbsent:nil. |
|
4157 |
nm notNil ifTrue:[ |
|
4158 |
nm := nm string. |
|
4159 |
(nm endsWith:' ...') ifTrue:[ |
|
4160 |
nm := (nm copyWithoutLast:4) withoutSpaces |
|
4161 |
]. |
|
4162 |
]. |
|
4163 |
nm |
|
4164 |
]. |
|
4165 |
action := [ |
|
4166 |
sel do:[:nm | |
|
4167 |
nm notNil ifTrue:[ |
|
4168 |
aBlock value:nm |
|
4169 |
] |
|
4170 |
] |
|
4171 |
]. |
|
4172 |
Processor activeProcess == self windowGroup process ifTrue:[ |
|
4173 |
self withWaitCursorDo:action |
|
4174 |
] ifFalse:[ |
|
4175 |
action value |
|
4176 |
] |
|
1162 | 4177 |
] |
4178 |
||
1974 | 4179 |
"Modified: / 16.12.1998 / 17:30:57 / cg" |
1162 | 4180 |
! |
4181 |
||
4182 |
show:something |
|
4183 |
"show something in subview and undef acceptAction" |
|
4184 |
||
4185 |
subView contents:something. |
|
4186 |
subView acceptAction:nil. |
|
4187 |
subView modified:false. |
|
4188 |
currentFileName := nil |
|
4189 |
! |
|
4190 |
||
4191 |
showAlert:aString with:anErrorString |
|
4192 |
"show an alertbox, displaying the last Unix-error" |
|
4193 |
||
4194 |
|msg| |
|
4195 |
||
4196 |
anErrorString isNil ifTrue:[ |
|
1317 | 4197 |
msg := aString |
1162 | 4198 |
] ifFalse:[ |
1317 | 4199 |
msg := aString , '\\(' , anErrorString , ')' |
1162 | 4200 |
]. |
4201 |
self warn:msg withCRs |
|
4202 |
! |
|
4203 |
||
4204 |
withoutHiddenFiles:aCollection |
|
4205 |
"remove hidden files (i.e. those that start with '.') from |
|
4206 |
the list in aCollection" |
|
4207 |
||
4208 |
|newCollection| |
|
4209 |
||
4210 |
newCollection := aCollection species new. |
|
4211 |
aCollection do:[:fname | |
|
1868 | 4212 |
|ignore| |
4213 |
||
4214 |
ignore := false. |
|
4215 |
||
4216 |
((fname startsWith:'.') and:[fname ~= '..']) ifTrue:[ |
|
4217 |
showingHiddenFiles value "showDotFiles" ifFalse:[ |
|
4218 |
ignore := true |
|
4219 |
] |
|
4220 |
]. |
|
4221 |
ignore ifFalse:[ |
|
4222 |
newCollection add:fname |
|
4223 |
] |
|
1162 | 4224 |
]. |
4225 |
^ newCollection |
|
4226 |
||
1834 | 4227 |
"Modified: / 4.8.1998 / 13:46:27 / cg" |
1162 | 4228 |
! ! |
4229 |
||
4230 |
!FileBrowser methodsFor:'private - actions & command execution'! |
|
4231 |
||
4232 |
binaryFileAction:aFilename |
|
4233 |
"for some binary files, if double clicked, we can do some useful |
|
4234 |
action ..." |
|
4235 |
||
1330 | 4236 |
(currentDirectory construct:aFilename) isExecutableProgram ifTrue:[ |
1329 | 4237 |
(OperatingSystem executeCommand:'cd ', currentDirectory pathName, '; ',aFilename) |
4238 |
ifTrue:[^true]. |
|
1162 | 4239 |
]. |
4240 |
^ self imageAction:aFilename |
|
4241 |
||
4242 |
"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
|
4243 |
"Modified: 18.9.1997 / 17:18:04 / stefan" |
1162 | 4244 |
! |
4245 |
||
1358 | 4246 |
doExecuteCommand:commandArg replace:replace |
1162 | 4247 |
"execute a unix command inserting the output of the command. |
4248 |
If replace is true, all text is replaced by the commands output; |
|
4249 |
otherwise, its inserted as selected text at the cursor position." |
|
4250 |
||
1493 | 4251 |
|command stream line lnr myProcess myPriority startLine startCol stopSignal |
1983
50157c992ef9
subprocess name of button event handler
Claus Gittinger <cg@exept.de>
parents:
1981
diff
changeset
|
4252 |
pauseSignal access stillReplacing pauseHolder lowerFrameView |
50157c992ef9
subprocess name of button event handler
Claus Gittinger <cg@exept.de>
parents:
1981
diff
changeset
|
4253 |
buttonWindowGroup| |
1162 | 4254 |
|
1358 | 4255 |
command := commandArg asString. |
4256 |
||
1162 | 4257 |
access := Semaphore forMutualExclusion name:'accessLock'. |
4258 |
stopSignal := Signal new. |
|
1335
4f8ee6e1d8e1
Use signal instead polling for pauseButton in #doExecuteCommand:replace:.
Stefan Vogel <sv@exept.de>
parents:
1334
diff
changeset
|
4259 |
pauseSignal := Signal new. |
1162 | 4260 |
|
4261 |
" |
|
1298
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
4262 |
The following is tricky: |
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
4263 |
the pauseToggle & killButton will |
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
4264 |
be handled by their own windowGroup process. |
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
4265 |
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
|
4266 |
I myself am reading the commands output. |
1162 | 4267 |
" |
1298
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
4268 |
|
1329 | 4269 |
commandView beInvisible. |
4270 |
||
1298
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
4271 |
" |
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
4272 |
must take kill & pauseButtons out of my group |
1162 | 4273 |
" |
1298
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
4274 |
killButton windowGroup:nil. |
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
4275 |
pauseToggle windowGroup:nil. |
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
4276 |
|
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
4277 |
" |
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
4278 |
bring them to front, and turn hidden-mode off |
1162 | 4279 |
" |
1298
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
4280 |
killButton raise; beVisible. |
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
4281 |
pauseToggle raise; beVisible. |
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
4282 |
|
1162 | 4283 |
" |
1298
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
4284 |
kill will make me raise the stopSignal when pressed |
1162 | 4285 |
" |
4286 |
killButton |
|
2138 | 4287 |
action:[ |
4288 |
stream notNil ifTrue:[ |
|
4289 |
access critical:[ |
|
4290 |
myProcess interruptWith:[stopSignal raiseRequest]. |
|
4291 |
] |
|
4292 |
] |
|
4293 |
]. |
|
1298
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
4294 |
|
1162 | 4295 |
" |
1298
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
4296 |
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
|
4297 |
" |
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
4298 |
pauseHolder := false asValue. |
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
4299 |
pauseToggle model:pauseHolder. |
1335
4f8ee6e1d8e1
Use signal instead polling for pauseButton in #doExecuteCommand:replace:.
Stefan Vogel <sv@exept.de>
parents:
1334
diff
changeset
|
4300 |
pauseToggle pressAction:[ |
2138 | 4301 |
stream notNil ifTrue:[ |
4302 |
access critical:[ |
|
4303 |
myProcess interruptWith:[pauseSignal raiseRequest]. |
|
4304 |
] |
|
4305 |
] |
|
1335
4f8ee6e1d8e1
Use signal instead polling for pauseButton in #doExecuteCommand:replace:.
Stefan Vogel <sv@exept.de>
parents:
1334
diff
changeset
|
4306 |
]. |
4f8ee6e1d8e1
Use signal instead polling for pauseButton in #doExecuteCommand:replace:.
Stefan Vogel <sv@exept.de>
parents:
1334
diff
changeset
|
4307 |
|
1298
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
4308 |
|
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
4309 |
" |
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
4310 |
start kill button under its own windowgroup |
1162 | 4311 |
" |
4312 |
killButton openAutonomous. |
|
1983
50157c992ef9
subprocess name of button event handler
Claus Gittinger <cg@exept.de>
parents:
1981
diff
changeset
|
4313 |
buttonWindowGroup := killButton windowGroup. |
50157c992ef9
subprocess name of button event handler
Claus Gittinger <cg@exept.de>
parents:
1981
diff
changeset
|
4314 |
buttonWindowGroup process name:'FileBrowser sub'. |
50157c992ef9
subprocess name of button event handler
Claus Gittinger <cg@exept.de>
parents:
1981
diff
changeset
|
4315 |
buttonWindowGroup process processGroupId:(Processor activeProcess id). |
1298
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
4316 |
|
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
4317 |
" |
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
4318 |
and add the pauseToggle to its windowGroup |
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
4319 |
" |
1983
50157c992ef9
subprocess name of button event handler
Claus Gittinger <cg@exept.de>
parents:
1981
diff
changeset
|
4320 |
pauseToggle windowGroup:buttonWindowGroup. |
1298
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
4321 |
|
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
4322 |
|
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
4323 |
lowerFrameView := subView superView. |
1162 | 4324 |
|
4325 |
" |
|
4326 |
go fork a pipe and read it |
|
4327 |
" |
|
4328 |
self label:(myName , ': executing ' , (command copyTo:(20 min:command size)) , ' ...'). |
|
4329 |
[ |
|
4330 |
self withWaitCursorDo:[ |
|
2138 | 4331 |
stopSignal catch:[ |
4332 |
pauseSignal handle:[:ex| |
|
4333 |
|noPauseSema| |
|
4334 |
||
4335 |
"/ |
|
4336 |
"/ allow interaction with |
|
4337 |
"/ the codeView via the other windowGroup |
|
4338 |
"/ |
|
4339 |
lowerFrameView windowGroup:buttonWindowGroup. |
|
4340 |
||
4341 |
"/ |
|
4342 |
"/ wait for pause to be turned off |
|
4343 |
"/ |
|
4344 |
noPauseSema := Semaphore new. |
|
4345 |
pauseHolder onChangeSend:#signal to:noPauseSema. |
|
4346 |
noPauseSema wait. |
|
4347 |
||
4348 |
"/ |
|
4349 |
"/ no interaction with the codeView ... |
|
4350 |
"/ |
|
4351 |
lowerFrameView windowGroup:(self windowGroup). |
|
4352 |
ex proceed. |
|
4353 |
] do:[ |
|
4354 |
startLine := subView cursorLine. |
|
4355 |
startCol := subView cursorCol. |
|
4356 |
||
4357 |
" |
|
4358 |
this can be a time consuming operation; therefore lower my priority |
|
4359 |
" |
|
4360 |
myProcess := Processor activeProcess. |
|
1912 | 4361 |
"/ myPriority := myProcess priority. |
4362 |
"/ myProcess priority:(Processor userBackgroundPriority). |
|
4363 |
||
2138 | 4364 |
stream := PipeStream |
4365 |
readingFrom:command |
|
4366 |
errorDisposition:#inline |
|
4367 |
inDirectory:currentDirectory. |
|
4368 |
stream notNil ifTrue:[ |
|
4369 |
[ |
|
4370 |
|codeView lines noPauseSema enc| |
|
4371 |
||
4372 |
enc := fileEncoding. |
|
4373 |
enc == #iso8859 ifTrue:[ |
|
4374 |
enc := nil |
|
4375 |
]. |
|
4376 |
||
4377 |
stream buffered:true. |
|
4378 |
codeView := subView. |
|
4379 |
codeView unselect. |
|
4380 |
||
4381 |
replace ifTrue:[ |
|
4382 |
codeView list:nil. |
|
4383 |
lnr := 1. |
|
4384 |
]. |
|
4385 |
||
4386 |
stillReplacing := replace. |
|
4387 |
||
4388 |
[stream readWait. stream atEnd] whileFalse:[ |
|
4389 |
" |
|
4390 |
data available; read up to 100 lines |
|
4391 |
and insert as a single junk. This speeds up |
|
4392 |
display of long output (less line-scrolling). |
|
4393 |
" |
|
4394 |
lines := OrderedCollection new:100. |
|
4395 |
||
4396 |
[ |
|
4397 |
line := stream nextLine. |
|
4398 |
line notNil ifTrue:[ |
|
4399 |
enc notNil ifTrue:[ |
|
4400 |
line := line decodeFrom:enc |
|
4401 |
]. |
|
4402 |
lines add:line |
|
4403 |
]. |
|
4404 |
] doWhile:[ |
|
4405 |
stream canReadWithoutBlocking |
|
4406 |
and:[stream atEnd not |
|
4407 |
and:[lines size < 100]] |
|
4408 |
]. |
|
4409 |
||
4410 |
" |
|
4411 |
need this critical section; otherwise, |
|
4412 |
we could get the signal while waiting for |
|
4413 |
an expose event ... |
|
4414 |
" |
|
4415 |
access critical:[ |
|
4416 |
lines size > 0 ifTrue:[ |
|
4417 |
stillReplacing ifTrue:[ |
|
4418 |
lines do:[:line | |
|
4419 |
codeView at:lnr put:line withTabsExpanded. |
|
4420 |
codeView cursorToBottom; cursorDown:1. |
|
4421 |
lnr := lnr + 1. |
|
4422 |
lnr > codeView list size ifTrue:[ |
|
4423 |
stillReplacing := false |
|
4424 |
] |
|
4425 |
]. |
|
4426 |
] ifFalse:[ |
|
4427 |
codeView insertLines:lines before:codeView cursorLine. |
|
4428 |
codeView cursorDown:lines size. |
|
4429 |
] |
|
4430 |
]. |
|
4431 |
]. |
|
4432 |
||
4433 |
" |
|
4434 |
give others running at same prio a chance too |
|
4435 |
(especially other FileBrowsers doing the same) |
|
4436 |
" |
|
4437 |
Processor yield |
|
4438 |
]. |
|
4439 |
] valueNowOrOnUnwindDo:[ |
|
4440 |
stream shutDown "close". stream := nil. |
|
4441 |
]. |
|
4442 |
||
4443 |
"/ |
|
4444 |
"/ the command could have changed the directory |
|
4445 |
"/ |
|
4446 |
self updateCurrentDirectoryIfChanged |
|
4447 |
]. |
|
4448 |
replace ifTrue:[ |
|
4449 |
subView modified:false. |
|
4450 |
]. |
|
4451 |
] |
|
4452 |
] |
|
1162 | 4453 |
] |
4454 |
] valueNowOrOnUnwindDo:[ |
|
2138 | 4455 |
|wg| |
4456 |
||
4457 |
self label:myName; iconLabel:myName. |
|
1912 | 4458 |
"/ myProcess notNil ifTrue:[myProcess priority:myPriority]. |
4459 |
||
2138 | 4460 |
" |
4461 |
hide the button, and make sure it will stay |
|
4462 |
hidden when we are realized again |
|
4463 |
" |
|
4464 |
killButton beInvisible. |
|
4465 |
pauseToggle beInvisible. |
|
4466 |
||
4467 |
commandView beVisible. |
|
4468 |
||
4469 |
" |
|
4470 |
remove the killButton from its group |
|
4471 |
(otherwise, it will be destroyed when we shut down the group) |
|
4472 |
" |
|
4473 |
wg := killButton windowGroup. |
|
4474 |
killButton windowGroup:nil. |
|
4475 |
pauseToggle windowGroup:nil. |
|
4476 |
||
4477 |
" |
|
4478 |
shut down the kill buttons windowgroup |
|
4479 |
" |
|
4480 |
wg notNil ifTrue:[ |
|
4481 |
wg process terminate. |
|
4482 |
]. |
|
4483 |
" |
|
4484 |
clear its action (actually not needed, but |
|
4485 |
releases reference to thisContext earlier) |
|
4486 |
" |
|
4487 |
killButton action:nil. |
|
4488 |
pauseToggle pressAction:nil. |
|
4489 |
"/ |
|
4490 |
"/ allow interaction with the codeView |
|
4491 |
"/ (bring it back into my group) |
|
4492 |
"/ |
|
4493 |
lowerFrameView windowGroup:(self windowGroup). |
|
1162 | 4494 |
]. |
4495 |
||
4496 |
currentFileName isNil ifTrue:[ |
|
2138 | 4497 |
subView modified:false. |
1162 | 4498 |
]. |
4499 |
||
4500 |
subView size > 10000 ifTrue:[ |
|
2138 | 4501 |
self warn:'text quite large now - please cut off some lines' |
1162 | 4502 |
] |
4503 |
||
1358 | 4504 |
"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
|
4505 |
"Modified: / 6.3.1998 / 17:32:03 / stefan" |
1933 | 4506 |
"Modified: / 15.10.1998 / 12:37:52 / cg" |
1162 | 4507 |
! |
4508 |
||
4509 |
imageAction:aFilename |
|
4510 |
"for some image files, if double clicked, we can do some useful |
|
4511 |
action ..." |
|
4512 |
||
2158
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
4513 |
|img errmsg| |
1162 | 4514 |
|
4515 |
(Image isImageFileSuffix:(aFilename asFilename suffix)) |
|
4516 |
ifTrue:[ |
|
2158
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
4517 |
Image imageLoadErrorSignal handle:[:ex | |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
4518 |
errmsg := ex errorString |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
4519 |
] do:[ |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
4520 |
img := Image fromFile:(currentDirectory construct:aFilename). |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
4521 |
]. |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
4522 |
img notNil ifTrue:[ |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
4523 |
ImageEditor openOnImage:img. |
1410 | 4524 |
"/ img inspect. |
2158
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
4525 |
^ true |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
4526 |
]. |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
4527 |
errmsg notNil ifTrue:[ |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
4528 |
self warn:errmsg. |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
4529 |
] |
1162 | 4530 |
]. |
4531 |
^ false |
|
4532 |
||
2158
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
4533 |
"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
|
4534 |
"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
|
4535 |
"Modified: / 18.5.1999 / 15:45:06 / cg" |
1162 | 4536 |
! |
4537 |
||
4538 |
initialCommandFor:fileName into:aBox |
|
4539 |
"set a useful initial command for execute box." |
|
4540 |
||
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
4541 |
|cmd select path suffix| |
1162 | 4542 |
|
4543 |
"/ XXX should be changed to take stuff from a config file |
|
4544 |
"/ XXX or from resources. |
|
4545 |
||
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
4546 |
path := currentDirectory filenameFor:fileName. |
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
4547 |
(path type == #regular) ifTrue:[ |
2138 | 4548 |
path isExecutableProgram ifTrue:[ |
4549 |
aBox initialText:(fileName , ' <arguments>'). |
|
4550 |
^ self |
|
4551 |
]. |
|
4552 |
||
4553 |
select := true. |
|
4554 |
||
4555 |
"some heuristics - my personal preferences ... |
|
4556 |
(actually this should come from a configfile)" |
|
4557 |
||
4558 |
(fileName endsWith:'akefile') ifTrue:[ |
|
4559 |
aBox initialText:'make target' selectFrom:6 to:11. |
|
4560 |
^ self |
|
4561 |
]. |
|
4562 |
||
4563 |
suffix := path suffix. |
|
4564 |
(suffix = 'C') ifTrue:[ |
|
4565 |
cmd := 'g++ -c %1'. |
|
4566 |
select := 6. |
|
4567 |
] ifFalse:[ |
|
4568 |
suffix := suffix asLowercase. |
|
4569 |
(suffix = 'taz') ifTrue:[ |
|
4570 |
aBox initialText:'zcat %1 | tar tvf -'. |
|
4571 |
select := false. |
|
4572 |
]. |
|
4573 |
(suffix = 'tar') ifTrue:[ |
|
4574 |
cmd := 'tar tvf %1'. |
|
4575 |
select := 7. |
|
4576 |
]. |
|
4577 |
(suffix = 'zoo') ifTrue:[ |
|
4578 |
cmd := 'zoo -list %1'. |
|
4579 |
select := 9. |
|
4580 |
]. |
|
4581 |
(suffix = 'zip') ifTrue:[ |
|
4582 |
cmd := 'unzip -l %1'. |
|
4583 |
select := 8. |
|
4584 |
]. |
|
4585 |
(suffix = 'jar') ifTrue:[ |
|
4586 |
cmd := 'unzip -l %1'. |
|
4587 |
select := 8. |
|
4588 |
]. |
|
4589 |
(suffix = 'z') ifTrue:[ |
|
4590 |
(fileName asLowercase endsWith:'tar.z') ifTrue:[ |
|
4591 |
cmd := 'zcat %1 | tar tvf -'. |
|
4592 |
select := false. |
|
4593 |
] ifFalse:[ |
|
4594 |
cmd := 'uncompress %1' |
|
4595 |
]. |
|
4596 |
]. |
|
4597 |
(suffix = 'gz') ifTrue:[ |
|
4598 |
(fileName asLowercase endsWith:'tar.gz') ifTrue:[ |
|
4599 |
cmd := ('gunzip < %1 | tar tvf -' ). |
|
4600 |
select := false. |
|
4601 |
] ifFalse:[ |
|
4602 |
cmd := 'gunzip %1'. |
|
4603 |
]. |
|
4604 |
]. |
|
4605 |
(suffix = 'tgz') ifTrue:[ |
|
4606 |
cmd := ('gunzip < %1 | tar tvf -' ). |
|
4607 |
select := false. |
|
4608 |
]. |
|
4609 |
(suffix = 'html') ifTrue:[ |
|
4610 |
cmd := 'netscape %1' |
|
4611 |
]. |
|
4612 |
(suffix = 'htm') ifTrue:[ |
|
4613 |
cmd := 'netscape %1' |
|
4614 |
]. |
|
4615 |
(suffix = 'uue') ifTrue:[ |
|
4616 |
cmd := 'uudecode %1' |
|
4617 |
]. |
|
4618 |
(suffix = 'c') ifTrue:[ |
|
4619 |
cmd := 'cc -c %1'. |
|
4620 |
select := 5. |
|
4621 |
]. |
|
4622 |
(suffix = 'cc') ifTrue:[ |
|
4623 |
cmd := 'g++ -c %1'. |
|
4624 |
select := 6. |
|
4625 |
]. |
|
4626 |
(suffix = 'xbm') ifTrue:[ |
|
4627 |
cmd := 'bitmap %1' |
|
4628 |
]. |
|
4629 |
(suffix = 'ps') ifTrue:[ |
|
4630 |
cmd := 'ghostview %1' |
|
4631 |
]. |
|
4632 |
((suffix = '1') or:[suffix = 'man']) ifTrue:[ |
|
4633 |
cmd := 'nroff -man %1'. |
|
4634 |
select := 10. |
|
4635 |
]. |
|
4636 |
]. |
|
4637 |
||
4638 |
cmd isNil ifTrue:[ |
|
4639 |
DefaultCommandPerSuffix isNil ifTrue:[ |
|
4640 |
cmd := '<cmd>' |
|
4641 |
] ifFalse:[ |
|
4642 |
cmd := DefaultCommandPerSuffix |
|
4643 |
at:suffix |
|
4644 |
ifAbsent:'<cmd>'. |
|
4645 |
]. |
|
4646 |
cmd := cmd , ' %1'. |
|
4647 |
]. |
|
4648 |
||
4649 |
cmd := cmd bindWith:fileName. |
|
4650 |
select == false ifTrue:[ |
|
4651 |
aBox initialText:cmd |
|
4652 |
] ifFalse:[ |
|
4653 |
select isInteger ifFalse:[ |
|
4654 |
select := (cmd indexOf:Character space ifAbsent:[cmd size + 1]) - 1. |
|
4655 |
]. |
|
4656 |
aBox initialText:cmd selectFrom:1 to:select |
|
4657 |
] |
|
1162 | 4658 |
] |
4659 |
||
1542 | 4660 |
"Modified: / 24.9.1997 / 16:34:52 / stefan" |
4661 |
"Modified: / 9.4.1998 / 17:15:57 / cg" |
|
1162 | 4662 |
! |
4663 |
||
4664 |
nonBinaryFileAction:aFilename |
|
4665 |
"for some nonBinary files, if double clicked, we can do some useful |
|
4666 |
action ..." |
|
4667 |
||
1493 | 4668 |
|fullPath| |
1162 | 4669 |
|
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
4670 |
fullPath := currentDirectory filenameFor:aFilename. |
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
4671 |
((fullPath hasSuffix:'htm') or:[fullPath hasSuffix:'html']) ifTrue:[ |
2138 | 4672 |
HTMLDocumentView openOn:fullPath pathName. |
4673 |
^ true |
|
2091 | 4674 |
]. |
4675 |
((fullPath hasSuffix:'prj') |
|
4676 |
and:[ProjectBrowser notNil]) ifTrue:[ |
|
2138 | 4677 |
ProjectBrowser openOnFile:fullPath pathName. |
4678 |
^ true |
|
1162 | 4679 |
]. |
4680 |
||
4681 |
OperatingSystem isUNIXlike ifTrue:[ |
|
2138 | 4682 |
(#('.man' '.1' '.2' '.3') findFirst:[:suff | fullPath hasSuffix:suff]) ~~ 0 |
4683 |
ifTrue:[ |
|
4684 |
HTMLDocumentView openFullOnText:(HTMLDocGenerator manPageForFile:fullPath pathName). |
|
4685 |
^ true |
|
4686 |
] |
|
1162 | 4687 |
]. |
4688 |
^ self imageAction:aFilename |
|
4689 |
||
4690 |
"Created: 19.6.1996 / 09:36:38 / cg" |
|
4691 |
"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
|
4692 |
"Modified: 18.9.1997 / 16:58:40 / stefan" |
1162 | 4693 |
! ! |
4694 |
||
4695 |
!FileBrowser methodsFor:'private - directory stuff'! |
|
4696 |
||
1371
a80db8d0e311
remember directory in history when entering (not when leaving)
Claus Gittinger <cg@exept.de>
parents:
1358
diff
changeset
|
4697 |
addToHistory:path |
a80db8d0e311
remember directory in history when entering (not when leaving)
Claus Gittinger <cg@exept.de>
parents:
1358
diff
changeset
|
4698 |
|pos idx| |
a80db8d0e311
remember directory in history when entering (not when leaving)
Claus Gittinger <cg@exept.de>
parents:
1358
diff
changeset
|
4699 |
|
a80db8d0e311
remember directory in history when entering (not when leaving)
Claus Gittinger <cg@exept.de>
parents:
1358
diff
changeset
|
4700 |
(DirectoryHistory includes:path) ifFalse:[ |
1393 | 4701 |
DirectoryHistory size >= HistorySize ifTrue:[ |
4702 |
DirectoryHistory removeLast. |
|
4703 |
DirectoryHistoryWhere removeLast |
|
4704 |
] |
|
1371
a80db8d0e311
remember directory in history when entering (not when leaving)
Claus Gittinger <cg@exept.de>
parents:
1358
diff
changeset
|
4705 |
] ifTrue:[ |
1393 | 4706 |
"already been there before; move the entry to |
4707 |
the beginning, so it will fall out later." |
|
4708 |
||
4709 |
idx := DirectoryHistory indexOf:path. |
|
4710 |
DirectoryHistory removeIndex:idx. |
|
4711 |
pos := DirectoryHistoryWhere at:idx. |
|
4712 |
DirectoryHistoryWhere removeIndex:idx. |
|
1371
a80db8d0e311
remember directory in history when entering (not when leaving)
Claus Gittinger <cg@exept.de>
parents:
1358
diff
changeset
|
4713 |
]. |
a80db8d0e311
remember directory in history when entering (not when leaving)
Claus Gittinger <cg@exept.de>
parents:
1358
diff
changeset
|
4714 |
DirectoryHistory addFirst:path. |
a80db8d0e311
remember directory in history when entering (not when leaving)
Claus Gittinger <cg@exept.de>
parents:
1358
diff
changeset
|
4715 |
DirectoryHistoryWhere addFirst:pos. |
a80db8d0e311
remember directory in history when entering (not when leaving)
Claus Gittinger <cg@exept.de>
parents:
1358
diff
changeset
|
4716 |
|
a80db8d0e311
remember directory in history when entering (not when leaving)
Claus Gittinger <cg@exept.de>
parents:
1358
diff
changeset
|
4717 |
"Created: / 8.11.1997 / 17:16:29 / cg" |
a80db8d0e311
remember directory in history when entering (not when leaving)
Claus Gittinger <cg@exept.de>
parents:
1358
diff
changeset
|
4718 |
! |
a80db8d0e311
remember directory in history when entering (not when leaving)
Claus Gittinger <cg@exept.de>
parents:
1358
diff
changeset
|
4719 |
|
172 | 4720 |
changeToPreviousDirectory |
4721 |
"if text was modified show a queryBox, |
|
4722 |
otherwise change immediately to previous directory." |
|
93 | 4723 |
|
172 | 4724 |
previousDirectory isNil ifTrue:[^ self]. |
1339
4b712d8c1738
Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents:
1336
diff
changeset
|
4725 |
self discardChangesDialog ifTrue:[ |
1393 | 4726 |
self doChangeCurrentDirectoryTo:previousDirectory updateHistory:false |
172 | 4727 |
] |
1339
4b712d8c1738
Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents:
1336
diff
changeset
|
4728 |
|
4b712d8c1738
Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents:
1336
diff
changeset
|
4729 |
"Modified: 2.10.1997 / 14:13:40 / stefan" |
36 | 4730 |
! |
4731 |
||
98 | 4732 |
checkIfDirectoryHasChanged |
4733 |
"every checkDelta secs, check if directoy has changed and update the list if so. |
|
4734 |
Also, we check if the file shown has been touched in the meanwhile (for example, |
|
4735 |
from another browser) and say 'outdated' in the label if so. |
|
4736 |
This avoids confusion if the same file is being edited by two browsers. (or other editors). |
|
4737 |
If the text shown in the codeView has been edited, 'modified' is shown. |
|
4738 |
" |
|
4739 |
||
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
4740 |
|oldSelection nOld newState msg newLabel t| |
98 | 4741 |
|
4742 |
shown ifTrue:[ |
|
1868 | 4743 |
currentDirectory notNil ifTrue:[ |
4744 |
lockUpdate ifTrue:[ |
|
4745 |
Processor removeTimedBlock:checkBlock. |
|
4746 |
Processor addTimedBlock:checkBlock afterSeconds:checkDelta. |
|
4747 |
^ self |
|
4748 |
]. |
|
4749 |
||
4750 |
subView modified ifTrue:[ |
|
4751 |
newState := ' (modified)' |
|
4752 |
]. |
|
4753 |
||
4754 |
(currentDirectory isReadable) ifTrue:[ |
|
4755 |
Processor removeTimedBlock:checkBlock. |
|
4756 |
||
4757 |
t := currentDirectory modificationTime. |
|
4758 |
(t notNil and:[t > timeOfLastCheck]) ifTrue:[ |
|
4759 |
nOld := fileListView numberOfSelections. |
|
4760 |
oldSelection := fileListView selectionValue. |
|
4761 |
self updateCurrentDirectory. |
|
4762 |
nOld ~~ 0 ifTrue:[ |
|
4763 |
nOld > 1 ifTrue:[ |
|
4764 |
oldSelection do:[:element | |
|
4765 |
fileListView addElementToSelection:element |
|
4766 |
] |
|
4767 |
] ifFalse:[ |
|
4768 |
fileListView selectElementWithoutScroll:oldSelection |
|
4769 |
] |
|
4770 |
]. |
|
4771 |
] ifFalse:[ |
|
4772 |
Processor addTimedBlock:checkBlock afterSeconds:checkDelta |
|
4773 |
]. |
|
4774 |
||
4775 |
currentFileName notNil ifTrue:[ |
|
4776 |
|f| |
|
4777 |
f := currentDirectory construct:currentFileName. |
|
4778 |
f exists ifFalse:[ |
|
4779 |
newState := ' (removed)'. |
|
4780 |
] ifTrue:[ |
|
4781 |
f modificationTime > timeOfFileRead ifTrue:[ |
|
4782 |
newState := ' (outdated)'. |
|
4783 |
subView modified ifTrue:[ |
|
4784 |
newState := ' (modified & outdated)' |
|
4785 |
] |
|
4786 |
]. |
|
4787 |
]. |
|
4788 |
]. |
|
4789 |
] ifFalse:[ |
|
4790 |
" |
|
4791 |
if the directory has been deleted, or is not readable ... |
|
4792 |
" |
|
4793 |
(currentDirectory exists) ifFalse:[ |
|
4794 |
msg := 'FileBrowser:\\directory %1 is gone ?!!?' |
|
4795 |
] ifTrue:[ |
|
4796 |
msg := 'FileBrowser:\\directory %1 is no longer readable ?!!?' |
|
4797 |
]. |
|
4798 |
self warn:(resources string:msg with:currentDirectory pathName) withCRs. |
|
4799 |
||
4800 |
fileListView contents:nil. |
|
4801 |
newLabel := myName , ': directory is gone !!'. |
|
4802 |
"/ Processor addTimedBlock:checkBlock afterSeconds:checkDelta |
|
4803 |
]. |
|
4804 |
||
4805 |
newState notNil ifTrue:[ |
|
4806 |
newLabel := myName. |
|
4807 |
currentFileName notNil ifTrue:[ |
|
4808 |
newLabel := newLabel , ': ' , currentFileName |
|
4809 |
]. |
|
4810 |
newLabel := newLabel , newState. |
|
4811 |
]. |
|
4812 |
newLabel notNil ifTrue:[ |
|
4813 |
self label:newLabel. |
|
4814 |
] |
|
4815 |
] |
|
98 | 4816 |
] |
1168
b157f3712548
care for nil returns from userName/groupName * time queries
Claus Gittinger <cg@exept.de>
parents:
1166
diff
changeset
|
4817 |
|
1380
547d31bfa12c
warning string fixed when directory vanishes
Claus Gittinger <cg@exept.de>
parents:
1374
diff
changeset
|
4818 |
"Modified: / 28.4.1997 / 22:31:02 / dq" |
547d31bfa12c
warning string fixed when directory vanishes
Claus Gittinger <cg@exept.de>
parents:
1374
diff
changeset
|
4819 |
"Modified: / 16.9.1997 / 15:17:15 / stefan" |
1481 | 4820 |
"Modified: / 18.2.1998 / 17:57:49 / cg" |
98 | 4821 |
! |
4822 |
||
172 | 4823 |
doChangeCurrentDirectoryTo:fileName updateHistory:updateHistory |
4824 |
"verify argument is name of a readable & executable directory |
|
4825 |
and if so, go there" |
|
4826 |
||
1317 | 4827 |
|msg path idx f| |
172 | 4828 |
|
4829 |
self label:myName; iconLabel:myName. |
|
4830 |
fileName notNil ifTrue:[ |
|
2138 | 4831 |
(f := fileName asFilename) isAbsolute ifFalse:[ |
4832 |
f := currentDirectory filenameFor:fileName. |
|
4833 |
]. |
|
4834 |
f := f asAbsoluteFilename. |
|
4835 |
(f isDirectory) ifTrue:[ |
|
4836 |
(f isReadable) ifTrue:[ |
|
4837 |
(f isExecutable) ifTrue:[ |
|
4838 |
path := currentDirectory pathName. |
|
4839 |
previousDirectory := path. |
|
4840 |
||
4841 |
" |
|
4842 |
remember where we are positioned in the fileList |
|
4843 |
(in case we want to return) |
|
4844 |
" |
|
4845 |
idx := DirectoryHistory indexOf:path. |
|
4846 |
idx ~~ 0 ifTrue:[ |
|
4847 |
DirectoryHistoryWhere at:idx put:fileListView firstLineShown |
|
4848 |
]. |
|
4849 |
||
4850 |
updateHistory ifTrue:[ |
|
4851 |
self addToHistory:path. |
|
4852 |
]. |
|
4853 |
||
4854 |
self setCurrentDirectory:(f pathName). |
|
4855 |
||
4856 |
"/ fetch the new path. |
|
4857 |
path := currentDirectory pathName. |
|
4858 |
||
4859 |
" |
|
4860 |
if we have already been there, look for the |
|
4861 |
position offset, and scroll the fileList |
|
4862 |
" |
|
4863 |
idx := DirectoryHistory indexOf:path. |
|
4864 |
idx ~~ 0 ifTrue:[ |
|
4865 |
|pos| |
|
4866 |
||
4867 |
pos := DirectoryHistoryWhere at:idx. |
|
4868 |
pos notNil ifTrue:[ |
|
4869 |
fileListView scrollToLine:pos. |
|
4870 |
] |
|
4871 |
]. |
|
4872 |
||
4873 |
updateHistory ifTrue:[ |
|
4874 |
self addToHistory:path. |
|
4875 |
]. |
|
4876 |
||
4877 |
^ self |
|
4878 |
]. |
|
4879 |
msg := 'cannot change directory to ''%1'' !!' |
|
4880 |
] ifFalse:[ |
|
4881 |
msg := 'cannot read directory ''%1'' !!' |
|
4882 |
] |
|
4883 |
] ifFalse:[ |
|
4884 |
OperatingSystem isVMSlike ifTrue:[ |
|
4885 |
"/ cannot tell if it exists or is simply invisible ... |
|
4886 |
msg := '''%1'' is not a directory or unreadable !!' |
|
4887 |
] ifFalse:[ |
|
4888 |
msg := '''%1'' is not a directory !!' |
|
4889 |
] |
|
4890 |
]. |
|
4891 |
Dialog warn:(resources string:msg withCRs with:fileName). |
|
172 | 4892 |
] |
1166
0029f77ccea7
when updating the directoryList,
Claus Gittinger <cg@exept.de>
parents:
1162
diff
changeset
|
4893 |
|
1371
a80db8d0e311
remember directory in history when entering (not when leaving)
Claus Gittinger <cg@exept.de>
parents:
1358
diff
changeset
|
4894 |
"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
|
4895 |
"Modified: / 27.4.1999 / 17:10:14 / cg" |
1329 | 4896 |
! |
4897 |
||
4898 |
doChangeToDefaultDirectory |
|
4899 |
"go to parent directory" |
|
4900 |
||
4901 |
self doChangeCurrentDirectoryTo:(Filename currentDirectory pathName) updateHistory:true |
|
4902 |
||
4903 |
"Created: 21.9.1997 / 23:45:59 / cg" |
|
172 | 4904 |
! |
4905 |
||
4906 |
doChangeToHomeDirectory |
|
4907 |
"go to home directory" |
|
4908 |
||
4909 |
self doChangeCurrentDirectoryTo:(OperatingSystem getHomeDirectory) updateHistory:true |
|
4910 |
! |
|
4911 |
||
4912 |
doChangeToParentDirectory |
|
1317 | 4913 |
"go to parent directory" |
36 | 4914 |
|
172 | 4915 |
self doChangeCurrentDirectoryTo:'..' updateHistory:true |
4916 |
! |
|
4917 |
||
4918 |
doCreateDirectory:newName |
|
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
4919 |
|f| |
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
4920 |
|
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
4921 |
f := currentDirectory filenameFor:newName. |
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
4922 |
f exists ifTrue:[ |
2138 | 4923 |
self warn:'%1 already exists.' with:newName. |
4924 |
^ self |
|
172 | 4925 |
]. |
4926 |
||
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
4927 |
f makeDirectory ifTrue:[ |
2138 | 4928 |
self updateCurrentDirectory |
172 | 4929 |
] ifFalse:[ |
2138 | 4930 |
self showAlert:(resources string:'cannot create directory ''%1'' !!' with:newName) |
4931 |
with:(OperatingSystem lastErrorString) |
|
172 | 4932 |
] |
1157
667a57034e40
only update if the directory did change (after execute command)
Claus Gittinger <cg@exept.de>
parents:
1156
diff
changeset
|
4933 |
|
1988 | 4934 |
"Modified: / 18.9.1997 / 17:21:25 / stefan" |
4935 |
"Modified: / 30.1.1999 / 16:24:12 / cg" |
|
172 | 4936 |
! |
4937 |
||
1162 | 4938 |
setCurrentDirectory:aPathName |
4939 |
"setup for another directory" |
|
4940 |
||
4941 |
|newDirectory| |
|
4942 |
||
4943 |
aPathName isEmpty ifTrue:[^ self]. |
|
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
4944 |
newDirectory := currentDirectory filenameFor:aPathName. |
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
4945 |
newDirectory isDirectory ifTrue:[ |
1329 | 4946 |
self currentDirectory:newDirectory. |
4947 |
currentFileName notNil ifTrue:[ |
|
4948 |
fileListView contents:nil. |
|
4949 |
currentFileName := nil. |
|
4950 |
] ifFalse:[ |
|
4951 |
fileListView setSelection:nil. |
|
4952 |
fileListView scrollToTop. |
|
4953 |
]. |
|
4954 |
self updateCurrentDirectory. |
|
4955 |
self showInfo. |
|
172 | 4956 |
] |
294 | 4957 |
|
1162 | 4958 |
"Modified: 21.9.1995 / 11:22:45 / claus" |
4959 |
"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
|
4960 |
"Modified: 18.9.1997 / 17:08:07 / stefan" |
912
dae70963b64c
define language specific commentStrings
Claus Gittinger <cg@exept.de>
parents:
874
diff
changeset
|
4961 |
! |
dae70963b64c
define language specific commentStrings
Claus Gittinger <cg@exept.de>
parents:
874
diff
changeset
|
4962 |
|
1162 | 4963 |
updateCurrentDirectoryIfChanged |
1837 | 4964 |
|t| |
4965 |
||
1975 | 4966 |
OperatingSystem isMSDOSlike ifTrue:[ |
2138 | 4967 |
"/ workaround: DOS has no diretory modifiation time ... |
4968 |
self updateCurrentDirectory. |
|
4969 |
^ self |
|
1975 | 4970 |
]. |
4971 |
||
1837 | 4972 |
((t := currentDirectory modificationTime) isNil |
4973 |
or:[t > timeOfLastCheck]) ifTrue:[ |
|
2138 | 4974 |
self updateCurrentDirectory |
1162 | 4975 |
] |
4976 |
||
1837 | 4977 |
"Modified: / 16.9.1997 / 15:35:52 / stefan" |
1975 | 4978 |
"Modified: / 16.12.1998 / 22:55:44 / cg" |
1162 | 4979 |
! ! |
4980 |
||
4981 |
!FileBrowser methodsFor:'private - encoding'! |
|
172 | 4982 |
|
395 | 4983 |
guessEncodingFrom:aBuffer |
988 | 4984 |
"look for a string |
1317 | 4985 |
encoding #name |
988 | 4986 |
or: |
1317 | 4987 |
encoding: name |
1209 | 4988 |
within the given buffer |
4989 |
(which is usually the first few bytes of a textFile). |
|
4990 |
If thats not found, use heuristics (in CharacterArray) to guess." |
|
988 | 4991 |
|
395 | 4992 |
|n "{Class: SmallInteger }" |
1209 | 4993 |
binary idx s w enc| |
395 | 4994 |
|
4995 |
binary := false. |
|
4996 |
n := aBuffer size. |
|
4997 |
||
1223 | 4998 |
(idx := aBuffer findString:'charset=') ~~ 0 ifTrue:[ |
1317 | 4999 |
s := ReadStream on:aBuffer. |
5000 |
s position:idx + 8. |
|
5001 |
s skipSeparators. |
|
5002 |
w := s upToSeparator. |
|
5003 |
w notNil ifTrue:[ |
|
5004 |
(idx := w indexOf:$") ~~ 0 ifTrue:[ |
|
5005 |
w := w copyTo:idx-1 |
|
5006 |
]. |
|
5007 |
^ w asSymbol |
|
5008 |
]. |
|
1223 | 5009 |
]. |
807 | 5010 |
(idx := aBuffer findString:'encoding') ~~ 0 ifTrue:[ |
1317 | 5011 |
s := ReadStream on:aBuffer. |
5012 |
s position:idx + 8. |
|
5013 |
s skipSeparators. |
|
5014 |
s peek == $: ifTrue:[ |
|
5015 |
s next. |
|
5016 |
s skipSeparators. |
|
5017 |
]. |
|
5018 |
||
5019 |
s peek == $# ifTrue:[ |
|
5020 |
s next. |
|
5021 |
s skipSeparators. |
|
5022 |
]. |
|
5023 |
w := s upToSeparator. |
|
5024 |
w notNil ifTrue:[ |
|
5025 |
^ w asSymbol |
|
5026 |
]. |
|
807 | 5027 |
]. |
5028 |
||
395 | 5029 |
1 to:n do:[:i | |
1317 | 5030 |
(aBuffer at:i) isPrintable ifFalse:[binary := true]. |
395 | 5031 |
]. |
807 | 5032 |
|
395 | 5033 |
binary ifTrue:[ |
1317 | 5034 |
"/ look for JIS7 / EUC encoding |
5035 |
||
5036 |
enc := CharacterArray guessEncodingFrom:aBuffer. |
|
5037 |
enc notNil ifTrue:[ |
|
5038 |
^ enc |
|
5039 |
]. |
|
5040 |
||
5041 |
"/ if the encoding has been set to any non iso setting, |
|
5042 |
"/ assume its what we defined ... |
|
5043 |
||
5044 |
(('iso*' match:fileEncoding) or:['ascii*' match:fileEncoding]) ifTrue:[ |
|
5045 |
^ #binary |
|
5046 |
]. |
|
5047 |
^ fileEncoding ? #binary |
|
395 | 5048 |
]. |
5049 |
^ #ascii |
|
5050 |
||
5051 |
"Created: 26.2.1996 / 17:43:08 / cg" |
|
1223 | 5052 |
"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
|
5053 |
! |
02d5bbd925dd
allow decoding errors to be ignored
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
5054 |
|
02d5bbd925dd
allow decoding errors to be ignored
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
5055 |
preferredFontEncodingFor:fileEncoding |
02d5bbd925dd
allow decoding errors to be ignored
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
5056 |
"given a file encoding, return corresponding preferred fontEncoding |
02d5bbd925dd
allow decoding errors to be ignored
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
5057 |
match pattern" |
02d5bbd925dd
allow decoding errors to be ignored
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
5058 |
|
1223 | 5059 |
|fe| |
5060 |
||
5061 |
fe := MIMETypes fontForCharset:fileEncoding. |
|
5062 |
fe notNil ifTrue:[^ fe]. |
|
1221 | 5063 |
^ 'iso8859*' |
1214
02d5bbd925dd
allow decoding errors to be ignored
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
5064 |
|
02d5bbd925dd
allow decoding errors to be ignored
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
5065 |
"Created: 28.6.1997 / 20:47:35 / cg" |
1223 | 5066 |
"Modified: 1.7.1997 / 00:04:56 / cg" |
395 | 5067 |
! |
5068 |
||
1140 | 5069 |
validateFontEncodingFor:newEncoding ask:ask |
5070 |
"if required, query user if he/she wants to change to another font, |
|
5071 |
which is able to display text encoded as specified by newEncoding" |
|
5072 |
||
1214
02d5bbd925dd
allow decoding errors to be ignored
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
5073 |
|fontsEncoding msg filter f defaultFont pref| |
1140 | 5074 |
|
5075 |
fontsEncoding := subView font encoding. |
|
5076 |
||
1221 | 5077 |
pref := self preferredFontEncodingFor:newEncoding. |
5078 |
||
5079 |
(pref match:fontsEncoding) ifTrue:[ |
|
1317 | 5080 |
^ self |
1140 | 5081 |
]. |
1221 | 5082 |
"/ stupid ... |
5083 |
pref = 'ascii*' ifTrue:[ |
|
1317 | 5084 |
(fontsEncoding match:'iso8859*') ifTrue:[ |
5085 |
^ self |
|
5086 |
] |
|
1140 | 5087 |
]. |
5088 |
||
1221 | 5089 |
filter := [:f | |coding| |
1317 | 5090 |
(coding := f encoding) notNil |
5091 |
and:[pref match:coding]]. |
|
1221 | 5092 |
|
5093 |
defaultFont := TextView defaultFont onDevice:device. |
|
5094 |
(pref match:(defaultFont encoding)) ifFalse:[ |
|
1317 | 5095 |
defaultFont := nil. |
1140 | 5096 |
]. |
5097 |
||
1221 | 5098 |
defaultFont isNil ifTrue:[ |
1317 | 5099 |
(pref = 'ascii*' |
5100 |
or:[pref = 'iso8859*']) ifTrue:[ |
|
5101 |
defaultFont := FontDescription family:'courier' face:'medium' style:'roman' size:12 |
|
5102 |
] |
|
1221 | 5103 |
]. |
5104 |
||
5105 |
defaultFont isNil ifTrue:[ |
|
1317 | 5106 |
defaultFont := device |
5107 |
listOfAvailableFonts |
|
5108 |
detect:[:f | filter value:f] |
|
5109 |
ifNone:nil. |
|
5110 |
defaultFont isNil ifTrue:[ |
|
5111 |
||
5112 |
"/ flush list, and refetch font list |
|
5113 |
"/ (in case someone just changed the font path ...) |
|
5114 |
||
5115 |
device flushListOfAvailableFonts. |
|
5116 |
defaultFont := device |
|
5117 |
listOfAvailableFonts |
|
5118 |
detect:[:f | filter value:f] |
|
5119 |
ifNone:nil. |
|
5120 |
]. |
|
5121 |
||
5122 |
defaultFont isNil ifTrue:[ |
|
5123 |
self warn:'your display does not seem to provide any ' , newEncoding , '-encoded font.'. |
|
5124 |
^ self. |
|
5125 |
] |
|
1221 | 5126 |
]. |
5127 |
||
5128 |
msg := 'switch to a %1 encoded font ?'. |
|
5129 |
(ask not or:[self confirm:(resources string:msg with:pref) withCRs]) |
|
5130 |
ifTrue:[ |
|
1317 | 5131 |
self withWaitCursorDo:[ |
5132 |
f := FontPanel |
|
5133 |
fontFromUserInitial:defaultFont |
|
5134 |
title:(resources string:'font selection') |
|
5135 |
filter:filter. |
|
5136 |
f notNil ifTrue:[ |
|
5137 |
subView font:f |
|
5138 |
] |
|
5139 |
] |
|
1140 | 5140 |
] |
5141 |
||
5142 |
"Created: 26.10.1996 / 12:06:54 / cg" |
|
1221 | 5143 |
"Modified: 30.6.1997 / 17:46:46 / cg" |
1162 | 5144 |
! ! |
5145 |
||
5146 |
!FileBrowser methodsFor:'private - file stuff'! |
|
5147 |
||
5148 |
doCreateFile:newName |
|
5149 |
"create an empty file" |
|
5150 |
||
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
5151 |
|aStream f| |
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
5152 |
|
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
5153 |
f := currentDirectory filenameFor:newName. |
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
5154 |
f exists ifTrue:[ |
1329 | 5155 |
(self |
5156 |
ask:(resources string:'%1 already exists\\truncate ?' with:newName) |
|
5157 |
yesButton:'truncate' |
|
5158 |
) ifFalse:[^ self]. |
|
1162 | 5159 |
]. |
5160 |
||
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
5161 |
FileStream openErrorSignal handle:[:ex| |
1329 | 5162 |
^ self showAlert:(resources string:'cannot create file ''%1'' !!' with:newName) |
5163 |
with:(FileStream lastErrorString) |
|
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
5164 |
] do:[ |
1329 | 5165 |
aStream := f newReadWriteStream. |
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
5166 |
]. |
1162 | 5167 |
aStream notNil ifTrue:[ |
1329 | 5168 |
aStream close. |
5169 |
self updateCurrentDirectoryIfChanged |
|
1162 | 5170 |
] ifFalse:[ |
1329 | 5171 |
self showAlert:(resources string:'cannot create file ''%1'' !!' with:newName) |
5172 |
with:(FileStream lastErrorString) |
|
1162 | 5173 |
] |
5174 |
||
5175 |
"Modified: 23.4.1997 / 13:19:12 / cg" |
|
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
5176 |
"Modified: 18.9.1997 / 17:21:45 / stefan" |
1140 | 5177 |
! |
5178 |
||
1162 | 5179 |
doFileGet:viaDoubleClick |
5180 |
"get selected file - show contents in subView. |
|
5181 |
This is invoked either by the 'get file' menu item, or via double click. |
|
5182 |
When invoked via the menu (viaDoubleClick argument is false), |
|
5183 |
the automatic file action is not performed - instead, the file is always |
|
5184 |
shown in the codeView (if possible). |
|
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
5185 |
This distinction was done to allow xpm or xbm files (which have an automatic |
1162 | 5186 |
action) to be edited." |
5187 |
||
1994 | 5188 |
|fileName| |
5189 |
||
5190 |
fileName := self getSelectedFileName. |
|
5191 |
fileName notNil ifTrue:[ |
|
2138 | 5192 |
self doOpenFile:fileName viaDoubleClick:viaDoubleClick |
1162 | 5193 |
] |
5194 |
||
1955
e10babdbf077
before accepting, see if the file is outdated and warn if so.
Claus Gittinger <cg@exept.de>
parents:
1950
diff
changeset
|
5195 |
"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
|
5196 |
"Modified: / 18.9.1997 / 17:35:31 / stefan" |
1994 | 5197 |
"Modified: / 4.2.1999 / 17:43:51 / cg" |
1162 | 5198 |
! |
5199 |
||
2166
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5200 |
doFindFileNamed:namePatterns ignoreCase:ignCaseInName containingString:contentsString ignoreCaseInContents:ignCaseInString sameContentsAsFile:filenameToCompareContentsOrNil sameContentsAs:bytesToCompareContentsOrNil in:aDirectory |
1965 | 5201 |
|dir subDirs nameMatches contentsMatches lines contentsToCompare| |
5202 |
||
5203 |
bytesToCompareContentsOrNil notNil ifTrue:[ |
|
2166
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5204 |
contentsToCompare := bytesToCompareContentsOrNil |
1965 | 5205 |
]. |
1933 | 5206 |
|
5207 |
subDirs := OrderedCollection new. |
|
5208 |
||
5209 |
dir := aDirectory asFilename. |
|
5210 |
self label:myName , '- searching ' , dir name. |
|
5211 |
(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
|
5212 |
|f| |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5213 |
|
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5214 |
f := dir construct:fn. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5215 |
f isDirectory ifTrue:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5216 |
f isSymbolicLink ifFalse:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5217 |
subDirs add:f |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5218 |
] |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5219 |
] ifFalse:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5220 |
(nameMatches := namePatterns isNil) ifFalse:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5221 |
ignCaseInName ifTrue:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5222 |
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
|
5223 |
] ifFalse:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5224 |
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
|
5225 |
] |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5226 |
]. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5227 |
nameMatches ifTrue:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5228 |
filenameToCompareContentsOrNil notNil ifTrue:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5229 |
"/ contents compare ... |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5230 |
contentsMatches := false. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5231 |
f pathName ~= filenameToCompareContentsOrNil pathName ifTrue:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5232 |
f fileSize == filenameToCompareContentsOrNil fileSize ifTrue:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5233 |
contentsToCompare isNil ifTrue:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5234 |
filenameToCompareContentsOrNil fileSize < (512*1024) ifTrue:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5235 |
contentsToCompare := filenameToCompareContentsOrNil binaryContentsOfEntireFile |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5236 |
] |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5237 |
]. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5238 |
contentsToCompare isNil ifTrue:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5239 |
"/ too large - compare block-wise ... |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5240 |
contentsMatches := (filenameToCompareContentsOrNil sameContentsAs:f). |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5241 |
] ifFalse:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5242 |
contentsMatches := contentsToCompare = (f binaryContentsOfEntireFile). |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5243 |
] |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5244 |
]. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5245 |
] ifFalse:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5246 |
f isSymbolicLink ifTrue:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5247 |
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
|
5248 |
subView cursorDown. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5249 |
] |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5250 |
] |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5251 |
] ifFalse:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5252 |
"/ string search ... |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5253 |
(contentsMatches := contentsString isNil) ifFalse:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5254 |
(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
|
5255 |
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
|
5256 |
subView cursorDown. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5257 |
] ifTrue:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5258 |
f fileSize > (4024*1024) ifTrue:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5259 |
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
|
5260 |
subView cursorDown. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5261 |
] ifFalse:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5262 |
Stream lineTooLongErrorSignal handle:[:ex | |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5263 |
|cont| |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5264 |
|
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5265 |
"/ 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
|
5266 |
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
|
5267 |
ignCaseInString ifTrue:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5268 |
contentsMatches := cont asLowercase includesString:contentsString |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5269 |
] ifFalse:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5270 |
contentsMatches := cont includesString:contentsString |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5271 |
]. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5272 |
] do:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5273 |
lines := f contents ? #(). |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5274 |
ignCaseInString ifTrue:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5275 |
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
|
5276 |
] ifFalse:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5277 |
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
|
5278 |
]. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5279 |
]. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5280 |
]. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5281 |
]. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5282 |
]. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5283 |
]. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5284 |
contentsMatches ifTrue:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5285 |
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
|
5286 |
subView cursorDown. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5287 |
] |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5288 |
] |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5289 |
] |
1933 | 5290 |
]. |
5291 |
||
5292 |
subDirs do:[:dir | |
|
2166
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5293 |
self |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5294 |
doFindFileNamed:namePatterns |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5295 |
ignoreCase:ignCaseInName |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5296 |
containingString:contentsString |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5297 |
ignoreCaseInContents:ignCaseInString |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5298 |
sameContentsAsFile:filenameToCompareContentsOrNil |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5299 |
sameContentsAs:contentsToCompare |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
5300 |
in:dir |
1933 | 5301 |
]. |
5302 |
||
5303 |
"Created: / 15.10.1998 / 11:37:15 / cg" |
|
5304 |
"Modified: / 15.10.1998 / 12:50:48 / cg" |
|
5305 |
! |
|
5306 |
||
1994 | 5307 |
doOpenFile:fileName viaDoubleClick:viaDoubleClick |
5308 |
"get selected file - show contents in subView. |
|
5309 |
This is invoked either by the 'get file' menu item, or via double click. |
|
5310 |
When invoked via the menu (viaDoubleClick argument is false), |
|
5311 |
the automatic file action is not performed - instead, the file is always |
|
5312 |
shown in the codeView (if possible). |
|
5313 |
This distinction was done to allow xpm or xbm files (which have an automatic |
|
5314 |
action) to be edited." |
|
5315 |
||
5316 |
|iconLbl winLbl f| |
|
5317 |
||
5318 |
self withReadCursorDo:[ |
|
2139 | 5319 |
(f := fileName asFilename) isAbsolute ifFalse:[ |
5320 |
f := currentDirectory construct:fileName. |
|
5321 |
]. |
|
5322 |
f isDirectory ifTrue:[ |
|
5323 |
self doChangeCurrentDirectoryTo:fileName updateHistory:true. |
|
5324 |
winLbl := myName. |
|
5325 |
iconLbl := myName |
|
5326 |
] ifFalse:[ |
|
5327 |
f exists ifFalse:[ |
|
5328 |
Dialog warn:(resources string:'oops, ''%1'' is gone or unreadable.' withCRs with:f pathName asText allBold). |
|
5329 |
^ self |
|
5330 |
]. |
|
5331 |
timeOfFileRead := f modificationTime. |
|
5332 |
self showFile:fileName insert:false encoding:fileEncoding doubleClick:viaDoubleClick. |
|
5333 |
currentFileName := fileName. |
|
5334 |
||
5335 |
self fileTypeSpecificActions. |
|
5336 |
||
5337 |
subView acceptAction:[:theCode | |
|
5338 |
(f modificationTime <= timeOfFileRead |
|
5339 |
or:[ |
|
5340 |
(self |
|
5341 |
ask:(resources at:'FileBrowser:\\file has changed somehow in the meanwhile.\(Hint: use the file-difference menu function to see what has changed)\\Do you really want to save ?') |
|
5342 |
yesButton:'save' |
|
5343 |
noButton:'don''t save')]) ifTrue:[ |
|
5344 |
||
5345 |
self withCursor:(Cursor write) do:[ |
|
5346 |
self writeFile:fileName text:theCode encoding:fileEncoding. |
|
5347 |
timeOfFileRead := f modificationTime. |
|
5348 |
self label:myName , ': ' , currentFileName |
|
5349 |
] |
|
5350 |
] |
|
5351 |
]. |
|
5352 |
||
5353 |
winLbl := myName , ': ' , fileName. |
|
5354 |
f isWritable ifFalse:[ |
|
5355 |
winLbl := winLbl , ' (readonly)' |
|
5356 |
]. |
|
5357 |
iconLbl := fileName |
|
5358 |
]. |
|
5359 |
self label:winLbl. |
|
5360 |
self iconLabel:iconLbl. |
|
1994 | 5361 |
] |
5362 |
||
5363 |
"Created: / 4.2.1999 / 17:43:26 / cg" |
|
2139 | 5364 |
"Modified: / 3.5.1999 / 20:32:27 / ps" |
5365 |
"Modified: / 4.5.1999 / 20:39:10 / cg" |
|
1994 | 5366 |
! |
5367 |
||
1961
f81295571da7
care for updating listView while removing (get selection before)
Claus Gittinger <cg@exept.de>
parents:
1956
diff
changeset
|
5368 |
doRemove:filesToRemove |
1162 | 5369 |
"remove the selected file(s) - no questions asked" |
5370 |
||
2124
826a16d63a93
care for win32 - no file modificationTime
Claus Gittinger <cg@exept.de>
parents:
2116
diff
changeset
|
5371 |
|msg needUpdate toRemove updateRunning yesToAll mTime| |
1162 | 5372 |
|
5373 |
updateRunning := listUpdateProcess notNil. |
|
5374 |
self stopUpdateProcess. |
|
5375 |
toRemove := OrderedCollection new. |
|
5376 |
||
5377 |
"/ |
|
5378 |
"/ did the directory change in the meanwhile ? |
|
5379 |
"/ |
|
2124
826a16d63a93
care for win32 - no file modificationTime
Claus Gittinger <cg@exept.de>
parents:
2116
diff
changeset
|
5380 |
mTime := currentDirectory modificationTime. |
826a16d63a93
care for win32 - no file modificationTime
Claus Gittinger <cg@exept.de>
parents:
2116
diff
changeset
|
5381 |
needUpdate := mTime notNil and:[mTime > timeOfLastCheck]. |
1162 | 5382 |
|
1945
8acc1753a8ed
added 'yes-to-all' in multi-remove confirmation dialog.
Claus Gittinger <cg@exept.de>
parents:
1942
diff
changeset
|
5383 |
yesToAll := false. |
1162 | 5384 |
lockUpdate := true. |
5385 |
[ |
|
2138 | 5386 |
filesToRemove keysAndValuesDo:[:idx :fileName | |
5387 |
|f| |
|
5388 |
||
5389 |
f := currentDirectory construct:fileName. |
|
5390 |
OperatingSystem accessDeniedErrorSignal handle:[:ex| |
|
5391 |
"was not able to remove it" |
|
5392 |
msg := (resources string:'cannot remove ''%1'' !!' with:fileName). |
|
5393 |
self showAlert:msg with:(OperatingSystem lastErrorString) |
|
5394 |
] do:[ |
|
5395 |
|answer contents i| |
|
5396 |
||
5397 |
(f isSymbolicLink not and:[f isDirectory]) ifTrue:[ |
|
5398 |
contents := f directoryContents. |
|
5399 |
contents isEmpty ifTrue:[ |
|
5400 |
f remove |
|
5401 |
] ifFalse:[ |
|
5402 |
yesToAll ifFalse:[ |
|
5403 |
idx == filesToRemove size ifTrue:[ |
|
5404 |
answer := Dialog |
|
5405 |
confirmWithCancel:(resources string:'directory ''%1'' is not empty\remove anyway ?' with:fileName asText allBold) withCRs |
|
5406 |
labels:(resources array:#('cancel' 'remove')) |
|
5407 |
values:#(false true) |
|
5408 |
default:2. |
|
5409 |
] ifFalse:[ |
|
5410 |
answer := Dialog |
|
5411 |
confirmWithCancel:(resources string:'directory ''%1'' is not empty\remove anyway ?' with:fileName asText allBold) withCRs |
|
5412 |
labels:(resources array:#('cancel' 'remove all' 'remove')) |
|
5413 |
values:#(false #removeAll true) |
|
5414 |
default:3. |
|
5415 |
]. |
|
5416 |
answer == false ifTrue:[ |
|
5417 |
^ self |
|
5418 |
]. |
|
5419 |
answer == #removeAll ifTrue:[ |
|
5420 |
yesToAll := true |
|
5421 |
]. |
|
5422 |
]. |
|
5423 |
f recursiveRemove |
|
5424 |
]. |
|
5425 |
] ifFalse:[ |
|
5426 |
f remove. |
|
5427 |
]. |
|
1162 | 5428 |
" |
2138 | 5429 |
self show:nil |
1945
8acc1753a8ed
added 'yes-to-all' in multi-remove confirmation dialog.
Claus Gittinger <cg@exept.de>
parents:
1942
diff
changeset
|
5430 |
" |
2138 | 5431 |
i := fileList indexOf:fileName. |
5432 |
i ~~ 0 ifTrue:[ |
|
5433 |
toRemove add:i. |
|
5434 |
] |
|
5435 |
]. |
|
5436 |
]. |
|
1162 | 5437 |
] valueNowOrOnUnwindDo:[ |
2138 | 5438 |
lockUpdate := false. |
5439 |
fileListView setSelection:nil. |
|
5440 |
||
5441 |
"/ |
|
5442 |
"/ remove reverse - otherwise indices are wrong |
|
5443 |
"/ |
|
5444 |
toRemove sort. |
|
5445 |
toRemove reverseDo:[:idx | |
|
5446 |
fileList removeIndex:idx. |
|
5447 |
fileListView removeIndex:idx. |
|
5448 |
]. |
|
5449 |
||
5450 |
updateRunning ifTrue:[ |
|
5451 |
self updateCurrentDirectory |
|
5452 |
] ifFalse:[ |
|
5453 |
" |
|
5454 |
install a new check after some time |
|
5455 |
" |
|
5456 |
needUpdate ifFalse:[timeOfLastCheck := AbsoluteTime now]. |
|
5457 |
Processor removeTimedBlock:checkBlock. |
|
5458 |
Processor addTimedBlock:checkBlock afterSeconds:checkDelta. |
|
5459 |
] |
|
1162 | 5460 |
] |
5461 |
||
1374
b3a1e95a6220
Do not ask for nonempty directory if remove target is a symlink
Stefan Vogel <sv@exept.de>
parents:
1371
diff
changeset
|
5462 |
"Modified: / 20.11.1997 / 17:39:14 / stefan" |
2124
826a16d63a93
care for win32 - no file modificationTime
Claus Gittinger <cg@exept.de>
parents:
2116
diff
changeset
|
5463 |
"Modified: / 26.4.1999 / 23:03:12 / cg" |
1162 | 5464 |
! |
5465 |
||
5466 |
doRename:oldName to:newName |
|
1331
73e712c85588
Handle errors when renaming files.
Stefan Vogel <sv@exept.de>
parents:
1330
diff
changeset
|
5467 |
"rename a file (or directory)" |
1162 | 5468 |
|
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
5469 |
|old new| |
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
5470 |
|
1162 | 5471 |
(oldName notNil and:[newName notNil]) ifTrue:[ |
2138 | 5472 |
(oldName isBlank or:[newName isBlank]) ifFalse:[ |
5473 |
old := currentDirectory filenameFor:oldName. |
|
5474 |
new := currentDirectory filenameFor:newName. |
|
5475 |
OperatingSystem errorSignal handle:[:ex| |
|
5476 |
self showAlert:(resources string:'cannot rename file ''%1'' to %2 !!' |
|
5477 |
with:oldName with:newName) |
|
5478 |
with:(OperatingSystem lastErrorString) |
|
5479 |
] do:[ |
|
5480 |
new exists ifTrue:[ |
|
5481 |
(self confirm:(resources string:'''%1'' already exists - rename (i.e. overwrite) anyway ?' with:new baseName asText allBold)) |
|
5482 |
ifFalse:[ |
|
5483 |
^ self |
|
5484 |
] |
|
5485 |
]. |
|
5486 |
old renameTo:new. |
|
5487 |
]. |
|
5488 |
self updateCurrentDirectoryIfChanged. |
|
5489 |
] |
|
1162 | 5490 |
] |
5491 |
||
1911
6d1b77eda98f
check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents:
1903
diff
changeset
|
5492 |
"Modified: / 24.9.1997 / 09:20:00 / stefan" |
6d1b77eda98f
check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents:
1903
diff
changeset
|
5493 |
"Modified: / 3.10.1998 / 18:19:27 / cg" |
1162 | 5494 |
! ! |
5495 |
||
5496 |
!FileBrowser methodsFor:'private - file type & info'! |
|
5497 |
||
5498 |
fileCommentStrings |
|
5499 |
"return a useful comment definition; based upon the fileName for now" |
|
5500 |
||
2185 | 5501 |
|suff mime| |
2184 | 5502 |
|
1162 | 5503 |
"/ for now, |
5504 |
"/ define comment strings, by heuristics; |
|
5505 |
"/ (should look for some mode= or similar string |
|
5506 |
"/ found in the file itself - like emacs does it) |
|
2182 | 5507 |
"/ Also, I would prefer some other (central) place for this |
5508 |
"/ kind of information (how about the MIMEType class ?) |
|
1162 | 5509 |
|
2087
343c831f625a
fixed commentString setting (commentIt/uncommentIt for C sources)
Claus Gittinger <cg@exept.de>
parents:
2074
diff
changeset
|
5510 |
(#('Make.proto' |
343c831f625a
fixed commentString setting (commentIt/uncommentIt for C sources)
Claus Gittinger <cg@exept.de>
parents:
2074
diff
changeset
|
5511 |
'Makefile' |
343c831f625a
fixed commentString setting (commentIt/uncommentIt for C sources)
Claus Gittinger <cg@exept.de>
parents:
2074
diff
changeset
|
5512 |
'makefile' |
343c831f625a
fixed commentString setting (commentIt/uncommentIt for C sources)
Claus Gittinger <cg@exept.de>
parents:
2074
diff
changeset
|
5513 |
) includes:currentFileName) ifTrue:[ |
2139 | 5514 |
^ #('#' (nil nil)). |
2138 | 5515 |
]. |
2184 | 5516 |
|
5517 |
suff := currentFileName asFilename suffix. |
|
5518 |
suff := suff asLowercase. |
|
5519 |
||
2185 | 5520 |
mime := MIMETypes mimeTypeForSuffix:suff. |
5521 |
mime notNil ifTrue:[ |
|
5522 |
mime = 'application/x-smalltalk-source' ifTrue:[ |
|
5523 |
"/ smalltalk comments |
|
5524 |
^ #('"/' ('"' '"')). |
|
5525 |
]. |
|
2187
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
5526 |
mime = 'text/html' ifTrue:[ |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
5527 |
^ #(nil ('<!!--' '-->')). |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
5528 |
]. |
2185 | 5529 |
]. |
5530 |
||
2184 | 5531 |
(suff = 'mak') ifTrue:[ |
2139 | 5532 |
^ #('#' (nil nil)). |
1162 | 5533 |
]. |
2184 | 5534 |
|
5535 |
(suff = 'sh') ifTrue:[ |
|
5536 |
^ #('#' (nil nil)). |
|
5537 |
]. |
|
2187
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
5538 |
(suff = 'bat') ifTrue:[ |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
5539 |
^ #('rem ' (nil nil)). |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
5540 |
]. |
2184 | 5541 |
(suff = 'c') ifTrue:[ |
2139 | 5542 |
^ #(nil ('/*' '*/')). |
1162 | 5543 |
]. |
2184 | 5544 |
((suff = 'cc') or:[suff = 'cpp']) ifTrue:[ |
2139 | 5545 |
^ #('//' ('/*' '*/')). |
1162 | 5546 |
]. |
2184 | 5547 |
(suff = 'java') ifTrue:[ |
2139 | 5548 |
^ #('//' (nil nil)). |
1162 | 5549 |
]. |
2184 | 5550 |
(suff = 'style') ifTrue:[ |
2139 | 5551 |
^ #(';' (nil nil)). |
2104 | 5552 |
]. |
2184 | 5553 |
(suff = 'rs') ifTrue:[ |
2139 | 5554 |
^ #(';' (nil nil)). |
2104 | 5555 |
]. |
2184 | 5556 |
((suff = 'asn1') |
5557 |
or:[(suff = 'x409') |
|
5558 |
or:[(suff = 'gdmo') |
|
5559 |
or:[(suff = 'gdm')]]]) ifTrue:[ |
|
2181 | 5560 |
^ #('--' ('--' '--')). |
5561 |
]. |
|
1162 | 5562 |
|
2185 | 5563 |
"/ default: smalltalk comments |
1162 | 5564 |
|
5565 |
^ #('"/' ('"' '"')). |
|
5566 |
||
2139 | 5567 |
"Created: / 7.1.1997 / 20:30:00 / cg" |
5568 |
"Modified: / 4.5.1999 / 19:42:30 / ps" |
|
5569 |
"Modified: / 4.5.1999 / 20:39:14 / cg" |
|
1162 | 5570 |
! |
5571 |
||
5572 |
fileTypeSpecificActions |
|
5573 |
"any special fileTypeSpecific actions are done here, |
|
5574 |
when a new file is selected" |
|
5575 |
||
5576 |
|commentStrings| |
|
5577 |
||
5578 |
commentStrings := self fileCommentStrings. |
|
5579 |
commentStrings notNil ifTrue:[ |
|
2138 | 5580 |
subView perform:#commentStrings: with:commentStrings ifNotUnderstood:nil |
1162 | 5581 |
]. |
5582 |
||
5583 |
"Modified: 7.1.1997 / 20:30:54 / cg" |
|
5584 |
! |
|
5585 |
||
5586 |
getFileInfoString:longInfo |
|
5587 |
"get stat info on selected file - return a string which can be |
|
5588 |
shown in a box" |
|
5589 |
||
5590 |
|fileName f fullPath text info fileOutput type modeBits modeString s ts| |
|
5591 |
||
5592 |
fileName := self getSelectedFileName. |
|
5593 |
fileName isNil ifTrue:[^ nil]. |
|
5594 |
||
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
5595 |
f := currentDirectory construct:fileName. |
1162 | 5596 |
info := f info. |
5597 |
||
5598 |
info isNil ifTrue:[ |
|
1329 | 5599 |
self showAlert:(resources string:'cannot get info of ''%1'' !!' with:fileName) |
5600 |
with:(OperatingSystem lastErrorString). |
|
5601 |
^ nil |
|
1162 | 5602 |
]. |
5603 |
||
5604 |
text := StringCollection new. |
|
5605 |
f isSymbolicLink ifTrue:[ |
|
1329 | 5606 |
text add:(resources string:'symbolic link to: %1' with:(f linkInfo path)) |
1162 | 5607 |
]. |
5608 |
||
5609 |
type := info type. |
|
5610 |
(longInfo and:[type == #regular]) ifTrue:[ |
|
1329 | 5611 |
fullPath := currentDirectory pathName asFilename constructString:fileName. |
5612 |
fileOutput := fullPath asFilename fileType. |
|
1162 | 5613 |
]. |
5614 |
||
5615 |
s := (resources at:'type: '). |
|
5616 |
fileOutput isNil ifTrue:[ |
|
1329 | 5617 |
s := s , type asString |
1162 | 5618 |
] ifFalse:[ |
1329 | 5619 |
s := s , 'regular (' , fileOutput , ')' |
1162 | 5620 |
]. |
5621 |
text add:s. |
|
5622 |
text add:(resources string:'size: %1' with:(info size) printString). |
|
5623 |
||
5624 |
modeBits := info mode. |
|
5625 |
modeString := self getModeString:modeBits. |
|
5626 |
longInfo ifTrue:[ |
|
1329 | 5627 |
text add:(resources string:'access: %1 (%2)' |
5628 |
with:modeString |
|
5629 |
with:(modeBits printStringRadix:8)) |
|
1162 | 5630 |
] ifFalse:[ |
1329 | 5631 |
text add:(resources string:'access: %1' with:modeString) |
1162 | 5632 |
]. |
5633 |
text add:(resources string:'owner: %1' |
|
1329 | 5634 |
with:(OperatingSystem getUserNameFromID:(info uid))). |
1162 | 5635 |
longInfo ifTrue:[ |
1329 | 5636 |
text add:(resources string:'group: %1' |
5637 |
with:(OperatingSystem getGroupNameFromID:(info gid))). |
|
5638 |
||
5639 |
ts := info accessed. |
|
5640 |
text add:(resources string:'last access: %1 %2' |
|
5641 |
with:(ts asTime printString) |
|
5642 |
with:(ts asDate printString)). |
|
5643 |
||
5644 |
ts := info modified. |
|
5645 |
text add:(resources string:'last modification: %1 %2' |
|
5646 |
with:(ts asTime printString) |
|
5647 |
with:(ts asDate printString)). |
|
1162 | 5648 |
]. |
5649 |
^ text asString |
|
5650 |
||
5651 |
"Modified: 8.9.1995 / 11:59:28 / claus" |
|
5652 |
"Modified: 1.11.1996 / 20:47:52 / cg" |
|
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
5653 |
"Modified: 18.9.1997 / 16:34:31 / stefan" |
1162 | 5654 |
! |
5655 |
||
5656 |
getInfoFile |
|
5657 |
"get filename of a description-file (.dir.info, README etc.); |
|
5658 |
This file is automatically shown when a directory is enterred. |
|
5659 |
You can add more names below if you like." |
|
5660 |
||
5661 |
#( |
|
5662 |
'.dir.info' |
|
5663 |
'README' |
|
5664 |
'ReadMe' |
|
5665 |
'Readme' |
|
5666 |
'readme' |
|
5667 |
'read.me' |
|
5668 |
'Read.me' |
|
5669 |
'READ.ME' |
|
1272 | 5670 |
'README.TXT' |
5671 |
'readme.txt' |
|
5672 |
'Readme.txt' |
|
1307 | 5673 |
'Info.txt' |
5674 |
'info.txt' |
|
5675 |
'INFO.TXT' |
|
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
5676 |
) do:[:f | |
1329 | 5677 |
|n| |
5678 |
n := currentDirectory construct:f. |
|
5679 |
(n isReadable and:[n isDirectory not]) ifTrue:[ |
|
5680 |
^ f. |
|
5681 |
] |
|
1140 | 5682 |
]. |
1162 | 5683 |
^ nil |
5684 |
||
1272 | 5685 |
"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
|
5686 |
"Modified: 16.9.1997 / 15:26:53 / stefan" |
1162 | 5687 |
! |
5688 |
||
5689 |
getModeString:modeBits |
|
5690 |
"convert file-mode bits into a more user-friendly string. |
|
5691 |
This is wrong here - should be moved into OperatingSystem." |
|
5692 |
||
5693 |
^ self getModeString:modeBits |
|
1317 | 5694 |
with:#( 'owner:' $r $w $x |
5695 |
' group:' $r $w $x |
|
5696 |
' others:' $r $w $x ) |
|
1140 | 5697 |
! |
5698 |
||
1162 | 5699 |
getModeString:modeBits with:texts |
5700 |
"convert file-mode bits into a more user-friendly string. |
|
5701 |
This is wrong here - should be moved into OperatingSystem." |
|
5702 |
||
5703 |
|bits modeString| |
|
5704 |
||
5705 |
bits := modeBits bitAnd:8r777. |
|
5706 |
modeString := ''. |
|
5707 |
||
5708 |
#( nil 8r400 8r200 8r100 nil 8r040 8r020 8r010 nil 8r004 8r002 8r001 ) |
|
5709 |
with: texts do:[:bitMask :access | |
|
1317 | 5710 |
|ch| |
5711 |
||
5712 |
bitMask isNil ifTrue:[ |
|
5713 |
modeString := modeString , (resources string:access) |
|
5714 |
] ifFalse:[ |
|
5715 |
(bits bitAnd:bitMask) == 0 ifTrue:[ |
|
5716 |
ch := $- |
|
5717 |
] ifFalse:[ |
|
5718 |
ch := access |
|
5719 |
]. |
|
5720 |
modeString := modeString copyWith:ch |
|
5721 |
] |
|
633
4630175ed31e
double click on .htm / .html files open a viewer;
Claus Gittinger <cg@exept.de>
parents:
585
diff
changeset
|
5722 |
]. |
1162 | 5723 |
^ modeString |
5724 |
! |
|
5725 |
||
5726 |
showInfo |
|
5727 |
"show directory info when dir has changed" |
|
5728 |
||
5729 |
|info txt| |
|
5730 |
||
5731 |
info := self getInfoFile. |
|
5732 |
info notNil ifTrue:[ |
|
1317 | 5733 |
txt := self readFile:info |
1162 | 5734 |
]. |
5735 |
self show:txt. |
|
5736 |
! |
|
5737 |
||
5738 |
sizePrintString:size |
|
5739 |
"helper for update-directory to return a string with a files size. |
|
5740 |
This one gives the size in byte, Kb or Mb depending on size. |
|
5741 |
If you dont like this, just uncomment the first statement below." |
|
5742 |
||
5743 |
|unitString n| |
|
5744 |
||
5745 |
" |
|
5746 |
^ size printString. |
|
5747 |
" |
|
5748 |
unitString := ''. |
|
5749 |
size < (500 * 1024) ifTrue:[ |
|
1317 | 5750 |
size < 1024 ifTrue:[ |
5751 |
n := size |
|
5752 |
] ifFalse:[ |
|
5753 |
n := (size * 10 // 1024 / 10.0). |
|
5754 |
unitString := ' Kb' |
|
5755 |
] |
|
1162 | 5756 |
] ifFalse:[ |
1317 | 5757 |
n := (size * 10 // 1024 // 1024 / 10.0). |
5758 |
unitString := ' Mb' |
|
1162 | 5759 |
]. |
5760 |
^ (n printStringLeftPaddedTo:5) , unitString. |
|
5761 |
! ! |
|
5762 |
||
5763 |
!FileBrowser methodsFor:'private - file-I/O'! |
|
5764 |
||
5765 |
readFile:fileName |
|
5766 |
"read in the file, answer its contents as StringCollection" |
|
5767 |
||
5768 |
^ self readFile:fileName lineDelimiter:Character cr encoding:nil |
|
5769 |
||
5770 |
"Modified: 22.2.1996 / 14:57:08 / cg" |
|
5771 |
! |
|
5772 |
||
5773 |
readFile:fileName lineDelimiter:aCharacter encoding:encoding |
|
5774 |
"read in the file, return its contents as StringCollection. |
|
5775 |
The files lines are delimited by aCharacter. |
|
5776 |
If encoding is nonNil, the file is assumed to be coded according to |
|
5777 |
that symbol, and #decodeString: should be able to convert it." |
|
5778 |
||
1994 | 5779 |
|f stream text msg sz| |
5780 |
||
5781 |
(f := fileName asFilename) isAbsolute ifFalse:[ |
|
2138 | 5782 |
f := (currentDirectory construct:fileName) |
1994 | 5783 |
]. |
5784 |
stream := f readStream. |
|
1162 | 5785 |
stream isNil ifTrue:[ |
2138 | 5786 |
msg := (resources string:'cannot read file ''%1'' !!' with:fileName). |
5787 |
self showAlert:msg with:(FileStream lastErrorString). |
|
5788 |
^ nil |
|
1162 | 5789 |
]. |
5790 |
||
5791 |
" |
|
5792 |
for very big files, give ObjectMemory a hint, to preallocate more |
|
5793 |
" |
|
1311 | 5794 |
(sz := stream fileSize) > 1000000 ifTrue:[ |
2138 | 5795 |
Processor activeProcess withPriority:Processor userBackgroundPriority do:[ |
5796 |
ObjectMemory announceSpaceNeed:(sz + (sz // 5)) "/ add 20% for tab expansion |
|
5797 |
]. |
|
1162 | 5798 |
]. |
5799 |
||
5800 |
text := self readStream:stream lineDelimiter:aCharacter encoding:encoding. |
|
5801 |
stream close. |
|
5802 |
^ text |
|
5803 |
||
1994 | 5804 |
"Created: / 22.2.1996 / 14:56:48 / cg" |
5805 |
"Modified: / 18.9.1997 / 17:06:54 / stefan" |
|
5806 |
"Modified: / 4.2.1999 / 17:52:18 / cg" |
|
1162 | 5807 |
! |
5808 |
||
5809 |
readStream:aStream |
|
5810 |
"read in from aStream, answer its contents as StringCollection" |
|
5811 |
||
5812 |
^ self readStream:aStream lineDelimiter:Character cr encoding:nil |
|
5813 |
||
5814 |
"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
|
5815 |
! |
4630175ed31e
double click on .htm / .html files open a viewer;
Claus Gittinger <cg@exept.de>
parents:
585
diff
changeset
|
5816 |
|
1162 | 5817 |
readStream:aStream lineDelimiter:aCharacter encoding:encoding |
5818 |
"read from aStream, answer its contents as StringCollection. |
|
5819 |
The files lines are delimited by aCharacter. |
|
5820 |
If encoding is nonNil, the file is assumed to be coded according to |
|
5821 |
that symbol, and #decodeString: should be able to convert it." |
|
5822 |
||
5823 |
|text line enc| |
|
5824 |
||
5825 |
text := StringCollection new. |
|
5826 |
||
5827 |
enc := encoding. |
|
5828 |
enc == #iso8859 ifTrue:[ |
|
2138 | 5829 |
enc := nil |
1162 | 5830 |
]. |
5831 |
||
5832 |
aCharacter == Character cr ifTrue:[ |
|
2138 | 5833 |
FileStream lineTooLongErrorSignal handle:[:ex | |
5834 |
|s partialLine| |
|
5835 |
||
5836 |
s := ex parameter at:1. |
|
5837 |
partialLine := ex parameter at:2. |
|
5838 |
ex proceedWith:(partialLine , s upTo:aCharacter) |
|
5839 |
] do:[ |
|
5840 |
[aStream atEnd] whileFalse:[ |
|
5841 |
line := aStream nextLine withTabsExpanded. |
|
5842 |
enc notNil ifTrue:[ |
|
5843 |
line := line decodeFrom:enc |
|
5844 |
]. |
|
5845 |
text add:line |
|
5846 |
]. |
|
5847 |
]. |
|
1162 | 5848 |
] ifFalse:[ |
2138 | 5849 |
[aStream atEnd] whileFalse:[ |
5850 |
line := (aStream upTo:aCharacter) withTabsExpanded. |
|
5851 |
enc notNil ifTrue:[ |
|
5852 |
line := line decodeFrom:enc |
|
5853 |
]. |
|
5854 |
text add:line |
|
5855 |
]. |
|
633
4630175ed31e
double click on .htm / .html files open a viewer;
Claus Gittinger <cg@exept.de>
parents:
585
diff
changeset
|
5856 |
]. |
1162 | 5857 |
^ text |
5858 |
||
1994 | 5859 |
"Created: / 22.2.1996 / 14:58:25 / cg" |
5860 |
"Modified: / 5.2.1999 / 00:53:22 / cg" |
|
1162 | 5861 |
! |
5862 |
||
5863 |
showFile:fileName |
|
5864 |
"show contents of fileName in subView" |
|
5865 |
||
1689 | 5866 |
fileListView selection:(fileList indexOf:fileName). |
5867 |
self fileGet |
|
5868 |
||
5869 |
"Modified: / 17.6.1998 / 11:26:13 / cg" |
|
1162 | 5870 |
! |
5871 |
||
5872 |
showFile:fileName insert:insert encoding:encoding |
|
5873 |
"show/insert contents of fileName in subView" |
|
5874 |
||
5875 |
^ self |
|
1317 | 5876 |
showFile:fileName insert:insert encoding:encoding doubleClick:false |
1162 | 5877 |
|
5878 |
"Modified: 19.6.1996 / 09:40:19 / cg" |
|
5879 |
! |
|
5880 |
||
5881 |
showFile:fileName insert:insert encoding:encoding doubleClick:viaDoubleClick |
|
5882 |
"show/insert contents of fileName in subView" |
|
5883 |
||
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
5884 |
|path buffer s n i ok convert text msg eol guess action enc |
1214
02d5bbd925dd
allow decoding errors to be ignored
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
5885 |
fontsEncoding pref failWarning| |
1162 | 5886 |
|
1994 | 5887 |
fileName asFilename isAbsolute ifFalse:[ |
2158
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5888 |
path := currentDirectory filenameFor:fileName. |
1994 | 5889 |
] ifTrue:[ |
2158
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5890 |
path := fileName asFilename asAbsoluteFilename |
1994 | 5891 |
]. |
5892 |
||
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
5893 |
(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
|
5894 |
"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
|
5895 |
path exists ifFalse:[ |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5896 |
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
|
5897 |
] ifTrue:[ |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5898 |
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
|
5899 |
]. |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5900 |
self warn:(resources string:msg with:fileName). |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5901 |
^ self |
1162 | 5902 |
]. |
5903 |
||
5904 |
"/ |
|
5905 |
"/ check if file is a text file |
|
5906 |
"/ |
|
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
5907 |
s := path readStream. |
1162 | 5908 |
s isNil ifTrue:[ |
2158
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5909 |
self showAlert:(resources string:'cannot read file ''%1'' !!' with:fileName) |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5910 |
with:(FileStream lastErrorString). |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5911 |
^ nil |
1162 | 5912 |
]. |
5913 |
||
1222
f2952fc3ced9
look at more when guessing the encoding
Claus Gittinger <cg@exept.de>
parents:
1221
diff
changeset
|
5914 |
buffer := String new:4096. |
f2952fc3ced9
look at more when guessing the encoding
Claus Gittinger <cg@exept.de>
parents:
1221
diff
changeset
|
5915 |
n := s nextBytes:4096 into:buffer. |
1162 | 5916 |
s close. |
5917 |
||
5918 |
enc := encoding. |
|
5919 |
ok := true. |
|
5920 |
guess := self guessEncodingFrom:buffer. |
|
5921 |
||
5922 |
guess == #binary ifTrue:[ |
|
2158
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5923 |
ok := false. |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5924 |
viaDoubleClick ifTrue:[ |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5925 |
(self binaryFileAction:fileName) ifTrue:[^ self]. |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5926 |
]. |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5927 |
(self confirm:(resources string:'''%1'' seems to be a binary file (or unsupported format) - show anyway ?' with:fileName)) |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5928 |
ifFalse:[^ self] |
1162 | 5929 |
] ifFalse:[ |
2158
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5930 |
viaDoubleClick ifTrue:[ |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5931 |
(self nonBinaryFileAction:fileName) ifTrue:[^ self]. |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5932 |
]. |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5933 |
|
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5934 |
fontsEncoding := subView font encoding. |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5935 |
pref := self preferredFontEncodingFor:guess. |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5936 |
|
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5937 |
ok := pref match:fontsEncoding. |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5938 |
ok ifFalse:[ |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5939 |
pref = 'iso8859*' ifTrue:[ |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5940 |
ok := 'ascii*' match:fontsEncoding |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5941 |
] |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5942 |
]. |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5943 |
ok ifTrue:[ |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5944 |
fileEncoding := guess. |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5945 |
enc := guess. |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5946 |
] ifFalse:[ |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5947 |
action := Dialog choose:(resources string:'''%1'' seems to require a %2 font.' with:fileName with:pref) |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5948 |
labels:(resources array:#('cancel' 'show' 'change font')) |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5949 |
values:#(nil #show #encoding) |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5950 |
default:#encoding. |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5951 |
action isNil ifTrue:[^ self]. |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5952 |
action == #encoding ifTrue:[ |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5953 |
fileEncoding := guess asSymbol. |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5954 |
subView externalEncoding:fileEncoding. |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5955 |
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
|
5956 |
] ifFalse:[ |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5957 |
self information:(resources string:'Individual characters may be invisible/wrong in this font.') |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5958 |
]. |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5959 |
enc := fileEncoding. |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5960 |
]. |
1162 | 5961 |
]. |
5962 |
||
5963 |
convert := false. |
|
1329 | 5964 |
"/ ok ifTrue:[ |
5965 |
"/ "/ |
|
5966 |
"/ "/ check if line delimiter is a cr |
|
5967 |
"/ "/ |
|
5968 |
"/ i := buffer indexOf:Character cr. |
|
5969 |
"/ i == 0 ifTrue:[ |
|
5970 |
"/ "/ |
|
5971 |
"/ "/ no newline found - try cr |
|
5972 |
"/ "/ |
|
5973 |
"/ i := buffer indexOf:(Character value:13). |
|
5974 |
"/ i ~~ 0 ifTrue:[ |
|
5975 |
"/ convert := self confirm:(resources string:'''%1'' seems to have CR as line delimiter - convert to NL ?' with:fileName). |
|
5976 |
"/ ] |
|
5977 |
"/ ] |
|
5978 |
"/ ]. |
|
1162 | 5979 |
|
5980 |
insert ifFalse:[ |
|
2158
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5981 |
"/ release old text first |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5982 |
"/ - 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
|
5983 |
"/ (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
|
5984 |
"/ 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
|
5985 |
|
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5986 |
subView contents:nil. |
1162 | 5987 |
]. |
5988 |
||
5989 |
convert ifTrue:[ |
|
2158
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5990 |
eol := Character value:13 |
1162 | 5991 |
] ifFalse:[ |
2158
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5992 |
eol := Character cr |
1162 | 5993 |
]. |
1212 | 5994 |
|
1214
02d5bbd925dd
allow decoding errors to be ignored
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
5995 |
failWarning := false. |
1212 | 5996 |
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
|
5997 |
|errStr| |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5998 |
|
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5999 |
failWarning ifFalse:[ |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
6000 |
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
|
6001 |
(self confirm:(resources |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
6002 |
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
|
6003 |
with:errStr) withCRs) |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
6004 |
ifFalse:[ |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
6005 |
^ self |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
6006 |
]. |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
6007 |
failWarning := true. |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
6008 |
]. |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
6009 |
ex proceed. |
1212 | 6010 |
] do:[ |
2158
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
6011 |
text := self readFile:fileName lineDelimiter:eol encoding:enc. |
1212 | 6012 |
]. |
1162 | 6013 |
|
6014 |
insert ifFalse:[ |
|
2158
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
6015 |
self show:text |
1162 | 6016 |
] ifTrue:[ |
2158
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
6017 |
subView insertSelectedStringAtCursor:text asString |
1162 | 6018 |
]. |
6019 |
||
1994 | 6020 |
"Created: / 19.6.1996 / 09:39:52 / cg" |
6021 |
"Modified: / 18.9.1997 / 17:10:20 / stefan" |
|
2158
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
6022 |
"Modified: / 18.5.1999 / 15:51:18 / cg" |
1162 | 6023 |
! |
6024 |
||
6025 |
writeFile:fileName text:someText encoding:encoding |
|
1353 | 6026 |
|stream errReason msg startNr nLines string| |
6027 |
||
6028 |
errReason := ''. |
|
6029 |
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
|
6030 |
errReason := ex errorString. |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
6031 |
ex return. |
1353 | 6032 |
] do:[ |
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
6033 |
stream := (currentDirectory filenameFor:fileName) writeStream. |
1353 | 6034 |
]. |
1162 | 6035 |
stream isNil ifTrue:[ |
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
6036 |
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
|
6037 |
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
|
6038 |
^ self. |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
6039 |
]. |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
6040 |
|
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
6041 |
dosEOLMode value == true ifTrue:[ |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
6042 |
stream eolMode:#crlf. |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
6043 |
"/ must do it lineWise ... |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
6044 |
someText asStringCollection do:[:line | |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
6045 |
line notNil ifTrue:[ |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
6046 |
stream nextPutAll:line |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
6047 |
]. |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
6048 |
stream cr |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
6049 |
] |
1162 | 6050 |
] ifFalse:[ |
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
6051 |
(someText isString) ifTrue:[ |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
6052 |
stream nextPutAll:someText. |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
6053 |
] ifFalse:[ |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
6054 |
"/ |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
6055 |
"/ 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
|
6056 |
"/ 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
|
6057 |
"/ 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
|
6058 |
"/ |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
6059 |
startNr := 1. |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
6060 |
nLines := someText size. |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
6061 |
[startNr <= nLines] whileTrue:[ |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
6062 |
string := someText asStringWithCRsFrom:startNr |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
6063 |
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
|
6064 |
compressTabs:compressTabs. |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
6065 |
encoding notNil ifTrue:[ |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
6066 |
string := string encodeInto:encoding |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
6067 |
]. |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
6068 |
stream nextPutAll:string. |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
6069 |
startNr := startNr + 1000 + 1. |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
6070 |
]. |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
6071 |
]. |
1353 | 6072 |
]. |
6073 |
||
6074 |
stream close. |
|
6075 |
subView modified:false |
|
1162 | 6076 |
|
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
6077 |
"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
|
6078 |
"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
|
6079 |
"Modified: / 6.5.1999 / 11:45:50 / cg" |
1140 | 6080 |
! ! |
6081 |
||
6082 |
!FileBrowser methodsFor:'private - presentation'! |
|
6083 |
||
6084 |
defineTabulatorsForLongList |
|
6085 |
"define the tabs for the long list" |
|
6086 |
||
6087 |
tabSpec := TabulatorSpecification new. |
|
6088 |
tabSpec unit:#inch. |
|
6089 |
"/ tabSpec positions:#(0 0.25 2.3 4.3 5.3 6.0 6.5). |
|
6090 |
tabSpec widths: #(0.25 2 2.0 1 0.5 0.5 1"any"). |
|
6091 |
" icon name mode owner group size type" |
|
6092 |
tabSpec align: #(#left #left #left #right #right #decimal #left). |
|
6093 |
tabSpec addDependent:self. |
|
6094 |
||
6095 |
tabRulerView tabulatorSpecification:tabSpec. |
|
6096 |
||
6097 |
"Modified: 17.4.1997 / 02:56:07 / cg" |
|
172 | 6098 |
! |
6099 |
||
1140 | 6100 |
defineTabulatorsForShortList |
6101 |
"define the tabs for the short list" |
|
6102 |
||
6103 |
tabSpec := TabulatorSpecification new. |
|
6104 |
tabSpec unit:#inch. |
|
6105 |
"/ tabSpec positions:#(0 0.25 ). |
|
6106 |
tabSpec widths: #(0.25 2 ). |
|
6107 |
" icon name" |
|
6108 |
tabSpec align: #(#left #left). |
|
6109 |
tabSpec addDependent:self. |
|
6110 |
||
1758 | 6111 |
tabRulerView notNil ifTrue:[ |
6112 |
tabRulerView tabulatorSpecification:tabSpec. |
|
6113 |
]. |
|
6114 |
||
6115 |
"Created: / 17.4.1997 / 02:51:41 / cg" |
|
6116 |
"Modified: / 27.7.1998 / 20:23:34 / cg" |
|
1140 | 6117 |
! |
6118 |
||
6119 |
iconForFile:aFilenameString |
|
1147 | 6120 |
"given a fileName, return an appropriate icon" |
6121 |
||
1784
329e3a904236
ask MIMETypes when mapping suffixes to icons.
Claus Gittinger <cg@exept.de>
parents:
1758
diff
changeset
|
6122 |
|f icn key key2 suff mimeType| |
1140 | 6123 |
|
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
6124 |
f := currentDirectory construct:aFilenameString. |
1140 | 6125 |
f isDirectory ifTrue:[ |
2187
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
6126 |
f isSymbolicLink ifTrue:[ |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
6127 |
key := #directoryLink |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
6128 |
] ifFalse:[ |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
6129 |
key := #directory. |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
6130 |
(f isReadable not or:[f isExecutable not]) ifTrue:[ |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
6131 |
key := #directoryLocked |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
6132 |
]. |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
6133 |
] |
1147 | 6134 |
] ifFalse:[ |
2187
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
6135 |
f isSymbolicLink ifTrue:[ |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
6136 |
f isReadable not ifTrue:[ |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
6137 |
key := #fileLocked |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
6138 |
] ifFalse:[ |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
6139 |
key := #fileLink |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
6140 |
] |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
6141 |
] ifFalse:[ |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
6142 |
key := key2 := #file. |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
6143 |
f isExecutableProgram ifTrue:[ |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
6144 |
key := key2 := #executableFile |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
6145 |
]. |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
6146 |
(f isReadable not) ifTrue:[ |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
6147 |
key := #fileLocked |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
6148 |
] ifFalse:[ |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
6149 |
suff := f suffix. |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
6150 |
mimeType := MIMETypes mimeTypeForSuffix:suff. |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
6151 |
mimeType notNil ifTrue:[ |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
6152 |
(mimeType startsWith:'image/') ifTrue:[ |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
6153 |
key := #imageFile |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
6154 |
] ifFalse:[ |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
6155 |
(mimeType startsWith:'text/') ifTrue:[ |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
6156 |
key := #textFile |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
6157 |
] |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
6158 |
] |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
6159 |
]. |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
6160 |
]. |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
6161 |
]. |
1141 | 6162 |
]. |
1147 | 6163 |
|
1784
329e3a904236
ask MIMETypes when mapping suffixes to icons.
Claus Gittinger <cg@exept.de>
parents:
1758
diff
changeset
|
6164 |
"/ local (device) icons |
329e3a904236
ask MIMETypes when mapping suffixes to icons.
Claus Gittinger <cg@exept.de>
parents:
1758
diff
changeset
|
6165 |
icons notNil ifTrue:[ |
2187
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
6166 |
mimeType notNil ifTrue:[ |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
6167 |
icn := icons at:mimeType ifAbsent:nil. |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
6168 |
icn notNil ifTrue:[^ icn]. |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
6169 |
]. |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
6170 |
icn := icons at:key ifAbsent:nil. |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
6171 |
icn notNil ifTrue:[^ icn]. |
1141 | 6172 |
]. |
1495 | 6173 |
|
1784
329e3a904236
ask MIMETypes when mapping suffixes to icons.
Claus Gittinger <cg@exept.de>
parents:
1758
diff
changeset
|
6174 |
"/ global icons |
329e3a904236
ask MIMETypes when mapping suffixes to icons.
Claus Gittinger <cg@exept.de>
parents:
1758
diff
changeset
|
6175 |
|
329e3a904236
ask MIMETypes when mapping suffixes to icons.
Claus Gittinger <cg@exept.de>
parents:
1758
diff
changeset
|
6176 |
Icons notNil ifTrue:[ |
2187
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
6177 |
mimeType notNil ifTrue:[ |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
6178 |
icn := Icons at:mimeType ifAbsent:nil. |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
6179 |
"/ sight - check for parent-MIME types ... |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
6180 |
|
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
6181 |
[icn isNil and:[mimeType includes:$/]] whileTrue:[ |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
6182 |
mimeType := mimeType copyTo:(mimeType lastIndexOf:$/) - 1. |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
6183 |
icn := Icons at:mimeType ifAbsent:nil. |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
6184 |
]. |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
6185 |
]. |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
6186 |
icn notNil ifTrue:[ |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
6187 |
key := mimeType |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
6188 |
] ifFalse:[ |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
6189 |
icn := Icons at:key ifAbsent:nil. |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
6190 |
]. |
1784
329e3a904236
ask MIMETypes when mapping suffixes to icons.
Claus Gittinger <cg@exept.de>
parents:
1758
diff
changeset
|
6191 |
]. |
1495 | 6192 |
|
1253 | 6193 |
icn isNil ifTrue:[ |
2187
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
6194 |
( (key := key2) isNil |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
6195 |
or:[(icn := icons at:key ifAbsent:nil) notNil |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
6196 |
or:[(icn := Icons at:key ifAbsent:nil) isNil]] |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
6197 |
) ifTrue:[ |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
6198 |
^ icn |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
6199 |
] |
1253 | 6200 |
]. |
1495 | 6201 |
|
1784
329e3a904236
ask MIMETypes when mapping suffixes to icons.
Claus Gittinger <cg@exept.de>
parents:
1758
diff
changeset
|
6202 |
"/ remember device icon |
329e3a904236
ask MIMETypes when mapping suffixes to icons.
Claus Gittinger <cg@exept.de>
parents:
1758
diff
changeset
|
6203 |
icn := icn copy onDevice:device. |
1495 | 6204 |
icn clearMaskedPixels. |
6205 |
icons at:key put:icn. |
|
1239
e58e2cb6639a
allow specification of icons from resource file.
Claus Gittinger <cg@exept.de>
parents:
1235
diff
changeset
|
6206 |
^ icn |
1141 | 6207 |
|
1746
68a187e3f30f
another icon for executable files.
Claus Gittinger <cg@exept.de>
parents:
1737
diff
changeset
|
6208 |
"Modified: / 18.9.1997 / 16:35:28 / stefan" |
1784
329e3a904236
ask MIMETypes when mapping suffixes to icons.
Claus Gittinger <cg@exept.de>
parents:
1758
diff
changeset
|
6209 |
"Modified: / 1.8.1998 / 17:42:37 / cg" |
36 | 6210 |
! |
6211 |
||
2094 | 6212 |
stopImageRenderProcess |
6213 |
imageRenderProcess notNil ifTrue:[ |
|
2138 | 6214 |
imageRenderProcess terminate. |
6215 |
imageRenderProcess := nil |
|
2094 | 6216 |
]. |
6217 |
||
6218 |
"Created: 19.4.1997 / 13:51:34 / cg" |
|
6219 |
! |
|
6220 |
||
1156
f3df28086973
dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents:
1154
diff
changeset
|
6221 |
stopUpdateProcess |
f3df28086973
dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents:
1154
diff
changeset
|
6222 |
Processor removeTimedBlock:checkBlock. |
f3df28086973
dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents:
1154
diff
changeset
|
6223 |
listUpdateProcess notNil ifTrue:[ |
1317 | 6224 |
listUpdateProcess terminate. |
6225 |
listUpdateProcess := nil. |
|
1156
f3df28086973
dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents:
1154
diff
changeset
|
6226 |
]. |
f3df28086973
dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents:
1154
diff
changeset
|
6227 |
|
f3df28086973
dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents:
1154
diff
changeset
|
6228 |
"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
|
6229 |
! |
f3df28086973
dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents:
1154
diff
changeset
|
6230 |
|
36 | 6231 |
updateCurrentDirectory |
6232 |
"update listView with directory contents" |
|
6233 |
||
49 | 6234 |
"the code below may look somewhat complex - |
6235 |
it reads the directory first for the names, |
|
1151
194b10bad6da
great asynchronous list update;
Claus Gittinger <cg@exept.de>
parents:
1147
diff
changeset
|
6236 |
then (in followup sweeps over the files) gets the |
194b10bad6da
great asynchronous list update;
Claus Gittinger <cg@exept.de>
parents:
1147
diff
changeset
|
6237 |
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
|
6238 |
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
|
6239 |
(i.e. stat-calls) may take long - especially on NFS-mounted directories. |
49 | 6240 |
The file reading is done at lower priority, to let user continue |
6241 |
his work in other views. However, to be fair to other fileBrowser, |
|
6242 |
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
|
6243 |
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
|
6244 |
Therefore, browsers which read short directories will finish first. |
49 | 6245 |
ST/X users love this behavior ;-) |
6246 |
" |
|
6247 |
||
294 | 6248 |
self withReadCursorDo:[ |
2138 | 6249 |
|files matchPattern list passDone f| |
6250 |
||
6251 |
self stopUpdateProcess. |
|
6252 |
||
6253 |
timeOfLastCheck := AbsoluteTime now. |
|
6254 |
||
6255 |
files := currentDirectory asFilename fullDirectoryContents. |
|
1329 | 6256 |
|
6257 |
"/ (files includes:(Filename parentDirectoryName)) ifTrue:[ |
|
6258 |
"/ upButton enable. |
|
6259 |
"/ ] ifFalse:[ |
|
6260 |
"/ upButton disable. |
|
6261 |
"/ ]. |
|
6262 |
||
2138 | 6263 |
"/ show files which are either directories |
6264 |
"/ or match the current pattern |
|
6265 |
||
6266 |
matchPattern := filterField contents. |
|
6267 |
(matchPattern notNil and:[ |
|
6268 |
matchPattern isEmpty not and:[ |
|
6269 |
matchPattern ~= '*']]) ifTrue:[ |
|
6270 |
files := files select:[:aName | |
|
6271 |
((currentDirectory construct:aName) isDirectory) |
|
6272 |
or:[matchPattern compoundMatch:aName] |
|
6273 |
]. |
|
6274 |
]. |
|
6275 |
||
6276 |
files size == 0 ifTrue:[ |
|
6277 |
self information:('directory ', currentDirectory pathName, ' vanished'). |
|
6278 |
^ self |
|
6279 |
]. |
|
6280 |
(sortByWhat value == #name) ifTrue:[ |
|
6281 |
sortCaseless value == true ifTrue:[ |
|
6282 |
files sort:[:a :b | a asLowercase < b asLowercase] |
|
6283 |
] ifFalse:[ |
|
6284 |
files sort. |
|
6285 |
] |
|
6286 |
] ifFalse:[ |
|
6287 |
(sortByWhat value == #time) ifTrue:[ |
|
6288 |
files sort:[:a :b | |f1 f2 t1 t2| |
|
6289 |
f1 := (currentDirectory construct:a). |
|
6290 |
f2 := (currentDirectory construct:b). |
|
6291 |
t1 := f1 isSymbolicLink |
|
6292 |
ifFalse:[f1 modificationTime] |
|
6293 |
ifTrue:[f1 linkInfo modified]. |
|
6294 |
t2 := f2 isSymbolicLink |
|
6295 |
ifFalse:[f2 modificationTime] |
|
6296 |
ifTrue:[f2 linkInfo modified]. |
|
6297 |
t1 := t1 ? (AbsoluteTime now). |
|
6298 |
t2 := t2 ? (AbsoluteTime now). |
|
6299 |
t1 > t2 |
|
6300 |
] |
|
6301 |
] ifFalse:[ |
|
6302 |
(sortByWhat value == #type) ifTrue:[ |
|
6303 |
files sort:[:a :b | |f1 f2 t1 t2 suff1 suff2| |
|
6304 |
f1 := (currentDirectory construct:a). |
|
6305 |
f2 := (currentDirectory construct:b). |
|
6306 |
t1 := f1 type ? #xbadLink. |
|
6307 |
t2 := f2 type ? #xbadLink. |
|
6308 |
t1 = t2 ifTrue:[ |
|
6309 |
suff1 := f1 suffix. |
|
6310 |
suff2 := f2 suffix. |
|
6311 |
suff1 = suff2 ifTrue:[ |
|
6312 |
sortCaseless value == true ifTrue:[ |
|
6313 |
a asLowercase < b asLowercase |
|
6314 |
] ifFalse:[ |
|
6315 |
a < b |
|
6316 |
] |
|
6317 |
] ifFalse:[ |
|
6318 |
suff1 asLowercase < suff2 asLowercase |
|
6319 |
] |
|
6320 |
] ifFalse:[ |
|
6321 |
t1 < t2 |
|
6322 |
] |
|
6323 |
] |
|
6324 |
] |
|
6325 |
] |
|
6326 |
]. |
|
6327 |
||
6328 |
files := self withoutHiddenFiles:files. |
|
6329 |
fileList := files copy. |
|
6330 |
||
6331 |
tabSpec isNil ifTrue:[ |
|
6332 |
showingDetails value "showLongList" ifTrue:[ |
|
6333 |
self defineTabulatorsForLongList |
|
6334 |
] ifFalse:[ |
|
6335 |
self defineTabulatorsForShortList |
|
6336 |
]. |
|
6337 |
]. |
|
6338 |
||
6339 |
"/ |
|
6340 |
"/ first show all the names - this can be done fast ... |
|
6341 |
"/ |
|
6342 |
list := files collect:[:fileName | |
|
6343 |
|entry| |
|
6344 |
||
6345 |
entry := MultiColListEntry new. |
|
6346 |
entry tabulatorSpecification:tabSpec. |
|
6347 |
entry colAt:1 put:nil. |
|
6348 |
entry colAt:2 put:fileName. |
|
6349 |
]. |
|
6350 |
||
6351 |
fileListView setList:list expandTabs:false. |
|
6352 |
passDone := Array new:list size withAll:0. |
|
6353 |
||
6354 |
" |
|
6355 |
this is a time consuming operation (especially, if reading an |
|
6356 |
NFS-mounted directory); therefore, start a low prio process, |
|
6357 |
which fills in the remaining fields in the fileList ... |
|
6358 |
" |
|
6359 |
||
6360 |
listUpdateProcess := [ |
|
6361 |
|prevUid prevGid fileNameString nameString groupString |
|
6362 |
modeString info line len |
|
6363 |
anyImages lineIndex aFileName |
|
6364 |
entry typ f p typeString done endIndex |
|
6365 |
state stopAtEnd nextState img prevFirstLine prevLastLine |
|
6366 |
numVisible dirSuffix| |
|
6367 |
||
6368 |
dirSuffix := Filename directorySuffix. |
|
6369 |
dirSuffix size > 0 ifTrue:[ |
|
6370 |
dirSuffix := '.' , dirSuffix asLowercase. |
|
6371 |
]. |
|
6372 |
||
6373 |
"/ |
|
6374 |
"/ then walk over the files, adding more info |
|
6375 |
"/ (since we have to stat each file, this may take a while longer) |
|
6376 |
"/ Visible items are always filled first. |
|
6377 |
||
6378 |
"/ |
|
6379 |
"/ the state machine |
|
6380 |
"/ |
|
6381 |
nextState := IdentityDictionary new. |
|
6382 |
showingDetails value "showLongList" ifTrue:[ |
|
6383 |
nextState add:(#visibleIcons -> #visibleAttributes). |
|
6384 |
nextState add:(#visibleAttributes -> #visibleTypes). |
|
6385 |
nextState add:(#visibleTypes -> #visibleImages). |
|
6386 |
nextState add:(#visibleImages -> #nextPageIcons). |
|
6387 |
||
6388 |
nextState add:(#nextPageIcons -> #nextPageAttributes). |
|
6389 |
nextState add:(#nextPageAttributes -> #nextPageTypes). |
|
6390 |
nextState add:(#nextPageTypes -> #nextPageImages). |
|
6391 |
nextState add:(#nextPageImages -> #previousPageIcons). |
|
6392 |
||
6393 |
nextState add:(#previousPageIcons -> #previousPageAttributes). |
|
6394 |
nextState add:(#previousPageAttributes -> #previousPageTypes). |
|
6395 |
nextState add:(#previousPageTypes -> #previousPageImages). |
|
6396 |
nextState add:(#previousPageImages -> #remainingIcons). |
|
6397 |
||
6398 |
nextState add:(#remainingIcons -> #remainingAttributes). |
|
6399 |
nextState add:(#remainingAttributes -> #remainingTypes). |
|
6400 |
nextState add:(#remainingTypes -> #remainingImages). |
|
6401 |
nextState add:(#remainingImages -> nil). |
|
6402 |
] ifFalse:[ |
|
6403 |
nextState add:(#visibleIcons -> #nextPageIcons). |
|
6404 |
nextState add:(#nextPageIcons -> #previousPageIcons). |
|
6405 |
nextState add:(#previousPageIcons -> #remainingIcons). |
|
6406 |
nextState add:(#remainingIcons -> nil). |
|
6407 |
]. |
|
6408 |
||
6409 |
anyImages := false. |
|
6410 |
||
6411 |
lineIndex := prevFirstLine := fileListView firstLineShown. |
|
6412 |
endIndex := prevLastLine := fileListView lastLineShown. |
|
6413 |
endIndex := endIndex min:(files size). |
|
6414 |
state := #visibleIcons. |
|
6415 |
||
6416 |
done := false. |
|
6417 |
[done] whileFalse:[ |
|
6418 |
"/ |
|
6419 |
"/ if multiple FileBrowsers are reading, let others |
|
6420 |
"/ make some progress too |
|
6421 |
"/ |
|
6422 |
Processor yield. |
|
6423 |
||
6424 |
"/ |
|
6425 |
"/ could be destroyed in the meanwhile ... |
|
6426 |
"/ |
|
6427 |
realized ifFalse:[ |
|
6428 |
listUpdateProcess := nil. |
|
6429 |
Processor activeProcess terminate |
|
6430 |
]. |
|
6431 |
||
6432 |
((prevFirstLine ~~ fileListView firstLineShown) |
|
6433 |
or:[prevLastLine ~~ fileListView lastLineShown]) ifTrue:[ |
|
6434 |
"/ start all over again |
|
6435 |
lineIndex := prevFirstLine := fileListView firstLineShown. |
|
6436 |
endIndex := prevLastLine := fileListView lastLineShown. |
|
6437 |
endIndex := endIndex min:(files size). |
|
6438 |
state := #visibleIcons. |
|
6439 |
]. |
|
6440 |
||
6441 |
(lineIndex between:1 and:(files size)) ifTrue:[ |
|
6442 |
||
6443 |
"/ |
|
6444 |
"/ expand the next entry ... |
|
6445 |
"/ |
|
6446 |
aFileName := files at:lineIndex. |
|
6447 |
entry := fileListView at:lineIndex. |
|
6448 |
f := currentDirectory construct:aFileName. |
|
6449 |
||
6450 |
(state endsWith:'Icons') ifTrue:[ |
|
6451 |
"/ |
|
6452 |
"/ pass 1 - icons |
|
6453 |
"/ |
|
6454 |
(passDone at:lineIndex) < 1 ifTrue:[ |
|
6455 |
(f isDirectory |
|
6456 |
and:[(aFileName ~= '..') and:[aFileName ~= '.']] |
|
6457 |
) ifTrue:[ |
|
6458 |
||
6459 |
"/ the following suffix cutOff is not really required, |
|
6460 |
"/ but makes the list look better on VMS ... |
|
6461 |
fileNameString := aFileName. |
|
6462 |
dirSuffix notNil ifTrue:[ |
|
6463 |
(aFileName asLowercase endsWith:dirSuffix) ifTrue:[ |
|
6464 |
fileNameString := aFileName copyWithoutLast:(dirSuffix size). |
|
6465 |
] |
|
6466 |
]. |
|
6467 |
fileNameString := fileNameString , ' ...' |
|
6468 |
] ifFalse:[ |
|
6469 |
fileNameString := aFileName. |
|
6470 |
OperatingSystem isVMSlike ifTrue:[ |
|
6471 |
(aFileName endsWith:'.') ifTrue:[ |
|
6472 |
aFileName ~= '..' ifTrue:[ |
|
6473 |
fileNameString := aFileName copyWithoutLast:1 |
|
6474 |
] |
|
6475 |
] |
|
6476 |
] |
|
6477 |
]. |
|
6478 |
||
6479 |
showingDetails value "showLongList" ifTrue:[ |
|
6480 |
len := fileNameString size. |
|
6481 |
(len > 20) ifTrue:[ |
|
6482 |
fileNameString := (fileNameString contractTo:20) |
|
6483 |
]. |
|
6484 |
]. |
|
6485 |
||
6486 |
entry colAt:1 put:(self iconForFile:aFileName). |
|
6487 |
entry colAt:2 put:fileNameString. |
|
6488 |
||
6489 |
"/fileListView at:lineIndex put:entry. |
|
6490 |
fileListView withoutRedrawAt:lineIndex put:entry. |
|
6491 |
fileListView invalidateLine:lineIndex. |
|
6492 |
||
6493 |
anyImages ifFalse:[ |
|
6494 |
(Image isImageFileSuffix:(aFileName asFilename suffix)) |
|
6495 |
ifTrue:[ |
|
6496 |
anyImages := true |
|
6497 |
] |
|
6498 |
]. |
|
6499 |
passDone at:lineIndex put:1 |
|
6500 |
] |
|
6501 |
]. |
|
6502 |
||
6503 |
(state endsWith:'Attributes') ifTrue:[ |
|
6504 |
"/ |
|
6505 |
"/ pass 2 - everything except fileType (which takes very long) |
|
6506 |
"/ |
|
6507 |
(passDone at:lineIndex) < 2 ifTrue:[ |
|
6508 |
info := f info. |
|
6509 |
info isNil ifTrue:[ |
|
6510 |
"not accessable - usually a symlink, |
|
6511 |
to a nonexisting/nonreadable file |
|
6512 |
" |
|
6513 |
f isSymbolicLink ifTrue:[ |
|
6514 |
p := f linkInfo path. |
|
6515 |
typeString := 'broken symbolic link to ' , p |
|
6516 |
] ifFalse:[ |
|
6517 |
typeString := 'unknown' |
|
6518 |
]. |
|
6519 |
] ifFalse:[ |
|
6520 |
typ := (info type). |
|
6521 |
||
6522 |
modeString := self getModeString:(info at:#mode) |
|
6523 |
with:#( '' $r $w $x |
|
6524 |
' ' $r $w $x |
|
6525 |
' ' $r $w $x ). |
|
6526 |
entry colAt:3 put:modeString. |
|
6527 |
||
6528 |
((info uid) ~~ prevUid) ifTrue:[ |
|
6529 |
prevUid := (info uid). |
|
6530 |
nameString := OperatingSystem getUserNameFromID:prevUid. |
|
6531 |
nameString := nameString contractTo:10. |
|
6532 |
nameString := nameString , (String new:(10 - nameString size)) |
|
6533 |
]. |
|
6534 |
nameString isNil ifTrue:[nameString := '???']. |
|
6535 |
entry colAt:4 put:nameString withoutSpaces. |
|
6536 |
||
6537 |
((info gid) ~~ prevGid) ifTrue:[ |
|
6538 |
prevGid := (info gid). |
|
6539 |
groupString := OperatingSystem getGroupNameFromID:prevGid. |
|
6540 |
groupString := groupString contractTo:10. |
|
6541 |
groupString := groupString , (String new:(10 - groupString size)) |
|
6542 |
]. |
|
6543 |
groupString isNil ifTrue:[groupString := '???']. |
|
6544 |
entry colAt:5 put:groupString withoutSpaces. |
|
6545 |
||
6546 |
(typ == #regular) ifTrue:[ |
|
6547 |
entry colAt:6 put:(self sizePrintString:(info size)). |
|
6548 |
]. |
|
6549 |
||
6550 |
f isSymbolicLink ifTrue:[ |
|
6551 |
p := f linkInfo path. |
|
6552 |
typeString := 'symbolic link to ' , p |
|
6553 |
] ifFalse:[ |
|
6554 |
typeString := typ asString |
|
6555 |
]. |
|
6556 |
]. |
|
6557 |
entry colAt:7 put:typeString. |
|
6558 |
||
6559 |
"/ fileListView at:lineIndex put:entry. |
|
6560 |
fileListView withoutRedrawAt:lineIndex put:entry. |
|
6561 |
fileListView invalidateLine:lineIndex. |
|
6562 |
passDone at:lineIndex put:2. |
|
6563 |
]. |
|
6564 |
]. |
|
6565 |
||
6566 |
(state endsWith:'Types') ifTrue:[ |
|
6567 |
"/ |
|
6568 |
"/ pass 3: add fileType |
|
6569 |
"/ |
|
6570 |
(passDone at:lineIndex) < 3 ifTrue:[ |
|
6571 |
info := f info. |
|
6572 |
info notNil ifTrue:[ |
|
6573 |
f isSymbolicLink ifFalse:[ |
|
6574 |
(Image isImageFileSuffix:(f suffix)) ifFalse:[ |
|
6575 |
typeString := f fileType. |
|
6576 |
||
6577 |
entry colAt:7 put:typeString. |
|
6578 |
"/ fileListView at:lineIndex put:entry |
|
6579 |
fileListView withoutRedrawAt:lineIndex put:entry. |
|
6580 |
fileListView invalidateLine:lineIndex. |
|
6581 |
]. |
|
6582 |
]. |
|
6583 |
]. |
|
6584 |
||
6585 |
passDone at:lineIndex put:3 |
|
6586 |
]. |
|
6587 |
]. |
|
6588 |
||
6589 |
(state endsWith:'Images') ifTrue:[ |
|
6590 |
"/ |
|
6591 |
"/ pass 4: read images |
|
6592 |
"/ |
|
6593 |
(passDone at:lineIndex) < 4 ifTrue:[ |
|
6594 |
(Image isImageFileSuffix:(f suffix)) ifTrue:[ |
|
6595 |
f isDirectory ifFalse:[ |
|
6596 |
img := Image fromFile:(f pathName). |
|
6597 |
img notNil ifTrue:[ |
|
6598 |
showingBigImagePreview value == true ifTrue:[ |
|
6599 |
img := img magnifiedTo:32@32. |
|
6600 |
] ifFalse:[ |
|
6601 |
img := img magnifiedTo:16@16. |
|
6602 |
]. |
|
6603 |
img := img on:self device. |
|
6604 |
entry colAt:7 put:img. |
|
6605 |
"/ fileListView at:lineIndex put:entry |
|
6606 |
fileListView withoutRedrawAt:lineIndex put:entry. |
|
6607 |
fileListView invalidateLine:lineIndex. |
|
6608 |
] |
|
6609 |
] |
|
6610 |
]. |
|
6611 |
passDone at:lineIndex put:4 |
|
6612 |
]. |
|
6613 |
]. |
|
6614 |
]. |
|
6615 |
||
6616 |
"/ |
|
6617 |
"/ advance to the next line |
|
6618 |
"/ |
|
6619 |
lineIndex := lineIndex + 1. |
|
6620 |
lineIndex > endIndex ifTrue:[ |
|
6621 |
"/ finished this round ... |
|
6622 |
"/ see what we are going for ... |
|
6623 |
numVisible := (fileListView lastLineShown - fileListView firstLineShown + 1). |
|
6624 |
||
6625 |
state := nextState at:state ifAbsent:nil. |
|
6626 |
||
6627 |
state isNil ifTrue:[ |
|
6628 |
done := true |
|
6629 |
] ifFalse:[ |
|
6630 |
(state startsWith:'visible') ifTrue:[ |
|
6631 |
lineIndex := fileListView firstLineShown. |
|
6632 |
endIndex := fileListView lastLineShown. |
|
6633 |
endIndex := endIndex min:(files size). |
|
6634 |
] ifFalse:[ |
|
6635 |
(state startsWith:'nextPage') ifTrue:[ |
|
6636 |
lineIndex := fileListView lastLineShown + 1. |
|
6637 |
endIndex := lineIndex + numVisible. |
|
6638 |
endIndex := endIndex min:(files size). |
|
6639 |
lineIndex := lineIndex min:(files size). |
|
6640 |
] ifFalse:[ |
|
6641 |
(state startsWith:'previousPage') ifTrue:[ |
|
6642 |
endIndex := fileListView firstLineShown - 1. |
|
6643 |
lineIndex := endIndex - numVisible. |
|
6644 |
lineIndex := lineIndex max:1. |
|
6645 |
endIndex := endIndex min:(files size). |
|
6646 |
endIndex := endIndex max:1. |
|
6647 |
] ifFalse:[ |
|
6648 |
"/ remaining |
|
6649 |
lineIndex := 1. |
|
6650 |
endIndex := files size. |
|
6651 |
] |
|
6652 |
] |
|
6653 |
] |
|
6654 |
] |
|
6655 |
] |
|
6656 |
]. |
|
6657 |
||
6658 |
listUpdateProcess := nil. |
|
6659 |
||
6660 |
] forkAt:(Processor activePriority - 1). |
|
6661 |
||
6662 |
" |
|
6663 |
install a new check after some time |
|
6664 |
" |
|
6665 |
Processor addTimedBlock:checkBlock afterSeconds:checkDelta |
|
36 | 6666 |
] |
142 | 6667 |
|
1487
c8d32d8b039c
oops - dont sort a nil object
Claus Gittinger <cg@exept.de>
parents:
1481
diff
changeset
|
6668 |
"Modified: / 21.9.1995 / 11:40:23 / claus" |
c8d32d8b039c
oops - dont sort a nil object
Claus Gittinger <cg@exept.de>
parents:
1481
diff
changeset
|
6669 |
"Modified: / 28.4.1997 / 22:30:30 / dq" |
c8d32d8b039c
oops - dont sort a nil object
Claus Gittinger <cg@exept.de>
parents:
1481
diff
changeset
|
6670 |
"Modified: / 18.9.1997 / 18:28:30 / stefan" |
1834 | 6671 |
"Modified: / 14.8.1998 / 17:59:06 / cg" |
386
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
6672 |
! ! |
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
6673 |
|
172 | 6674 |
!FileBrowser methodsFor:'queries'! |
73 | 6675 |
|
1700
5067b3c4cafa
added access to fileName (kludge to fileIn RefactoryBrowser)
Claus Gittinger <cg@exept.de>
parents:
1689
diff
changeset
|
6676 |
fileName |
1702
962056a31c06
remember the current file during fileIn,
Claus Gittinger <cg@exept.de>
parents:
1700
diff
changeset
|
6677 |
"return my current fileName - during fileIn, the file |
962056a31c06
remember the current file during fileIn,
Claus Gittinger <cg@exept.de>
parents:
1700
diff
changeset
|
6678 |
which is being loaded is returned. |
962056a31c06
remember the current file during fileIn,
Claus Gittinger <cg@exept.de>
parents:
1700
diff
changeset
|
6679 |
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
|
6680 |
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
|
6681 |
|
962056a31c06
remember the current file during fileIn,
Claus Gittinger <cg@exept.de>
parents:
1700
diff
changeset
|
6682 |
|f| |
962056a31c06
remember the current file during fileIn,
Claus Gittinger <cg@exept.de>
parents:
1700
diff
changeset
|
6683 |
|
962056a31c06
remember the current file during fileIn,
Claus Gittinger <cg@exept.de>
parents:
1700
diff
changeset
|
6684 |
f := currentFileInFileName ? currentFileName. |
962056a31c06
remember the current file during fileIn,
Claus Gittinger <cg@exept.de>
parents:
1700
diff
changeset
|
6685 |
f isNil ifTrue:[^ nil]. |
962056a31c06
remember the current file during fileIn,
Claus Gittinger <cg@exept.de>
parents:
1700
diff
changeset
|
6686 |
^ self path asFilename construct:f |
1700
5067b3c4cafa
added access to fileName (kludge to fileIn RefactoryBrowser)
Claus Gittinger <cg@exept.de>
parents:
1689
diff
changeset
|
6687 |
|
5067b3c4cafa
added access to fileName (kludge to fileIn RefactoryBrowser)
Claus Gittinger <cg@exept.de>
parents:
1689
diff
changeset
|
6688 |
" |
5067b3c4cafa
added access to fileName (kludge to fileIn RefactoryBrowser)
Claus Gittinger <cg@exept.de>
parents:
1689
diff
changeset
|
6689 |
(FileBrowser openOnFileNamed:'Makefile') fileName |
5067b3c4cafa
added access to fileName (kludge to fileIn RefactoryBrowser)
Claus Gittinger <cg@exept.de>
parents:
1689
diff
changeset
|
6690 |
" |
5067b3c4cafa
added access to fileName (kludge to fileIn RefactoryBrowser)
Claus Gittinger <cg@exept.de>
parents:
1689
diff
changeset
|
6691 |
|
1702
962056a31c06
remember the current file during fileIn,
Claus Gittinger <cg@exept.de>
parents:
1700
diff
changeset
|
6692 |
"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
|
6693 |
! |
5067b3c4cafa
added access to fileName (kludge to fileIn RefactoryBrowser)
Claus Gittinger <cg@exept.de>
parents:
1689
diff
changeset
|
6694 |
|
172 | 6695 |
path |
6696 |
"return my currentDirectories pathName; |
|
1329 | 6697 |
sent from the pathField to aquire the pathname when I changed directory" |
6698 |
||
6699 |
"/ somewhat tricky: first ask it for the full pathName, |
|
6700 |
"/ then convert it to a directory name |
|
6701 |
"/ (which only makes a difference on VMS) |
|
6702 |
||
1828 | 6703 |
^ currentDirectory asFilename pathName "/ asFilename osNameForDirectory |
6704 |
||
6705 |
"Modified: / 12.8.1998 / 14:45:48 / cg" |
|
49 | 6706 |
! ! |
6707 |
||
763
94a8d188b52d
care for the nameSpace Query when loading binary classes
Claus Gittinger <cg@exept.de>
parents:
749
diff
changeset
|
6708 |
!FileBrowser class methodsFor:'documentation'! |
203 | 6709 |
|
6710 |
version |
|
2216
b84ee099f484
dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
6711 |
^ '$Header: /cvs/stx/stx/libtool/FileBrowser.st,v 1.332 1999-06-28 08:46:13 cg Exp $' |
381 | 6712 |
! ! |