author | penk |
Wed, 10 Jul 2002 15:48:40 +0200 | |
changeset 3705 | b4c309a36141 |
parent 3697 | e2f7d8dec6e2 |
child 3720 | 156602dcf15c |
permissions | -rw-r--r-- |
36 | 1 |
" |
2 |
COPYRIGHT (c) 1991 by Claus Gittinger |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3 |
All Rights Reserved |
36 | 4 |
|
5 |
This software is furnished under a license and may be used |
|
6 |
only in accordance with the terms of that license and with the |
|
7 |
inclusion of the above copyright notice. This software may not |
|
8 |
be provided or otherwise made available to, or used by, any |
|
9 |
other person. No title to or ownership of the software is |
|
10 |
hereby transferred. |
|
11 |
" |
|
12 |
||
2665
3601bc8c5ae2
cursorLeft - change to parent dir
Claus Gittinger <cg@exept.de>
parents:
2640
diff
changeset
|
13 |
"{ Package: 'stx:libtool' }" |
3601bc8c5ae2
cursorLeft - change to parent dir
Claus Gittinger <cg@exept.de>
parents:
2640
diff
changeset
|
14 |
|
36 | 15 |
StandardSystemView subclass:#FileBrowser |
3454 | 16 |
instanceVariableNames:'menuPanel labelView filterField fileListView subView |
17 |
currentDirectory fileList checkBlock checkDelta timeOfLastCheck |
|
18 |
myName killButton pauseToggle compressTabs lockUpdate |
|
19 |
previousDirectory currentFileName timeOfFileRead tabSpec |
|
20 |
commandView commandIndex fileEncoding tabRulerView scrollView |
|
21 |
icons listUpdateProcess currentFileInFileName |
|
22 |
lastFileDiffDirectory sortByWhat sortCaseless showingDetails |
|
23 |
showingTimeAndDate showingHiddenFiles showingBigImagePreview |
|
24 |
imagePreviewView imageRenderProcess dosEOLMode doAutoUpdate |
|
25 |
doNotShowFontDialog' |
|
26 |
classVariableNames:'DirectoryHistory DirectoryHistoryWhere DirectoryBookmarks |
|
27 |
HistorySize DefaultIcon CommandHistory CommandHistorySize Icons |
|
28 |
DefaultCommandPerSuffix DefaultCommandPerMIME VisitedFileHistory' |
|
29 |
poolDictionaries:'' |
|
30 |
category:'Interface-Browsers' |
|
36 | 31 |
! |
32 |
||
763
94a8d188b52d
care for the nameSpace Query when loading binary classes
Claus Gittinger <cg@exept.de>
parents:
749
diff
changeset
|
33 |
!FileBrowser class methodsFor:'documentation'! |
36 | 34 |
|
35 |
copyright |
|
36 |
" |
|
37 |
COPYRIGHT (c) 1991 by Claus Gittinger |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
38 |
All Rights Reserved |
36 | 39 |
|
40 |
This software is furnished under a license and may be used |
|
41 |
only in accordance with the terms of that license and with the |
|
42 |
inclusion of the above copyright notice. This software may not |
|
43 |
be provided or otherwise made available to, or used by, any |
|
44 |
other person. No title to or ownership of the software is |
|
45 |
hereby transferred. |
|
46 |
" |
|
47 |
! |
|
48 |
||
49 |
documentation |
|
50 |
" |
|
51 |
this used to be a very simple demo application, |
|
52 |
but migrated into a quite nice tool, includes all kinds of |
|
53 |
warning and information boxes, background processes for directory- |
|
54 |
reading and internationalized strings. A good example for beginners, |
|
100 | 55 |
on how to do things .... (and maybe how not to do things ;-, since some |
56 |
stuff is historic and was implemented at times when better mechanisms |
|
57 |
were not available) |
|
52 | 58 |
|
36 | 59 |
See additional information in 'doc/misc/fbrowser.doc'. |
45 | 60 |
|
52 | 61 |
WARNING: files edited with FileBrowser will have leading spaces (multiple-8) |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
62 |
being replaced by tabs. If tabs are to be preserved at other |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
63 |
positions (for example, sendmail-config files) they will be |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
64 |
corrupt after being written. |
508 | 65 |
|
66 |
[instance variables]: |
|
67 |
||
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
68 |
checkDelta <Integer> number of seconds of check interval |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
69 |
(looks ever so often if shown directory |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
70 |
has changed). You may make this number |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
71 |
higher, if your network-times are |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
72 |
incorrect and thus, the filebrowser |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
73 |
checks too often. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
74 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
75 |
compressTabs <Boolean> if true, leading spaces will be |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
76 |
replaced by tabs when saving text |
52 | 77 |
|
78 |
some of the defaults (long/short list etc.) can be set by the resource file; |
|
79 |
see FileBrowser>>initialize for more details.. |
|
508 | 80 |
|
81 |
[author:] |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
82 |
Claus Gittinger |
2031 | 83 |
|
84 |
[start with:] |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
85 |
FileBrowser open |
36 | 86 |
" |
203 | 87 |
! ! |
36 | 88 |
|
763
94a8d188b52d
care for the nameSpace Query when loading binary classes
Claus Gittinger <cg@exept.de>
parents:
749
diff
changeset
|
89 |
!FileBrowser class methodsFor:'instance creation'! |
36 | 90 |
|
3025 | 91 |
on:aDirectoryPath |
92 |
"return a new FileBrowser in a pathname" |
|
93 |
||
94 |
^ (self new currentDirectory:aDirectoryPath) |
|
95 |
||
96 |
" |
|
97 |
(FileBrowser on:'/usr/local/bin') open |
|
98 |
(FileBrowser on:'/etc' ) open |
|
99 |
(FileBrowser on:'..' ) open |
|
100 |
(FileBrowser on:'.' ) open |
|
101 |
" |
|
102 |
! |
|
103 |
||
36 | 104 |
openOn:aDirectoryPath |
105 |
"start a new FileBrowser in a pathname" |
|
106 |
||
3025 | 107 |
^ (self on:aDirectoryPath) open |
36 | 108 |
|
52 | 109 |
" |
110 |
FileBrowser openOn:'/etc' |
|
111 |
FileBrowser openOn:'..' |
|
112 |
FileBrowser openOn:'.' |
|
113 |
" |
|
93 | 114 |
! |
115 |
||
3025 | 116 |
openOn:aDirectoryPath withExtent:extent |
117 |
"start a new FileBrowser in a pathname" |
|
118 |
||
119 |
^ (self on:aDirectoryPath) openWithExtent:extent |
|
120 |
||
121 |
" |
|
122 |
FileBrowser openOn:'/etc' withExtent:200@300 |
|
123 |
FileBrowser openOn:'..' withExtent:200@300 |
|
124 |
FileBrowser openOn:'.' withExtent:200@300 |
|
125 |
" |
|
126 |
! |
|
127 |
||
93 | 128 |
openOnFileNamed:aFilename |
129 |
"start a new FileBrowser on a file" |
|
130 |
||
131 |
|f browser| |
|
132 |
||
133 |
f := aFilename asFilename. |
|
1124 | 134 |
f isDirectory ifTrue:[ |
3025 | 135 |
^ self openOn:aFilename |
136 |
]. |
|
137 |
||
138 |
browser := self on:f directoryName. |
|
1689 | 139 |
browser updateCurrentDirectory. |
93 | 140 |
browser showFile:f baseName. |
1689 | 141 |
|
142 |
^ browser open. |
|
93 | 143 |
|
144 |
" |
|
145 |
FileBrowser openOnFileNamed:'Makefile' |
|
146 |
FileBrowser openOnFileNamed:'../Makefile' |
|
147 |
FileBrowser openOnFileNamed:'/tmp/foo' |
|
148 |
" |
|
1124 | 149 |
|
1689 | 150 |
"Modified: / 17.6.1998 / 11:25:29 / cg" |
36 | 151 |
! ! |
152 |
||
1145
0464625bbdbb
read directory in a subprocess.
Claus Gittinger <cg@exept.de>
parents:
1144
diff
changeset
|
153 |
!FileBrowser class methodsFor:'class initialization'! |
0464625bbdbb
read directory in a subprocess.
Claus Gittinger <cg@exept.de>
parents:
1144
diff
changeset
|
154 |
|
2676 | 155 |
icons |
156 |
Icons isNil ifTrue:[ |
|
157 |
self initializeIcons |
|
158 |
]. |
|
159 |
^ Icons |
|
160 |
! |
|
161 |
||
2346 | 162 |
initializeDefaultCommands |
163 |
DefaultCommandPerMIME := Dictionary new. |
|
164 |
||
165 |
DefaultCommandPerMIME at:'application/x-tar-compressed' put:'gunzip < %1 | tar tvf -'. |
|
3654 | 166 |
DefaultCommandPerMIME at:'application/pdf' put:'acroread -display %2 %1'. |
2346 | 167 |
|
168 |
" |
|
169 |
self initializeDefaultCommands |
|
170 |
" |
|
171 |
||
172 |
"Modified: / 1.8.1998 / 17:39:27 / cg" |
|
173 |
! |
|
174 |
||
1178
f5f4d0c605db
lazy initialization of Icons
Claus Gittinger <cg@exept.de>
parents:
1173
diff
changeset
|
175 |
initializeIcons |
1239
e58e2cb6639a
allow specification of icons from resource file.
Claus Gittinger <cg@exept.de>
parents:
1235
diff
changeset
|
176 |
|resources| |
e58e2cb6639a
allow specification of icons from resource file.
Claus Gittinger <cg@exept.de>
parents:
1235
diff
changeset
|
177 |
|
e58e2cb6639a
allow specification of icons from resource file.
Claus Gittinger <cg@exept.de>
parents:
1235
diff
changeset
|
178 |
resources := self classResources. |
e58e2cb6639a
allow specification of icons from resource file.
Claus Gittinger <cg@exept.de>
parents:
1235
diff
changeset
|
179 |
|
1784
329e3a904236
ask MIMETypes when mapping suffixes to icons.
Claus Gittinger <cg@exept.de>
parents:
1758
diff
changeset
|
180 |
Icons := Dictionary new. |
1145
0464625bbdbb
read directory in a subprocess.
Claus Gittinger <cg@exept.de>
parents:
1144
diff
changeset
|
181 |
|
1147 | 182 |
#( |
2187
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
183 |
"/ internal-type to icon mappings. |
3705 | 184 |
(#directory 'ICON_DIRECTORY' 'tiny_yellow_dir.xpm' ) |
185 |
(#directoryLocked 'ICON_DIRECTORY_LOCKED' 'tiny_yellow_dir_locked.xpm' ) |
|
186 |
(#directoryLink 'ICON_DIRECTORY_LINK' 'tiny_yellow_dir_link.xpm' ) |
|
187 |
(#file 'ICON_FILE' 'tiny_file_plain.xpm' ) |
|
188 |
(#fileLink 'ICON_FILE_LINK' 'tiny_file_link.xpm' ) |
|
189 |
(#fileLocked 'ICON_FILE_LOCKED' 'tiny_file_lock.xpm' ) |
|
190 |
(#imageFile 'ICON_IMAGE_FILE' 'tiny_file_pix.xpm' ) |
|
191 |
(#textFile 'ICON_TEXT_FILE' 'tiny_file_text.xpm' ) |
|
192 |
(#executableFile 'ICON_EXECUTABLEFILE' 'tiny_file_exec.xpm' ) |
|
193 |
(#compressedFile 'ICON_COMPRESSED_FILE' 'tiny_file_compressed.xpm' ) |
|
194 |
(#compressedArchive 'ICON_COMPRESSED_ARCHIVE' 'tiny_file_tar_compressed.xpm' ) |
|
195 |
(#archive 'ICON_ARCHIVE' 'tiny_file_tar.xpm' ) |
|
2187
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
196 |
|
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
197 |
"/ mime-type to icon mappings. |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
198 |
('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
|
199 |
('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
|
200 |
('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
|
201 |
('application/x-smalltalk-source' nil 'tiny_file_st.xpm' ) |
2320 | 202 |
('application/x-java-source' nil 'tiny_file_java.xpm' ) |
2187
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
203 |
('image' nil 'tiny_file_pix.xpm' ) |
2794 | 204 |
('audio' nil 'tiny_file_sound.xpm' ) |
1239
e58e2cb6639a
allow specification of icons from resource file.
Claus Gittinger <cg@exept.de>
parents:
1235
diff
changeset
|
205 |
) do:[:entry | |
2491
0222b19ee371
new icon search (search under goodies package)
Claus Gittinger <cg@exept.de>
parents:
2476
diff
changeset
|
206 |
|key resource defaultName nm img| |
2187
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
207 |
|
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
208 |
key := entry at:1. |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
209 |
resource := entry at:2. |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
210 |
defaultName := entry at:3. |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
211 |
|
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
212 |
resource notNil ifTrue:[ |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
213 |
nm := resources at:resource default:nil. |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
214 |
]. |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
215 |
nm isNil ifTrue:[ |
2491
0222b19ee371
new icon search (search under goodies package)
Claus Gittinger <cg@exept.de>
parents:
2476
diff
changeset
|
216 |
nm := 'xpmBitmaps/document_images/' , defaultName |
2187
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
217 |
]. |
2492
055eef2763e3
moved icon search to smalltalk utility method
Claus Gittinger <cg@exept.de>
parents:
2491
diff
changeset
|
218 |
Icons at:key put:(Smalltalk imageFromFileNamed:nm forClass:self). |
1147 | 219 |
] |
220 |
||
221 |
" |
|
1178
f5f4d0c605db
lazy initialization of Icons
Claus Gittinger <cg@exept.de>
parents:
1173
diff
changeset
|
222 |
self initializeIcons |
1147 | 223 |
" |
224 |
||
1784
329e3a904236
ask MIMETypes when mapping suffixes to icons.
Claus Gittinger <cg@exept.de>
parents:
1758
diff
changeset
|
225 |
"Modified: / 1.8.1998 / 17:39:27 / cg" |
1145
0464625bbdbb
read directory in a subprocess.
Claus Gittinger <cg@exept.de>
parents:
1144
diff
changeset
|
226 |
! ! |
0464625bbdbb
read directory in a subprocess.
Claus Gittinger <cg@exept.de>
parents:
1144
diff
changeset
|
227 |
|
763
94a8d188b52d
care for the nameSpace Query when loading binary classes
Claus Gittinger <cg@exept.de>
parents:
749
diff
changeset
|
228 |
!FileBrowser class methodsFor:'defaults'! |
73 | 229 |
|
230 |
defaultIcon |
|
1147 | 231 |
"return the file browsers default window icon" |
232 |
||
1287 | 233 |
<resource: #style (#FILEBROWSER_ICON #FILEBROWSER_ICON_FILE)> |
234 |
||
235 |
|nm i res| |
|
1147 | 236 |
|
237 |
(i := DefaultIcon) isNil ifTrue:[ |
|
2339 | 238 |
res := self classResources. |
239 |
i := res at:'FILEBROWSER_ICON' default:nil. |
|
240 |
i isNil ifTrue:[ |
|
241 |
nm := res at:'FILEBROWSER_ICON_FILE' default:'FBrowser.xbm'. |
|
2476 | 242 |
i := Smalltalk imageFromFileNamed:nm forClass:self. |
2339 | 243 |
i isNil ifTrue:[ |
2453
63c50508c4cd
try my bitmaps in package directory
Claus Gittinger <cg@exept.de>
parents:
2447
diff
changeset
|
244 |
i := StandardSystemView defaultIcon |
2339 | 245 |
] |
246 |
]. |
|
247 |
i notNil ifTrue:[ |
|
248 |
DefaultIcon := i := i onDevice:Display |
|
249 |
] |
|
1145
0464625bbdbb
read directory in a subprocess.
Claus Gittinger <cg@exept.de>
parents:
1144
diff
changeset
|
250 |
]. |
0464625bbdbb
read directory in a subprocess.
Claus Gittinger <cg@exept.de>
parents:
1144
diff
changeset
|
251 |
^ i |
0464625bbdbb
read directory in a subprocess.
Claus Gittinger <cg@exept.de>
parents:
1144
diff
changeset
|
252 |
|
1147 | 253 |
"Modified: 19.3.1997 / 20:48:34 / ca" |
1287 | 254 |
"Modified: 15.8.1997 / 15:27:19 / cg" |
73 | 255 |
! ! |
256 |
||
2951
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
257 |
!FileBrowser class methodsFor:'history'! |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
258 |
|
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
259 |
addToCommandHistory:aCommandString for:aFilename |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
260 |
|cmd suffix| |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
261 |
|
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
262 |
(aCommandString notNil and:[aCommandString notEmpty]) ifTrue:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
263 |
CommandHistory notNil ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
264 |
CommandHistory addFirst:aCommandString. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
265 |
CommandHistory size > CommandHistorySize ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
266 |
CommandHistory removeLast |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
267 |
] |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
268 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
269 |
aFilename notNil ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
270 |
cmd := aCommandString copyTo:(aCommandString indexOf:Character space ifAbsent:[aCommandString size + 1])-1. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
271 |
DefaultCommandPerSuffix isNil ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
272 |
DefaultCommandPerSuffix := Dictionary new. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
273 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
274 |
suffix := aFilename asFilename suffix. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
275 |
suffix notNil ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
276 |
DefaultCommandPerSuffix at:suffix put:cmd. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
277 |
] |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
278 |
] |
2951
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
279 |
] |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
280 |
|
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
281 |
"Created: 14.11.1996 / 14:58:13 / cg" |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
282 |
! |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
283 |
|
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
284 |
addToHistory:path |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
285 |
|pos idx| |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
286 |
|
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
287 |
idx := DirectoryHistory indexOf:path. |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
288 |
idx == 0 ifTrue:[ |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
289 |
DirectoryHistory size >= HistorySize ifTrue:[ |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
290 |
DirectoryHistory removeLast. |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
291 |
DirectoryHistoryWhere removeLast |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
292 |
] |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
293 |
] ifFalse:[ |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
294 |
"already been there before; move the entry to |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
295 |
the beginning, so it will fall out later." |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
296 |
|
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
297 |
DirectoryHistory removeIndex:idx. |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
298 |
pos := DirectoryHistoryWhere at:idx. |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
299 |
DirectoryHistoryWhere removeIndex:idx. |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
300 |
]. |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
301 |
DirectoryHistory addFirst:path. |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
302 |
DirectoryHistoryWhere addFirst:pos. |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
303 |
|
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
304 |
"Created: / 8.11.1997 / 17:16:29 / cg" |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
305 |
! |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
306 |
|
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
307 |
addToVisitedFileHistory:path |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
308 |
|idx| |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
309 |
|
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
310 |
idx := VisitedFileHistory indexOf:path. |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
311 |
idx == 0 ifTrue:[ |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
312 |
VisitedFileHistory size >= HistorySize ifTrue:[ |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
313 |
VisitedFileHistory removeLast. |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
314 |
] |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
315 |
] ifFalse:[ |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
316 |
"already been there before; move the entry to |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
317 |
the beginning, so it will fall out later." |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
318 |
|
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
319 |
VisitedFileHistory removeIndex:idx. |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
320 |
]. |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
321 |
VisitedFileHistory addFirst:path. |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
322 |
! ! |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
323 |
|
1933 | 324 |
!FileBrowser class methodsFor:'interface specs'! |
325 |
||
326 |
fileSearchDialogSpec |
|
327 |
"This resource specification was automatically generated |
|
328 |
by the UIPainter of ST/X." |
|
329 |
||
330 |
"Do not manually edit this!! If it is corrupted, |
|
331 |
the UIPainter may not be able to read the specification." |
|
332 |
||
333 |
" |
|
334 |
UIPainter new openOnClass:FileBrowser andSelector:#fileSearchDialogSpec |
|
335 |
" |
|
336 |
||
337 |
<resource: #canvas> |
|
338 |
||
339 |
^ |
|
340 |
||
341 |
#(#FullSpec |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
342 |
#window: |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
343 |
#(#WindowSpec |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
344 |
#name: 'File Search' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
345 |
#layout: #(#LayoutFrame 4 0 50 0 315 0 349 0) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
346 |
#level: 0 |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
347 |
#label: 'File Search' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
348 |
#min: #(#Point 10 10) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
349 |
#max: #(#Point 1280 1024) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
350 |
#bounds: #(#Rectangle 4 50 316 350) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
351 |
#usePreferredExtent: false |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
352 |
#returnIsOKInDialog: true |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
353 |
#escapeIsCancelInDialog: true |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
354 |
) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
355 |
#component: |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
356 |
#(#SpecCollection |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
357 |
#collection: |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
358 |
#( |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
359 |
#(#LabelSpec |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
360 |
#name: 'Label1' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
361 |
#layout: #(#LayoutFrame 0 0 10 0 0 1 32 0) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
362 |
#label: 'Search for files named:' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
363 |
#translateLabel: true |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
364 |
#adjust: #left |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
365 |
) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
366 |
#(#InputFieldSpec |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
367 |
#name: 'EntryField1' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
368 |
#layout: #(#LayoutFrame 10 0 36 0 305 0 58 0) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
369 |
#tabable: true |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
370 |
#model: #namePatternHolder |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
371 |
) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
372 |
#(#CheckBoxSpec |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
373 |
#name: 'CheckBox1' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
374 |
#layout: #(#LayoutFrame 7 0 66 0 143 0 88 0) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
375 |
#tabable: true |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
376 |
#model: #ignoreCaseInName |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
377 |
#label: 'Ignore case' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
378 |
#translateLabel: true |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
379 |
) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
380 |
#(#LabelSpec |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
381 |
#name: 'Label2' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
382 |
#layout: #(#LayoutFrame 0 0.0 107 0 0 1.0 129 0) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
383 |
#label: 'Containing the string:' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
384 |
#translateLabel: true |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
385 |
#adjust: #left |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
386 |
) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
387 |
#(#InputFieldSpec |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
388 |
#name: 'EntryField2' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
389 |
#layout: #(#LayoutFrame 10 0 133 0 305 0 155 0) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
390 |
#enableChannel: #notSearchForSameContents |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
391 |
#tabable: true |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
392 |
#model: #contentsPatternHolder |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
393 |
) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
394 |
#(#CheckBoxSpec |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
395 |
#name: 'CheckBox2' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
396 |
#layout: #(#LayoutFrame 6 0 163 0 142 0 185 0) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
397 |
#enableChannel: #notSearchForSameContents |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
398 |
#tabable: true |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
399 |
#model: #ignoreCaseInContents |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
400 |
#label: 'Ignore case' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
401 |
#translateLabel: true |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
402 |
) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
403 |
#(#LabelSpec |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
404 |
#name: 'Label3' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
405 |
#layout: #(#LayoutFrame 0 0.0 223 0 -30 1.0 245 0) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
406 |
#label: 'Containing same contents as selected:' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
407 |
#translateLabel: true |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
408 |
#adjust: #left |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
409 |
) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
410 |
#(#DividerSpec |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
411 |
#name: 'Separator1' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
412 |
#layout: #(#LayoutFrame 0 0.0 97 0 0 1.0 101 0) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
413 |
) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
414 |
#(#CheckToggleSpec |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
415 |
#name: 'CheckToggle1' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
416 |
#layout: #(#LayoutOrigin -25 1 225 0) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
417 |
#tabable: true |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
418 |
#model: #searchForSameContents |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
419 |
#enableChannel: #searchForSameContentsEnabled |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
420 |
#isTriggerOnDown: true |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
421 |
#showLamp: false |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
422 |
#lampColor: #(#Color 100.0 100.0 0.0) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
423 |
) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
424 |
#(#HorizontalPanelViewSpec |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
425 |
#name: 'HorizontalPanel1' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
426 |
#layout: #(#LayoutFrame 0 0.0 -30 1 0 1.0 0 1.0) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
427 |
#component: |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
428 |
#(#SpecCollection |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
429 |
#collection: |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
430 |
#( |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
431 |
#(#ActionButtonSpec |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
432 |
#name: 'Button1' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
433 |
#label: 'Cancel' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
434 |
#translateLabel: true |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
435 |
#tabable: true |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
436 |
#model: #cancel |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
437 |
#extent: #(#Point 151 25) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
438 |
) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
439 |
#(#ActionButtonSpec |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
440 |
#name: 'Button2' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
441 |
#label: 'Search' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
442 |
#translateLabel: true |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
443 |
#tabable: true |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
444 |
#model: #accept |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
445 |
#isDefault: true |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
446 |
#extent: #(#Point 152 25) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
447 |
) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
448 |
) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
449 |
) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
450 |
#horizontalLayout: #fitSpace |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
451 |
#verticalLayout: #centerMax |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
452 |
#horizontalSpace: 3 |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
453 |
#verticalSpace: 3 |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
454 |
) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
455 |
) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
456 |
) |
1933 | 457 |
) |
458 |
! ! |
|
459 |
||
1834 | 460 |
!FileBrowser class methodsFor:'menu specs'! |
461 |
||
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
462 |
baseBookmarksMenuSpec |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
463 |
"This resource specification was automatically generated |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
464 |
by the MenuEditor of ST/X." |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
465 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
466 |
"Do not manually edit this!! If it is corrupted, |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
467 |
the MenuEditor may not be able to read the specification." |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
468 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
469 |
" |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
470 |
MenuEditor new openOnClass:FileBrowser andSelector:#baseBookmarksMenuSpec |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
471 |
(Menu new fromLiteralArrayEncoding:(FileBrowser baseBookmarksMenuSpec)) startUp |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
472 |
" |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
473 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
474 |
<resource: #menu> |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
475 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
476 |
^ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
477 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
478 |
#(#Menu |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
479 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
480 |
#( |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
481 |
#(#MenuItem |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
482 |
#label: 'Add Bookmark' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
483 |
#translateLabel: true |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
484 |
#value: #addBookmark |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
485 |
) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
486 |
#(#MenuItem |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
487 |
#label: 'Remove Bookmark' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
488 |
#translateLabel: true |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
489 |
#value: #removeBookmark |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
490 |
#enabled: #hasBookmarksToRemove |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
491 |
) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
492 |
) nil |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
493 |
nil |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
494 |
) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
495 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
496 |
"Created: / 4.8.1998 / 17:21:16 / cg" |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
497 |
"Modified: / 14.8.1998 / 19:19:06 / cg" |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
498 |
! |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
499 |
|
1834 | 500 |
baseDirectoryMenuSpec |
501 |
"This resource specification was automatically generated |
|
502 |
by the MenuEditor of ST/X." |
|
503 |
||
504 |
"Do not manually edit this!! If it is corrupted, |
|
505 |
the MenuEditor may not be able to read the specification." |
|
506 |
||
507 |
" |
|
508 |
MenuEditor new openOnClass:FileBrowser andSelector:#directoryMenuSpec |
|
509 |
(Menu new fromLiteralArrayEncoding:(FileBrowser directoryMenuSpec)) startUp |
|
510 |
" |
|
511 |
||
512 |
<resource: #menu> |
|
513 |
||
514 |
^ |
|
515 |
||
516 |
#(#Menu |
|
517 |
||
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
518 |
#( |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
519 |
#(#MenuItem |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
520 |
#label: 'Copy Path' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
521 |
#translateLabel: true |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
522 |
#value: #copyPath |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
523 |
) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
524 |
#(#MenuItem |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
525 |
#label: '-' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
526 |
) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
527 |
#(#MenuItem |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
528 |
#label: 'Up' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
529 |
#translateLabel: true |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
530 |
#value: #changeToParentDirectory |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
531 |
#enabled: #currentDirectoryIsNotTop |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
532 |
) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
533 |
#(#MenuItem |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
534 |
#label: 'Back' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
535 |
#translateLabel: true |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
536 |
#value: #changeToPreviousDirectory |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
537 |
) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
538 |
#(#MenuItem |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
539 |
#label: 'Home' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
540 |
#translateLabel: true |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
541 |
#value: #changeToHomeDirectory |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
542 |
) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
543 |
#(#MenuItem |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
544 |
#label: 'Default' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
545 |
#translateLabel: true |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
546 |
#value: #changeToDefaultDirectory |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
547 |
) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
548 |
#(#MenuItem |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
549 |
#label: 'Goto...' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
550 |
#translateLabel: true |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
551 |
#value: #changeCurrentDirectory |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
552 |
) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
553 |
#(#MenuItem |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
554 |
#label: '-' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
555 |
) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
556 |
#(#MenuItem |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
557 |
#label: 'Bookmarks' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
558 |
#translateLabel: true |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
559 |
#submenuChannel: #bookmarksMenuSpec |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
560 |
) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
561 |
) nil |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
562 |
nil |
1834 | 563 |
) |
564 |
||
565 |
"Created: / 4.8.1998 / 17:21:16 / cg" |
|
1835 | 566 |
"Modified: / 14.8.1998 / 19:19:06 / cg" |
1834 | 567 |
! |
568 |
||
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
569 |
bookmarksMenuSpec |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
570 |
"This resource specification was automatically generated |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
571 |
by the MenuEditor of ST/X." |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
572 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
573 |
"Do not manually edit this!! If it is corrupted, |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
574 |
the MenuEditor may not be able to read the specification." |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
575 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
576 |
" |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
577 |
MenuEditor new openOnClass:FileBrowser andSelector:#bookmarksMenuSpec |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
578 |
(Menu new fromLiteralArrayEncoding:(FileBrowser bookmarksMenuSpec)) startUp |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
579 |
" |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
580 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
581 |
<resource: #programMenu> |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
582 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
583 |
|m| |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
584 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
585 |
m := self baseBookmarksMenuSpec. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
586 |
m := m decodeAsLiteralArray. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
587 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
588 |
"/ add the history items ... |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
589 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
590 |
DirectoryBookmarks size > 0 ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
591 |
m addItem:(MenuItem labeled:'-'). |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
592 |
DirectoryBookmarks do:[:dirName | |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
593 |
m addItem:((MenuItem label:dirName value:#changeDirectoryTo:) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
594 |
argument:dirName; |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
595 |
yourself). |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
596 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
597 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
598 |
^ m |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
599 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
600 |
"Modified: / 17.8.1998 / 10:13:05 / cg" |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
601 |
! |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
602 |
|
1834 | 603 |
directoryMenuSpec |
604 |
"This resource specification was automatically generated |
|
605 |
by the MenuEditor of ST/X." |
|
606 |
||
607 |
"Do not manually edit this!! If it is corrupted, |
|
608 |
the MenuEditor may not be able to read the specification." |
|
609 |
||
610 |
" |
|
611 |
MenuEditor new openOnClass:FileBrowser andSelector:#directoryMenuSpec |
|
612 |
(Menu new fromLiteralArrayEncoding:(FileBrowser directoryMenuSpec)) startUp |
|
613 |
" |
|
614 |
||
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
615 |
<resource: #menu> |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
616 |
|
3658 | 617 |
^ |
618 |
#(#Menu |
|
619 |
#( |
|
620 |
#(#MenuItem |
|
621 |
#label: 'Copy Path' |
|
622 |
#translateLabel: true |
|
623 |
#value: #copyPath |
|
624 |
) |
|
625 |
#(#MenuItem |
|
626 |
#label: '-' |
|
627 |
) |
|
628 |
#(#MenuItem |
|
629 |
#label: 'Up' |
|
630 |
#translateLabel: true |
|
631 |
#value: #changeToParentDirectory |
|
632 |
#enabled: #currentDirectoryIsNotTop |
|
633 |
) |
|
634 |
#(#MenuItem |
|
635 |
#label: 'Goto...' |
|
636 |
#translateLabel: true |
|
637 |
#value: #changeCurrentDirectory |
|
638 |
) |
|
639 |
#(#MenuItem |
|
640 |
#label: '-' |
|
641 |
) |
|
642 |
#(#MenuItem |
|
643 |
#label: 'Back' |
|
644 |
#translateLabel: true |
|
645 |
#value: #changeToPreviousDirectory |
|
646 |
) |
|
647 |
#(#MenuItem |
|
648 |
#label: '-' |
|
649 |
) |
|
650 |
#(#MenuItem |
|
651 |
#label: 'Default' |
|
652 |
#translateLabel: true |
|
653 |
#value: #changeToDefaultDirectory |
|
654 |
) |
|
655 |
#(#MenuItem |
|
656 |
#label: 'Home' |
|
657 |
#translateLabel: true |
|
658 |
#value: #changeToHomeDirectory |
|
659 |
) |
|
660 |
#(#MenuItem |
|
661 |
#label: 'Bookmarks' |
|
662 |
#translateLabel: true |
|
663 |
#submenuChannel: #bookmarksMenuSpec |
|
664 |
) |
|
665 |
#(#MenuItem |
|
666 |
#label: '-' |
|
667 |
) |
|
668 |
#(#MenuItem |
|
669 |
#label: 'Visited Directories' |
|
670 |
#translateLabel: true |
|
671 |
#submenuChannel: #historyMenuSpec |
|
672 |
) |
|
673 |
) |
|
674 |
nil |
|
675 |
nil |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
676 |
) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
677 |
! |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
678 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
679 |
historyMenuSpec |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
680 |
"This resource specification was automatically generated |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
681 |
by the MenuEditor of ST/X." |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
682 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
683 |
"Do not manually edit this!! If it is corrupted, |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
684 |
the MenuEditor may not be able to read the specification." |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
685 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
686 |
" |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
687 |
MenuEditor new openOnClass:FileBrowser andSelector:#directoryMenuSpec |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
688 |
(Menu new fromLiteralArrayEncoding:(FileBrowser directoryMenuSpec)) startUp |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
689 |
" |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
690 |
|
1834 | 691 |
<resource: #programMenu> |
692 |
||
2035
307ed5143d8b
national language stuff - again
Claus Gittinger <cg@exept.de>
parents:
2031
diff
changeset
|
693 |
|m| |
307ed5143d8b
national language stuff - again
Claus Gittinger <cg@exept.de>
parents:
2031
diff
changeset
|
694 |
|
1834 | 695 |
"/ add the history items ... |
696 |
||
1835 | 697 |
DirectoryHistory size > 0 ifTrue:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
698 |
m := Menu new. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
699 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
700 |
DirectoryHistory do:[:dirName | |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
701 |
m addItem:((MenuItem label:dirName value:#changeDirectoryTo:) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
702 |
argument:dirName; |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
703 |
yourself). |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
704 |
]. |
3454 | 705 |
]. |
706 |
||
2035
307ed5143d8b
national language stuff - again
Claus Gittinger <cg@exept.de>
parents:
2031
diff
changeset
|
707 |
^ m |
1834 | 708 |
|
1837 | 709 |
"Modified: / 17.8.1998 / 10:13:05 / cg" |
1834 | 710 |
! |
711 |
||
712 |
menuPopUp |
|
713 |
"This resource specification was automatically generated |
|
714 |
by the MenuEditor of ST/X." |
|
715 |
||
716 |
"Do not manually edit this!! If it is corrupted, |
|
717 |
the MenuEditor may not be able to read the specification." |
|
718 |
||
719 |
" |
|
720 |
MenuEditor new openOnClass:FileBrowser andSelector:#menuPopUp |
|
721 |
(Menu new fromLiteralArrayEncoding:(FileBrowser menuPopUp)) startUp |
|
722 |
" |
|
723 |
||
724 |
<resource: #menu> |
|
725 |
||
2185 | 726 |
^ |
727 |
#(#Menu |
|
728 |
#( |
|
729 |
#(#MenuItem |
|
730 |
#label: 'Spawn' |
|
731 |
#translateLabel: true |
|
732 |
#value: #fileSpawn |
|
733 |
) |
|
734 |
#(#MenuItem |
|
735 |
#label: '-' |
|
736 |
) |
|
737 |
#(#MenuItem |
|
738 |
#label: 'Get Contents' |
|
739 |
#translateLabel: true |
|
740 |
#value: #fileGet |
|
741 |
#enabled: #hasSelection |
|
742 |
) |
|
743 |
#(#MenuItem |
|
744 |
#label: 'Insert Contents' |
|
745 |
#translateLabel: true |
|
746 |
#value: #fileInsert |
|
747 |
#enabled: #hasSelection |
|
748 |
) |
|
749 |
#(#MenuItem |
|
750 |
#label: 'FileIn' |
|
751 |
#translateLabel: true |
|
752 |
#value: #fileFileIn |
|
753 |
#enabled: #hasSelection |
|
2825
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
754 |
#shortcutKeyCharacter: #Accept |
2185 | 755 |
) |
756 |
#(#MenuItem |
|
757 |
#label: '-' |
|
758 |
) |
|
759 |
#(#MenuItem |
|
3172 | 760 |
#label: 'New' |
2185 | 761 |
#translateLabel: true |
3172 | 762 |
#submenu: |
763 |
#(#Menu |
|
764 |
#( |
|
765 |
#(#MenuItem |
|
766 |
#label: 'Directory...' |
|
767 |
#translateLabel: true |
|
768 |
#value: #newDirectory |
|
769 |
) |
|
770 |
#(#MenuItem |
|
771 |
#label: 'File...' |
|
772 |
#translateLabel: true |
|
773 |
#value: #newFile |
|
774 |
) |
|
775 |
#(#MenuItem |
|
776 |
#label: 'Hard Link...' |
|
777 |
#translateLabel: true |
|
778 |
#isVisible: #systemIsUnix |
|
779 |
#value: #newHardLink |
|
780 |
) |
|
781 |
#(#MenuItem |
|
782 |
#label: 'Symbolic Link...' |
|
783 |
#translateLabel: true |
|
784 |
#isVisible: #systemIsUnix |
|
785 |
#value: #newSoftLink |
|
786 |
) |
|
787 |
) |
|
788 |
nil |
|
789 |
nil |
|
790 |
) |
|
2185 | 791 |
) |
792 |
#(#MenuItem |
|
793 |
#label: 'Remove...' |
|
794 |
#translateLabel: true |
|
795 |
#value: #fileRemove |
|
796 |
#enabled: #hasSelection |
|
2543 | 797 |
#shortcutKeyCharacter: #Cut |
2185 | 798 |
) |
799 |
#(#MenuItem |
|
800 |
#label: 'Rename...' |
|
801 |
#translateLabel: true |
|
802 |
#value: #fileRename |
|
803 |
#enabled: #hasSelection |
|
2825
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
804 |
#shortcutKeyCharacter: #Replace |
2185 | 805 |
) |
806 |
#(#MenuItem |
|
807 |
#label: '-' |
|
808 |
) |
|
809 |
#(#MenuItem |
|
3172 | 810 |
#label: 'Properties...' |
2185 | 811 |
#translateLabel: true |
3172 | 812 |
#value: #fileGetLongInfo |
813 |
#enabled: #hasSelection |
|
2185 | 814 |
) |
815 |
#(#MenuItem |
|
3172 | 816 |
#label: '-' |
817 |
) |
|
818 |
#(#MenuItem |
|
819 |
#label: 'Tools' |
|
2185 | 820 |
#translateLabel: true |
3172 | 821 |
#submenuChannel: #toolsMenuSpec |
822 |
#shortcutKeyCharacter: #Ctrl |
|
2185 | 823 |
) |
824 |
#(#MenuItem |
|
825 |
#label: '-' |
|
826 |
) |
|
827 |
#(#MenuItem |
|
828 |
#label: 'Update' |
|
829 |
#translateLabel: true |
|
830 |
#value: #updateCurrentDirectory |
|
831 |
) |
|
832 |
) |
|
833 |
nil |
|
834 |
nil |
|
2844 | 835 |
) |
836 |
! |
|
1834 | 837 |
|
838 |
menuSpec |
|
839 |
"This resource specification was automatically generated |
|
840 |
by the MenuEditor of ST/X." |
|
841 |
||
842 |
"Do not manually edit this!! If it is corrupted, |
|
843 |
the MenuEditor may not be able to read the specification." |
|
844 |
||
845 |
" |
|
846 |
MenuEditor new openOnClass:FileBrowser andSelector:#menuSpec |
|
847 |
(Menu new fromLiteralArrayEncoding:(FileBrowser menuSpec)) startUp |
|
848 |
" |
|
849 |
||
850 |
<resource: #menu> |
|
851 |
||
2102 | 852 |
^ |
853 |
#(#Menu |
|
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
854 |
#( |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
855 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
856 |
#label: 'File' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
857 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
858 |
#submenu: |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
859 |
#(#Menu |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
860 |
#( |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
861 |
#(#MenuItem |
2951
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
862 |
#label: 'Spawn' |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
863 |
#translateLabel: true |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
864 |
#value: #fileSpawn |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
865 |
) |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
866 |
#(#MenuItem |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
867 |
#label: '-' |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
868 |
) |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
869 |
#(#MenuItem |
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
870 |
#label: 'Open' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
871 |
#translateLabel: true |
3213 | 872 |
#isVisible: false |
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
873 |
#value: #menuOpen |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
874 |
#enabled: #hasSelection |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
875 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
876 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
877 |
#label: 'Open selected Filename' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
878 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
879 |
#isVisible: #hasFilenameSelectionInCodeView |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
880 |
#value: #openSelectedFilename |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
881 |
#enabled: #hasFilenameSelectionInCodeView |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
882 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
883 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
884 |
#label: 'FileIn' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
885 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
886 |
#value: #fileFileIn |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
887 |
#enabled: #hasSelection |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
888 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
889 |
#(#MenuItem |
3465
f52e089ca838
added fileIntoNameSpace menu item
Claus Gittinger <cg@exept.de>
parents:
3461
diff
changeset
|
890 |
#label: 'FileInTo NameSpace...' |
f52e089ca838
added fileIntoNameSpace menu item
Claus Gittinger <cg@exept.de>
parents:
3461
diff
changeset
|
891 |
#translateLabel: true |
f52e089ca838
added fileIntoNameSpace menu item
Claus Gittinger <cg@exept.de>
parents:
3461
diff
changeset
|
892 |
#value: #fileFileInToNameSpace |
f52e089ca838
added fileIntoNameSpace menu item
Claus Gittinger <cg@exept.de>
parents:
3461
diff
changeset
|
893 |
#enabled: #hasSelection |
f52e089ca838
added fileIntoNameSpace menu item
Claus Gittinger <cg@exept.de>
parents:
3461
diff
changeset
|
894 |
) |
f52e089ca838
added fileIntoNameSpace menu item
Claus Gittinger <cg@exept.de>
parents:
3461
diff
changeset
|
895 |
#(#MenuItem |
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
896 |
#label: '-' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
897 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
898 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
899 |
#label: 'New' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
900 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
901 |
#submenu: |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
902 |
#(#Menu |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
903 |
#( |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
904 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
905 |
#label: 'Directory...' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
906 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
907 |
#value: #newDirectory |
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 |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
910 |
#label: 'File...' |
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 |
#value: #newFile |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
913 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
914 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
915 |
#label: 'Hard Link...' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
916 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
917 |
#isVisible: #systemIsUnix |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
918 |
#value: #newHardLink |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
919 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
920 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
921 |
#label: 'Symbolic Link...' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
922 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
923 |
#isVisible: #systemIsUnix |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
924 |
#value: #newSoftLink |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
925 |
) |
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 |
nil |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
928 |
nil |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
929 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
930 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
931 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
932 |
#label: 'Remove' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
933 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
934 |
#value: #fileRemove |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
935 |
#enabled: #hasSelection |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
936 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
937 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
938 |
#label: 'Rename' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
939 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
940 |
#value: #fileRename |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
941 |
#enabled: #hasSelection |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
942 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
943 |
#(#MenuItem |
2143 | 944 |
#label: '-' |
945 |
) |
|
946 |
#(#MenuItem |
|
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
947 |
#label: 'Properties...' |
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 |
#value: #fileGetLongInfo |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
950 |
#enabled: #hasSelection |
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: '-' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
954 |
#isVisible: #javaSupportLoaded |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
955 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
956 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
957 |
#label: 'Add to Java ClassPath' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
958 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
959 |
#isVisible: #javaSupportLoaded |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
960 |
#value: #fileAddToJavaClassPath |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
961 |
#enabled: #canAddToClassPath |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
962 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
963 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
964 |
#label: 'Remove from Java ClassPath' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
965 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
966 |
#isVisible: #javaSupportLoaded |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
967 |
#value: #fileRemoveFromJavaClassPath |
2368 | 968 |
#enabled: #canRemoveFromClassPath |
969 |
) |
|
970 |
#(#MenuItem |
|
971 |
#label: 'Add to Java SourcePath' |
|
972 |
#translateLabel: true |
|
973 |
#isVisible: #javaSupportLoaded |
|
974 |
#value: #fileAddToJavaSourcePath |
|
975 |
#enabled: #canAddToSourcePath |
|
976 |
) |
|
977 |
#(#MenuItem |
|
978 |
#label: 'Remove from Java SourcePath' |
|
979 |
#translateLabel: true |
|
980 |
#isVisible: #javaSupportLoaded |
|
981 |
#value: #fileRemoveFromJavaSourcePath |
|
982 |
#enabled: #canRemoveFromSourcePath |
|
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
983 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
984 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
985 |
#label: '-' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
986 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
987 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
988 |
#label: 'Exit' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
989 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
990 |
#value: #menuExit |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
991 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
992 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
993 |
nil |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
994 |
nil |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
995 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
996 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
997 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
998 |
#label: 'Directory' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
999 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1000 |
#submenuChannel: #directoryMenuSpec |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1001 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1002 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1003 |
#label: 'Edit' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1004 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1005 |
#submenu: |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1006 |
#(#Menu |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1007 |
#( |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1008 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1009 |
#label: 'Get Contents' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1010 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1011 |
#value: #fileGet |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1012 |
#enabled: #hasSelection |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1013 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1014 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1015 |
#label: 'Insert Contents' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1016 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1017 |
#value: #fileInsert |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1018 |
#enabled: #hasSelection |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1019 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1020 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1021 |
#label: '-' |
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: 'Copy File List' |
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: #copyFileList |
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: 'Copy Selected Filename' |
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: #copySelectedFileName |
3010 | 1032 |
#enabled: #hasSelection |
1033 |
) |
|
1034 |
#(#MenuItem |
|
1035 |
#label: 'Copy Selected Pathname' |
|
1036 |
#translateLabel: true |
|
1037 |
#value: #copySelectedPathName |
|
1038 |
#enabled: #hasSelection |
|
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1039 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1040 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1041 |
#label: 'Copy Command History' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1042 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1043 |
#value: #copyCommandHistory |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1044 |
) |
2951
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
1045 |
#(#MenuItem |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
1046 |
#label: '-' |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
1047 |
) |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
1048 |
#(#MenuItem |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
1049 |
#label: 'Visited Files' |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
1050 |
#translateLabel: true |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
1051 |
#submenuChannel: #visitedFileMenuSpec |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
1052 |
) |
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1053 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1054 |
nil |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1055 |
nil |
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 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1058 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1059 |
#label: 'View' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1060 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1061 |
#submenu: |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1062 |
#(#Menu |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1063 |
#( |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1064 |
#(#MenuItem |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1065 |
#label: 'Show Details' |
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1066 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1067 |
#indication: #showingDetails |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1068 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1069 |
#(#MenuItem |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1070 |
#label: 'Show Time && Date' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1071 |
#translateLabel: true |
3658 | 1072 |
#enabled: #showingDetails |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1073 |
#indication: #showingTimeAndDate |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1074 |
) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1075 |
#(#MenuItem |
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1076 |
#label: 'Show Hidden Files' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1077 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1078 |
#indication: #showingHiddenFiles |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1079 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1080 |
#(#MenuItem |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1081 |
#label: 'Show Big Image Preview' |
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1082 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1083 |
#indication: #showingBigImagePreview |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1084 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1085 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1086 |
#label: '-' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1087 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1088 |
#(#MenuItem |
2155 | 1089 |
#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
|
1090 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1091 |
#choice: #sortByWhat |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1092 |
#choiceValue: #name |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1093 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1094 |
#(#MenuItem |
2155 | 1095 |
#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
|
1096 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1097 |
#choice: #sortByWhat |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1098 |
#choiceValue: #type |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1099 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1100 |
#(#MenuItem |
2155 | 1101 |
#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
|
1102 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1103 |
#choice: #sortByWhat |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1104 |
#choiceValue: #time |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1105 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1106 |
#(#MenuItem |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1107 |
#label: 'Ignore Case in Sort' |
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1108 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1109 |
#indication: #sortCaseless |
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 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1112 |
#label: '-' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1113 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1114 |
#(#MenuItem |
3172 | 1115 |
#label: 'Encoding...' |
1116 |
#translateLabel: true |
|
1117 |
#value: #fileEncoding |
|
1118 |
) |
|
1119 |
#(#MenuItem |
|
1120 |
#label: 'DOS EndOfLine Mode' |
|
1121 |
#translateLabel: true |
|
1122 |
#indication: #dosEOLMode |
|
1123 |
) |
|
1124 |
#(#MenuItem |
|
1125 |
#label: '-' |
|
1126 |
) |
|
1127 |
#(#MenuItem |
|
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1128 |
#label: 'Update' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1129 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1130 |
#value: #updateCurrentDirectory |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1131 |
) |
2220
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
1132 |
#(#MenuItem |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
1133 |
#label: 'AutoUpdate' |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
1134 |
#translateLabel: true |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
1135 |
#indication: #autoUpdate |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
1136 |
) |
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1137 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1138 |
nil |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1139 |
nil |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1140 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1141 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1142 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1143 |
#label: 'Tools' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1144 |
#translateLabel: true |
2825
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1145 |
#submenuChannel: #toolsMenuSpec |
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1146 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1147 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1148 |
#label: 'CVS' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1149 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1150 |
#submenu: |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1151 |
#(#Menu |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1152 |
#( |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1153 |
#(#MenuItem |
3691
f5d9ed09899b
menu texts: standard headline case
Claus Gittinger <cg@exept.de>
parents:
3665
diff
changeset
|
1154 |
#label: 'Update Selected Files/Directories' |
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1155 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1156 |
#value: #cvsUpdateSelection |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1157 |
#enabled: #hasSelection |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1158 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1159 |
#(#MenuItem |
3691
f5d9ed09899b
menu texts: standard headline case
Claus Gittinger <cg@exept.de>
parents:
3665
diff
changeset
|
1160 |
#label: 'Update Directory Local' |
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1161 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1162 |
#value: #cvsUpdateDirectoryLocal |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1163 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1164 |
#(#MenuItem |
3691
f5d9ed09899b
menu texts: standard headline case
Claus Gittinger <cg@exept.de>
parents:
3665
diff
changeset
|
1165 |
#label: 'Update Directory Recursive' |
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1166 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1167 |
#value: #cvsUpdateDirectoryRecursive |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1168 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1169 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1170 |
#label: '-' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1171 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1172 |
#(#MenuItem |
2386 | 1173 |
#label: 'Commit...' |
1174 |
#translateLabel: true |
|
1175 |
#value: #cvsCommitSelection |
|
1176 |
) |
|
1177 |
#(#MenuItem |
|
3467 | 1178 |
#label: 'Add && Commit...' |
2424 | 1179 |
#translateLabel: true |
3467 | 1180 |
#value: #cvsAddAndCommitSelection |
2424 | 1181 |
) |
1182 |
#(#MenuItem |
|
2386 | 1183 |
#label: '-' |
1184 |
) |
|
1185 |
#(#MenuItem |
|
3691
f5d9ed09899b
menu texts: standard headline case
Claus Gittinger <cg@exept.de>
parents:
3665
diff
changeset
|
1186 |
#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
|
1187 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1188 |
#value: #cvsRemoveFileAndContainer |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1189 |
#enabled: #canRemoveCVSContainer |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1190 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1191 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1192 |
nil |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1193 |
nil |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1194 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1195 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1196 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1197 |
#label: 'Help' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1198 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1199 |
#startGroup: #right |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1200 |
#submenu: |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1201 |
#(#Menu |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1202 |
#( |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1203 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1204 |
#label: 'FileBrowser Documentation' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1205 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1206 |
#value: #openHTMLDocument: |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1207 |
#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
|
1208 |
) |
3213 | 1209 |
#(#MenuItem |
1210 |
#label: '-' |
|
1211 |
) |
|
1212 |
#(#MenuItem |
|
1213 |
#label: 'About FileBrowser...' |
|
1214 |
#translateLabel: true |
|
1215 |
#value: #openAboutThisApplication |
|
1216 |
) |
|
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1217 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1218 |
nil |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1219 |
nil |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1220 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1221 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1222 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1223 |
nil |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1224 |
nil |
1834 | 1225 |
) |
2825
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1226 |
! |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1227 |
|
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1228 |
toolsMenuSpec |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1229 |
"This resource specification was automatically generated |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1230 |
by the MenuEditor of ST/X." |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1231 |
|
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1232 |
"Do not manually edit this!! If it is corrupted, |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1233 |
the MenuEditor may not be able to read the specification." |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1234 |
|
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1235 |
" |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1236 |
MenuEditor new openOnClass:FileBrowser andSelector:#toolsMenuSpec |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1237 |
(Menu new fromLiteralArrayEncoding:(FileBrowser toolsMenuSpec)) startUp |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1238 |
" |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1239 |
|
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1240 |
<resource: #menu> |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1241 |
|
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1242 |
^ |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1243 |
#(#Menu |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1244 |
#( |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1245 |
#(#MenuItem |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1246 |
#label: 'Unix Command...' |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1247 |
#translateLabel: true |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1248 |
#isVisible: #systemIsUnix |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1249 |
#value: #menuOSCommand |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1250 |
) |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1251 |
#(#MenuItem |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1252 |
#label: 'DOS Command...' |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1253 |
#translateLabel: true |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1254 |
#isVisible: #systemIsDOS |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1255 |
#value: #menuOSCommand |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1256 |
) |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1257 |
#(#MenuItem |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1258 |
#label: 'VMS Command...' |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1259 |
#translateLabel: true |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1260 |
#isVisible: #systemIsVMS |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1261 |
#value: #menuOSCommand |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1262 |
) |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1263 |
#(#MenuItem |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1264 |
#label: 'Shell Terminal' |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1265 |
#translateLabel: true |
3398 | 1266 |
#isVisible: #canDoTerminalAndSystemIsUnix |
1267 |
#value: #openTerminal |
|
1268 |
#enabled: #canDoTerminal |
|
1269 |
) |
|
1270 |
#(#MenuItem |
|
1271 |
#label: 'DOS Terminal' |
|
1272 |
#translateLabel: true |
|
1273 |
#isVisible: #canDoTerminalAndSystemIsDOS |
|
2825
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1274 |
#value: #openTerminal |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1275 |
#enabled: #canDoTerminal |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1276 |
) |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1277 |
#(#MenuItem |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1278 |
#label: '-' |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1279 |
) |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1280 |
#(#MenuItem |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1281 |
#label: 'Changes Browser' |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1282 |
#translateLabel: true |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1283 |
#value: #openChangesBrowser |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1284 |
#enabled: #hasSelection |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1285 |
) |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1286 |
#(#MenuItem |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1287 |
#label: 'Snapshot Image Browser' |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1288 |
#translateLabel: true |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1289 |
#value: #openSnapshotImageBrowser |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1290 |
#enabled: #hasSnapshotSelection |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1291 |
) |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1292 |
#(#MenuItem |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1293 |
#label: 'Create Smalltalk Project' |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1294 |
#translateLabel: true |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1295 |
#value: #createProjectAndOpenProjectBrowser |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1296 |
#enabled: #canCreateNewProject |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1297 |
) |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1298 |
#(#MenuItem |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1299 |
#label: 'Install autoloaded' |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1300 |
#translateLabel: true |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1301 |
#value: #readAbbrevFile |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1302 |
#enabled: #canReadAbbrevFile |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1303 |
) |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1304 |
#(#MenuItem |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1305 |
#label: 'Editor' |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1306 |
#translateLabel: true |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1307 |
#value: #openEditor |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1308 |
#enabled: #hasSelection |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1309 |
) |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1310 |
#(#MenuItem |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1311 |
#label: 'HTML Reader' |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1312 |
#translateLabel: true |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1313 |
#value: #openHTMLReader |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1314 |
#enabled: #hasSelection |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1315 |
) |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1316 |
#(#MenuItem |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1317 |
#label: 'ASN1 Browser' |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1318 |
#translateLabel: true |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1319 |
#isVisible: #hasASN1 |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1320 |
#value: #openASN1Browser |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1321 |
#enabled: #hasASN1AndSelection |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1322 |
) |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1323 |
#(#MenuItem |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1324 |
#label: 'C Browser' |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1325 |
#translateLabel: true |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1326 |
#isVisible: #hasCBrowser |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1327 |
#value: #openCBrowser |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1328 |
#enabled: #hasCBrowser |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1329 |
) |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1330 |
#(#MenuItem |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1331 |
#label: 'Applet Viewer' |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1332 |
#translateLabel: true |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1333 |
#isVisible: #hasJava |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1334 |
#value: #openAppletViewer |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1335 |
#enabled: #hasJavaAndSelection |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1336 |
) |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1337 |
#(#MenuItem |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1338 |
#label: 'Image Inspector' |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1339 |
#translateLabel: true |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1340 |
#value: #openImageInspector |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1341 |
#enabled: #hasSelection |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1342 |
) |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1343 |
#(#MenuItem |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1344 |
#label: 'Image Preview' |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1345 |
#translateLabel: true |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1346 |
#value: #openImagePreview |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1347 |
#enabled: #hasSelection |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1348 |
) |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1349 |
#(#MenuItem |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1350 |
#label: 'Image Editor' |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1351 |
#translateLabel: true |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1352 |
#value: #openImageEditor |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1353 |
#enabled: #hasSelection |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1354 |
) |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1355 |
#(#MenuItem |
3001 | 1356 |
#label: 'MP3 Player' |
1357 |
#translateLabel: true |
|
1358 |
#isVisible: #hasMP3Player |
|
1359 |
#value: #openMP3Player |
|
1360 |
#enabled: #hasMP3PlayerAndSelection |
|
1361 |
) |
|
1362 |
#(#MenuItem |
|
2825
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1363 |
#label: 'ZipFile Tool' |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1364 |
#translateLabel: true |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1365 |
#value: #openZipTool |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1366 |
#enabled: #hasZipFileSelected |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1367 |
) |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1368 |
#(#MenuItem |
3536 | 1369 |
#label: 'SlideShow' |
1370 |
#translateLabel: true |
|
1371 |
#value: #openSlideShow |
|
1372 |
#isVisible: #hasSlideShow |
|
1373 |
) |
|
1374 |
#(#MenuItem |
|
2825
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1375 |
#label: 'File Differences...' |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1376 |
#translateLabel: true |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1377 |
#value: #openDiffView |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1378 |
) |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1379 |
#(#MenuItem |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1380 |
#label: 'Find Duplicate Files' |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1381 |
#translateLabel: true |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1382 |
#value: #fileFindDuplicates |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1383 |
) |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1384 |
#(#MenuItem |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1385 |
#label: 'Find All Duplicate Files (recursive)' |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1386 |
#translateLabel: true |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1387 |
#value: #fileFindAllDuplicates |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1388 |
) |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1389 |
#(#MenuItem |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1390 |
#label: 'Find a File...' |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1391 |
#translateLabel: true |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1392 |
#value: #fileFindFile |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1393 |
) |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1394 |
#(#MenuItem |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1395 |
#label: 'Hex Dump' |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1396 |
#translateLabel: true |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1397 |
#value: #fileHexDump |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1398 |
#enabled: #hasSelection |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1399 |
) |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1400 |
) |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1401 |
nil |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1402 |
nil |
2844 | 1403 |
) |
3398 | 1404 |
|
3536 | 1405 |
"Modified: / 29.12.2001 / 21:59:27 / cg" |
2951
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
1406 |
! |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
1407 |
|
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
1408 |
visitedFileMenuSpec |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
1409 |
|
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
1410 |
<resource: #programMenu> |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
1411 |
|
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
1412 |
|m| |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
1413 |
|
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
1414 |
VisitedFileHistory size == 0 ifTrue:[^ nil]. |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
1415 |
|
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
1416 |
m := Menu new. |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
1417 |
|
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
1418 |
"/ add the history items ... |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
1419 |
|
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
1420 |
VisitedFileHistory do:[:pathName | |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
1421 |
m addItem:((MenuItem label:pathName asFilename baseName value:#revisitFile:) |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
1422 |
argument:pathName; |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
1423 |
yourself). |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
1424 |
]. |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
1425 |
^ m |
2844 | 1426 |
! ! |
1834 | 1427 |
|
2094 | 1428 |
!FileBrowser class methodsFor:'queries'! |
1429 |
||
1430 |
isVisualStartable |
|
2844 | 1431 |
"return true, if this application can be started via #open. |
1432 |
(to allow start of a change browser via double-click in the browser)" |
|
2094 | 1433 |
|
1434 |
^ true |
|
1435 |
! ! |
|
1436 |
||
1834 | 1437 |
!FileBrowser methodsFor:'aspects'! |
1438 |
||
2220
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
1439 |
autoUpdate |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
1440 |
^ doAutoUpdate |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
1441 |
|
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
1442 |
"Created: / 6.5.1999 / 11:37:25 / cg" |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
1443 |
"Modified: / 6.5.1999 / 11:39:38 / cg" |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
1444 |
! |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
1445 |
|
1893
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
1446 |
canAddToClassPath |
2368 | 1447 |
^ [ |f| |
1448 |
||
1449 |
(Java isNil or:[Java isLoaded not]) ifTrue:[ |
|
1450 |
false |
|
1451 |
] ifFalse:[ |
|
1452 |
f := self singleSelectedFileOrCurrentDirectory. |
|
1453 |
f notNil |
|
1454 |
and:[(Java classPath includes:f pathName) not |
|
1455 |
and:[f isDirectory |
|
1456 |
or:[(f hasSuffix:'jar') |
|
1457 |
or:[(f hasSuffix:'zip')]]]]. |
|
1458 |
] |
|
1459 |
] |
|
1460 |
||
1461 |
"Modified: / 1.2.1999 / 20:38:42 / cg" |
|
1462 |
! |
|
1463 |
||
1464 |
canAddToSourcePath |
|
1465 |
^ [ |f| |
|
1466 |
||
1467 |
(Java isNil or:[Java isLoaded not]) ifTrue:[ |
|
1468 |
false |
|
1469 |
] ifFalse:[ |
|
1470 |
f := self singleSelectedFileOrCurrentDirectory. |
|
1471 |
f notNil |
|
2438 | 1472 |
and:[(Java sourcePath isNil |
1473 |
or:[(Java sourcePath includes:f pathName) not]) |
|
2368 | 1474 |
and:[f isDirectory |
1475 |
or:[(f hasSuffix:'jar') |
|
1476 |
or:[(f hasSuffix:'zip')]]]]. |
|
1477 |
] |
|
1893
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
1478 |
] |
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
1479 |
|
1989 | 1480 |
"Modified: / 1.2.1999 / 20:38:42 / cg" |
1893
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
1481 |
! |
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
1482 |
|
2562
da7680fe8407
first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents:
2550
diff
changeset
|
1483 |
canCreateNewProject |
da7680fe8407
first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents:
2550
diff
changeset
|
1484 |
^ [ |
da7680fe8407
first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents:
2550
diff
changeset
|
1485 |
currentDirectory notNil |
da7680fe8407
first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents:
2550
diff
changeset
|
1486 |
and:[((currentDirectory directoryContents |
da7680fe8407
first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents:
2550
diff
changeset
|
1487 |
select:[:f| f endsWith:'.prj']) size == 0) |
da7680fe8407
first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents:
2550
diff
changeset
|
1488 |
and:[((currentDirectory directoryContents |
da7680fe8407
first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents:
2550
diff
changeset
|
1489 |
select:[:f| f endsWith:'.st']) size > 0) |
da7680fe8407
first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents:
2550
diff
changeset
|
1490 |
]]] |
da7680fe8407
first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents:
2550
diff
changeset
|
1491 |
! |
da7680fe8407
first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents:
2550
diff
changeset
|
1492 |
|
2129 | 1493 |
canDoTerminal |
1494 |
^ OperatingSystem isUNIXlike |
|
1495 |
or:[OperatingSystem isMSWINDOWSlike] |
|
1496 |
||
1497 |
"Created: / 4.8.1998 / 13:37:13 / cg" |
|
1498 |
"Modified: / 28.4.1999 / 11:54:17 / cg" |
|
1499 |
! |
|
1500 |
||
3398 | 1501 |
canDoTerminalAndSystemIsDOS |
1502 |
^ self canDoTerminal and:[OperatingSystem isMSWINDOWSlike] |
|
1503 |
||
1504 |
"Created: / 10.11.2001 / 13:10:32 / cg" |
|
1505 |
! |
|
1506 |
||
1507 |
canDoTerminalAndSystemIsUnix |
|
1508 |
^ self canDoTerminal and:[OperatingSystem isUNIXlike] |
|
1509 |
||
1510 |
"Created: / 10.11.2001 / 13:10:46 / cg" |
|
1511 |
! |
|
1512 |
||
2567
dd029fea485d
added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents:
2562
diff
changeset
|
1513 |
canReadAbbrevFile |
3013 | 1514 |
^ [|sel f fn suff ok| |
2567
dd029fea485d
added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents:
2562
diff
changeset
|
1515 |
|
dd029fea485d
added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents:
2562
diff
changeset
|
1516 |
sel := fileListView selection. |
dd029fea485d
added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents:
2562
diff
changeset
|
1517 |
sel size == 1 ifTrue:[ |
dd029fea485d
added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents:
2562
diff
changeset
|
1518 |
f := fileList at:sel first ifAbsent:nil. |
3013 | 1519 |
ok := (f = 'abbrev.stc'). |
1520 |
]. |
|
1521 |
ok ifFalse:[ |
|
1522 |
ok := currentDirectory notNil |
|
1523 |
and:[(currentDirectory asFilename construct:'abbrev.stc') exists]. |
|
1524 |
]. |
|
1525 |
ok |
|
2567
dd029fea485d
added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents:
2562
diff
changeset
|
1526 |
] |
dd029fea485d
added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents:
2562
diff
changeset
|
1527 |
|
dd029fea485d
added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents:
2562
diff
changeset
|
1528 |
"Modified: / 30.1.1999 / 19:05:59 / cg" |
dd029fea485d
added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents:
2562
diff
changeset
|
1529 |
"Created: / 29.1.2000 / 13:00:57 / cg" |
dd029fea485d
added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents:
2562
diff
changeset
|
1530 |
! |
dd029fea485d
added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents:
2562
diff
changeset
|
1531 |
|
2101 | 1532 |
canRemoveCVSContainer |
1533 |
^ [ |cvsDir| |
|
1534 |
||
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1535 |
currentDirectory notNil |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1536 |
and:[fileListView selection size > 0 |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1537 |
and:[(cvsDir := currentDirectory construct:'CVS') exists |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1538 |
and:[cvsDir isDirectory]]]] |
2101 | 1539 |
! |
1540 |
||
2368 | 1541 |
canRemoveFromClassPath |
1542 |
^ [ |f| |
|
1543 |
||
1544 |
(Java isNil or:[Java isLoaded not]) ifTrue:[ |
|
1545 |
false |
|
1546 |
] ifFalse:[ |
|
1547 |
f := self singleSelectedFileOrCurrentDirectory. |
|
1548 |
f notNil |
|
1549 |
and:[(Java classPath includes:f pathName) |
|
1550 |
and:[f isDirectory |
|
1551 |
or:[(f hasSuffix:'jar') |
|
1552 |
or:[(f hasSuffix:'zip')]]]] |
|
1553 |
] |
|
1554 |
] |
|
1555 |
||
1556 |
"Modified: / 1.2.1999 / 20:39:25 / cg" |
|
1557 |
! |
|
1558 |
||
1559 |
canRemoveFromSourcePath |
|
1560 |
^ [ |f| |
|
1561 |
||
1562 |
(Java isNil or:[Java isLoaded not]) ifTrue:[ |
|
1563 |
false |
|
1564 |
] ifFalse:[ |
|
1565 |
f := self singleSelectedFileOrCurrentDirectory. |
|
1566 |
f notNil |
|
2438 | 1567 |
and:[(Java sourcePath isNil |
1568 |
or:[(Java sourcePath includes:f pathName)]) |
|
2368 | 1569 |
and:[f isDirectory |
1570 |
or:[(f hasSuffix:'jar') |
|
1571 |
or:[(f hasSuffix:'zip')]]]] |
|
1572 |
] |
|
1893
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
1573 |
] |
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
1574 |
|
1989 | 1575 |
"Modified: / 1.2.1999 / 20:39:25 / cg" |
1893
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
1576 |
! |
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
1577 |
|
1834 | 1578 |
currentDirectoryIsNotTop |
1579 |
^ [currentDirectory notNil and:[currentDirectory isRootDirectory not]] |
|
1580 |
||
1581 |
"Modified: / 4.8.1998 / 14:10:57 / cg" |
|
1582 |
"Created: / 14.8.1998 / 12:07:10 / cg" |
|
1583 |
! |
|
1584 |
||
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1585 |
dosEOLMode |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1586 |
^ dosEOLMode |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1587 |
|
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1588 |
"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
|
1589 |
"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
|
1590 |
! |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1591 |
|
2185 | 1592 |
hasASN1 |
1593 |
^ [ OSI::ASN1Parser notNil |
|
1594 |
and:[OSI::ASN1Parser isLoaded]] |
|
1595 |
||
1596 |
! |
|
1597 |
||
1598 |
hasASN1AndSelection |
|
1599 |
^ [ fileListView selection size > 0 |
|
1600 |
and:[OSI::ASN1Parser notNil |
|
1601 |
and:[OSI::ASN1Parser isLoaded]]] |
|
1602 |
! |
|
1603 |
||
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1604 |
hasBookmarks |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1605 |
^ DirectoryBookmarks size > 0 |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1606 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1607 |
"Created: / 14.8.1998 / 19:17:02 / cg" |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1608 |
"Modified: / 14.8.1998 / 19:17:17 / cg" |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1609 |
! |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1610 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1611 |
hasBookmarksToRemove |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1612 |
^ DirectoryBookmarks size > 0 |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1613 |
and:[ DirectoryBookmarks includes:(currentDirectory asFilename pathName) ] |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1614 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1615 |
"Created: / 14.8.1998 / 19:17:02 / cg" |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1616 |
"Modified: / 14.8.1998 / 19:17:17 / cg" |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1617 |
! |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1618 |
|
2814 | 1619 |
hasCBrowser |
1620 |
^ [ CC::Browser notNil ] |
|
1621 |
||
1622 |
! |
|
1623 |
||
1994 | 1624 |
hasFilenameSelectionInCodeView |
1625 |
^ [ |val sel| |
|
1626 |
||
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1627 |
val := false. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1628 |
sel := subView selection. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1629 |
sel notNil ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1630 |
sel := sel asString withoutSeparators. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1631 |
sel asFilename exists ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1632 |
val := sel asFilename isReadable |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1633 |
] |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1634 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1635 |
val |
1994 | 1636 |
] |
1637 |
||
1638 |
"Created: / 4.2.1999 / 17:34:57 / cg" |
|
1639 |
"Modified: / 4.2.1999 / 17:39:32 / cg" |
|
1640 |
! |
|
1641 |
||
1942 | 1642 |
hasJava |
1643 |
^ [ JavaClassReader notNil |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1644 |
and:[JavaClassReader isLoaded]] |
1942 | 1645 |
|
1646 |
"Modified: / 17.10.1998 / 16:57:14 / cg" |
|
1647 |
"Created: / 17.10.1998 / 22:58:25 / cg" |
|
1648 |
! |
|
1649 |
||
1650 |
hasJavaAndSelection |
|
1651 |
^ [ fileListView selection size > 0 |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1652 |
and:[JavaClassReader notNil |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1653 |
and:[JavaClassReader isLoaded]]] |
1942 | 1654 |
|
1655 |
"Modified: / 17.10.1998 / 16:57:14 / cg" |
|
1656 |
"Created: / 17.10.1998 / 22:58:03 / cg" |
|
1657 |
! |
|
1658 |
||
3001 | 1659 |
hasMP3Player |
1660 |
^ [ MP3PlayerApplication notNil |
|
1661 |
or:[SaugFix::MP3PlayerApplication notNil ]] |
|
1662 |
! |
|
1663 |
||
1664 |
hasMP3PlayerAndSelection |
|
1665 |
^ [ fileListView selection size > 0 |
|
1666 |
and:[ self hasMP3Player value]] |
|
1667 |
! |
|
1668 |
||
1834 | 1669 |
hasSelection |
1670 |
^ [fileListView selection size > 0] |
|
1671 |
||
1672 |
"Created: / 4.8.1998 / 14:10:31 / cg" |
|
1673 |
"Modified: / 4.8.1998 / 14:10:57 / cg" |
|
1674 |
! |
|
1675 |
||
2825
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1676 |
hasSnapshotSelection |
3627 | 1677 |
^ [ |fn| |
1678 |
||
2825
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1679 |
(fileListView selection size == 1) |
3627 | 1680 |
and:[ ((fn := fileListView selectionValue first string withoutSeparators asFilename) hasSuffix:'img') |
1681 |
or:[fn hasSuffix:'sav'] ] |
|
2825
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1682 |
] |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1683 |
|
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1684 |
"Created: / 4.8.1998 / 14:10:31 / cg" |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1685 |
"Modified: / 4.8.1998 / 14:10:57 / cg" |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1686 |
! |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1687 |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1688 |
hasVisitHistory |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1689 |
^ [DirectoryHistory size > 0] |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1690 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1691 |
"Created: / 14.8.1998 / 19:17:02 / cg" |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1692 |
"Modified: / 14.8.1998 / 19:17:17 / cg" |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1693 |
! |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1694 |
|
1853 | 1695 |
hasZipFileSelected |
1988 | 1696 |
^ [|sel f fn suff| |
1697 |
||
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1698 |
sel := fileListView selection. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1699 |
sel size == 1 ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1700 |
f := fileList at:sel first ifAbsent:nil. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1701 |
f notNil ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1702 |
suff := f asFilename suffix asLowercase. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1703 |
suff = 'zip' or:[suff = 'jar'] |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1704 |
] ifFalse:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1705 |
false |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1706 |
] |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1707 |
] ifFalse:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1708 |
false |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1709 |
] |
1853 | 1710 |
] |
1711 |
||
1712 |
"Created: / 26.8.1998 / 16:15:26 / cg" |
|
1988 | 1713 |
"Modified: / 30.1.1999 / 19:05:59 / cg" |
1853 | 1714 |
! |
1715 |
||
1893
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
1716 |
javaSupportLoaded |
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
1717 |
^ [ JavaClassReader notNil |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1718 |
and:[JavaClassReader isLoaded]] |
1893
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
1719 |
|
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
1720 |
"Created: / 9.11.1998 / 05:33:17 / cg" |
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
1721 |
! |
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
1722 |
|
2031 | 1723 |
showingBigImagePreview |
1724 |
^ showingBigImagePreview |
|
1725 |
||
1726 |
"Created: / 14.8.1998 / 14:15:44 / cg" |
|
1727 |
! |
|
1728 |
||
1834 | 1729 |
showingDetails |
1730 |
^ showingDetails |
|
1731 |
||
1732 |
"Created: / 14.8.1998 / 14:15:15 / cg" |
|
1733 |
! |
|
1734 |
||
1735 |
showingHiddenFiles |
|
1736 |
^ showingHiddenFiles |
|
1737 |
||
1738 |
"Created: / 14.8.1998 / 14:15:44 / cg" |
|
1739 |
! |
|
1740 |
||
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1741 |
showingTimeAndDate |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1742 |
^ showingTimeAndDate |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1743 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1744 |
"Created: / 14.8.1998 / 14:15:44 / cg" |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1745 |
! |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1746 |
|
2567
dd029fea485d
added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents:
2562
diff
changeset
|
1747 |
singleSelectedFile |
dd029fea485d
added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents:
2562
diff
changeset
|
1748 |
|f sel| |
dd029fea485d
added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents:
2562
diff
changeset
|
1749 |
|
dd029fea485d
added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents:
2562
diff
changeset
|
1750 |
sel := fileListView selection. |
dd029fea485d
added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents:
2562
diff
changeset
|
1751 |
sel size ~~ 1 ifTrue:[ |
dd029fea485d
added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents:
2562
diff
changeset
|
1752 |
^ nil |
dd029fea485d
added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents:
2562
diff
changeset
|
1753 |
]. |
dd029fea485d
added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents:
2562
diff
changeset
|
1754 |
f := fileList at:sel first ifAbsent:nil. |
dd029fea485d
added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents:
2562
diff
changeset
|
1755 |
f notNil ifTrue:[ |
dd029fea485d
added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents:
2562
diff
changeset
|
1756 |
^ currentDirectory asFilename construct:f |
dd029fea485d
added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents:
2562
diff
changeset
|
1757 |
]. |
dd029fea485d
added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents:
2562
diff
changeset
|
1758 |
^ nil |
dd029fea485d
added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents:
2562
diff
changeset
|
1759 |
|
dd029fea485d
added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents:
2562
diff
changeset
|
1760 |
"Created: / 29.1.2000 / 13:09:09 / cg" |
dd029fea485d
added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents:
2562
diff
changeset
|
1761 |
! |
dd029fea485d
added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents:
2562
diff
changeset
|
1762 |
|
2368 | 1763 |
singleSelectedFileOrCurrentDirectory |
1764 |
|f sel| |
|
1765 |
||
1766 |
sel := fileListView selection. |
|
1767 |
sel size > 1 ifTrue:[ |
|
1768 |
^ nil |
|
1769 |
]. |
|
1770 |
sel size == 0 ifTrue:[ |
|
1771 |
^ currentDirectory asFilename |
|
1772 |
]. |
|
1773 |
f := fileList at:sel first ifAbsent:nil. |
|
1774 |
f notNil ifTrue:[ |
|
1775 |
^ currentDirectory asFilename construct:f |
|
1776 |
]. |
|
1777 |
^ nil |
|
1778 |
! |
|
1779 |
||
1834 | 1780 |
sortByWhat |
1781 |
^ sortByWhat |
|
1782 |
||
1783 |
"Created: / 14.8.1998 / 15:55:18 / cg" |
|
1784 |
"Modified: / 14.8.1998 / 15:56:08 / cg" |
|
1785 |
! |
|
1786 |
||
1787 |
sortCaseless |
|
1788 |
^ sortCaseless |
|
1789 |
||
1790 |
"Created: / 14.8.1998 / 14:21:21 / cg" |
|
1791 |
! |
|
1792 |
||
1793 |
systemIsDOS |
|
1794 |
^ OperatingSystem isMSDOSlike |
|
1795 |
||
1796 |
"Created: / 4.8.1998 / 13:37:28 / cg" |
|
1797 |
! |
|
1798 |
||
1799 |
systemIsUnix |
|
1800 |
^ OperatingSystem isUNIXlike |
|
1801 |
||
1802 |
"Created: / 4.8.1998 / 13:37:13 / cg" |
|
1803 |
! |
|
1804 |
||
1805 |
systemIsVMS |
|
1806 |
^ OperatingSystem isVMSlike |
|
1807 |
||
1808 |
"Created: / 4.8.1998 / 13:37:37 / cg" |
|
1809 |
! ! |
|
1810 |
||
1119 | 1811 |
!FileBrowser methodsFor:'drag & drop'! |
172 | 1812 |
|
1132
bd2eda432e1d
drop arg is always a collection
Claus Gittinger <cg@exept.de>
parents:
1124
diff
changeset
|
1813 |
canDrop:aCollectionOfDropObjects |
1119 | 1814 |
"I accept fileObjects only" |
1815 |
||
1132
bd2eda432e1d
drop arg is always a collection
Claus Gittinger <cg@exept.de>
parents:
1124
diff
changeset
|
1816 |
aCollectionOfDropObjects do:[:aDropObject | |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1817 |
aDropObject isFileObject ifFalse:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1818 |
aDropObject isTextObject ifFalse:[^ false]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1819 |
] |
1122
970fc7e88639
support drag out of my list.
Claus Gittinger <cg@exept.de>
parents:
1120
diff
changeset
|
1820 |
]. |
1132
bd2eda432e1d
drop arg is always a collection
Claus Gittinger <cg@exept.de>
parents:
1124
diff
changeset
|
1821 |
^ true |
bd2eda432e1d
drop arg is always a collection
Claus Gittinger <cg@exept.de>
parents:
1124
diff
changeset
|
1822 |
|
bd2eda432e1d
drop arg is always a collection
Claus Gittinger <cg@exept.de>
parents:
1124
diff
changeset
|
1823 |
"Modified: 11.4.1997 / 12:41:59 / cg" |
1118 | 1824 |
! |
1825 |
||
1132
bd2eda432e1d
drop arg is always a collection
Claus Gittinger <cg@exept.de>
parents:
1124
diff
changeset
|
1826 |
drop:aCollectionOfDropObjects at:aPoint |
1122
970fc7e88639
support drag out of my list.
Claus Gittinger <cg@exept.de>
parents:
1120
diff
changeset
|
1827 |
"handle drops" |
970fc7e88639
support drag out of my list.
Claus Gittinger <cg@exept.de>
parents:
1120
diff
changeset
|
1828 |
|
3061 | 1829 |
"/ for now ... only allow single drop |
1830 |
aCollectionOfDropObjects size > 1 ifTrue:[ |
|
1831 |
(self confirm:'Drop the last file only ?') ifFalse:[ |
|
1832 |
^ self |
|
1833 |
]. |
|
1834 |
self dropSingleObject:aCollectionOfDropObjects first at:aPoint. |
|
1835 |
^ self |
|
1836 |
]. |
|
3045 | 1837 |
|
1132
bd2eda432e1d
drop arg is always a collection
Claus Gittinger <cg@exept.de>
parents:
1124
diff
changeset
|
1838 |
aCollectionOfDropObjects do:[:aDropObject | |
3045 | 1839 |
self dropSingleObject:aDropObject at:aPoint |
1132
bd2eda432e1d
drop arg is always a collection
Claus Gittinger <cg@exept.de>
parents:
1124
diff
changeset
|
1840 |
] |
bd2eda432e1d
drop arg is always a collection
Claus Gittinger <cg@exept.de>
parents:
1124
diff
changeset
|
1841 |
|
bd2eda432e1d
drop arg is always a collection
Claus Gittinger <cg@exept.de>
parents:
1124
diff
changeset
|
1842 |
"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
|
1843 |
! |
970fc7e88639
support drag out of my list.
Claus Gittinger <cg@exept.de>
parents:
1120
diff
changeset
|
1844 |
|
970fc7e88639
support drag out of my list.
Claus Gittinger <cg@exept.de>
parents:
1120
diff
changeset
|
1845 |
dropSingleObject:someObject at:aPoint |
1119 | 1846 |
"handle drops; if its a directory, change to it. |
1124 | 1847 |
If its a file, change to its directory and select the file. |
1848 |
If its text, paste it into the codeView." |
|
1119 | 1849 |
|
1122
970fc7e88639
support drag out of my list.
Claus Gittinger <cg@exept.de>
parents:
1120
diff
changeset
|
1850 |
|newDir newFile| |
970fc7e88639
support drag out of my list.
Claus Gittinger <cg@exept.de>
parents:
1120
diff
changeset
|
1851 |
|
1124 | 1852 |
someObject isFileObject ifTrue:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1853 |
someObject isDirectory ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1854 |
newDir := someObject theObject pathName. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1855 |
] ifFalse:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1856 |
newDir := someObject theObject directoryName. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1857 |
newFile := someObject theObject baseName. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1858 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1859 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1860 |
newDir notNil ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1861 |
newDir ~= currentDirectory pathName ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1862 |
self changeDirectoryTo:newDir. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1863 |
] |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1864 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1865 |
newFile notNil ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1866 |
newFile ~= currentFileName ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1867 |
fileListView selection:(fileList indexOf:newFile). |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1868 |
self doFileGet:false. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1869 |
] |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1870 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1871 |
^ self |
1122
970fc7e88639
support drag out of my list.
Claus Gittinger <cg@exept.de>
parents:
1120
diff
changeset
|
1872 |
]. |
970fc7e88639
support drag out of my list.
Claus Gittinger <cg@exept.de>
parents:
1120
diff
changeset
|
1873 |
|
1124 | 1874 |
someObject isTextObject ifTrue:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1875 |
subView paste:someObject theObject. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1876 |
^ self |
1118 | 1877 |
]. |
1124 | 1878 |
|
1879 |
"Modified: 6.4.1997 / 14:46:44 / cg" |
|
1119 | 1880 |
! ! |
1881 |
||
1882 |
!FileBrowser methodsFor:'events'! |
|
1118 | 1883 |
|
1010 | 1884 |
handlesKeyPress:key inView:view |
1885 |
"this method is reached via delegation: are we prepared to handle |
|
1886 |
a keyPress in some other view ?" |
|
1887 |
||
2669
677ca47d8d11
cursor-right --> change to previous directory
Claus Gittinger <cg@exept.de>
parents:
2666
diff
changeset
|
1888 |
<resource: #keyboard (#GotoLine #InspectIt #CmdI #Cmdu |
677ca47d8d11
cursor-right --> change to previous directory
Claus Gittinger <cg@exept.de>
parents:
2666
diff
changeset
|
1889 |
#DoIt #Delete #BackSpace #Accept #CmdF #CmdD |
677ca47d8d11
cursor-right --> change to previous directory
Claus Gittinger <cg@exept.de>
parents:
2666
diff
changeset
|
1890 |
#CursorLeft #CursorRight |
677ca47d8d11
cursor-right --> change to previous directory
Claus Gittinger <cg@exept.de>
parents:
2666
diff
changeset
|
1891 |
)> |
1010 | 1892 |
|
1893 |
view == fileListView ifTrue:[ |
|
2543 | 1894 |
(key == #Delete |
1895 |
or:[key == #BackSpace |
|
1896 |
or:[key == #Accept |
|
1897 |
or:[key == #CmdI |
|
1898 |
or:[key == #CmdF |
|
1899 |
or:[key == #CmdD |
|
1900 |
or:[key == #Cmdu |
|
1901 |
or:[key == #Cut |
|
1902 |
or:[key == #Cmdr |
|
1903 |
or:[key == #Replace |
|
1904 |
or:[key == #InspectIt |
|
1905 |
or:[key == #GotoLine |
|
2665
3601bc8c5ae2
cursorLeft - change to parent dir
Claus Gittinger <cg@exept.de>
parents:
2640
diff
changeset
|
1906 |
or:[key == #CursorLeft |
2669
677ca47d8d11
cursor-right --> change to previous directory
Claus Gittinger <cg@exept.de>
parents:
2666
diff
changeset
|
1907 |
or:[key == #CursorRight |
677ca47d8d11
cursor-right --> change to previous directory
Claus Gittinger <cg@exept.de>
parents:
2666
diff
changeset
|
1908 |
or:[key == #DoIt]]]]]]]]]]]]]]) ifTrue:[^ true]. |
1010 | 1909 |
]. |
1910 |
^ false |
|
1911 |
||
1396 | 1912 |
"Created: / 28.1.1997 / 14:03:20 / stefan" |
1913 |
"Modified: / 20.6.1997 / 16:35:01 / cg" |
|
1914 |
"Modified: / 16.1.1998 / 16:50:39 / stefan" |
|
1010 | 1915 |
! |
1916 |
||
1917 |
keyPress:key x:x y:y view:view |
|
1918 |
"this method is reached via delegation from the fileListView" |
|
1919 |
||
2543 | 1920 |
<resource: #keyboard (#GotoLine #InspectIt |
1921 |
#CmdI #Cmdu #DoIt #Delete #BackSpace #Accept |
|
2669
677ca47d8d11
cursor-right --> change to previous directory
Claus Gittinger <cg@exept.de>
parents:
2666
diff
changeset
|
1922 |
#Cmdr #Cut #CursorLeft #CursorRight)> |
2543 | 1923 |
|
1924 |
(key == #Delete |
|
1925 |
or:[key == #Cut |
|
1926 |
or:[key == #BackSpace]]) ifTrue:[ |
|
1927 |
self fileRemove. |
|
1928 |
^ self |
|
1010 | 1929 |
]. |
1930 |
(key == #Accept) ifTrue:[ |
|
2543 | 1931 |
self fileFileIn. |
1932 |
^ self |
|
1010 | 1933 |
]. |
1934 |
(key == #GotoLine) ifTrue:[ |
|
2543 | 1935 |
self fileGet. |
1936 |
^ self |
|
1010 | 1937 |
]. |
1938 |
(key == #DoIt) ifTrue:[ |
|
2543 | 1939 |
self fileExecute. |
1940 |
^ self |
|
1010 | 1941 |
]. |
1942 |
(key == #InspectIt) ifTrue:[ |
|
2543 | 1943 |
self fileGetInfo. |
1944 |
^ self |
|
1010 | 1945 |
]. |
1946 |
(key == #CmdI) ifTrue:[ |
|
2543 | 1947 |
self fileGetLongInfo. |
1948 |
^ self |
|
1010 | 1949 |
]. |
1950 |
(key == #Cmdu) ifTrue:[ |
|
2543 | 1951 |
self updateCurrentDirectory. |
1952 |
^ self |
|
1396 | 1953 |
]. |
1954 |
(key == #CmdF) ifTrue:[ |
|
2543 | 1955 |
self newFile. |
1956 |
^ self |
|
1396 | 1957 |
]. |
1958 |
(key == #CmdD) ifTrue:[ |
|
2543 | 1959 |
self newDirectory. |
1960 |
^ self |
|
1961 |
]. |
|
1962 |
((key == #Cmdr) or:[key == #Replace]) ifTrue:[ |
|
1963 |
self fileRename. |
|
1964 |
^ self |
|
1010 | 1965 |
]. |
2665
3601bc8c5ae2
cursorLeft - change to parent dir
Claus Gittinger <cg@exept.de>
parents:
2640
diff
changeset
|
1966 |
(key == #CursorLeft) ifTrue:[ |
3601bc8c5ae2
cursorLeft - change to parent dir
Claus Gittinger <cg@exept.de>
parents:
2640
diff
changeset
|
1967 |
self changeToParentDirectory. |
3601bc8c5ae2
cursorLeft - change to parent dir
Claus Gittinger <cg@exept.de>
parents:
2640
diff
changeset
|
1968 |
^ self |
3601bc8c5ae2
cursorLeft - change to parent dir
Claus Gittinger <cg@exept.de>
parents:
2640
diff
changeset
|
1969 |
]. |
2669
677ca47d8d11
cursor-right --> change to previous directory
Claus Gittinger <cg@exept.de>
parents:
2666
diff
changeset
|
1970 |
(key == #CursorRight) ifTrue:[ |
677ca47d8d11
cursor-right --> change to previous directory
Claus Gittinger <cg@exept.de>
parents:
2666
diff
changeset
|
1971 |
self changeToPreviousDirectory. |
677ca47d8d11
cursor-right --> change to previous directory
Claus Gittinger <cg@exept.de>
parents:
2666
diff
changeset
|
1972 |
^ self |
677ca47d8d11
cursor-right --> change to previous directory
Claus Gittinger <cg@exept.de>
parents:
2666
diff
changeset
|
1973 |
]. |
1010 | 1974 |
fileListView keyPress:key x:x y:y |
1975 |
||
1396 | 1976 |
"Created: / 28.1.1997 / 14:03:56 / stefan" |
1977 |
"Modified: / 20.6.1997 / 16:35:08 / cg" |
|
1978 |
"Modified: / 16.1.1998 / 16:51:38 / stefan" |
|
1010 | 1979 |
! |
1980 |
||
172 | 1981 |
mapped |
1982 |
super mapped. |
|
1983 |
" |
|
1984 |
whant to know about changed history |
|
1985 |
" |
|
1986 |
self updateCurrentDirectory |
|
1987 |
! |
|
1988 |
||
1989 |
visibilityChange:how |
|
1990 |
|wasVisible| |
|
1991 |
||
1992 |
wasVisible := shown. |
|
1993 |
super visibilityChange:how. |
|
1994 |
(wasVisible not and:[shown]) ifTrue:[ |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1995 |
" |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1996 |
start checking again |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1997 |
" |
3520
83cf11e1bf32
schedule checkBlock for the right process
Claus Gittinger <cg@exept.de>
parents:
3503
diff
changeset
|
1998 |
self scheduleCheckBlock. |
172 | 1999 |
] |
1481 | 2000 |
|
2001 |
"Modified: / 18.2.1998 / 17:57:44 / cg" |
|
172 | 2002 |
! ! |
2003 |
||
2004 |
!FileBrowser methodsFor:'fileList user interaction'! |
|
2005 |
||
2031 | 2006 |
bigImagePreviewSettingChanged |
2007 |
"invoked, when big image preview flag changed" |
|
2008 |
||
2009 |
|fh| |
|
2010 |
||
2011 |
(showingBigImagePreview value == true |
|
2012 |
and:[showingDetails value == true]) ifTrue:[ |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2013 |
fh := fileListView font height. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2014 |
fileListView lineSpacing:(34 - fh max:0). |
2031 | 2015 |
] ifFalse:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2016 |
fileListView clear. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2017 |
self updateCurrentDirectory. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2018 |
fileListView lineSpacing:2. |
2031 | 2019 |
]. |
2020 |
fileListView clear. |
|
2021 |
self updateCurrentDirectory |
|
2022 |
||
2023 |
"Modified: / 4.8.1998 / 13:43:54 / cg" |
|
2024 |
"Created: / 14.8.1998 / 14:17:49 / cg" |
|
2025 |
! |
|
2026 |
||
172 | 2027 |
changeDisplayMode |
2028 |
"toggle from long to short listing (and vice-versa)" |
|
2029 |
||
1834 | 2030 |
showingDetails value:(showingDetails value not). |
2031 |
"/ showLongList := showLongList not. |
|
1156
f3df28086973
dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents:
1154
diff
changeset
|
2032 |
self showOrHideTabView. |
172 | 2033 |
self updateCurrentDirectory |
747 | 2034 |
|
1834 | 2035 |
"Modified: / 4.8.1998 / 13:43:54 / cg" |
172 | 2036 |
! |
2037 |
||
2038 |
changeDotFileVisibility |
|
2039 |
"turn on/off visibility of files whose name starts with '.'" |
|
2040 |
||
1834 | 2041 |
showingHiddenFiles value:(showingHiddenFiles value not). |
2042 |
"/ showDotFiles := showDotFiles not. |
|
172 | 2043 |
self updateCurrentDirectory |
1834 | 2044 |
|
2045 |
"Modified: / 4.8.1998 / 13:45:46 / cg" |
|
2046 |
! |
|
2047 |
||
3281 | 2048 |
confirmAndRemove:fileNames |
2049 |
"remove fileNames with user confirmation. |
|
2050 |
TODO: Should be enhanced, to look for a ~/.trash directory |
|
2051 |
and move files there if it exists (without asking in this case)." |
|
2052 |
||
2053 |
|q doRemove| |
|
2054 |
||
2055 |
"/ do not ask, if shift is pressed |
|
2056 |
fileNames size > 1 ifTrue:[ |
|
2057 |
q := resources string:'Remove %1 selected files ?' with:(fileNames size). |
|
2058 |
doRemove := Dialog |
|
2059 |
confirmWithCancel:q |
|
2060 |
labels:(resources array:#('Cancel' 'Confirm Each' 'Remove')) |
|
2061 |
values:#(false #confirm true) |
|
2062 |
default:3. |
|
2063 |
doRemove isNil ifTrue:[^ self]. |
|
2064 |
doRemove == #confirm ifTrue:[ |
|
2065 |
fileNames do:[:eachFileName | |
|
2066 |
self confirmAndRemove:(Array with:eachFileName). |
|
2067 |
]. |
|
2068 |
^ self. |
|
2069 |
]. |
|
2070 |
] ifFalse:[ |
|
2071 |
q := resources string:'Remove ''%1'' ?' with:(fileNames first allBold). |
|
2072 |
doRemove := self ask:q yesButton:'Remove'. |
|
2073 |
]. |
|
2074 |
||
2075 |
doRemove ifTrue:[ |
|
2076 |
self doRemove:fileNames |
|
2077 |
] |
|
2078 |
! |
|
2079 |
||
1834 | 2080 |
detailsSettingChanged |
2081 |
"invoked, when detail (i.e. long / short) listing flag changed" |
|
2082 |
||
2083 |
self showOrHideTabView. |
|
2031 | 2084 |
self bigImagePreviewSettingChanged |
1834 | 2085 |
|
2086 |
"Modified: / 4.8.1998 / 13:43:54 / cg" |
|
2087 |
"Created: / 14.8.1998 / 14:17:49 / cg" |
|
172 | 2088 |
! |
2089 |
||
1327 | 2090 |
fileDoubleClick:lineNr |
2091 |
"double click on a file - get its contents" |
|
2092 |
||
2093 |
self fileSelect:lineNr. |
|
2094 |
self fileGet:true |
|
2095 |
! |
|
2096 |
||
386
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
2097 |
fileEncoding |
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
2098 |
"open a dialog to allow change of the files character encoding. |
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
2099 |
Files are converted to internal encoding when read, and converted back |
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
2100 |
to this encoding when saved. |
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
2101 |
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
|
2102 |
the internal encoding (which is iso8859). |
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
2103 |
Notice: currently, not too many encodings are supported by the system." |
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
2104 |
|
495
6d6a6b8feb2b
ask characterArray for encodings
Claus Gittinger <cg@exept.de>
parents:
488
diff
changeset
|
2105 |
|dialog list descr encodings encodingNames idx| |
386
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
2106 |
|
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
2107 |
list := SelectionInList new. |
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
2108 |
|
495
6d6a6b8feb2b
ask characterArray for encodings
Claus Gittinger <cg@exept.de>
parents:
488
diff
changeset
|
2109 |
descr := CharacterArray supportedExternalEncodings. |
6d6a6b8feb2b
ask characterArray for encodings
Claus Gittinger <cg@exept.de>
parents:
488
diff
changeset
|
2110 |
encodings := descr at:2. |
6d6a6b8feb2b
ask characterArray for encodings
Claus Gittinger <cg@exept.de>
parents:
488
diff
changeset
|
2111 |
encodingNames := descr at:1. |
6d6a6b8feb2b
ask characterArray for encodings
Claus Gittinger <cg@exept.de>
parents:
488
diff
changeset
|
2112 |
|
6d6a6b8feb2b
ask characterArray for encodings
Claus Gittinger <cg@exept.de>
parents:
488
diff
changeset
|
2113 |
list list:encodingNames. |
386
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
2114 |
list selectionIndex:(encodings indexOf:fileEncoding ifAbsent:1). |
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
2115 |
|
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
2116 |
dialog := Dialog new. |
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
2117 |
|
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
2118 |
dialog addTextLabel:(resources string:'ENCODING_MSG') withCRs. |
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
2119 |
dialog addVerticalSpace. |
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
2120 |
dialog addListBoxOn:list withNumberOfLines:5. |
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
2121 |
|
2048 | 2122 |
dialog addAbortAndOkButtons. |
386
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
2123 |
dialog open. |
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
2124 |
|
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
2125 |
dialog accepted ifTrue:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2126 |
idx := list selectionIndex. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2127 |
fileEncoding := encodings at:idx. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2128 |
subView externalEncoding:fileEncoding. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2129 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2130 |
self validateFontEncodingFor:fileEncoding ask:true. |
386
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
2131 |
]. |
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
2132 |
|
1219 | 2133 |
"Modified: 30.6.1997 / 14:41:12 / cg" |
386
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
2134 |
! |
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
2135 |
|
172 | 2136 |
fileExecute |
2137 |
"if text was modified show a queryBox, |
|
2138 |
otherwise pop up execute box immediately" |
|
2139 |
||
1142
9066d7d02a3a
remember last executed command per suffix; offer this as default.
Claus Gittinger <cg@exept.de>
parents:
1141
diff
changeset
|
2140 |
|action sel fileName| |
172 | 2141 |
|
2142 |
" |
|
2143 |
this replaces everything by the commands output ... |
|
2144 |
" |
|
865
48395e8ecca9
remember executeCommand actions in history as well.
Claus Gittinger <cg@exept.de>
parents:
851
diff
changeset
|
2145 |
action := [:command | |
3252 | 2146 |
self class addToCommandHistory:command for:fileName. |
2147 |
self doExecuteCommand:command replace:true |
|
2148 |
]. |
|
2149 |
||
2150 |
(self askIfModified:'Contents has not been saved.\\Modifications will be lost when command is executed.' |
|
2151 |
yesButton:'Execute') ifFalse:[^ self]. |
|
172 | 2152 |
|
2153 |
"/ " |
|
2154 |
"/ this inserts the commands output ... |
|
2155 |
"/ " |
|
2156 |
"/ action := [:command| self doExecuteCommand:command replace:false]. |
|
2157 |
"/ |
|
1142
9066d7d02a3a
remember last executed command per suffix; offer this as default.
Claus Gittinger <cg@exept.de>
parents:
1141
diff
changeset
|
2158 |
|
9066d7d02a3a
remember last executed command per suffix; offer this as default.
Claus Gittinger <cg@exept.de>
parents:
1141
diff
changeset
|
2159 |
sel := fileListView selection. |
9066d7d02a3a
remember last executed command per suffix; offer this as default.
Claus Gittinger <cg@exept.de>
parents:
1141
diff
changeset
|
2160 |
sel size == 1 ifTrue:[ |
3252 | 2161 |
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
|
2162 |
]. |
9066d7d02a3a
remember last executed command per suffix; offer this as default.
Claus Gittinger <cg@exept.de>
parents:
1141
diff
changeset
|
2163 |
self askForCommandFor:fileName thenDo:action |
865
48395e8ecca9
remember executeCommand actions in history as well.
Claus Gittinger <cg@exept.de>
parents:
851
diff
changeset
|
2164 |
|
48395e8ecca9
remember executeCommand actions in history as well.
Claus Gittinger <cg@exept.de>
parents:
851
diff
changeset
|
2165 |
"Modified: 14.11.1996 / 14:59:34 / cg" |
172 | 2166 |
! |
2167 |
||
2168 |
fileFileIn |
|
2169 |
"fileIn the selected file(s)" |
|
2170 |
||
2171 |
self fileFileInLazy:false |
|
2172 |
! |
|
2173 |
||
2174 |
fileFileInLazy |
|
2175 |
"fileIn the selected file(s). Do a quick load (no compilation)" |
|
2176 |
||
2177 |
self fileFileInLazy:true |
|
2178 |
! |
|
2179 |
||
2180 |
fileFileInLazy:lazy |
|
2181 |
"fileIn the selected file(s)" |
|
2182 |
||
3478 | 2183 |
|aStream path wasLazy prevCurrentFileName| |
172 | 2184 |
|
2185 |
self selectedFilesDo:[:fileName | |
|
2430 | 2186 |
path := currentDirectory filenameFor:fileName. |
2187 |
path type == #regular ifTrue:[ |
|
2188 |
prevCurrentFileName := currentFileInFileName. |
|
2189 |
currentFileInFileName := fileName. |
|
2190 |
||
2191 |
(ObjectFileLoader notNil |
|
2192 |
and:[ObjectFileLoader hasValidBinaryExtension:fileName]) ifTrue:[ |
|
3436
c4fe19deba58
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3421
diff
changeset
|
2193 |
AbortOperationRequest catch:[ |
2430 | 2194 |
|p| |
2195 |
||
2196 |
"/ |
|
2197 |
"/ look if already loaded ... then unload first |
|
2198 |
"/ |
|
2199 |
p := path pathName. |
|
2200 |
(ObjectFileLoader loadedObjectFiles includes:p) ifTrue:[ |
|
2201 |
(Dialog confirm:(resources |
|
2202 |
string:'%1 is already loaded; load anyway ?' |
|
2203 |
with:p)) ifFalse:[ |
|
2204 |
^ self |
|
2205 |
]. |
|
2206 |
Transcript showCR:'unloading old ' , p , ' ...'. |
|
2207 |
ObjectFileLoader unloadObjectFile:p. |
|
2208 |
]. |
|
2209 |
||
2210 |
Transcript showCR:'loading ' , p , ' ...'. |
|
2211 |
ObjectFileLoader loadObjectFile:p. |
|
2212 |
Class addInfoRecord:('fileIn ' , fileName) |
|
2213 |
] |
|
3478 | 2214 |
] ifFalse:[ ((path hasSuffix:'cls') |
2215 |
and:[((path mimeTypeOfContents ? '') startsWith:'application/x-smalltalk-source') not ]) ifTrue:[ |
|
2640 | 2216 |
"/ loading a binary class file |
2217 |
aStream := path readStream. |
|
2218 |
aStream notNil ifTrue:[ |
|
3404 | 2219 |
aStream fileInBinary. |
2640 | 2220 |
] |
2430 | 2221 |
] ifFalse:[ |
2640 | 2222 |
((path hasSuffix:'class') |
2223 |
or:[(path hasSuffix:'cla')]) ifTrue:[ |
|
2224 |
"/ loading a java class file |
|
2225 |
JavaClassReader notNil ifTrue:[ |
|
2226 |
JavaClassReader loadFile:(path pathName) |
|
2227 |
] |
|
2228 |
] ifFalse:[ (path hasSuffix:'sif') ifTrue:[ |
|
2229 |
"/ loading a sif (smalltalk interchange format) file |
|
3523 | 2230 |
SmalltalkInterchangeSTXFileInManager autoload. |
2640 | 2231 |
SmalltalkInterchangeFileManager newForFileIn |
2232 |
fileName: path pathName; |
|
2233 |
fileIn. |
|
3342 | 2234 |
] ifFalse:[ (path hasSuffix:'pcl') ifTrue:[ |
2235 |
Parcel isNil ifTrue:[ |
|
2236 |
self warn:'Parcel support not loaded.' |
|
2237 |
] ifFalse:[ |
|
2238 |
Parcel loadParcelFrom: path pathName |
|
2239 |
] |
|
2640 | 2240 |
] ifFalse:[ |
2241 |
"/ loading a regular (chunk) or xml source file |
|
2430 | 2242 |
aStream := path readStream. |
2243 |
aStream notNil ifTrue:[ |
|
2640 | 2244 |
[ |
2245 |
Class withoutUpdatingChangesDo:[ |
|
2246 |
wasLazy := Compiler compileLazy:lazy. |
|
2247 |
aStream fileIn. |
|
2430 | 2248 |
]. |
2640 | 2249 |
Class addInfoRecord:('fileIn ' , fileName) |
3596
9761af1f3f72
#valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents:
3568
diff
changeset
|
2250 |
] ensure:[ |
2640 | 2251 |
Compiler compileLazy:wasLazy. |
2252 |
aStream close |
|
2430 | 2253 |
] |
2254 |
] |
|
3342 | 2255 |
]]] |
2640 | 2256 |
]] |
2430 | 2257 |
]. |
2258 |
currentFileInFileName := prevCurrentFileName |
|
172 | 2259 |
] |
2260 |
||
1702
962056a31c06
remember the current file during fileIn,
Claus Gittinger <cg@exept.de>
parents:
1700
diff
changeset
|
2261 |
"Modified: / 19.9.1997 / 23:42:22 / stefan" |
3436
c4fe19deba58
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3421
diff
changeset
|
2262 |
"Modified: / 16.11.2001 / 17:38:34 / cg" |
172 | 2263 |
! |
2264 |
||
3465
f52e089ca838
added fileIntoNameSpace menu item
Claus Gittinger <cg@exept.de>
parents:
3461
diff
changeset
|
2265 |
fileFileInToNameSpace |
f52e089ca838
added fileIntoNameSpace menu item
Claus Gittinger <cg@exept.de>
parents:
3461
diff
changeset
|
2266 |
"fileIn the selected file(s)<into a nameSpace" |
f52e089ca838
added fileIntoNameSpace menu item
Claus Gittinger <cg@exept.de>
parents:
3461
diff
changeset
|
2267 |
|
f52e089ca838
added fileIntoNameSpace menu item
Claus Gittinger <cg@exept.de>
parents:
3461
diff
changeset
|
2268 |
|ns| |
f52e089ca838
added fileIntoNameSpace menu item
Claus Gittinger <cg@exept.de>
parents:
3461
diff
changeset
|
2269 |
|
f52e089ca838
added fileIntoNameSpace menu item
Claus Gittinger <cg@exept.de>
parents:
3461
diff
changeset
|
2270 |
ns := Dialog request:'Default NameSpace for fileIn ?'. |
f52e089ca838
added fileIntoNameSpace menu item
Claus Gittinger <cg@exept.de>
parents:
3461
diff
changeset
|
2271 |
ns isEmptyOrNil ifTrue:[^ self]. |
f52e089ca838
added fileIntoNameSpace menu item
Claus Gittinger <cg@exept.de>
parents:
3461
diff
changeset
|
2272 |
ns := NameSpace name:ns. |
f52e089ca838
added fileIntoNameSpace menu item
Claus Gittinger <cg@exept.de>
parents:
3461
diff
changeset
|
2273 |
Class nameSpaceQuerySignal |
f52e089ca838
added fileIntoNameSpace menu item
Claus Gittinger <cg@exept.de>
parents:
3461
diff
changeset
|
2274 |
answer:ns |
f52e089ca838
added fileIntoNameSpace menu item
Claus Gittinger <cg@exept.de>
parents:
3461
diff
changeset
|
2275 |
do:[ self fileFileInLazy:false ] |
f52e089ca838
added fileIntoNameSpace menu item
Claus Gittinger <cg@exept.de>
parents:
3461
diff
changeset
|
2276 |
! |
f52e089ca838
added fileIntoNameSpace menu item
Claus Gittinger <cg@exept.de>
parents:
3461
diff
changeset
|
2277 |
|
1972 | 2278 |
fileFindAllDuplicates |
2279 |
"scan directory and all subdirs for duplicate files" |
|
2280 |
||
2281 |
|fileNames dir infoDir filesBySize |
|
2282 |
result info dirPrefix| |
|
2283 |
||
2284 |
(self askIfModified:'contents has not been saved.\\Modifications will be lost when you proceed.' |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2285 |
yesButton:'proceed') ifFalse:[^ self]. |
1972 | 2286 |
|
2287 |
self withWaitCursorDo:[ |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2288 |
result := Dictionary new. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2289 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2290 |
dir := currentDirectory asFilename. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2291 |
self label:myName , '- gathering file names ...'. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2292 |
fileNames := dir recursiveDirectoryContents. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2293 |
fileNames := fileNames collect:[:fn | dir construct:fn]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2294 |
fileNames := fileNames select:[:fn | fn isDirectory not]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2295 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2296 |
self label:myName , '- gathering sizes ...'. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2297 |
infoDir := Dictionary new. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2298 |
fileNames do:[:fn | |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2299 |
infoDir at:fn put:(fn fileSize) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2300 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2301 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2302 |
"/ for each, get the files size. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2303 |
"/ in a first pass, look for files of the same size and |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2304 |
"/ compare them ... |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2305 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2306 |
self label:myName , '- preselect possible duplicates ...'. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2307 |
filesBySize := Dictionary new. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2308 |
infoDir keysAndValuesDo:[:fn :sz | |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2309 |
|entry| |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2310 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2311 |
entry := filesBySize at:sz ifAbsentPut:[Set new]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2312 |
entry add:fn. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2313 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2314 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2315 |
"/ any of same size ? |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2316 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2317 |
self label:myName , '- checking for duplicates ...'. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2318 |
filesBySize do:[:entry | |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2319 |
|files| |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2320 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2321 |
entry size > 1 ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2322 |
files := entry asArray. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2323 |
1 to:files size-1 do:[:idx1 | |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2324 |
idx1+1 to:files size do:[:idx2 | |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2325 |
|fn1 fn2| |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2326 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2327 |
fn1 := files at:idx1. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2328 |
fn2 := files at:idx2. |
1972 | 2329 |
|
2330 |
"/ self label:myName , '- checking ' , fn1 baseName , ' vs. ' , fn2 baseName , ' ...'. |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2331 |
(result at:fn2 ifAbsent:nil) ~= fn1 ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2332 |
"/ compare the files |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2333 |
(fn1 sameContentsAs:fn2) ifTrue:[ |
1972 | 2334 |
"/ Transcript show:'Same: '; show:fn1 baseName; show:' and '; showCR:fn2 baseName. |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2335 |
result at:fn1 put:fn2. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2336 |
] |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2337 |
] |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2338 |
] |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2339 |
] |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2340 |
] |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2341 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2342 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2343 |
self label:myName , '- sorting ...'. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2344 |
dirPrefix := currentDirectory asFilename pathName. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2345 |
result := result associations. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2346 |
result := result collect:[:assoc | |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2347 |
|f1 f2| |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2348 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2349 |
f1 := assoc key name. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2350 |
f2 := assoc value name. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2351 |
(f1 startsWith:dirPrefix) ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2352 |
f1 := f1 copyFrom:dirPrefix size + 2. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2353 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2354 |
(f2 startsWith:dirPrefix) ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2355 |
f2 := f2 copyFrom:dirPrefix size + 2. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2356 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2357 |
f1 < f2 ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2358 |
f2 -> f1 |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2359 |
] ifFalse:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2360 |
f1 -> f2 |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2361 |
] |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2362 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2363 |
result sort:[:f1 :f2 | f2 value < f1 value]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2364 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2365 |
info := OrderedCollection new. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2366 |
result do:[:assoc | |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2367 |
info add:(assoc key , ' same as ' , assoc value) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2368 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2369 |
info isEmpty ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2370 |
info := 'No duplicate files found.' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2371 |
]. |
1972 | 2372 |
]. |
2373 |
||
2374 |
subView contents:info. |
|
2375 |
self label:myName. |
|
2376 |
||
2377 |
"Created: / 28.11.1998 / 17:47:53 / cg" |
|
2378 |
"Modified: / 10.12.1998 / 17:13:14 / cg" |
|
2379 |
! |
|
2380 |
||
1911
6d1b77eda98f
check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents:
1903
diff
changeset
|
2381 |
fileFindDuplicates |
6d1b77eda98f
check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents:
1903
diff
changeset
|
2382 |
"scan directory for duplicate files" |
6d1b77eda98f
check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents:
1903
diff
changeset
|
2383 |
|
6d1b77eda98f
check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents:
1903
diff
changeset
|
2384 |
|fileNames dir infoDir filesBySize |
6d1b77eda98f
check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents:
1903
diff
changeset
|
2385 |
result info| |
6d1b77eda98f
check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents:
1903
diff
changeset
|
2386 |
|
6d1b77eda98f
check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents:
1903
diff
changeset
|
2387 |
(self askIfModified:'contents has not been saved.\\Modifications will be lost when you proceed.' |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2388 |
yesButton:'proceed') ifFalse:[^ self]. |
1911
6d1b77eda98f
check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents:
1903
diff
changeset
|
2389 |
|
6d1b77eda98f
check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents:
1903
diff
changeset
|
2390 |
self withWaitCursorDo:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2391 |
result := Dictionary new. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2392 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2393 |
dir := currentDirectory asFilename. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2394 |
fileNames := dir directoryContents. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2395 |
fileNames := fileNames collect:[:fn | dir construct:fn]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2396 |
fileNames := fileNames select:[:fn | fn isDirectory not]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2397 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2398 |
infoDir := Dictionary new. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2399 |
fileNames do:[:fn | |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2400 |
infoDir at:fn put:(fn info) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2401 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2402 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2403 |
"/ for each, get the files size. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2404 |
"/ in a first pass, look for files of the same size and |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2405 |
"/ compare them ... |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2406 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2407 |
filesBySize := Dictionary new. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2408 |
infoDir keysAndValuesDo:[:fn :info | |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2409 |
|sz entry| |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2410 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2411 |
sz := info size. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2412 |
entry := filesBySize at:sz ifAbsentPut:[Set new]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2413 |
entry add:fn. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2414 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2415 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2416 |
"/ any of same size ? |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2417 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2418 |
filesBySize do:[:entry | |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2419 |
|files| |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2420 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2421 |
entry size > 1 ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2422 |
files := entry asArray. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2423 |
1 to:files size-1 do:[:idx1 | |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2424 |
idx1+1 to:files size do:[:idx2 | |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2425 |
|fn1 fn2| |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2426 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2427 |
fn1 := files at:idx1. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2428 |
fn2 := files at:idx2. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2429 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2430 |
(result at:fn2 ifAbsent:nil) ~= fn1 ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2431 |
"/ compare the files |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2432 |
(fn1 sameContentsAs:fn2) ifTrue:[ |
1911
6d1b77eda98f
check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents:
1903
diff
changeset
|
2433 |
"/ Transcript show:'Same: '; show:fn1 baseName; show:' and '; showCR:fn2 baseName. |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2434 |
result at:fn1 put:fn2. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2435 |
] |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2436 |
] |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2437 |
] |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2438 |
] |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2439 |
] |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2440 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2441 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2442 |
result := result associations. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2443 |
result := result collect:[:assoc | |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2444 |
|f1 f2| |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2445 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2446 |
f1 := assoc key baseName. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2447 |
f2 := assoc value baseName. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2448 |
f1 < f2 ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2449 |
f2 -> f1 |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2450 |
] ifFalse:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2451 |
f1 -> f2 |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2452 |
] |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2453 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2454 |
result sort:[:f1 :f2 | f2 value < f1 value]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2455 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2456 |
info := OrderedCollection new. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2457 |
result do:[:assoc | |
3556 | 2458 |
|fn1 fn2| |
2459 |
||
2460 |
fn1 := assoc key. |
|
2461 |
fn2 := assoc value. |
|
2462 |
(fn1 includes:Character space) ifTrue:[ |
|
2463 |
fn1 := '"' , fn1 , '"' |
|
2464 |
]. |
|
2465 |
(fn2 includes:Character space) ifTrue:[ |
|
2466 |
fn2 := '"' , fn2 , '"' |
|
2467 |
]. |
|
2468 |
info add:(fn1 , ' same as ' , fn2) |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2469 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2470 |
info isEmpty ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2471 |
info := 'No duplicate files found.' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2472 |
]. |
1911
6d1b77eda98f
check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents:
1903
diff
changeset
|
2473 |
]. |
6d1b77eda98f
check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents:
1903
diff
changeset
|
2474 |
|
6d1b77eda98f
check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents:
1903
diff
changeset
|
2475 |
subView contents:info |
6d1b77eda98f
check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents:
1903
diff
changeset
|
2476 |
|
6d1b77eda98f
check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents:
1903
diff
changeset
|
2477 |
"Created: / 3.10.1998 / 17:59:00 / cg" |
1912 | 2478 |
"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
|
2479 |
! |
6d1b77eda98f
check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents:
1903
diff
changeset
|
2480 |
|
1933 | 2481 |
fileFindFile |
1965 | 2482 |
|sel bindings |
1933 | 2483 |
namePatternHolder contentsPatternHolder |
2484 |
ignoreCaseInName ignoreCaseInContents |
|
2166
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2485 |
namePattern namePatterns contentsPattern |
1965 | 2486 |
searchForSameContentsEnabled searchForSameContents| |
1933 | 2487 |
|
2488 |
(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
|
2489 |
yesButton:'proceed') ifFalse:[^ self]. |
1933 | 2490 |
|
2491 |
subView contents:nil; scrollToTop. |
|
2492 |
||
2493 |
bindings := IdentityDictionary new. |
|
2494 |
bindings at:#namePatternHolder put:(namePatternHolder := '' asValue). |
|
2495 |
bindings at:#contentsPatternHolder put:(contentsPatternHolder := '' asValue). |
|
2496 |
bindings at:#ignoreCaseInName put:(ignoreCaseInName := false asValue). |
|
2497 |
bindings at:#ignoreCaseInContents put:(ignoreCaseInContents := false asValue). |
|
2498 |
||
1965 | 2499 |
searchForSameContentsEnabled := false. |
2500 |
sel := fileListView selectionValue. |
|
2501 |
sel size == 1 ifTrue:[ |
|
2166
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2502 |
searchForSameContentsEnabled := true. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2503 |
sel := sel first string withoutSeparators |
1965 | 2504 |
]. |
2505 |
bindings at:#searchForSameContentsEnabled put:(searchForSameContentsEnabled := searchForSameContentsEnabled asValue). |
|
2506 |
bindings at:#searchForSameContents put:(searchForSameContents := false asValue). |
|
2507 |
bindings at:#notSearchForSameContents put:(BlockValue forLogicalNot:searchForSameContents). |
|
2508 |
||
2509 |
||
1933 | 2510 |
(SimpleDialog new |
2166
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2511 |
openFor:self |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2512 |
interfaceSpec:(self class fileSearchDialogSpec) |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2513 |
withBindings:bindings) ifTrue:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2514 |
|
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2515 |
namePattern := namePatternHolder value. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2516 |
namePattern size == 0 ifTrue:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2517 |
namePatterns := nil |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2518 |
] ifFalse:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2519 |
ignoreCaseInName value ifTrue:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2520 |
namePattern := namePattern asLowercase |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2521 |
]. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2522 |
namePatterns := namePattern asCollectionOfSubstringsSeparatedBy:$; |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2523 |
]. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2524 |
contentsPattern := contentsPatternHolder value. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2525 |
contentsPattern size == 0 ifTrue:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2526 |
contentsPattern := nil |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2527 |
] ifFalse:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2528 |
ignoreCaseInContents value ifTrue:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2529 |
contentsPattern := contentsPattern asLowercase |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2530 |
] |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2531 |
]. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2532 |
|
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2533 |
self withWaitCursorDo:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2534 |
|stopSignal access myProcess lowerFrameView| |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2535 |
|
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2536 |
myProcess := Processor activeProcess. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2537 |
|
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2538 |
access := Semaphore forMutualExclusion name:'accessLock'. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2539 |
stopSignal := Signal new. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2540 |
|
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2541 |
" |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2542 |
The following is tricky: |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2543 |
the pauseToggle & killButton will |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2544 |
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
|
2545 |
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
|
2546 |
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
|
2547 |
" |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2548 |
|
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2549 |
commandView beInvisible. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2550 |
|
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2551 |
" |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2552 |
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
|
2553 |
" |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2554 |
killButton windowGroup:nil. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2555 |
|
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2556 |
" |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2557 |
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
|
2558 |
" |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2559 |
killButton label:(resources string:'stop'). |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2560 |
killButton raise; beVisible. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2561 |
|
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2562 |
" |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2563 |
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
|
2564 |
" |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2565 |
killButton |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2566 |
action:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2567 |
access critical:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2568 |
myProcess interruptWith:[stopSignal raiseRequest]. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2569 |
] |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2570 |
]. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2571 |
|
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2572 |
" |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2573 |
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
|
2574 |
" |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2575 |
killButton openAutonomous. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2576 |
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
|
2577 |
|
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2578 |
lowerFrameView := subView superView. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2579 |
|
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2580 |
[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2581 |
stopSignal catch:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2582 |
searchForSameContents value ifTrue:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2583 |
self |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2584 |
doFindFileNamed:namePatterns |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2585 |
ignoreCase:ignoreCaseInName value |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2586 |
containingString:nil |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2587 |
ignoreCaseInContents:ignoreCaseInContents value |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2588 |
sameContentsAsFile:(currentDirectory asFilename construct:sel) |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2589 |
sameContentsAs:nil |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2590 |
in:currentDirectory. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2591 |
] ifFalse:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2592 |
(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
|
2593 |
self |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2594 |
doFindFileNamed:namePatterns |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2595 |
ignoreCase:ignoreCaseInName value |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2596 |
containingString:contentsPattern |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2597 |
ignoreCaseInContents:ignoreCaseInContents value |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2598 |
sameContentsAsFile:nil |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2599 |
sameContentsAs:nil |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2600 |
in:currentDirectory. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2601 |
] |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2602 |
] |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2603 |
] |
3596
9761af1f3f72
#valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents:
3568
diff
changeset
|
2604 |
] ensure:[ |
2166
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2605 |
|wg| |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2606 |
|
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2607 |
self label:myName; iconLabel:myName. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2608 |
|
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2609 |
" |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2610 |
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
|
2611 |
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
|
2612 |
" |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2613 |
killButton beInvisible. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2614 |
|
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2615 |
commandView beVisible. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2616 |
|
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2617 |
" |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2618 |
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
|
2619 |
(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
|
2620 |
" |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2621 |
wg := killButton windowGroup. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2622 |
killButton windowGroup:nil. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2623 |
|
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2624 |
" |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2625 |
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
|
2626 |
" |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2627 |
wg notNil ifTrue:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2628 |
wg process terminate. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2629 |
]. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2630 |
" |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2631 |
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
|
2632 |
releases reference to thisContext earlier) |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2633 |
" |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2634 |
killButton action:nil. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2635 |
killButton label:(resources string:'kill'). |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2636 |
|
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2637 |
"/ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2638 |
"/ allow interaction with the codeView |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2639 |
"/ (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
|
2640 |
"/ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2641 |
lowerFrameView windowGroup:(self windowGroup). |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2642 |
]. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2643 |
|
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2644 |
]. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2645 |
self label:myName. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2646 |
currentFileName isNil ifTrue:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2647 |
subView modified:false. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2648 |
]. |
1933 | 2649 |
]. |
2650 |
||
2651 |
"Created: / 15.10.1998 / 11:32:57 / cg" |
|
2652 |
"Modified: / 15.10.1998 / 12:41:09 / cg" |
|
2653 |
! |
|
2654 |
||
172 | 2655 |
fileGet |
2656 |
"get contents of selected file into subView. |
|
2657 |
If text was modified show a queryBox, |
|
2658 |
otherwise get it immediately" |
|
2659 |
||
633
4630175ed31e
double click on .htm / .html files open a viewer;
Claus Gittinger <cg@exept.de>
parents:
585
diff
changeset
|
2660 |
self fileGet:false |
4630175ed31e
double click on .htm / .html files open a viewer;
Claus Gittinger <cg@exept.de>
parents:
585
diff
changeset
|
2661 |
|
4630175ed31e
double click on .htm / .html files open a viewer;
Claus Gittinger <cg@exept.de>
parents:
585
diff
changeset
|
2662 |
"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
|
2663 |
! |
4630175ed31e
double click on .htm / .html files open a viewer;
Claus Gittinger <cg@exept.de>
parents:
585
diff
changeset
|
2664 |
|
4630175ed31e
double click on .htm / .html files open a viewer;
Claus Gittinger <cg@exept.de>
parents:
585
diff
changeset
|
2665 |
fileGet:viaDoubleClick |
4630175ed31e
double click on .htm / .html files open a viewer;
Claus Gittinger <cg@exept.de>
parents:
585
diff
changeset
|
2666 |
"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
|
2667 |
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
|
2668 |
otherwise get it immediately" |
4630175ed31e
double click on .htm / .html files open a viewer;
Claus Gittinger <cg@exept.de>
parents:
585
diff
changeset
|
2669 |
|
172 | 2670 |
|fileName msg label| |
2671 |
||
1110
9ec4692e9cda
dont decode string, if the encoding is already iso8859
Claus Gittinger <cg@exept.de>
parents:
1104
diff
changeset
|
2672 |
(subView modified not or:[subView contentsWasSaved]) ifTrue:[ |
3252 | 2673 |
self doFileGet:viaDoubleClick. |
2674 |
^ self |
|
1110
9ec4692e9cda
dont decode string, if the encoding is already iso8859
Claus Gittinger <cg@exept.de>
parents:
1104
diff
changeset
|
2675 |
]. |
172 | 2676 |
fileName := self getSelectedFileName. |
2677 |
fileName notNil ifTrue:[ |
|
3252 | 2678 |
(currentDirectory filenameFor:fileName) isDirectory ifTrue:[ |
2679 |
msg := 'Contents has not been saved.\\Modifications will be lost when directory is changed.'. |
|
2680 |
label := 'Change'. |
|
2681 |
] ifFalse:[ |
|
2682 |
msg := 'Contents has not been saved.\\Modifications will be lost when new file is read.'. |
|
2683 |
label := 'Get'. |
|
2684 |
]. |
|
2685 |
(self ask:(resources at:msg) yesButton:label) ifTrue:[ |
|
2686 |
subView modified:false. |
|
2687 |
self doFileGet:viaDoubleClick |
|
2688 |
] |
|
172 | 2689 |
] |
633
4630175ed31e
double click on .htm / .html files open a viewer;
Claus Gittinger <cg@exept.de>
parents:
585
diff
changeset
|
2690 |
|
4630175ed31e
double click on .htm / .html files open a viewer;
Claus Gittinger <cg@exept.de>
parents:
585
diff
changeset
|
2691 |
"Created: 19.6.1996 / 09:38:35 / cg" |
1162 | 2692 |
"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
|
2693 |
"Modified: 18.9.1997 / 16:27:34 / stefan" |
172 | 2694 |
! |
2695 |
||
2696 |
fileGetInfo |
|
2697 |
"show short file (stat)-info" |
|
2698 |
||
2699 |
self fileGetInfo:false |
|
2700 |
! |
|
2701 |
||
2702 |
fileGetInfo:longInfo |
|
2703 |
"get info on selected file - show it in a box" |
|
2704 |
||
1672
9df905f8bfa3
update fileInfo while showing infoBox
Claus Gittinger <cg@exept.de>
parents:
1628
diff
changeset
|
2705 |
|string box updater| |
172 | 2706 |
|
2707 |
string := self getFileInfoString:longInfo. |
|
2708 |
string notNil ifTrue:[ |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2709 |
box := InfoBox title:string. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2710 |
updater := [ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2711 |
[true] whileTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2712 |
Delay waitForSeconds:2. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2713 |
string := self getFileInfoString:longInfo. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2714 |
box title:string |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2715 |
] |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2716 |
] fork. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2717 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2718 |
box showAtPointer. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2719 |
updater terminate. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2720 |
box destroy |
172 | 2721 |
] |
2722 |
! |
|
2723 |
||
2724 |
fileGetLongInfo |
|
2725 |
"show long stat (file)-info" |
|
2726 |
||
2727 |
self fileGetInfo:true |
|
2728 |
! |
|
2729 |
||
1874 | 2730 |
fileHexDump |
2731 |
"show a hex dump (similar to od -x) |
|
2732 |
Only needed with non-Unix systems." |
|
2733 |
||
3252 | 2734 |
(self askIfModified:'Contents has not been saved.\\Modifications will be lost when hex dump is shown.' |
2735 |
yesButton:'HexDump') ifFalse:[^ self]. |
|
2736 |
||
1874 | 2737 |
self withReadCursorDo:[ |
2666 | 2738 |
|fileName f stream data offs |
2701
78171ebe64f5
less memory need for hexDump
Claus Gittinger <cg@exept.de>
parents:
2688
diff
changeset
|
2739 |
addrDigits col line lineStream asciiLineStream lines| |
2666 | 2740 |
|
2741 |
fileName := self getSelectedFileName. |
|
2742 |
fileName notNil ifTrue:[ |
|
2743 |
f := currentDirectory construct:fileName. |
|
2744 |
f isDirectory ifTrue:[ |
|
2745 |
^ self warn:(resources string:'%1 is a directory.' with:fileName). |
|
2746 |
]. |
|
2747 |
f exists ifFalse:[ |
|
3528 | 2748 |
Dialog warn:(resources string:'oops, ''%1'' is gone or unreadable.' with:fileName). |
2666 | 2749 |
^ self |
2750 |
]. |
|
2751 |
f isReadable ifFalse:[ |
|
3528 | 2752 |
Dialog warn:(resources string:'''%1'' is unreadable.' with:fileName). |
2666 | 2753 |
^ self |
2754 |
]. |
|
2755 |
f fileSize > (512*1024) ifTrue:[ |
|
2756 |
(self confirm:'Warning: the file is big (', (f fileSize//1024) printString , 'Kb). Show anyway ?') |
|
2757 |
ifFalse:[ |
|
2758 |
^ self |
|
2759 |
] |
|
2760 |
]. |
|
2761 |
stream := f readStream binary. |
|
2762 |
data := stream contents. |
|
2763 |
stream close. |
|
2764 |
||
2765 |
subView list:nil. |
|
2766 |
col := 1. |
|
2767 |
offs := 0. |
|
2768 |
lines := StringCollection new. |
|
2769 |
||
2770 |
addrDigits := ((f fileSize + 1) log:16) truncated + 1. |
|
2771 |
||
2701
78171ebe64f5
less memory need for hexDump
Claus Gittinger <cg@exept.de>
parents:
2688
diff
changeset
|
2772 |
lineStream := '' writeStream. |
78171ebe64f5
less memory need for hexDump
Claus Gittinger <cg@exept.de>
parents:
2688
diff
changeset
|
2773 |
asciiLineStream := '' writeStream. |
78171ebe64f5
less memory need for hexDump
Claus Gittinger <cg@exept.de>
parents:
2688
diff
changeset
|
2774 |
|
78171ebe64f5
less memory need for hexDump
Claus Gittinger <cg@exept.de>
parents:
2688
diff
changeset
|
2775 |
lineStream nextPutAll:(offs hexPrintString:addrDigits). |
78171ebe64f5
less memory need for hexDump
Claus Gittinger <cg@exept.de>
parents:
2688
diff
changeset
|
2776 |
lineStream nextPutAll:': '. |
2666 | 2777 |
|
2778 |
data do:[:byte | |
|
2701
78171ebe64f5
less memory need for hexDump
Claus Gittinger <cg@exept.de>
parents:
2688
diff
changeset
|
2779 |
lineStream nextPutAll:(byte hexPrintString:2). |
2666 | 2780 |
(byte between:32 and:127) ifTrue:[ |
2701
78171ebe64f5
less memory need for hexDump
Claus Gittinger <cg@exept.de>
parents:
2688
diff
changeset
|
2781 |
asciiLineStream nextPut:(Character value:byte) |
2666 | 2782 |
] ifFalse:[ |
2701
78171ebe64f5
less memory need for hexDump
Claus Gittinger <cg@exept.de>
parents:
2688
diff
changeset
|
2783 |
asciiLineStream nextPut:$. |
2666 | 2784 |
]. |
2785 |
||
2786 |
offs := offs + 1. |
|
2787 |
col := col + 1. |
|
2788 |
col > 16 ifTrue:[ |
|
2701
78171ebe64f5
less memory need for hexDump
Claus Gittinger <cg@exept.de>
parents:
2688
diff
changeset
|
2789 |
lineStream nextPutAll:' '. |
78171ebe64f5
less memory need for hexDump
Claus Gittinger <cg@exept.de>
parents:
2688
diff
changeset
|
2790 |
lineStream nextPutAll:asciiLineStream contents. |
78171ebe64f5
less memory need for hexDump
Claus Gittinger <cg@exept.de>
parents:
2688
diff
changeset
|
2791 |
lines add:(lineStream contents). |
2666 | 2792 |
(offs bitAnd:16rFF) == 0 ifTrue:[ |
2793 |
lines add:nil |
|
2794 |
]. |
|
2701
78171ebe64f5
less memory need for hexDump
Claus Gittinger <cg@exept.de>
parents:
2688
diff
changeset
|
2795 |
lineStream reset. |
78171ebe64f5
less memory need for hexDump
Claus Gittinger <cg@exept.de>
parents:
2688
diff
changeset
|
2796 |
asciiLineStream reset. |
78171ebe64f5
less memory need for hexDump
Claus Gittinger <cg@exept.de>
parents:
2688
diff
changeset
|
2797 |
|
78171ebe64f5
less memory need for hexDump
Claus Gittinger <cg@exept.de>
parents:
2688
diff
changeset
|
2798 |
lineStream nextPutAll:(offs hexPrintString:addrDigits). |
78171ebe64f5
less memory need for hexDump
Claus Gittinger <cg@exept.de>
parents:
2688
diff
changeset
|
2799 |
lineStream nextPutAll:': '. |
2666 | 2800 |
col := 1. |
2801 |
] ifFalse:[ |
|
2701
78171ebe64f5
less memory need for hexDump
Claus Gittinger <cg@exept.de>
parents:
2688
diff
changeset
|
2802 |
lineStream space |
2666 | 2803 |
] |
2804 |
]. |
|
2701
78171ebe64f5
less memory need for hexDump
Claus Gittinger <cg@exept.de>
parents:
2688
diff
changeset
|
2805 |
line := lineStream contents paddedTo:(3*16 + addrDigits + 1). |
78171ebe64f5
less memory need for hexDump
Claus Gittinger <cg@exept.de>
parents:
2688
diff
changeset
|
2806 |
lines add:(line , ' ' , asciiLineStream contents). |
2666 | 2807 |
self show:lines. |
2808 |
] |
|
1874 | 2809 |
] |
2810 |
||
2811 |
"Modified: / 7.9.1998 / 15:37:47 / cg" |
|
2812 |
! |
|
2813 |
||
172 | 2814 |
fileInsert |
1162 | 2815 |
"insert contents of file at the cursor position" |
172 | 2816 |
|
2817 |
|fileName| |
|
2818 |
||
2819 |
fileName := self getSelectedFileName. |
|
2820 |
fileName notNil ifTrue:[ |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2821 |
self showFile:fileName insert:true encoding:fileEncoding |
172 | 2822 |
] |
386
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
2823 |
|
1162 | 2824 |
"Modified: 23.4.1997 / 13:06:06 / cg" |
172 | 2825 |
! |
2826 |
||
2827 |
fileListMenu |
|
2828 |
"return the menu to show in the fileList" |
|
2829 |
||
1235
13610578a5d2
resource flag: #menu -> #programMenu
Claus Gittinger <cg@exept.de>
parents:
1227
diff
changeset
|
2830 |
<resource: #programMenu> |
1040 | 2831 |
|
3330 | 2832 |
|spec| |
1834 | 2833 |
|
3002 | 2834 |
self sensor ctrlDown ifTrue:[ |
3330 | 2835 |
spec := self class toolsMenuSpec. |
3002 | 2836 |
] ifFalse:[ |
3330 | 2837 |
spec := self class menuPopUp. |
2838 |
]. |
|
2839 |
^ self menuFromSpec:spec. |
|
2840 |
"/ |m| |
|
2841 |
"/ |
|
2842 |
"/ self sensor ctrlDown ifTrue:[ |
|
2843 |
"/ m := self class toolsMenuSpec. |
|
2844 |
"/ ] ifFalse:[ |
|
2845 |
"/ m := self class menuPopUp. |
|
2846 |
"/ ]. |
|
2847 |
"/ m := m decodeAsLiteralArray. |
|
2848 |
"/ m receiver:self. |
|
2849 |
"/ m findGuiResourcesIn:self. |
|
2850 |
"/ ^ m. |
|
1834 | 2851 |
|
2852 |
"Modified: / 14.8.1998 / 14:09:12 / cg" |
|
2853 |
! |
|
2854 |
||
2855 |
fileListMenu_old |
|
2856 |
"return the menu to show in the fileList" |
|
2857 |
||
2858 |
<resource: #programMenu> |
|
2859 |
||
3527 | 2860 |
|items m sel ns| |
1736
36cab4d1d655
remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents:
1735
diff
changeset
|
2861 |
|
36cab4d1d655
remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents:
1735
diff
changeset
|
2862 |
items := #( |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2863 |
('spawn' fileSpawn ) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2864 |
('-' nil ) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2865 |
('get contents' fileGet GotoLine) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2866 |
('insert contents' fileInsert ) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2867 |
('show info' fileGetInfo InspectIt) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2868 |
('show full info' fileGetLongInfo CmdI) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2869 |
). |
1193
568b858d94ce
show current namespace in menus fileIn item
Claus Gittinger <cg@exept.de>
parents:
1189
diff
changeset
|
2870 |
|
568b858d94ce
show current namespace in menus fileIn item
Claus Gittinger <cg@exept.de>
parents:
1189
diff
changeset
|
2871 |
((ns := Project current defaultNameSpace) notNil |
568b858d94ce
show current namespace in menus fileIn item
Claus Gittinger <cg@exept.de>
parents:
1189
diff
changeset
|
2872 |
and:[ns ~~ Smalltalk]) ifTrue:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2873 |
items := items copyWith:(Array |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2874 |
with:(resources string:'fileIn (into ''%1'')' with:(Project current defaultNameSpace name)) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2875 |
with:#fileFileIn |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2876 |
with:#Accept) |
1736
36cab4d1d655
remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents:
1735
diff
changeset
|
2877 |
|
1193
568b858d94ce
show current namespace in menus fileIn item
Claus Gittinger <cg@exept.de>
parents:
1189
diff
changeset
|
2878 |
] ifFalse:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2879 |
items := items copyWith:#( 'fileIn' #fileFileIn #Accept) |
1193
568b858d94ce
show current namespace in menus fileIn item
Claus Gittinger <cg@exept.de>
parents:
1189
diff
changeset
|
2880 |
]. |
568b858d94ce
show current namespace in menus fileIn item
Claus Gittinger <cg@exept.de>
parents:
1189
diff
changeset
|
2881 |
|
1736
36cab4d1d655
remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents:
1735
diff
changeset
|
2882 |
items := items , #( |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2883 |
('-' ) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2884 |
('update' updateCurrentDirectory Cmdu) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2885 |
('-' ) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2886 |
('execute unix command ...' fileExecute DoIt) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2887 |
('st/x tools' stxTools ) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2888 |
('-' ) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2889 |
('remove' fileRemove Delete) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2890 |
('rename ...' fileRename ) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2891 |
('-' ) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2892 |
('display long list' changeDisplayMode ) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2893 |
('show all files' changeDotFileVisibility ) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2894 |
('encoding ...' fileEncoding ) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2895 |
('-' ) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2896 |
('create directory ...' newDirectory CmdD) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2897 |
('create file ...' newFile CmdF) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2898 |
). |
172 | 2899 |
|
2900 |
m := PopUpMenu |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2901 |
itemList:items |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2902 |
resources:resources. |
172 | 2903 |
|
1834 | 2904 |
showingHiddenFiles value "showDotFiles" ifTrue:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2905 |
m labelAt:#changeDotFileVisibility put:(resources string:'hide hidden files') |
172 | 2906 |
]. |
1834 | 2907 |
showingDetails value "showLongList" ifTrue:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2908 |
m labelAt:#changeDisplayMode put:(resources string:'display short list') |
172 | 2909 |
]. |
2910 |
||
1736
36cab4d1d655
remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents:
1735
diff
changeset
|
2911 |
items := #( |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2912 |
('Changes browser' openChangesBrowser ) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2913 |
('Editor' openEditor ) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2914 |
('HTML reader' openHTMLReader ) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2915 |
('Image inspect' openImageInspector ) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2916 |
('show file differences' openDiffView ) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2917 |
). |
1286
2a464093d865
added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents:
1272
diff
changeset
|
2918 |
|
1751 | 2919 |
OperatingSystem isUNIXlike ifTrue:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2920 |
items := items , #( ('terminal' openTerminal )). |
1751 | 2921 |
]. |
2922 |
||
1286
2a464093d865
added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents:
1272
diff
changeset
|
2923 |
JavaInterpreter notNil ifTrue:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2924 |
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
|
2925 |
]. |
2a464093d865
added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents:
1272
diff
changeset
|
2926 |
|
2a464093d865
added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents:
1272
diff
changeset
|
2927 |
m subMenuAt:#stxTools |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2928 |
put:(PopUpMenu |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2929 |
itemList:items |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2930 |
resources:resources). |
1736
36cab4d1d655
remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents:
1735
diff
changeset
|
2931 |
|
36cab4d1d655
remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents:
1735
diff
changeset
|
2932 |
((sel := fileListView selection) isNil |
36cab4d1d655
remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents:
1735
diff
changeset
|
2933 |
or:[sel isEmpty]) ifTrue:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2934 |
m disableAll:#(fileGet fileInsert |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2935 |
fileGetInfo fileGetLongInfo |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2936 |
fileFileIn fileFileInLazy |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2937 |
fileRemove fileRename). |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2938 |
(m subMenuAt:#stxTools) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2939 |
disableAll:#(openChangesBrowser openEditor openHTMLReader openImageInspector) |
865
48395e8ecca9
remember executeCommand actions in history as well.
Claus Gittinger <cg@exept.de>
parents:
851
diff
changeset
|
2940 |
] ifFalse:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2941 |
fileListView selection size > 1 ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2942 |
m disableAll:#( fileGet fileInsert fileGetInfo fileGetLongInfo fileRename ) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2943 |
] |
172 | 2944 |
]. |
2945 |
||
2946 |
^m |
|
252 | 2947 |
|
1396 | 2948 |
"Modified: / 16.1.1998 / 16:42:59 / stefan" |
1834 | 2949 |
"Modified: / 4.8.1998 / 13:45:56 / cg" |
2950 |
"Created: / 13.8.1998 / 20:51:38 / cg" |
|
172 | 2951 |
! |
2952 |
||
2953 |
filePrint |
|
1162 | 2954 |
"send a files contents to the printer (not in the menu)" |
2955 |
||
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
2956 |
|fileName path inStream printStream line| |
172 | 2957 |
|
294 | 2958 |
self withWaitCursorDo:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2959 |
fileName := self getSelectedFileName. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2960 |
fileName notNil ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2961 |
path := currentDirectory filenameFor:fileName. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2962 |
(path type == #regular) ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2963 |
inStream := path readStream. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2964 |
inStream isNil ifFalse:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2965 |
printStream := PrinterStream new. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2966 |
printStream notNil ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2967 |
[inStream atEnd] whileFalse:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2968 |
line := inStream nextLine. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2969 |
printStream nextPutLine:line. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2970 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2971 |
printStream close |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2972 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2973 |
inStream close |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2974 |
] |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2975 |
] |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2976 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2977 |
0 "compiler hint" |
172 | 2978 |
] |
294 | 2979 |
|
1162 | 2980 |
"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
|
2981 |
"Modified: 18.9.1997 / 16:29:17 / stefan" |
172 | 2982 |
! |
2983 |
||
2984 |
fileRemove |
|
2985 |
"remove the selected file(s). |
|
3281 | 2986 |
Query if user really wants to remove the file, except if |
2987 |
shift-key is pressed. |
|
2988 |
TODO: Should be enhanced, to look for a ~/.trash directory |
|
2989 |
and move files there if it exists (without asking in this case)." |
|
2990 |
||
2991 |
|sel| |
|
172 | 2992 |
|
2094 | 2993 |
sel := fileListView selection. |
2994 |
sel size > 0 ifTrue:[ |
|
2868 | 2995 |
sel := sel collect:[:rawIndex | fileList at:rawIndex]. |
3281 | 2996 |
"/ do not ask, if shift is pressed |
2997 |
self sensor shiftDown ifTrue:[ |
|
2998 |
self doRemove:sel |
|
2868 | 2999 |
] ifFalse:[ |
3281 | 3000 |
self confirmAndRemove:sel |
2868 | 3001 |
]. |
3281 | 3002 |
] |
3003 |
! |
|
3004 |
||
3005 |
fileRemove:fileNames |
|
3006 |
"remove fileNames. |
|
3007 |
Query if user really wants to remove the file, except if |
|
3008 |
shift-key is pressed. |
|
3009 |
TODO: Should be enhanced, to look for a ~/.trash directory |
|
3010 |
and move files there if it exists (without asking in this case)." |
|
3011 |
||
3012 |
|q doRemove| |
|
3013 |
||
3014 |
"/ do not ask, if shift is pressed |
|
3015 |
doRemove := self sensor shiftDown. |
|
3016 |
doRemove ifFalse:[ |
|
3017 |
fileNames size > 1 ifTrue:[ |
|
3018 |
q := resources string:'Remove %1 selected files ?' with:(fileNames size). |
|
3019 |
doRemove := Dialog |
|
3020 |
confirmWithCancel:q |
|
3021 |
labels:(resources array:#('Remove' 'Confirm Each' 'Cancel')) |
|
3022 |
values:#(true #confirm false) |
|
3023 |
default:true. |
|
3024 |
doRemove == #confirm ifTrue:[ |
|
3527 | 3025 |
self halt:'Confirm each not yet implemented'. |
3281 | 3026 |
]. |
3027 |
] ifFalse:[ |
|
3028 |
q := resources string:'Remove ''%1'' ?' with:(fileNames first allBold). |
|
3029 |
doRemove := self ask:q yesButton:'Remove'. |
|
3030 |
]. |
|
3031 |
]. |
|
3032 |
||
3033 |
doRemove ifTrue:[ |
|
3034 |
self withWaitCursorDo:[ |
|
3035 |
self doRemove:fileNames |
|
2868 | 3036 |
] |
172 | 3037 |
] |
3038 |
! |
|
3039 |
||
3040 |
fileRename |
|
3041 |
"rename the selected file(s)" |
|
3042 |
||
3565 | 3043 |
|queryBox b lastNewName lastOldName initialText| |
172 | 3044 |
|
3045 |
queryBox := FilenameEnterBox new. |
|
3280 | 3046 |
queryBox okText:(resources at:'Rename'). |
3059
ced4d5b13ad2
cancelAll if renaming multiple files
Claus Gittinger <cg@exept.de>
parents:
3045
diff
changeset
|
3047 |
fileListView selection size > 1 ifTrue:[ |
3697
e2f7d8dec6e2
menu items/button labels uppercase-first
Claus Gittinger <cg@exept.de>
parents:
3691
diff
changeset
|
3048 |
b := queryBox addAbortButtonLabelled:(resources at:'Cancel All'). |
3059
ced4d5b13ad2
cancelAll if renaming multiple files
Claus Gittinger <cg@exept.de>
parents:
3045
diff
changeset
|
3049 |
b action:[^ self ]. |
ced4d5b13ad2
cancelAll if renaming multiple files
Claus Gittinger <cg@exept.de>
parents:
3045
diff
changeset
|
3050 |
]. |
ced4d5b13ad2
cancelAll if renaming multiple files
Claus Gittinger <cg@exept.de>
parents:
3045
diff
changeset
|
3051 |
|
172 | 3052 |
self selectedFilesDo:[:oldName | |
3280 | 3053 |
queryBox title:(resources string:'Rename ''%1'' to:' with:oldName). |
3066
7daebd50006e
intelligent default in rename
Claus Gittinger <cg@exept.de>
parents:
3061
diff
changeset
|
3054 |
initialText := oldName. |
7daebd50006e
intelligent default in rename
Claus Gittinger <cg@exept.de>
parents:
3061
diff
changeset
|
3055 |
|
3556 | 3056 |
lastNewName notNil ifTrue:[ |
3059
ced4d5b13ad2
cancelAll if renaming multiple files
Claus Gittinger <cg@exept.de>
parents:
3045
diff
changeset
|
3057 |
"/ intelligent default ... |
3565 | 3058 |
initialText := self goodRenameDefaultFor:oldName lastOld:lastOldName lastNew:lastNewName |
3059
ced4d5b13ad2
cancelAll if renaming multiple files
Claus Gittinger <cg@exept.de>
parents:
3045
diff
changeset
|
3059 |
]. |
3565 | 3060 |
queryBox initialText:(initialText ? oldName). |
3059
ced4d5b13ad2
cancelAll if renaming multiple files
Claus Gittinger <cg@exept.de>
parents:
3045
diff
changeset
|
3061 |
queryBox action:[:newName | |
3060 | 3062 |
fileListView removeFromSelection:(fileList indexOf:oldName). |
3059
ced4d5b13ad2
cancelAll if renaming multiple files
Claus Gittinger <cg@exept.de>
parents:
3045
diff
changeset
|
3063 |
self doRename:oldName to:newName. |
ced4d5b13ad2
cancelAll if renaming multiple files
Claus Gittinger <cg@exept.de>
parents:
3045
diff
changeset
|
3064 |
lastOldName := oldName. |
ced4d5b13ad2
cancelAll if renaming multiple files
Claus Gittinger <cg@exept.de>
parents:
3045
diff
changeset
|
3065 |
lastNewName := newName. |
ced4d5b13ad2
cancelAll if renaming multiple files
Claus Gittinger <cg@exept.de>
parents:
3045
diff
changeset
|
3066 |
]. |
ced4d5b13ad2
cancelAll if renaming multiple files
Claus Gittinger <cg@exept.de>
parents:
3045
diff
changeset
|
3067 |
|
ced4d5b13ad2
cancelAll if renaming multiple files
Claus Gittinger <cg@exept.de>
parents:
3045
diff
changeset
|
3068 |
queryBox showAtPointer |
172 | 3069 |
] |
3070 |
! |
|
3071 |
||
3072 |
fileSelect:lineNr |
|
3073 |
"selected a file - do nothing here" |
|
1162 | 3074 |
|
2094 | 3075 |
|fn| |
3076 |
||
2095 | 3077 |
imagePreviewView notNil ifTrue:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3078 |
self stopImageRenderProcess. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3079 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3080 |
fn := self getSelectedFileName. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3081 |
(Image isImageFileSuffix:(fn asFilename suffix)) ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3082 |
imageRenderProcess := [ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3083 |
self loadImageAndPerform:[:img | |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3084 |
imagePreviewView beVisible. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3085 |
imagePreviewView image:img |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3086 |
] |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3087 |
] forkAt:(Processor activePriority - 1). |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3088 |
] ifFalse:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3089 |
imagePreviewView beInvisible |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3090 |
]. |
2095 | 3091 |
] |
1162 | 3092 |
|
3093 |
"Modified: 23.4.1997 / 13:04:55 / cg" |
|
172 | 3094 |
! |
3095 |
||
3096 |
fileSpawn |
|
3097 |
"start another FileBrowser on the selected directory or |
|
3098 |
on the same directory if none is selected." |
|
3099 |
||
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
3100 |
|any path| |
172 | 3101 |
|
3102 |
any := false. |
|
3103 |
self selectedFilesDo:[:fileName | |
|
3025 | 3104 |
path := currentDirectory filenameFor:fileName. |
3105 |
path isDirectory ifTrue:[ |
|
3106 |
self class openOn:(path pathName). |
|
3107 |
any := true |
|
3108 |
] |
|
172 | 3109 |
]. |
3110 |
any ifFalse:[ |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3111 |
"/ access by name, to get most up-to-date version |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3112 |
"/ (if changed in the browser, and the running one is old) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3113 |
(Smalltalk at:(self class name)) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3114 |
openOn:currentDirectory pathName withExtent:self topView extent |
172 | 3115 |
] |
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
3116 |
|
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
3117 |
"Modified: 18.9.1997 / 16:32:39 / stefan" |
172 | 3118 |
! |
3119 |
||
3565 | 3120 |
goodRenameDefaultFor:oldName lastOld:lastOldName lastNew:lastNewName |
3636 | 3121 |
|prefix suffix lastNewSize lastOldSize t |
3635 | 3122 |
lastOldWOSuffix lastNewWOSuffix oldWOSuffix lastOldRest oldRest lastNewRest |
3123 |
lastRemoved lastInserted| |
|
3565 | 3124 |
|
3125 |
lastNewName isNil ifTrue:[ ^ nil]. |
|
3126 |
||
3127 |
lastNewSize := lastNewName size. |
|
3128 |
lastOldSize := lastOldName size. |
|
3129 |
||
3130 |
"/ intelligent default ... |
|
3131 |
(lastNewName endsWith:lastOldName) ifTrue:[ |
|
3132 |
prefix := lastNewName copyTo:(lastNewSize - lastOldSize). |
|
3133 |
^ (prefix , oldName). |
|
3134 |
]. |
|
3135 |
(lastOldName endsWith:lastNewName) ifTrue:[ |
|
3136 |
prefix := lastOldName copyTo:(lastOldSize - lastNewSize). |
|
3137 |
^ (oldName copyFrom:prefix size+1). |
|
3138 |
]. |
|
3139 |
(lastOldName withoutSeparators = lastNewName) ifTrue:[ |
|
3140 |
"/ intelligent default ... |
|
3141 |
^ oldName withoutSeparators. |
|
3142 |
]. |
|
3143 |
(lastNewName startsWith:lastOldName) ifTrue:[ |
|
3144 |
"/ intelligent default ... |
|
3145 |
suffix := lastNewName copyLast:(lastNewSize - lastOldSize). |
|
3146 |
^ (oldName , suffix). |
|
3147 |
]. |
|
3148 |
(lastOldName startsWith:lastNewName) ifTrue:[ |
|
3149 |
suffix := lastOldName copyLast:(lastOldSize - lastNewSize). |
|
3150 |
(oldName endsWith:suffix) ifTrue:[ |
|
3151 |
^ (oldName copyWithoutLast:suffix size). |
|
3152 |
] |
|
3153 |
]. |
|
3154 |
||
3155 |
lastOldWOSuffix := lastOldName asFilename withoutSuffix name. |
|
3156 |
lastNewWOSuffix := lastNewName asFilename withoutSuffix name. |
|
3157 |
oldWOSuffix := oldName asFilename withoutSuffix name. |
|
3158 |
||
3636 | 3159 |
prefix := lastOldWOSuffix commonPrefixWith:oldWOSuffix. |
3565 | 3160 |
(lastNewWOSuffix startsWith:prefix) ifTrue:[ |
3161 |
lastOldRest := lastOldWOSuffix copyFrom:prefix size + 1. |
|
3162 |
lastNewRest := lastNewWOSuffix copyFrom:prefix size + 1. |
|
3163 |
oldRest := oldWOSuffix copyFrom:prefix size + 1. |
|
3164 |
||
3165 |
(lastNewRest endsWith:lastOldRest) ifTrue:[ |
|
3166 |
t := lastNewRest copyWithoutLast:lastOldRest size. |
|
3167 |
^ ((prefix , t , oldRest) asFilename withSuffix:oldName asFilename suffix) name |
|
3168 |
]. |
|
3169 |
]. |
|
3170 |
||
3636 | 3171 |
suffix := lastOldWOSuffix commonSuffixWith:lastNewWOSuffix. |
3635 | 3172 |
suffix size > 0 ifTrue:[ |
3173 |
"/ last change changed something at the beginning |
|
3636 | 3174 |
prefix := oldWOSuffix commonPrefixWith:lastOldWOSuffix. |
3635 | 3175 |
prefix size > 0 ifTrue:[ |
3176 |
"/ this name starts with the same characters |
|
3177 |
lastRemoved := lastOldWOSuffix copyWithoutLast:suffix size. |
|
3178 |
lastInserted := lastNewWOSuffix copyWithoutLast:suffix size. |
|
3179 |
^ lastInserted , (oldName copyFrom:lastRemoved size + 1) |
|
3180 |
]. |
|
3181 |
]. |
|
3182 |
||
3565 | 3183 |
^ nil |
3184 |
! |
|
3185 |
||
3536 | 3186 |
hasSlideShow |
3187 |
^ [CodingExamples_GUI::SlideShow notNil] |
|
3188 |
||
3189 |
"Created: / 29.12.2001 / 21:58:47 / cg" |
|
3190 |
"Modified: / 29.12.2001 / 21:59:01 / cg" |
|
3191 |
! |
|
3192 |
||
1964 | 3193 |
loadImageAndPerform:aSelectorOrBlock |
1853 | 3194 |
|img path| |
3195 |
||
3196 |
self selectedFilesDo:[:fileName | |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3197 |
path := currentDirectory filenameFor:fileName. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3198 |
path isDirectory ifFalse:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3199 |
img := Image fromFile:(path pathName). |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3200 |
img notNil ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3201 |
aSelectorOrBlock isSymbol ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3202 |
img perform:aSelectorOrBlock |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3203 |
] ifFalse:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3204 |
aSelectorOrBlock value:img |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3205 |
] |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3206 |
] ifFalse:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3207 |
self warn:'unknown format: ' , fileName |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3208 |
] |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3209 |
] |
1853 | 3210 |
]. |
3211 |
||
3212 |
"Modified: / 17.9.1995 / 17:41:24 / claus" |
|
3213 |
"Modified: / 18.9.1997 / 17:05:04 / stefan" |
|
3214 |
"Created: / 26.8.1998 / 16:20:18 / cg" |
|
3215 |
! |
|
3216 |
||
172 | 3217 |
newDirectory |
3218 |
"ask for and create a new directory" |
|
3219 |
||
3220 |
|queryBox| |
|
3221 |
||
3222 |
queryBox := FilenameEnterBox |
|
3280 | 3223 |
title:(resources at:'Create new directory:') withCRs |
3224 |
okText:(resources at:'Create') |
|
3225 |
action:[:newName | self doCreateDirectory:newName]. |
|
172 | 3226 |
queryBox showAtPointer |
1162 | 3227 |
|
3228 |
"Modified: 23.4.1997 / 13:04:27 / cg" |
|
172 | 3229 |
! |
3230 |
||
3231 |
newFile |
|
3232 |
"ask for and create a new file" |
|
3233 |
||
3234 |
|sel queryBox| |
|
3235 |
||
3236 |
queryBox := FilenameEnterBox |
|
3280 | 3237 |
title:(resources at:'Create new file:') withCRs |
3238 |
okText:(resources at:'Create') |
|
2512
35d2092df60f
autoselect a new created file
Claus Gittinger <cg@exept.de>
parents:
2504
diff
changeset
|
3239 |
action:[:newName | newName isEmpty ifFalse:[ |
35d2092df60f
autoselect a new created file
Claus Gittinger <cg@exept.de>
parents:
2504
diff
changeset
|
3240 |
self doCreateFile:newName. |
35d2092df60f
autoselect a new created file
Claus Gittinger <cg@exept.de>
parents:
2504
diff
changeset
|
3241 |
self selectFile:newName. |
35d2092df60f
autoselect a new created file
Claus Gittinger <cg@exept.de>
parents:
2504
diff
changeset
|
3242 |
] |
35d2092df60f
autoselect a new created file
Claus Gittinger <cg@exept.de>
parents:
2504
diff
changeset
|
3243 |
]. |
172 | 3244 |
sel := subView selection. |
3245 |
sel notNil ifTrue:[ |
|
2512
35d2092df60f
autoselect a new created file
Claus Gittinger <cg@exept.de>
parents:
2504
diff
changeset
|
3246 |
queryBox initialText:(sel asString) |
172 | 3247 |
]. |
3248 |
queryBox showAtPointer |
|
381 | 3249 |
|
1396 | 3250 |
"Modified: / 23.4.1997 / 13:04:38 / cg" |
3251 |
"Modified: / 16.1.1998 / 16:54:00 / stefan" |
|
172 | 3252 |
! |
3253 |
||
1834 | 3254 |
newHardLink |
3255 |
"ask for and create a hard link (unix only)" |
|
3256 |
||
3527 | 3257 |
|sel box orgName1 name1 name2 f1 f2 err here if1 if2| |
1834 | 3258 |
|
3259 |
sel := self getSelectedFileName. |
|
3260 |
||
3261 |
orgName1 := ''. |
|
3262 |
(sel size > 0) ifTrue:[ |
|
2868 | 3263 |
(currentDirectory construct:sel) isDirectory ifFalse:[ |
3264 |
orgName1 := sel |
|
3265 |
] |
|
1834 | 3266 |
]. |
3267 |
||
3268 |
name1 := orgName1 asValue. |
|
3269 |
name2 := '' asValue. |
|
3270 |
||
3271 |
box := DialogBox new. |
|
2035
307ed5143d8b
national language stuff - again
Claus Gittinger <cg@exept.de>
parents:
2031
diff
changeset
|
3272 |
(box addTextLabel:(resources string:'Create hard link from:')) adjust:#left. |
1834 | 3273 |
if1 := box addFilenameInputFieldOn:name1 in:here tabable:true. |
2035
307ed5143d8b
national language stuff - again
Claus Gittinger <cg@exept.de>
parents:
2031
diff
changeset
|
3274 |
(box addTextLabel:(resources string:'to:')) adjust:#left. |
1834 | 3275 |
if2 := box addFilenameInputFieldOn:name2 in:here tabable:true. |
3276 |
||
2048 | 3277 |
box addAbortAndOkButtons. |
1834 | 3278 |
|
3279 |
orgName1 size > 0 ifTrue:[ |
|
2868 | 3280 |
box focusOnField:if2. |
1834 | 3281 |
]. |
3282 |
box showAtPointer. |
|
3283 |
||
3284 |
box accepted ifTrue:[ |
|
2868 | 3285 |
name1 := name1 value. |
3286 |
(name1 size == 0) ifTrue:[ |
|
3287 |
err := 'no name entered'. |
|
3288 |
] ifFalse:[ |
|
3289 |
f1 := name1 asFilename. |
|
3290 |
name2 := name2 value. |
|
3291 |
(name2 size == 0) ifTrue:[ |
|
3292 |
err := 'no name entered'. |
|
3293 |
] ifFalse:[ |
|
3294 |
f2 := name2 asFilename. |
|
3295 |
f2 exists ifTrue:[ |
|
3296 |
err := '''%2'' already exists'. |
|
3297 |
] ifFalse:[ |
|
3298 |
f1 exists ifFalse:[ |
|
3299 |
err := '''%1'' does not exist'. |
|
3300 |
] ifTrue:[ |
|
3301 |
f1 isDirectory ifTrue:[ |
|
3302 |
err := '''%1'' is a directory'. |
|
3303 |
] ifFalse:[ |
|
3304 |
ErrorSignal handle:[:ex | |
|
3305 |
err := ex errorString |
|
3306 |
] do:[ |
|
3307 |
OperatingSystem createHardLinkFrom:name1 to:name2 |
|
3308 |
] |
|
3309 |
] |
|
3310 |
] |
|
3311 |
] |
|
3312 |
] |
|
3313 |
]. |
|
3314 |
||
3315 |
err notNil ifTrue:[ |
|
3316 |
self warn:(resources string:err with:(name1 ? '') allBold with:(name2 ? '') allBold). |
|
3317 |
^ self |
|
3318 |
]. |
|
1834 | 3319 |
]. |
3320 |
||
3321 |
"Modified: / 13.8.1998 / 21:47:01 / cg" |
|
3322 |
! |
|
3323 |
||
3324 |
newSoftLink |
|
3325 |
"ask for and create a soft link (unix only)" |
|
3326 |
||
3527 | 3327 |
|sel box orgName1 name1 name2 f1 f2 err here if1 if2| |
1834 | 3328 |
|
3329 |
sel := self getSelectedFileName. |
|
2832 | 3330 |
here := currentDirectory pathName. |
1834 | 3331 |
|
3332 |
orgName1 := ''. |
|
3333 |
(sel size > 0) ifTrue:[ |
|
2868 | 3334 |
orgName1 := sel |
1834 | 3335 |
]. |
3336 |
||
3337 |
name1 := orgName1 asValue. |
|
3338 |
name2 := '' asValue. |
|
3339 |
||
3340 |
box := DialogBox new. |
|
3341 |
(box addTextLabel:'Create symbolic link to:') adjust:#left. |
|
3342 |
if1 := box addFilenameInputFieldOn:name1 in:here tabable:true. |
|
3343 |
(box addTextLabel:'as:') adjust:#left. |
|
3344 |
if2 := box addFilenameInputFieldOn:name2 in:here tabable:true. |
|
3345 |
||
2048 | 3346 |
box addAbortAndOkButtons. |
1834 | 3347 |
|
3348 |
orgName1 size > 0 ifTrue:[ |
|
2868 | 3349 |
box focusOnField:if2. |
1834 | 3350 |
]. |
3351 |
box showAtPointer. |
|
3352 |
||
3353 |
box accepted ifTrue:[ |
|
2868 | 3354 |
name1 := name1 value. |
3355 |
(name1 size == 0) ifTrue:[ |
|
3356 |
err := 'no name entered'. |
|
3357 |
] ifFalse:[ |
|
3358 |
f1 := name1 asFilename. |
|
3359 |
name2 := name2 value. |
|
3360 |
(name2 size == 0) ifTrue:[ |
|
3361 |
err := 'no name entered'. |
|
3362 |
] ifFalse:[ |
|
3363 |
f2 := name2 asFilename. |
|
3364 |
f2 exists ifTrue:[ |
|
3365 |
err := '''%2'' already exists'. |
|
3366 |
] ifFalse:[ |
|
3367 |
f1 exists ifFalse:[ |
|
3368 |
err := '''%1'' does not exist (link created anyway)'. |
|
3369 |
]. |
|
3370 |
ErrorSignal handle:[:ex | |
|
3371 |
err := ex errorString |
|
3372 |
] do:[ |
|
3373 |
OperatingSystem createSymbolicLinkFrom:name1 to:name2 |
|
3374 |
] |
|
3375 |
] |
|
3376 |
] |
|
3377 |
]. |
|
3378 |
||
3379 |
err notNil ifTrue:[ |
|
3380 |
self warn:(resources string:err with:(name1 ? '') allBold with:(name2 ? '') allBold). |
|
3381 |
^ self |
|
3382 |
]. |
|
1834 | 3383 |
]. |
3384 |
||
3385 |
"Modified: / 13.8.1998 / 21:26:59 / cg" |
|
3386 |
"Created: / 13.8.1998 / 21:47:14 / cg" |
|
3387 |
! |
|
3388 |
||
2186 | 3389 |
openASN1Browser |
3390 |
self openTool:OSI::ASN1Browser |
|
3391 |
||
3392 |
"Modified: / 7.9.1998 / 21:31:58 / cg" |
|
3393 |
! |
|
3394 |
||
1286
2a464093d865
added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents:
1272
diff
changeset
|
3395 |
openAppletViewer |
2a464093d865
added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents:
1272
diff
changeset
|
3396 |
|numItems| |
2a464093d865
added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents:
1272
diff
changeset
|
3397 |
|
2a464093d865
added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents:
1272
diff
changeset
|
3398 |
(numItems := fileListView selection size) > 2 ifTrue:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3399 |
(self |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3400 |
confirm:(resources string:'open for each of the %1 items ?' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3401 |
with:numItems)) ifFalse:[^ self]. |
1286
2a464093d865
added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents:
1272
diff
changeset
|
3402 |
]. |
2a464093d865
added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents:
1272
diff
changeset
|
3403 |
|
1942 | 3404 |
Java startupJavaSystem. |
3405 |
"/ Java markAllClassesUninitialized. |
|
3406 |
"/ Java initAllStaticFields. |
|
3407 |
"/ Java initAllClasses. |
|
1286
2a464093d865
added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents:
1272
diff
changeset
|
3408 |
|
2a464093d865
added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents:
1272
diff
changeset
|
3409 |
self selectedFilesDo:[:fileName | |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3410 |
|p path| |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3411 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3412 |
path := currentDirectory filenameFor:fileName. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3413 |
path isDirectory ifFalse:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3414 |
p := Java |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3415 |
javaProcessForMainOf:(Java classForName:'sun.applet.AppletViewer') |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3416 |
argumentString:path pathName. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3417 |
p resume. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3418 |
] |
1286
2a464093d865
added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents:
1272
diff
changeset
|
3419 |
]. |
2a464093d865
added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents:
1272
diff
changeset
|
3420 |
|
1942 | 3421 |
"Modified: / 18.9.1997 / 17:00:59 / stefan" |
3422 |
"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
|
3423 |
! |
2a464093d865
added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents:
1272
diff
changeset
|
3424 |
|
2814 | 3425 |
openCBrowser |
3272 | 3426 |
self withWaitCursorDo:[ |
3427 |
CC::Browser openIn:currentDirectory. |
|
3428 |
] |
|
2814 | 3429 |
! |
3430 |
||
172 | 3431 |
openChangesBrowser |
3432 |
"open a change browser on the selected file(s)" |
|
3433 |
||
1939
5947fefec5af
care for newChangesBrowser setting
Claus Gittinger <cg@exept.de>
parents:
1933
diff
changeset
|
3434 |
self openTool:(UserPreferences current changesBrowserClass) |
5947fefec5af
care for newChangesBrowser setting
Claus Gittinger <cg@exept.de>
parents:
1933
diff
changeset
|
3435 |
|
5947fefec5af
care for newChangesBrowser setting
Claus Gittinger <cg@exept.de>
parents:
1933
diff
changeset
|
3436 |
"Modified: / 17.10.1998 / 14:39:15 / cg" |
172 | 3437 |
! |
3438 |
||
252 | 3439 |
openDiffView |
3440 |
"open a diff-view" |
|
3441 |
||
1736
36cab4d1d655
remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents:
1735
diff
changeset
|
3442 |
|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
|
3443 |
|
2969
1ec854b0f2fd
openDiff-viewer - allow two-file-selection
Claus Gittinger <cg@exept.de>
parents:
2956
diff
changeset
|
3444 |
sel := fileListView selection. |
1ec854b0f2fd
openDiff-viewer - allow two-file-selection
Claus Gittinger <cg@exept.de>
parents:
2956
diff
changeset
|
3445 |
(sel size == 2) ifTrue:[ |
1ec854b0f2fd
openDiff-viewer - allow two-file-selection
Claus Gittinger <cg@exept.de>
parents:
2956
diff
changeset
|
3446 |
name1 := fileList at:sel first. |
1ec854b0f2fd
openDiff-viewer - allow two-file-selection
Claus Gittinger <cg@exept.de>
parents:
2956
diff
changeset
|
3447 |
name2 := fileList at:sel last. |
1ec854b0f2fd
openDiff-viewer - allow two-file-selection
Claus Gittinger <cg@exept.de>
parents:
2956
diff
changeset
|
3448 |
] ifFalse:[ |
1ec854b0f2fd
openDiff-viewer - allow two-file-selection
Claus Gittinger <cg@exept.de>
parents:
2956
diff
changeset
|
3449 |
sel := self getSelectedFileName. |
1ec854b0f2fd
openDiff-viewer - allow two-file-selection
Claus Gittinger <cg@exept.de>
parents:
2956
diff
changeset
|
3450 |
|
1ec854b0f2fd
openDiff-viewer - allow two-file-selection
Claus Gittinger <cg@exept.de>
parents:
2956
diff
changeset
|
3451 |
orgName1 := ''. |
1ec854b0f2fd
openDiff-viewer - allow two-file-selection
Claus Gittinger <cg@exept.de>
parents:
2956
diff
changeset
|
3452 |
(sel size > 0 |
1ec854b0f2fd
openDiff-viewer - allow two-file-selection
Claus Gittinger <cg@exept.de>
parents:
2956
diff
changeset
|
3453 |
and:[lastFileDiffDirectory notNil |
1ec854b0f2fd
openDiff-viewer - allow two-file-selection
Claus Gittinger <cg@exept.de>
parents:
2956
diff
changeset
|
3454 |
and:[lastFileDiffDirectory asFilename isDirectory]]) ifTrue:[ |
1ec854b0f2fd
openDiff-viewer - allow two-file-selection
Claus Gittinger <cg@exept.de>
parents:
2956
diff
changeset
|
3455 |
f := lastFileDiffDirectory asFilename construct:sel. |
1ec854b0f2fd
openDiff-viewer - allow two-file-selection
Claus Gittinger <cg@exept.de>
parents:
2956
diff
changeset
|
3456 |
(f exists |
1ec854b0f2fd
openDiff-viewer - allow two-file-selection
Claus Gittinger <cg@exept.de>
parents:
2956
diff
changeset
|
3457 |
and:[f isReadable]) ifTrue:[ |
1ec854b0f2fd
openDiff-viewer - allow two-file-selection
Claus Gittinger <cg@exept.de>
parents:
2956
diff
changeset
|
3458 |
orgName1 := f name |
1ec854b0f2fd
openDiff-viewer - allow two-file-selection
Claus Gittinger <cg@exept.de>
parents:
2956
diff
changeset
|
3459 |
] |
1ec854b0f2fd
openDiff-viewer - allow two-file-selection
Claus Gittinger <cg@exept.de>
parents:
2956
diff
changeset
|
3460 |
]. |
1ec854b0f2fd
openDiff-viewer - allow two-file-selection
Claus Gittinger <cg@exept.de>
parents:
2956
diff
changeset
|
3461 |
name1 := orgName1 asValue. |
1ec854b0f2fd
openDiff-viewer - allow two-file-selection
Claus Gittinger <cg@exept.de>
parents:
2956
diff
changeset
|
3462 |
name2 := self getSelectedFileName asValue. |
1ec854b0f2fd
openDiff-viewer - allow two-file-selection
Claus Gittinger <cg@exept.de>
parents:
2956
diff
changeset
|
3463 |
]. |
1ec854b0f2fd
openDiff-viewer - allow two-file-selection
Claus Gittinger <cg@exept.de>
parents:
2956
diff
changeset
|
3464 |
|
252 | 3465 |
here := currentDirectory pathName. |
3466 |
||
3467 |
box := DialogBox new. |
|
1852 | 3468 |
(box addTextLabel:'show difference between:\\file1 (empty for views contents):' withCRs) adjust:#left. |
252 | 3469 |
box addFilenameInputFieldOn:name1 in:here tabable:true. |
1852 | 3470 |
(box addTextLabel:'and file2:') adjust:#left. |
252 | 3471 |
box addFilenameInputFieldOn:name2 in:here tabable:true. |
3472 |
||
2048 | 3473 |
box addAbortAndOkButtons. |
252 | 3474 |
|
3475 |
box showAtPointer. |
|
3476 |
||
3477 |
box accepted ifTrue:[ |
|
2140
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3478 |
name1 := name1 value. |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3479 |
(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
|
3480 |
"/ text1 := subView contents. |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3481 |
text1 := subView list asStringCollection withTabs. |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3482 |
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
|
3483 |
name1 := nil. |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3484 |
l1 := 'browser contents' |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3485 |
] ifFalse:[ |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3486 |
name1 := currentDirectory filenameFor:name1. |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3487 |
name1 isReadable ifFalse:[ |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3488 |
nm := name1. |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3489 |
name1 exists ifFalse:[ |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3490 |
err := '%1 does not exist'. |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3491 |
] ifTrue:[ |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3492 |
err := '%1 is not readable' |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3493 |
]. |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3494 |
]. |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3495 |
l1 := name1 pathName |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3496 |
]. |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3497 |
|
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3498 |
name2 := currentDirectory filenameFor:name2 value. |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3499 |
err isNil ifTrue:[ |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3500 |
name2 isReadable ifFalse:[ |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3501 |
nm := name2. |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3502 |
name2 exists ifFalse:[ |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3503 |
err := '%1 does not exist'. |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3504 |
] ifTrue:[ |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3505 |
err := '%1 is not readable' |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3506 |
]. |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3507 |
]. |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3508 |
]. |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3509 |
err notNil ifTrue:[ |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3510 |
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
|
3511 |
^ self |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3512 |
]. |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3513 |
|
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3514 |
self withWaitCursorDo:[ |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3515 |
(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
|
3516 |
lastFileDiffDirectory := name1 directoryName |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3517 |
]. |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3518 |
name1 notNil ifTrue:[ |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3519 |
text1 := name1 contents. |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3520 |
]. |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3521 |
text2 := name2 contents. |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3522 |
text1 = text2 ifTrue:[ |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3523 |
self information:'same contents' |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3524 |
] ifFalse:[ |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3525 |
d := DiffTextView |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3526 |
openOn:text1 label:l1 |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3527 |
and:text2 label:name2 pathName. |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3528 |
d label:'file differences'. |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3529 |
] |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3530 |
] |
252 | 3531 |
]. |
3532 |
||
1735
57ebbb06fcd7
only show an infoBox, if files have the same contents
Claus Gittinger <cg@exept.de>
parents:
1732
diff
changeset
|
3533 |
"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
|
3534 |
"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
|
3535 |
"Modified: / 5.5.1999 / 16:04:10 / cg" |
267 | 3536 |
! |
3537 |
||
3538 |
openEditor |
|
3539 |
self openTool:EditTextView |
|
3540 |
! |
|
3541 |
||
3542 |
openHTMLReader |
|
1874 | 3543 |
self openTool:HTMLDocumentView ignoreDirectories:false |
3544 |
||
3545 |
"Modified: / 7.9.1998 / 21:31:58 / cg" |
|
267 | 3546 |
! |
3547 |
||
1834 | 3548 |
openImageEditor |
1874 | 3549 |
[self loadImageAndPerform:#edit] fork |
1834 | 3550 |
|
3551 |
"Modified: / 17.9.1995 / 17:41:24 / claus" |
|
3552 |
"Modified: / 18.9.1997 / 17:05:04 / stefan" |
|
3553 |
"Created: / 13.8.1998 / 22:07:09 / cg" |
|
1874 | 3554 |
"Modified: / 7.9.1998 / 21:31:41 / cg" |
1834 | 3555 |
! |
3556 |
||
267 | 3557 |
openImageInspector |
1874 | 3558 |
[self loadImageAndPerform:#inspect] fork |
1853 | 3559 |
|
3560 |
"Modified: / 17.9.1995 / 17:41:24 / claus" |
|
3561 |
"Modified: / 18.9.1997 / 17:05:04 / stefan" |
|
1874 | 3562 |
"Modified: / 7.9.1998 / 21:31:30 / cg" |
267 | 3563 |
! |
3564 |
||
1964 | 3565 |
openImagePreview |
3566 |
[self loadImageAndPerform:[:img | |
|
3661 | 3567 |
|i top viewer imgFileName| |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3568 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3569 |
top := StandardSystemView new. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3570 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3571 |
viewer := ImageView origin:0.0@0.0 corner:1.0@1.0 in:top. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3572 |
i := img. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3573 |
top extent:200@200. |
3661 | 3574 |
imgFileName := img fileName asFilename. |
3575 |
top label:(imgFileName directoryName asFilename baseName , '/' , imgFileName baseName). |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3576 |
top openAndWait. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3577 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3578 |
(i width > 200 or:[i height > 200]) ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3579 |
i := i magnifiedPreservingRatioTo:200@200. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3580 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3581 |
viewer image:i. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3582 |
]. |
1964 | 3583 |
] fork |
1969 | 3584 |
|
3585 |
"Modified: / 4.12.1998 / 15:49:03 / cg" |
|
1964 | 3586 |
! |
3587 |
||
3001 | 3588 |
openMP3Player |
3589 |
|file| |
|
3590 |
||
3591 |
file := self getSelectedFileName. |
|
3592 |
(file isNil) ifTrue:[ |
|
3593 |
^ self. |
|
3594 |
]. |
|
3595 |
file := currentDirectory filenameFor:file. |
|
3596 |
(MP3PlayerApplication ? SaugFix::MP3PlayerApplication) playSong:file. |
|
3597 |
! |
|
3598 |
||
1994 | 3599 |
openSelectedFilename |
3600 |
|sel| |
|
3601 |
||
3602 |
sel := subView selection. |
|
3603 |
sel notNil ifTrue:[ |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3604 |
sel := sel asString withoutSeparators. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3605 |
sel asFilename exists ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3606 |
self doOpenFile:sel viaDoubleClick:false |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3607 |
] |
1994 | 3608 |
]. |
3609 |
||
3610 |
"Created: / 4.2.1999 / 17:40:42 / cg" |
|
3611 |
"Modified: / 4.2.1999 / 17:47:06 / cg" |
|
3612 |
! |
|
3613 |
||
3536 | 3614 |
openSlideShow |
3615 |
CodingExamples_GUI::SlideShow openIn:currentDirectory |
|
3616 |
||
3617 |
"Created: / 29.12.2001 / 21:56:34 / cg" |
|
3618 |
! |
|
3619 |
||
2825
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
3620 |
openSnapshotImageBrowser |
2844 | 3621 |
^ self openTool:SystemBrowser with:#openOnSnapShotImage: ignoreDirectories:true |
3622 |
! |
|
2825
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
3623 |
|
1731 | 3624 |
openTerminal |
1732 | 3625 |
VT100TerminalView openShellIn:currentDirectory |
1731 | 3626 |
|
3627 |
"Created: / 20.7.1998 / 18:18:15 / cg" |
|
1732 | 3628 |
"Modified: / 20.7.1998 / 18:32:28 / cg" |
1731 | 3629 |
! |
3630 |
||
267 | 3631 |
openTool:aToolClass |
3632 |
"open a tool on the selected file(s)" |
|
3633 |
||
2015 | 3634 |
^ self openTool:aToolClass ignoreDirectories:true |
1874 | 3635 |
|
3636 |
"Modified: / 7.9.1998 / 19:32:10 / cg" |
|
3637 |
! |
|
3638 |
||
3639 |
openTool:aToolClass ignoreDirectories:ignoreDirs |
|
3640 |
"open a tool on the selected file(s)" |
|
3641 |
||
2825
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
3642 |
^ self |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
3643 |
openTool:aToolClass |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
3644 |
with:#openOn: |
2844 | 3645 |
ignoreDirectories:ignoreDirs |
3646 |
! |
|
2825
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
3647 |
|
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
3648 |
openTool:aToolClass with:aSelector ignoreDirectories:ignoreDirs |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
3649 |
"open a tool on the selected file(s)" |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
3650 |
|
2015 | 3651 |
|numItems path tool| |
865
48395e8ecca9
remember executeCommand actions in history as well.
Claus Gittinger <cg@exept.de>
parents:
851
diff
changeset
|
3652 |
|
1883 | 3653 |
aToolClass isNil ifTrue:[ |
2170 | 3654 |
self warn:'Sorry, that tool seems to be not available'. |
3655 |
^ nil. |
|
1883 | 3656 |
]. |
3657 |
||
865
48395e8ecca9
remember executeCommand actions in history as well.
Claus Gittinger <cg@exept.de>
parents:
851
diff
changeset
|
3658 |
(numItems := fileListView selection size) > 2 ifTrue:[ |
2170 | 3659 |
(self |
3660 |
confirm:(resources string:'open for each of the %1 items ?' |
|
3661 |
with:numItems)) ifFalse:[^ self]. |
|
865
48395e8ecca9
remember executeCommand actions in history as well.
Claus Gittinger <cg@exept.de>
parents:
851
diff
changeset
|
3662 |
]. |
48395e8ecca9
remember executeCommand actions in history as well.
Claus Gittinger <cg@exept.de>
parents:
851
diff
changeset
|
3663 |
|
3272 | 3664 |
self withWaitCursorDo:[ |
3665 |
self selectedFilesDo:[:fileName | |
|
3666 |
path := currentDirectory filenameFor:fileName. |
|
3461 | 3667 |
(ignoreDirs not or:[path isDirectory not]) ifTrue:[ |
3668 |
path isAbsolute ifTrue:[ |
|
3669 |
path := path getName. |
|
3670 |
] ifFalse:[ |
|
3671 |
path := path pathName. |
|
3672 |
]. |
|
3673 |
tool := aToolClass perform:aSelector with:path. |
|
3272 | 3674 |
] |
3675 |
]. |
|
267 | 3676 |
]. |
2015 | 3677 |
^ tool |
865
48395e8ecca9
remember executeCommand actions in history as well.
Claus Gittinger <cg@exept.de>
parents:
851
diff
changeset
|
3678 |
|
1874 | 3679 |
"Modified: / 18.9.1997 / 17:06:18 / stefan" |
3680 |
"Created: / 7.9.1998 / 19:31:49 / cg" |
|
2844 | 3681 |
"Modified: / 25.5.1999 / 16:30:35 / cg" |
3682 |
! |
|
1156
f3df28086973
dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents:
1154
diff
changeset
|
3683 |
|
1853 | 3684 |
openZipTool |
2015 | 3685 |
|zipTool| |
3686 |
||
2170 | 3687 |
(zipTool := self openTool:ZipTool) notNil ifTrue:[ |
3688 |
zipTool initialExtractDirectory:currentDirectory |
|
3689 |
]. |
|
1853 | 3690 |
|
3691 |
"Created: / 26.8.1998 / 16:20:55 / cg" |
|
2170 | 3692 |
"Modified: / 25.5.1999 / 16:30:54 / cg" |
1853 | 3693 |
! |
3694 |
||
2567
dd029fea485d
added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents:
2562
diff
changeset
|
3695 |
readAbbrevFile |
3398 | 3696 |
"read the abbrev file and install classes found there as autoloaded classes" |
3697 |
||
3555 | 3698 |
|sel current| |
3699 |
||
3700 |
current := currentDirectory asFilename. |
|
3701 |
sel := fileListView selection. |
|
3702 |
sel size == 0 ifTrue:[ |
|
3703 |
Smalltalk installAutoloadedClassesFrom:(current construct:'abbrev.stc'). |
|
3704 |
^ self |
|
3705 |
]. |
|
3706 |
sel do:[:eachIndex | |
|
3707 |
|f| |
|
3708 |
||
3709 |
f := fileList at:eachIndex ifAbsent:nil. |
|
3710 |
f := current construct:f. |
|
3711 |
f isDirectory ifTrue:[ |
|
3712 |
f := f construct:'abbrev.stc' |
|
3713 |
]. |
|
3714 |
Smalltalk installAutoloadedClassesFrom:f. |
|
3715 |
]. |
|
2567
dd029fea485d
added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents:
2562
diff
changeset
|
3716 |
! |
dd029fea485d
added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents:
2562
diff
changeset
|
3717 |
|
2951
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
3718 |
revisitFile:aFileName |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
3719 |
|lineNr| |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
3720 |
|
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
3721 |
(self askIfModified:'contents has not been saved.\\Modifications will be lost when you proceed.' |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
3722 |
yesButton:'proceed') ifFalse:[ ^self ]. |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
3723 |
|
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
3724 |
self doChangeCurrentDirectoryTo:aFileName asFilename directory updateHistory:false. |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
3725 |
lineNr := fileList indexOf:aFileName asFilename baseName. |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
3726 |
fileListView selection:lineNr. |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
3727 |
self fileGet:true. |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
3728 |
|
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
3729 |
! |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
3730 |
|
1156
f3df28086973
dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents:
1154
diff
changeset
|
3731 |
showOrHideTabView |
f3df28086973
dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents:
1154
diff
changeset
|
3732 |
"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
|
3733 |
|
1834 | 3734 |
showingDetails value "showLongList" ifTrue:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3735 |
tabRulerView isNil ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3736 |
self createTabRulerIn:scrollView superView. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3737 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3738 |
tabRulerView beVisible. |
1758 | 3739 |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3740 |
false "self is3D" ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3741 |
scrollView topInset:(tabRulerView superView height). |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3742 |
tabRulerView superView leftInset:(fileListView originRelativeTo:scrollView) x. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3743 |
] ifFalse:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3744 |
scrollView topInset:(tabRulerView height). |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3745 |
tabRulerView leftInset:(fileListView originRelativeTo:scrollView) x. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3746 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3747 |
tabRulerView hiddenTabs:#(1). |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3748 |
tabRulerView fixedTabs:#(1). |
1156
f3df28086973
dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents:
1154
diff
changeset
|
3749 |
] ifFalse:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3750 |
tabRulerView notNil ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3751 |
tabRulerView beInvisible. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3752 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3753 |
scrollView topInset:0 |
1156
f3df28086973
dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents:
1154
diff
changeset
|
3754 |
]. |
f3df28086973
dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents:
1154
diff
changeset
|
3755 |
tabSpec := nil. |
f3df28086973
dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents:
1154
diff
changeset
|
3756 |
|
1758 | 3757 |
"Created: / 19.4.1997 / 09:50:02 / cg" |
1834 | 3758 |
"Modified: / 4.8.1998 / 13:44:14 / cg" |
172 | 3759 |
! ! |
3760 |
||
3328 | 3761 |
!FileBrowser methodsFor:'help'! |
172 | 3762 |
|
3763 |
helpTextFor:aComponent |
|
3764 |
|s| |
|
3765 |
||
3766 |
aComponent == subView ifTrue:[ |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3767 |
s := 'HELP_SUBVIEW' |
172 | 3768 |
]. |
3769 |
aComponent == fileListView ifTrue:[ |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3770 |
s := 'HELP_FILELIST' |
172 | 3771 |
]. |
3772 |
aComponent == filterField ifTrue:[ |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3773 |
s := 'HELP_FILTER' |
172 | 3774 |
]. |
3775 |
aComponent == labelView ifTrue:[ |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3776 |
s := 'HELP_PATHFIELD' |
172 | 3777 |
]. |
3778 |
aComponent == commandView ifTrue:[ |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3779 |
s := 'HELP_COMMANDVIEW' |
172 | 3780 |
]. |
3781 |
s notNil ifTrue:[ |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3782 |
^ resources string:s |
172 | 3783 |
]. |
3784 |
^ nil |
|
3785 |
! ! |
|
3786 |
||
2116 | 3787 |
!FileBrowser methodsFor:'initialize / release'! |
36 | 3788 |
|
1758 | 3789 |
createTabRulerIn:topFrame |
3790 |
|v| |
|
3791 |
||
3792 |
false "self is3D" ifTrue:[ |
|
2256
3ea6c549b035
let the tabRuler scroll with the fileList.
Claus Gittinger <cg@exept.de>
parents:
2255
diff
changeset
|
3793 |
v := View in:topFrame. |
3ea6c549b035
let the tabRuler scroll with the fileList.
Claus Gittinger <cg@exept.de>
parents:
2255
diff
changeset
|
3794 |
v level:-1. |
3ea6c549b035
let the tabRuler scroll with the fileList.
Claus Gittinger <cg@exept.de>
parents:
2255
diff
changeset
|
3795 |
tabRulerView := TabSpecRuler in:v. |
3ea6c549b035
let the tabRuler scroll with the fileList.
Claus Gittinger <cg@exept.de>
parents:
2255
diff
changeset
|
3796 |
tabRulerView level:1. |
3ea6c549b035
let the tabRuler scroll with the fileList.
Claus Gittinger <cg@exept.de>
parents:
2255
diff
changeset
|
3797 |
v origin:(0.0@0.0) corner:(1.0@10). |
3ea6c549b035
let the tabRuler scroll with the fileList.
Claus Gittinger <cg@exept.de>
parents:
2255
diff
changeset
|
3798 |
tabRulerView origin:(0.0@0.0) corner:(1.0@1.0). |
1758 | 3799 |
] ifFalse:[ |
2256
3ea6c549b035
let the tabRuler scroll with the fileList.
Claus Gittinger <cg@exept.de>
parents:
2255
diff
changeset
|
3800 |
tabRulerView := TabSpecRuler in:topFrame. |
3ea6c549b035
let the tabRuler scroll with the fileList.
Claus Gittinger <cg@exept.de>
parents:
2255
diff
changeset
|
3801 |
tabRulerView origin:(0.0@0.0) corner:(1.0@10). |
1758 | 3802 |
]. |
3803 |
tabRulerView borderWidth:0. |
|
3804 |
tabRulerView synchronousOperation:true. |
|
2256
3ea6c549b035
let the tabRuler scroll with the fileList.
Claus Gittinger <cg@exept.de>
parents:
2255
diff
changeset
|
3805 |
tabRulerView masterView:scrollView scrolledView |
1758 | 3806 |
|
3807 |
"Created: / 27.7.1998 / 20:23:10 / cg" |
|
3808 |
"Modified: / 27.7.1998 / 20:30:10 / cg" |
|
3809 |
! |
|
3810 |
||
172 | 3811 |
currentDirectory:aDirectoryPath |
3812 |
"set the directory to be browsed" |
|
3813 |
||
2216
b84ee099f484
dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
3814 |
|newDirectory| |
b84ee099f484
dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
3815 |
|
b84ee099f484
dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
3816 |
newDirectory := aDirectoryPath asFilename. |
b84ee099f484
dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
3817 |
newDirectory = currentDirectory ifTrue:[ |
b84ee099f484
dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
3818 |
^ self |
b84ee099f484
dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
3819 |
]. |
b84ee099f484
dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
3820 |
|
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
3821 |
currentDirectory := aDirectoryPath asFilename. |
172 | 3822 |
self changed:#path. |
1327 | 3823 |
|
172 | 3824 |
" |
3825 |
tell my subview (whatever that is) to start its file-dialog |
|
3826 |
(i.e. save-as etc.) in that directory |
|
3827 |
" |
|
3828 |
(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
|
3829 |
subView directoryForFileDialog:currentDirectory |
172 | 3830 |
] |
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
3831 |
|
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
3832 |
"Modified: 16.9.1997 / 14:56:17 / stefan" |
1327 | 3833 |
"Modified: 21.9.1997 / 11:28:49 / cg" |
172 | 3834 |
! |
3835 |
||
2116 | 3836 |
destroy |
3837 |
"destroy view and boxes" |
|
3838 |
||
3839 |
ObjectMemory removeDependent:self. |
|
3840 |
self stopUpdateProcess. |
|
3841 |
self stopImageRenderProcess. |
|
3842 |
checkBlock := nil. |
|
3843 |
super destroy |
|
3844 |
||
3845 |
"Modified: 19.4.1997 / 13:51:48 / cg" |
|
3846 |
! |
|
3847 |
||
172 | 3848 |
focusSequence |
3849 |
"return the sequence in which ALT-CursorRight steps focus" |
|
3850 |
||
3851 |
|fs| |
|
3852 |
||
2688
9bb22571f558
include menuPanel in focusSequence
Claus Gittinger <cg@exept.de>
parents:
2676
diff
changeset
|
3853 |
fs := Array |
9bb22571f558
include menuPanel in focusSequence
Claus Gittinger <cg@exept.de>
parents:
2676
diff
changeset
|
3854 |
with:menuPanel |
9bb22571f558
include menuPanel in focusSequence
Claus Gittinger <cg@exept.de>
parents:
2676
diff
changeset
|
3855 |
with:labelView |
9bb22571f558
include menuPanel in focusSequence
Claus Gittinger <cg@exept.de>
parents:
2676
diff
changeset
|
3856 |
with:filterField |
9bb22571f558
include menuPanel in focusSequence
Claus Gittinger <cg@exept.de>
parents:
2676
diff
changeset
|
3857 |
with:fileListView |
9bb22571f558
include menuPanel in focusSequence
Claus Gittinger <cg@exept.de>
parents:
2676
diff
changeset
|
3858 |
with:subView. |
172 | 3859 |
|
3860 |
commandView notNil ifTrue:[ |
|
2688
9bb22571f558
include menuPanel in focusSequence
Claus Gittinger <cg@exept.de>
parents:
2676
diff
changeset
|
3861 |
fs := fs copyWith:commandView |
172 | 3862 |
]. |
3863 |
^fs |
|
3864 |
! |
|
3865 |
||
3866 |
initEvents |
|
3867 |
super initEvents. |
|
3868 |
self enableEvent:#visibilityChange. |
|
3869 |
! |
|
3870 |
||
36 | 3871 |
initialize |
1102 | 3872 |
|frame spacing halfSpacing v topFrame labelFrame filterModel |
3527 | 3873 |
mH lowerFrame| |
36 | 3874 |
|
3875 |
super initialize. |
|
3876 |
||
819
b78a26650047
initialize fileEncoding to #iso8859
Claus Gittinger <cg@exept.de>
parents:
807
diff
changeset
|
3877 |
fileEncoding := #iso8859. "/ native ST/X encoding |
386
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
3878 |
|
52 | 3879 |
"if true, will replace leading spaces by tabs on |
3880 |
file write. If false, they will be written as spaces |
|
3881 |
" |
|
3882 |
compressTabs := resources at:'COMPRESS_TABS' default:true. |
|
3883 |
||
3884 |
" |
|
3885 |
showing long or short by default |
|
3886 |
" |
|
1834 | 3887 |
"/ showLongList := resources at:'LONG_LIST' default:false. |
3888 |
showingDetails := (resources at:'LONG_LIST' default:false) asValue. |
|
3889 |
showingDetails onChangeSend:#detailsSettingChanged to:self. |
|
52 | 3890 |
|
3891 |
" |
|
3892 |
show hidden files or not ? |
|
3893 |
" |
|
1834 | 3894 |
"/ showDotFiles := resources at:'SHOW_DOT_FILES' default:false. |
3895 |
showingHiddenFiles := (resources at:'SHOW_DOT_FILES' default:false) asValue. |
|
3896 |
showingHiddenFiles onChangeSend:#updateCurrentDirectory to:self. |
|
3897 |
||
2031 | 3898 |
" |
3899 |
showing small icons by default |
|
3900 |
" |
|
3901 |
showingBigImagePreview := (resources at:'BIG_IMAGE_PREVIEW' default:false) asValue. |
|
3902 |
showingBigImagePreview onChangeSend:#bigImagePreviewSettingChanged to:self. |
|
3903 |
||
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3904 |
showingTimeAndDate := (resources at:'SHOW_TIME_AND_DATE' default:false) asValue. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3905 |
showingTimeAndDate onChangeSend:#updateCurrentDirectory to:self. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3906 |
|
1834 | 3907 |
sortByWhat := #name asValue. |
3908 |
sortByWhat onChangeSend:#sortChanged to:self. |
|
3909 |
||
3910 |
sortCaseless := (Filename isCaseSensitive not) asValue. |
|
3911 |
sortCaseless onChangeSend:#updateCurrentDirectory to:self. |
|
52 | 3912 |
|
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
3913 |
dosEOLMode := false asValue. |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
3914 |
|
45 | 3915 |
lockUpdate := false. |
3916 |
||
132 | 3917 |
CommandHistory isNil ifTrue:[ |
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
3918 |
CommandHistory := OrderedCollection new. |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
3919 |
CommandHistorySize := 50 |
132 | 3920 |
]. |
36 | 3921 |
DirectoryHistory isNil ifTrue:[ |
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
3922 |
DirectoryHistory := OrderedCollection new. |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
3923 |
DirectoryHistoryWhere := OrderedCollection new. |
2951
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
3924 |
]. |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
3925 |
VisitedFileHistory isNil ifTrue:[ |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
3926 |
VisitedFileHistory := OrderedCollection new. |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
3927 |
]. |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
3928 |
HistorySize isNil ifTrue:[ |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
3929 |
HistorySize := 15 |
36 | 3930 |
]. |
132 | 3931 |
commandIndex := 0. |
36 | 3932 |
|
1784
329e3a904236
ask MIMETypes when mapping suffixes to icons.
Claus Gittinger <cg@exept.de>
parents:
1758
diff
changeset
|
3933 |
icons := Dictionary new. |
1495 | 3934 |
|
3935 |
Icons isNil ifTrue:[ |
|
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
3936 |
self class initializeIcons |
1495 | 3937 |
]. |
3938 |
||
36 | 3939 |
myName := (resources string:self class name). |
3940 |
self label:myName. |
|
45 | 3941 |
|
1834 | 3942 |
menuPanel := MenuPanel in:self. |
3242 | 3943 |
"/ menuPanel level:1. |
1834 | 3944 |
menuPanel verticalLayout:false. |
3945 |
menuPanel receiver:self. |
|
3946 |
menuPanel menu:(self pullDownMenu). |
|
2050 | 3947 |
|
1834 | 3948 |
mH := menuPanel preferredExtent y. |
1846
6b66290db627
geometry fixes for win95 style
Claus Gittinger <cg@exept.de>
parents:
1845
diff
changeset
|
3949 |
menuPanel origin:(0.0 @ 0.0) corner:(1.0 @ (mH)). |
1834 | 3950 |
|
93 | 3951 |
labelFrame := View |
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
3952 |
origin:(0.0 @ mH) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
3953 |
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
|
3954 |
in:self. |
52 | 3955 |
|
1846
6b66290db627
geometry fixes for win95 style
Claus Gittinger <cg@exept.de>
parents:
1845
diff
changeset
|
3956 |
(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
|
3957 |
labelFrame level:1. |
1879 | 3958 |
"/ labelFrame rightInset:-1. |
45 | 3959 |
]. |
36 | 3960 |
|
3961 |
spacing := ViewSpacing. |
|
3962 |
halfSpacing := spacing // 2. |
|
3963 |
||
1100
d9382b49c62d
Use #pushEvent: for timer handling.
Stefan Vogel <sv@exept.de>
parents:
1091
diff
changeset
|
3964 |
" |
d9382b49c62d
Use #pushEvent: for timer handling.
Stefan Vogel <sv@exept.de>
parents:
1091
diff
changeset
|
3965 |
checkBlock is executed by the Processor every checkDelta seconds. |
d9382b49c62d
Use #pushEvent: for timer handling.
Stefan Vogel <sv@exept.de>
parents:
1091
diff
changeset
|
3966 |
We use #pushEvent: to perform the directory update |
d9382b49c62d
Use #pushEvent: for timer handling.
Stefan Vogel <sv@exept.de>
parents:
1091
diff
changeset
|
3967 |
in our windowgroups process. |
d9382b49c62d
Use #pushEvent: for timer handling.
Stefan Vogel <sv@exept.de>
parents:
1091
diff
changeset
|
3968 |
" |
d9382b49c62d
Use #pushEvent: for timer handling.
Stefan Vogel <sv@exept.de>
parents:
1091
diff
changeset
|
3969 |
checkBlock := [self pushEvent:#checkIfDirectoryHasChanged]. |
45 | 3970 |
checkDelta := resources at:'CHECK_DELTA' default:10. |
2220
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
3971 |
doAutoUpdate := true asValue. |
36 | 3972 |
|
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
3973 |
currentDirectory := Filename currentDirectory. |
36 | 3974 |
|
344
3f881dbee13a
use a model for the filter field
Claus Gittinger <cg@exept.de>
parents:
333
diff
changeset
|
3975 |
filterModel := '*' asValue. |
45 | 3976 |
filterField := EditField in:labelFrame. |
1071 | 3977 |
filterField |
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
3978 |
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
|
3979 |
corner:(1.0 @ (filterField heightIncludingBorder + halfSpacing) ). |
1846
6b66290db627
geometry fixes for win95 style
Claus Gittinger <cg@exept.de>
parents:
1845
diff
changeset
|
3980 |
filterField rightInset:(ViewSpacing - halfSpacing). |
344
3f881dbee13a
use a model for the filter field
Claus Gittinger <cg@exept.de>
parents:
333
diff
changeset
|
3981 |
filterField model:filterModel. |
45 | 3982 |
|
1846
6b66290db627
geometry fixes for win95 style
Claus Gittinger <cg@exept.de>
parents:
1845
diff
changeset
|
3983 |
labelFrame corner:(1.0 @ (mH + ViewSpacing + filterField height + halfSpacing)). |
6b66290db627
geometry fixes for win95 style
Claus Gittinger <cg@exept.de>
parents:
1845
diff
changeset
|
3984 |
|
36 | 3985 |
self initializeFilterPattern. |
344
3f881dbee13a
use a model for the filter field
Claus Gittinger <cg@exept.de>
parents:
333
diff
changeset
|
3986 |
filterModel onChangeSend:#filterPatternChanged to:self. |
3f881dbee13a
use a model for the filter field
Claus Gittinger <cg@exept.de>
parents:
333
diff
changeset
|
3987 |
"/ filterField leaveAction:[:key | fileListView scrollToTop. self updateCurrentDirectory]. |
36 | 3988 |
|
1327 | 3989 |
"/ labelView := Label in:labelFrame. |
3990 |
"/ labelView origin:(halfSpacing @ halfSpacing) |
|
3991 |
"/ extent:[((width // 4 * 3) - spacing - borderWidth) |
|
3992 |
"/ @ |
|
3993 |
"/ (filterField heightIncludingBorder) |
|
3994 |
"/ "(font height + font descent)" |
|
3995 |
"/ ]. |
|
3996 |
"/ labelView adjust:#right. |
|
3997 |
"/ labelView borderWidth:0. |
|
3998 |
"/ labelView model:self; menu:#labelMenu; aspect:#path; labelMessage:#path. |
|
3999 |
"/ labelFrame model:self; menu:#labelMenu. |
|
4000 |
||
4001 |
labelView := FilenameEditField in:labelFrame. |
|
4002 |
labelView |
|
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
4003 |
origin:(halfSpacing @ (halfSpacing)) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
4004 |
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
|
4005 |
@ |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
4006 |
(filterField heightIncludingBorder) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
4007 |
"(font height + font descent)" |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
4008 |
]. |
1834 | 4009 |
labelView menu:#labelMenu; |
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
4010 |
aspect:#path; changeMessage:#pathChanged:. |
1327 | 4011 |
labelView model:self. |
2216
b84ee099f484
dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
4012 |
labelView acceptOnExpand:true. |
1327 | 4013 |
labelView backgroundColor:(labelFrame viewBackground). |
73 | 4014 |
labelFrame model:self; menu:#labelMenu. |
1329 | 4015 |
labelView cursorType:#solidCaret; cursorTypeNoFocus:#none. |
4016 |
labelView level:0. |
|
4017 |
labelView borderWidth:0. |
|
4018 |
||
4019 |
killButton := Button label:(resources string:'kill') in:self. |
|
4020 |
"/ killButton origin:(halfSpacing @ halfSpacing) |
|
4021 |
"/ extent:(killButton width @ filterField height). |
|
4022 |
killButton origin:(halfSpacing @ 1.0). |
|
4023 |
killButton topInset:(killButton height negated). |
|
4024 |
killButton beInvisible. |
|
4025 |
||
4026 |
pauseToggle := Toggle label:(resources string:'pause') in:self. |
|
4027 |
"/ pauseToggle origin:((killButton corner x + 50) @ halfSpacing) |
|
4028 |
"/ extent:(pauseToggle width @ filterField height). |
|
4029 |
pauseToggle origin:((killButton corner x + ViewSpacing + 20) @ 1.0). |
|
4030 |
pauseToggle topInset:(pauseToggle height negated). |
|
4031 |
pauseToggle beInvisible. |
|
36 | 4032 |
|
132 | 4033 |
self initializeCommandViewIn:self. |
4034 |
||
4035 |
"/ frame := VariableVerticalPanel |
|
4036 |
"/ origin:[frame borderWidth negated |
|
4037 |
"/ @ |
|
4038 |
"/ labelFrame height |
|
4039 |
"/ "/ (labelView height + labelView origin y + spacing) |
|
4040 |
"/ ] |
|
4041 |
"/ corner:(1.0 @ 1.0) |
|
4042 |
"/ in:self. |
|
4043 |
||
1834 | 4044 |
frame := VariableVerticalPanel origin:0.0@mH corner:1.0@1.0 in:self. |
2739 | 4045 |
frame snapMode:#both. |
132 | 4046 |
frame topInset:labelFrame height. |
4047 |
commandView notNil ifTrue:[ |
|
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
4048 |
frame bottomInset:(commandView height + spacing + spacing) |
132 | 4049 |
]. |
36 | 4050 |
|
1102 | 4051 |
topFrame := View in:frame. |
36 | 4052 |
topFrame origin:(0.0 @ 0.0) corner:(1.0 @ 0.3). |
4053 |
||
1758 | 4054 |
false ifTrue:[ |
4055 |
self createTabRulerIn:topFrame. |
|
4056 |
]. |
|
1102 | 4057 |
|
4058 |
scrollView := ScrollableView in:topFrame. |
|
2252 | 4059 |
scrollView |
2255
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
4060 |
verticalScrollable:true; |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
4061 |
verticalMini:false; |
2252 | 4062 |
horizontalScrollable:true; |
4063 |
horizontalMini:true; |
|
4064 |
autoHideHorizontalScrollBar:true; |
|
2255
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
4065 |
autoHideVerticalScrollBar:false; |
2252 | 4066 |
origin:(0.0 @ 0.0) corner:(1.0 @ 1.0). |
1102 | 4067 |
|
4068 |
fileListView := SelectionInListView new. |
|
4069 |
scrollView scrolledView:fileListView. |
|
36 | 4070 |
fileListView action:[:lineNr | self fileSelect:lineNr]. |
1326 | 4071 |
fileListView doubleClickAction:[:lineNr | self fileDoubleClick:lineNr]. |
36 | 4072 |
fileListView multipleSelectOk:true. |
1010 | 4073 |
fileListView delegate:self. |
98 | 4074 |
fileListView menuHolder:self; menuPerformer:self; menuMessage:#fileListMenu. |
1122
970fc7e88639
support drag out of my list.
Claus Gittinger <cg@exept.de>
parents:
1120
diff
changeset
|
4075 |
fileListView allowDrag:true. |
1156
f3df28086973
dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents:
1154
diff
changeset
|
4076 |
fileListView dragObjectConverter:[:obj | |
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
4077 |
|dir nm path idx| |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
4078 |
|
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
4079 |
nm := obj theObject asString. |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
4080 |
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
|
4081 |
idx == 0 ifTrue:[ |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
4082 |
"/ cannot happen ... |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
4083 |
nil |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
4084 |
] ifFalse:[ |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
4085 |
nm := fileList at:idx. |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
4086 |
dir := currentDirectory pathName asFilename. |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
4087 |
path := dir constructString:nm. |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
4088 |
DropObject newFile:path. |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
4089 |
] |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
4090 |
]. |
1158
ea2cd788ef59
delay tabView origin setting
Claus Gittinger <cg@exept.de>
parents:
1157
diff
changeset
|
4091 |
|
ea2cd788ef59
delay tabView origin setting
Claus Gittinger <cg@exept.de>
parents:
1157
diff
changeset
|
4092 |
"/ sigh - must be delayed - origin is not yet fixe |
ea2cd788ef59
delay tabView origin setting
Claus Gittinger <cg@exept.de>
parents:
1157
diff
changeset
|
4093 |
"/ tabRulerView leftInset:(fileListView originRelativeTo:scrollView) x. |
ea2cd788ef59
delay tabView origin setting
Claus Gittinger <cg@exept.de>
parents:
1157
diff
changeset
|
4094 |
"/ self showOrHideTabView. |
1102 | 4095 |
|
2094 | 4096 |
lowerFrame := View in:frame. |
4097 |
lowerFrame origin:(0.0 @ 0.3) corner:(1.0 @ 1.0). |
|
4098 |
||
4099 |
v := self initializeSubViewIn:lowerFrame. |
|
4100 |
||
36 | 4101 |
subView := v scrolledView. |
4102 |
(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
|
4103 |
subView directoryForFileDialog:currentDirectory |
36 | 4104 |
]. |
4105 |
||
1329 | 4106 |
"/ buttonPanel := HorizontalPanelView in:self. |
4107 |
"/ buttonPanel horizontalLayout:#leftSpace. |
|
4108 |
"/ buttonPanel verticalSpace:0. |
|
4109 |
"/ "/ buttonPanel verticalLayout:#top. |
|
4110 |
"/ buttonPanel borderWidth:0. |
|
4111 |
"/ |
|
4112 |
"/ buttonPanel |
|
4113 |
"/ origin:(0.5 @ halfSpacing) |
|
4114 |
"/ extent:[((width // 4) - spacing - borderWidth) |
|
4115 |
"/ @ |
|
4116 |
"/ (buttonPanel preferredExtent y max:(labelView height)) |
|
4117 |
"/ ]. |
|
4118 |
"/ "/ buttonPanel level:-1. |
|
4119 |
"/ |
|
4120 |
"/ upButton := Button in:buttonPanel. |
|
4121 |
"/ img := Image fromFile:'bitmaps/xpmBitmaps/document_images/tiny_yellow_dir_up.xpm'. |
|
4122 |
"/ upButton label:(img ? 'up'). |
|
4123 |
"/ upButton action:[self changeToParentDirectory]. |
|
1328 | 4124 |
|
36 | 4125 |
ObjectMemory addDependent:self. |
132 | 4126 |
|
1758 | 4127 |
"Modified: / 6.9.1995 / 20:26:06 / claus" |
4128 |
"Modified: / 16.9.1997 / 14:52:46 / stefan" |
|
2252 | 4129 |
"Modified: / 12.7.1999 / 12:59:47 / cg" |
36 | 4130 |
! |
4131 |
||
132 | 4132 |
initializeCommandViewIn:frame |
4133 |
"set up the command view - can be redefined in subclasses as empty, |
|
4134 |
if no commandView is wanted" |
|
4135 |
||
4136 |
||
4137 |
commandView := EditField origin:0.0@1.0 corner:1.0@1.0 in:frame. |
|
3499 | 4138 |
"/ commandView allInset:ViewSpacing//2. |
132 | 4139 |
commandView topInset:(commandView preferredExtent y negated - ViewSpacing). |
4140 |
||
133 | 4141 |
"/ commandView contents:'** no commands which require input here **'. |
132 | 4142 |
|
142 | 4143 |
commandView entryCompletionBlock:[:contents | |
2998
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
4144 |
|newString| |
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
4145 |
|
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
4146 |
newString := self entryCompletion:contents. |
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
4147 |
newString notNil ifTrue:[ |
2803
5c913909a56b
fileNameCompletion now does exactly that;
Claus Gittinger <cg@exept.de>
parents:
2796
diff
changeset
|
4148 |
commandView contents:newString. |
5c913909a56b
fileNameCompletion now does exactly that;
Claus Gittinger <cg@exept.de>
parents:
2796
diff
changeset
|
4149 |
commandView cursorToEndOfLine. |
2998
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
4150 |
]. |
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
4151 |
]. |
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
4152 |
|
132 | 4153 |
commandView leaveAction:[:key | |
2522
036e46c50ac9
care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents:
2512
diff
changeset
|
4154 |
|cmd nCmd empty| |
036e46c50ac9
care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents:
2512
diff
changeset
|
4155 |
|
036e46c50ac9
care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents:
2512
diff
changeset
|
4156 |
(key == #CursorDown |
036e46c50ac9
care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents:
2512
diff
changeset
|
4157 |
or:[key == #CursorUp]) ifTrue:[ |
036e46c50ac9
care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents:
2512
diff
changeset
|
4158 |
nCmd := CommandHistory size. |
036e46c50ac9
care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents:
2512
diff
changeset
|
4159 |
nCmd == 0 ifTrue:[ |
036e46c50ac9
care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents:
2512
diff
changeset
|
4160 |
empty := true |
036e46c50ac9
care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents:
2512
diff
changeset
|
4161 |
] ifFalse:[ |
036e46c50ac9
care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents:
2512
diff
changeset
|
4162 |
key == #CursorUp ifTrue:[ |
036e46c50ac9
care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents:
2512
diff
changeset
|
4163 |
commandIndex == nCmd ifTrue:[ |
036e46c50ac9
care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents:
2512
diff
changeset
|
4164 |
commandView flash. |
036e46c50ac9
care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents:
2512
diff
changeset
|
4165 |
]. |
036e46c50ac9
care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents:
2512
diff
changeset
|
4166 |
commandIndex := (commandIndex + 1) min:nCmd |
036e46c50ac9
care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents:
2512
diff
changeset
|
4167 |
] ifFalse:[ |
036e46c50ac9
care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents:
2512
diff
changeset
|
4168 |
commandIndex == 1 ifTrue:[ |
036e46c50ac9
care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents:
2512
diff
changeset
|
4169 |
commandView flash. |
036e46c50ac9
care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents:
2512
diff
changeset
|
4170 |
empty := true. |
036e46c50ac9
care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents:
2512
diff
changeset
|
4171 |
]. |
036e46c50ac9
care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents:
2512
diff
changeset
|
4172 |
commandIndex := (commandIndex - 1) max:1. |
036e46c50ac9
care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents:
2512
diff
changeset
|
4173 |
]. |
036e46c50ac9
care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents:
2512
diff
changeset
|
4174 |
]. |
036e46c50ac9
care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents:
2512
diff
changeset
|
4175 |
empty == true ifTrue:[ |
036e46c50ac9
care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents:
2512
diff
changeset
|
4176 |
commandView contents:nil |
036e46c50ac9
care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents:
2512
diff
changeset
|
4177 |
] ifFalse:[ |
036e46c50ac9
care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents:
2512
diff
changeset
|
4178 |
commandView contents:(CommandHistory at:commandIndex). |
036e46c50ac9
care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents:
2512
diff
changeset
|
4179 |
] |
036e46c50ac9
care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents:
2512
diff
changeset
|
4180 |
]. |
036e46c50ac9
care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents:
2512
diff
changeset
|
4181 |
key == #Return ifTrue:[ |
036e46c50ac9
care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents:
2512
diff
changeset
|
4182 |
cmd := commandView contents string. |
036e46c50ac9
care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents:
2512
diff
changeset
|
4183 |
|
036e46c50ac9
care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents:
2512
diff
changeset
|
4184 |
subView insertLine:( |
036e46c50ac9
care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents:
2512
diff
changeset
|
4185 |
Text string:('>> ' , cmd) |
036e46c50ac9
care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents:
2512
diff
changeset
|
4186 |
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
|
4187 |
"/ ColoredListEntry string:('>> ' , cmd) color:Color blue |
2522
036e46c50ac9
care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents:
2512
diff
changeset
|
4188 |
) |
036e46c50ac9
care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents:
2512
diff
changeset
|
4189 |
before:(subView cursorLine). |
036e46c50ac9
care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents:
2512
diff
changeset
|
4190 |
subView cursorDown:1. |
133 | 4191 |
|
4192 |
"/ subView insertStringAtCursor:cmd. |
|
4193 |
"/ subView insertCharAtCursor:(Character cr). |
|
132 | 4194 |
|
2522
036e46c50ac9
care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents:
2512
diff
changeset
|
4195 |
(cmd notNil and:[cmd notEmpty]) ifTrue:[ |
036e46c50ac9
care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents:
2512
diff
changeset
|
4196 |
self class addToCommandHistory:cmd for:nil. |
036e46c50ac9
care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents:
2512
diff
changeset
|
4197 |
self doExecuteCommand:cmd replace:false. |
036e46c50ac9
care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents:
2512
diff
changeset
|
4198 |
commandView contents:nil. |
036e46c50ac9
care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents:
2512
diff
changeset
|
4199 |
commandIndex := 0 |
036e46c50ac9
care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents:
2512
diff
changeset
|
4200 |
] |
036e46c50ac9
care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents:
2512
diff
changeset
|
4201 |
] |
132 | 4202 |
]. |
4203 |
||
3499 | 4204 |
"Modified: / 7.9.1995 / 15:48:45 / claus" |
4205 |
"Modified: / 18.9.1997 / 16:55:01 / stefan" |
|
4206 |
"Modified: / 10.12.2001 / 23:57:25 / cg" |
|
132 | 4207 |
! |
4208 |
||
172 | 4209 |
initializeFilterPattern |
4210 |
"set an initial matchpattern - can be redefined in subclasses" |
|
4211 |
||
344
3f881dbee13a
use a model for the filter field
Claus Gittinger <cg@exept.de>
parents:
333
diff
changeset
|
4212 |
filterField model value:'*' |
172 | 4213 |
! |
4214 |
||
4215 |
initializeSubViewIn:frame |
|
4216 |
"set up the contents view - can be redefined in subclasses for |
|
4217 |
different view types (SoundFileBrowser/ImageBrowsers etc.)" |
|
4218 |
||
2094 | 4219 |
|textView| |
4220 |
||
4221 |
textView := HVScrollableView |
|
2572
bdb14ce83fd0
also provide the currentFileInDirectory in doIts.
Claus Gittinger <cg@exept.de>
parents:
2567
diff
changeset
|
4222 |
for:CodeView |
bdb14ce83fd0
also provide the currentFileInDirectory in doIts.
Claus Gittinger <cg@exept.de>
parents:
2567
diff
changeset
|
4223 |
miniScrollerH:true |
bdb14ce83fd0
also provide the currentFileInDirectory in doIts.
Claus Gittinger <cg@exept.de>
parents:
2567
diff
changeset
|
4224 |
miniScrollerV:false |
bdb14ce83fd0
also provide the currentFileInDirectory in doIts.
Claus Gittinger <cg@exept.de>
parents:
2567
diff
changeset
|
4225 |
in:frame. |
2094 | 4226 |
textView origin:(0.0 @ 0.0) corner:(1.0 @ 1.0). |
4227 |
||
2095 | 4228 |
"/ imagePreviewView := HVScrollableView |
4229 |
"/ for:ImageView |
|
4230 |
"/ miniScrollerH:true |
|
4231 |
"/ miniScrollerV:false |
|
4232 |
"/ in:frame. |
|
4233 |
"/ imagePreviewView origin:(0.0 @ 0.0) corner:(1.0 @ 1.0). |
|
4234 |
"/ |
|
4235 |
"/ imagePreviewView beInvisible. |
|
2094 | 4236 |
|
2572
bdb14ce83fd0
also provide the currentFileInDirectory in doIts.
Claus Gittinger <cg@exept.de>
parents:
2567
diff
changeset
|
4237 |
textView doItAction:[:theCode | |
bdb14ce83fd0
also provide the currentFileInDirectory in doIts.
Claus Gittinger <cg@exept.de>
parents:
2567
diff
changeset
|
4238 |
PositionableStream currentFileInDirectoryQuerySignal |
bdb14ce83fd0
also provide the currentFileInDirectory in doIts.
Claus Gittinger <cg@exept.de>
parents:
2567
diff
changeset
|
4239 |
answer:(currentDirectory asFilename) |
bdb14ce83fd0
also provide the currentFileInDirectory in doIts.
Claus Gittinger <cg@exept.de>
parents:
2567
diff
changeset
|
4240 |
do:[ |
bdb14ce83fd0
also provide the currentFileInDirectory in doIts.
Claus Gittinger <cg@exept.de>
parents:
2567
diff
changeset
|
4241 |
Compiler |
bdb14ce83fd0
also provide the currentFileInDirectory in doIts.
Claus Gittinger <cg@exept.de>
parents:
2567
diff
changeset
|
4242 |
evaluate:theCode |
bdb14ce83fd0
also provide the currentFileInDirectory in doIts.
Claus Gittinger <cg@exept.de>
parents:
2567
diff
changeset
|
4243 |
in:nil |
bdb14ce83fd0
also provide the currentFileInDirectory in doIts.
Claus Gittinger <cg@exept.de>
parents:
2567
diff
changeset
|
4244 |
receiver:nil |
2607 | 4245 |
notifying:textView |
2572
bdb14ce83fd0
also provide the currentFileInDirectory in doIts.
Claus Gittinger <cg@exept.de>
parents:
2567
diff
changeset
|
4246 |
logged:true |
bdb14ce83fd0
also provide the currentFileInDirectory in doIts.
Claus Gittinger <cg@exept.de>
parents:
2567
diff
changeset
|
4247 |
ifFail:nil |
bdb14ce83fd0
also provide the currentFileInDirectory in doIts.
Claus Gittinger <cg@exept.de>
parents:
2567
diff
changeset
|
4248 |
] |
bdb14ce83fd0
also provide the currentFileInDirectory in doIts.
Claus Gittinger <cg@exept.de>
parents:
2567
diff
changeset
|
4249 |
]. |
bdb14ce83fd0
also provide the currentFileInDirectory in doIts.
Claus Gittinger <cg@exept.de>
parents:
2567
diff
changeset
|
4250 |
|
2094 | 4251 |
^ textView. |
1158
ea2cd788ef59
delay tabView origin setting
Claus Gittinger <cg@exept.de>
parents:
1157
diff
changeset
|
4252 |
! |
ea2cd788ef59
delay tabView origin setting
Claus Gittinger <cg@exept.de>
parents:
1157
diff
changeset
|
4253 |
|
1247 | 4254 |
postRealize |
4255 |
super postRealize. |
|
1158
ea2cd788ef59
delay tabView origin setting
Claus Gittinger <cg@exept.de>
parents:
1157
diff
changeset
|
4256 |
self showOrHideTabView. |
ea2cd788ef59
delay tabView origin setting
Claus Gittinger <cg@exept.de>
parents:
1157
diff
changeset
|
4257 |
|
1247 | 4258 |
"Created: 24.7.1997 / 18:13:46 / cg" |
172 | 4259 |
! ! |
4260 |
||
1834 | 4261 |
!FileBrowser methodsFor:'menu actions'! |
4262 |
||
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4263 |
addBookmark |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4264 |
self addBookmark:currentDirectory asFilename pathName |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4265 |
! |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4266 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4267 |
addBookmark:path |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4268 |
|idx| |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4269 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4270 |
DirectoryBookmarks isNil ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4271 |
DirectoryBookmarks := OrderedCollection new |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4272 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4273 |
idx := DirectoryBookmarks indexOf:path. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4274 |
idx == 0 ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4275 |
"/ DirectoryBookmarks size >= HistorySize ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4276 |
"/ DirectoryBookmarks removeLast. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4277 |
"/ ]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4278 |
DirectoryBookmarks addLast:path. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4279 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4280 |
! |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4281 |
|
1950 | 4282 |
copyCommandHistory |
4283 |
"copy the command history to the clipBoard" |
|
4284 |
||
4285 |
self setTextSelection:(CommandHistory asStringCollection asString). |
|
4286 |
||
4287 |
"Modified: / 29.10.1998 / 12:17:14 / cg" |
|
4288 |
! |
|
4289 |
||
1837 | 4290 |
copyFileList |
4291 |
"copy fileList to the clipBoard" |
|
4292 |
||
4293 |
self setTextSelection:(fileListView list |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4294 |
collect:[:l | |ll| |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4295 |
ll := l string withoutSeparators. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4296 |
(ll endsWith:' ...') ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4297 |
ll copyWithoutLast:4 |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4298 |
] ifFalse:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4299 |
ll |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4300 |
] |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4301 |
]) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4302 |
asStringCollection asString. |
1837 | 4303 |
|
4304 |
"Modified: / 17.8.1998 / 10:13:10 / cg" |
|
4305 |
! |
|
4306 |
||
1920
adffddc8cfc2
added #copyFilename (to clipboard)
Claus Gittinger <cg@exept.de>
parents:
1912
diff
changeset
|
4307 |
copySelectedFileName |
adffddc8cfc2
added #copyFilename (to clipboard)
Claus Gittinger <cg@exept.de>
parents:
1912
diff
changeset
|
4308 |
"copy the selected filename to the clipBoard (for easy paste)" |
adffddc8cfc2
added #copyFilename (to clipboard)
Claus Gittinger <cg@exept.de>
parents:
1912
diff
changeset
|
4309 |
|
adffddc8cfc2
added #copyFilename (to clipboard)
Claus Gittinger <cg@exept.de>
parents:
1912
diff
changeset
|
4310 |
|sel fileName| |
adffddc8cfc2
added #copyFilename (to clipboard)
Claus Gittinger <cg@exept.de>
parents:
1912
diff
changeset
|
4311 |
|
adffddc8cfc2
added #copyFilename (to clipboard)
Claus Gittinger <cg@exept.de>
parents:
1912
diff
changeset
|
4312 |
sel := fileListView selection. |
adffddc8cfc2
added #copyFilename (to clipboard)
Claus Gittinger <cg@exept.de>
parents:
1912
diff
changeset
|
4313 |
sel size == 1 ifTrue:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4314 |
fileName := fileList at:sel first. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4315 |
self setTextSelection:fileName |
1920
adffddc8cfc2
added #copyFilename (to clipboard)
Claus Gittinger <cg@exept.de>
parents:
1912
diff
changeset
|
4316 |
]. |
adffddc8cfc2
added #copyFilename (to clipboard)
Claus Gittinger <cg@exept.de>
parents:
1912
diff
changeset
|
4317 |
! |
adffddc8cfc2
added #copyFilename (to clipboard)
Claus Gittinger <cg@exept.de>
parents:
1912
diff
changeset
|
4318 |
|
3010 | 4319 |
copySelectedPathName |
4320 |
"copy the selected files pathname to the clipBoard (for easy paste)" |
|
4321 |
||
4322 |
|sel fileName| |
|
4323 |
||
4324 |
sel := fileListView selection. |
|
4325 |
sel size == 1 ifTrue:[ |
|
4326 |
fileName := currentDirectory constructString:(fileList at:sel first). |
|
4327 |
self setTextSelection:fileName |
|
4328 |
]. |
|
4329 |
! |
|
4330 |
||
2562
da7680fe8407
first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents:
2550
diff
changeset
|
4331 |
createProjectAndOpenProjectBrowser |
da7680fe8407
first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents:
2550
diff
changeset
|
4332 |
|nm f s| |
da7680fe8407
first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents:
2550
diff
changeset
|
4333 |
|
da7680fe8407
first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents:
2550
diff
changeset
|
4334 |
nm := currentDirectory baseName. |
da7680fe8407
first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents:
2550
diff
changeset
|
4335 |
f := (currentDirectory construct:nm) withSuffix:'prj'. |
da7680fe8407
first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents:
2550
diff
changeset
|
4336 |
f exists ifTrue:[ |
da7680fe8407
first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents:
2550
diff
changeset
|
4337 |
self warn:'A file named ' , f baseName , ' alredy exists.'. |
da7680fe8407
first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents:
2550
diff
changeset
|
4338 |
^ self. |
da7680fe8407
first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents:
2550
diff
changeset
|
4339 |
]. |
da7680fe8407
first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents:
2550
diff
changeset
|
4340 |
s := f writeStream. |
da7680fe8407
first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents:
2550
diff
changeset
|
4341 |
s nextPutAll:' |
da7680fe8407
first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents:
2550
diff
changeset
|
4342 |
name ''' , nm , ''' |
da7680fe8407
first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents:
2550
diff
changeset
|
4343 |
type #classLibrary |
da7680fe8407
first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents:
2550
diff
changeset
|
4344 |
package #''private:' , nm , ''' |
da7680fe8407
first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents:
2550
diff
changeset
|
4345 |
prerequisites nil |
da7680fe8407
first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents:
2550
diff
changeset
|
4346 |
|
da7680fe8407
first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents:
2550
diff
changeset
|
4347 |
classes #( ) |
da7680fe8407
first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents:
2550
diff
changeset
|
4348 |
'. |
da7680fe8407
first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents:
2550
diff
changeset
|
4349 |
s close. |
da7680fe8407
first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents:
2550
diff
changeset
|
4350 |
ProjectBrowser openOnFile:f. |
da7680fe8407
first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents:
2550
diff
changeset
|
4351 |
! |
da7680fe8407
first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents:
2550
diff
changeset
|
4352 |
|
1834 | 4353 |
menuExit |
4354 |
self closeRequest |
|
4355 |
||
4356 |
"Created: / 4.8.1998 / 13:41:38 / cg" |
|
4357 |
! |
|
4358 |
||
4359 |
menuOSCommand |
|
4360 |
self fileExecute |
|
4361 |
||
4362 |
"Created: / 4.8.1998 / 14:06:54 / cg" |
|
4363 |
! |
|
4364 |
||
4365 |
menuShowFileBrowserDocumentation |
|
4366 |
||
4367 |
"Created: / 4.8.1998 / 14:03:57 / cg" |
|
4368 |
! |
|
4369 |
||
4370 |
openAboutThisApplication |
|
4371 |
"opens an about box for this application." |
|
4372 |
||
3503 | 4373 |
DialogBox aboutClass:self class. |
4374 |
"/ |rev myClass clsRev msg| |
|
4375 |
"/ |
|
4376 |
"/ rev := ''. |
|
4377 |
"/ myClass := self class. |
|
4378 |
"/ |
|
4379 |
"/ (clsRev := myClass revision) notNil ifTrue: [rev := ' (rev: ', clsRev printString, ')']. |
|
4380 |
"/ |
|
4381 |
"/ msg := '\' withCRs , myClass name asBoldText, rev. |
|
4382 |
"/ |
|
4383 |
"/ AboutBox isNil ifTrue:[ |
|
4384 |
"/ "/ this handles bad installations of ST/X, |
|
4385 |
"/ "/ where the AboutBox is missing. |
|
4386 |
"/ "/ (May vanish in the future) |
|
4387 |
"/ ^ self information:msg |
|
4388 |
"/ ]. |
|
4389 |
"/ |
|
4390 |
"/ Dialog |
|
4391 |
"/ about:(resources string:msg) |
|
4392 |
"/ label:(resources string:'About FileBrowser') |
|
4393 |
"/ icon:self class defaultIcon |
|
4394 |
"/ |
|
4395 |
"/ "Modified: / 17.11.2001 / 23:07:25 / cg" |
|
1834 | 4396 |
! |
4397 |
||
4398 |
openHTMLDocument:relativeDocPath |
|
4399 |
HTMLDocumentView openFullOnDocumentationFile:relativeDocPath |
|
4400 |
||
4401 |
"Created: / 4.8.1998 / 14:06:10 / cg" |
|
4402 |
! |
|
4403 |
||
4404 |
pullDownMenu |
|
4405 |
"return the top (pullDown) menu" |
|
4406 |
||
4407 |
<resource: #programMenu> |
|
4408 |
||
3330 | 4409 |
^ self menuFromSpec:self class menuSpec. |
4410 |
"/ |m| |
|
4411 |
"/ |
|
4412 |
"/ m := self class menuSpec. |
|
4413 |
"/ m := m decodeAsLiteralArray. |
|
4414 |
"/ m receiver:self. |
|
4415 |
"/ m findGuiResourcesIn:self. |
|
4416 |
"/ ^ m. |
|
1834 | 4417 |
|
4418 |
"Modified: / 14.8.1998 / 14:09:12 / cg" |
|
4419 |
"Created: / 14.8.1998 / 14:14:16 / cg" |
|
4420 |
! |
|
4421 |
||
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4422 |
removeBookmark |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4423 |
DirectoryBookmarks isNil ifTrue:[ ^ self]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4424 |
DirectoryBookmarks remove:(currentDirectory asFilename pathName) ifAbsent:nil. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4425 |
! |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4426 |
|
1834 | 4427 |
showAboutSTX |
4428 |
ToolApplicationModel openAboutSTX |
|
4429 |
||
4430 |
"Created: / 14.8.1998 / 13:18:41 / cg" |
|
4431 |
! |
|
4432 |
||
4433 |
sortChanged |
|
2020 | 4434 |
"/ Transcript show:'fBrowser:'; showCR:sortByWhat value. |
1834 | 4435 |
self updateCurrentDirectory |
4436 |
||
4437 |
"Created: / 14.8.1998 / 16:17:20 / cg" |
|
4438 |
"Modified: / 14.8.1998 / 16:44:00 / cg" |
|
4439 |
! ! |
|
4440 |
||
2102 | 4441 |
!FileBrowser methodsFor:'menu actions - cvs'! |
4442 |
||
3467 | 4443 |
cvsAddAndCommitSelection |
4444 |
"add files (or all in current directory) and commit" |
|
4445 |
||
4446 |
self cvsAddSelectionWithCommit:true |
|
4447 |
! |
|
4448 |
||
2424 | 4449 |
cvsAddSelection |
4450 |
"add files (or all in current directory)" |
|
4451 |
||
3467 | 4452 |
self cvsAddSelectionWithCommit:false |
4453 |
! |
|
4454 |
||
4455 |
cvsAddSelectionWithCommit:withCommit |
|
4456 |
"add files (or all in current directory) with optional commit" |
|
4457 |
||
2424 | 4458 |
|sel log| |
4459 |
||
4460 |
log := Dialog |
|
4461 |
requestText:(resources string:'enter initial log message') |
|
4462 |
lines:10 |
|
4463 |
columns:70 |
|
4464 |
initialAnswer:nil. |
|
4465 |
||
4466 |
log notNil ifTrue:[ |
|
4467 |
sel := fileListView selection. |
|
4468 |
sel size > 0 ifTrue:[ |
|
4469 |
sel := sel collect:[:rawIndex | fileList at:rawIndex]. |
|
4470 |
sel do:[:fn | |
|
4471 |
self |
|
4472 |
doExecuteCommand:('cvs add -m ''' , log , ''' ' , fn) replace:false |
|
4473 |
] |
|
4474 |
] ifFalse:[ |
|
4475 |
self |
|
4476 |
doExecuteCommand:('cvs add -l -m ''' , log , ''' *') replace:false |
|
4477 |
]. |
|
3467 | 4478 |
withCommit ifTrue:[ |
4479 |
self doExecuteCommand:('cvs commit -l -m ''' , log , '''') replace:false |
|
4480 |
] |
|
2424 | 4481 |
] |
4482 |
! |
|
4483 |
||
2386 | 4484 |
cvsCommitSelection |
4485 |
"commit files (or all in current directory)" |
|
4486 |
||
2956 | 4487 |
|nSel sel log msg| |
4488 |
||
4489 |
nSel := fileListView selection size. |
|
4490 |
nSel == 1 ifTrue:[ |
|
4491 |
msg := resources string:'enter log message for checkIn of ''%1''' with:(fileList at:fileListView selection first) |
|
4492 |
] ifFalse:[ |
|
4493 |
nSel > 1 ifTrue:[ |
|
4494 |
msg := resources string:'enter log message for %1 files to checkIn' with:nSel printString |
|
4495 |
] ifFalse:[ |
|
4496 |
msg := resources string:'enter log message for checkIn' |
|
4497 |
] |
|
4498 |
]. |
|
2386 | 4499 |
|
4500 |
log := Dialog |
|
2956 | 4501 |
requestText:msg |
2386 | 4502 |
lines:10 |
4503 |
columns:70 |
|
4504 |
initialAnswer:nil. |
|
4505 |
||
4506 |
log notNil ifTrue:[ |
|
4507 |
sel := fileListView selection. |
|
4508 |
sel size > 0 ifTrue:[ |
|
4509 |
sel := sel collect:[:rawIndex | fileList at:rawIndex]. |
|
4510 |
sel do:[:fn | |
|
4511 |
self |
|
4512 |
doExecuteCommand:('cvs commit -m ''' , log , ''' ' , fn) replace:false |
|
4513 |
] |
|
4514 |
] ifFalse:[ |
|
4515 |
self |
|
4516 |
doExecuteCommand:('cvs commit -l -m ''' , log , '''') replace:false |
|
4517 |
]. |
|
4518 |
] |
|
4519 |
||
4520 |
"Modified: / 16.12.1998 / 17:30:31 / cg" |
|
4521 |
! |
|
4522 |
||
2102 | 4523 |
cvsRemoveFileAndContainer |
4524 |
"remove the selected file(s) and their CVS containers. |
|
4525 |
Query if user really wants to really remove them." |
|
4526 |
||
4527 |
|sel q| |
|
4528 |
||
4529 |
sel := fileListView selection. |
|
4530 |
sel size > 0 ifTrue:[ |
|
2868 | 4531 |
sel := sel collect:[:rawIndex | fileList at:rawIndex]. |
4532 |
sel size > 1 ifTrue:[ |
|
2939 | 4533 |
q := resources string:'Remove %1 selected files and their CVS containers ?' with:(sel size) |
2868 | 4534 |
] ifFalse:[ |
2939 | 4535 |
q := resources string:'Remove ''%1'' and its CVS container ?' with:(sel first allBold) |
2868 | 4536 |
]. |
4537 |
(self sensor shiftDown |
|
4538 |
or:[self ask:q yesButton:'remove']) ifTrue:[ |
|
4539 |
self withCursor:(Cursor wait) do:[ |
|
4540 |
self doRemoveAndRemoveFromCVS:sel |
|
4541 |
] |
|
4542 |
] |
|
2102 | 4543 |
] |
4544 |
||
4545 |
"Modified: / 16.12.1998 / 17:30:31 / cg" |
|
4546 |
! |
|
4547 |
||
4548 |
cvsUpdateDirectoryLocal |
|
4549 |
"update this directory" |
|
4550 |
||
4551 |
self |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4552 |
doExecuteCommand:'cvs upd -l' replace:false |
2102 | 4553 |
|
4554 |
"Modified: / 16.12.1998 / 17:30:31 / cg" |
|
4555 |
! |
|
4556 |
||
4557 |
cvsUpdateDirectoryRecursive |
|
4558 |
"update this directory" |
|
4559 |
||
4560 |
self |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4561 |
doExecuteCommand:'cvs upd -d' replace:false |
2102 | 4562 |
|
4563 |
"Modified: / 16.12.1998 / 17:30:31 / cg" |
|
4564 |
! |
|
4565 |
||
4566 |
cvsUpdateSelection |
|
4567 |
"update selected files" |
|
4568 |
||
4569 |
|sel| |
|
4570 |
||
4571 |
sel := fileListView selection. |
|
4572 |
sel size > 0 ifTrue:[ |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4573 |
sel := sel collect:[:rawIndex | fileList at:rawIndex]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4574 |
sel do:[:fn | |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4575 |
self |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4576 |
doExecuteCommand:('cvs upd ' , fn) replace:false |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4577 |
] |
2102 | 4578 |
]. |
4579 |
! |
|
4580 |
||
4581 |
doRemoveAndRemoveFromCVS:filesToRemove |
|
4582 |
"remove the selected file(s) and their CVS containers - no questions asked" |
|
4583 |
||
4584 |
|msg idx needUpdate toRemove updateRunning yesToAll| |
|
4585 |
||
4586 |
updateRunning := listUpdateProcess notNil. |
|
4587 |
self stopUpdateProcess. |
|
4588 |
toRemove := OrderedCollection new. |
|
4589 |
||
4590 |
"/ |
|
4591 |
"/ did the directory change in the meanwhile ? |
|
4592 |
"/ |
|
4593 |
needUpdate := (currentDirectory modificationTime > timeOfLastCheck). |
|
4594 |
||
4595 |
yesToAll := false. |
|
4596 |
lockUpdate := true. |
|
4597 |
[ |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4598 |
filesToRemove do:[:fileName | |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4599 |
|f| |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4600 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4601 |
f := currentDirectory construct:fileName. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4602 |
OperatingSystem accessDeniedErrorSignal handle:[:ex| |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4603 |
"was not able to remove it" |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4604 |
msg := (resources string:'cannot remove ''%1'' !!' with:fileName). |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4605 |
self showAlert:msg with:(OperatingSystem lastErrorString) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4606 |
] do:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4607 |
|answer contents| |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4608 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4609 |
(f isSymbolicLink not) ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4610 |
self |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4611 |
doExecuteCommand:('cvs remove -f ' , f baseName) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4612 |
replace:false. |
2102 | 4613 |
|
4614 |
" |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4615 |
self show:nil |
2102 | 4616 |
" |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4617 |
idx := fileList indexOf:fileName. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4618 |
idx ~~ 0 ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4619 |
toRemove add:idx. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4620 |
] |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4621 |
] |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4622 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4623 |
]. |
3596
9761af1f3f72
#valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents:
3568
diff
changeset
|
4624 |
] ensure:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4625 |
lockUpdate := false. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4626 |
fileListView setSelection:nil. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4627 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4628 |
"/ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4629 |
"/ remove reverse - otherwise indices are wrong |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4630 |
"/ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4631 |
toRemove sort. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4632 |
toRemove reverseDo:[:idx | |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4633 |
fileList removeIndex:idx. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4634 |
fileListView removeIndex:idx. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4635 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4636 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4637 |
updateRunning ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4638 |
self updateCurrentDirectory |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4639 |
] ifFalse:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4640 |
" |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4641 |
install a new check after some time |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4642 |
" |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4643 |
needUpdate ifFalse:[timeOfLastCheck := AbsoluteTime now]. |
3520
83cf11e1bf32
schedule checkBlock for the right process
Claus Gittinger <cg@exept.de>
parents:
3503
diff
changeset
|
4644 |
self scheduleCheckBlock. |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4645 |
] |
2102 | 4646 |
]. |
4647 |
||
4648 |
self |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4649 |
doExecuteCommand:('cvs commit -m ''removed via FileBrowser''') |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4650 |
replace:false. |
2102 | 4651 |
|
4652 |
"Modified: / 21.10.1998 / 17:02:11 / cg" |
|
4653 |
! ! |
|
4654 |
||
172 | 4655 |
!FileBrowser methodsFor:'misc user interaction'! |
4656 |
||
1786 | 4657 |
closeRequest |
4658 |
"exit FileBrowser" |
|
4659 |
||
3251 | 4660 |
(self askIfModified:'Contents has not been saved.\\Modifications will be lost when FileBrowser is closed.' |
4661 |
yesButton:'Close') |
|
1786 | 4662 |
ifTrue:[ |
3251 | 4663 |
"/ self windowGroup closeDownViews. |
4664 |
super closeRequest |
|
1786 | 4665 |
] |
4666 |
||
4667 |
"Created: / 3.8.1998 / 19:55:06 / cg" |
|
1834 | 4668 |
"Modified: / 4.8.1998 / 18:21:03 / cg" |
1786 | 4669 |
! |
4670 |
||
1339
4b712d8c1738
Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents:
1336
diff
changeset
|
4671 |
discardChangesDialog |
4b712d8c1738
Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents:
1336
diff
changeset
|
4672 |
"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
|
4673 |
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
|
4674 |
|
3658 | 4675 |
^ self askIfModified:'Contents has not been saved.\\Modifications will be lost when directory is changed.' |
4676 |
yesButton:'Change' |
|
1339
4b712d8c1738
Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents:
1336
diff
changeset
|
4677 |
|
4b712d8c1738
Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents:
1336
diff
changeset
|
4678 |
"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
|
4679 |
! |
4b712d8c1738
Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents:
1336
diff
changeset
|
4680 |
|
2998
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
4681 |
entryCompletion:contents |
3527 | 4682 |
|newString lastWord expandedWord idx onlyOne addSpace fn| |
2998
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
4683 |
|
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
4684 |
"/ find the last word. |
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
4685 |
"/ used to be 'contents asCollectionOfWords last', |
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
4686 |
"/ but we have to care for escaped spaces here (unix) ... |
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
4687 |
|
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
4688 |
idx := contents size. |
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
4689 |
OperatingSystem isUNIXlike ifFalse:[ |
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
4690 |
"/ under MSDOS, the backslash is a directory separator |
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
4691 |
idx := contents lastIndexOf:Character space startingAt:idx. |
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
4692 |
] ifTrue:[ |
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
4693 |
"/ under UNIX, the backslash is a special character escape |
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
4694 |
idx := idx + 1. |
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
4695 |
[ |
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
4696 |
idx := contents lastIndexOf:Character space startingAt:idx-1. |
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
4697 |
] doWhile:[ |
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
4698 |
idx > 1 and:[ (contents at:idx-1) = $\ ] |
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
4699 |
]. |
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
4700 |
]. |
3185 | 4701 |
"/ idx == 0 ifTrue:[ |
4702 |
"/ commandView flash. |
|
4703 |
"/ ^ nil. |
|
4704 |
"/ ]. |
|
2998
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
4705 |
|
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
4706 |
lastWord := contents copyFrom:idx + 1. |
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
4707 |
OperatingSystem isUNIXlike ifTrue:[ |
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
4708 |
(lastWord includes:$\) ifTrue:[ |
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
4709 |
lastWord := lastWord copyReplaceAll:$\ withAll:''. |
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
4710 |
]. |
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
4711 |
]. |
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
4712 |
|
3020 | 4713 |
onlyOne := true. |
2998
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
4714 |
expandedWord := Filename |
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
4715 |
filenameCompletionFor:lastWord |
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
4716 |
directory:currentDirectory |
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
4717 |
directoriesOnly:false |
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
4718 |
filesOnly:false |
3020 | 4719 |
ifMultiple:[:dir | onlyOne := false. commandView flash.]. |
4720 |
||
4721 |
addSpace := false. |
|
4722 |
onlyOne ifTrue:[ |
|
3022 | 4723 |
fn := currentDirectory construct:expandedWord. |
4724 |
(fn exists and:[fn isDirectory not]) ifTrue:[ |
|
3020 | 4725 |
addSpace := true. |
4726 |
]. |
|
4727 |
]. |
|
2998
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
4728 |
|
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
4729 |
OperatingSystem isUNIXlike ifTrue:[ |
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
4730 |
expandedWord := expandedWord copyReplaceAll:(Character space) withAll:'\ '. |
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
4731 |
expandedWord := expandedWord copyReplaceAll:($') withAll:'\'''. |
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
4732 |
expandedWord := expandedWord copyReplaceAll:($() withAll:'\('. |
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
4733 |
expandedWord := expandedWord copyReplaceAll:($)) withAll:'\)'. |
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
4734 |
expandedWord := expandedWord copyReplaceAll:($[) withAll:'\['. |
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
4735 |
expandedWord := expandedWord copyReplaceAll:($]) withAll:'\]'. |
2999 | 4736 |
expandedWord := expandedWord copyReplaceAll:($&) withAll:'\&'. |
4737 |
expandedWord := expandedWord copyReplaceAll:($|) withAll:'\|'. |
|
4738 |
expandedWord := expandedWord copyReplaceAll:($;) withAll:'\;'. |
|
2998
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
4739 |
]. |
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
4740 |
|
3020 | 4741 |
addSpace ifTrue:[ |
4742 |
expandedWord := expandedWord , ' ' |
|
4743 |
]. |
|
2998
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
4744 |
newString := (contents copyTo:idx) , expandedWord. |
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
4745 |
|
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
4746 |
^ newString |
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
4747 |
! |
48eb938bbb7e
fixed filename completion when
Claus Gittinger <cg@exept.de>
parents:
2989
diff
changeset
|
4748 |
|
346 | 4749 |
filterPatternChanged |
1911
6d1b77eda98f
check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents:
1903
diff
changeset
|
4750 |
fileListView scrollToTop. |
6d1b77eda98f
check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents:
1903
diff
changeset
|
4751 |
fileListView deselect. |
346 | 4752 |
self updateCurrentDirectory |
1911
6d1b77eda98f
check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents:
1903
diff
changeset
|
4753 |
|
6d1b77eda98f
check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents:
1903
diff
changeset
|
4754 |
"Modified: / 3.10.1998 / 18:23:34 / cg" |
346 | 4755 |
! |
4756 |
||
172 | 4757 |
update:what with:someArgument from:changedObject |
4758 |
realized ifFalse:[^ self]. |
|
36 | 4759 |
|
172 | 4760 |
(what == #aboutToExit) ifTrue:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4761 |
"system wants to shut down this |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4762 |
- if text was modified, pop up, and ask user and save if requested." |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4763 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4764 |
(subView modified and:[subView contentsWasSaved not]) ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4765 |
self raiseDeiconified. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4766 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4767 |
(self |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4768 |
ask:(resources at:'FileBrowser:\\contents has not been saved.\\Save before exiting ?') |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4769 |
yesButton:'save' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4770 |
noButton:'don''t save') |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4771 |
ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4772 |
subView acceptAction notNil ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4773 |
subView accept |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4774 |
] ifFalse:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4775 |
subView save |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4776 |
] |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4777 |
] |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4778 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4779 |
^ self |
172 | 4780 |
]. |
4781 |
changedObject == tabSpec ifTrue:[ |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4782 |
fileListView invalidate |
172 | 4783 |
]. |
380 | 4784 |
|
585
be0241bf7268
use #invalidate instead of #redraw
Claus Gittinger <cg@exept.de>
parents:
564
diff
changeset
|
4785 |
"Modified: 29.5.1996 / 16:13:43 / cg" |
172 | 4786 |
! ! |
4787 |
||
4788 |
!FileBrowser methodsFor:'pathField user interaction'! |
|
4789 |
||
1271 | 4790 |
addDirToJavaClassPath |
4791 |
"add the current path to javas classPath |
|
4792 |
(only available with ST/J System" |
|
4793 |
||
4794 |
Java addToClassPath:currentDirectory pathName |
|
4795 |
||
4796 |
"Modified: 14.12.1996 / 15:37:47 / cg" |
|
4797 |
"Created: 1.8.1997 / 21:25:22 / cg" |
|
4798 |
! |
|
4799 |
||
1272 | 4800 |
addDirToJavaSourcePath |
4801 |
"add the current path to javas sourcePath |
|
4802 |
(only available with ST/J System" |
|
4803 |
||
4804 |
Java addToSourcePath:currentDirectory pathName |
|
4805 |
||
4806 |
"Modified: 14.12.1996 / 15:37:47 / cg" |
|
4807 |
"Created: 2.8.1997 / 14:11:19 / cg" |
|
4808 |
! |
|
4809 |
||
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4810 |
bookmarksMenuSpec |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4811 |
"return the bookmarksMenu for the path label" |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4812 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4813 |
<resource: #programMenu> |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4814 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4815 |
^ self menuFromSpec:(self class bookmarksMenuSpec). |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4816 |
! |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4817 |
|
172 | 4818 |
changeCurrentDirectory |
4819 |
"if text was modified show a queryBox, |
|
1329 | 4820 |
otherwise ask for & change to that directory" |
172 | 4821 |
|
3658 | 4822 |
"/ self discardChangesDialog ifTrue:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4823 |
self queryForDirectoryToChange |
3658 | 4824 |
"/ ] |
1329 | 4825 |
|
4826 |
"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
|
4827 |
"Modified: 2.10.1997 / 14:09:02 / stefan" |
36 | 4828 |
! |
4829 |
||
172 | 4830 |
changeDirectoryTo:aDirectoryName |
4831 |
"sent from label menu to change back to a previous directory" |
|
132 | 4832 |
|
1339
4b712d8c1738
Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents:
1336
diff
changeset
|
4833 |
self discardChangesDialog ifTrue:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4834 |
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
|
4835 |
]. |
4b712d8c1738
Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents:
1336
diff
changeset
|
4836 |
|
1737 | 4837 |
"Modified: / 2.10.1997 / 14:09:24 / stefan" |
4838 |
"Modified: / 21.7.1998 / 16:38:03 / cg" |
|
172 | 4839 |
! |
4840 |
||
1329 | 4841 |
changeToDefaultDirectory |
4842 |
"if text was modified show a queryBox, |
|
4843 |
otherwise change immediately to the default directory" |
|
4844 |
||
1339
4b712d8c1738
Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents:
1336
diff
changeset
|
4845 |
self discardChangesDialog ifTrue:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4846 |
self doChangeToDefaultDirectory |
1329 | 4847 |
] |
4848 |
||
4849 |
"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
|
4850 |
"Modified: 2.10.1997 / 14:09:33 / stefan" |
1329 | 4851 |
! |
4852 |
||
172 | 4853 |
changeToHomeDirectory |
4854 |
"if text was modified show a queryBox, |
|
1329 | 4855 |
otherwise change immediately to the home directory" |
132 | 4856 |
|
1339
4b712d8c1738
Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents:
1336
diff
changeset
|
4857 |
self discardChangesDialog ifTrue:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4858 |
self doChangeToHomeDirectory |
172 | 4859 |
] |
1329 | 4860 |
|
4861 |
"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
|
4862 |
"Modified: 2.10.1997 / 14:09:42 / stefan" |
172 | 4863 |
! |
45 | 4864 |
|
172 | 4865 |
changeToParentDirectory |
4866 |
"if text was modified show a queryBox, |
|
1329 | 4867 |
otherwise change immediately to the parent directory" |
45 | 4868 |
|
1339
4b712d8c1738
Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents:
1336
diff
changeset
|
4869 |
self discardChangesDialog ifTrue:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4870 |
self doChangeToParentDirectory |
36 | 4871 |
] |
1329 | 4872 |
|
4873 |
"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
|
4874 |
"Modified: 2.10.1997 / 14:09:55 / stefan" |
98 | 4875 |
! |
4876 |
||
172 | 4877 |
copyPath |
4878 |
"copy current path into cut & paste buffer" |
|
4879 |
||
873 | 4880 |
self setTextSelection:currentDirectory pathName |
4881 |
||
4882 |
"Modified: 14.12.1996 / 15:37:47 / cg" |
|
172 | 4883 |
! |
4884 |
||
1893
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
4885 |
fileAddToJavaClassPath |
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
4886 |
"add the current path to javas classPath |
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
4887 |
(only available with ST/J System" |
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
4888 |
|
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
4889 |
|f| |
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
4890 |
|
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
4891 |
f := self getSelectedFileName. |
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
4892 |
f isNil ifTrue:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4893 |
^ self addDirToJavaClassPath |
1893
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
4894 |
]. |
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
4895 |
f := currentDirectory asFilename construct:f. |
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
4896 |
Java addToClassPath:(f pathName) |
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
4897 |
|
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
4898 |
"Created: / 9.11.1998 / 05:41:34 / cg" |
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
4899 |
"Modified: / 9.11.1998 / 05:56:00 / cg" |
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
4900 |
! |
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
4901 |
|
2368 | 4902 |
fileAddToJavaSourcePath |
4903 |
"add the current path to javas sourcePath |
|
4904 |
(only available with ST/J System" |
|
4905 |
||
4906 |
|f| |
|
4907 |
||
4908 |
f := self getSelectedFileName. |
|
4909 |
f isNil ifTrue:[ |
|
4910 |
^ self addDirToJavaSourcePath |
|
4911 |
]. |
|
4912 |
f := currentDirectory asFilename construct:f. |
|
4913 |
Java addToSourcePath:(f pathName) |
|
4914 |
||
4915 |
"Created: / 9.11.1998 / 05:41:34 / cg" |
|
4916 |
"Modified: / 9.11.1998 / 05:56:00 / cg" |
|
4917 |
! |
|
4918 |
||
1893
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
4919 |
fileRemoveFromJavaClassPath |
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
4920 |
"remove the current path from javas classPath |
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
4921 |
(only available with ST/J System" |
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
4922 |
|
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
4923 |
|f| |
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
4924 |
|
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
4925 |
f := self getSelectedFileName. |
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
4926 |
f isNil ifTrue:[ |
2368 | 4927 |
^ self removeDirFromJavaClassPath |
1893
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
4928 |
]. |
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
4929 |
f := currentDirectory asFilename construct:f. |
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
4930 |
Java removeFromClassPath:(f pathName) |
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
4931 |
|
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
4932 |
"Created: / 9.11.1998 / 05:42:05 / cg" |
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
4933 |
"Modified: / 9.11.1998 / 05:56:14 / cg" |
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
4934 |
! |
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
4935 |
|
2368 | 4936 |
fileRemoveFromJavaSourcePath |
4937 |
"remove the current path from javas sourcePath |
|
4938 |
(only available with ST/J System" |
|
4939 |
||
4940 |
|f| |
|
4941 |
||
4942 |
f := self getSelectedFileName. |
|
4943 |
f isNil ifTrue:[ |
|
4944 |
^ self removeDirFromJavaSourcePath |
|
4945 |
]. |
|
4946 |
f := currentDirectory asFilename construct:f. |
|
4947 |
Java removeFromSourcePath:(f pathName) |
|
4948 |
||
4949 |
"Created: / 9.11.1998 / 05:42:05 / cg" |
|
4950 |
"Modified: / 9.11.1998 / 05:56:14 / cg" |
|
4951 |
! |
|
4952 |
||
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4953 |
historyMenuSpec |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4954 |
"return the historyMenu for the path label" |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4955 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4956 |
<resource: #programMenu> |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4957 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4958 |
^ self menuFromSpec:(self class historyMenuSpec). |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4959 |
! |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4960 |
|
172 | 4961 |
labelMenu |
1040 | 4962 |
"return the popUpMenu for the path label" |
4963 |
||
1235
13610578a5d2
resource flag: #menu -> #programMenu
Claus Gittinger <cg@exept.de>
parents:
1227
diff
changeset
|
4964 |
<resource: #programMenu> |
1040 | 4965 |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4966 |
^ self menuFromSpec:(self class directoryMenuSpec). |
1834 | 4967 |
! |
4968 |
||
4969 |
labelMenu_old |
|
4970 |
"return the popUpMenu for the path label" |
|
4971 |
||
4972 |
<resource: #programMenu> |
|
4973 |
||
1737 | 4974 |
|items menu currentIndex| |
1736
36cab4d1d655
remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents:
1735
diff
changeset
|
4975 |
|
36cab4d1d655
remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents:
1735
diff
changeset
|
4976 |
items := #( |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4977 |
('copy path' copyPath ) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4978 |
('-' ) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4979 |
('up' changeToParentDirectory ) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4980 |
('back' changeToPreviousDirectory ) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4981 |
('change to home-directory' changeToHomeDirectory ) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4982 |
('change to default-directory' changeToDefaultDirectory ) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4983 |
('change directory ...' changeCurrentDirectory ) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4984 |
). |
1400 | 4985 |
|
4986 |
(JavaClassReader notNil and:[JavaClassReader isLoaded]) ifTrue:[ |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4987 |
items := items , #( |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4988 |
( '-') |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4989 |
( 'add to JavaClassPath' addDirToJavaClassPath) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4990 |
( 'add to JavaSourcePath' addDirToJavaSourcePath) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4991 |
( 'remove from JavaClassPath' removeDirFromJavaClassPath) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4992 |
( 'remove from JavaSourcePath' removeDirFromJavaSourcePath) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4993 |
). |
1271 | 4994 |
]. |
4995 |
||
172 | 4996 |
DirectoryHistory size > 0 ifTrue:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4997 |
items := items copyWith:#('-'). |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4998 |
items := items , |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
4999 |
(DirectoryHistory |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5000 |
collect:[:dirName | |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5001 |
Array |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5002 |
with:dirName |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5003 |
with:#changeDirectoryTo: |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5004 |
with:nil |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5005 |
with:dirName |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5006 |
] |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5007 |
). |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5008 |
currentIndex := items findFirst:[:i | (i at:1) = currentDirectory pathName]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5009 |
currentIndex == 0 ifTrue:[currentIndex := nil]. |
123 | 5010 |
]. |
172 | 5011 |
|
5012 |
menu := PopUpMenu |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5013 |
itemList:items |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5014 |
resources:resources. |
172 | 5015 |
|
5016 |
previousDirectory isNil ifTrue:[ |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5017 |
menu disable:#changeToPreviousDirectory. |
132 | 5018 |
]. |
1737 | 5019 |
currentIndex notNil ifTrue:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5020 |
menu disable:currentIndex |
1737 | 5021 |
]. |
1400 | 5022 |
(JavaClassReader notNil and:[JavaClassReader isLoaded]) ifTrue:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5023 |
(Java classPath includes:currentDirectory pathName) ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5024 |
menu disable:#addDirToJavaClassPath |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5025 |
] ifFalse:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5026 |
menu disable:#removeDirFromJavaClassPath |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5027 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5028 |
(Java sourcePath includes:currentDirectory pathName) ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5029 |
menu disable:#addDirToJavaSourcePath |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5030 |
] ifFalse:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5031 |
menu disable:#removeDirFromJavaSourcePath |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5032 |
]. |
1393 | 5033 |
]. |
172 | 5034 |
^menu. |
1040 | 5035 |
|
1737 | 5036 |
"Modified: / 21.7.1998 / 16:43:25 / cg" |
1834 | 5037 |
"Created: / 14.8.1998 / 12:10:02 / cg" |
172 | 5038 |
! |
5039 |
||
1327 | 5040 |
pathChanged:newPath |
1339
4b712d8c1738
Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents:
1336
diff
changeset
|
5041 |
"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
|
5042 |
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
|
5043 |
|
2135
88eb91efc5dd
care for caseless systems when entering a fileName
Claus Gittinger <cg@exept.de>
parents:
2129
diff
changeset
|
5044 |
|f name lcName idx| |
1339
4b712d8c1738
Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents:
1336
diff
changeset
|
5045 |
|
4b712d8c1738
Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents:
1336
diff
changeset
|
5046 |
self discardChangesDialog ifTrue:[ |
2216
b84ee099f484
dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
5047 |
f := newPath asFilename. |
b84ee099f484
dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
5048 |
(f isDirectory) ifTrue:[ |
b84ee099f484
dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
5049 |
self changeDirectoryTo:newPath |
b84ee099f484
dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
5050 |
] ifFalse:[ |
b84ee099f484
dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
5051 |
self changeDirectoryTo:(f directoryName). |
b84ee099f484
dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
5052 |
"/ self changed:#path. |
b84ee099f484
dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
5053 |
name := f baseName. |
b84ee099f484
dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
5054 |
idx := fileList indexOf:name. |
b84ee099f484
dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
5055 |
idx = 0 ifTrue:[ |
b84ee099f484
dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
5056 |
lcName := name asLowercase. |
b84ee099f484
dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
5057 |
f class isCaseSensitive ifFalse:[ |
b84ee099f484
dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
5058 |
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
|
5059 |
] |
b84ee099f484
dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
5060 |
]. |
b84ee099f484
dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
5061 |
fileListView selection:idx. |
b84ee099f484
dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
5062 |
self fileSelect:name. |
b84ee099f484
dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
5063 |
self fileGet:true. |
b84ee099f484
dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
5064 |
]. |
1339
4b712d8c1738
Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents:
1336
diff
changeset
|
5065 |
] ifFalse:[ |
2216
b84ee099f484
dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
5066 |
self changed:#path. |
2135
88eb91efc5dd
care for caseless systems when entering a fileName
Claus Gittinger <cg@exept.de>
parents:
2129
diff
changeset
|
5067 |
]. |
88eb91efc5dd
care for caseless systems when entering a fileName
Claus Gittinger <cg@exept.de>
parents:
2129
diff
changeset
|
5068 |
|
88eb91efc5dd
care for caseless systems when entering a fileName
Claus Gittinger <cg@exept.de>
parents:
2129
diff
changeset
|
5069 |
"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
|
5070 |
"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
|
5071 |
"Modified: / 30.4.1999 / 11:19:29 / cg" |
1327 | 5072 |
! |
5073 |
||
172 | 5074 |
queryForDirectoryToChange |
5075 |
"query for new directory" |
|
123 | 5076 |
|
1168
b157f3712548
care for nil returns from userName/groupName * time queries
Claus Gittinger <cg@exept.de>
parents:
1166
diff
changeset
|
5077 |
|queryBox dirName| |
98 | 5078 |
|
172 | 5079 |
queryBox := FilenameEnterBox |
3658 | 5080 |
title:(resources at:'Change directory to:') withCRs |
5081 |
okText:(resources at:'Change') |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5082 |
action:[:newName | dirName := newName]. |
172 | 5083 |
"/ queryBox initialText:''. |
1168
b157f3712548
care for nil returns from userName/groupName * time queries
Claus Gittinger <cg@exept.de>
parents:
1166
diff
changeset
|
5084 |
queryBox showAtPointer. |
b157f3712548
care for nil returns from userName/groupName * time queries
Claus Gittinger <cg@exept.de>
parents:
1166
diff
changeset
|
5085 |
queryBox destroy. |
3658 | 5086 |
dirName size == 0 ifTrue:[^ self]. |
5087 |
||
5088 |
self discardChangesDialog ifTrue:[ |
|
5089 |
self doChangeCurrentDirectoryTo:dirName updateHistory:true. |
|
5090 |
]. |
|
1168
b157f3712548
care for nil returns from userName/groupName * time queries
Claus Gittinger <cg@exept.de>
parents:
1166
diff
changeset
|
5091 |
|
b157f3712548
care for nil returns from userName/groupName * time queries
Claus Gittinger <cg@exept.de>
parents:
1166
diff
changeset
|
5092 |
"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
|
5093 |
"Modified: 28.4.1997 / 22:30:40 / dq" |
1271 | 5094 |
! |
5095 |
||
5096 |
removeDirFromJavaClassPath |
|
5097 |
"remove the current path from javas classPath |
|
5098 |
(only available with ST/J System" |
|
5099 |
||
5100 |
Java removeFromClassPath:currentDirectory pathName |
|
5101 |
||
5102 |
"Modified: 14.12.1996 / 15:37:47 / cg" |
|
5103 |
"Created: 1.8.1997 / 21:25:36 / cg" |
|
1272 | 5104 |
! |
5105 |
||
5106 |
removeDirFromJavaSourcePath |
|
5107 |
"remove the current path from javas sourcePath |
|
5108 |
(only available with ST/J System" |
|
5109 |
||
5110 |
Java removeFromSourcePath:currentDirectory pathName |
|
5111 |
||
5112 |
"Modified: 14.12.1996 / 15:37:47 / cg" |
|
5113 |
"Created: 2.8.1997 / 14:11:41 / cg" |
|
36 | 5114 |
! ! |
5115 |
||
5116 |
!FileBrowser methodsFor:'private'! |
|
5117 |
||
172 | 5118 |
ask:question yesButton:yesButtonText |
5119 |
"common method to ask a yes/no question; return true or false" |
|
36 | 5120 |
|
3209 | 5121 |
^ self ask:question yesButton:yesButtonText noButton:'Cancel' |
172 | 5122 |
! |
93 | 5123 |
|
172 | 5124 |
ask:question yesButton:yesButtonText noButton:noButtonText |
36 | 5125 |
"common method to ask a yes/no question" |
5126 |
||
380 | 5127 |
^ Dialog |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5128 |
confirm:question withCRs |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5129 |
yesLabel:(resources at:yesButtonText) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5130 |
noLabel:(resources at:noButtonText) |
37 | 5131 |
|
380 | 5132 |
"Modified: 21.2.1996 / 01:19:21 / cg" |
36 | 5133 |
! |
5134 |
||
1142
9066d7d02a3a
remember last executed command per suffix; offer this as default.
Claus Gittinger <cg@exept.de>
parents:
1141
diff
changeset
|
5135 |
askForCommandFor:fileName thenDo:aBlock |
172 | 5136 |
"setup and launch a querybox to ask for unix command. |
5137 |
Then evaluate aBlock passing the command-string as argument." |
|
93 | 5138 |
|
1834 | 5139 |
|box osName| |
5140 |
||
5141 |
osName := OperatingSystem platformName. |
|
93 | 5142 |
|
172 | 5143 |
box := FilenameEnterBox |
3280 | 5144 |
title:(resources string:'Execute %1 command:' with:osName) |
5145 |
okText:(resources string:'Execute') |
|
5146 |
action:aBlock. |
|
79 | 5147 |
|
172 | 5148 |
fileName notNil ifTrue:[ |
3280 | 5149 |
self initialCommandFor:fileName into:box. |
172 | 5150 |
]. |
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
5151 |
box directory:currentDirectory. |
1142
9066d7d02a3a
remember last executed command per suffix; offer this as default.
Claus Gittinger <cg@exept.de>
parents:
1141
diff
changeset
|
5152 |
box showAtPointer. |
9066d7d02a3a
remember last executed command per suffix; offer this as default.
Claus Gittinger <cg@exept.de>
parents:
1141
diff
changeset
|
5153 |
box destroy. |
36 | 5154 |
|
1834 | 5155 |
"Modified: / 7.9.1995 / 10:31:54 / claus" |
5156 |
"Modified: / 16.9.1997 / 15:35:10 / stefan" |
|
5157 |
"Modified: / 14.8.1998 / 14:12:52 / cg" |
|
36 | 5158 |
! |
5159 |
||
98 | 5160 |
askIfModified:question yesButton:yesButtonText |
5161 |
"tell user, that code has been modified - let her confirm" |
|
5162 |
||
5163 |
(subView modified not or:[subView contentsWasSaved]) ifTrue:[ |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5164 |
^ true |
98 | 5165 |
]. |
1340 | 5166 |
(self ask:(resources string:question) yesButton:yesButtonText) ifTrue:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5167 |
"/ reset modified flag so question is asked only once |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5168 |
subView modified:false. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5169 |
^ true |
1340 | 5170 |
]. |
5171 |
^ false |
|
1339
4b712d8c1738
Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents:
1336
diff
changeset
|
5172 |
|
4b712d8c1738
Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents:
1336
diff
changeset
|
5173 |
"Modified: 2.10.1997 / 14:23:47 / stefan" |
98 | 5174 |
! |
5175 |
||
1162 | 5176 |
getSelectedFileName |
5177 |
"returns the currently selected file; shows an error if |
|
5178 |
multiple files are selected" |
|
5179 |
||
5180 |
|sel| |
|
5181 |
||
5182 |
sel := fileListView selection. |
|
5183 |
(sel size > 1) ifTrue:[ |
|
2791 | 5184 |
self onlyOneSelection |
1162 | 5185 |
] ifFalse:[ |
2791 | 5186 |
sel size > 0 ifTrue:[ |
5187 |
^ fileList at:sel first ifAbsent:nil |
|
5188 |
] |
|
1162 | 5189 |
]. |
5190 |
^ nil |
|
1911
6d1b77eda98f
check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents:
1903
diff
changeset
|
5191 |
|
6d1b77eda98f
check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents:
1903
diff
changeset
|
5192 |
"Modified: / 3.10.1998 / 18:21:23 / cg" |
1162 | 5193 |
! |
5194 |
||
5195 |
onlyOneSelection |
|
5196 |
"show a warning, that only one file must be selected for |
|
5197 |
this operation" |
|
5198 |
||
5199 |
self warn:'exactly one file must be selected !!' |
|
5200 |
! |
|
5201 |
||
3520
83cf11e1bf32
schedule checkBlock for the right process
Claus Gittinger <cg@exept.de>
parents:
3503
diff
changeset
|
5202 |
scheduleCheckBlock |
83cf11e1bf32
schedule checkBlock for the right process
Claus Gittinger <cg@exept.de>
parents:
3503
diff
changeset
|
5203 |
Processor removeTimedBlock:checkBlock. |
3568 | 5204 |
self windowGroup isNil ifTrue:[ |
5205 |
"/ not yet opened |
|
5206 |
Processor |
|
5207 |
addTimedBlock:checkBlock |
|
5208 |
afterSeconds:checkDelta |
|
5209 |
] ifFalse:[ |
|
5210 |
Processor |
|
5211 |
addTimedBlock:checkBlock |
|
5212 |
for:(self windowGroup process) |
|
5213 |
afterSeconds:checkDelta |
|
5214 |
] |
|
3520
83cf11e1bf32
schedule checkBlock for the right process
Claus Gittinger <cg@exept.de>
parents:
3503
diff
changeset
|
5215 |
! |
83cf11e1bf32
schedule checkBlock for the right process
Claus Gittinger <cg@exept.de>
parents:
3503
diff
changeset
|
5216 |
|
2512
35d2092df60f
autoselect a new created file
Claus Gittinger <cg@exept.de>
parents:
2504
diff
changeset
|
5217 |
selectFile:aFilename |
35d2092df60f
autoselect a new created file
Claus Gittinger <cg@exept.de>
parents:
2504
diff
changeset
|
5218 |
(currentDirectory filenameFor:aFilename) exists ifTrue:[ |
35d2092df60f
autoselect a new created file
Claus Gittinger <cg@exept.de>
parents:
2504
diff
changeset
|
5219 |
fileListView selection:(fileList indexOf:aFilename). |
35d2092df60f
autoselect a new created file
Claus Gittinger <cg@exept.de>
parents:
2504
diff
changeset
|
5220 |
self fileDoubleClick:fileListView selection. |
35d2092df60f
autoselect a new created file
Claus Gittinger <cg@exept.de>
parents:
2504
diff
changeset
|
5221 |
]. |
35d2092df60f
autoselect a new created file
Claus Gittinger <cg@exept.de>
parents:
2504
diff
changeset
|
5222 |
! |
35d2092df60f
autoselect a new created file
Claus Gittinger <cg@exept.de>
parents:
2504
diff
changeset
|
5223 |
|
1162 | 5224 |
selectedFilesDo:aBlock |
5225 |
"evaluate aBlock on all selected files; |
|
5226 |
show a wait cursor while doing this" |
|
5227 |
||
1969 | 5228 |
|sel action| |
1162 | 5229 |
|
5230 |
sel := fileListView selection. |
|
5231 |
sel notNil ifTrue:[ |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5232 |
sel := sel collect:[:aSelectionIndex | |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5233 |
|nm| |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5234 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5235 |
nm := fileList at:aSelectionIndex ifAbsent:nil. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5236 |
nm notNil ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5237 |
nm := nm string. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5238 |
(nm endsWith:' ...') ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5239 |
nm := (nm copyWithoutLast:4) withoutSpaces |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5240 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5241 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5242 |
nm |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5243 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5244 |
action := [ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5245 |
sel do:[:nm | |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5246 |
nm notNil ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5247 |
aBlock value:nm |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5248 |
] |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5249 |
] |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5250 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5251 |
Processor activeProcess == self windowGroup process ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5252 |
self withWaitCursorDo:action |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5253 |
] ifFalse:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5254 |
action value |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5255 |
] |
1162 | 5256 |
] |
5257 |
||
1974 | 5258 |
"Modified: / 16.12.1998 / 17:30:57 / cg" |
1162 | 5259 |
! |
5260 |
||
5261 |
show:something |
|
5262 |
"show something in subview and undef acceptAction" |
|
5263 |
||
5264 |
subView contents:something. |
|
5265 |
subView acceptAction:nil. |
|
5266 |
subView modified:false. |
|
5267 |
currentFileName := nil |
|
5268 |
! |
|
5269 |
||
5270 |
showAlert:aString with:anErrorString |
|
5271 |
"show an alertbox, displaying the last Unix-error" |
|
5272 |
||
5273 |
|msg| |
|
5274 |
||
5275 |
anErrorString isNil ifTrue:[ |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5276 |
msg := aString |
1162 | 5277 |
] ifFalse:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5278 |
msg := aString , '\\(' , anErrorString , ')' |
1162 | 5279 |
]. |
5280 |
self warn:msg withCRs |
|
5281 |
! |
|
5282 |
||
5283 |
withoutHiddenFiles:aCollection |
|
5284 |
"remove hidden files (i.e. those that start with '.') from |
|
5285 |
the list in aCollection" |
|
5286 |
||
5287 |
|newCollection| |
|
5288 |
||
5289 |
newCollection := aCollection species new. |
|
5290 |
aCollection do:[:fname | |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5291 |
|ignore| |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5292 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5293 |
ignore := false. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5294 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5295 |
((fname startsWith:'.') and:[fname ~= '..']) ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5296 |
showingHiddenFiles value "showDotFiles" ifFalse:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5297 |
ignore := true |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5298 |
] |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5299 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5300 |
ignore ifFalse:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5301 |
newCollection add:fname |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5302 |
] |
1162 | 5303 |
]. |
5304 |
^ newCollection |
|
5305 |
||
1834 | 5306 |
"Modified: / 4.8.1998 / 13:46:27 / cg" |
1162 | 5307 |
! ! |
5308 |
||
5309 |
!FileBrowser methodsFor:'private - actions & command execution'! |
|
5310 |
||
5311 |
binaryFileAction:aFilename |
|
5312 |
"for some binary files, if double clicked, we can do some useful |
|
5313 |
action ..." |
|
5314 |
||
2385 | 5315 |
|cmd| |
5316 |
||
5317 |
(aFilename asFilename hasSuffix:'pdf') ifTrue:[ |
|
2434
5cf8d286f680
dont crash if DefaultCommandPerMIME is undefined
Claus Gittinger <cg@exept.de>
parents:
2430
diff
changeset
|
5318 |
DefaultCommandPerMIME isNil ifTrue:[ |
5cf8d286f680
dont crash if DefaultCommandPerMIME is undefined
Claus Gittinger <cg@exept.de>
parents:
2430
diff
changeset
|
5319 |
self class initializeDefaultCommands |
5cf8d286f680
dont crash if DefaultCommandPerMIME is undefined
Claus Gittinger <cg@exept.de>
parents:
2430
diff
changeset
|
5320 |
]. |
2385 | 5321 |
cmd := DefaultCommandPerMIME at:'application/pdf' ifAbsent:nil. |
5322 |
cmd notNil ifTrue:[ |
|
3654 | 5323 |
(OperatingSystem |
5324 |
executeCommand:(cmd bindWith:aFilename with:Display displayName) |
|
5325 |
inDirectory:currentDirectory pathName) |
|
2385 | 5326 |
ifTrue:[^true]. |
5327 |
]. |
|
5328 |
]. |
|
5329 |
||
1330 | 5330 |
(currentDirectory construct:aFilename) isExecutableProgram ifTrue:[ |
2385 | 5331 |
(OperatingSystem executeCommand:aFilename inDirectory:currentDirectory pathName) |
5332 |
ifTrue:[^true]. |
|
1162 | 5333 |
]. |
5334 |
^ self imageAction:aFilename |
|
5335 |
||
5336 |
"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
|
5337 |
"Modified: 18.9.1997 / 17:18:04 / stefan" |
1162 | 5338 |
! |
5339 |
||
1358 | 5340 |
doExecuteCommand:commandArg replace:replace |
1162 | 5341 |
"execute a unix command inserting the output of the command. |
5342 |
If replace is true, all text is replaced by the commands output; |
|
5343 |
otherwise, its inserted as selected text at the cursor position." |
|
5344 |
||
3527 | 5345 |
|command stream line lnr myProcess startLine startCol stopSignal |
1983
50157c992ef9
subprocess name of button event handler
Claus Gittinger <cg@exept.de>
parents:
1981
diff
changeset
|
5346 |
pauseSignal access stillReplacing pauseHolder lowerFrameView |
50157c992ef9
subprocess name of button event handler
Claus Gittinger <cg@exept.de>
parents:
1981
diff
changeset
|
5347 |
buttonWindowGroup| |
1162 | 5348 |
|
1358 | 5349 |
command := commandArg asString. |
5350 |
||
1162 | 5351 |
access := Semaphore forMutualExclusion name:'accessLock'. |
5352 |
stopSignal := Signal new. |
|
1335
4f8ee6e1d8e1
Use signal instead polling for pauseButton in #doExecuteCommand:replace:.
Stefan Vogel <sv@exept.de>
parents:
1334
diff
changeset
|
5353 |
pauseSignal := Signal new. |
1162 | 5354 |
|
5355 |
" |
|
1298
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
5356 |
The following is tricky: |
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
5357 |
the pauseToggle & killButton will |
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
5358 |
be handled by their own windowGroup process. |
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
5359 |
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
|
5360 |
I myself am reading the commands output. |
1162 | 5361 |
" |
1298
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
5362 |
|
1329 | 5363 |
commandView beInvisible. |
5364 |
||
1298
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
5365 |
" |
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
5366 |
must take kill & pauseButtons out of my group |
1162 | 5367 |
" |
1298
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
5368 |
killButton windowGroup:nil. |
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
5369 |
pauseToggle windowGroup:nil. |
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
5370 |
|
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
5371 |
" |
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
5372 |
bring them to front, and turn hidden-mode off |
1162 | 5373 |
" |
1298
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
5374 |
killButton raise; beVisible. |
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
5375 |
pauseToggle raise; beVisible. |
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
5376 |
|
1162 | 5377 |
" |
1298
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
5378 |
kill will make me raise the stopSignal when pressed |
1162 | 5379 |
" |
5380 |
killButton |
|
3025 | 5381 |
action:[ |
5382 |
stream notNil ifTrue:[ |
|
5383 |
access critical:[ |
|
5384 |
myProcess interruptWith:[stopSignal raiseRequest]. |
|
5385 |
] |
|
5386 |
] |
|
5387 |
]. |
|
1298
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
5388 |
|
1162 | 5389 |
" |
1298
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
5390 |
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
|
5391 |
" |
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
5392 |
pauseHolder := false asValue. |
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
5393 |
pauseToggle model:pauseHolder. |
1335
4f8ee6e1d8e1
Use signal instead polling for pauseButton in #doExecuteCommand:replace:.
Stefan Vogel <sv@exept.de>
parents:
1334
diff
changeset
|
5394 |
pauseToggle pressAction:[ |
3025 | 5395 |
stream notNil ifTrue:[ |
5396 |
access critical:[ |
|
5397 |
myProcess interruptWith:[pauseSignal raiseRequest]. |
|
5398 |
] |
|
5399 |
] |
|
1335
4f8ee6e1d8e1
Use signal instead polling for pauseButton in #doExecuteCommand:replace:.
Stefan Vogel <sv@exept.de>
parents:
1334
diff
changeset
|
5400 |
]. |
4f8ee6e1d8e1
Use signal instead polling for pauseButton in #doExecuteCommand:replace:.
Stefan Vogel <sv@exept.de>
parents:
1334
diff
changeset
|
5401 |
|
1298
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
5402 |
|
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
5403 |
" |
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
5404 |
start kill button under its own windowgroup |
1162 | 5405 |
" |
5406 |
killButton openAutonomous. |
|
1983
50157c992ef9
subprocess name of button event handler
Claus Gittinger <cg@exept.de>
parents:
1981
diff
changeset
|
5407 |
buttonWindowGroup := killButton windowGroup. |
50157c992ef9
subprocess name of button event handler
Claus Gittinger <cg@exept.de>
parents:
1981
diff
changeset
|
5408 |
buttonWindowGroup process name:'FileBrowser sub'. |
50157c992ef9
subprocess name of button event handler
Claus Gittinger <cg@exept.de>
parents:
1981
diff
changeset
|
5409 |
buttonWindowGroup process processGroupId:(Processor activeProcess id). |
1298
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
5410 |
|
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
5411 |
" |
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
5412 |
and add the pauseToggle to its windowGroup |
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
5413 |
" |
1983
50157c992ef9
subprocess name of button event handler
Claus Gittinger <cg@exept.de>
parents:
1981
diff
changeset
|
5414 |
pauseToggle windowGroup:buttonWindowGroup. |
1298
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
5415 |
|
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
5416 |
|
4ce2a9cd693a
allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
5417 |
lowerFrameView := subView superView. |
1162 | 5418 |
|
5419 |
" |
|
5420 |
go fork a pipe and read it |
|
5421 |
" |
|
5422 |
self label:(myName , ': executing ' , (command copyTo:(20 min:command size)) , ' ...'). |
|
5423 |
[ |
|
5424 |
self withWaitCursorDo:[ |
|
3025 | 5425 |
stopSignal catch:[ |
5426 |
pauseSignal handle:[:ex| |
|
5427 |
|noPauseSema| |
|
5428 |
||
5429 |
"/ |
|
5430 |
"/ allow interaction with |
|
5431 |
"/ the codeView via the other windowGroup |
|
5432 |
"/ |
|
5433 |
lowerFrameView windowGroup:buttonWindowGroup. |
|
5434 |
||
5435 |
"/ |
|
5436 |
"/ wait for pause to be turned off |
|
5437 |
"/ |
|
5438 |
noPauseSema := Semaphore new. |
|
5439 |
pauseHolder onChangeSend:#signal to:noPauseSema. |
|
5440 |
noPauseSema wait. |
|
5441 |
||
5442 |
"/ |
|
5443 |
"/ no interaction with the codeView ... |
|
5444 |
"/ |
|
5445 |
lowerFrameView windowGroup:(self windowGroup). |
|
5446 |
ex proceed. |
|
5447 |
] do:[ |
|
5448 |
startLine := subView cursorLine. |
|
5449 |
startCol := subView cursorCol. |
|
5450 |
||
5451 |
" |
|
5452 |
this can be a time consuming operation; therefore lower my priority |
|
5453 |
" |
|
5454 |
myProcess := Processor activeProcess. |
|
1912 | 5455 |
"/ myPriority := myProcess priority. |
5456 |
"/ myProcess priority:(Processor userBackgroundPriority). |
|
5457 |
||
3025 | 5458 |
stream := PipeStream |
5459 |
readingFrom:command |
|
5460 |
errorDisposition:#inline |
|
5461 |
inDirectory:currentDirectory. |
|
5462 |
stream notNil ifTrue:[ |
|
5463 |
[ |
|
5464 |
|codeView lines noPauseSema enc| |
|
5465 |
||
5466 |
enc := fileEncoding. |
|
5467 |
enc == #iso8859 ifTrue:[ |
|
5468 |
enc := nil |
|
5469 |
]. |
|
5470 |
||
5471 |
stream buffered:true. |
|
5472 |
codeView := subView. |
|
5473 |
codeView unselect. |
|
5474 |
||
5475 |
replace ifTrue:[ |
|
5476 |
codeView list:nil. |
|
5477 |
lnr := 1. |
|
5478 |
]. |
|
5479 |
||
5480 |
stillReplacing := replace. |
|
5481 |
||
3027 | 5482 |
[ |
3029 | 5483 |
stream readWaitWithTimeout:1. |
5484 |
stream atEnd not |
|
3027 | 5485 |
] whileTrue:[ |
3025 | 5486 |
" |
5487 |
data available; read up to 100 lines |
|
5488 |
and insert as a single junk. This speeds up |
|
5489 |
display of long output (less line-scrolling). |
|
5490 |
" |
|
5491 |
lines := OrderedCollection new:100. |
|
5492 |
||
5493 |
[ |
|
5494 |
line := stream nextLine. |
|
5495 |
line notNil ifTrue:[ |
|
5496 |
enc notNil ifTrue:[ |
|
5497 |
line := line decodeFrom:enc |
|
5498 |
]. |
|
5499 |
lines add:line |
|
5500 |
]. |
|
5501 |
] doWhile:[ |
|
3027 | 5502 |
stream pid notNil |
5503 |
and:[stream canReadWithoutBlocking |
|
3025 | 5504 |
and:[stream atEnd not |
3027 | 5505 |
and:[lines size < 100]]] |
3025 | 5506 |
]. |
5507 |
||
5508 |
" |
|
5509 |
need this critical section; otherwise, |
|
5510 |
we could get the signal while waiting for |
|
5511 |
an expose event ... |
|
5512 |
" |
|
5513 |
access critical:[ |
|
5514 |
lines size > 0 ifTrue:[ |
|
5515 |
stillReplacing ifTrue:[ |
|
5516 |
lines do:[:line | |
|
5517 |
codeView at:lnr put:line withTabsExpanded. |
|
5518 |
codeView cursorToBottom; cursorDown:1. |
|
5519 |
lnr := lnr + 1. |
|
5520 |
lnr > codeView list size ifTrue:[ |
|
5521 |
stillReplacing := false |
|
5522 |
] |
|
5523 |
]. |
|
5524 |
] ifFalse:[ |
|
5525 |
codeView insertLines:lines before:codeView cursorLine. |
|
5526 |
codeView cursorDown:lines size. |
|
5527 |
] |
|
5528 |
]. |
|
5529 |
]. |
|
5530 |
||
5531 |
" |
|
5532 |
give others running at same prio a chance too |
|
5533 |
(especially other FileBrowsers doing the same) |
|
5534 |
" |
|
5535 |
Processor yield |
|
5536 |
]. |
|
3596
9761af1f3f72
#valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents:
3568
diff
changeset
|
5537 |
] ensure:[ |
3025 | 5538 |
stream shutDown "close". stream := nil. |
5539 |
]. |
|
5540 |
||
5541 |
"/ |
|
5542 |
"/ the command could have changed the directory |
|
5543 |
"/ |
|
5544 |
self updateCurrentDirectoryIfChanged |
|
5545 |
]. |
|
5546 |
replace ifTrue:[ |
|
5547 |
subView modified:false. |
|
5548 |
]. |
|
5549 |
] |
|
5550 |
] |
|
1162 | 5551 |
] |
3596
9761af1f3f72
#valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents:
3568
diff
changeset
|
5552 |
] ensure:[ |
3025 | 5553 |
|wg| |
5554 |
||
5555 |
self label:myName; iconLabel:myName. |
|
1912 | 5556 |
"/ myProcess notNil ifTrue:[myProcess priority:myPriority]. |
5557 |
||
3025 | 5558 |
" |
5559 |
hide the button, and make sure it will stay |
|
5560 |
hidden when we are realized again |
|
5561 |
" |
|
5562 |
killButton beInvisible. |
|
5563 |
pauseToggle beInvisible. |
|
5564 |
||
5565 |
commandView beVisible. |
|
5566 |
||
5567 |
" |
|
5568 |
remove the killButton from its group |
|
5569 |
(otherwise, it will be destroyed when we shut down the group) |
|
5570 |
" |
|
5571 |
wg := killButton windowGroup. |
|
5572 |
killButton windowGroup:nil. |
|
5573 |
pauseToggle windowGroup:nil. |
|
5574 |
||
5575 |
" |
|
5576 |
shut down the kill buttons windowgroup |
|
5577 |
" |
|
5578 |
wg notNil ifTrue:[ |
|
5579 |
wg process terminate. |
|
5580 |
]. |
|
5581 |
" |
|
5582 |
clear its action (actually not needed, but |
|
5583 |
releases reference to thisContext earlier) |
|
5584 |
" |
|
5585 |
killButton action:nil. |
|
5586 |
pauseToggle pressAction:nil. |
|
5587 |
"/ |
|
5588 |
"/ allow interaction with the codeView |
|
5589 |
"/ (bring it back into my group) |
|
5590 |
"/ |
|
5591 |
lowerFrameView windowGroup:(self windowGroup). |
|
1162 | 5592 |
]. |
5593 |
||
5594 |
currentFileName isNil ifTrue:[ |
|
3025 | 5595 |
subView modified:false. |
1162 | 5596 |
]. |
5597 |
||
5598 |
subView size > 10000 ifTrue:[ |
|
3025 | 5599 |
self warn:'text quite large now - please cut off some lines' |
1162 | 5600 |
] |
5601 |
||
1358 | 5602 |
"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
|
5603 |
"Modified: / 6.3.1998 / 17:32:03 / stefan" |
1933 | 5604 |
"Modified: / 15.10.1998 / 12:37:52 / cg" |
1162 | 5605 |
! |
5606 |
||
5607 |
imageAction:aFilename |
|
5608 |
"for some image files, if double clicked, we can do some useful |
|
5609 |
action ..." |
|
5610 |
||
2158
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5611 |
|img errmsg| |
1162 | 5612 |
|
5613 |
(Image isImageFileSuffix:(aFilename asFilename suffix)) |
|
5614 |
ifTrue:[ |
|
2158
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5615 |
Image imageLoadErrorSignal handle:[:ex | |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5616 |
errmsg := ex errorString |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5617 |
] do:[ |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5618 |
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
|
5619 |
]. |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5620 |
img notNil ifTrue:[ |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5621 |
ImageEditor openOnImage:img. |
1410 | 5622 |
"/ img inspect. |
2158
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5623 |
^ true |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5624 |
]. |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5625 |
errmsg notNil ifTrue:[ |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5626 |
self warn:errmsg. |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5627 |
] |
1162 | 5628 |
]. |
5629 |
^ false |
|
5630 |
||
2158
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5631 |
"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
|
5632 |
"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
|
5633 |
"Modified: / 18.5.1999 / 15:45:06 / cg" |
1162 | 5634 |
! |
5635 |
||
5636 |
initialCommandFor:fileName into:aBox |
|
5637 |
"set a useful initial command for execute box." |
|
5638 |
||
2345 | 5639 |
|mime cmd select path suffix| |
5640 |
||
5641 |
path := currentDirectory filenameFor:fileName. |
|
5642 |
||
5643 |
mime := MIMETypes mimeTypeForSuffix:fileName asFilename suffix. |
|
5644 |
"/ mime notNil ifTrue:[ |
|
5645 |
"/ cmd := self initialCommandForMIME:mime file:path |
|
5646 |
"/ ]. |
|
1162 | 5647 |
|
5648 |
"/ XXX should be changed to take stuff from a config file |
|
5649 |
"/ XXX or from resources. |
|
5650 |
||
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
5651 |
(path type == #regular) ifTrue:[ |
2345 | 5652 |
path isExecutableProgram ifTrue:[ |
5653 |
aBox initialText:(fileName , ' <arguments>'). |
|
5654 |
^ self |
|
5655 |
]. |
|
5656 |
||
5657 |
select := true. |
|
5658 |
||
5659 |
"some heuristics - my personal preferences ... |
|
5660 |
(actually this should come from a configfile)" |
|
5661 |
||
5662 |
(fileName endsWith:'akefile') ifTrue:[ |
|
5663 |
aBox initialText:'make target' selectFrom:6 to:11. |
|
5664 |
^ self |
|
5665 |
]. |
|
5666 |
||
2346 | 5667 |
DefaultCommandPerMIME isNil ifTrue:[ |
5668 |
self class initializeDefaultCommands |
|
5669 |
]. |
|
5670 |
||
5671 |
cmd := DefaultCommandPerMIME at:mime ifAbsent:nil. |
|
5672 |
cmd notNil ifTrue:[ |
|
5673 |
select := false |
|
5674 |
]. |
|
5675 |
||
5676 |
cmd isNil ifTrue:[ |
|
5677 |
||
5678 |
suffix := path suffix. |
|
5679 |
(suffix = 'C') ifTrue:[ |
|
2345 | 5680 |
cmd := 'g++ -c %1'. |
5681 |
select := 6. |
|
2346 | 5682 |
] ifFalse:[ |
5683 |
suffix := suffix asLowercase. |
|
5684 |
||
5685 |
(suffix = 'taz') ifTrue:[ |
|
5686 |
aBox initialText:'zcat %1 | tar tvf -'. |
|
5687 |
select := false. |
|
5688 |
]. |
|
5689 |
(suffix = 'tar') ifTrue:[ |
|
5690 |
cmd := 'tar tvf %1'. |
|
5691 |
select := 7. |
|
5692 |
]. |
|
5693 |
(suffix = 'zoo') ifTrue:[ |
|
5694 |
cmd := 'zoo -list %1'. |
|
5695 |
select := 9. |
|
5696 |
]. |
|
5697 |
(suffix = 'zip') ifTrue:[ |
|
5698 |
cmd := 'unzip -l %1'. |
|
5699 |
select := 8. |
|
5700 |
]. |
|
5701 |
(suffix = 'jar') ifTrue:[ |
|
5702 |
cmd := 'unzip -l %1'. |
|
5703 |
select := 8. |
|
5704 |
]. |
|
5705 |
(suffix = 'z') ifTrue:[ |
|
5706 |
(fileName asLowercase endsWith:'tar.z') ifTrue:[ |
|
5707 |
cmd := 'zcat %1 | tar tvf -'. |
|
5708 |
select := false. |
|
5709 |
] ifFalse:[ |
|
5710 |
cmd := 'uncompress %1' |
|
5711 |
]. |
|
5712 |
]. |
|
5713 |
(suffix = 'gz') ifTrue:[ |
|
5714 |
(fileName asLowercase endsWith:'tar.gz') ifTrue:[ |
|
5715 |
cmd := ('gunzip < %1 | tar tvf -' ). |
|
5716 |
select := false. |
|
5717 |
] ifFalse:[ |
|
5718 |
cmd := 'gunzip %1'. |
|
5719 |
]. |
|
5720 |
]. |
|
5721 |
(suffix = 'html') ifTrue:[ |
|
5722 |
cmd := 'netscape %1' |
|
5723 |
]. |
|
5724 |
(suffix = 'htm') ifTrue:[ |
|
5725 |
cmd := 'netscape %1' |
|
5726 |
]. |
|
5727 |
(suffix = 'uue') ifTrue:[ |
|
5728 |
cmd := 'uudecode %1' |
|
5729 |
]. |
|
5730 |
(suffix = 'c') ifTrue:[ |
|
5731 |
cmd := 'cc -c %1'. |
|
5732 |
select := 5. |
|
5733 |
]. |
|
5734 |
(suffix = 'cc') ifTrue:[ |
|
5735 |
cmd := 'g++ -c %1'. |
|
5736 |
select := 6. |
|
5737 |
]. |
|
5738 |
(suffix = 'xbm') ifTrue:[ |
|
5739 |
cmd := 'bitmap %1' |
|
5740 |
]. |
|
5741 |
(suffix = 'ps') ifTrue:[ |
|
5742 |
cmd := 'ghostview %1' |
|
5743 |
]. |
|
5744 |
((suffix = '1') or:[suffix = 'man']) ifTrue:[ |
|
5745 |
cmd := 'nroff -man %1'. |
|
5746 |
select := 10. |
|
5747 |
]. |
|
2345 | 5748 |
]. |
5749 |
]. |
|
5750 |
||
5751 |
cmd isNil ifTrue:[ |
|
5752 |
DefaultCommandPerSuffix isNil ifTrue:[ |
|
5753 |
cmd := '<cmd>' |
|
5754 |
] ifFalse:[ |
|
5755 |
cmd := DefaultCommandPerSuffix |
|
5756 |
at:suffix |
|
5757 |
ifAbsent:'<cmd>'. |
|
5758 |
]. |
|
5759 |
cmd := cmd , ' %1'. |
|
5760 |
]. |
|
5761 |
||
5762 |
cmd := cmd bindWith:fileName. |
|
5763 |
select == false ifTrue:[ |
|
5764 |
aBox initialText:cmd |
|
5765 |
] ifFalse:[ |
|
5766 |
select class == Interval ifTrue:[ |
|
5767 |
aBox initialText:cmd selectFrom:select start to:select stop |
|
5768 |
] ifFalse:[ |
|
5769 |
select isInteger ifFalse:[ |
|
5770 |
select := (cmd indexOf:Character space ifAbsent:[cmd size + 1]) - 1. |
|
5771 |
]. |
|
5772 |
aBox initialText:cmd selectFrom:1 to:select |
|
5773 |
]. |
|
5774 |
] |
|
1162 | 5775 |
] |
5776 |
||
1542 | 5777 |
"Modified: / 24.9.1997 / 16:34:52 / stefan" |
5778 |
"Modified: / 9.4.1998 / 17:15:57 / cg" |
|
1162 | 5779 |
! |
5780 |
||
5781 |
nonBinaryFileAction:aFilename |
|
5782 |
"for some nonBinary files, if double clicked, we can do some useful |
|
5783 |
action ..." |
|
5784 |
||
1493 | 5785 |
|fullPath| |
1162 | 5786 |
|
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
5787 |
fullPath := currentDirectory filenameFor:aFilename. |
2550 | 5788 |
((fullPath hasSuffix:'htm') |
5789 |
or:[(fullPath hasSuffix:'HTM') |
|
5790 |
or:[(fullPath hasSuffix:'html') |
|
5791 |
or:[(fullPath hasSuffix:'HTML')]]]) ifTrue:[ |
|
2385 | 5792 |
HTMLDocumentView openOn:fullPath pathName. |
5793 |
^ true |
|
2091 | 5794 |
]. |
5795 |
((fullPath hasSuffix:'prj') |
|
5796 |
and:[ProjectBrowser notNil]) ifTrue:[ |
|
2385 | 5797 |
ProjectBrowser openOnFile:fullPath pathName. |
5798 |
^ true |
|
1162 | 5799 |
]. |
5800 |
||
5801 |
OperatingSystem isUNIXlike ifTrue:[ |
|
2385 | 5802 |
(#('.man' '.1' '.2' '.3') findFirst:[:suff | fullPath hasSuffix:suff]) ~~ 0 |
5803 |
ifTrue:[ |
|
5804 |
HTMLDocumentView openFullOnText:(HTMLDocGenerator manPageForFile:fullPath pathName). |
|
5805 |
^ true |
|
5806 |
]. |
|
1162 | 5807 |
]. |
5808 |
^ self imageAction:aFilename |
|
5809 |
||
5810 |
"Created: 19.6.1996 / 09:36:38 / cg" |
|
5811 |
"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
|
5812 |
"Modified: 18.9.1997 / 16:58:40 / stefan" |
1162 | 5813 |
! ! |
5814 |
||
5815 |
!FileBrowser methodsFor:'private - directory stuff'! |
|
5816 |
||
1371
a80db8d0e311
remember directory in history when entering (not when leaving)
Claus Gittinger <cg@exept.de>
parents:
1358
diff
changeset
|
5817 |
addToHistory:path |
2951
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
5818 |
self class addToHistory:path |
1371
a80db8d0e311
remember directory in history when entering (not when leaving)
Claus Gittinger <cg@exept.de>
parents:
1358
diff
changeset
|
5819 |
! |
a80db8d0e311
remember directory in history when entering (not when leaving)
Claus Gittinger <cg@exept.de>
parents:
1358
diff
changeset
|
5820 |
|
172 | 5821 |
changeToPreviousDirectory |
5822 |
"if text was modified show a queryBox, |
|
5823 |
otherwise change immediately to previous directory." |
|
93 | 5824 |
|
172 | 5825 |
previousDirectory isNil ifTrue:[^ self]. |
1339
4b712d8c1738
Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents:
1336
diff
changeset
|
5826 |
self discardChangesDialog ifTrue:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5827 |
self doChangeCurrentDirectoryTo:previousDirectory updateHistory:false |
172 | 5828 |
] |
1339
4b712d8c1738
Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents:
1336
diff
changeset
|
5829 |
|
4b712d8c1738
Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents:
1336
diff
changeset
|
5830 |
"Modified: 2.10.1997 / 14:13:40 / stefan" |
36 | 5831 |
! |
5832 |
||
98 | 5833 |
checkIfDirectoryHasChanged |
5834 |
"every checkDelta secs, check if directoy has changed and update the list if so. |
|
5835 |
Also, we check if the file shown has been touched in the meanwhile (for example, |
|
5836 |
from another browser) and say 'outdated' in the label if so. |
|
5837 |
This avoids confusion if the same file is being edited by two browsers. (or other editors). |
|
5838 |
If the text shown in the codeView has been edited, 'modified' is shown. |
|
5839 |
" |
|
5840 |
||
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
5841 |
|oldSelection nOld newState msg newLabel t| |
98 | 5842 |
|
5843 |
shown ifTrue:[ |
|
2220
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
5844 |
currentDirectory notNil ifTrue:[ |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
5845 |
(lockUpdate or:[doAutoUpdate value not]) ifTrue:[ |
3520
83cf11e1bf32
schedule checkBlock for the right process
Claus Gittinger <cg@exept.de>
parents:
3503
diff
changeset
|
5846 |
self scheduleCheckBlock. |
2220
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
5847 |
^ self |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
5848 |
]. |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
5849 |
|
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
5850 |
subView modified ifTrue:[ |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
5851 |
newState := ' (modified)' |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
5852 |
]. |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
5853 |
|
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
5854 |
(currentDirectory isReadable) ifTrue:[ |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
5855 |
Processor removeTimedBlock:checkBlock. |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
5856 |
|
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
5857 |
t := currentDirectory modificationTime. |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
5858 |
(t notNil and:[t > timeOfLastCheck]) ifTrue:[ |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
5859 |
nOld := fileListView numberOfSelections. |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
5860 |
oldSelection := fileListView selectionValue. |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
5861 |
self updateCurrentDirectory. |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
5862 |
nOld ~~ 0 ifTrue:[ |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
5863 |
nOld > 1 ifTrue:[ |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
5864 |
oldSelection do:[:element | |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
5865 |
fileListView addElementToSelection:element |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
5866 |
] |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
5867 |
] ifFalse:[ |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
5868 |
fileListView selectElementWithoutScroll:oldSelection |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
5869 |
] |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
5870 |
]. |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
5871 |
] ifFalse:[ |
3520
83cf11e1bf32
schedule checkBlock for the right process
Claus Gittinger <cg@exept.de>
parents:
3503
diff
changeset
|
5872 |
self scheduleCheckBlock. |
2220
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
5873 |
]. |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
5874 |
|
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
5875 |
currentFileName notNil ifTrue:[ |
3399 | 5876 |
|f mod| |
2220
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
5877 |
f := currentDirectory construct:currentFileName. |
3399 | 5878 |
(f exists not or:[(mod := f modificationTime) isNil]) ifTrue:[ |
2220
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
5879 |
newState := ' (removed)'. |
3399 | 5880 |
] ifFalse:[ |
5881 |
mod > timeOfFileRead ifTrue:[ |
|
2220
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
5882 |
newState := ' (outdated)'. |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
5883 |
subView modified ifTrue:[ |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
5884 |
newState := ' (modified & outdated)' |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
5885 |
] |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
5886 |
]. |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
5887 |
]. |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
5888 |
]. |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
5889 |
] ifFalse:[ |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
5890 |
" |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
5891 |
if the directory has been deleted, or is not readable ... |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
5892 |
" |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
5893 |
(currentDirectory exists) ifFalse:[ |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
5894 |
msg := 'FileBrowser:\\directory %1 is gone ?!!?' |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
5895 |
] ifTrue:[ |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
5896 |
msg := 'FileBrowser:\\directory %1 is no longer readable ?!!?' |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
5897 |
]. |
3417
1fee40dd5af4
win32: do not x-laet backslash in a filename to cr in warnbox
Claus Gittinger <cg@exept.de>
parents:
3414
diff
changeset
|
5898 |
"/ sigh - avoid translating backslashes in WIN-filenames |
3528 | 5899 |
msg := (resources string:msg) withCRs. |
5900 |
Dialog warn:(msg bindWith:currentDirectory pathName allBold). |
|
2220
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
5901 |
|
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
5902 |
fileListView contents:nil. |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
5903 |
newLabel := myName , ': directory is gone !!'. |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
5904 |
]. |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
5905 |
|
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
5906 |
newState notNil ifTrue:[ |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
5907 |
newLabel := myName. |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
5908 |
currentFileName notNil ifTrue:[ |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
5909 |
newLabel := newLabel , ': ' , currentFileName |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
5910 |
]. |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
5911 |
newLabel := newLabel , newState. |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
5912 |
]. |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
5913 |
newLabel notNil ifTrue:[ |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
5914 |
self label:newLabel. |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
5915 |
] |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
5916 |
] |
98 | 5917 |
] |
1168
b157f3712548
care for nil returns from userName/groupName * time queries
Claus Gittinger <cg@exept.de>
parents:
1166
diff
changeset
|
5918 |
|
1380
547d31bfa12c
warning string fixed when directory vanishes
Claus Gittinger <cg@exept.de>
parents:
1374
diff
changeset
|
5919 |
"Modified: / 28.4.1997 / 22:31:02 / dq" |
547d31bfa12c
warning string fixed when directory vanishes
Claus Gittinger <cg@exept.de>
parents:
1374
diff
changeset
|
5920 |
"Modified: / 16.9.1997 / 15:17:15 / stefan" |
3417
1fee40dd5af4
win32: do not x-laet backslash in a filename to cr in warnbox
Claus Gittinger <cg@exept.de>
parents:
3414
diff
changeset
|
5921 |
"Modified: / 15.11.2001 / 21:27:05 / cg" |
98 | 5922 |
! |
5923 |
||
172 | 5924 |
doChangeCurrentDirectoryTo:fileName updateHistory:updateHistory |
5925 |
"verify argument is name of a readable & executable directory |
|
5926 |
and if so, go there" |
|
5927 |
||
1317 | 5928 |
|msg path idx f| |
172 | 5929 |
|
5930 |
self label:myName; iconLabel:myName. |
|
5931 |
fileName notNil ifTrue:[ |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5932 |
(f := fileName asFilename) isAbsolute ifFalse:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5933 |
f := currentDirectory filenameFor:fileName. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5934 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5935 |
f := f asAbsoluteFilename. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5936 |
(f isDirectory) ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5937 |
(f isReadable) ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5938 |
(f isExecutable) ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5939 |
path := currentDirectory pathName. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5940 |
previousDirectory := path. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5941 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5942 |
" |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5943 |
remember where we are positioned in the fileList |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5944 |
(in case we want to return) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5945 |
" |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5946 |
idx := DirectoryHistory indexOf:path. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5947 |
idx ~~ 0 ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5948 |
DirectoryHistoryWhere at:idx put:fileListView firstLineShown |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5949 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5950 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5951 |
updateHistory ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5952 |
self addToHistory:path. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5953 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5954 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5955 |
self setCurrentDirectory:(f pathName). |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5956 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5957 |
"/ fetch the new path. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5958 |
path := currentDirectory pathName. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5959 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5960 |
" |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5961 |
if we have already been there, look for the |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5962 |
position offset, and scroll the fileList |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5963 |
" |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5964 |
idx := DirectoryHistory indexOf:path. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5965 |
idx ~~ 0 ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5966 |
|pos| |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5967 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5968 |
pos := DirectoryHistoryWhere at:idx. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5969 |
pos notNil ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5970 |
fileListView scrollToLine:pos. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5971 |
] |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5972 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5973 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5974 |
updateHistory ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5975 |
self addToHistory:path. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5976 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5977 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5978 |
^ self |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5979 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5980 |
msg := 'cannot change directory to ''%1'' !!' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5981 |
] ifFalse:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5982 |
msg := 'cannot read directory ''%1'' !!' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5983 |
] |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5984 |
] ifFalse:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5985 |
OperatingSystem isVMSlike ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5986 |
"/ cannot tell if it exists or is simply invisible ... |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5987 |
msg := '''%1'' is not a directory or unreadable !!' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5988 |
] ifFalse:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5989 |
msg := '''%1'' is not a directory !!' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5990 |
] |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5991 |
]. |
3528 | 5992 |
msg := (resources string:msg) withCRs. |
5993 |
Dialog warn:(msg bindWith:fileName allBold). |
|
172 | 5994 |
] |
1166
0029f77ccea7
when updating the directoryList,
Claus Gittinger <cg@exept.de>
parents:
1162
diff
changeset
|
5995 |
|
1371
a80db8d0e311
remember directory in history when entering (not when leaving)
Claus Gittinger <cg@exept.de>
parents:
1358
diff
changeset
|
5996 |
"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
|
5997 |
"Modified: / 27.4.1999 / 17:10:14 / cg" |
1329 | 5998 |
! |
5999 |
||
6000 |
doChangeToDefaultDirectory |
|
6001 |
"go to parent directory" |
|
6002 |
||
6003 |
self doChangeCurrentDirectoryTo:(Filename currentDirectory pathName) updateHistory:true |
|
6004 |
||
6005 |
"Created: 21.9.1997 / 23:45:59 / cg" |
|
172 | 6006 |
! |
6007 |
||
6008 |
doChangeToHomeDirectory |
|
6009 |
"go to home directory" |
|
6010 |
||
6011 |
self doChangeCurrentDirectoryTo:(OperatingSystem getHomeDirectory) updateHistory:true |
|
6012 |
! |
|
6013 |
||
6014 |
doChangeToParentDirectory |
|
1317 | 6015 |
"go to parent directory" |
36 | 6016 |
|
172 | 6017 |
self doChangeCurrentDirectoryTo:'..' updateHistory:true |
6018 |
! |
|
6019 |
||
6020 |
doCreateDirectory:newName |
|
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
6021 |
|f| |
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
6022 |
|
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
6023 |
f := currentDirectory filenameFor:newName. |
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
6024 |
f exists ifTrue:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6025 |
self warn:'%1 already exists.' with:newName. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6026 |
^ self |
172 | 6027 |
]. |
6028 |
||
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
6029 |
f makeDirectory ifTrue:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6030 |
self updateCurrentDirectory |
172 | 6031 |
] ifFalse:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6032 |
self showAlert:(resources string:'cannot create directory ''%1'' !!' with:newName) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6033 |
with:(OperatingSystem lastErrorString) |
172 | 6034 |
] |
1157
667a57034e40
only update if the directory did change (after execute command)
Claus Gittinger <cg@exept.de>
parents:
1156
diff
changeset
|
6035 |
|
1988 | 6036 |
"Modified: / 18.9.1997 / 17:21:25 / stefan" |
6037 |
"Modified: / 30.1.1999 / 16:24:12 / cg" |
|
172 | 6038 |
! |
6039 |
||
1162 | 6040 |
setCurrentDirectory:aPathName |
6041 |
"setup for another directory" |
|
6042 |
||
6043 |
|newDirectory| |
|
6044 |
||
6045 |
aPathName isEmpty ifTrue:[^ self]. |
|
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
6046 |
newDirectory := currentDirectory filenameFor:aPathName. |
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
6047 |
newDirectory isDirectory ifTrue:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6048 |
self currentDirectory:newDirectory. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6049 |
currentFileName notNil ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6050 |
fileListView contents:nil. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6051 |
currentFileName := nil. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6052 |
] ifFalse:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6053 |
fileListView setSelection:nil. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6054 |
fileListView scrollToTop. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6055 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6056 |
self updateCurrentDirectory. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6057 |
self showInfo. |
172 | 6058 |
] |
294 | 6059 |
|
1162 | 6060 |
"Modified: 21.9.1995 / 11:22:45 / claus" |
6061 |
"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
|
6062 |
"Modified: 18.9.1997 / 17:08:07 / stefan" |
912
dae70963b64c
define language specific commentStrings
Claus Gittinger <cg@exept.de>
parents:
874
diff
changeset
|
6063 |
! |
dae70963b64c
define language specific commentStrings
Claus Gittinger <cg@exept.de>
parents:
874
diff
changeset
|
6064 |
|
1162 | 6065 |
updateCurrentDirectoryIfChanged |
1837 | 6066 |
|t| |
6067 |
||
1975 | 6068 |
OperatingSystem isMSDOSlike ifTrue:[ |
2636 | 6069 |
"/ workaround: DOS has no directory modifiation time ... |
6070 |
self updateCurrentDirectory. |
|
6071 |
^ self |
|
1975 | 6072 |
]. |
6073 |
||
1837 | 6074 |
((t := currentDirectory modificationTime) isNil |
6075 |
or:[t > timeOfLastCheck]) ifTrue:[ |
|
2636 | 6076 |
self updateCurrentDirectory |
1162 | 6077 |
] |
6078 |
||
1837 | 6079 |
"Modified: / 16.9.1997 / 15:35:52 / stefan" |
1975 | 6080 |
"Modified: / 16.12.1998 / 22:55:44 / cg" |
1162 | 6081 |
! ! |
6082 |
||
6083 |
!FileBrowser methodsFor:'private - encoding'! |
|
172 | 6084 |
|
395 | 6085 |
guessEncodingFrom:aBuffer |
988 | 6086 |
"look for a string |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6087 |
encoding #name |
988 | 6088 |
or: |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6089 |
encoding: name |
1209 | 6090 |
within the given buffer |
6091 |
(which is usually the first few bytes of a textFile). |
|
6092 |
If thats not found, use heuristics (in CharacterArray) to guess." |
|
988 | 6093 |
|
395 | 6094 |
|n "{Class: SmallInteger }" |
1209 | 6095 |
binary idx s w enc| |
395 | 6096 |
|
6097 |
binary := false. |
|
6098 |
n := aBuffer size. |
|
6099 |
||
1223 | 6100 |
(idx := aBuffer findString:'charset=') ~~ 0 ifTrue:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6101 |
s := ReadStream on:aBuffer. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6102 |
s position:idx + 8. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6103 |
s skipSeparators. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6104 |
w := s upToSeparator. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6105 |
w notNil ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6106 |
(idx := w indexOf:$") ~~ 0 ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6107 |
w := w copyTo:idx-1 |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6108 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6109 |
^ w asSymbol |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6110 |
]. |
1223 | 6111 |
]. |
807 | 6112 |
(idx := aBuffer findString:'encoding') ~~ 0 ifTrue:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6113 |
s := ReadStream on:aBuffer. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6114 |
s position:idx + 8. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6115 |
s skipSeparators. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6116 |
s peek == $: ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6117 |
s next. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6118 |
s skipSeparators. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6119 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6120 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6121 |
s peek == $# ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6122 |
s next. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6123 |
s skipSeparators. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6124 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6125 |
w := s upToSeparator. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6126 |
w notNil ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6127 |
^ w asSymbol |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6128 |
]. |
807 | 6129 |
]. |
6130 |
||
395 | 6131 |
1 to:n do:[:i | |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6132 |
(aBuffer at:i) isPrintable ifFalse:[binary := true]. |
395 | 6133 |
]. |
807 | 6134 |
|
395 | 6135 |
binary ifTrue:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6136 |
"/ look for JIS7 / EUC encoding |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6137 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6138 |
enc := CharacterArray guessEncodingFrom:aBuffer. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6139 |
enc notNil ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6140 |
^ enc |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6141 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6142 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6143 |
"/ if the encoding has been set to any non iso setting, |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6144 |
"/ assume its what we defined ... |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6145 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6146 |
(('iso*' match:fileEncoding) or:['ascii*' match:fileEncoding]) ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6147 |
^ #binary |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6148 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6149 |
^ fileEncoding ? #binary |
395 | 6150 |
]. |
6151 |
^ #ascii |
|
6152 |
||
6153 |
"Created: 26.2.1996 / 17:43:08 / cg" |
|
1223 | 6154 |
"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
|
6155 |
! |
02d5bbd925dd
allow decoding errors to be ignored
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
6156 |
|
02d5bbd925dd
allow decoding errors to be ignored
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
6157 |
preferredFontEncodingFor:fileEncoding |
02d5bbd925dd
allow decoding errors to be ignored
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
6158 |
"given a file encoding, return corresponding preferred fontEncoding |
02d5bbd925dd
allow decoding errors to be ignored
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
6159 |
match pattern" |
02d5bbd925dd
allow decoding errors to be ignored
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
6160 |
|
1223 | 6161 |
|fe| |
6162 |
||
6163 |
fe := MIMETypes fontForCharset:fileEncoding. |
|
6164 |
fe notNil ifTrue:[^ fe]. |
|
1221 | 6165 |
^ 'iso8859*' |
1214
02d5bbd925dd
allow decoding errors to be ignored
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
6166 |
|
02d5bbd925dd
allow decoding errors to be ignored
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
6167 |
"Created: 28.6.1997 / 20:47:35 / cg" |
1223 | 6168 |
"Modified: 1.7.1997 / 00:04:56 / cg" |
395 | 6169 |
! |
6170 |
||
1140 | 6171 |
validateFontEncodingFor:newEncoding ask:ask |
6172 |
"if required, query user if he/she wants to change to another font, |
|
6173 |
which is able to display text encoded as specified by newEncoding" |
|
6174 |
||
1214
02d5bbd925dd
allow decoding errors to be ignored
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
6175 |
|fontsEncoding msg filter f defaultFont pref| |
1140 | 6176 |
|
6177 |
fontsEncoding := subView font encoding. |
|
6178 |
||
1221 | 6179 |
pref := self preferredFontEncodingFor:newEncoding. |
6180 |
||
6181 |
(pref match:fontsEncoding) ifTrue:[ |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6182 |
^ self |
1140 | 6183 |
]. |
1221 | 6184 |
"/ stupid ... |
6185 |
pref = 'ascii*' ifTrue:[ |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6186 |
(fontsEncoding match:'iso8859*') ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6187 |
^ self |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6188 |
] |
1140 | 6189 |
]. |
6190 |
||
1221 | 6191 |
filter := [:f | |coding| |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6192 |
(coding := f encoding) notNil |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6193 |
and:[pref match:coding]]. |
1221 | 6194 |
|
6195 |
defaultFont := TextView defaultFont onDevice:device. |
|
6196 |
(pref match:(defaultFont encoding)) ifFalse:[ |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6197 |
defaultFont := nil. |
1140 | 6198 |
]. |
6199 |
||
1221 | 6200 |
defaultFont isNil ifTrue:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6201 |
(pref = 'ascii*' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6202 |
or:[pref = 'iso8859*']) ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6203 |
defaultFont := FontDescription family:'courier' face:'medium' style:'roman' size:12 |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6204 |
] |
1221 | 6205 |
]. |
6206 |
||
6207 |
defaultFont isNil ifTrue:[ |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6208 |
defaultFont := device |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6209 |
listOfAvailableFonts |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6210 |
detect:[:f | filter value:f] |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6211 |
ifNone:nil. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6212 |
defaultFont isNil ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6213 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6214 |
"/ flush list, and refetch font list |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6215 |
"/ (in case someone just changed the font path ...) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6216 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6217 |
device flushListOfAvailableFonts. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6218 |
defaultFont := device |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6219 |
listOfAvailableFonts |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6220 |
detect:[:f | filter value:f] |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6221 |
ifNone:nil. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6222 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6223 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6224 |
defaultFont isNil ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6225 |
self warn:'your display does not seem to provide any ' , newEncoding , '-encoded font.'. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6226 |
^ self. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6227 |
] |
1221 | 6228 |
]. |
6229 |
||
6230 |
msg := 'switch to a %1 encoded font ?'. |
|
6231 |
(ask not or:[self confirm:(resources string:msg with:pref) withCRs]) |
|
6232 |
ifTrue:[ |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6233 |
self withWaitCursorDo:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6234 |
f := FontPanel |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6235 |
fontFromUserInitial:defaultFont |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6236 |
title:(resources string:'font selection') |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6237 |
filter:filter. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6238 |
f notNil ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6239 |
subView font:f |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6240 |
] |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6241 |
] |
1140 | 6242 |
] |
6243 |
||
6244 |
"Created: 26.10.1996 / 12:06:54 / cg" |
|
1221 | 6245 |
"Modified: 30.6.1997 / 17:46:46 / cg" |
1162 | 6246 |
! ! |
6247 |
||
6248 |
!FileBrowser methodsFor:'private - file stuff'! |
|
6249 |
||
6250 |
doCreateFile:newName |
|
6251 |
"create an empty file" |
|
6252 |
||
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
6253 |
|aStream f| |
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
6254 |
|
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
6255 |
f := currentDirectory filenameFor:newName. |
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
6256 |
f exists ifTrue:[ |
3421 | 6257 |
(self |
6258 |
ask:(resources string:'%1 already exists\\truncate ?' with:newName) |
|
6259 |
yesButton:'truncate' |
|
6260 |
) ifFalse:[^ self]. |
|
1162 | 6261 |
]. |
6262 |
||
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
6263 |
FileStream openErrorSignal handle:[:ex| |
3421 | 6264 |
^ self showAlert:(resources string:'Cannot create file ''%1'' !!' with:newName) |
6265 |
with:(FileStream lastErrorString) |
|
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
6266 |
] do:[ |
3421 | 6267 |
aStream := f newReadWriteStream. |
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
6268 |
]. |
1162 | 6269 |
aStream notNil ifTrue:[ |
3421 | 6270 |
aStream close. |
6271 |
self updateCurrentDirectoryIfChanged |
|
1162 | 6272 |
] ifFalse:[ |
3421 | 6273 |
self showAlert:(resources string:'Cannot create file ''%1'' !!' with:newName) |
6274 |
with:(FileStream lastErrorString) |
|
1162 | 6275 |
] |
6276 |
||
3421 | 6277 |
"Modified: / 18.9.1997 / 17:21:45 / stefan" |
6278 |
"Modified: / 16.11.2001 / 00:44:49 / cg" |
|
1140 | 6279 |
! |
6280 |
||
1162 | 6281 |
doFileGet:viaDoubleClick |
6282 |
"get selected file - show contents in subView. |
|
6283 |
This is invoked either by the 'get file' menu item, or via double click. |
|
6284 |
When invoked via the menu (viaDoubleClick argument is false), |
|
6285 |
the automatic file action is not performed - instead, the file is always |
|
6286 |
shown in the codeView (if possible). |
|
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
6287 |
This distinction was done to allow xpm or xbm files (which have an automatic |
1162 | 6288 |
action) to be edited." |
6289 |
||
1994 | 6290 |
|fileName| |
6291 |
||
6292 |
fileName := self getSelectedFileName. |
|
6293 |
fileName notNil ifTrue:[ |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6294 |
self doOpenFile:fileName viaDoubleClick:viaDoubleClick |
1162 | 6295 |
] |
6296 |
||
1955
e10babdbf077
before accepting, see if the file is outdated and warn if so.
Claus Gittinger <cg@exept.de>
parents:
1950
diff
changeset
|
6297 |
"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
|
6298 |
"Modified: / 18.9.1997 / 17:35:31 / stefan" |
1994 | 6299 |
"Modified: / 4.2.1999 / 17:43:51 / cg" |
1162 | 6300 |
! |
6301 |
||
2166
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6302 |
doFindFileNamed:namePatterns ignoreCase:ignCaseInName containingString:contentsString ignoreCaseInContents:ignCaseInString sameContentsAsFile:filenameToCompareContentsOrNil sameContentsAs:bytesToCompareContentsOrNil in:aDirectory |
1965 | 6303 |
|dir subDirs nameMatches contentsMatches lines contentsToCompare| |
6304 |
||
6305 |
bytesToCompareContentsOrNil notNil ifTrue:[ |
|
2166
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6306 |
contentsToCompare := bytesToCompareContentsOrNil |
1965 | 6307 |
]. |
1933 | 6308 |
|
6309 |
subDirs := OrderedCollection new. |
|
6310 |
||
6311 |
dir := aDirectory asFilename. |
|
6312 |
self label:myName , '- searching ' , dir name. |
|
6313 |
(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
|
6314 |
|f| |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6315 |
|
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6316 |
f := dir construct:fn. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6317 |
f isDirectory ifTrue:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6318 |
f isSymbolicLink ifFalse:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6319 |
subDirs add:f |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6320 |
] |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6321 |
] ifFalse:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6322 |
(nameMatches := namePatterns isNil) ifFalse:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6323 |
ignCaseInName ifTrue:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6324 |
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
|
6325 |
] ifFalse:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6326 |
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
|
6327 |
] |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6328 |
]. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6329 |
nameMatches ifTrue:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6330 |
filenameToCompareContentsOrNil notNil ifTrue:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6331 |
"/ contents compare ... |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6332 |
contentsMatches := false. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6333 |
f pathName ~= filenameToCompareContentsOrNil pathName ifTrue:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6334 |
f fileSize == filenameToCompareContentsOrNil fileSize ifTrue:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6335 |
contentsToCompare isNil ifTrue:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6336 |
filenameToCompareContentsOrNil fileSize < (512*1024) ifTrue:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6337 |
contentsToCompare := filenameToCompareContentsOrNil binaryContentsOfEntireFile |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6338 |
] |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6339 |
]. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6340 |
contentsToCompare isNil ifTrue:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6341 |
"/ too large - compare block-wise ... |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6342 |
contentsMatches := (filenameToCompareContentsOrNil sameContentsAs:f). |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6343 |
] ifFalse:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6344 |
contentsMatches := contentsToCompare = (f binaryContentsOfEntireFile). |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6345 |
] |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6346 |
]. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6347 |
] ifFalse:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6348 |
f isSymbolicLink ifTrue:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6349 |
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
|
6350 |
subView cursorDown. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6351 |
] |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6352 |
] |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6353 |
] ifFalse:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6354 |
"/ string search ... |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6355 |
(contentsMatches := contentsString isNil) ifFalse:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6356 |
(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
|
6357 |
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
|
6358 |
subView cursorDown. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6359 |
] ifTrue:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6360 |
f fileSize > (4024*1024) ifTrue:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6361 |
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
|
6362 |
subView cursorDown. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6363 |
] ifFalse:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6364 |
Stream lineTooLongErrorSignal handle:[:ex | |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6365 |
|cont| |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6366 |
|
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6367 |
"/ 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
|
6368 |
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
|
6369 |
ignCaseInString ifTrue:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6370 |
contentsMatches := cont asLowercase includesString:contentsString |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6371 |
] ifFalse:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6372 |
contentsMatches := cont includesString:contentsString |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6373 |
]. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6374 |
] do:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6375 |
lines := f contents ? #(). |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6376 |
ignCaseInString ifTrue:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6377 |
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
|
6378 |
] ifFalse:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6379 |
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
|
6380 |
]. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6381 |
]. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6382 |
]. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6383 |
]. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6384 |
]. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6385 |
]. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6386 |
contentsMatches ifTrue:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6387 |
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
|
6388 |
subView cursorDown. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6389 |
] |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6390 |
] |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6391 |
] |
1933 | 6392 |
]. |
6393 |
||
6394 |
subDirs do:[:dir | |
|
2166
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6395 |
self |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6396 |
doFindFileNamed:namePatterns |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6397 |
ignoreCase:ignCaseInName |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6398 |
containingString:contentsString |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6399 |
ignoreCaseInContents:ignCaseInString |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6400 |
sameContentsAsFile:filenameToCompareContentsOrNil |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6401 |
sameContentsAs:contentsToCompare |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6402 |
in:dir |
1933 | 6403 |
]. |
6404 |
||
6405 |
"Created: / 15.10.1998 / 11:37:15 / cg" |
|
6406 |
"Modified: / 15.10.1998 / 12:50:48 / cg" |
|
6407 |
! |
|
6408 |
||
1994 | 6409 |
doOpenFile:fileName viaDoubleClick:viaDoubleClick |
6410 |
"get selected file - show contents in subView. |
|
6411 |
This is invoked either by the 'get file' menu item, or via double click. |
|
6412 |
When invoked via the menu (viaDoubleClick argument is false), |
|
6413 |
the automatic file action is not performed - instead, the file is always |
|
6414 |
shown in the codeView (if possible). |
|
6415 |
This distinction was done to allow xpm or xbm files (which have an automatic |
|
6416 |
action) to be edited." |
|
6417 |
||
6418 |
|iconLbl winLbl f| |
|
6419 |
||
6420 |
self withReadCursorDo:[ |
|
2139 | 6421 |
(f := fileName asFilename) isAbsolute ifFalse:[ |
6422 |
f := currentDirectory construct:fileName. |
|
6423 |
]. |
|
6424 |
f isDirectory ifTrue:[ |
|
6425 |
self doChangeCurrentDirectoryTo:fileName updateHistory:true. |
|
6426 |
winLbl := myName. |
|
6427 |
iconLbl := myName |
|
6428 |
] ifFalse:[ |
|
6429 |
f exists ifFalse:[ |
|
2868 | 6430 |
Dialog warn:(resources string:'oops, ''%1'' is gone or unreadable.' withCRs with:f pathName allBold). |
2139 | 6431 |
^ self |
6432 |
]. |
|
6433 |
timeOfFileRead := f modificationTime. |
|
6434 |
self showFile:fileName insert:false encoding:fileEncoding doubleClick:viaDoubleClick. |
|
6435 |
currentFileName := fileName. |
|
6436 |
||
6437 |
self fileTypeSpecificActions. |
|
6438 |
||
6439 |
subView acceptAction:[:theCode | |
|
3498
5c5fff5b60bf
in doAccept: care for file being removed in the meantime
Claus Gittinger <cg@exept.de>
parents:
3478
diff
changeset
|
6440 |
|filesModificationTime| |
5c5fff5b60bf
in doAccept: care for file being removed in the meantime
Claus Gittinger <cg@exept.de>
parents:
3478
diff
changeset
|
6441 |
|
5c5fff5b60bf
in doAccept: care for file being removed in the meantime
Claus Gittinger <cg@exept.de>
parents:
3478
diff
changeset
|
6442 |
filesModificationTime := f modificationTime. |
5c5fff5b60bf
in doAccept: care for file being removed in the meantime
Claus Gittinger <cg@exept.de>
parents:
3478
diff
changeset
|
6443 |
(filesModificationTime isNil |
5c5fff5b60bf
in doAccept: care for file being removed in the meantime
Claus Gittinger <cg@exept.de>
parents:
3478
diff
changeset
|
6444 |
or:[filesModificationTime <= timeOfFileRead |
5c5fff5b60bf
in doAccept: care for file being removed in the meantime
Claus Gittinger <cg@exept.de>
parents:
3478
diff
changeset
|
6445 |
or:[(self |
2139 | 6446 |
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 ?') |
6447 |
yesButton:'save' |
|
3498
5c5fff5b60bf
in doAccept: care for file being removed in the meantime
Claus Gittinger <cg@exept.de>
parents:
3478
diff
changeset
|
6448 |
noButton:'don''t save')]]) |
5c5fff5b60bf
in doAccept: care for file being removed in the meantime
Claus Gittinger <cg@exept.de>
parents:
3478
diff
changeset
|
6449 |
ifTrue:[ |
2139 | 6450 |
self withCursor:(Cursor write) do:[ |
6451 |
self writeFile:fileName text:theCode encoding:fileEncoding. |
|
6452 |
timeOfFileRead := f modificationTime. |
|
6453 |
self label:myName , ': ' , currentFileName |
|
6454 |
] |
|
6455 |
] |
|
6456 |
]. |
|
6457 |
||
6458 |
winLbl := myName , ': ' , fileName. |
|
6459 |
f isWritable ifFalse:[ |
|
6460 |
winLbl := winLbl , ' (readonly)' |
|
6461 |
]. |
|
6462 |
iconLbl := fileName |
|
6463 |
]. |
|
6464 |
self label:winLbl. |
|
6465 |
self iconLabel:iconLbl. |
|
1994 | 6466 |
] |
6467 |
||
6468 |
"Created: / 4.2.1999 / 17:43:26 / cg" |
|
2139 | 6469 |
"Modified: / 3.5.1999 / 20:32:27 / ps" |
3498
5c5fff5b60bf
in doAccept: care for file being removed in the meantime
Claus Gittinger <cg@exept.de>
parents:
3478
diff
changeset
|
6470 |
"Modified: / 10.12.2001 / 14:33:38 / cg" |
1994 | 6471 |
! |
6472 |
||
1961
f81295571da7
care for updating listView while removing (get selection before)
Claus Gittinger <cg@exept.de>
parents:
1956
diff
changeset
|
6473 |
doRemove:filesToRemove |
1162 | 6474 |
"remove the selected file(s) - no questions asked" |
6475 |
||
3420 | 6476 |
|msg needUpdate toRemove updateRunning yesToAll mTime| |
1162 | 6477 |
|
3281 | 6478 |
self withWaitCursorDo:[ |
6479 |
updateRunning := listUpdateProcess notNil. |
|
6480 |
self stopUpdateProcess. |
|
6481 |
toRemove := OrderedCollection new. |
|
2772
84029fca1f3d
use removeFile (a bit faster) if known to be a file
Claus Gittinger <cg@exept.de>
parents:
2771
diff
changeset
|
6482 |
|
84029fca1f3d
use removeFile (a bit faster) if known to be a file
Claus Gittinger <cg@exept.de>
parents:
2771
diff
changeset
|
6483 |
"/ |
3281 | 6484 |
"/ did the directory change in the meanwhile ? |
2772
84029fca1f3d
use removeFile (a bit faster) if known to be a file
Claus Gittinger <cg@exept.de>
parents:
2771
diff
changeset
|
6485 |
"/ |
3281 | 6486 |
mTime := currentDirectory modificationTime. |
6487 |
needUpdate := mTime notNil and:[mTime > timeOfLastCheck]. |
|
6488 |
||
6489 |
yesToAll := false. |
|
6490 |
lockUpdate := true. |
|
6491 |
[ |
|
6492 |
filesToRemove keysAndValuesDo:[:idx :fileName | |
|
6493 |
|f| |
|
6494 |
||
6495 |
f := currentDirectory construct:fileName. |
|
6496 |
OperatingSystem accessDeniedErrorSignal handle:[:ex| |
|
6497 |
"was not able to remove it" |
|
3419 | 6498 |
msg := (resources string:'Cannot remove ''%1'' !!' with:fileName). |
3281 | 6499 |
self showAlert:msg with:(OperatingSystem lastErrorString) |
6500 |
] do:[ |
|
6501 |
|answer contents i| |
|
6502 |
||
6503 |
(f isSymbolicLink not and:[f isDirectory]) ifTrue:[ |
|
6504 |
contents := f directoryContents. |
|
6505 |
contents isEmpty ifTrue:[ |
|
6506 |
f remove |
|
6507 |
] ifFalse:[ |
|
6508 |
yesToAll ifFalse:[ |
|
6509 |
idx == filesToRemove size ifTrue:[ |
|
6510 |
answer := Dialog |
|
3419 | 6511 |
confirmWithCancel:(resources string:'Directory ''%1'' is not empty\remove anyway ?' with:fileName allBold) withCRs |
6512 |
labels:(resources array:#('Cancel' 'Remove')) |
|
3281 | 6513 |
values:#(false true) |
6514 |
default:2. |
|
6515 |
] ifFalse:[ |
|
6516 |
answer := Dialog |
|
3419 | 6517 |
confirmWithCancel:(resources string:'Directory ''%1'' is not empty\remove anyway ?' with:fileName allBold) withCRs |
3697
e2f7d8dec6e2
menu items/button labels uppercase-first
Claus Gittinger <cg@exept.de>
parents:
3691
diff
changeset
|
6518 |
labels:(resources array:#('Cancel' 'Remove All' 'Remove')) |
3281 | 6519 |
values:#(false #removeAll true) |
6520 |
default:3. |
|
6521 |
]. |
|
6522 |
answer == false ifTrue:[ |
|
6523 |
^ self |
|
6524 |
]. |
|
6525 |
answer == #removeAll ifTrue:[ |
|
6526 |
yesToAll := true |
|
6527 |
]. |
|
6528 |
]. |
|
6529 |
f recursiveRemove |
|
6530 |
]. |
|
6531 |
] ifFalse:[ |
|
6532 |
f removeFile. |
|
6533 |
]. |
|
6534 |
" |
|
6535 |
self show:nil |
|
6536 |
" |
|
6537 |
i := fileList indexOf:fileName. |
|
6538 |
i ~~ 0 ifTrue:[ |
|
6539 |
toRemove add:i. |
|
6540 |
] |
|
6541 |
]. |
|
6542 |
]. |
|
3596
9761af1f3f72
#valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents:
3568
diff
changeset
|
6543 |
] ensure:[ |
3281 | 6544 |
lockUpdate := false. |
6545 |
fileListView setSelection:nil. |
|
6546 |
||
6547 |
"/ |
|
6548 |
"/ remove reverse - otherwise indices are wrong |
|
6549 |
"/ |
|
6550 |
toRemove sort. |
|
6551 |
toRemove reverseDo:[:idx | |
|
6552 |
fileList removeIndex:idx. |
|
6553 |
fileListView removeIndex:idx. |
|
6554 |
]. |
|
6555 |
||
6556 |
updateRunning ifTrue:[ |
|
6557 |
self updateCurrentDirectory |
|
6558 |
] ifFalse:[ |
|
6559 |
" |
|
6560 |
install a new check after some time |
|
6561 |
" |
|
6562 |
needUpdate ifFalse:[timeOfLastCheck := AbsoluteTime now]. |
|
3520
83cf11e1bf32
schedule checkBlock for the right process
Claus Gittinger <cg@exept.de>
parents:
3503
diff
changeset
|
6563 |
self scheduleCheckBlock. |
3281 | 6564 |
] |
2772
84029fca1f3d
use removeFile (a bit faster) if known to be a file
Claus Gittinger <cg@exept.de>
parents:
2771
diff
changeset
|
6565 |
] |
1162 | 6566 |
] |
6567 |
||
1374
b3a1e95a6220
Do not ask for nonempty directory if remove target is a symlink
Stefan Vogel <sv@exept.de>
parents:
1371
diff
changeset
|
6568 |
"Modified: / 20.11.1997 / 17:39:14 / stefan" |
3420 | 6569 |
"Modified: / 16.11.2001 / 00:43:40 / cg" |
1162 | 6570 |
! |
6571 |
||
6572 |
doRename:oldName to:newName |
|
1331
73e712c85588
Handle errors when renaming files.
Stefan Vogel <sv@exept.de>
parents:
1330
diff
changeset
|
6573 |
"rename a file (or directory)" |
1162 | 6574 |
|
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
6575 |
|old new| |
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
6576 |
|
2989 | 6577 |
(oldName isNil or:[newName isNil]) ifTrue:[ |
6578 |
^ self |
|
6579 |
]. |
|
6580 |
(oldName isBlank or:[newName isBlank]) ifTrue:[ |
|
6581 |
^ self |
|
6582 |
]. |
|
6583 |
(oldName = newName) ifTrue:[ |
|
6584 |
^ self |
|
6585 |
]. |
|
6586 |
||
6587 |
old := currentDirectory filenameFor:oldName. |
|
6588 |
new := currentDirectory filenameFor:newName. |
|
6589 |
||
6590 |
OperatingSystem errorSignal handle:[:ex| |
|
3421 | 6591 |
self showAlert:(resources string:'Cannot rename file ''%1'' to %2 !!' |
2989 | 6592 |
with:oldName with:newName) |
6593 |
with:(OperatingSystem lastErrorString) |
|
6594 |
] do:[ |
|
6595 |
new exists ifTrue:[ |
|
6596 |
(self confirm:(resources string:'''%1'' already exists - rename (i.e. overwrite) anyway ?' with:new baseName allBold)) |
|
6597 |
ifFalse:[ |
|
6598 |
^ self |
|
6599 |
] |
|
6600 |
]. |
|
6601 |
old renameTo:new. |
|
6602 |
]. |
|
3206 | 6603 |
|
3007 | 6604 |
self updateCurrentDirectory |
6605 |
"/ self updateCurrentDirectoryIfChanged. |
|
1162 | 6606 |
|
1911
6d1b77eda98f
check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents:
1903
diff
changeset
|
6607 |
"Modified: / 24.9.1997 / 09:20:00 / stefan" |
3421 | 6608 |
"Modified: / 16.11.2001 / 00:44:27 / cg" |
1162 | 6609 |
! ! |
6610 |
||
6611 |
!FileBrowser methodsFor:'private - file type & info'! |
|
6612 |
||
6613 |
fileCommentStrings |
|
6614 |
"return a useful comment definition; based upon the fileName for now" |
|
6615 |
||
3015
84b5619bd78d
comment strings functionality moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
3013
diff
changeset
|
6616 |
^ MIMETypes commentStringsForFilename:currentFileName |
3072 | 6617 |
ifUnknown:[ |
6618 |
"/ st: |
|
6619 |
#('"/' ('"' '"')) |
|
6620 |
] |
|
1162 | 6621 |
! |
6622 |
||
6623 |
fileTypeSpecificActions |
|
6624 |
"any special fileTypeSpecific actions are done here, |
|
6625 |
when a new file is selected" |
|
6626 |
||
6627 |
|commentStrings| |
|
6628 |
||
6629 |
commentStrings := self fileCommentStrings. |
|
6630 |
commentStrings notNil ifTrue:[ |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6631 |
subView perform:#commentStrings: with:commentStrings ifNotUnderstood:nil |
1162 | 6632 |
]. |
6633 |
||
6634 |
"Modified: 7.1.1997 / 20:30:54 / cg" |
|
6635 |
! |
|
6636 |
||
6637 |
getFileInfoString:longInfo |
|
6638 |
"get stat info on selected file - return a string which can be |
|
6639 |
shown in a box" |
|
6640 |
||
6641 |
|fileName f fullPath text info fileOutput type modeBits modeString s ts| |
|
6642 |
||
6643 |
fileName := self getSelectedFileName. |
|
6644 |
fileName isNil ifTrue:[^ nil]. |
|
6645 |
||
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
6646 |
f := currentDirectory construct:fileName. |
1162 | 6647 |
info := f info. |
6648 |
||
6649 |
info isNil ifTrue:[ |
|
3421 | 6650 |
self showAlert:(resources string:'Cannot get info of ''%1'' !!' with:fileName) |
6651 |
with:(OperatingSystem lastErrorString). |
|
6652 |
^ nil |
|
1162 | 6653 |
]. |
6654 |
||
6655 |
text := StringCollection new. |
|
6656 |
f isSymbolicLink ifTrue:[ |
|
3421 | 6657 |
text add:(resources string:'symbolic link to: %1' with:(f linkInfo path)) |
1162 | 6658 |
]. |
6659 |
||
6660 |
type := info type. |
|
6661 |
(longInfo and:[type == #regular]) ifTrue:[ |
|
3421 | 6662 |
fullPath := currentDirectory pathName asFilename constructString:fileName. |
6663 |
fileOutput := fullPath asFilename fileType. |
|
1162 | 6664 |
]. |
6665 |
||
6666 |
s := (resources at:'type: '). |
|
6667 |
fileOutput isNil ifTrue:[ |
|
3421 | 6668 |
s := s , type asString |
1162 | 6669 |
] ifFalse:[ |
3421 | 6670 |
s := s , 'regular (' , fileOutput , ')' |
1162 | 6671 |
]. |
6672 |
text add:s. |
|
6673 |
text add:(resources string:'size: %1' with:(info size) printString). |
|
6674 |
||
6675 |
modeBits := info mode. |
|
6676 |
modeString := self getModeString:modeBits. |
|
6677 |
longInfo ifTrue:[ |
|
3421 | 6678 |
text add:(resources string:'access: %1 (%2)' |
6679 |
with:modeString |
|
6680 |
with:(modeBits printStringRadix:8)) |
|
1162 | 6681 |
] ifFalse:[ |
3421 | 6682 |
text add:(resources string:'access: %1' with:modeString) |
1162 | 6683 |
]. |
6684 |
text add:(resources string:'owner: %1' |
|
3421 | 6685 |
with:(OperatingSystem getUserNameFromID:(info uid))). |
1162 | 6686 |
longInfo ifTrue:[ |
3421 | 6687 |
text add:(resources string:'group: %1' |
6688 |
with:(OperatingSystem getGroupNameFromID:(info gid))). |
|
6689 |
||
6690 |
ts := info accessed. |
|
6691 |
text add:(resources string:'last access: %1 %2' |
|
6692 |
with:(ts asTime printString) |
|
6693 |
with:(ts asDate printString)). |
|
6694 |
||
6695 |
ts := info modified. |
|
6696 |
text add:(resources string:'last modification: %1 %2' |
|
6697 |
with:(ts asTime printString) |
|
6698 |
with:(ts asDate printString)). |
|
1162 | 6699 |
]. |
6700 |
^ text asString |
|
6701 |
||
3421 | 6702 |
"Modified: / 8.9.1995 / 11:59:28 / claus" |
6703 |
"Modified: / 18.9.1997 / 16:34:31 / stefan" |
|
6704 |
"Modified: / 16.11.2001 / 00:45:11 / cg" |
|
1162 | 6705 |
! |
6706 |
||
6707 |
getInfoFile |
|
6708 |
"get filename of a description-file (.dir.info, README etc.); |
|
6709 |
This file is automatically shown when a directory is enterred. |
|
6710 |
You can add more names below if you like." |
|
6711 |
||
6712 |
#( |
|
6713 |
'.dir.info' |
|
6714 |
'README' |
|
6715 |
'ReadMe' |
|
6716 |
'Readme' |
|
6717 |
'readme' |
|
6718 |
'read.me' |
|
6719 |
'Read.me' |
|
6720 |
'READ.ME' |
|
1272 | 6721 |
'README.TXT' |
6722 |
'readme.txt' |
|
6723 |
'Readme.txt' |
|
1307 | 6724 |
'Info.txt' |
6725 |
'info.txt' |
|
6726 |
'INFO.TXT' |
|
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
6727 |
) do:[:f | |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6728 |
|n| |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6729 |
n := currentDirectory construct:f. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6730 |
(n isReadable and:[n isDirectory not]) ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6731 |
^ f. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6732 |
] |
1140 | 6733 |
]. |
1162 | 6734 |
^ nil |
6735 |
||
1272 | 6736 |
"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
|
6737 |
"Modified: 16.9.1997 / 15:26:53 / stefan" |
1162 | 6738 |
! |
6739 |
||
6740 |
getModeString:modeBits |
|
6741 |
"convert file-mode bits into a more user-friendly string. |
|
6742 |
This is wrong here - should be moved into OperatingSystem." |
|
6743 |
||
6744 |
^ self getModeString:modeBits |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6745 |
with:#( 'owner:' $r $w $x |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6746 |
' group:' $r $w $x |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6747 |
' others:' $r $w $x ) |
1140 | 6748 |
! |
6749 |
||
1162 | 6750 |
getModeString:modeBits with:texts |
6751 |
"convert file-mode bits into a more user-friendly string. |
|
6752 |
This is wrong here - should be moved into OperatingSystem." |
|
6753 |
||
6754 |
|bits modeString| |
|
6755 |
||
6756 |
bits := modeBits bitAnd:8r777. |
|
6757 |
modeString := ''. |
|
6758 |
||
6759 |
#( nil 8r400 8r200 8r100 nil 8r040 8r020 8r010 nil 8r004 8r002 8r001 ) |
|
6760 |
with: texts do:[:bitMask :access | |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6761 |
|ch| |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6762 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6763 |
bitMask isNil ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6764 |
modeString := modeString , (resources string:access) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6765 |
] ifFalse:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6766 |
(bits bitAnd:bitMask) == 0 ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6767 |
ch := $- |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6768 |
] ifFalse:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6769 |
ch := access |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6770 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6771 |
modeString := modeString copyWith:ch |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6772 |
] |
633
4630175ed31e
double click on .htm / .html files open a viewer;
Claus Gittinger <cg@exept.de>
parents:
585
diff
changeset
|
6773 |
]. |
1162 | 6774 |
^ modeString |
6775 |
! |
|
6776 |
||
6777 |
showInfo |
|
6778 |
"show directory info when dir has changed" |
|
6779 |
||
6780 |
|info txt| |
|
6781 |
||
6782 |
info := self getInfoFile. |
|
6783 |
info notNil ifTrue:[ |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6784 |
txt := self readFile:info |
1162 | 6785 |
]. |
6786 |
self show:txt. |
|
6787 |
! |
|
6788 |
||
6789 |
sizePrintString:size |
|
6790 |
"helper for update-directory to return a string with a files size. |
|
6791 |
This one gives the size in byte, Kb or Mb depending on size. |
|
6792 |
If you dont like this, just uncomment the first statement below." |
|
6793 |
||
6794 |
|unitString n| |
|
6795 |
||
6796 |
" |
|
6797 |
^ size printString. |
|
6798 |
" |
|
6799 |
unitString := ''. |
|
6800 |
size < (500 * 1024) ifTrue:[ |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6801 |
size < 1024 ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6802 |
n := size |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6803 |
] ifFalse:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6804 |
n := (size * 10 // 1024 / 10.0). |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6805 |
unitString := ' Kb' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6806 |
] |
1162 | 6807 |
] ifFalse:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6808 |
n := (size * 10 // 1024 // 1024 / 10.0). |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6809 |
unitString := ' Mb' |
1162 | 6810 |
]. |
6811 |
^ (n printStringLeftPaddedTo:5) , unitString. |
|
6812 |
! ! |
|
6813 |
||
6814 |
!FileBrowser methodsFor:'private - file-I/O'! |
|
6815 |
||
6816 |
readFile:fileName |
|
6817 |
"read in the file, answer its contents as StringCollection" |
|
6818 |
||
6819 |
^ self readFile:fileName lineDelimiter:Character cr encoding:nil |
|
6820 |
||
6821 |
"Modified: 22.2.1996 / 14:57:08 / cg" |
|
6822 |
! |
|
6823 |
||
6824 |
readFile:fileName lineDelimiter:aCharacter encoding:encoding |
|
6825 |
"read in the file, return its contents as StringCollection. |
|
6826 |
The files lines are delimited by aCharacter. |
|
6827 |
If encoding is nonNil, the file is assumed to be coded according to |
|
6828 |
that symbol, and #decodeString: should be able to convert it." |
|
6829 |
||
1994 | 6830 |
|f stream text msg sz| |
6831 |
||
6832 |
(f := fileName asFilename) isAbsolute ifFalse:[ |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6833 |
f := (currentDirectory construct:fileName) |
1994 | 6834 |
]. |
6835 |
stream := f readStream. |
|
1162 | 6836 |
stream isNil ifTrue:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6837 |
msg := (resources string:'cannot read file ''%1'' !!' with:fileName). |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6838 |
self showAlert:msg with:(FileStream lastErrorString). |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6839 |
^ nil |
1162 | 6840 |
]. |
6841 |
||
6842 |
" |
|
6843 |
for very big files, give ObjectMemory a hint, to preallocate more |
|
6844 |
" |
|
1311 | 6845 |
(sz := stream fileSize) > 1000000 ifTrue:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6846 |
Processor activeProcess withPriority:Processor userBackgroundPriority do:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6847 |
ObjectMemory announceSpaceNeed:(sz + (sz // 5)) "/ add 20% for tab expansion |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6848 |
]. |
1162 | 6849 |
]. |
6850 |
||
6851 |
text := self readStream:stream lineDelimiter:aCharacter encoding:encoding. |
|
6852 |
stream close. |
|
6853 |
^ text |
|
6854 |
||
1994 | 6855 |
"Created: / 22.2.1996 / 14:56:48 / cg" |
6856 |
"Modified: / 18.9.1997 / 17:06:54 / stefan" |
|
6857 |
"Modified: / 4.2.1999 / 17:52:18 / cg" |
|
1162 | 6858 |
! |
6859 |
||
6860 |
readStream:aStream |
|
6861 |
"read in from aStream, answer its contents as StringCollection" |
|
6862 |
||
6863 |
^ self readStream:aStream lineDelimiter:Character cr encoding:nil |
|
6864 |
||
6865 |
"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
|
6866 |
! |
4630175ed31e
double click on .htm / .html files open a viewer;
Claus Gittinger <cg@exept.de>
parents:
585
diff
changeset
|
6867 |
|
1162 | 6868 |
readStream:aStream lineDelimiter:aCharacter encoding:encoding |
6869 |
"read from aStream, answer its contents as StringCollection. |
|
6870 |
The files lines are delimited by aCharacter. |
|
6871 |
If encoding is nonNil, the file is assumed to be coded according to |
|
6872 |
that symbol, and #decodeString: should be able to convert it." |
|
6873 |
||
6874 |
|text line enc| |
|
6875 |
||
6876 |
text := StringCollection new. |
|
6877 |
||
6878 |
enc := encoding. |
|
6879 |
enc == #iso8859 ifTrue:[ |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6880 |
enc := nil |
1162 | 6881 |
]. |
6882 |
||
6883 |
aCharacter == Character cr ifTrue:[ |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6884 |
FileStream lineTooLongErrorSignal handle:[:ex | |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6885 |
|s partialLine| |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6886 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6887 |
s := ex parameter at:1. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6888 |
partialLine := ex parameter at:2. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6889 |
ex proceedWith:(partialLine , s upTo:aCharacter) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6890 |
] do:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6891 |
[aStream atEnd] whileFalse:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6892 |
line := aStream nextLine withTabsExpanded. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6893 |
enc notNil ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6894 |
line := line decodeFrom:enc |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6895 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6896 |
text add:line |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6897 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6898 |
]. |
1162 | 6899 |
] ifFalse:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6900 |
[aStream atEnd] whileFalse:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6901 |
line := (aStream upTo:aCharacter) withTabsExpanded. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6902 |
enc notNil ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6903 |
line := line decodeFrom:enc |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6904 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6905 |
text add:line |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6906 |
]. |
633
4630175ed31e
double click on .htm / .html files open a viewer;
Claus Gittinger <cg@exept.de>
parents:
585
diff
changeset
|
6907 |
]. |
1162 | 6908 |
^ text |
6909 |
||
1994 | 6910 |
"Created: / 22.2.1996 / 14:58:25 / cg" |
6911 |
"Modified: / 5.2.1999 / 00:53:22 / cg" |
|
1162 | 6912 |
! |
6913 |
||
6914 |
showFile:fileName |
|
6915 |
"show contents of fileName in subView" |
|
6916 |
||
1689 | 6917 |
fileListView selection:(fileList indexOf:fileName). |
6918 |
self fileGet |
|
6919 |
||
6920 |
"Modified: / 17.6.1998 / 11:26:13 / cg" |
|
1162 | 6921 |
! |
6922 |
||
6923 |
showFile:fileName insert:insert encoding:encoding |
|
6924 |
"show/insert contents of fileName in subView" |
|
6925 |
||
6926 |
^ self |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6927 |
showFile:fileName insert:insert encoding:encoding doubleClick:false |
1162 | 6928 |
|
6929 |
"Modified: 19.6.1996 / 09:40:19 / cg" |
|
6930 |
! |
|
6931 |
||
3414 | 6932 |
showFile:fileNameString insert:insert encoding:encoding doubleClick:viaDoubleClick |
1162 | 6933 |
"show/insert contents of fileName in subView" |
6934 |
||
3527 | 6935 |
|path buffer s n ok convert text msg eol guess action enc |
3414 | 6936 |
fontsEncoding pref failWarning f answer fileName| |
6937 |
||
6938 |
fileName := fileNameString asFilename. |
|
6939 |
||
6940 |
fileName isAbsolute ifFalse:[ |
|
6941 |
path := currentDirectory filenameFor:fileNameString. |
|
1994 | 6942 |
] ifTrue:[ |
3414 | 6943 |
path := fileName asAbsoluteFilename |
1994 | 6944 |
]. |
6945 |
||
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
6946 |
(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
|
6947 |
"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
|
6948 |
path exists ifFalse:[ |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
6949 |
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
|
6950 |
] ifTrue:[ |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
6951 |
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
|
6952 |
]. |
3528 | 6953 |
msg := (resources string:msg) withCRs. |
6954 |
Dialog warn:(msg bindWith:fileNameString allBold). |
|
2158
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
6955 |
^ self |
1162 | 6956 |
]. |
6957 |
||
6958 |
"/ |
|
6959 |
"/ check if file is a text file |
|
6960 |
"/ |
|
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
6961 |
s := path readStream. |
1162 | 6962 |
s isNil ifTrue:[ |
3697
e2f7d8dec6e2
menu items/button labels uppercase-first
Claus Gittinger <cg@exept.de>
parents:
3691
diff
changeset
|
6963 |
self showAlert:(resources string:'Cannot read file ''%1'' !!' with:fileNameString) |
2158
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
6964 |
with:(FileStream lastErrorString). |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
6965 |
^ nil |
1162 | 6966 |
]. |
6967 |
||
1222
f2952fc3ced9
look at more when guessing the encoding
Claus Gittinger <cg@exept.de>
parents:
1221
diff
changeset
|
6968 |
buffer := String new:4096. |
f2952fc3ced9
look at more when guessing the encoding
Claus Gittinger <cg@exept.de>
parents:
1221
diff
changeset
|
6969 |
n := s nextBytes:4096 into:buffer. |
1162 | 6970 |
s close. |
6971 |
||
6972 |
enc := encoding. |
|
6973 |
ok := true. |
|
6974 |
guess := self guessEncodingFrom:buffer. |
|
6975 |
||
6976 |
guess == #binary ifTrue:[ |
|
2158
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
6977 |
ok := false. |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
6978 |
viaDoubleClick ifTrue:[ |
3414 | 6979 |
(self binaryFileAction:fileNameString) ifTrue:[^ self]. |
2158
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
6980 |
]. |
3414 | 6981 |
answer := self confirmWithCancel:(resources string:'''%1'' seems to be a binary file (or unsupported format) - show anyway ?' with:fileNameString). |
3061 | 6982 |
answer == false ifTrue:[^ self]. |
6983 |
answer isNil ifTrue:[AbortSignal raise]. |
|
1162 | 6984 |
] ifFalse:[ |
2158
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
6985 |
viaDoubleClick ifTrue:[ |
3414 | 6986 |
(self nonBinaryFileAction:fileNameString) ifTrue:[^ self]. |
2158
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
6987 |
]. |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
6988 |
|
3413 | 6989 |
fontsEncoding := subView font encoding ? 'unknown'. |
2158
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
6990 |
pref := self preferredFontEncodingFor:guess. |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
6991 |
|
3381
2a0331ea6dfc
stupid encoding question eliminated
Claus Gittinger <cg@exept.de>
parents:
3342
diff
changeset
|
6992 |
ok := pref asLowercase match:fontsEncoding asLowercase. |
2158
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
6993 |
ok ifFalse:[ |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
6994 |
pref = 'iso8859*' ifTrue:[ |
3381
2a0331ea6dfc
stupid encoding question eliminated
Claus Gittinger <cg@exept.de>
parents:
3342
diff
changeset
|
6995 |
ok := 'ascii*' match:fontsEncoding asLowercase |
2158
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
6996 |
] |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
6997 |
]. |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
6998 |
ok ifTrue:[ |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
6999 |
fileEncoding := guess. |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
7000 |
enc := guess. |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
7001 |
] ifFalse:[ |
2779 | 7002 |
doNotShowFontDialog == true ifTrue:[ |
7003 |
action := #show |
|
7004 |
] ifFalse:[ |
|
3414 | 7005 |
action := Dialog choose:(resources string:'''%1'' seems to require a %2 font.' with:fileNameString with:pref) |
3697
e2f7d8dec6e2
menu items/button labels uppercase-first
Claus Gittinger <cg@exept.de>
parents:
3691
diff
changeset
|
7006 |
labels:(resources array:#('Cancel' 'Show' 'Dont Ask Again' 'Change Font')) |
2779 | 7007 |
values:#(nil #show #showAlways #encoding) |
7008 |
default:#encoding. |
|
7009 |
]. |
|
7010 |
action == #showAlways ifTrue:[ |
|
7011 |
doNotShowFontDialog := true. |
|
7012 |
action := #show. |
|
7013 |
]. |
|
2158
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
7014 |
action isNil ifTrue:[^ self]. |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
7015 |
action == #encoding ifTrue:[ |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
7016 |
fileEncoding := guess asSymbol. |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
7017 |
subView externalEncoding:fileEncoding. |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
7018 |
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
|
7019 |
] ifFalse:[ |
2779 | 7020 |
doNotShowFontDialog ~~ true ifTrue:[ |
7021 |
self information:(resources string:'Individual characters may be invisible/wrong in this font.') |
|
7022 |
] |
|
2158
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
7023 |
]. |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
7024 |
enc := fileEncoding. |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
7025 |
]. |
1162 | 7026 |
]. |
7027 |
||
7028 |
convert := false. |
|
1329 | 7029 |
"/ ok ifTrue:[ |
7030 |
"/ "/ |
|
7031 |
"/ "/ check if line delimiter is a cr |
|
7032 |
"/ "/ |
|
7033 |
"/ i := buffer indexOf:Character cr. |
|
7034 |
"/ i == 0 ifTrue:[ |
|
7035 |
"/ "/ |
|
7036 |
"/ "/ no newline found - try cr |
|
7037 |
"/ "/ |
|
7038 |
"/ i := buffer indexOf:(Character value:13). |
|
7039 |
"/ i ~~ 0 ifTrue:[ |
|
3414 | 7040 |
"/ convert := self confirm:(resources string:'''%1'' seems to have CR as line delimiter - convert to NL ?' with:fileNameString). |
1329 | 7041 |
"/ ] |
7042 |
"/ ] |
|
7043 |
"/ ]. |
|
1162 | 7044 |
|
7045 |
insert ifFalse:[ |
|
2158
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
7046 |
"/ release old text first |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
7047 |
"/ - 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
|
7048 |
"/ (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
|
7049 |
"/ 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
|
7050 |
|
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
7051 |
subView contents:nil. |
1162 | 7052 |
]. |
7053 |
||
7054 |
convert ifTrue:[ |
|
2158
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
7055 |
eol := Character value:13 |
1162 | 7056 |
] ifFalse:[ |
2158
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
7057 |
eol := Character cr |
1162 | 7058 |
]. |
1212 | 7059 |
|
1214
02d5bbd925dd
allow decoding errors to be ignored
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
7060 |
failWarning := false. |
1212 | 7061 |
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
|
7062 |
|errStr| |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
7063 |
|
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
7064 |
failWarning ifFalse:[ |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
7065 |
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
|
7066 |
(self confirm:(resources |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
7067 |
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
|
7068 |
with:errStr) withCRs) |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
7069 |
ifFalse:[ |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
7070 |
^ self |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
7071 |
]. |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
7072 |
failWarning := true. |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
7073 |
]. |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
7074 |
ex proceed. |
1212 | 7075 |
] do:[ |
3414 | 7076 |
text := self readFile:fileNameString lineDelimiter:eol encoding:enc. |
1212 | 7077 |
]. |
1162 | 7078 |
|
7079 |
insert ifFalse:[ |
|
3414 | 7080 |
(f := fileName) isAbsolute ifFalse:[ |
7081 |
f := (currentDirectory construct:fileNameString) |
|
2951
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
7082 |
]. |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
7083 |
self class addToVisitedFileHistory:f pathName. |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
7084 |
|
2158
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
7085 |
self show:text |
1162 | 7086 |
] ifTrue:[ |
2158
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
7087 |
subView insertSelectedStringAtCursor:text asString |
1162 | 7088 |
]. |
7089 |
||
1994 | 7090 |
"Created: / 19.6.1996 / 09:39:52 / cg" |
7091 |
"Modified: / 18.9.1997 / 17:10:20 / stefan" |
|
3414 | 7092 |
"Modified: / 15.11.2001 / 17:15:27 / cg" |
1162 | 7093 |
! |
7094 |
||
7095 |
writeFile:fileName text:someText encoding:encoding |
|
1353 | 7096 |
|stream errReason msg startNr nLines string| |
7097 |
||
7098 |
errReason := ''. |
|
7099 |
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
|
7100 |
errReason := ex errorString. |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
7101 |
ex return. |
1353 | 7102 |
] do:[ |
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
7103 |
stream := (currentDirectory filenameFor:fileName) writeStream. |
1353 | 7104 |
]. |
1162 | 7105 |
stream isNil ifTrue:[ |
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
7106 |
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
|
7107 |
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
|
7108 |
^ self. |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
7109 |
]. |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
7110 |
|
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
7111 |
dosEOLMode value == true ifTrue:[ |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
7112 |
stream eolMode:#crlf. |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
7113 |
"/ must do it lineWise ... |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
7114 |
someText asStringCollection do:[:line | |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
7115 |
line notNil ifTrue:[ |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
7116 |
stream nextPutAll:line |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
7117 |
]. |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
7118 |
stream cr |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
7119 |
] |
1162 | 7120 |
] ifFalse:[ |
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
7121 |
(someText isString) ifTrue:[ |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
7122 |
stream nextPutAll:someText. |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
7123 |
] ifFalse:[ |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
7124 |
"/ |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
7125 |
"/ 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
|
7126 |
"/ 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
|
7127 |
"/ 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
|
7128 |
"/ |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
7129 |
startNr := 1. |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
7130 |
nLines := someText size. |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
7131 |
[startNr <= nLines] whileTrue:[ |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
7132 |
string := someText asStringWithCRsFrom:startNr |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
7133 |
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
|
7134 |
compressTabs:compressTabs. |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
7135 |
encoding notNil ifTrue:[ |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
7136 |
string := string encodeInto:encoding |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
7137 |
]. |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
7138 |
stream nextPutAll:string. |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
7139 |
startNr := startNr + 1000 + 1. |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
7140 |
]. |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
7141 |
]. |
1353 | 7142 |
]. |
7143 |
||
7144 |
stream close. |
|
7145 |
subView modified:false |
|
1162 | 7146 |
|
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
7147 |
"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
|
7148 |
"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
|
7149 |
"Modified: / 6.5.1999 / 11:45:50 / cg" |
1140 | 7150 |
! ! |
7151 |
||
7152 |
!FileBrowser methodsFor:'private - presentation'! |
|
7153 |
||
7154 |
defineTabulatorsForLongList |
|
7155 |
"define the tabs for the long list" |
|
7156 |
||
7157 |
tabSpec := TabulatorSpecification new. |
|
7158 |
tabSpec unit:#inch. |
|
7159 |
"/ tabSpec positions:#(0 0.25 2.3 4.3 5.3 6.0 6.5). |
|
7160 |
tabSpec widths: #(0.25 2 2.0 1 0.5 0.5 1"any"). |
|
7161 |
" icon name mode owner group size type" |
|
7162 |
tabSpec align: #(#left #left #left #right #right #decimal #left). |
|
7163 |
tabSpec addDependent:self. |
|
7164 |
||
7165 |
tabRulerView tabulatorSpecification:tabSpec. |
|
7166 |
||
7167 |
"Modified: 17.4.1997 / 02:56:07 / cg" |
|
172 | 7168 |
! |
7169 |
||
1140 | 7170 |
defineTabulatorsForShortList |
7171 |
"define the tabs for the short list" |
|
7172 |
||
7173 |
tabSpec := TabulatorSpecification new. |
|
7174 |
tabSpec unit:#inch. |
|
7175 |
"/ tabSpec positions:#(0 0.25 ). |
|
7176 |
tabSpec widths: #(0.25 2 ). |
|
7177 |
" icon name" |
|
7178 |
tabSpec align: #(#left #left). |
|
7179 |
tabSpec addDependent:self. |
|
7180 |
||
1758 | 7181 |
tabRulerView notNil ifTrue:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7182 |
tabRulerView tabulatorSpecification:tabSpec. |
1758 | 7183 |
]. |
7184 |
||
7185 |
"Created: / 17.4.1997 / 02:51:41 / cg" |
|
7186 |
"Modified: / 27.7.1998 / 20:23:34 / cg" |
|
1140 | 7187 |
! |
7188 |
||
7189 |
iconForFile:aFilenameString |
|
1147 | 7190 |
"given a fileName, return an appropriate icon" |
7191 |
||
1784
329e3a904236
ask MIMETypes when mapping suffixes to icons.
Claus Gittinger <cg@exept.de>
parents:
1758
diff
changeset
|
7192 |
|f icn key key2 suff mimeType| |
1140 | 7193 |
|
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
7194 |
f := currentDirectory construct:aFilenameString. |
1140 | 7195 |
f isDirectory ifTrue:[ |
2187
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
7196 |
f isSymbolicLink ifTrue:[ |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
7197 |
key := #directoryLink |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
7198 |
] ifFalse:[ |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
7199 |
key := #directory. |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
7200 |
(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
|
7201 |
key := #directoryLocked |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
7202 |
]. |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
7203 |
] |
1147 | 7204 |
] ifFalse:[ |
2187
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
7205 |
f isSymbolicLink ifTrue:[ |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
7206 |
f isReadable not ifTrue:[ |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
7207 |
key := #fileLocked |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
7208 |
] ifFalse:[ |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
7209 |
key := #fileLink |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
7210 |
] |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
7211 |
] ifFalse:[ |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
7212 |
key := key2 := #file. |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
7213 |
f isExecutableProgram ifTrue:[ |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
7214 |
key := key2 := #executableFile |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
7215 |
]. |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
7216 |
(f isReadable not) ifTrue:[ |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
7217 |
key := #fileLocked |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
7218 |
] ifFalse:[ |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
7219 |
suff := f suffix. |
2504 | 7220 |
(suff = 'bak' or:[suff = 'sav']) ifTrue:[ |
7221 |
suff := f withoutSuffix suffix. |
|
7222 |
]. |
|
7223 |
suff size > 0 ifTrue:[ |
|
7224 |
mimeType := MIMETypes mimeTypeForSuffix:suff. |
|
7225 |
mimeType notNil ifTrue:[ |
|
7226 |
(mimeType startsWith:'image/') ifTrue:[ |
|
7227 |
key := #imageFile |
|
7228 |
] ifFalse:[ |
|
7229 |
(mimeType startsWith:'text/') ifTrue:[ |
|
7230 |
key := #textFile |
|
7231 |
] |
|
2187
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
7232 |
] |
2504 | 7233 |
]. |
2187
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
7234 |
]. |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
7235 |
]. |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
7236 |
]. |
1141 | 7237 |
]. |
1147 | 7238 |
|
1784
329e3a904236
ask MIMETypes when mapping suffixes to icons.
Claus Gittinger <cg@exept.de>
parents:
1758
diff
changeset
|
7239 |
"/ local (device) icons |
329e3a904236
ask MIMETypes when mapping suffixes to icons.
Claus Gittinger <cg@exept.de>
parents:
1758
diff
changeset
|
7240 |
icons notNil ifTrue:[ |
2187
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
7241 |
mimeType notNil ifTrue:[ |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
7242 |
icn := icons at:mimeType ifAbsent:nil. |
2796 | 7243 |
] ifFalse:[ |
7244 |
icn := icons at:key ifAbsent:nil. |
|
2187
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
7245 |
]. |
2796 | 7246 |
icn notNil ifTrue:[^ icn]. |
1141 | 7247 |
]. |
1495 | 7248 |
|
1784
329e3a904236
ask MIMETypes when mapping suffixes to icons.
Claus Gittinger <cg@exept.de>
parents:
1758
diff
changeset
|
7249 |
"/ global icons |
329e3a904236
ask MIMETypes when mapping suffixes to icons.
Claus Gittinger <cg@exept.de>
parents:
1758
diff
changeset
|
7250 |
|
329e3a904236
ask MIMETypes when mapping suffixes to icons.
Claus Gittinger <cg@exept.de>
parents:
1758
diff
changeset
|
7251 |
Icons notNil ifTrue:[ |
2187
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
7252 |
mimeType notNil ifTrue:[ |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
7253 |
icn := Icons at:mimeType ifAbsent:nil. |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
7254 |
"/ sight - check for parent-MIME types ... |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
7255 |
|
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
7256 |
[icn isNil and:[mimeType includes:$/]] whileTrue:[ |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
7257 |
mimeType := mimeType copyTo:(mimeType lastIndexOf:$/) - 1. |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
7258 |
icn := Icons at:mimeType ifAbsent:nil. |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
7259 |
]. |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
7260 |
]. |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
7261 |
icn notNil ifTrue:[ |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
7262 |
key := mimeType |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
7263 |
] ifFalse:[ |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
7264 |
icn := Icons at:key ifAbsent:nil. |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
7265 |
]. |
1784
329e3a904236
ask MIMETypes when mapping suffixes to icons.
Claus Gittinger <cg@exept.de>
parents:
1758
diff
changeset
|
7266 |
]. |
1495 | 7267 |
|
1253 | 7268 |
icn isNil ifTrue:[ |
2187
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
7269 |
( (key := key2) isNil |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
7270 |
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
|
7271 |
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
|
7272 |
) ifTrue:[ |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
7273 |
^ icn |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
7274 |
] |
1253 | 7275 |
]. |
1495 | 7276 |
|
1784
329e3a904236
ask MIMETypes when mapping suffixes to icons.
Claus Gittinger <cg@exept.de>
parents:
1758
diff
changeset
|
7277 |
"/ remember device icon |
329e3a904236
ask MIMETypes when mapping suffixes to icons.
Claus Gittinger <cg@exept.de>
parents:
1758
diff
changeset
|
7278 |
icn := icn copy onDevice:device. |
1495 | 7279 |
icn clearMaskedPixels. |
7280 |
icons at:key put:icn. |
|
1239
e58e2cb6639a
allow specification of icons from resource file.
Claus Gittinger <cg@exept.de>
parents:
1235
diff
changeset
|
7281 |
^ icn |
1141 | 7282 |
|
1746
68a187e3f30f
another icon for executable files.
Claus Gittinger <cg@exept.de>
parents:
1737
diff
changeset
|
7283 |
"Modified: / 18.9.1997 / 16:35:28 / stefan" |
2504 | 7284 |
"Modified: / 23.12.1999 / 22:28:00 / cg" |
36 | 7285 |
! |
7286 |
||
2094 | 7287 |
stopImageRenderProcess |
7288 |
imageRenderProcess notNil ifTrue:[ |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7289 |
imageRenderProcess terminate. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7290 |
imageRenderProcess := nil |
2094 | 7291 |
]. |
7292 |
||
7293 |
"Created: 19.4.1997 / 13:51:34 / cg" |
|
7294 |
! |
|
7295 |
||
1156
f3df28086973
dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents:
1154
diff
changeset
|
7296 |
stopUpdateProcess |
f3df28086973
dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents:
1154
diff
changeset
|
7297 |
Processor removeTimedBlock:checkBlock. |
f3df28086973
dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents:
1154
diff
changeset
|
7298 |
listUpdateProcess notNil ifTrue:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7299 |
listUpdateProcess terminate. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7300 |
listUpdateProcess := nil. |
1156
f3df28086973
dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents:
1154
diff
changeset
|
7301 |
]. |
f3df28086973
dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents:
1154
diff
changeset
|
7302 |
|
f3df28086973
dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents:
1154
diff
changeset
|
7303 |
"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
|
7304 |
! |
f3df28086973
dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents:
1154
diff
changeset
|
7305 |
|
36 | 7306 |
updateCurrentDirectory |
7307 |
"update listView with directory contents" |
|
7308 |
||
49 | 7309 |
"the code below may look somewhat complex - |
7310 |
it reads the directory first for the names, |
|
1151
194b10bad6da
great asynchronous list update;
Claus Gittinger <cg@exept.de>
parents:
1147
diff
changeset
|
7311 |
then (in followup sweeps over the files) gets the |
194b10bad6da
great asynchronous list update;
Claus Gittinger <cg@exept.de>
parents:
1147
diff
changeset
|
7312 |
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
|
7313 |
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
|
7314 |
(i.e. stat-calls) may take long - especially on NFS-mounted directories. |
49 | 7315 |
The file reading is done at lower priority, to let user continue |
7316 |
his work in other views. However, to be fair to other fileBrowser, |
|
7317 |
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
|
7318 |
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
|
7319 |
Therefore, browsers which read short directories will finish first. |
49 | 7320 |
ST/X users love this behavior ;-) |
7321 |
" |
|
7322 |
||
3665 | 7323 |
|files matchPattern list passDone ignoreCase oldSelection newSelection times types| |
3419 | 7324 |
|
294 | 7325 |
self withReadCursorDo:[ |
2255
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7326 |
self stopUpdateProcess. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7327 |
|
2636 | 7328 |
timeOfLastCheck := currentDirectory modificationTime. |
2255
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7329 |
|
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7330 |
files := currentDirectory asFilename fullDirectoryContents. |
1329 | 7331 |
|
7332 |
"/ (files includes:(Filename parentDirectoryName)) ifTrue:[ |
|
7333 |
"/ upButton enable. |
|
7334 |
"/ ] ifFalse:[ |
|
7335 |
"/ upButton disable. |
|
7336 |
"/ ]. |
|
7337 |
||
2255
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7338 |
"/ show files which are either directories |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7339 |
"/ or match the current pattern |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7340 |
|
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7341 |
matchPattern := filterField contents. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7342 |
(matchPattern notNil and:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7343 |
matchPattern isEmpty not and:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7344 |
matchPattern ~= '*']]) ifTrue:[ |
2498
77c52f2004a4
care for case-insensitive systems in pattern-match (windows)
Claus Gittinger <cg@exept.de>
parents:
2492
diff
changeset
|
7345 |
ignoreCase := Filename isCaseSensitive not. |
2255
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7346 |
files := files select:[:aName | |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7347 |
((currentDirectory construct:aName) isDirectory) |
2498
77c52f2004a4
care for case-insensitive systems in pattern-match (windows)
Claus Gittinger <cg@exept.de>
parents:
2492
diff
changeset
|
7348 |
or:[matchPattern compoundMatch:aName ignoreCase:ignoreCase] |
2255
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7349 |
]. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7350 |
]. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7351 |
|
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7352 |
files size == 0 ifTrue:[ |
3528 | 7353 |
Dialog warn:((resources string:'Directory ''%1'' is gone.') |
7354 |
withCRs |
|
7355 |
bindWith:currentDirectory pathName allBold). |
|
2255
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7356 |
^ self |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7357 |
]. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7358 |
(sortByWhat value == #name) ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7359 |
sortCaseless value == true ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7360 |
files sort:[:a :b | a asLowercase < b asLowercase] |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7361 |
] ifFalse:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7362 |
files sort. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7363 |
] |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7364 |
] ifFalse:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7365 |
(sortByWhat value == #time) ifTrue:[ |
3665 | 7366 |
times := Dictionary new. |
7367 |
files do:[:fn | |t f| |
|
7368 |
f := currentDirectory construct:fn. |
|
7369 |
t := f isSymbolicLink |
|
7370 |
ifFalse:[f modificationTime] |
|
7371 |
ifTrue:[f linkInfo modified]. |
|
7372 |
t isNil ifTrue:[t := AbsoluteTime now]. |
|
7373 |
times at:fn put:t. |
|
7374 |
]. |
|
2255
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7375 |
files sort:[:a :b | |f1 f2 t1 t2| |
3665 | 7376 |
t1 := times at:a. |
7377 |
t2 := times at:b. |
|
7378 |
||
7379 |
"/ f1 := (currentDirectory construct:a). |
|
7380 |
"/ f2 := (currentDirectory construct:b). |
|
7381 |
"/ t1 := f1 isSymbolicLink |
|
7382 |
"/ ifFalse:[f1 modificationTime] |
|
7383 |
"/ ifTrue:[f1 linkInfo modified]. |
|
7384 |
"/ t2 := f2 isSymbolicLink |
|
7385 |
"/ ifFalse:[f2 modificationTime] |
|
7386 |
"/ ifTrue:[f2 linkInfo modified]. |
|
7387 |
"/ t1 := t1 ? (AbsoluteTime now). |
|
7388 |
"/ t2 := t2 ? (AbsoluteTime now). |
|
2255
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7389 |
t1 > t2 |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7390 |
] |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7391 |
] ifFalse:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7392 |
(sortByWhat value == #type) ifTrue:[ |
3665 | 7393 |
types := Dictionary new. |
7394 |
files do:[:fn | |t f| |
|
7395 |
f := currentDirectory construct:fn. |
|
7396 |
t := f type ? #xbadLink. |
|
7397 |
types at:fn put:t. |
|
7398 |
]. |
|
2255
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7399 |
files sort:[:a :b | |f1 f2 t1 t2 suff1 suff2| |
3665 | 7400 |
t1 := types at:a. |
7401 |
t2 := types at:b. |
|
7402 |
"/ f1 := (currentDirectory construct:a). |
|
7403 |
"/ f2 := (currentDirectory construct:b). |
|
7404 |
"/ t1 := f1 type ? #xbadLink. |
|
7405 |
"/ t2 := f2 type ? #xbadLink. |
|
2255
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7406 |
t1 = t2 ifTrue:[ |
3665 | 7407 |
f1 := (currentDirectory construct:a). |
7408 |
f2 := (currentDirectory construct:b). |
|
2255
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7409 |
suff1 := f1 suffix. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7410 |
suff2 := f2 suffix. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7411 |
suff1 = suff2 ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7412 |
sortCaseless value == true ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7413 |
a asLowercase < b asLowercase |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7414 |
] ifFalse:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7415 |
a < b |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7416 |
] |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7417 |
] ifFalse:[ |
3665 | 7418 |
suff1 asLowercase = suff2 asLowercase ifTrue:[ |
7419 |
sortCaseless value == true ifTrue:[ |
|
7420 |
a asLowercase < b asLowercase |
|
7421 |
] ifFalse:[ |
|
7422 |
a < b |
|
7423 |
] |
|
7424 |
] ifFalse:[ |
|
7425 |
suff1 asLowercase < suff2 asLowercase |
|
7426 |
] |
|
2255
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7427 |
] |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7428 |
] ifFalse:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7429 |
t1 < t2 |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7430 |
] |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7431 |
] |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7432 |
] |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7433 |
] |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7434 |
]. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7435 |
|
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7436 |
files := self withoutHiddenFiles:files. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7437 |
fileList := files copy. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7438 |
|
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7439 |
tabSpec isNil ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7440 |
showingDetails value "showLongList" ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7441 |
self defineTabulatorsForLongList |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7442 |
] ifFalse:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7443 |
self defineTabulatorsForShortList |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7444 |
]. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7445 |
]. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7446 |
|
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7447 |
"/ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7448 |
"/ first show all the names - this can be done fast ... |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7449 |
"/ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7450 |
list := files collect:[:fileName | |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7451 |
|entry| |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7452 |
|
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7453 |
entry := MultiColListEntry new. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7454 |
entry tabulatorSpecification:tabSpec. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7455 |
entry colAt:1 put:nil. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7456 |
entry colAt:2 put:fileName. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7457 |
]. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7458 |
|
3206 | 7459 |
oldSelection := fileListView selectionValue. |
2255
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7460 |
fileListView setList:list expandTabs:false. |
3206 | 7461 |
newSelection := oldSelection collect:[:nm | list indexOf:nm]. |
7462 |
fileListView selectWithoutScroll:newSelection. |
|
7463 |
||
2255
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7464 |
passDone := Array new:list size withAll:0. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7465 |
|
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7466 |
" |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7467 |
this is a time consuming operation (especially, if reading an |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7468 |
NFS-mounted directory); therefore, start a low prio process, |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7469 |
which fills in the remaining fields in the fileList ... |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7470 |
" |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7471 |
|
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7472 |
listUpdateProcess := [ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7473 |
|prevUid prevGid fileNameString nameString groupString |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7474 |
modeString info line len |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7475 |
anyImages lineIndex aFileName |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7476 |
entry typ f p typeString done endIndex |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7477 |
state stopAtEnd nextState img prevFirstLine prevLastLine |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7478 |
numVisible dirSuffix prevWidth t| |
2255
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7479 |
|
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7480 |
dirSuffix := Filename directorySuffix. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7481 |
dirSuffix size > 0 ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7482 |
dirSuffix := '.' , dirSuffix asLowercase. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7483 |
]. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7484 |
|
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7485 |
"/ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7486 |
"/ then walk over the files, adding more info |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7487 |
"/ (since we have to stat each file, this may take a while longer) |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7488 |
"/ Visible items are always filled first. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7489 |
|
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7490 |
"/ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7491 |
"/ the state machine |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7492 |
"/ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7493 |
nextState := IdentityDictionary new. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7494 |
showingDetails value "showLongList" ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7495 |
nextState add:(#visibleIcons -> #visibleAttributes). |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7496 |
nextState add:(#visibleAttributes -> #visibleTypes). |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7497 |
nextState add:(#visibleTypes -> #visibleImages). |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7498 |
nextState add:(#visibleImages -> #nextPageIcons). |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7499 |
|
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7500 |
nextState add:(#nextPageIcons -> #nextPageAttributes). |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7501 |
nextState add:(#nextPageAttributes -> #nextPageTypes). |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7502 |
nextState add:(#nextPageTypes -> #nextPageImages). |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7503 |
nextState add:(#nextPageImages -> #previousPageIcons). |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7504 |
|
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7505 |
nextState add:(#previousPageIcons -> #previousPageAttributes). |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7506 |
nextState add:(#previousPageAttributes -> #previousPageTypes). |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7507 |
nextState add:(#previousPageTypes -> #previousPageImages). |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7508 |
nextState add:(#previousPageImages -> #remainingIcons). |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7509 |
|
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7510 |
nextState add:(#remainingIcons -> #remainingAttributes). |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7511 |
nextState add:(#remainingAttributes -> #remainingTypes). |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7512 |
nextState add:(#remainingTypes -> #remainingImages). |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7513 |
nextState add:(#remainingImages -> nil). |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7514 |
] ifFalse:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7515 |
nextState add:(#visibleIcons -> #nextPageIcons). |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7516 |
nextState add:(#nextPageIcons -> #previousPageIcons). |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7517 |
nextState add:(#previousPageIcons -> #remainingIcons). |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7518 |
nextState add:(#remainingIcons -> nil). |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7519 |
]. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7520 |
|
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7521 |
anyImages := false. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7522 |
|
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7523 |
lineIndex := prevFirstLine := fileListView firstLineShown. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7524 |
endIndex := prevLastLine := fileListView lastLineShown. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7525 |
endIndex := endIndex min:(files size). |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7526 |
state := #visibleIcons. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7527 |
|
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7528 |
done := false. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7529 |
[done] whileFalse:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7530 |
"/ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7531 |
"/ if multiple FileBrowsers are reading, let others |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7532 |
"/ make some progress too |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7533 |
"/ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7534 |
Processor yield. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7535 |
|
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7536 |
"/ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7537 |
"/ could be destroyed in the meanwhile ... |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7538 |
"/ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7539 |
realized ifFalse:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7540 |
listUpdateProcess := nil. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7541 |
Processor activeProcess terminate |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7542 |
]. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7543 |
|
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7544 |
((prevFirstLine ~~ fileListView firstLineShown) |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7545 |
or:[prevLastLine ~~ fileListView lastLineShown]) ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7546 |
"/ start all over again |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7547 |
lineIndex := prevFirstLine := fileListView firstLineShown. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7548 |
endIndex := prevLastLine := fileListView lastLineShown. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7549 |
endIndex := endIndex min:(files size). |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7550 |
state := #visibleIcons. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7551 |
]. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7552 |
|
2257
02dc5c0000e1
oops - must send size-changeNotification manually
Claus Gittinger <cg@exept.de>
parents:
2256
diff
changeset
|
7553 |
showingDetails value ifTrue:[ |
02dc5c0000e1
oops - must send size-changeNotification manually
Claus Gittinger <cg@exept.de>
parents:
2256
diff
changeset
|
7554 |
prevWidth := fileListView widthOfContents. |
02dc5c0000e1
oops - must send size-changeNotification manually
Claus Gittinger <cg@exept.de>
parents:
2256
diff
changeset
|
7555 |
]. |
02dc5c0000e1
oops - must send size-changeNotification manually
Claus Gittinger <cg@exept.de>
parents:
2256
diff
changeset
|
7556 |
|
2255
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7557 |
(lineIndex between:1 and:(files size)) ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7558 |
|
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7559 |
"/ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7560 |
"/ expand the next entry ... |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7561 |
"/ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7562 |
aFileName := files at:lineIndex. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7563 |
entry := fileListView at:lineIndex. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7564 |
f := currentDirectory construct:aFileName. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7565 |
|
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7566 |
(state endsWith:'Icons') ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7567 |
"/ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7568 |
"/ pass 1 - icons |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7569 |
"/ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7570 |
(passDone at:lineIndex) < 1 ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7571 |
(f isDirectory |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7572 |
and:[(aFileName ~= '..') and:[aFileName ~= '.']] |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7573 |
) ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7574 |
|
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7575 |
"/ the following suffix cutOff is not really required, |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7576 |
"/ but makes the list look better on VMS ... |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7577 |
fileNameString := aFileName. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7578 |
dirSuffix notNil ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7579 |
(aFileName asLowercase endsWith:dirSuffix) ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7580 |
fileNameString := aFileName copyWithoutLast:(dirSuffix size). |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7581 |
] |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7582 |
]. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7583 |
fileNameString := fileNameString , ' ...' |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7584 |
] ifFalse:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7585 |
fileNameString := aFileName. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7586 |
OperatingSystem isVMSlike ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7587 |
(aFileName endsWith:'.') ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7588 |
aFileName ~= '..' ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7589 |
fileNameString := aFileName copyWithoutLast:1 |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7590 |
] |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7591 |
] |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7592 |
] |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7593 |
]. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7594 |
|
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7595 |
showingDetails value "showLongList" ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7596 |
len := fileNameString size. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7597 |
(len > 20) ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7598 |
fileNameString := (fileNameString contractTo:20) |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7599 |
]. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7600 |
]. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7601 |
|
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7602 |
entry colAt:1 put:(self iconForFile:aFileName). |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7603 |
entry colAt:2 put:fileNameString. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7604 |
|
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7605 |
"/fileListView at:lineIndex put:entry. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7606 |
fileListView withoutRedrawAt:lineIndex put:entry. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7607 |
fileListView invalidateLine:lineIndex. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7608 |
|
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7609 |
anyImages ifFalse:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7610 |
(Image isImageFileSuffix:(aFileName asFilename suffix)) |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7611 |
ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7612 |
anyImages := true |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7613 |
] |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7614 |
]. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7615 |
passDone at:lineIndex put:1 |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7616 |
] |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7617 |
]. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7618 |
|
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7619 |
(state endsWith:'Attributes') ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7620 |
"/ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7621 |
"/ pass 2 - everything except fileType (which takes very long) |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7622 |
"/ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7623 |
(passDone at:lineIndex) < 2 ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7624 |
info := f info. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7625 |
info isNil ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7626 |
"not accessable - usually a symlink, |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7627 |
to a nonexisting/nonreadable file |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7628 |
" |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7629 |
f isSymbolicLink ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7630 |
p := f linkInfo path. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7631 |
typeString := 'broken symbolic link to ' , p |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7632 |
] ifFalse:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7633 |
typeString := 'unknown' |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7634 |
]. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7635 |
] ifFalse:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7636 |
typ := (info type). |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7637 |
|
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7638 |
modeString := self getModeString:(info at:#mode) |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7639 |
with:#( '' $r $w $x |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7640 |
' ' $r $w $x |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7641 |
' ' $r $w $x ). |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7642 |
entry colAt:3 put:modeString. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7643 |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7644 |
showingTimeAndDate value ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7645 |
t := f isSymbolicLink |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7646 |
ifFalse:[f modificationTime] |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7647 |
ifTrue:[f linkInfo modified]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7648 |
entry colAt:4 put:t asDate printString. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7649 |
entry colAt:5 put:t asTime printString. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7650 |
] ifFalse:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7651 |
((info uid) ~~ prevUid) ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7652 |
prevUid := (info uid). |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7653 |
nameString := OperatingSystem getUserNameFromID:prevUid. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7654 |
nameString := nameString contractTo:10. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7655 |
nameString := nameString , (String new:(10 - nameString size)) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7656 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7657 |
nameString isNil ifTrue:[nameString := '???']. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7658 |
entry colAt:4 put:nameString withoutSpaces. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7659 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7660 |
((info gid) ~~ prevGid) ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7661 |
prevGid := (info gid). |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7662 |
groupString := OperatingSystem getGroupNameFromID:prevGid. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7663 |
groupString := groupString contractTo:10. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7664 |
groupString := groupString , (String new:(10 - groupString size)) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7665 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7666 |
groupString isNil ifTrue:[groupString := '???']. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7667 |
entry colAt:5 put:groupString withoutSpaces. |
2255
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7668 |
]. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7669 |
|
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7670 |
(typ == #regular) ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7671 |
entry colAt:6 put:(self sizePrintString:(info size)). |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7672 |
]. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7673 |
|
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7674 |
f isSymbolicLink ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7675 |
p := f linkInfo path. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7676 |
typeString := 'symbolic link to ' , p |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7677 |
] ifFalse:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7678 |
typeString := typ asString |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7679 |
]. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7680 |
]. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7681 |
entry colAt:7 put:typeString. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7682 |
|
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7683 |
"/ fileListView at:lineIndex put:entry. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7684 |
fileListView withoutRedrawAt:lineIndex put:entry. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7685 |
fileListView invalidateLine:lineIndex. |
2257
02dc5c0000e1
oops - must send size-changeNotification manually
Claus Gittinger <cg@exept.de>
parents:
2256
diff
changeset
|
7686 |
|
2255
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7687 |
passDone at:lineIndex put:2. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7688 |
]. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7689 |
]. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7690 |
|
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7691 |
(state endsWith:'Types') ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7692 |
"/ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7693 |
"/ pass 3: add fileType |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7694 |
"/ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7695 |
(passDone at:lineIndex) < 3 ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7696 |
info := f info. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7697 |
info notNil ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7698 |
f isSymbolicLink ifFalse:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7699 |
(Image isImageFileSuffix:(f suffix)) ifFalse:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7700 |
typeString := f fileType. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7701 |
|
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7702 |
entry colAt:7 put:typeString. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7703 |
"/ fileListView at:lineIndex put:entry |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7704 |
fileListView withoutRedrawAt:lineIndex put:entry. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7705 |
fileListView invalidateLine:lineIndex. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7706 |
]. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7707 |
]. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7708 |
]. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7709 |
|
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7710 |
passDone at:lineIndex put:3 |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7711 |
]. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7712 |
]. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7713 |
|
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7714 |
(state endsWith:'Images') ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7715 |
"/ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7716 |
"/ pass 4: read images |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7717 |
"/ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7718 |
(passDone at:lineIndex) < 4 ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7719 |
(Image isImageFileSuffix:(f suffix)) ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7720 |
f isDirectory ifFalse:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7721 |
img := Image fromFile:(f pathName). |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7722 |
img notNil ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7723 |
showingBigImagePreview value == true ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7724 |
img := img magnifiedTo:32@32. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7725 |
] ifFalse:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7726 |
img := img magnifiedTo:16@16. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7727 |
]. |
2339 | 7728 |
img := img onDevice:self device. |
2255
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7729 |
entry colAt:7 put:img. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7730 |
"/ fileListView at:lineIndex put:entry |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7731 |
fileListView withoutRedrawAt:lineIndex put:entry. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7732 |
fileListView invalidateLine:lineIndex. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7733 |
] |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7734 |
] |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7735 |
]. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7736 |
passDone at:lineIndex put:4 |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7737 |
]. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7738 |
]. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7739 |
]. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7740 |
|
2257
02dc5c0000e1
oops - must send size-changeNotification manually
Claus Gittinger <cg@exept.de>
parents:
2256
diff
changeset
|
7741 |
showingDetails value ifTrue:[ |
02dc5c0000e1
oops - must send size-changeNotification manually
Claus Gittinger <cg@exept.de>
parents:
2256
diff
changeset
|
7742 |
fileListView widthOfContents ~~ prevWidth ifTrue:[ |
02dc5c0000e1
oops - must send size-changeNotification manually
Claus Gittinger <cg@exept.de>
parents:
2256
diff
changeset
|
7743 |
fileListView contentsChanged. |
02dc5c0000e1
oops - must send size-changeNotification manually
Claus Gittinger <cg@exept.de>
parents:
2256
diff
changeset
|
7744 |
] |
02dc5c0000e1
oops - must send size-changeNotification manually
Claus Gittinger <cg@exept.de>
parents:
2256
diff
changeset
|
7745 |
]. |
02dc5c0000e1
oops - must send size-changeNotification manually
Claus Gittinger <cg@exept.de>
parents:
2256
diff
changeset
|
7746 |
|
2255
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7747 |
"/ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7748 |
"/ advance to the next line |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7749 |
"/ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7750 |
lineIndex := lineIndex + 1. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7751 |
lineIndex > endIndex ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7752 |
"/ finished this round ... |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7753 |
"/ see what we are going for ... |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7754 |
numVisible := (fileListView lastLineShown - fileListView firstLineShown + 1). |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7755 |
|
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7756 |
state := nextState at:state ifAbsent:nil. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7757 |
|
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7758 |
state isNil ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7759 |
done := true |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7760 |
] ifFalse:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7761 |
(state startsWith:'visible') ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7762 |
lineIndex := fileListView firstLineShown. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7763 |
endIndex := fileListView lastLineShown. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7764 |
endIndex := endIndex min:(files size). |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7765 |
] ifFalse:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7766 |
(state startsWith:'nextPage') ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7767 |
lineIndex := fileListView lastLineShown + 1. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7768 |
endIndex := lineIndex + numVisible. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7769 |
endIndex := endIndex min:(files size). |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7770 |
lineIndex := lineIndex min:(files size). |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7771 |
] ifFalse:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7772 |
(state startsWith:'previousPage') ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7773 |
endIndex := fileListView firstLineShown - 1. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7774 |
lineIndex := endIndex - numVisible. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7775 |
lineIndex := lineIndex max:1. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7776 |
endIndex := endIndex min:(files size). |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7777 |
endIndex := endIndex max:1. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7778 |
] ifFalse:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7779 |
"/ remaining |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7780 |
lineIndex := 1. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7781 |
endIndex := files size. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7782 |
] |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7783 |
] |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7784 |
] |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7785 |
] |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7786 |
] |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7787 |
]. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7788 |
|
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7789 |
listUpdateProcess := nil. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7790 |
|
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7791 |
] forkAt:(Processor activePriority - 1). |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7792 |
|
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7793 |
" |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7794 |
install a new check after some time |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7795 |
" |
3520
83cf11e1bf32
schedule checkBlock for the right process
Claus Gittinger <cg@exept.de>
parents:
3503
diff
changeset
|
7796 |
self scheduleCheckBlock. |
36 | 7797 |
] |
142 | 7798 |
|
1487
c8d32d8b039c
oops - dont sort a nil object
Claus Gittinger <cg@exept.de>
parents:
1481
diff
changeset
|
7799 |
"Modified: / 21.9.1995 / 11:40:23 / claus" |
c8d32d8b039c
oops - dont sort a nil object
Claus Gittinger <cg@exept.de>
parents:
1481
diff
changeset
|
7800 |
"Modified: / 28.4.1997 / 22:30:30 / dq" |
c8d32d8b039c
oops - dont sort a nil object
Claus Gittinger <cg@exept.de>
parents:
1481
diff
changeset
|
7801 |
"Modified: / 18.9.1997 / 18:28:30 / stefan" |
3419 | 7802 |
"Modified: / 15.11.2001 / 23:49:03 / cg" |
386
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
7803 |
! ! |
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
7804 |
|
172 | 7805 |
!FileBrowser methodsFor:'queries'! |
73 | 7806 |
|
1700
5067b3c4cafa
added access to fileName (kludge to fileIn RefactoryBrowser)
Claus Gittinger <cg@exept.de>
parents:
1689
diff
changeset
|
7807 |
fileName |
1702
962056a31c06
remember the current file during fileIn,
Claus Gittinger <cg@exept.de>
parents:
1700
diff
changeset
|
7808 |
"return my current fileName - during fileIn, the file |
962056a31c06
remember the current file during fileIn,
Claus Gittinger <cg@exept.de>
parents:
1700
diff
changeset
|
7809 |
which is being loaded is returned. |
962056a31c06
remember the current file during fileIn,
Claus Gittinger <cg@exept.de>
parents:
1700
diff
changeset
|
7810 |
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
|
7811 |
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
|
7812 |
|
962056a31c06
remember the current file during fileIn,
Claus Gittinger <cg@exept.de>
parents:
1700
diff
changeset
|
7813 |
|f| |
962056a31c06
remember the current file during fileIn,
Claus Gittinger <cg@exept.de>
parents:
1700
diff
changeset
|
7814 |
|
962056a31c06
remember the current file during fileIn,
Claus Gittinger <cg@exept.de>
parents:
1700
diff
changeset
|
7815 |
f := currentFileInFileName ? currentFileName. |
962056a31c06
remember the current file during fileIn,
Claus Gittinger <cg@exept.de>
parents:
1700
diff
changeset
|
7816 |
f isNil ifTrue:[^ nil]. |
962056a31c06
remember the current file during fileIn,
Claus Gittinger <cg@exept.de>
parents:
1700
diff
changeset
|
7817 |
^ self path asFilename construct:f |
1700
5067b3c4cafa
added access to fileName (kludge to fileIn RefactoryBrowser)
Claus Gittinger <cg@exept.de>
parents:
1689
diff
changeset
|
7818 |
|
5067b3c4cafa
added access to fileName (kludge to fileIn RefactoryBrowser)
Claus Gittinger <cg@exept.de>
parents:
1689
diff
changeset
|
7819 |
" |
5067b3c4cafa
added access to fileName (kludge to fileIn RefactoryBrowser)
Claus Gittinger <cg@exept.de>
parents:
1689
diff
changeset
|
7820 |
(FileBrowser openOnFileNamed:'Makefile') fileName |
5067b3c4cafa
added access to fileName (kludge to fileIn RefactoryBrowser)
Claus Gittinger <cg@exept.de>
parents:
1689
diff
changeset
|
7821 |
" |
5067b3c4cafa
added access to fileName (kludge to fileIn RefactoryBrowser)
Claus Gittinger <cg@exept.de>
parents:
1689
diff
changeset
|
7822 |
|
1702
962056a31c06
remember the current file during fileIn,
Claus Gittinger <cg@exept.de>
parents:
1700
diff
changeset
|
7823 |
"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
|
7824 |
! |
5067b3c4cafa
added access to fileName (kludge to fileIn RefactoryBrowser)
Claus Gittinger <cg@exept.de>
parents:
1689
diff
changeset
|
7825 |
|
172 | 7826 |
path |
7827 |
"return my currentDirectories pathName; |
|
1329 | 7828 |
sent from the pathField to aquire the pathname when I changed directory" |
7829 |
||
7830 |
"/ somewhat tricky: first ask it for the full pathName, |
|
7831 |
"/ then convert it to a directory name |
|
7832 |
"/ (which only makes a difference on VMS) |
|
7833 |
||
1828 | 7834 |
^ currentDirectory asFilename pathName "/ asFilename osNameForDirectory |
7835 |
||
7836 |
"Modified: / 12.8.1998 / 14:45:48 / cg" |
|
49 | 7837 |
! ! |
7838 |
||
763
94a8d188b52d
care for the nameSpace Query when loading binary classes
Claus Gittinger <cg@exept.de>
parents:
749
diff
changeset
|
7839 |
!FileBrowser class methodsFor:'documentation'! |
203 | 7840 |
|
7841 |
version |
|
3705 | 7842 |
^ '$Header: /cvs/stx/stx/libtool/FileBrowser.st,v 1.472 2002-07-10 13:48:40 penk Exp $' |
381 | 7843 |
! ! |