author | penk |
Wed, 31 Jul 2002 15:21:48 +0200 | |
changeset 3762 | c6dd99988ca8 |
parent 3759 | 366d5ebc3f89 |
child 3765 | 8309f42ebf29 |
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' ) |
|
3762 | 193 |
(#deviceFile 'ICON_DEVICE_FILE' 'tiny_file_device.xpm' ) |
194 |
(#binaryFile 'ICON_BINARY_FILE' 'tiny_file_binary.xpm' ) |
|
3705 | 195 |
(#compressedFile 'ICON_COMPRESSED_FILE' 'tiny_file_compressed.xpm' ) |
196 |
(#compressedArchive 'ICON_COMPRESSED_ARCHIVE' 'tiny_file_tar_compressed.xpm' ) |
|
197 |
(#archive 'ICON_ARCHIVE' 'tiny_file_tar.xpm' ) |
|
3720 | 198 |
(#directoryGray 'ICON_DIRECTORY_GRAY' 'tiny_yellow_dir_gray.xpm' ) |
2187
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
199 |
"/ mime-type to icon mappings. |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
200 |
('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
|
201 |
('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
|
202 |
('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
|
203 |
('application/x-smalltalk-source' nil 'tiny_file_st.xpm' ) |
2320 | 204 |
('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
|
205 |
('image' nil 'tiny_file_pix.xpm' ) |
2794 | 206 |
('audio' nil 'tiny_file_sound.xpm' ) |
1239
e58e2cb6639a
allow specification of icons from resource file.
Claus Gittinger <cg@exept.de>
parents:
1235
diff
changeset
|
207 |
) do:[:entry | |
2491
0222b19ee371
new icon search (search under goodies package)
Claus Gittinger <cg@exept.de>
parents:
2476
diff
changeset
|
208 |
|key resource defaultName nm img| |
2187
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
209 |
|
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
210 |
key := entry at:1. |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
211 |
resource := entry at:2. |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
212 |
defaultName := entry at:3. |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
213 |
|
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
214 |
resource notNil ifTrue:[ |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
215 |
nm := resources at:resource default:nil. |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
216 |
]. |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
217 |
nm isNil ifTrue:[ |
2491
0222b19ee371
new icon search (search under goodies package)
Claus Gittinger <cg@exept.de>
parents:
2476
diff
changeset
|
218 |
nm := 'xpmBitmaps/document_images/' , defaultName |
2187
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
219 |
]. |
2492
055eef2763e3
moved icon search to smalltalk utility method
Claus Gittinger <cg@exept.de>
parents:
2491
diff
changeset
|
220 |
Icons at:key put:(Smalltalk imageFromFileNamed:nm forClass:self). |
1147 | 221 |
] |
222 |
||
223 |
" |
|
1178
f5f4d0c605db
lazy initialization of Icons
Claus Gittinger <cg@exept.de>
parents:
1173
diff
changeset
|
224 |
self initializeIcons |
1147 | 225 |
" |
226 |
||
1784
329e3a904236
ask MIMETypes when mapping suffixes to icons.
Claus Gittinger <cg@exept.de>
parents:
1758
diff
changeset
|
227 |
"Modified: / 1.8.1998 / 17:39:27 / cg" |
1145
0464625bbdbb
read directory in a subprocess.
Claus Gittinger <cg@exept.de>
parents:
1144
diff
changeset
|
228 |
! ! |
0464625bbdbb
read directory in a subprocess.
Claus Gittinger <cg@exept.de>
parents:
1144
diff
changeset
|
229 |
|
763
94a8d188b52d
care for the nameSpace Query when loading binary classes
Claus Gittinger <cg@exept.de>
parents:
749
diff
changeset
|
230 |
!FileBrowser class methodsFor:'defaults'! |
73 | 231 |
|
232 |
defaultIcon |
|
1147 | 233 |
"return the file browsers default window icon" |
234 |
||
1287 | 235 |
<resource: #style (#FILEBROWSER_ICON #FILEBROWSER_ICON_FILE)> |
236 |
||
237 |
|nm i res| |
|
1147 | 238 |
|
239 |
(i := DefaultIcon) isNil ifTrue:[ |
|
2339 | 240 |
res := self classResources. |
241 |
i := res at:'FILEBROWSER_ICON' default:nil. |
|
242 |
i isNil ifTrue:[ |
|
243 |
nm := res at:'FILEBROWSER_ICON_FILE' default:'FBrowser.xbm'. |
|
2476 | 244 |
i := Smalltalk imageFromFileNamed:nm forClass:self. |
2339 | 245 |
i isNil ifTrue:[ |
2453
63c50508c4cd
try my bitmaps in package directory
Claus Gittinger <cg@exept.de>
parents:
2447
diff
changeset
|
246 |
i := StandardSystemView defaultIcon |
2339 | 247 |
] |
248 |
]. |
|
249 |
i notNil ifTrue:[ |
|
250 |
DefaultIcon := i := i onDevice:Display |
|
251 |
] |
|
1145
0464625bbdbb
read directory in a subprocess.
Claus Gittinger <cg@exept.de>
parents:
1144
diff
changeset
|
252 |
]. |
0464625bbdbb
read directory in a subprocess.
Claus Gittinger <cg@exept.de>
parents:
1144
diff
changeset
|
253 |
^ i |
0464625bbdbb
read directory in a subprocess.
Claus Gittinger <cg@exept.de>
parents:
1144
diff
changeset
|
254 |
|
1147 | 255 |
"Modified: 19.3.1997 / 20:48:34 / ca" |
1287 | 256 |
"Modified: 15.8.1997 / 15:27:19 / cg" |
73 | 257 |
! ! |
258 |
||
2951
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
259 |
!FileBrowser class methodsFor:'history'! |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
260 |
|
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
261 |
addToCommandHistory:aCommandString for:aFilename |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
262 |
|cmd suffix| |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
263 |
|
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
264 |
(aCommandString notNil and:[aCommandString notEmpty]) ifTrue:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
265 |
CommandHistory notNil ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
266 |
CommandHistory addFirst:aCommandString. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
267 |
CommandHistory size > CommandHistorySize ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
268 |
CommandHistory removeLast |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
269 |
] |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
270 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
271 |
aFilename notNil ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
272 |
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
|
273 |
DefaultCommandPerSuffix isNil ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
274 |
DefaultCommandPerSuffix := Dictionary new. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
275 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
276 |
suffix := aFilename asFilename suffix. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
277 |
suffix notNil ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
278 |
DefaultCommandPerSuffix at:suffix put:cmd. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
279 |
] |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
280 |
] |
2951
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
281 |
] |
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 |
"Created: 14.11.1996 / 14:58:13 / cg" |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
284 |
! |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
285 |
|
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
286 |
addToHistory:path |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
287 |
|pos idx| |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
288 |
|
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
289 |
idx := DirectoryHistory indexOf:path. |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
290 |
idx == 0 ifTrue:[ |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
291 |
DirectoryHistory size >= HistorySize ifTrue:[ |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
292 |
DirectoryHistory removeLast. |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
293 |
DirectoryHistoryWhere removeLast |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
294 |
] |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
295 |
] ifFalse:[ |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
296 |
"already been there before; move the entry to |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
297 |
the beginning, so it will fall out later." |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
298 |
|
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
299 |
DirectoryHistory removeIndex:idx. |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
300 |
pos := DirectoryHistoryWhere at:idx. |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
301 |
DirectoryHistoryWhere removeIndex:idx. |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
302 |
]. |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
303 |
DirectoryHistory addFirst:path. |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
304 |
DirectoryHistoryWhere addFirst:pos. |
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 |
"Created: / 8.11.1997 / 17:16:29 / cg" |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
307 |
! |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
308 |
|
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
309 |
addToVisitedFileHistory:path |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
310 |
|idx| |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
311 |
|
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
312 |
idx := VisitedFileHistory indexOf:path. |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
313 |
idx == 0 ifTrue:[ |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
314 |
VisitedFileHistory size >= HistorySize ifTrue:[ |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
315 |
VisitedFileHistory removeLast. |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
316 |
] |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
317 |
] ifFalse:[ |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
318 |
"already been there before; move the entry to |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
319 |
the beginning, so it will fall out later." |
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 removeIndex:idx. |
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 |
VisitedFileHistory addFirst:path. |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
324 |
! ! |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
325 |
|
1933 | 326 |
!FileBrowser class methodsFor:'interface specs'! |
327 |
||
328 |
fileSearchDialogSpec |
|
329 |
"This resource specification was automatically generated |
|
330 |
by the UIPainter of ST/X." |
|
331 |
||
332 |
"Do not manually edit this!! If it is corrupted, |
|
333 |
the UIPainter may not be able to read the specification." |
|
334 |
||
335 |
" |
|
336 |
UIPainter new openOnClass:FileBrowser andSelector:#fileSearchDialogSpec |
|
337 |
" |
|
338 |
||
339 |
<resource: #canvas> |
|
340 |
||
341 |
^ |
|
342 |
||
343 |
#(#FullSpec |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
344 |
#window: |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
345 |
#(#WindowSpec |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
346 |
#name: 'File Search' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
347 |
#layout: #(#LayoutFrame 4 0 50 0 315 0 349 0) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
348 |
#level: 0 |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
349 |
#label: 'File Search' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
350 |
#min: #(#Point 10 10) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
351 |
#max: #(#Point 1280 1024) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
352 |
#bounds: #(#Rectangle 4 50 316 350) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
353 |
#usePreferredExtent: false |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
354 |
#returnIsOKInDialog: true |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
355 |
#escapeIsCancelInDialog: true |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
356 |
) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
357 |
#component: |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
358 |
#(#SpecCollection |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
359 |
#collection: |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
360 |
#( |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
361 |
#(#LabelSpec |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
362 |
#name: 'Label1' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
363 |
#layout: #(#LayoutFrame 0 0 10 0 0 1 32 0) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
364 |
#label: 'Search for files named:' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
365 |
#translateLabel: true |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
366 |
#adjust: #left |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
367 |
) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
368 |
#(#InputFieldSpec |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
369 |
#name: 'EntryField1' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
370 |
#layout: #(#LayoutFrame 10 0 36 0 305 0 58 0) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
371 |
#tabable: true |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
372 |
#model: #namePatternHolder |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
373 |
) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
374 |
#(#CheckBoxSpec |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
375 |
#name: 'CheckBox1' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
376 |
#layout: #(#LayoutFrame 7 0 66 0 143 0 88 0) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
377 |
#tabable: true |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
378 |
#model: #ignoreCaseInName |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
379 |
#label: 'Ignore case' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
380 |
#translateLabel: true |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
381 |
) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
382 |
#(#LabelSpec |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
383 |
#name: 'Label2' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
384 |
#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
|
385 |
#label: 'Containing the string:' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
386 |
#translateLabel: true |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
387 |
#adjust: #left |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
388 |
) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
389 |
#(#InputFieldSpec |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
390 |
#name: 'EntryField2' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
391 |
#layout: #(#LayoutFrame 10 0 133 0 305 0 155 0) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
392 |
#enableChannel: #notSearchForSameContents |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
393 |
#tabable: true |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
394 |
#model: #contentsPatternHolder |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
395 |
) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
396 |
#(#CheckBoxSpec |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
397 |
#name: 'CheckBox2' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
398 |
#layout: #(#LayoutFrame 6 0 163 0 142 0 185 0) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
399 |
#enableChannel: #notSearchForSameContents |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
400 |
#tabable: true |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
401 |
#model: #ignoreCaseInContents |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
402 |
#label: 'Ignore case' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
403 |
#translateLabel: true |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
404 |
) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
405 |
#(#LabelSpec |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
406 |
#name: 'Label3' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
407 |
#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
|
408 |
#label: 'Containing same contents as selected:' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
409 |
#translateLabel: true |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
410 |
#adjust: #left |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
411 |
) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
412 |
#(#DividerSpec |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
413 |
#name: 'Separator1' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
414 |
#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
|
415 |
) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
416 |
#(#CheckToggleSpec |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
417 |
#name: 'CheckToggle1' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
418 |
#layout: #(#LayoutOrigin -25 1 225 0) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
419 |
#tabable: true |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
420 |
#model: #searchForSameContents |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
421 |
#enableChannel: #searchForSameContentsEnabled |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
422 |
#isTriggerOnDown: true |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
423 |
#showLamp: false |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
424 |
#lampColor: #(#Color 100.0 100.0 0.0) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
425 |
) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
426 |
#(#HorizontalPanelViewSpec |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
427 |
#name: 'HorizontalPanel1' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
428 |
#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
|
429 |
#component: |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
430 |
#(#SpecCollection |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
431 |
#collection: |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
432 |
#( |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
433 |
#(#ActionButtonSpec |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
434 |
#name: 'Button1' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
435 |
#label: 'Cancel' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
436 |
#translateLabel: true |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
437 |
#tabable: true |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
438 |
#model: #cancel |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
439 |
#extent: #(#Point 151 25) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
440 |
) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
441 |
#(#ActionButtonSpec |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
442 |
#name: 'Button2' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
443 |
#label: 'Search' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
444 |
#translateLabel: true |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
445 |
#tabable: true |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
446 |
#model: #accept |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
447 |
#isDefault: true |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
448 |
#extent: #(#Point 152 25) |
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 |
) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
451 |
) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
452 |
#horizontalLayout: #fitSpace |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
453 |
#verticalLayout: #centerMax |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
454 |
#horizontalSpace: 3 |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
455 |
#verticalSpace: 3 |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
456 |
) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
457 |
) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
458 |
) |
1933 | 459 |
) |
460 |
! ! |
|
461 |
||
1834 | 462 |
!FileBrowser class methodsFor:'menu specs'! |
463 |
||
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
464 |
baseBookmarksMenuSpec |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
465 |
"This resource specification was automatically generated |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
466 |
by the MenuEditor of ST/X." |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
467 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
468 |
"Do not manually edit this!! If it is corrupted, |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
469 |
the MenuEditor may not be able to read the specification." |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
470 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
471 |
" |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
472 |
MenuEditor new openOnClass:FileBrowser andSelector:#baseBookmarksMenuSpec |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
473 |
(Menu new fromLiteralArrayEncoding:(FileBrowser baseBookmarksMenuSpec)) startUp |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
474 |
" |
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 |
<resource: #menu> |
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 |
^ |
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 |
#(#Menu |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
481 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
482 |
#( |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
483 |
#(#MenuItem |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
484 |
#label: 'Add Bookmark' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
485 |
#translateLabel: true |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
486 |
#value: #addBookmark |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
487 |
) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
488 |
#(#MenuItem |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
489 |
#label: 'Remove Bookmark' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
490 |
#translateLabel: true |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
491 |
#value: #removeBookmark |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
492 |
#enabled: #hasBookmarksToRemove |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
493 |
) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
494 |
) nil |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
495 |
nil |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
496 |
) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
497 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
498 |
"Created: / 4.8.1998 / 17:21:16 / cg" |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
499 |
"Modified: / 14.8.1998 / 19:19:06 / cg" |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
500 |
! |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
501 |
|
1834 | 502 |
baseDirectoryMenuSpec |
503 |
"This resource specification was automatically generated |
|
504 |
by the MenuEditor of ST/X." |
|
505 |
||
506 |
"Do not manually edit this!! If it is corrupted, |
|
507 |
the MenuEditor may not be able to read the specification." |
|
508 |
||
509 |
" |
|
510 |
MenuEditor new openOnClass:FileBrowser andSelector:#directoryMenuSpec |
|
511 |
(Menu new fromLiteralArrayEncoding:(FileBrowser directoryMenuSpec)) startUp |
|
512 |
" |
|
513 |
||
514 |
<resource: #menu> |
|
515 |
||
516 |
^ |
|
517 |
||
518 |
#(#Menu |
|
519 |
||
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
520 |
#( |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
521 |
#(#MenuItem |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
522 |
#label: 'Copy Path' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
523 |
#translateLabel: true |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
524 |
#value: #copyPath |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
525 |
) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
526 |
#(#MenuItem |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
527 |
#label: '-' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
528 |
) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
529 |
#(#MenuItem |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
530 |
#label: 'Up' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
531 |
#translateLabel: true |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
532 |
#value: #changeToParentDirectory |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
533 |
#enabled: #currentDirectoryIsNotTop |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
534 |
) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
535 |
#(#MenuItem |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
536 |
#label: 'Back' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
537 |
#translateLabel: true |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
538 |
#value: #changeToPreviousDirectory |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
539 |
) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
540 |
#(#MenuItem |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
541 |
#label: 'Home' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
542 |
#translateLabel: true |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
543 |
#value: #changeToHomeDirectory |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
544 |
) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
545 |
#(#MenuItem |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
546 |
#label: 'Default' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
547 |
#translateLabel: true |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
548 |
#value: #changeToDefaultDirectory |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
549 |
) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
550 |
#(#MenuItem |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
551 |
#label: 'Goto...' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
552 |
#translateLabel: true |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
553 |
#value: #changeCurrentDirectory |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
554 |
) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
555 |
#(#MenuItem |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
556 |
#label: '-' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
557 |
) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
558 |
#(#MenuItem |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
559 |
#label: 'Bookmarks' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
560 |
#translateLabel: true |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
561 |
#submenuChannel: #bookmarksMenuSpec |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
562 |
) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
563 |
) nil |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
564 |
nil |
1834 | 565 |
) |
566 |
||
567 |
"Created: / 4.8.1998 / 17:21:16 / cg" |
|
1835 | 568 |
"Modified: / 14.8.1998 / 19:19:06 / cg" |
1834 | 569 |
! |
570 |
||
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
571 |
bookmarksMenuSpec |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
572 |
"This resource specification was automatically generated |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
573 |
by the MenuEditor of ST/X." |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
574 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
575 |
"Do not manually edit this!! If it is corrupted, |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
576 |
the MenuEditor may not be able to read the specification." |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
577 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
578 |
" |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
579 |
MenuEditor new openOnClass:FileBrowser andSelector:#bookmarksMenuSpec |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
580 |
(Menu new fromLiteralArrayEncoding:(FileBrowser bookmarksMenuSpec)) startUp |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
581 |
" |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
582 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
583 |
<resource: #programMenu> |
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| |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
586 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
587 |
m := self baseBookmarksMenuSpec. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
588 |
m := m decodeAsLiteralArray. |
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 |
"/ add the history items ... |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
591 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
592 |
DirectoryBookmarks size > 0 ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
593 |
m addItem:(MenuItem labeled:'-'). |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
594 |
DirectoryBookmarks do:[:dirName | |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
595 |
m addItem:((MenuItem label:dirName value:#changeDirectoryTo:) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
596 |
argument:dirName; |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
597 |
yourself). |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
598 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
599 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
600 |
^ m |
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 |
"Modified: / 17.8.1998 / 10:13:05 / cg" |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
603 |
! |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
604 |
|
1834 | 605 |
directoryMenuSpec |
606 |
"This resource specification was automatically generated |
|
607 |
by the MenuEditor of ST/X." |
|
608 |
||
609 |
"Do not manually edit this!! If it is corrupted, |
|
610 |
the MenuEditor may not be able to read the specification." |
|
611 |
||
612 |
" |
|
613 |
MenuEditor new openOnClass:FileBrowser andSelector:#directoryMenuSpec |
|
614 |
(Menu new fromLiteralArrayEncoding:(FileBrowser directoryMenuSpec)) startUp |
|
615 |
" |
|
616 |
||
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
617 |
<resource: #menu> |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
618 |
|
3658 | 619 |
^ |
620 |
#(#Menu |
|
621 |
#( |
|
622 |
#(#MenuItem |
|
623 |
#label: 'Copy Path' |
|
624 |
#translateLabel: true |
|
625 |
#value: #copyPath |
|
626 |
) |
|
627 |
#(#MenuItem |
|
628 |
#label: '-' |
|
629 |
) |
|
630 |
#(#MenuItem |
|
631 |
#label: 'Up' |
|
632 |
#translateLabel: true |
|
633 |
#value: #changeToParentDirectory |
|
634 |
#enabled: #currentDirectoryIsNotTop |
|
635 |
) |
|
636 |
#(#MenuItem |
|
637 |
#label: 'Goto...' |
|
638 |
#translateLabel: true |
|
639 |
#value: #changeCurrentDirectory |
|
640 |
) |
|
641 |
#(#MenuItem |
|
642 |
#label: '-' |
|
643 |
) |
|
644 |
#(#MenuItem |
|
645 |
#label: 'Back' |
|
646 |
#translateLabel: true |
|
647 |
#value: #changeToPreviousDirectory |
|
648 |
) |
|
649 |
#(#MenuItem |
|
650 |
#label: '-' |
|
651 |
) |
|
652 |
#(#MenuItem |
|
653 |
#label: 'Default' |
|
654 |
#translateLabel: true |
|
655 |
#value: #changeToDefaultDirectory |
|
656 |
) |
|
657 |
#(#MenuItem |
|
658 |
#label: 'Home' |
|
659 |
#translateLabel: true |
|
660 |
#value: #changeToHomeDirectory |
|
661 |
) |
|
662 |
#(#MenuItem |
|
663 |
#label: 'Bookmarks' |
|
664 |
#translateLabel: true |
|
665 |
#submenuChannel: #bookmarksMenuSpec |
|
666 |
) |
|
667 |
#(#MenuItem |
|
668 |
#label: '-' |
|
669 |
) |
|
670 |
#(#MenuItem |
|
671 |
#label: 'Visited Directories' |
|
672 |
#translateLabel: true |
|
673 |
#submenuChannel: #historyMenuSpec |
|
674 |
) |
|
675 |
) |
|
676 |
nil |
|
677 |
nil |
|
3448
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 |
! |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
680 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
681 |
historyMenuSpec |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
682 |
"This resource specification was automatically generated |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
683 |
by the MenuEditor of ST/X." |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
684 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
685 |
"Do not manually edit this!! If it is corrupted, |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
686 |
the MenuEditor may not be able to read the specification." |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
687 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
688 |
" |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
689 |
MenuEditor new openOnClass:FileBrowser andSelector:#directoryMenuSpec |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
690 |
(Menu new fromLiteralArrayEncoding:(FileBrowser directoryMenuSpec)) startUp |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
691 |
" |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
692 |
|
1834 | 693 |
<resource: #programMenu> |
694 |
||
2035
307ed5143d8b
national language stuff - again
Claus Gittinger <cg@exept.de>
parents:
2031
diff
changeset
|
695 |
|m| |
307ed5143d8b
national language stuff - again
Claus Gittinger <cg@exept.de>
parents:
2031
diff
changeset
|
696 |
|
1834 | 697 |
"/ add the history items ... |
698 |
||
1835 | 699 |
DirectoryHistory size > 0 ifTrue:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
700 |
m := Menu new. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
701 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
702 |
DirectoryHistory do:[:dirName | |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
703 |
m addItem:((MenuItem label:dirName value:#changeDirectoryTo:) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
704 |
argument:dirName; |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
705 |
yourself). |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
706 |
]. |
3454 | 707 |
]. |
708 |
||
2035
307ed5143d8b
national language stuff - again
Claus Gittinger <cg@exept.de>
parents:
2031
diff
changeset
|
709 |
^ m |
1834 | 710 |
|
1837 | 711 |
"Modified: / 17.8.1998 / 10:13:05 / cg" |
1834 | 712 |
! |
713 |
||
714 |
menuPopUp |
|
715 |
"This resource specification was automatically generated |
|
716 |
by the MenuEditor of ST/X." |
|
717 |
||
718 |
"Do not manually edit this!! If it is corrupted, |
|
719 |
the MenuEditor may not be able to read the specification." |
|
720 |
||
721 |
" |
|
722 |
MenuEditor new openOnClass:FileBrowser andSelector:#menuPopUp |
|
723 |
(Menu new fromLiteralArrayEncoding:(FileBrowser menuPopUp)) startUp |
|
724 |
" |
|
725 |
||
726 |
<resource: #menu> |
|
727 |
||
2185 | 728 |
^ |
729 |
#(#Menu |
|
730 |
#( |
|
731 |
#(#MenuItem |
|
732 |
#label: 'Spawn' |
|
733 |
#translateLabel: true |
|
734 |
#value: #fileSpawn |
|
735 |
) |
|
736 |
#(#MenuItem |
|
737 |
#label: '-' |
|
738 |
) |
|
739 |
#(#MenuItem |
|
740 |
#label: 'Get Contents' |
|
741 |
#translateLabel: true |
|
742 |
#value: #fileGet |
|
743 |
#enabled: #hasSelection |
|
744 |
) |
|
745 |
#(#MenuItem |
|
746 |
#label: 'Insert Contents' |
|
747 |
#translateLabel: true |
|
748 |
#value: #fileInsert |
|
749 |
#enabled: #hasSelection |
|
750 |
) |
|
751 |
#(#MenuItem |
|
752 |
#label: 'FileIn' |
|
753 |
#translateLabel: true |
|
754 |
#value: #fileFileIn |
|
755 |
#enabled: #hasSelection |
|
2825
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
756 |
#shortcutKeyCharacter: #Accept |
2185 | 757 |
) |
758 |
#(#MenuItem |
|
759 |
#label: '-' |
|
760 |
) |
|
761 |
#(#MenuItem |
|
3172 | 762 |
#label: 'New' |
2185 | 763 |
#translateLabel: true |
3172 | 764 |
#submenu: |
765 |
#(#Menu |
|
766 |
#( |
|
767 |
#(#MenuItem |
|
768 |
#label: 'Directory...' |
|
769 |
#translateLabel: true |
|
770 |
#value: #newDirectory |
|
771 |
) |
|
772 |
#(#MenuItem |
|
773 |
#label: 'File...' |
|
774 |
#translateLabel: true |
|
775 |
#value: #newFile |
|
776 |
) |
|
777 |
#(#MenuItem |
|
778 |
#label: 'Hard Link...' |
|
779 |
#translateLabel: true |
|
780 |
#isVisible: #systemIsUnix |
|
781 |
#value: #newHardLink |
|
782 |
) |
|
783 |
#(#MenuItem |
|
784 |
#label: 'Symbolic Link...' |
|
785 |
#translateLabel: true |
|
786 |
#isVisible: #systemIsUnix |
|
787 |
#value: #newSoftLink |
|
788 |
) |
|
789 |
) |
|
790 |
nil |
|
791 |
nil |
|
792 |
) |
|
2185 | 793 |
) |
794 |
#(#MenuItem |
|
795 |
#label: 'Remove...' |
|
796 |
#translateLabel: true |
|
797 |
#value: #fileRemove |
|
798 |
#enabled: #hasSelection |
|
2543 | 799 |
#shortcutKeyCharacter: #Cut |
2185 | 800 |
) |
801 |
#(#MenuItem |
|
802 |
#label: 'Rename...' |
|
803 |
#translateLabel: true |
|
804 |
#value: #fileRename |
|
805 |
#enabled: #hasSelection |
|
2825
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
806 |
#shortcutKeyCharacter: #Replace |
2185 | 807 |
) |
808 |
#(#MenuItem |
|
809 |
#label: '-' |
|
810 |
) |
|
811 |
#(#MenuItem |
|
3172 | 812 |
#label: 'Properties...' |
2185 | 813 |
#translateLabel: true |
3172 | 814 |
#value: #fileGetLongInfo |
815 |
#enabled: #hasSelection |
|
2185 | 816 |
) |
817 |
#(#MenuItem |
|
3172 | 818 |
#label: '-' |
819 |
) |
|
820 |
#(#MenuItem |
|
821 |
#label: 'Tools' |
|
2185 | 822 |
#translateLabel: true |
3172 | 823 |
#submenuChannel: #toolsMenuSpec |
824 |
#shortcutKeyCharacter: #Ctrl |
|
2185 | 825 |
) |
826 |
#(#MenuItem |
|
827 |
#label: '-' |
|
828 |
) |
|
829 |
#(#MenuItem |
|
830 |
#label: 'Update' |
|
831 |
#translateLabel: true |
|
832 |
#value: #updateCurrentDirectory |
|
833 |
) |
|
834 |
) |
|
835 |
nil |
|
836 |
nil |
|
2844 | 837 |
) |
838 |
! |
|
1834 | 839 |
|
840 |
menuSpec |
|
841 |
"This resource specification was automatically generated |
|
842 |
by the MenuEditor of ST/X." |
|
843 |
||
844 |
"Do not manually edit this!! If it is corrupted, |
|
845 |
the MenuEditor may not be able to read the specification." |
|
846 |
||
847 |
" |
|
848 |
MenuEditor new openOnClass:FileBrowser andSelector:#menuSpec |
|
849 |
(Menu new fromLiteralArrayEncoding:(FileBrowser menuSpec)) startUp |
|
850 |
" |
|
851 |
||
852 |
<resource: #menu> |
|
853 |
||
2102 | 854 |
^ |
855 |
#(#Menu |
|
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
856 |
#( |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
857 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
858 |
#label: 'File' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
859 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
860 |
#submenu: |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
861 |
#(#Menu |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
862 |
#( |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
863 |
#(#MenuItem |
2951
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
864 |
#label: 'Spawn' |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
865 |
#translateLabel: true |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
866 |
#value: #fileSpawn |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
867 |
) |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
868 |
#(#MenuItem |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
869 |
#label: '-' |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
870 |
) |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
871 |
#(#MenuItem |
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
872 |
#label: 'Open' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
873 |
#translateLabel: true |
3213 | 874 |
#isVisible: false |
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
875 |
#value: #menuOpen |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
876 |
#enabled: #hasSelection |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
877 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
878 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
879 |
#label: 'Open selected Filename' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
880 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
881 |
#isVisible: #hasFilenameSelectionInCodeView |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
882 |
#value: #openSelectedFilename |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
883 |
#enabled: #hasFilenameSelectionInCodeView |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
884 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
885 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
886 |
#label: 'FileIn' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
887 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
888 |
#value: #fileFileIn |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
889 |
#enabled: #hasSelection |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
890 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
891 |
#(#MenuItem |
3465
f52e089ca838
added fileIntoNameSpace menu item
Claus Gittinger <cg@exept.de>
parents:
3461
diff
changeset
|
892 |
#label: 'FileInTo NameSpace...' |
f52e089ca838
added fileIntoNameSpace menu item
Claus Gittinger <cg@exept.de>
parents:
3461
diff
changeset
|
893 |
#translateLabel: true |
f52e089ca838
added fileIntoNameSpace menu item
Claus Gittinger <cg@exept.de>
parents:
3461
diff
changeset
|
894 |
#value: #fileFileInToNameSpace |
f52e089ca838
added fileIntoNameSpace menu item
Claus Gittinger <cg@exept.de>
parents:
3461
diff
changeset
|
895 |
#enabled: #hasSelection |
f52e089ca838
added fileIntoNameSpace menu item
Claus Gittinger <cg@exept.de>
parents:
3461
diff
changeset
|
896 |
) |
f52e089ca838
added fileIntoNameSpace menu item
Claus Gittinger <cg@exept.de>
parents:
3461
diff
changeset
|
897 |
#(#MenuItem |
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
898 |
#label: '-' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
899 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
900 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
901 |
#label: 'New' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
902 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
903 |
#submenu: |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
904 |
#(#Menu |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
905 |
#( |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
906 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
907 |
#label: 'Directory...' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
908 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
909 |
#value: #newDirectory |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
910 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
911 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
912 |
#label: 'File...' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
913 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
914 |
#value: #newFile |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
915 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
916 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
917 |
#label: 'Hard Link...' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
918 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
919 |
#isVisible: #systemIsUnix |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
920 |
#value: #newHardLink |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
921 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
922 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
923 |
#label: 'Symbolic Link...' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
924 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
925 |
#isVisible: #systemIsUnix |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
926 |
#value: #newSoftLink |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
927 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
928 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
929 |
nil |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
930 |
nil |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
931 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
932 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
933 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
934 |
#label: 'Remove' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
935 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
936 |
#value: #fileRemove |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
937 |
#enabled: #hasSelection |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
938 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
939 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
940 |
#label: 'Rename' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
941 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
942 |
#value: #fileRename |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
943 |
#enabled: #hasSelection |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
944 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
945 |
#(#MenuItem |
2143 | 946 |
#label: '-' |
947 |
) |
|
948 |
#(#MenuItem |
|
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
949 |
#label: 'Properties...' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
950 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
951 |
#value: #fileGetLongInfo |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
952 |
#enabled: #hasSelection |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
953 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
954 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
955 |
#label: '-' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
956 |
#isVisible: #javaSupportLoaded |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
957 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
958 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
959 |
#label: 'Add to Java ClassPath' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
960 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
961 |
#isVisible: #javaSupportLoaded |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
962 |
#value: #fileAddToJavaClassPath |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
963 |
#enabled: #canAddToClassPath |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
964 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
965 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
966 |
#label: 'Remove from Java ClassPath' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
967 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
968 |
#isVisible: #javaSupportLoaded |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
969 |
#value: #fileRemoveFromJavaClassPath |
2368 | 970 |
#enabled: #canRemoveFromClassPath |
971 |
) |
|
972 |
#(#MenuItem |
|
973 |
#label: 'Add to Java SourcePath' |
|
974 |
#translateLabel: true |
|
975 |
#isVisible: #javaSupportLoaded |
|
976 |
#value: #fileAddToJavaSourcePath |
|
977 |
#enabled: #canAddToSourcePath |
|
978 |
) |
|
979 |
#(#MenuItem |
|
980 |
#label: 'Remove from Java SourcePath' |
|
981 |
#translateLabel: true |
|
982 |
#isVisible: #javaSupportLoaded |
|
983 |
#value: #fileRemoveFromJavaSourcePath |
|
984 |
#enabled: #canRemoveFromSourcePath |
|
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
985 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
986 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
987 |
#label: '-' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
988 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
989 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
990 |
#label: 'Exit' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
991 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
992 |
#value: #menuExit |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
993 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
994 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
995 |
nil |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
996 |
nil |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
997 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
998 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
999 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1000 |
#label: 'Directory' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1001 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1002 |
#submenuChannel: #directoryMenuSpec |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1003 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1004 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1005 |
#label: 'Edit' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1006 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1007 |
#submenu: |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1008 |
#(#Menu |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1009 |
#( |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1010 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1011 |
#label: 'Get Contents' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1012 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1013 |
#value: #fileGet |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1014 |
#enabled: #hasSelection |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1015 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1016 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1017 |
#label: 'Insert Contents' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1018 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1019 |
#value: #fileInsert |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1020 |
#enabled: #hasSelection |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1021 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1022 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1023 |
#label: '-' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1024 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1025 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1026 |
#label: 'Copy File List' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1027 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1028 |
#value: #copyFileList |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1029 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1030 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1031 |
#label: 'Copy Selected Filename' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1032 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1033 |
#value: #copySelectedFileName |
3010 | 1034 |
#enabled: #hasSelection |
1035 |
) |
|
1036 |
#(#MenuItem |
|
1037 |
#label: 'Copy Selected Pathname' |
|
1038 |
#translateLabel: true |
|
1039 |
#value: #copySelectedPathName |
|
1040 |
#enabled: #hasSelection |
|
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1041 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1042 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1043 |
#label: 'Copy Command History' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1044 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1045 |
#value: #copyCommandHistory |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1046 |
) |
2951
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
1047 |
#(#MenuItem |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
1048 |
#label: '-' |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
1049 |
) |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
1050 |
#(#MenuItem |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
1051 |
#label: 'Visited Files' |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
1052 |
#translateLabel: true |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
1053 |
#submenuChannel: #visitedFileMenuSpec |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
1054 |
) |
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1055 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1056 |
nil |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1057 |
nil |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1058 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1059 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1060 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1061 |
#label: 'View' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1062 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1063 |
#submenu: |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1064 |
#(#Menu |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1065 |
#( |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1066 |
#(#MenuItem |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1067 |
#label: 'Show Details' |
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1068 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1069 |
#indication: #showingDetails |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1070 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1071 |
#(#MenuItem |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1072 |
#label: 'Show Time && Date' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1073 |
#translateLabel: true |
3658 | 1074 |
#enabled: #showingDetails |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1075 |
#indication: #showingTimeAndDate |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1076 |
) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1077 |
#(#MenuItem |
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1078 |
#label: 'Show Hidden Files' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1079 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1080 |
#indication: #showingHiddenFiles |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1081 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1082 |
#(#MenuItem |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1083 |
#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
|
1084 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1085 |
#indication: #showingBigImagePreview |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1086 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1087 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1088 |
#label: '-' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1089 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1090 |
#(#MenuItem |
2155 | 1091 |
#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
|
1092 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1093 |
#choice: #sortByWhat |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1094 |
#choiceValue: #name |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1095 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1096 |
#(#MenuItem |
2155 | 1097 |
#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
|
1098 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1099 |
#choice: #sortByWhat |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1100 |
#choiceValue: #type |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1101 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1102 |
#(#MenuItem |
2155 | 1103 |
#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
|
1104 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1105 |
#choice: #sortByWhat |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1106 |
#choiceValue: #time |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1107 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1108 |
#(#MenuItem |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1109 |
#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
|
1110 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1111 |
#indication: #sortCaseless |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1112 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1113 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1114 |
#label: '-' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1115 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1116 |
#(#MenuItem |
3172 | 1117 |
#label: 'Encoding...' |
1118 |
#translateLabel: true |
|
1119 |
#value: #fileEncoding |
|
1120 |
) |
|
1121 |
#(#MenuItem |
|
1122 |
#label: 'DOS EndOfLine Mode' |
|
1123 |
#translateLabel: true |
|
1124 |
#indication: #dosEOLMode |
|
1125 |
) |
|
1126 |
#(#MenuItem |
|
1127 |
#label: '-' |
|
1128 |
) |
|
1129 |
#(#MenuItem |
|
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1130 |
#label: 'Update' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1131 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1132 |
#value: #updateCurrentDirectory |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1133 |
) |
2220
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
1134 |
#(#MenuItem |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
1135 |
#label: 'AutoUpdate' |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
1136 |
#translateLabel: true |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
1137 |
#indication: #autoUpdate |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
1138 |
) |
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1139 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1140 |
nil |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1141 |
nil |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1142 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1143 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1144 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1145 |
#label: 'Tools' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1146 |
#translateLabel: true |
2825
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1147 |
#submenuChannel: #toolsMenuSpec |
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1148 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1149 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1150 |
#label: 'CVS' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1151 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1152 |
#submenu: |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1153 |
#(#Menu |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1154 |
#( |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1155 |
#(#MenuItem |
3691
f5d9ed09899b
menu texts: standard headline case
Claus Gittinger <cg@exept.de>
parents:
3665
diff
changeset
|
1156 |
#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
|
1157 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1158 |
#value: #cvsUpdateSelection |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1159 |
#enabled: #hasSelection |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1160 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1161 |
#(#MenuItem |
3691
f5d9ed09899b
menu texts: standard headline case
Claus Gittinger <cg@exept.de>
parents:
3665
diff
changeset
|
1162 |
#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
|
1163 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1164 |
#value: #cvsUpdateDirectoryLocal |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1165 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1166 |
#(#MenuItem |
3691
f5d9ed09899b
menu texts: standard headline case
Claus Gittinger <cg@exept.de>
parents:
3665
diff
changeset
|
1167 |
#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
|
1168 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1169 |
#value: #cvsUpdateDirectoryRecursive |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1170 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1171 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1172 |
#label: '-' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1173 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1174 |
#(#MenuItem |
2386 | 1175 |
#label: 'Commit...' |
1176 |
#translateLabel: true |
|
1177 |
#value: #cvsCommitSelection |
|
1178 |
) |
|
1179 |
#(#MenuItem |
|
3467 | 1180 |
#label: 'Add && Commit...' |
2424 | 1181 |
#translateLabel: true |
3467 | 1182 |
#value: #cvsAddAndCommitSelection |
2424 | 1183 |
) |
1184 |
#(#MenuItem |
|
2386 | 1185 |
#label: '-' |
1186 |
) |
|
1187 |
#(#MenuItem |
|
3691
f5d9ed09899b
menu texts: standard headline case
Claus Gittinger <cg@exept.de>
parents:
3665
diff
changeset
|
1188 |
#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
|
1189 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1190 |
#value: #cvsRemoveFileAndContainer |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1191 |
#enabled: #canRemoveCVSContainer |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1192 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1193 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1194 |
nil |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1195 |
nil |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1196 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1197 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1198 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1199 |
#label: 'Help' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1200 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1201 |
#startGroup: #right |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1202 |
#submenu: |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1203 |
#(#Menu |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1204 |
#( |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1205 |
#(#MenuItem |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1206 |
#label: 'FileBrowser Documentation' |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1207 |
#translateLabel: true |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1208 |
#value: #openHTMLDocument: |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1209 |
#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
|
1210 |
) |
3213 | 1211 |
#(#MenuItem |
1212 |
#label: '-' |
|
1213 |
) |
|
1214 |
#(#MenuItem |
|
1215 |
#label: 'About FileBrowser...' |
|
1216 |
#translateLabel: true |
|
1217 |
#value: #openAboutThisApplication |
|
1218 |
) |
|
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1219 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1220 |
nil |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1221 |
nil |
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 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1224 |
) |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1225 |
nil |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1226 |
nil |
1834 | 1227 |
) |
2825
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1228 |
! |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1229 |
|
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1230 |
toolsMenuSpec |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1231 |
"This resource specification was automatically generated |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1232 |
by the MenuEditor of ST/X." |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1233 |
|
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1234 |
"Do not manually edit this!! If it is corrupted, |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1235 |
the MenuEditor may not be able to read the specification." |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1236 |
|
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1237 |
" |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1238 |
MenuEditor new openOnClass:FileBrowser andSelector:#toolsMenuSpec |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1239 |
(Menu new fromLiteralArrayEncoding:(FileBrowser toolsMenuSpec)) startUp |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1240 |
" |
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 |
<resource: #menu> |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1243 |
|
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 |
#(#Menu |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1246 |
#( |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1247 |
#(#MenuItem |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1248 |
#label: 'Unix Command...' |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1249 |
#translateLabel: true |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1250 |
#isVisible: #systemIsUnix |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1251 |
#value: #menuOSCommand |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1252 |
) |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1253 |
#(#MenuItem |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1254 |
#label: 'DOS Command...' |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1255 |
#translateLabel: true |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1256 |
#isVisible: #systemIsDOS |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1257 |
#value: #menuOSCommand |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1258 |
) |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1259 |
#(#MenuItem |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1260 |
#label: 'VMS Command...' |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1261 |
#translateLabel: true |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1262 |
#isVisible: #systemIsVMS |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1263 |
#value: #menuOSCommand |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1264 |
) |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1265 |
#(#MenuItem |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1266 |
#label: 'Shell Terminal' |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1267 |
#translateLabel: true |
3398 | 1268 |
#isVisible: #canDoTerminalAndSystemIsUnix |
1269 |
#value: #openTerminal |
|
1270 |
#enabled: #canDoTerminal |
|
1271 |
) |
|
1272 |
#(#MenuItem |
|
1273 |
#label: 'DOS Terminal' |
|
1274 |
#translateLabel: true |
|
1275 |
#isVisible: #canDoTerminalAndSystemIsDOS |
|
2825
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1276 |
#value: #openTerminal |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1277 |
#enabled: #canDoTerminal |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1278 |
) |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1279 |
#(#MenuItem |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1280 |
#label: '-' |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1281 |
) |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1282 |
#(#MenuItem |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1283 |
#label: 'Changes Browser' |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1284 |
#translateLabel: true |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1285 |
#value: #openChangesBrowser |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1286 |
#enabled: #hasSelection |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1287 |
) |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1288 |
#(#MenuItem |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1289 |
#label: 'Snapshot Image Browser' |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1290 |
#translateLabel: true |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1291 |
#value: #openSnapshotImageBrowser |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1292 |
#enabled: #hasSnapshotSelection |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1293 |
) |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1294 |
#(#MenuItem |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1295 |
#label: 'Create Smalltalk Project' |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1296 |
#translateLabel: true |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1297 |
#value: #createProjectAndOpenProjectBrowser |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1298 |
#enabled: #canCreateNewProject |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1299 |
) |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1300 |
#(#MenuItem |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1301 |
#label: 'Install autoloaded' |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1302 |
#translateLabel: true |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1303 |
#value: #readAbbrevFile |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1304 |
#enabled: #canReadAbbrevFile |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1305 |
) |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1306 |
#(#MenuItem |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1307 |
#label: 'Editor' |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1308 |
#translateLabel: true |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1309 |
#value: #openEditor |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1310 |
#enabled: #hasSelection |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1311 |
) |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1312 |
#(#MenuItem |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1313 |
#label: 'HTML Reader' |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1314 |
#translateLabel: true |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1315 |
#value: #openHTMLReader |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1316 |
#enabled: #hasSelection |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1317 |
) |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1318 |
#(#MenuItem |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1319 |
#label: 'ASN1 Browser' |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1320 |
#translateLabel: true |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1321 |
#isVisible: #hasASN1 |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1322 |
#value: #openASN1Browser |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1323 |
#enabled: #hasASN1AndSelection |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1324 |
) |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1325 |
#(#MenuItem |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1326 |
#label: 'C Browser' |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1327 |
#translateLabel: true |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1328 |
#isVisible: #hasCBrowser |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1329 |
#value: #openCBrowser |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1330 |
#enabled: #hasCBrowser |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1331 |
) |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1332 |
#(#MenuItem |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1333 |
#label: 'Applet Viewer' |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1334 |
#translateLabel: true |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1335 |
#isVisible: #hasJava |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1336 |
#value: #openAppletViewer |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1337 |
#enabled: #hasJavaAndSelection |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1338 |
) |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1339 |
#(#MenuItem |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1340 |
#label: 'Image Inspector' |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1341 |
#translateLabel: true |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1342 |
#value: #openImageInspector |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1343 |
#enabled: #hasSelection |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1344 |
) |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1345 |
#(#MenuItem |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1346 |
#label: 'Image Preview' |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1347 |
#translateLabel: true |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1348 |
#value: #openImagePreview |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1349 |
#enabled: #hasSelection |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1350 |
) |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1351 |
#(#MenuItem |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1352 |
#label: 'Image Editor' |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1353 |
#translateLabel: true |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1354 |
#value: #openImageEditor |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1355 |
#enabled: #hasSelection |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1356 |
) |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1357 |
#(#MenuItem |
3001 | 1358 |
#label: 'MP3 Player' |
1359 |
#translateLabel: true |
|
1360 |
#isVisible: #hasMP3Player |
|
1361 |
#value: #openMP3Player |
|
1362 |
#enabled: #hasMP3PlayerAndSelection |
|
1363 |
) |
|
1364 |
#(#MenuItem |
|
2825
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1365 |
#label: 'ZipFile Tool' |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1366 |
#translateLabel: true |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1367 |
#value: #openZipTool |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1368 |
#enabled: #hasZipFileSelected |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1369 |
) |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1370 |
#(#MenuItem |
3536 | 1371 |
#label: 'SlideShow' |
1372 |
#translateLabel: true |
|
1373 |
#value: #openSlideShow |
|
1374 |
#isVisible: #hasSlideShow |
|
1375 |
) |
|
1376 |
#(#MenuItem |
|
2825
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1377 |
#label: 'File Differences...' |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1378 |
#translateLabel: true |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1379 |
#value: #openDiffView |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1380 |
) |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1381 |
#(#MenuItem |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1382 |
#label: 'Find Duplicate Files' |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1383 |
#translateLabel: true |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1384 |
#value: #fileFindDuplicates |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1385 |
) |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1386 |
#(#MenuItem |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1387 |
#label: 'Find All Duplicate Files (recursive)' |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1388 |
#translateLabel: true |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1389 |
#value: #fileFindAllDuplicates |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1390 |
) |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1391 |
#(#MenuItem |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1392 |
#label: 'Find a File...' |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1393 |
#translateLabel: true |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1394 |
#value: #fileFindFile |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1395 |
) |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1396 |
#(#MenuItem |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1397 |
#label: 'Hex Dump' |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1398 |
#translateLabel: true |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1399 |
#value: #fileHexDump |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1400 |
#enabled: #hasSelection |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1401 |
) |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1402 |
) |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1403 |
nil |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1404 |
nil |
2844 | 1405 |
) |
3398 | 1406 |
|
3536 | 1407 |
"Modified: / 29.12.2001 / 21:59:27 / cg" |
2951
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
1408 |
! |
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 |
visitedFileMenuSpec |
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 |
<resource: #programMenu> |
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 |
|m| |
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 |
VisitedFileHistory size == 0 ifTrue:[^ nil]. |
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 |
m := Menu new. |
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 |
"/ add the history items ... |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
1421 |
|
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
1422 |
VisitedFileHistory do:[:pathName | |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
1423 |
m addItem:((MenuItem label:pathName asFilename baseName value:#revisitFile:) |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
1424 |
argument:pathName; |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
1425 |
yourself). |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
1426 |
]. |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
1427 |
^ m |
2844 | 1428 |
! ! |
1834 | 1429 |
|
2094 | 1430 |
!FileBrowser class methodsFor:'queries'! |
1431 |
||
1432 |
isVisualStartable |
|
2844 | 1433 |
"return true, if this application can be started via #open. |
1434 |
(to allow start of a change browser via double-click in the browser)" |
|
2094 | 1435 |
|
1436 |
^ true |
|
1437 |
! ! |
|
1438 |
||
1834 | 1439 |
!FileBrowser methodsFor:'aspects'! |
1440 |
||
2220
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
1441 |
autoUpdate |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
1442 |
^ doAutoUpdate |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
1443 |
|
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
1444 |
"Created: / 6.5.1999 / 11:37:25 / cg" |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
1445 |
"Modified: / 6.5.1999 / 11:39:38 / cg" |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
1446 |
! |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
1447 |
|
1893
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
1448 |
canAddToClassPath |
2368 | 1449 |
^ [ |f| |
1450 |
||
1451 |
(Java isNil or:[Java isLoaded not]) ifTrue:[ |
|
1452 |
false |
|
1453 |
] ifFalse:[ |
|
1454 |
f := self singleSelectedFileOrCurrentDirectory. |
|
1455 |
f notNil |
|
1456 |
and:[(Java classPath includes:f pathName) not |
|
1457 |
and:[f isDirectory |
|
1458 |
or:[(f hasSuffix:'jar') |
|
1459 |
or:[(f hasSuffix:'zip')]]]]. |
|
1460 |
] |
|
1461 |
] |
|
1462 |
||
1463 |
"Modified: / 1.2.1999 / 20:38:42 / cg" |
|
1464 |
! |
|
1465 |
||
1466 |
canAddToSourcePath |
|
1467 |
^ [ |f| |
|
1468 |
||
1469 |
(Java isNil or:[Java isLoaded not]) ifTrue:[ |
|
1470 |
false |
|
1471 |
] ifFalse:[ |
|
1472 |
f := self singleSelectedFileOrCurrentDirectory. |
|
1473 |
f notNil |
|
2438 | 1474 |
and:[(Java sourcePath isNil |
1475 |
or:[(Java sourcePath includes:f pathName) not]) |
|
2368 | 1476 |
and:[f isDirectory |
1477 |
or:[(f hasSuffix:'jar') |
|
1478 |
or:[(f hasSuffix:'zip')]]]]. |
|
1479 |
] |
|
1893
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
1480 |
] |
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
1481 |
|
1989 | 1482 |
"Modified: / 1.2.1999 / 20:38:42 / cg" |
1893
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
1483 |
! |
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
1484 |
|
2562
da7680fe8407
first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents:
2550
diff
changeset
|
1485 |
canCreateNewProject |
da7680fe8407
first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents:
2550
diff
changeset
|
1486 |
^ [ |
da7680fe8407
first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents:
2550
diff
changeset
|
1487 |
currentDirectory notNil |
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:'.prj']) size == 0) |
da7680fe8407
first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents:
2550
diff
changeset
|
1490 |
and:[((currentDirectory directoryContents |
da7680fe8407
first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents:
2550
diff
changeset
|
1491 |
select:[:f| f endsWith:'.st']) size > 0) |
da7680fe8407
first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents:
2550
diff
changeset
|
1492 |
]]] |
da7680fe8407
first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents:
2550
diff
changeset
|
1493 |
! |
da7680fe8407
first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents:
2550
diff
changeset
|
1494 |
|
2129 | 1495 |
canDoTerminal |
1496 |
^ OperatingSystem isUNIXlike |
|
1497 |
or:[OperatingSystem isMSWINDOWSlike] |
|
1498 |
||
1499 |
"Created: / 4.8.1998 / 13:37:13 / cg" |
|
1500 |
"Modified: / 28.4.1999 / 11:54:17 / cg" |
|
1501 |
! |
|
1502 |
||
3398 | 1503 |
canDoTerminalAndSystemIsDOS |
1504 |
^ self canDoTerminal and:[OperatingSystem isMSWINDOWSlike] |
|
1505 |
||
1506 |
"Created: / 10.11.2001 / 13:10:32 / cg" |
|
1507 |
! |
|
1508 |
||
1509 |
canDoTerminalAndSystemIsUnix |
|
1510 |
^ self canDoTerminal and:[OperatingSystem isUNIXlike] |
|
1511 |
||
1512 |
"Created: / 10.11.2001 / 13:10:46 / cg" |
|
1513 |
! |
|
1514 |
||
2567
dd029fea485d
added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents:
2562
diff
changeset
|
1515 |
canReadAbbrevFile |
3013 | 1516 |
^ [|sel f fn suff ok| |
2567
dd029fea485d
added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents:
2562
diff
changeset
|
1517 |
|
dd029fea485d
added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents:
2562
diff
changeset
|
1518 |
sel := fileListView selection. |
dd029fea485d
added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents:
2562
diff
changeset
|
1519 |
sel size == 1 ifTrue:[ |
dd029fea485d
added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents:
2562
diff
changeset
|
1520 |
f := fileList at:sel first ifAbsent:nil. |
3013 | 1521 |
ok := (f = 'abbrev.stc'). |
1522 |
]. |
|
1523 |
ok ifFalse:[ |
|
1524 |
ok := currentDirectory notNil |
|
3747
d30bc1e54f15
Remove unused vars and asFilename sends
Stefan Vogel <sv@exept.de>
parents:
3746
diff
changeset
|
1525 |
and:[(currentDirectory construct:'abbrev.stc') exists]. |
3013 | 1526 |
]. |
1527 |
ok |
|
2567
dd029fea485d
added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents:
2562
diff
changeset
|
1528 |
] |
dd029fea485d
added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents:
2562
diff
changeset
|
1529 |
|
dd029fea485d
added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents:
2562
diff
changeset
|
1530 |
"Modified: / 30.1.1999 / 19:05:59 / cg" |
dd029fea485d
added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents:
2562
diff
changeset
|
1531 |
"Created: / 29.1.2000 / 13:00:57 / cg" |
dd029fea485d
added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents:
2562
diff
changeset
|
1532 |
! |
dd029fea485d
added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents:
2562
diff
changeset
|
1533 |
|
2101 | 1534 |
canRemoveCVSContainer |
1535 |
^ [ |cvsDir| |
|
1536 |
||
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1537 |
currentDirectory notNil |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1538 |
and:[fileListView selection size > 0 |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1539 |
and:[(cvsDir := currentDirectory construct:'CVS') exists |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1540 |
and:[cvsDir isDirectory]]]] |
2101 | 1541 |
! |
1542 |
||
2368 | 1543 |
canRemoveFromClassPath |
1544 |
^ [ |f| |
|
1545 |
||
1546 |
(Java isNil or:[Java isLoaded not]) ifTrue:[ |
|
1547 |
false |
|
1548 |
] ifFalse:[ |
|
1549 |
f := self singleSelectedFileOrCurrentDirectory. |
|
1550 |
f notNil |
|
1551 |
and:[(Java classPath includes:f pathName) |
|
1552 |
and:[f isDirectory |
|
1553 |
or:[(f hasSuffix:'jar') |
|
1554 |
or:[(f hasSuffix:'zip')]]]] |
|
1555 |
] |
|
1556 |
] |
|
1557 |
||
1558 |
"Modified: / 1.2.1999 / 20:39:25 / cg" |
|
1559 |
! |
|
1560 |
||
1561 |
canRemoveFromSourcePath |
|
1562 |
^ [ |f| |
|
1563 |
||
1564 |
(Java isNil or:[Java isLoaded not]) ifTrue:[ |
|
1565 |
false |
|
1566 |
] ifFalse:[ |
|
1567 |
f := self singleSelectedFileOrCurrentDirectory. |
|
1568 |
f notNil |
|
2438 | 1569 |
and:[(Java sourcePath isNil |
1570 |
or:[(Java sourcePath includes:f pathName)]) |
|
2368 | 1571 |
and:[f isDirectory |
1572 |
or:[(f hasSuffix:'jar') |
|
1573 |
or:[(f hasSuffix:'zip')]]]] |
|
1574 |
] |
|
1893
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
1575 |
] |
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
1576 |
|
1989 | 1577 |
"Modified: / 1.2.1999 / 20:39:25 / cg" |
1893
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
1578 |
! |
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
1579 |
|
1834 | 1580 |
currentDirectoryIsNotTop |
1581 |
^ [currentDirectory notNil and:[currentDirectory isRootDirectory not]] |
|
1582 |
||
1583 |
"Modified: / 4.8.1998 / 14:10:57 / cg" |
|
1584 |
"Created: / 14.8.1998 / 12:07:10 / cg" |
|
1585 |
! |
|
1586 |
||
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1587 |
dosEOLMode |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1588 |
^ dosEOLMode |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1589 |
|
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1590 |
"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
|
1591 |
"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
|
1592 |
! |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1593 |
|
2185 | 1594 |
hasASN1 |
1595 |
^ [ OSI::ASN1Parser notNil |
|
1596 |
and:[OSI::ASN1Parser isLoaded]] |
|
1597 |
||
1598 |
! |
|
1599 |
||
1600 |
hasASN1AndSelection |
|
1601 |
^ [ fileListView selection size > 0 |
|
1602 |
and:[OSI::ASN1Parser notNil |
|
1603 |
and:[OSI::ASN1Parser isLoaded]]] |
|
1604 |
! |
|
1605 |
||
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1606 |
hasBookmarks |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1607 |
^ DirectoryBookmarks size > 0 |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1608 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1609 |
"Created: / 14.8.1998 / 19:17:02 / cg" |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1610 |
"Modified: / 14.8.1998 / 19:17:17 / cg" |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1611 |
! |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1612 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1613 |
hasBookmarksToRemove |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1614 |
^ DirectoryBookmarks size > 0 |
3747
d30bc1e54f15
Remove unused vars and asFilename sends
Stefan Vogel <sv@exept.de>
parents:
3746
diff
changeset
|
1615 |
and:[ DirectoryBookmarks includes:(currentDirectory pathName) ] |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1616 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1617 |
"Created: / 14.8.1998 / 19:17:02 / cg" |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1618 |
"Modified: / 14.8.1998 / 19:17:17 / cg" |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1619 |
! |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1620 |
|
2814 | 1621 |
hasCBrowser |
1622 |
^ [ CC::Browser notNil ] |
|
1623 |
||
1624 |
! |
|
1625 |
||
1994 | 1626 |
hasFilenameSelectionInCodeView |
1627 |
^ [ |val sel| |
|
1628 |
||
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1629 |
val := false. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1630 |
sel := subView selection. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1631 |
sel notNil ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1632 |
sel := sel asString withoutSeparators. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1633 |
sel asFilename exists ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1634 |
val := sel asFilename isReadable |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1635 |
] |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1636 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1637 |
val |
1994 | 1638 |
] |
1639 |
||
1640 |
"Created: / 4.2.1999 / 17:34:57 / cg" |
|
1641 |
"Modified: / 4.2.1999 / 17:39:32 / cg" |
|
1642 |
! |
|
1643 |
||
1942 | 1644 |
hasJava |
1645 |
^ [ JavaClassReader notNil |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1646 |
and:[JavaClassReader isLoaded]] |
1942 | 1647 |
|
1648 |
"Modified: / 17.10.1998 / 16:57:14 / cg" |
|
1649 |
"Created: / 17.10.1998 / 22:58:25 / cg" |
|
1650 |
! |
|
1651 |
||
1652 |
hasJavaAndSelection |
|
1653 |
^ [ fileListView selection size > 0 |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1654 |
and:[JavaClassReader notNil |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1655 |
and:[JavaClassReader isLoaded]]] |
1942 | 1656 |
|
1657 |
"Modified: / 17.10.1998 / 16:57:14 / cg" |
|
1658 |
"Created: / 17.10.1998 / 22:58:03 / cg" |
|
1659 |
! |
|
1660 |
||
3001 | 1661 |
hasMP3Player |
1662 |
^ [ MP3PlayerApplication notNil |
|
1663 |
or:[SaugFix::MP3PlayerApplication notNil ]] |
|
1664 |
! |
|
1665 |
||
1666 |
hasMP3PlayerAndSelection |
|
1667 |
^ [ fileListView selection size > 0 |
|
1668 |
and:[ self hasMP3Player value]] |
|
1669 |
! |
|
1670 |
||
1834 | 1671 |
hasSelection |
1672 |
^ [fileListView selection size > 0] |
|
1673 |
||
1674 |
"Created: / 4.8.1998 / 14:10:31 / cg" |
|
1675 |
"Modified: / 4.8.1998 / 14:10:57 / cg" |
|
1676 |
! |
|
1677 |
||
2825
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1678 |
hasSnapshotSelection |
3627 | 1679 |
^ [ |fn| |
1680 |
||
2825
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1681 |
(fileListView selection size == 1) |
3627 | 1682 |
and:[ ((fn := fileListView selectionValue first string withoutSeparators asFilename) hasSuffix:'img') |
1683 |
or:[fn hasSuffix:'sav'] ] |
|
2825
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1684 |
] |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1685 |
|
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1686 |
"Created: / 4.8.1998 / 14:10:31 / cg" |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1687 |
"Modified: / 4.8.1998 / 14:10:57 / cg" |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1688 |
! |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
1689 |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1690 |
hasVisitHistory |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1691 |
^ [DirectoryHistory size > 0] |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1692 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1693 |
"Created: / 14.8.1998 / 19:17:02 / cg" |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1694 |
"Modified: / 14.8.1998 / 19:17:17 / cg" |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1695 |
! |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1696 |
|
1853 | 1697 |
hasZipFileSelected |
1988 | 1698 |
^ [|sel f fn suff| |
1699 |
||
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1700 |
sel := fileListView selection. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1701 |
sel size == 1 ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1702 |
f := fileList at:sel first ifAbsent:nil. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1703 |
f notNil ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1704 |
suff := f asFilename suffix asLowercase. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1705 |
suff = 'zip' or:[suff = 'jar'] |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1706 |
] ifFalse:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1707 |
false |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1708 |
] |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1709 |
] ifFalse:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1710 |
false |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1711 |
] |
1853 | 1712 |
] |
1713 |
||
1714 |
"Created: / 26.8.1998 / 16:15:26 / cg" |
|
1988 | 1715 |
"Modified: / 30.1.1999 / 19:05:59 / cg" |
1853 | 1716 |
! |
1717 |
||
1893
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
1718 |
javaSupportLoaded |
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
1719 |
^ [ JavaClassReader notNil |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1720 |
and:[JavaClassReader isLoaded]] |
1893
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 |
"Created: / 9.11.1998 / 05:33:17 / cg" |
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
1723 |
! |
1d91f4092152
added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents:
1883
diff
changeset
|
1724 |
|
2031 | 1725 |
showingBigImagePreview |
1726 |
^ showingBigImagePreview |
|
1727 |
||
1728 |
"Created: / 14.8.1998 / 14:15:44 / cg" |
|
1729 |
! |
|
1730 |
||
1834 | 1731 |
showingDetails |
1732 |
^ showingDetails |
|
1733 |
||
1734 |
"Created: / 14.8.1998 / 14:15:15 / cg" |
|
1735 |
! |
|
1736 |
||
1737 |
showingHiddenFiles |
|
1738 |
^ showingHiddenFiles |
|
1739 |
||
1740 |
"Created: / 14.8.1998 / 14:15:44 / cg" |
|
1741 |
! |
|
1742 |
||
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1743 |
showingTimeAndDate |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1744 |
^ showingTimeAndDate |
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 |
"Created: / 14.8.1998 / 14:15:44 / cg" |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1747 |
! |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1748 |
|
2567
dd029fea485d
added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents:
2562
diff
changeset
|
1749 |
singleSelectedFile |
dd029fea485d
added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents:
2562
diff
changeset
|
1750 |
|f sel| |
dd029fea485d
added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents:
2562
diff
changeset
|
1751 |
|
dd029fea485d
added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents:
2562
diff
changeset
|
1752 |
sel := fileListView selection. |
dd029fea485d
added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents:
2562
diff
changeset
|
1753 |
sel size ~~ 1 ifTrue:[ |
dd029fea485d
added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents:
2562
diff
changeset
|
1754 |
^ nil |
dd029fea485d
added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents:
2562
diff
changeset
|
1755 |
]. |
dd029fea485d
added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents:
2562
diff
changeset
|
1756 |
f := fileList at:sel first ifAbsent:nil. |
dd029fea485d
added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents:
2562
diff
changeset
|
1757 |
f notNil ifTrue:[ |
3747
d30bc1e54f15
Remove unused vars and asFilename sends
Stefan Vogel <sv@exept.de>
parents:
3746
diff
changeset
|
1758 |
^ currentDirectory construct:f |
2567
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 |
^ nil |
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 |
"Created: / 29.1.2000 / 13:09:09 / cg" |
dd029fea485d
added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents:
2562
diff
changeset
|
1763 |
! |
dd029fea485d
added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents:
2562
diff
changeset
|
1764 |
|
2368 | 1765 |
singleSelectedFileOrCurrentDirectory |
1766 |
|f sel| |
|
1767 |
||
1768 |
sel := fileListView selection. |
|
1769 |
sel size > 1 ifTrue:[ |
|
1770 |
^ nil |
|
1771 |
]. |
|
1772 |
sel size == 0 ifTrue:[ |
|
3747
d30bc1e54f15
Remove unused vars and asFilename sends
Stefan Vogel <sv@exept.de>
parents:
3746
diff
changeset
|
1773 |
^ currentDirectory |
2368 | 1774 |
]. |
1775 |
f := fileList at:sel first ifAbsent:nil. |
|
1776 |
f notNil ifTrue:[ |
|
3747
d30bc1e54f15
Remove unused vars and asFilename sends
Stefan Vogel <sv@exept.de>
parents:
3746
diff
changeset
|
1777 |
^ currentDirectory construct:f |
2368 | 1778 |
]. |
1779 |
^ nil |
|
1780 |
! |
|
1781 |
||
1834 | 1782 |
sortByWhat |
1783 |
^ sortByWhat |
|
1784 |
||
1785 |
"Created: / 14.8.1998 / 15:55:18 / cg" |
|
1786 |
"Modified: / 14.8.1998 / 15:56:08 / cg" |
|
1787 |
! |
|
1788 |
||
1789 |
sortCaseless |
|
1790 |
^ sortCaseless |
|
1791 |
||
1792 |
"Created: / 14.8.1998 / 14:21:21 / cg" |
|
1793 |
! |
|
1794 |
||
1795 |
systemIsDOS |
|
1796 |
^ OperatingSystem isMSDOSlike |
|
1797 |
||
1798 |
"Created: / 4.8.1998 / 13:37:28 / cg" |
|
1799 |
! |
|
1800 |
||
1801 |
systemIsUnix |
|
1802 |
^ OperatingSystem isUNIXlike |
|
1803 |
||
1804 |
"Created: / 4.8.1998 / 13:37:13 / cg" |
|
1805 |
! |
|
1806 |
||
1807 |
systemIsVMS |
|
1808 |
^ OperatingSystem isVMSlike |
|
1809 |
||
1810 |
"Created: / 4.8.1998 / 13:37:37 / cg" |
|
1811 |
! ! |
|
1812 |
||
1119 | 1813 |
!FileBrowser methodsFor:'drag & drop'! |
172 | 1814 |
|
1132
bd2eda432e1d
drop arg is always a collection
Claus Gittinger <cg@exept.de>
parents:
1124
diff
changeset
|
1815 |
canDrop:aCollectionOfDropObjects |
1119 | 1816 |
"I accept fileObjects only" |
1817 |
||
1132
bd2eda432e1d
drop arg is always a collection
Claus Gittinger <cg@exept.de>
parents:
1124
diff
changeset
|
1818 |
aCollectionOfDropObjects do:[:aDropObject | |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1819 |
aDropObject isFileObject ifFalse:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1820 |
aDropObject isTextObject ifFalse:[^ false]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1821 |
] |
1122
970fc7e88639
support drag out of my list.
Claus Gittinger <cg@exept.de>
parents:
1120
diff
changeset
|
1822 |
]. |
1132
bd2eda432e1d
drop arg is always a collection
Claus Gittinger <cg@exept.de>
parents:
1124
diff
changeset
|
1823 |
^ true |
bd2eda432e1d
drop arg is always a collection
Claus Gittinger <cg@exept.de>
parents:
1124
diff
changeset
|
1824 |
|
bd2eda432e1d
drop arg is always a collection
Claus Gittinger <cg@exept.de>
parents:
1124
diff
changeset
|
1825 |
"Modified: 11.4.1997 / 12:41:59 / cg" |
1118 | 1826 |
! |
1827 |
||
1132
bd2eda432e1d
drop arg is always a collection
Claus Gittinger <cg@exept.de>
parents:
1124
diff
changeset
|
1828 |
drop:aCollectionOfDropObjects at:aPoint |
1122
970fc7e88639
support drag out of my list.
Claus Gittinger <cg@exept.de>
parents:
1120
diff
changeset
|
1829 |
"handle drops" |
970fc7e88639
support drag out of my list.
Claus Gittinger <cg@exept.de>
parents:
1120
diff
changeset
|
1830 |
|
3061 | 1831 |
"/ for now ... only allow single drop |
1832 |
aCollectionOfDropObjects size > 1 ifTrue:[ |
|
1833 |
(self confirm:'Drop the last file only ?') ifFalse:[ |
|
1834 |
^ self |
|
1835 |
]. |
|
1836 |
self dropSingleObject:aCollectionOfDropObjects first at:aPoint. |
|
1837 |
^ self |
|
1838 |
]. |
|
3045 | 1839 |
|
1132
bd2eda432e1d
drop arg is always a collection
Claus Gittinger <cg@exept.de>
parents:
1124
diff
changeset
|
1840 |
aCollectionOfDropObjects do:[:aDropObject | |
3045 | 1841 |
self dropSingleObject:aDropObject at:aPoint |
1132
bd2eda432e1d
drop arg is always a collection
Claus Gittinger <cg@exept.de>
parents:
1124
diff
changeset
|
1842 |
] |
bd2eda432e1d
drop arg is always a collection
Claus Gittinger <cg@exept.de>
parents:
1124
diff
changeset
|
1843 |
|
bd2eda432e1d
drop arg is always a collection
Claus Gittinger <cg@exept.de>
parents:
1124
diff
changeset
|
1844 |
"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
|
1845 |
! |
970fc7e88639
support drag out of my list.
Claus Gittinger <cg@exept.de>
parents:
1120
diff
changeset
|
1846 |
|
970fc7e88639
support drag out of my list.
Claus Gittinger <cg@exept.de>
parents:
1120
diff
changeset
|
1847 |
dropSingleObject:someObject at:aPoint |
1119 | 1848 |
"handle drops; if its a directory, change to it. |
1124 | 1849 |
If its a file, change to its directory and select the file. |
1850 |
If its text, paste it into the codeView." |
|
1119 | 1851 |
|
1122
970fc7e88639
support drag out of my list.
Claus Gittinger <cg@exept.de>
parents:
1120
diff
changeset
|
1852 |
|newDir newFile| |
970fc7e88639
support drag out of my list.
Claus Gittinger <cg@exept.de>
parents:
1120
diff
changeset
|
1853 |
|
1124 | 1854 |
someObject isFileObject ifTrue:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1855 |
someObject isDirectory ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1856 |
newDir := someObject theObject pathName. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1857 |
] ifFalse:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1858 |
newDir := someObject theObject directoryName. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1859 |
newFile := someObject theObject baseName. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1860 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1861 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1862 |
newDir notNil ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1863 |
newDir ~= currentDirectory pathName ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1864 |
self changeDirectoryTo:newDir. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1865 |
] |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1866 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1867 |
newFile notNil ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1868 |
newFile ~= currentFileName ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1869 |
fileListView selection:(fileList indexOf:newFile). |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1870 |
self doFileGet:false. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1871 |
] |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1872 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1873 |
^ self |
1122
970fc7e88639
support drag out of my list.
Claus Gittinger <cg@exept.de>
parents:
1120
diff
changeset
|
1874 |
]. |
970fc7e88639
support drag out of my list.
Claus Gittinger <cg@exept.de>
parents:
1120
diff
changeset
|
1875 |
|
1124 | 1876 |
someObject isTextObject ifTrue:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1877 |
subView paste:someObject theObject. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1878 |
^ self |
1118 | 1879 |
]. |
1124 | 1880 |
|
1881 |
"Modified: 6.4.1997 / 14:46:44 / cg" |
|
1119 | 1882 |
! ! |
1883 |
||
1884 |
!FileBrowser methodsFor:'events'! |
|
1118 | 1885 |
|
1010 | 1886 |
handlesKeyPress:key inView:view |
1887 |
"this method is reached via delegation: are we prepared to handle |
|
1888 |
a keyPress in some other view ?" |
|
1889 |
||
2669
677ca47d8d11
cursor-right --> change to previous directory
Claus Gittinger <cg@exept.de>
parents:
2666
diff
changeset
|
1890 |
<resource: #keyboard (#GotoLine #InspectIt #CmdI #Cmdu |
677ca47d8d11
cursor-right --> change to previous directory
Claus Gittinger <cg@exept.de>
parents:
2666
diff
changeset
|
1891 |
#DoIt #Delete #BackSpace #Accept #CmdF #CmdD |
677ca47d8d11
cursor-right --> change to previous directory
Claus Gittinger <cg@exept.de>
parents:
2666
diff
changeset
|
1892 |
#CursorLeft #CursorRight |
677ca47d8d11
cursor-right --> change to previous directory
Claus Gittinger <cg@exept.de>
parents:
2666
diff
changeset
|
1893 |
)> |
1010 | 1894 |
|
1895 |
view == fileListView ifTrue:[ |
|
2543 | 1896 |
(key == #Delete |
1897 |
or:[key == #BackSpace |
|
1898 |
or:[key == #Accept |
|
1899 |
or:[key == #CmdI |
|
1900 |
or:[key == #CmdF |
|
1901 |
or:[key == #CmdD |
|
1902 |
or:[key == #Cmdu |
|
1903 |
or:[key == #Cut |
|
1904 |
or:[key == #Cmdr |
|
1905 |
or:[key == #Replace |
|
1906 |
or:[key == #InspectIt |
|
1907 |
or:[key == #GotoLine |
|
2665
3601bc8c5ae2
cursorLeft - change to parent dir
Claus Gittinger <cg@exept.de>
parents:
2640
diff
changeset
|
1908 |
or:[key == #CursorLeft |
2669
677ca47d8d11
cursor-right --> change to previous directory
Claus Gittinger <cg@exept.de>
parents:
2666
diff
changeset
|
1909 |
or:[key == #CursorRight |
677ca47d8d11
cursor-right --> change to previous directory
Claus Gittinger <cg@exept.de>
parents:
2666
diff
changeset
|
1910 |
or:[key == #DoIt]]]]]]]]]]]]]]) ifTrue:[^ true]. |
1010 | 1911 |
]. |
1912 |
^ false |
|
1913 |
||
1396 | 1914 |
"Created: / 28.1.1997 / 14:03:20 / stefan" |
1915 |
"Modified: / 20.6.1997 / 16:35:01 / cg" |
|
1916 |
"Modified: / 16.1.1998 / 16:50:39 / stefan" |
|
1010 | 1917 |
! |
1918 |
||
1919 |
keyPress:key x:x y:y view:view |
|
1920 |
"this method is reached via delegation from the fileListView" |
|
1921 |
||
2543 | 1922 |
<resource: #keyboard (#GotoLine #InspectIt |
1923 |
#CmdI #Cmdu #DoIt #Delete #BackSpace #Accept |
|
2669
677ca47d8d11
cursor-right --> change to previous directory
Claus Gittinger <cg@exept.de>
parents:
2666
diff
changeset
|
1924 |
#Cmdr #Cut #CursorLeft #CursorRight)> |
2543 | 1925 |
|
1926 |
(key == #Delete |
|
1927 |
or:[key == #Cut |
|
1928 |
or:[key == #BackSpace]]) ifTrue:[ |
|
1929 |
self fileRemove. |
|
1930 |
^ self |
|
1010 | 1931 |
]. |
1932 |
(key == #Accept) ifTrue:[ |
|
2543 | 1933 |
self fileFileIn. |
1934 |
^ self |
|
1010 | 1935 |
]. |
1936 |
(key == #GotoLine) ifTrue:[ |
|
2543 | 1937 |
self fileGet. |
1938 |
^ self |
|
1010 | 1939 |
]. |
1940 |
(key == #DoIt) ifTrue:[ |
|
2543 | 1941 |
self fileExecute. |
1942 |
^ self |
|
1010 | 1943 |
]. |
1944 |
(key == #InspectIt) ifTrue:[ |
|
2543 | 1945 |
self fileGetInfo. |
1946 |
^ self |
|
1010 | 1947 |
]. |
1948 |
(key == #CmdI) ifTrue:[ |
|
2543 | 1949 |
self fileGetLongInfo. |
1950 |
^ self |
|
1010 | 1951 |
]. |
1952 |
(key == #Cmdu) ifTrue:[ |
|
2543 | 1953 |
self updateCurrentDirectory. |
1954 |
^ self |
|
1396 | 1955 |
]. |
1956 |
(key == #CmdF) ifTrue:[ |
|
2543 | 1957 |
self newFile. |
1958 |
^ self |
|
1396 | 1959 |
]. |
1960 |
(key == #CmdD) ifTrue:[ |
|
2543 | 1961 |
self newDirectory. |
1962 |
^ self |
|
1963 |
]. |
|
1964 |
((key == #Cmdr) or:[key == #Replace]) ifTrue:[ |
|
1965 |
self fileRename. |
|
1966 |
^ self |
|
1010 | 1967 |
]. |
2665
3601bc8c5ae2
cursorLeft - change to parent dir
Claus Gittinger <cg@exept.de>
parents:
2640
diff
changeset
|
1968 |
(key == #CursorLeft) ifTrue:[ |
3601bc8c5ae2
cursorLeft - change to parent dir
Claus Gittinger <cg@exept.de>
parents:
2640
diff
changeset
|
1969 |
self changeToParentDirectory. |
3601bc8c5ae2
cursorLeft - change to parent dir
Claus Gittinger <cg@exept.de>
parents:
2640
diff
changeset
|
1970 |
^ self |
3601bc8c5ae2
cursorLeft - change to parent dir
Claus Gittinger <cg@exept.de>
parents:
2640
diff
changeset
|
1971 |
]. |
2669
677ca47d8d11
cursor-right --> change to previous directory
Claus Gittinger <cg@exept.de>
parents:
2666
diff
changeset
|
1972 |
(key == #CursorRight) ifTrue:[ |
677ca47d8d11
cursor-right --> change to previous directory
Claus Gittinger <cg@exept.de>
parents:
2666
diff
changeset
|
1973 |
self changeToPreviousDirectory. |
677ca47d8d11
cursor-right --> change to previous directory
Claus Gittinger <cg@exept.de>
parents:
2666
diff
changeset
|
1974 |
^ self |
677ca47d8d11
cursor-right --> change to previous directory
Claus Gittinger <cg@exept.de>
parents:
2666
diff
changeset
|
1975 |
]. |
1010 | 1976 |
fileListView keyPress:key x:x y:y |
1977 |
||
1396 | 1978 |
"Created: / 28.1.1997 / 14:03:56 / stefan" |
1979 |
"Modified: / 20.6.1997 / 16:35:08 / cg" |
|
1980 |
"Modified: / 16.1.1998 / 16:51:38 / stefan" |
|
1010 | 1981 |
! |
1982 |
||
172 | 1983 |
mapped |
1984 |
super mapped. |
|
1985 |
" |
|
1986 |
whant to know about changed history |
|
1987 |
" |
|
1988 |
self updateCurrentDirectory |
|
1989 |
! |
|
1990 |
||
1991 |
visibilityChange:how |
|
1992 |
|wasVisible| |
|
1993 |
||
1994 |
wasVisible := shown. |
|
1995 |
super visibilityChange:how. |
|
1996 |
(wasVisible not and:[shown]) ifTrue:[ |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1997 |
" |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1998 |
start checking again |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
1999 |
" |
3520
83cf11e1bf32
schedule checkBlock for the right process
Claus Gittinger <cg@exept.de>
parents:
3503
diff
changeset
|
2000 |
self scheduleCheckBlock. |
172 | 2001 |
] |
1481 | 2002 |
|
2003 |
"Modified: / 18.2.1998 / 17:57:44 / cg" |
|
172 | 2004 |
! ! |
2005 |
||
2006 |
!FileBrowser methodsFor:'fileList user interaction'! |
|
2007 |
||
2031 | 2008 |
bigImagePreviewSettingChanged |
2009 |
"invoked, when big image preview flag changed" |
|
2010 |
||
2011 |
|fh| |
|
2012 |
||
2013 |
(showingBigImagePreview value == true |
|
2014 |
and:[showingDetails value == true]) ifTrue:[ |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2015 |
fh := fileListView font height. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2016 |
fileListView lineSpacing:(34 - fh max:0). |
2031 | 2017 |
] ifFalse:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2018 |
fileListView clear. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2019 |
self updateCurrentDirectory. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2020 |
fileListView lineSpacing:2. |
2031 | 2021 |
]. |
2022 |
fileListView clear. |
|
2023 |
self updateCurrentDirectory |
|
2024 |
||
2025 |
"Modified: / 4.8.1998 / 13:43:54 / cg" |
|
2026 |
"Created: / 14.8.1998 / 14:17:49 / cg" |
|
2027 |
! |
|
2028 |
||
172 | 2029 |
changeDisplayMode |
2030 |
"toggle from long to short listing (and vice-versa)" |
|
2031 |
||
1834 | 2032 |
showingDetails value:(showingDetails value not). |
2033 |
"/ showLongList := showLongList not. |
|
1156
f3df28086973
dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents:
1154
diff
changeset
|
2034 |
self showOrHideTabView. |
172 | 2035 |
self updateCurrentDirectory |
747 | 2036 |
|
1834 | 2037 |
"Modified: / 4.8.1998 / 13:43:54 / cg" |
172 | 2038 |
! |
2039 |
||
2040 |
changeDotFileVisibility |
|
2041 |
"turn on/off visibility of files whose name starts with '.'" |
|
2042 |
||
1834 | 2043 |
showingHiddenFiles value:(showingHiddenFiles value not). |
2044 |
"/ showDotFiles := showDotFiles not. |
|
172 | 2045 |
self updateCurrentDirectory |
1834 | 2046 |
|
2047 |
"Modified: / 4.8.1998 / 13:45:46 / cg" |
|
2048 |
! |
|
2049 |
||
3281 | 2050 |
confirmAndRemove:fileNames |
2051 |
"remove fileNames with user confirmation. |
|
2052 |
TODO: Should be enhanced, to look for a ~/.trash directory |
|
2053 |
and move files there if it exists (without asking in this case)." |
|
2054 |
||
2055 |
|q doRemove| |
|
2056 |
||
2057 |
"/ do not ask, if shift is pressed |
|
2058 |
fileNames size > 1 ifTrue:[ |
|
2059 |
q := resources string:'Remove %1 selected files ?' with:(fileNames size). |
|
2060 |
doRemove := Dialog |
|
2061 |
confirmWithCancel:q |
|
2062 |
labels:(resources array:#('Cancel' 'Confirm Each' 'Remove')) |
|
2063 |
values:#(false #confirm true) |
|
2064 |
default:3. |
|
2065 |
doRemove isNil ifTrue:[^ self]. |
|
2066 |
doRemove == #confirm ifTrue:[ |
|
2067 |
fileNames do:[:eachFileName | |
|
2068 |
self confirmAndRemove:(Array with:eachFileName). |
|
2069 |
]. |
|
2070 |
^ self. |
|
2071 |
]. |
|
2072 |
] ifFalse:[ |
|
2073 |
q := resources string:'Remove ''%1'' ?' with:(fileNames first allBold). |
|
2074 |
doRemove := self ask:q yesButton:'Remove'. |
|
2075 |
]. |
|
2076 |
||
2077 |
doRemove ifTrue:[ |
|
2078 |
self doRemove:fileNames |
|
2079 |
] |
|
2080 |
! |
|
2081 |
||
1834 | 2082 |
detailsSettingChanged |
2083 |
"invoked, when detail (i.e. long / short) listing flag changed" |
|
2084 |
||
2085 |
self showOrHideTabView. |
|
2031 | 2086 |
self bigImagePreviewSettingChanged |
1834 | 2087 |
|
2088 |
"Modified: / 4.8.1998 / 13:43:54 / cg" |
|
2089 |
"Created: / 14.8.1998 / 14:17:49 / cg" |
|
172 | 2090 |
! |
2091 |
||
1327 | 2092 |
fileDoubleClick:lineNr |
2093 |
"double click on a file - get its contents" |
|
2094 |
||
2095 |
self fileSelect:lineNr. |
|
2096 |
self fileGet:true |
|
2097 |
! |
|
2098 |
||
386
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
2099 |
fileEncoding |
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
2100 |
"open a dialog to allow change of the files character encoding. |
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
2101 |
Files are converted to internal encoding when read, and converted back |
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
2102 |
to this encoding when saved. |
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
2103 |
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
|
2104 |
the internal encoding (which is iso8859). |
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
2105 |
Notice: currently, not too many encodings are supported by the system." |
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
2106 |
|
495
6d6a6b8feb2b
ask characterArray for encodings
Claus Gittinger <cg@exept.de>
parents:
488
diff
changeset
|
2107 |
|dialog list descr encodings encodingNames idx| |
386
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
2108 |
|
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
2109 |
list := SelectionInList new. |
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
2110 |
|
495
6d6a6b8feb2b
ask characterArray for encodings
Claus Gittinger <cg@exept.de>
parents:
488
diff
changeset
|
2111 |
descr := CharacterArray supportedExternalEncodings. |
6d6a6b8feb2b
ask characterArray for encodings
Claus Gittinger <cg@exept.de>
parents:
488
diff
changeset
|
2112 |
encodings := descr at:2. |
6d6a6b8feb2b
ask characterArray for encodings
Claus Gittinger <cg@exept.de>
parents:
488
diff
changeset
|
2113 |
encodingNames := descr at:1. |
6d6a6b8feb2b
ask characterArray for encodings
Claus Gittinger <cg@exept.de>
parents:
488
diff
changeset
|
2114 |
|
6d6a6b8feb2b
ask characterArray for encodings
Claus Gittinger <cg@exept.de>
parents:
488
diff
changeset
|
2115 |
list list:encodingNames. |
386
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
2116 |
list selectionIndex:(encodings indexOf:fileEncoding ifAbsent:1). |
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 := Dialog new. |
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
2119 |
|
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
2120 |
dialog addTextLabel:(resources string:'ENCODING_MSG') withCRs. |
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
2121 |
dialog addVerticalSpace. |
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
2122 |
dialog addListBoxOn:list withNumberOfLines:5. |
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
2123 |
|
2048 | 2124 |
dialog addAbortAndOkButtons. |
386
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
2125 |
dialog open. |
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
2126 |
|
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
2127 |
dialog accepted ifTrue:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2128 |
idx := list selectionIndex. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2129 |
fileEncoding := encodings at:idx. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2130 |
subView externalEncoding:fileEncoding. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2131 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2132 |
self validateFontEncodingFor:fileEncoding ask:true. |
386
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
2133 |
]. |
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
2134 |
|
1219 | 2135 |
"Modified: 30.6.1997 / 14:41:12 / cg" |
386
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
2136 |
! |
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
2137 |
|
172 | 2138 |
fileExecute |
2139 |
"if text was modified show a queryBox, |
|
2140 |
otherwise pop up execute box immediately" |
|
2141 |
||
1142
9066d7d02a3a
remember last executed command per suffix; offer this as default.
Claus Gittinger <cg@exept.de>
parents:
1141
diff
changeset
|
2142 |
|action sel fileName| |
172 | 2143 |
|
2144 |
" |
|
2145 |
this replaces everything by the commands output ... |
|
2146 |
" |
|
865
48395e8ecca9
remember executeCommand actions in history as well.
Claus Gittinger <cg@exept.de>
parents:
851
diff
changeset
|
2147 |
action := [:command | |
3252 | 2148 |
self class addToCommandHistory:command for:fileName. |
2149 |
self doExecuteCommand:command replace:true |
|
2150 |
]. |
|
2151 |
||
2152 |
(self askIfModified:'Contents has not been saved.\\Modifications will be lost when command is executed.' |
|
2153 |
yesButton:'Execute') ifFalse:[^ self]. |
|
172 | 2154 |
|
2155 |
"/ " |
|
2156 |
"/ this inserts the commands output ... |
|
2157 |
"/ " |
|
2158 |
"/ action := [:command| self doExecuteCommand:command replace:false]. |
|
2159 |
"/ |
|
1142
9066d7d02a3a
remember last executed command per suffix; offer this as default.
Claus Gittinger <cg@exept.de>
parents:
1141
diff
changeset
|
2160 |
|
9066d7d02a3a
remember last executed command per suffix; offer this as default.
Claus Gittinger <cg@exept.de>
parents:
1141
diff
changeset
|
2161 |
sel := fileListView selection. |
9066d7d02a3a
remember last executed command per suffix; offer this as default.
Claus Gittinger <cg@exept.de>
parents:
1141
diff
changeset
|
2162 |
sel size == 1 ifTrue:[ |
3252 | 2163 |
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
|
2164 |
]. |
9066d7d02a3a
remember last executed command per suffix; offer this as default.
Claus Gittinger <cg@exept.de>
parents:
1141
diff
changeset
|
2165 |
self askForCommandFor:fileName thenDo:action |
865
48395e8ecca9
remember executeCommand actions in history as well.
Claus Gittinger <cg@exept.de>
parents:
851
diff
changeset
|
2166 |
|
48395e8ecca9
remember executeCommand actions in history as well.
Claus Gittinger <cg@exept.de>
parents:
851
diff
changeset
|
2167 |
"Modified: 14.11.1996 / 14:59:34 / cg" |
172 | 2168 |
! |
2169 |
||
2170 |
fileFileIn |
|
2171 |
"fileIn the selected file(s)" |
|
2172 |
||
2173 |
self fileFileInLazy:false |
|
2174 |
! |
|
2175 |
||
2176 |
fileFileInLazy |
|
2177 |
"fileIn the selected file(s). Do a quick load (no compilation)" |
|
2178 |
||
2179 |
self fileFileInLazy:true |
|
2180 |
! |
|
2181 |
||
2182 |
fileFileInLazy:lazy |
|
2183 |
"fileIn the selected file(s)" |
|
2184 |
||
3478 | 2185 |
|aStream path wasLazy prevCurrentFileName| |
172 | 2186 |
|
2187 |
self selectedFilesDo:[:fileName | |
|
2430 | 2188 |
path := currentDirectory filenameFor:fileName. |
2189 |
path type == #regular ifTrue:[ |
|
2190 |
prevCurrentFileName := currentFileInFileName. |
|
2191 |
currentFileInFileName := fileName. |
|
2192 |
||
2193 |
(ObjectFileLoader notNil |
|
2194 |
and:[ObjectFileLoader hasValidBinaryExtension:fileName]) ifTrue:[ |
|
3436
c4fe19deba58
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3421
diff
changeset
|
2195 |
AbortOperationRequest catch:[ |
2430 | 2196 |
|p| |
2197 |
||
2198 |
"/ |
|
2199 |
"/ look if already loaded ... then unload first |
|
2200 |
"/ |
|
2201 |
p := path pathName. |
|
2202 |
(ObjectFileLoader loadedObjectFiles includes:p) ifTrue:[ |
|
2203 |
(Dialog confirm:(resources |
|
2204 |
string:'%1 is already loaded; load anyway ?' |
|
2205 |
with:p)) ifFalse:[ |
|
2206 |
^ self |
|
2207 |
]. |
|
2208 |
Transcript showCR:'unloading old ' , p , ' ...'. |
|
2209 |
ObjectFileLoader unloadObjectFile:p. |
|
2210 |
]. |
|
2211 |
||
2212 |
Transcript showCR:'loading ' , p , ' ...'. |
|
2213 |
ObjectFileLoader loadObjectFile:p. |
|
2214 |
Class addInfoRecord:('fileIn ' , fileName) |
|
2215 |
] |
|
3478 | 2216 |
] ifFalse:[ ((path hasSuffix:'cls') |
2217 |
and:[((path mimeTypeOfContents ? '') startsWith:'application/x-smalltalk-source') not ]) ifTrue:[ |
|
2640 | 2218 |
"/ loading a binary class file |
2219 |
aStream := path readStream. |
|
2220 |
aStream notNil ifTrue:[ |
|
3404 | 2221 |
aStream fileInBinary. |
2640 | 2222 |
] |
2430 | 2223 |
] ifFalse:[ |
2640 | 2224 |
((path hasSuffix:'class') |
2225 |
or:[(path hasSuffix:'cla')]) ifTrue:[ |
|
2226 |
"/ loading a java class file |
|
2227 |
JavaClassReader notNil ifTrue:[ |
|
2228 |
JavaClassReader loadFile:(path pathName) |
|
2229 |
] |
|
2230 |
] ifFalse:[ (path hasSuffix:'sif') ifTrue:[ |
|
2231 |
"/ loading a sif (smalltalk interchange format) file |
|
3523 | 2232 |
SmalltalkInterchangeSTXFileInManager autoload. |
2640 | 2233 |
SmalltalkInterchangeFileManager newForFileIn |
2234 |
fileName: path pathName; |
|
2235 |
fileIn. |
|
3342 | 2236 |
] ifFalse:[ (path hasSuffix:'pcl') ifTrue:[ |
2237 |
Parcel isNil ifTrue:[ |
|
2238 |
self warn:'Parcel support not loaded.' |
|
2239 |
] ifFalse:[ |
|
2240 |
Parcel loadParcelFrom: path pathName |
|
2241 |
] |
|
2640 | 2242 |
] ifFalse:[ |
2243 |
"/ loading a regular (chunk) or xml source file |
|
2430 | 2244 |
aStream := path readStream. |
2245 |
aStream notNil ifTrue:[ |
|
2640 | 2246 |
[ |
2247 |
Class withoutUpdatingChangesDo:[ |
|
2248 |
wasLazy := Compiler compileLazy:lazy. |
|
2249 |
aStream fileIn. |
|
2430 | 2250 |
]. |
2640 | 2251 |
Class addInfoRecord:('fileIn ' , fileName) |
3596
9761af1f3f72
#valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents:
3568
diff
changeset
|
2252 |
] ensure:[ |
2640 | 2253 |
Compiler compileLazy:wasLazy. |
2254 |
aStream close |
|
2430 | 2255 |
] |
2256 |
] |
|
3342 | 2257 |
]]] |
2640 | 2258 |
]] |
2430 | 2259 |
]. |
2260 |
currentFileInFileName := prevCurrentFileName |
|
172 | 2261 |
] |
2262 |
||
1702
962056a31c06
remember the current file during fileIn,
Claus Gittinger <cg@exept.de>
parents:
1700
diff
changeset
|
2263 |
"Modified: / 19.9.1997 / 23:42:22 / stefan" |
3436
c4fe19deba58
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3421
diff
changeset
|
2264 |
"Modified: / 16.11.2001 / 17:38:34 / cg" |
172 | 2265 |
! |
2266 |
||
3465
f52e089ca838
added fileIntoNameSpace menu item
Claus Gittinger <cg@exept.de>
parents:
3461
diff
changeset
|
2267 |
fileFileInToNameSpace |
f52e089ca838
added fileIntoNameSpace menu item
Claus Gittinger <cg@exept.de>
parents:
3461
diff
changeset
|
2268 |
"fileIn the selected file(s)<into a nameSpace" |
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| |
f52e089ca838
added fileIntoNameSpace menu item
Claus Gittinger <cg@exept.de>
parents:
3461
diff
changeset
|
2271 |
|
f52e089ca838
added fileIntoNameSpace menu item
Claus Gittinger <cg@exept.de>
parents:
3461
diff
changeset
|
2272 |
ns := Dialog request:'Default NameSpace for fileIn ?'. |
f52e089ca838
added fileIntoNameSpace menu item
Claus Gittinger <cg@exept.de>
parents:
3461
diff
changeset
|
2273 |
ns isEmptyOrNil ifTrue:[^ self]. |
f52e089ca838
added fileIntoNameSpace menu item
Claus Gittinger <cg@exept.de>
parents:
3461
diff
changeset
|
2274 |
ns := NameSpace name:ns. |
f52e089ca838
added fileIntoNameSpace menu item
Claus Gittinger <cg@exept.de>
parents:
3461
diff
changeset
|
2275 |
Class nameSpaceQuerySignal |
f52e089ca838
added fileIntoNameSpace menu item
Claus Gittinger <cg@exept.de>
parents:
3461
diff
changeset
|
2276 |
answer:ns |
f52e089ca838
added fileIntoNameSpace menu item
Claus Gittinger <cg@exept.de>
parents:
3461
diff
changeset
|
2277 |
do:[ self fileFileInLazy:false ] |
f52e089ca838
added fileIntoNameSpace menu item
Claus Gittinger <cg@exept.de>
parents:
3461
diff
changeset
|
2278 |
! |
f52e089ca838
added fileIntoNameSpace menu item
Claus Gittinger <cg@exept.de>
parents:
3461
diff
changeset
|
2279 |
|
1972 | 2280 |
fileFindAllDuplicates |
2281 |
"scan directory and all subdirs for duplicate files" |
|
2282 |
||
2283 |
|fileNames dir infoDir filesBySize |
|
2284 |
result info dirPrefix| |
|
2285 |
||
2286 |
(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
|
2287 |
yesButton:'proceed') ifFalse:[^ self]. |
1972 | 2288 |
|
2289 |
self withWaitCursorDo:[ |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2290 |
result := Dictionary new. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2291 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2292 |
dir := currentDirectory asFilename. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2293 |
self label:myName , '- gathering file names ...'. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2294 |
fileNames := dir recursiveDirectoryContents. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2295 |
fileNames := fileNames collect:[:fn | dir construct:fn]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2296 |
fileNames := fileNames select:[:fn | fn isDirectory not]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2297 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2298 |
self label:myName , '- gathering sizes ...'. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2299 |
infoDir := Dictionary new. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2300 |
fileNames do:[:fn | |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2301 |
infoDir at:fn put:(fn fileSize) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2302 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2303 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2304 |
"/ for each, get the files size. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2305 |
"/ 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
|
2306 |
"/ compare them ... |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2307 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2308 |
self label:myName , '- preselect possible duplicates ...'. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2309 |
filesBySize := Dictionary new. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2310 |
infoDir keysAndValuesDo:[:fn :sz | |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2311 |
|entry| |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2312 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2313 |
entry := filesBySize at:sz ifAbsentPut:[Set new]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2314 |
entry add:fn. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2315 |
]. |
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 |
"/ any of same size ? |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2318 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2319 |
self label:myName , '- checking for duplicates ...'. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2320 |
filesBySize do:[:entry | |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2321 |
|files| |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2322 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2323 |
entry size > 1 ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2324 |
files := entry asArray. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2325 |
1 to:files size-1 do:[:idx1 | |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2326 |
idx1+1 to:files size do:[:idx2 | |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2327 |
|fn1 fn2| |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2328 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2329 |
fn1 := files at:idx1. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2330 |
fn2 := files at:idx2. |
1972 | 2331 |
|
2332 |
"/ self label:myName , '- checking ' , fn1 baseName , ' vs. ' , fn2 baseName , ' ...'. |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2333 |
(result at:fn2 ifAbsent:nil) ~= fn1 ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2334 |
"/ compare the files |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2335 |
(fn1 sameContentsAs:fn2) ifTrue:[ |
1972 | 2336 |
"/ 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
|
2337 |
result at:fn1 put:fn2. |
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 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2344 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2345 |
self label:myName , '- sorting ...'. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2346 |
dirPrefix := currentDirectory asFilename pathName. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2347 |
result := result associations. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2348 |
result := result collect:[:assoc | |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2349 |
|f1 f2| |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2350 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2351 |
f1 := assoc key name. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2352 |
f2 := assoc value name. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2353 |
(f1 startsWith:dirPrefix) ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2354 |
f1 := f1 copyFrom:dirPrefix size + 2. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2355 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2356 |
(f2 startsWith:dirPrefix) ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2357 |
f2 := f2 copyFrom:dirPrefix size + 2. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2358 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2359 |
f1 < f2 ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2360 |
f2 -> f1 |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2361 |
] ifFalse:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2362 |
f1 -> f2 |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2363 |
] |
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 |
result sort:[:f1 :f2 | f2 value < f1 value]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2366 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2367 |
info := OrderedCollection new. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2368 |
result do:[:assoc | |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2369 |
info add:(assoc key , ' same as ' , assoc value) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2370 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2371 |
info isEmpty ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2372 |
info := 'No duplicate files found.' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2373 |
]. |
1972 | 2374 |
]. |
2375 |
||
2376 |
subView contents:info. |
|
2377 |
self label:myName. |
|
2378 |
||
2379 |
"Created: / 28.11.1998 / 17:47:53 / cg" |
|
2380 |
"Modified: / 10.12.1998 / 17:13:14 / cg" |
|
2381 |
! |
|
2382 |
||
1911
6d1b77eda98f
check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents:
1903
diff
changeset
|
2383 |
fileFindDuplicates |
6d1b77eda98f
check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents:
1903
diff
changeset
|
2384 |
"scan directory for duplicate files" |
6d1b77eda98f
check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents:
1903
diff
changeset
|
2385 |
|
6d1b77eda98f
check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents:
1903
diff
changeset
|
2386 |
|fileNames dir infoDir filesBySize |
6d1b77eda98f
check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents:
1903
diff
changeset
|
2387 |
result info| |
6d1b77eda98f
check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents:
1903
diff
changeset
|
2388 |
|
6d1b77eda98f
check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents:
1903
diff
changeset
|
2389 |
(self askIfModified:'contents has not been saved.\\Modifications will be lost when you proceed.' |
3726 | 2390 |
yesButton:'Proceed') ifFalse:[^ self]. |
1911
6d1b77eda98f
check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents:
1903
diff
changeset
|
2391 |
|
6d1b77eda98f
check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents:
1903
diff
changeset
|
2392 |
self withWaitCursorDo:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2393 |
result := Dictionary new. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2394 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2395 |
dir := currentDirectory asFilename. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2396 |
fileNames := dir directoryContents. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2397 |
fileNames := fileNames collect:[:fn | dir construct:fn]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2398 |
fileNames := fileNames select:[:fn | fn isDirectory not]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2399 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2400 |
infoDir := Dictionary new. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2401 |
fileNames do:[:fn | |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2402 |
infoDir at:fn put:(fn info) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2403 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2404 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2405 |
"/ for each, get the files size. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2406 |
"/ 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
|
2407 |
"/ compare them ... |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2408 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2409 |
filesBySize := Dictionary new. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2410 |
infoDir keysAndValuesDo:[:fn :info | |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2411 |
|sz entry| |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2412 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2413 |
sz := info size. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2414 |
entry := filesBySize at:sz ifAbsentPut:[Set new]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2415 |
entry add:fn. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2416 |
]. |
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 |
"/ any of same size ? |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2419 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2420 |
filesBySize do:[:entry | |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2421 |
|files| |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2422 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2423 |
entry size > 1 ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2424 |
files := entry asArray. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2425 |
1 to:files size-1 do:[:idx1 | |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2426 |
idx1+1 to:files size do:[:idx2 | |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2427 |
|fn1 fn2| |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2428 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2429 |
fn1 := files at:idx1. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2430 |
fn2 := files at:idx2. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2431 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2432 |
(result at:fn2 ifAbsent:nil) ~= fn1 ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2433 |
"/ compare the files |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2434 |
(fn1 sameContentsAs:fn2) ifTrue:[ |
1911
6d1b77eda98f
check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents:
1903
diff
changeset
|
2435 |
"/ 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
|
2436 |
result at:fn1 put:fn2. |
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 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2443 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2444 |
result := result associations. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2445 |
result := result collect:[:assoc | |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2446 |
|f1 f2| |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2447 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2448 |
f1 := assoc key baseName. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2449 |
f2 := assoc value baseName. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2450 |
f1 < f2 ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2451 |
f2 -> f1 |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2452 |
] ifFalse:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2453 |
f1 -> f2 |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2454 |
] |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2455 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2456 |
result sort:[:f1 :f2 | f2 value < f1 value]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2457 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2458 |
info := OrderedCollection new. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2459 |
result do:[:assoc | |
3556 | 2460 |
|fn1 fn2| |
2461 |
||
2462 |
fn1 := assoc key. |
|
2463 |
fn2 := assoc value. |
|
2464 |
(fn1 includes:Character space) ifTrue:[ |
|
2465 |
fn1 := '"' , fn1 , '"' |
|
2466 |
]. |
|
2467 |
(fn2 includes:Character space) ifTrue:[ |
|
2468 |
fn2 := '"' , fn2 , '"' |
|
2469 |
]. |
|
2470 |
info add:(fn1 , ' same as ' , fn2) |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2471 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2472 |
info isEmpty ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2473 |
info := 'No duplicate files found.' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2474 |
]. |
1911
6d1b77eda98f
check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents:
1903
diff
changeset
|
2475 |
]. |
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 |
subView contents:info |
6d1b77eda98f
check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents:
1903
diff
changeset
|
2478 |
|
6d1b77eda98f
check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents:
1903
diff
changeset
|
2479 |
"Created: / 3.10.1998 / 17:59:00 / cg" |
1912 | 2480 |
"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
|
2481 |
! |
6d1b77eda98f
check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents:
1903
diff
changeset
|
2482 |
|
1933 | 2483 |
fileFindFile |
1965 | 2484 |
|sel bindings |
1933 | 2485 |
namePatternHolder contentsPatternHolder |
2486 |
ignoreCaseInName ignoreCaseInContents |
|
2166
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2487 |
namePattern namePatterns contentsPattern |
1965 | 2488 |
searchForSameContentsEnabled searchForSameContents| |
1933 | 2489 |
|
2490 |
(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
|
2491 |
yesButton:'proceed') ifFalse:[^ self]. |
1933 | 2492 |
|
2493 |
subView contents:nil; scrollToTop. |
|
2494 |
||
2495 |
bindings := IdentityDictionary new. |
|
2496 |
bindings at:#namePatternHolder put:(namePatternHolder := '' asValue). |
|
2497 |
bindings at:#contentsPatternHolder put:(contentsPatternHolder := '' asValue). |
|
2498 |
bindings at:#ignoreCaseInName put:(ignoreCaseInName := false asValue). |
|
2499 |
bindings at:#ignoreCaseInContents put:(ignoreCaseInContents := false asValue). |
|
2500 |
||
1965 | 2501 |
searchForSameContentsEnabled := false. |
2502 |
sel := fileListView selectionValue. |
|
2503 |
sel size == 1 ifTrue:[ |
|
2166
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2504 |
searchForSameContentsEnabled := true. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2505 |
sel := sel first string withoutSeparators |
1965 | 2506 |
]. |
2507 |
bindings at:#searchForSameContentsEnabled put:(searchForSameContentsEnabled := searchForSameContentsEnabled asValue). |
|
2508 |
bindings at:#searchForSameContents put:(searchForSameContents := false asValue). |
|
2509 |
bindings at:#notSearchForSameContents put:(BlockValue forLogicalNot:searchForSameContents). |
|
2510 |
||
2511 |
||
1933 | 2512 |
(SimpleDialog new |
2166
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2513 |
openFor:self |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2514 |
interfaceSpec:(self class fileSearchDialogSpec) |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2515 |
withBindings:bindings) ifTrue:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2516 |
|
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2517 |
namePattern := namePatternHolder value. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2518 |
namePattern size == 0 ifTrue:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2519 |
namePatterns := nil |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2520 |
] ifFalse:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2521 |
ignoreCaseInName value ifTrue:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2522 |
namePattern := namePattern asLowercase |
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 |
namePatterns := namePattern asCollectionOfSubstringsSeparatedBy:$; |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2525 |
]. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2526 |
contentsPattern := contentsPatternHolder value. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2527 |
contentsPattern size == 0 ifTrue:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2528 |
contentsPattern := nil |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2529 |
] ifFalse:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2530 |
ignoreCaseInContents value ifTrue:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2531 |
contentsPattern := contentsPattern asLowercase |
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 |
]. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2534 |
|
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2535 |
self withWaitCursorDo:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2536 |
|stopSignal access myProcess lowerFrameView| |
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 |
myProcess := Processor activeProcess. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2539 |
|
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2540 |
access := Semaphore forMutualExclusion name:'accessLock'. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2541 |
stopSignal := Signal new. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2542 |
|
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2543 |
" |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2544 |
The following is tricky: |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2545 |
the pauseToggle & killButton will |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2546 |
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
|
2547 |
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
|
2548 |
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
|
2549 |
" |
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 |
commandView beInvisible. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2552 |
|
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 |
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
|
2555 |
" |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2556 |
killButton windowGroup:nil. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2557 |
|
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 |
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
|
2560 |
" |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2561 |
killButton label:(resources string:'stop'). |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2562 |
killButton raise; beVisible. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2563 |
|
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 |
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
|
2566 |
" |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2567 |
killButton |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2568 |
action:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2569 |
access critical:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2570 |
myProcess interruptWith:[stopSignal raiseRequest]. |
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 |
|
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 |
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
|
2576 |
" |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2577 |
killButton openAutonomous. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2578 |
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
|
2579 |
|
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2580 |
lowerFrameView := subView superView. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2581 |
|
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2582 |
[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2583 |
stopSignal catch:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2584 |
searchForSameContents value ifTrue:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2585 |
self |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2586 |
doFindFileNamed:namePatterns |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2587 |
ignoreCase:ignoreCaseInName value |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2588 |
containingString:nil |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2589 |
ignoreCaseInContents:ignoreCaseInContents value |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2590 |
sameContentsAsFile:(currentDirectory asFilename construct:sel) |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2591 |
sameContentsAs:nil |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2592 |
in:currentDirectory. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2593 |
] ifFalse:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2594 |
(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
|
2595 |
self |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2596 |
doFindFileNamed:namePatterns |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2597 |
ignoreCase:ignoreCaseInName value |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2598 |
containingString:contentsPattern |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2599 |
ignoreCaseInContents:ignoreCaseInContents value |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2600 |
sameContentsAsFile:nil |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2601 |
sameContentsAs:nil |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2602 |
in:currentDirectory. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2603 |
] |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2604 |
] |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2605 |
] |
3596
9761af1f3f72
#valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents:
3568
diff
changeset
|
2606 |
] ensure:[ |
2166
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2607 |
|wg| |
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 |
self label:myName; iconLabel:myName. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2610 |
|
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2611 |
" |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2612 |
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
|
2613 |
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
|
2614 |
" |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2615 |
killButton beInvisible. |
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 |
commandView beVisible. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2618 |
|
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2619 |
" |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2620 |
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
|
2621 |
(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
|
2622 |
" |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2623 |
wg := killButton windowGroup. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2624 |
killButton windowGroup:nil. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2625 |
|
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 |
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
|
2628 |
" |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2629 |
wg notNil ifTrue:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2630 |
wg process terminate. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2631 |
]. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2632 |
" |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2633 |
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
|
2634 |
releases reference to thisContext earlier) |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2635 |
" |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2636 |
killButton action:nil. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2637 |
killButton label:(resources string:'kill'). |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2638 |
|
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2639 |
"/ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2640 |
"/ allow interaction with the codeView |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2641 |
"/ (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
|
2642 |
"/ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2643 |
lowerFrameView windowGroup:(self windowGroup). |
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 |
|
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2646 |
]. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2647 |
self label:myName. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2648 |
currentFileName isNil ifTrue:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2649 |
subView modified:false. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
2650 |
]. |
1933 | 2651 |
]. |
2652 |
||
2653 |
"Created: / 15.10.1998 / 11:32:57 / cg" |
|
2654 |
"Modified: / 15.10.1998 / 12:41:09 / cg" |
|
2655 |
! |
|
2656 |
||
172 | 2657 |
fileGet |
2658 |
"get contents of selected file into subView. |
|
2659 |
If text was modified show a queryBox, |
|
2660 |
otherwise get it immediately" |
|
2661 |
||
633
4630175ed31e
double click on .htm / .html files open a viewer;
Claus Gittinger <cg@exept.de>
parents:
585
diff
changeset
|
2662 |
self fileGet:false |
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 |
"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
|
2665 |
! |
4630175ed31e
double click on .htm / .html files open a viewer;
Claus Gittinger <cg@exept.de>
parents:
585
diff
changeset
|
2666 |
|
4630175ed31e
double click on .htm / .html files open a viewer;
Claus Gittinger <cg@exept.de>
parents:
585
diff
changeset
|
2667 |
fileGet:viaDoubleClick |
4630175ed31e
double click on .htm / .html files open a viewer;
Claus Gittinger <cg@exept.de>
parents:
585
diff
changeset
|
2668 |
"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
|
2669 |
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
|
2670 |
otherwise get it immediately" |
4630175ed31e
double click on .htm / .html files open a viewer;
Claus Gittinger <cg@exept.de>
parents:
585
diff
changeset
|
2671 |
|
172 | 2672 |
|fileName msg label| |
2673 |
||
1110
9ec4692e9cda
dont decode string, if the encoding is already iso8859
Claus Gittinger <cg@exept.de>
parents:
1104
diff
changeset
|
2674 |
(subView modified not or:[subView contentsWasSaved]) ifTrue:[ |
3252 | 2675 |
self doFileGet:viaDoubleClick. |
2676 |
^ self |
|
1110
9ec4692e9cda
dont decode string, if the encoding is already iso8859
Claus Gittinger <cg@exept.de>
parents:
1104
diff
changeset
|
2677 |
]. |
172 | 2678 |
fileName := self getSelectedFileName. |
2679 |
fileName notNil ifTrue:[ |
|
3252 | 2680 |
(currentDirectory filenameFor:fileName) isDirectory ifTrue:[ |
2681 |
msg := 'Contents has not been saved.\\Modifications will be lost when directory is changed.'. |
|
2682 |
label := 'Change'. |
|
2683 |
] ifFalse:[ |
|
2684 |
msg := 'Contents has not been saved.\\Modifications will be lost when new file is read.'. |
|
2685 |
label := 'Get'. |
|
2686 |
]. |
|
2687 |
(self ask:(resources at:msg) yesButton:label) ifTrue:[ |
|
2688 |
subView modified:false. |
|
2689 |
self doFileGet:viaDoubleClick |
|
2690 |
] |
|
172 | 2691 |
] |
633
4630175ed31e
double click on .htm / .html files open a viewer;
Claus Gittinger <cg@exept.de>
parents:
585
diff
changeset
|
2692 |
|
4630175ed31e
double click on .htm / .html files open a viewer;
Claus Gittinger <cg@exept.de>
parents:
585
diff
changeset
|
2693 |
"Created: 19.6.1996 / 09:38:35 / cg" |
1162 | 2694 |
"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
|
2695 |
"Modified: 18.9.1997 / 16:27:34 / stefan" |
172 | 2696 |
! |
2697 |
||
2698 |
fileGetInfo |
|
2699 |
"show short file (stat)-info" |
|
2700 |
||
2701 |
self fileGetInfo:false |
|
2702 |
! |
|
2703 |
||
2704 |
fileGetInfo:longInfo |
|
2705 |
"get info on selected file - show it in a box" |
|
2706 |
||
1672
9df905f8bfa3
update fileInfo while showing infoBox
Claus Gittinger <cg@exept.de>
parents:
1628
diff
changeset
|
2707 |
|string box updater| |
172 | 2708 |
|
2709 |
string := self getFileInfoString:longInfo. |
|
2710 |
string notNil ifTrue:[ |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2711 |
box := InfoBox title:string. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2712 |
updater := [ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2713 |
[true] whileTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2714 |
Delay waitForSeconds:2. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2715 |
string := self getFileInfoString:longInfo. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2716 |
box title:string |
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 |
] fork. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2719 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2720 |
box showAtPointer. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2721 |
updater terminate. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2722 |
box destroy |
172 | 2723 |
] |
2724 |
! |
|
2725 |
||
2726 |
fileGetLongInfo |
|
2727 |
"show long stat (file)-info" |
|
2728 |
||
2729 |
self fileGetInfo:true |
|
2730 |
! |
|
2731 |
||
1874 | 2732 |
fileHexDump |
2733 |
"show a hex dump (similar to od -x) |
|
2734 |
Only needed with non-Unix systems." |
|
2735 |
||
3252 | 2736 |
(self askIfModified:'Contents has not been saved.\\Modifications will be lost when hex dump is shown.' |
2737 |
yesButton:'HexDump') ifFalse:[^ self]. |
|
2738 |
||
1874 | 2739 |
self withReadCursorDo:[ |
2666 | 2740 |
|fileName f stream data offs |
2701
78171ebe64f5
less memory need for hexDump
Claus Gittinger <cg@exept.de>
parents:
2688
diff
changeset
|
2741 |
addrDigits col line lineStream asciiLineStream lines| |
2666 | 2742 |
|
2743 |
fileName := self getSelectedFileName. |
|
2744 |
fileName notNil ifTrue:[ |
|
2745 |
f := currentDirectory construct:fileName. |
|
2746 |
f isDirectory ifTrue:[ |
|
2747 |
^ self warn:(resources string:'%1 is a directory.' with:fileName). |
|
2748 |
]. |
|
2749 |
f exists ifFalse:[ |
|
3528 | 2750 |
Dialog warn:(resources string:'oops, ''%1'' is gone or unreadable.' with:fileName). |
2666 | 2751 |
^ self |
2752 |
]. |
|
2753 |
f isReadable ifFalse:[ |
|
3528 | 2754 |
Dialog warn:(resources string:'''%1'' is unreadable.' with:fileName). |
2666 | 2755 |
^ self |
2756 |
]. |
|
2757 |
f fileSize > (512*1024) ifTrue:[ |
|
2758 |
(self confirm:'Warning: the file is big (', (f fileSize//1024) printString , 'Kb). Show anyway ?') |
|
2759 |
ifFalse:[ |
|
2760 |
^ self |
|
2761 |
] |
|
2762 |
]. |
|
2763 |
stream := f readStream binary. |
|
2764 |
data := stream contents. |
|
2765 |
stream close. |
|
2766 |
||
2767 |
subView list:nil. |
|
2768 |
col := 1. |
|
2769 |
offs := 0. |
|
2770 |
lines := StringCollection new. |
|
2771 |
||
2772 |
addrDigits := ((f fileSize + 1) log:16) truncated + 1. |
|
2773 |
||
2701
78171ebe64f5
less memory need for hexDump
Claus Gittinger <cg@exept.de>
parents:
2688
diff
changeset
|
2774 |
lineStream := '' writeStream. |
78171ebe64f5
less memory need for hexDump
Claus Gittinger <cg@exept.de>
parents:
2688
diff
changeset
|
2775 |
asciiLineStream := '' writeStream. |
78171ebe64f5
less memory need for hexDump
Claus Gittinger <cg@exept.de>
parents:
2688
diff
changeset
|
2776 |
|
78171ebe64f5
less memory need for hexDump
Claus Gittinger <cg@exept.de>
parents:
2688
diff
changeset
|
2777 |
lineStream nextPutAll:(offs hexPrintString:addrDigits). |
78171ebe64f5
less memory need for hexDump
Claus Gittinger <cg@exept.de>
parents:
2688
diff
changeset
|
2778 |
lineStream nextPutAll:': '. |
2666 | 2779 |
|
2780 |
data do:[:byte | |
|
2701
78171ebe64f5
less memory need for hexDump
Claus Gittinger <cg@exept.de>
parents:
2688
diff
changeset
|
2781 |
lineStream nextPutAll:(byte hexPrintString:2). |
2666 | 2782 |
(byte between:32 and:127) ifTrue:[ |
2701
78171ebe64f5
less memory need for hexDump
Claus Gittinger <cg@exept.de>
parents:
2688
diff
changeset
|
2783 |
asciiLineStream nextPut:(Character value:byte) |
2666 | 2784 |
] ifFalse:[ |
2701
78171ebe64f5
less memory need for hexDump
Claus Gittinger <cg@exept.de>
parents:
2688
diff
changeset
|
2785 |
asciiLineStream nextPut:$. |
2666 | 2786 |
]. |
2787 |
||
2788 |
offs := offs + 1. |
|
2789 |
col := col + 1. |
|
2790 |
col > 16 ifTrue:[ |
|
2701
78171ebe64f5
less memory need for hexDump
Claus Gittinger <cg@exept.de>
parents:
2688
diff
changeset
|
2791 |
lineStream nextPutAll:' '. |
78171ebe64f5
less memory need for hexDump
Claus Gittinger <cg@exept.de>
parents:
2688
diff
changeset
|
2792 |
lineStream nextPutAll:asciiLineStream contents. |
78171ebe64f5
less memory need for hexDump
Claus Gittinger <cg@exept.de>
parents:
2688
diff
changeset
|
2793 |
lines add:(lineStream contents). |
2666 | 2794 |
(offs bitAnd:16rFF) == 0 ifTrue:[ |
2795 |
lines add:nil |
|
2796 |
]. |
|
2701
78171ebe64f5
less memory need for hexDump
Claus Gittinger <cg@exept.de>
parents:
2688
diff
changeset
|
2797 |
lineStream reset. |
78171ebe64f5
less memory need for hexDump
Claus Gittinger <cg@exept.de>
parents:
2688
diff
changeset
|
2798 |
asciiLineStream reset. |
78171ebe64f5
less memory need for hexDump
Claus Gittinger <cg@exept.de>
parents:
2688
diff
changeset
|
2799 |
|
78171ebe64f5
less memory need for hexDump
Claus Gittinger <cg@exept.de>
parents:
2688
diff
changeset
|
2800 |
lineStream nextPutAll:(offs hexPrintString:addrDigits). |
78171ebe64f5
less memory need for hexDump
Claus Gittinger <cg@exept.de>
parents:
2688
diff
changeset
|
2801 |
lineStream nextPutAll:': '. |
2666 | 2802 |
col := 1. |
2803 |
] ifFalse:[ |
|
2701
78171ebe64f5
less memory need for hexDump
Claus Gittinger <cg@exept.de>
parents:
2688
diff
changeset
|
2804 |
lineStream space |
2666 | 2805 |
] |
2806 |
]. |
|
2701
78171ebe64f5
less memory need for hexDump
Claus Gittinger <cg@exept.de>
parents:
2688
diff
changeset
|
2807 |
line := lineStream contents paddedTo:(3*16 + addrDigits + 1). |
78171ebe64f5
less memory need for hexDump
Claus Gittinger <cg@exept.de>
parents:
2688
diff
changeset
|
2808 |
lines add:(line , ' ' , asciiLineStream contents). |
2666 | 2809 |
self show:lines. |
2810 |
] |
|
1874 | 2811 |
] |
2812 |
||
2813 |
"Modified: / 7.9.1998 / 15:37:47 / cg" |
|
2814 |
! |
|
2815 |
||
172 | 2816 |
fileInsert |
1162 | 2817 |
"insert contents of file at the cursor position" |
172 | 2818 |
|
2819 |
|fileName| |
|
2820 |
||
2821 |
fileName := self getSelectedFileName. |
|
2822 |
fileName notNil ifTrue:[ |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2823 |
self showFile:fileName insert:true encoding:fileEncoding |
172 | 2824 |
] |
386
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
2825 |
|
1162 | 2826 |
"Modified: 23.4.1997 / 13:06:06 / cg" |
172 | 2827 |
! |
2828 |
||
2829 |
fileListMenu |
|
2830 |
"return the menu to show in the fileList" |
|
2831 |
||
1235
13610578a5d2
resource flag: #menu -> #programMenu
Claus Gittinger <cg@exept.de>
parents:
1227
diff
changeset
|
2832 |
<resource: #programMenu> |
1040 | 2833 |
|
3330 | 2834 |
|spec| |
1834 | 2835 |
|
3002 | 2836 |
self sensor ctrlDown ifTrue:[ |
3330 | 2837 |
spec := self class toolsMenuSpec. |
3002 | 2838 |
] ifFalse:[ |
3330 | 2839 |
spec := self class menuPopUp. |
2840 |
]. |
|
2841 |
^ self menuFromSpec:spec. |
|
2842 |
"/ |m| |
|
2843 |
"/ |
|
2844 |
"/ self sensor ctrlDown ifTrue:[ |
|
2845 |
"/ m := self class toolsMenuSpec. |
|
2846 |
"/ ] ifFalse:[ |
|
2847 |
"/ m := self class menuPopUp. |
|
2848 |
"/ ]. |
|
2849 |
"/ m := m decodeAsLiteralArray. |
|
2850 |
"/ m receiver:self. |
|
2851 |
"/ m findGuiResourcesIn:self. |
|
2852 |
"/ ^ m. |
|
1834 | 2853 |
|
2854 |
"Modified: / 14.8.1998 / 14:09:12 / cg" |
|
2855 |
! |
|
2856 |
||
2857 |
fileListMenu_old |
|
2858 |
"return the menu to show in the fileList" |
|
2859 |
||
2860 |
<resource: #programMenu> |
|
2861 |
||
3527 | 2862 |
|items m sel ns| |
1736
36cab4d1d655
remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents:
1735
diff
changeset
|
2863 |
|
36cab4d1d655
remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents:
1735
diff
changeset
|
2864 |
items := #( |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2865 |
('spawn' fileSpawn ) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2866 |
('-' nil ) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2867 |
('get contents' fileGet GotoLine) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2868 |
('insert contents' fileInsert ) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2869 |
('show info' fileGetInfo InspectIt) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2870 |
('show full info' fileGetLongInfo CmdI) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2871 |
). |
1193
568b858d94ce
show current namespace in menus fileIn item
Claus Gittinger <cg@exept.de>
parents:
1189
diff
changeset
|
2872 |
|
568b858d94ce
show current namespace in menus fileIn item
Claus Gittinger <cg@exept.de>
parents:
1189
diff
changeset
|
2873 |
((ns := Project current defaultNameSpace) notNil |
568b858d94ce
show current namespace in menus fileIn item
Claus Gittinger <cg@exept.de>
parents:
1189
diff
changeset
|
2874 |
and:[ns ~~ Smalltalk]) ifTrue:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2875 |
items := items copyWith:(Array |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2876 |
with:(resources string:'fileIn (into ''%1'')' with:(Project current defaultNameSpace name)) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2877 |
with:#fileFileIn |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2878 |
with:#Accept) |
1736
36cab4d1d655
remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents:
1735
diff
changeset
|
2879 |
|
1193
568b858d94ce
show current namespace in menus fileIn item
Claus Gittinger <cg@exept.de>
parents:
1189
diff
changeset
|
2880 |
] ifFalse:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2881 |
items := items copyWith:#( 'fileIn' #fileFileIn #Accept) |
1193
568b858d94ce
show current namespace in menus fileIn item
Claus Gittinger <cg@exept.de>
parents:
1189
diff
changeset
|
2882 |
]. |
568b858d94ce
show current namespace in menus fileIn item
Claus Gittinger <cg@exept.de>
parents:
1189
diff
changeset
|
2883 |
|
1736
36cab4d1d655
remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents:
1735
diff
changeset
|
2884 |
items := items , #( |
3448
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 |
('update' updateCurrentDirectory Cmdu) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2887 |
('-' ) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2888 |
('execute unix command ...' fileExecute DoIt) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2889 |
('st/x tools' stxTools ) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2890 |
('-' ) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2891 |
('remove' fileRemove Delete) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2892 |
('rename ...' fileRename ) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2893 |
('-' ) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2894 |
('display long list' changeDisplayMode ) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2895 |
('show all files' changeDotFileVisibility ) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2896 |
('encoding ...' fileEncoding ) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2897 |
('-' ) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2898 |
('create directory ...' newDirectory CmdD) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2899 |
('create file ...' newFile CmdF) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2900 |
). |
172 | 2901 |
|
2902 |
m := PopUpMenu |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2903 |
itemList:items |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2904 |
resources:resources. |
172 | 2905 |
|
1834 | 2906 |
showingHiddenFiles value "showDotFiles" ifTrue:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2907 |
m labelAt:#changeDotFileVisibility put:(resources string:'hide hidden files') |
172 | 2908 |
]. |
1834 | 2909 |
showingDetails value "showLongList" ifTrue:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2910 |
m labelAt:#changeDisplayMode put:(resources string:'display short list') |
172 | 2911 |
]. |
2912 |
||
1736
36cab4d1d655
remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents:
1735
diff
changeset
|
2913 |
items := #( |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2914 |
('Changes browser' openChangesBrowser ) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2915 |
('Editor' openEditor ) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2916 |
('HTML reader' openHTMLReader ) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2917 |
('Image inspect' openImageInspector ) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2918 |
('show file differences' openDiffView ) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2919 |
). |
1286
2a464093d865
added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents:
1272
diff
changeset
|
2920 |
|
1751 | 2921 |
OperatingSystem isUNIXlike ifTrue:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2922 |
items := items , #( ('terminal' openTerminal )). |
1751 | 2923 |
]. |
2924 |
||
1286
2a464093d865
added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents:
1272
diff
changeset
|
2925 |
JavaInterpreter notNil ifTrue:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2926 |
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
|
2927 |
]. |
2a464093d865
added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents:
1272
diff
changeset
|
2928 |
|
2a464093d865
added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents:
1272
diff
changeset
|
2929 |
m subMenuAt:#stxTools |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2930 |
put:(PopUpMenu |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2931 |
itemList:items |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2932 |
resources:resources). |
1736
36cab4d1d655
remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents:
1735
diff
changeset
|
2933 |
|
36cab4d1d655
remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents:
1735
diff
changeset
|
2934 |
((sel := fileListView selection) isNil |
36cab4d1d655
remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents:
1735
diff
changeset
|
2935 |
or:[sel isEmpty]) ifTrue:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2936 |
m disableAll:#(fileGet fileInsert |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2937 |
fileGetInfo fileGetLongInfo |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2938 |
fileFileIn fileFileInLazy |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2939 |
fileRemove fileRename). |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2940 |
(m subMenuAt:#stxTools) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2941 |
disableAll:#(openChangesBrowser openEditor openHTMLReader openImageInspector) |
865
48395e8ecca9
remember executeCommand actions in history as well.
Claus Gittinger <cg@exept.de>
parents:
851
diff
changeset
|
2942 |
] ifFalse:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2943 |
fileListView selection size > 1 ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2944 |
m disableAll:#( fileGet fileInsert fileGetInfo fileGetLongInfo fileRename ) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2945 |
] |
172 | 2946 |
]. |
2947 |
||
2948 |
^m |
|
252 | 2949 |
|
1396 | 2950 |
"Modified: / 16.1.1998 / 16:42:59 / stefan" |
1834 | 2951 |
"Modified: / 4.8.1998 / 13:45:56 / cg" |
2952 |
"Created: / 13.8.1998 / 20:51:38 / cg" |
|
172 | 2953 |
! |
2954 |
||
2955 |
filePrint |
|
1162 | 2956 |
"send a files contents to the printer (not in the menu)" |
2957 |
||
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
2958 |
|fileName path inStream printStream line| |
172 | 2959 |
|
294 | 2960 |
self withWaitCursorDo:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2961 |
fileName := self getSelectedFileName. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2962 |
fileName notNil ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2963 |
path := currentDirectory filenameFor:fileName. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2964 |
(path type == #regular) ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2965 |
inStream := path readStream. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2966 |
inStream isNil ifFalse:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2967 |
printStream := PrinterStream new. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2968 |
printStream notNil ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2969 |
[inStream atEnd] whileFalse:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2970 |
line := inStream nextLine. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2971 |
printStream nextPutLine:line. |
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 |
printStream 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 |
inStream close |
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 |
] |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2978 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
2979 |
0 "compiler hint" |
172 | 2980 |
] |
294 | 2981 |
|
1162 | 2982 |
"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
|
2983 |
"Modified: 18.9.1997 / 16:29:17 / stefan" |
172 | 2984 |
! |
2985 |
||
2986 |
fileRemove |
|
2987 |
"remove the selected file(s). |
|
3281 | 2988 |
Query if user really wants to remove the file, except if |
2989 |
shift-key is pressed. |
|
2990 |
TODO: Should be enhanced, to look for a ~/.trash directory |
|
2991 |
and move files there if it exists (without asking in this case)." |
|
2992 |
||
2993 |
|sel| |
|
172 | 2994 |
|
2094 | 2995 |
sel := fileListView selection. |
2996 |
sel size > 0 ifTrue:[ |
|
2868 | 2997 |
sel := sel collect:[:rawIndex | fileList at:rawIndex]. |
3281 | 2998 |
"/ do not ask, if shift is pressed |
2999 |
self sensor shiftDown ifTrue:[ |
|
3000 |
self doRemove:sel |
|
2868 | 3001 |
] ifFalse:[ |
3281 | 3002 |
self confirmAndRemove:sel |
2868 | 3003 |
]. |
3281 | 3004 |
] |
3005 |
! |
|
3006 |
||
3007 |
fileRemove:fileNames |
|
3008 |
"remove fileNames. |
|
3009 |
Query if user really wants to remove the file, except if |
|
3010 |
shift-key is pressed. |
|
3011 |
TODO: Should be enhanced, to look for a ~/.trash directory |
|
3012 |
and move files there if it exists (without asking in this case)." |
|
3013 |
||
3014 |
|q doRemove| |
|
3015 |
||
3016 |
"/ do not ask, if shift is pressed |
|
3017 |
doRemove := self sensor shiftDown. |
|
3018 |
doRemove ifFalse:[ |
|
3019 |
fileNames size > 1 ifTrue:[ |
|
3020 |
q := resources string:'Remove %1 selected files ?' with:(fileNames size). |
|
3021 |
doRemove := Dialog |
|
3022 |
confirmWithCancel:q |
|
3023 |
labels:(resources array:#('Remove' 'Confirm Each' 'Cancel')) |
|
3024 |
values:#(true #confirm false) |
|
3025 |
default:true. |
|
3026 |
doRemove == #confirm ifTrue:[ |
|
3527 | 3027 |
self halt:'Confirm each not yet implemented'. |
3281 | 3028 |
]. |
3029 |
] ifFalse:[ |
|
3030 |
q := resources string:'Remove ''%1'' ?' with:(fileNames first allBold). |
|
3031 |
doRemove := self ask:q yesButton:'Remove'. |
|
3032 |
]. |
|
3033 |
]. |
|
3034 |
||
3035 |
doRemove ifTrue:[ |
|
3036 |
self withWaitCursorDo:[ |
|
3037 |
self doRemove:fileNames |
|
2868 | 3038 |
] |
172 | 3039 |
] |
3040 |
! |
|
3041 |
||
3042 |
fileRename |
|
3043 |
"rename the selected file(s)" |
|
3044 |
||
3565 | 3045 |
|queryBox b lastNewName lastOldName initialText| |
172 | 3046 |
|
3047 |
queryBox := FilenameEnterBox new. |
|
3280 | 3048 |
queryBox okText:(resources at:'Rename'). |
3059
ced4d5b13ad2
cancelAll if renaming multiple files
Claus Gittinger <cg@exept.de>
parents:
3045
diff
changeset
|
3049 |
fileListView selection size > 1 ifTrue:[ |
3697
e2f7d8dec6e2
menu items/button labels uppercase-first
Claus Gittinger <cg@exept.de>
parents:
3691
diff
changeset
|
3050 |
b := queryBox addAbortButtonLabelled:(resources at:'Cancel All'). |
3059
ced4d5b13ad2
cancelAll if renaming multiple files
Claus Gittinger <cg@exept.de>
parents:
3045
diff
changeset
|
3051 |
b action:[^ self ]. |
ced4d5b13ad2
cancelAll if renaming multiple files
Claus Gittinger <cg@exept.de>
parents:
3045
diff
changeset
|
3052 |
]. |
ced4d5b13ad2
cancelAll if renaming multiple files
Claus Gittinger <cg@exept.de>
parents:
3045
diff
changeset
|
3053 |
|
172 | 3054 |
self selectedFilesDo:[:oldName | |
3280 | 3055 |
queryBox title:(resources string:'Rename ''%1'' to:' with:oldName). |
3066
7daebd50006e
intelligent default in rename
Claus Gittinger <cg@exept.de>
parents:
3061
diff
changeset
|
3056 |
initialText := oldName. |
7daebd50006e
intelligent default in rename
Claus Gittinger <cg@exept.de>
parents:
3061
diff
changeset
|
3057 |
|
3556 | 3058 |
lastNewName notNil ifTrue:[ |
3059
ced4d5b13ad2
cancelAll if renaming multiple files
Claus Gittinger <cg@exept.de>
parents:
3045
diff
changeset
|
3059 |
"/ intelligent default ... |
3565 | 3060 |
initialText := self goodRenameDefaultFor:oldName lastOld:lastOldName lastNew:lastNewName |
3059
ced4d5b13ad2
cancelAll if renaming multiple files
Claus Gittinger <cg@exept.de>
parents:
3045
diff
changeset
|
3061 |
]. |
3565 | 3062 |
queryBox initialText:(initialText ? oldName). |
3059
ced4d5b13ad2
cancelAll if renaming multiple files
Claus Gittinger <cg@exept.de>
parents:
3045
diff
changeset
|
3063 |
queryBox action:[:newName | |
3060 | 3064 |
fileListView removeFromSelection:(fileList indexOf:oldName). |
3059
ced4d5b13ad2
cancelAll if renaming multiple files
Claus Gittinger <cg@exept.de>
parents:
3045
diff
changeset
|
3065 |
self doRename:oldName to:newName. |
ced4d5b13ad2
cancelAll if renaming multiple files
Claus Gittinger <cg@exept.de>
parents:
3045
diff
changeset
|
3066 |
lastOldName := oldName. |
ced4d5b13ad2
cancelAll if renaming multiple files
Claus Gittinger <cg@exept.de>
parents:
3045
diff
changeset
|
3067 |
lastNewName := newName. |
ced4d5b13ad2
cancelAll if renaming multiple files
Claus Gittinger <cg@exept.de>
parents:
3045
diff
changeset
|
3068 |
]. |
ced4d5b13ad2
cancelAll if renaming multiple files
Claus Gittinger <cg@exept.de>
parents:
3045
diff
changeset
|
3069 |
|
ced4d5b13ad2
cancelAll if renaming multiple files
Claus Gittinger <cg@exept.de>
parents:
3045
diff
changeset
|
3070 |
queryBox showAtPointer |
172 | 3071 |
] |
3072 |
! |
|
3073 |
||
3074 |
fileSelect:lineNr |
|
3075 |
"selected a file - do nothing here" |
|
1162 | 3076 |
|
2094 | 3077 |
|fn| |
3078 |
||
2095 | 3079 |
imagePreviewView notNil ifTrue:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3080 |
self stopImageRenderProcess. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3081 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3082 |
fn := self getSelectedFileName. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3083 |
(Image isImageFileSuffix:(fn asFilename suffix)) ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3084 |
imageRenderProcess := [ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3085 |
self loadImageAndPerform:[:img | |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3086 |
imagePreviewView beVisible. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3087 |
imagePreviewView image:img |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3088 |
] |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3089 |
] forkAt:(Processor activePriority - 1). |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3090 |
] ifFalse:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3091 |
imagePreviewView beInvisible |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3092 |
]. |
2095 | 3093 |
] |
1162 | 3094 |
|
3095 |
"Modified: 23.4.1997 / 13:04:55 / cg" |
|
172 | 3096 |
! |
3097 |
||
3098 |
fileSpawn |
|
3099 |
"start another FileBrowser on the selected directory or |
|
3100 |
on the same directory if none is selected." |
|
3101 |
||
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
3102 |
|any path| |
172 | 3103 |
|
3104 |
any := false. |
|
3105 |
self selectedFilesDo:[:fileName | |
|
3025 | 3106 |
path := currentDirectory filenameFor:fileName. |
3107 |
path isDirectory ifTrue:[ |
|
3108 |
self class openOn:(path pathName). |
|
3109 |
any := true |
|
3110 |
] |
|
172 | 3111 |
]. |
3112 |
any ifFalse:[ |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3113 |
"/ access by name, to get most up-to-date version |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3114 |
"/ (if changed in the browser, and the running one is old) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3115 |
(Smalltalk at:(self class name)) |
3747
d30bc1e54f15
Remove unused vars and asFilename sends
Stefan Vogel <sv@exept.de>
parents:
3746
diff
changeset
|
3116 |
openOn:currentDirectory withExtent:self topView extent |
172 | 3117 |
] |
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
3118 |
|
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
3119 |
"Modified: 18.9.1997 / 16:32:39 / stefan" |
172 | 3120 |
! |
3121 |
||
3565 | 3122 |
goodRenameDefaultFor:oldName lastOld:lastOldName lastNew:lastNewName |
3636 | 3123 |
|prefix suffix lastNewSize lastOldSize t |
3635 | 3124 |
lastOldWOSuffix lastNewWOSuffix oldWOSuffix lastOldRest oldRest lastNewRest |
3125 |
lastRemoved lastInserted| |
|
3565 | 3126 |
|
3127 |
lastNewName isNil ifTrue:[ ^ nil]. |
|
3128 |
||
3129 |
lastNewSize := lastNewName size. |
|
3130 |
lastOldSize := lastOldName size. |
|
3131 |
||
3132 |
"/ intelligent default ... |
|
3133 |
(lastNewName endsWith:lastOldName) ifTrue:[ |
|
3134 |
prefix := lastNewName copyTo:(lastNewSize - lastOldSize). |
|
3135 |
^ (prefix , oldName). |
|
3136 |
]. |
|
3137 |
(lastOldName endsWith:lastNewName) ifTrue:[ |
|
3138 |
prefix := lastOldName copyTo:(lastOldSize - lastNewSize). |
|
3139 |
^ (oldName copyFrom:prefix size+1). |
|
3140 |
]. |
|
3141 |
(lastOldName withoutSeparators = lastNewName) ifTrue:[ |
|
3142 |
"/ intelligent default ... |
|
3143 |
^ oldName withoutSeparators. |
|
3144 |
]. |
|
3145 |
(lastNewName startsWith:lastOldName) ifTrue:[ |
|
3146 |
"/ intelligent default ... |
|
3147 |
suffix := lastNewName copyLast:(lastNewSize - lastOldSize). |
|
3148 |
^ (oldName , suffix). |
|
3149 |
]. |
|
3150 |
(lastOldName startsWith:lastNewName) ifTrue:[ |
|
3151 |
suffix := lastOldName copyLast:(lastOldSize - lastNewSize). |
|
3152 |
(oldName endsWith:suffix) ifTrue:[ |
|
3153 |
^ (oldName copyWithoutLast:suffix size). |
|
3154 |
] |
|
3155 |
]. |
|
3156 |
||
3157 |
lastOldWOSuffix := lastOldName asFilename withoutSuffix name. |
|
3158 |
lastNewWOSuffix := lastNewName asFilename withoutSuffix name. |
|
3159 |
oldWOSuffix := oldName asFilename withoutSuffix name. |
|
3160 |
||
3636 | 3161 |
prefix := lastOldWOSuffix commonPrefixWith:oldWOSuffix. |
3565 | 3162 |
(lastNewWOSuffix startsWith:prefix) ifTrue:[ |
3163 |
lastOldRest := lastOldWOSuffix copyFrom:prefix size + 1. |
|
3164 |
lastNewRest := lastNewWOSuffix copyFrom:prefix size + 1. |
|
3165 |
oldRest := oldWOSuffix copyFrom:prefix size + 1. |
|
3166 |
||
3167 |
(lastNewRest endsWith:lastOldRest) ifTrue:[ |
|
3168 |
t := lastNewRest copyWithoutLast:lastOldRest size. |
|
3169 |
^ ((prefix , t , oldRest) asFilename withSuffix:oldName asFilename suffix) name |
|
3170 |
]. |
|
3171 |
]. |
|
3172 |
||
3636 | 3173 |
suffix := lastOldWOSuffix commonSuffixWith:lastNewWOSuffix. |
3635 | 3174 |
suffix size > 0 ifTrue:[ |
3175 |
"/ last change changed something at the beginning |
|
3636 | 3176 |
prefix := oldWOSuffix commonPrefixWith:lastOldWOSuffix. |
3635 | 3177 |
prefix size > 0 ifTrue:[ |
3178 |
"/ this name starts with the same characters |
|
3179 |
lastRemoved := lastOldWOSuffix copyWithoutLast:suffix size. |
|
3180 |
lastInserted := lastNewWOSuffix copyWithoutLast:suffix size. |
|
3181 |
^ lastInserted , (oldName copyFrom:lastRemoved size + 1) |
|
3182 |
]. |
|
3183 |
]. |
|
3184 |
||
3565 | 3185 |
^ nil |
3186 |
! |
|
3187 |
||
3536 | 3188 |
hasSlideShow |
3189 |
^ [CodingExamples_GUI::SlideShow notNil] |
|
3190 |
||
3191 |
"Created: / 29.12.2001 / 21:58:47 / cg" |
|
3192 |
"Modified: / 29.12.2001 / 21:59:01 / cg" |
|
3193 |
! |
|
3194 |
||
1964 | 3195 |
loadImageAndPerform:aSelectorOrBlock |
1853 | 3196 |
|img path| |
3197 |
||
3198 |
self selectedFilesDo:[:fileName | |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3199 |
path := currentDirectory filenameFor:fileName. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3200 |
path isDirectory ifFalse:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3201 |
img := Image fromFile:(path pathName). |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3202 |
img notNil ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3203 |
aSelectorOrBlock isSymbol ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3204 |
img perform:aSelectorOrBlock |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3205 |
] ifFalse:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3206 |
aSelectorOrBlock value:img |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3207 |
] |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3208 |
] ifFalse:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3209 |
self warn:'unknown format: ' , fileName |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3210 |
] |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3211 |
] |
1853 | 3212 |
]. |
3213 |
||
3214 |
"Modified: / 17.9.1995 / 17:41:24 / claus" |
|
3215 |
"Modified: / 18.9.1997 / 17:05:04 / stefan" |
|
3216 |
"Created: / 26.8.1998 / 16:20:18 / cg" |
|
3217 |
! |
|
3218 |
||
172 | 3219 |
newDirectory |
3220 |
"ask for and create a new directory" |
|
3221 |
||
3222 |
|queryBox| |
|
3223 |
||
3224 |
queryBox := FilenameEnterBox |
|
3280 | 3225 |
title:(resources at:'Create new directory:') withCRs |
3226 |
okText:(resources at:'Create') |
|
3227 |
action:[:newName | self doCreateDirectory:newName]. |
|
172 | 3228 |
queryBox showAtPointer |
1162 | 3229 |
|
3230 |
"Modified: 23.4.1997 / 13:04:27 / cg" |
|
172 | 3231 |
! |
3232 |
||
3233 |
newFile |
|
3234 |
"ask for and create a new file" |
|
3235 |
||
3236 |
|sel queryBox| |
|
3237 |
||
3238 |
queryBox := FilenameEnterBox |
|
3280 | 3239 |
title:(resources at:'Create new file:') withCRs |
3240 |
okText:(resources at:'Create') |
|
2512
35d2092df60f
autoselect a new created file
Claus Gittinger <cg@exept.de>
parents:
2504
diff
changeset
|
3241 |
action:[:newName | newName isEmpty ifFalse:[ |
35d2092df60f
autoselect a new created file
Claus Gittinger <cg@exept.de>
parents:
2504
diff
changeset
|
3242 |
self doCreateFile:newName. |
35d2092df60f
autoselect a new created file
Claus Gittinger <cg@exept.de>
parents:
2504
diff
changeset
|
3243 |
self selectFile:newName. |
35d2092df60f
autoselect a new created file
Claus Gittinger <cg@exept.de>
parents:
2504
diff
changeset
|
3244 |
] |
35d2092df60f
autoselect a new created file
Claus Gittinger <cg@exept.de>
parents:
2504
diff
changeset
|
3245 |
]. |
172 | 3246 |
sel := subView selection. |
3247 |
sel notNil ifTrue:[ |
|
2512
35d2092df60f
autoselect a new created file
Claus Gittinger <cg@exept.de>
parents:
2504
diff
changeset
|
3248 |
queryBox initialText:(sel asString) |
172 | 3249 |
]. |
3250 |
queryBox showAtPointer |
|
381 | 3251 |
|
1396 | 3252 |
"Modified: / 23.4.1997 / 13:04:38 / cg" |
3253 |
"Modified: / 16.1.1998 / 16:54:00 / stefan" |
|
172 | 3254 |
! |
3255 |
||
1834 | 3256 |
newHardLink |
3257 |
"ask for and create a hard link (unix only)" |
|
3258 |
||
3747
d30bc1e54f15
Remove unused vars and asFilename sends
Stefan Vogel <sv@exept.de>
parents:
3746
diff
changeset
|
3259 |
|sel box orgName1 name1 name2 f1 f2 err if1 if2| |
1834 | 3260 |
|
3261 |
sel := self getSelectedFileName. |
|
3262 |
||
3263 |
orgName1 := ''. |
|
3264 |
(sel size > 0) ifTrue:[ |
|
2868 | 3265 |
(currentDirectory construct:sel) isDirectory ifFalse:[ |
3266 |
orgName1 := sel |
|
3267 |
] |
|
1834 | 3268 |
]. |
3269 |
||
3270 |
name1 := orgName1 asValue. |
|
3271 |
name2 := '' asValue. |
|
3272 |
||
3273 |
box := DialogBox new. |
|
2035
307ed5143d8b
national language stuff - again
Claus Gittinger <cg@exept.de>
parents:
2031
diff
changeset
|
3274 |
(box addTextLabel:(resources string:'Create hard link from:')) adjust:#left. |
3747
d30bc1e54f15
Remove unused vars and asFilename sends
Stefan Vogel <sv@exept.de>
parents:
3746
diff
changeset
|
3275 |
if1 := box addFilenameInputFieldOn:name1 in:currentDirectory tabable:true. |
2035
307ed5143d8b
national language stuff - again
Claus Gittinger <cg@exept.de>
parents:
2031
diff
changeset
|
3276 |
(box addTextLabel:(resources string:'to:')) adjust:#left. |
3747
d30bc1e54f15
Remove unused vars and asFilename sends
Stefan Vogel <sv@exept.de>
parents:
3746
diff
changeset
|
3277 |
if2 := box addFilenameInputFieldOn:name2 in:currentDirectory tabable:true. |
1834 | 3278 |
|
2048 | 3279 |
box addAbortAndOkButtons. |
1834 | 3280 |
|
3281 |
orgName1 size > 0 ifTrue:[ |
|
2868 | 3282 |
box focusOnField:if2. |
1834 | 3283 |
]. |
3284 |
box showAtPointer. |
|
3285 |
||
3286 |
box accepted ifTrue:[ |
|
2868 | 3287 |
name1 := name1 value. |
3288 |
(name1 size == 0) ifTrue:[ |
|
3289 |
err := 'no name entered'. |
|
3290 |
] ifFalse:[ |
|
3291 |
f1 := name1 asFilename. |
|
3292 |
name2 := name2 value. |
|
3293 |
(name2 size == 0) ifTrue:[ |
|
3294 |
err := 'no name entered'. |
|
3295 |
] ifFalse:[ |
|
3296 |
f2 := name2 asFilename. |
|
3297 |
f2 exists ifTrue:[ |
|
3298 |
err := '''%2'' already exists'. |
|
3299 |
] ifFalse:[ |
|
3300 |
f1 exists ifFalse:[ |
|
3301 |
err := '''%1'' does not exist'. |
|
3302 |
] ifTrue:[ |
|
3303 |
f1 isDirectory ifTrue:[ |
|
3304 |
err := '''%1'' is a directory'. |
|
3305 |
] ifFalse:[ |
|
3306 |
ErrorSignal handle:[:ex | |
|
3307 |
err := ex errorString |
|
3308 |
] do:[ |
|
3309 |
OperatingSystem createHardLinkFrom:name1 to:name2 |
|
3310 |
] |
|
3311 |
] |
|
3312 |
] |
|
3313 |
] |
|
3314 |
] |
|
3315 |
]. |
|
3316 |
||
3317 |
err notNil ifTrue:[ |
|
3318 |
self warn:(resources string:err with:(name1 ? '') allBold with:(name2 ? '') allBold). |
|
3319 |
^ self |
|
3320 |
]. |
|
1834 | 3321 |
]. |
3322 |
||
3323 |
"Modified: / 13.8.1998 / 21:47:01 / cg" |
|
3324 |
! |
|
3325 |
||
3326 |
newSoftLink |
|
3327 |
"ask for and create a soft link (unix only)" |
|
3328 |
||
3747
d30bc1e54f15
Remove unused vars and asFilename sends
Stefan Vogel <sv@exept.de>
parents:
3746
diff
changeset
|
3329 |
|sel box orgName1 name1 name2 f1 f2 err if1 if2| |
1834 | 3330 |
|
3331 |
sel := self getSelectedFileName. |
|
3332 |
||
3333 |
orgName1 := ''. |
|
3334 |
(sel size > 0) ifTrue:[ |
|
2868 | 3335 |
orgName1 := sel |
1834 | 3336 |
]. |
3337 |
||
3338 |
name1 := orgName1 asValue. |
|
3339 |
name2 := '' asValue. |
|
3340 |
||
3341 |
box := DialogBox new. |
|
3342 |
(box addTextLabel:'Create symbolic link to:') adjust:#left. |
|
3747
d30bc1e54f15
Remove unused vars and asFilename sends
Stefan Vogel <sv@exept.de>
parents:
3746
diff
changeset
|
3343 |
if1 := box addFilenameInputFieldOn:name1 in:currentDirectory tabable:true. |
1834 | 3344 |
(box addTextLabel:'as:') adjust:#left. |
3747
d30bc1e54f15
Remove unused vars and asFilename sends
Stefan Vogel <sv@exept.de>
parents:
3746
diff
changeset
|
3345 |
if2 := box addFilenameInputFieldOn:name2 in:currentDirectory tabable:true. |
1834 | 3346 |
|
2048 | 3347 |
box addAbortAndOkButtons. |
1834 | 3348 |
|
3349 |
orgName1 size > 0 ifTrue:[ |
|
2868 | 3350 |
box focusOnField:if2. |
1834 | 3351 |
]. |
3352 |
box showAtPointer. |
|
3353 |
||
3354 |
box accepted ifTrue:[ |
|
2868 | 3355 |
name1 := name1 value. |
3356 |
(name1 size == 0) ifTrue:[ |
|
3357 |
err := 'no name entered'. |
|
3358 |
] ifFalse:[ |
|
3359 |
f1 := name1 asFilename. |
|
3360 |
name2 := name2 value. |
|
3361 |
(name2 size == 0) ifTrue:[ |
|
3362 |
err := 'no name entered'. |
|
3363 |
] ifFalse:[ |
|
3364 |
f2 := name2 asFilename. |
|
3365 |
f2 exists ifTrue:[ |
|
3366 |
err := '''%2'' already exists'. |
|
3367 |
] ifFalse:[ |
|
3368 |
f1 exists ifFalse:[ |
|
3369 |
err := '''%1'' does not exist (link created anyway)'. |
|
3370 |
]. |
|
3371 |
ErrorSignal handle:[:ex | |
|
3372 |
err := ex errorString |
|
3373 |
] do:[ |
|
3374 |
OperatingSystem createSymbolicLinkFrom:name1 to:name2 |
|
3375 |
] |
|
3376 |
] |
|
3377 |
] |
|
3378 |
]. |
|
3379 |
||
3380 |
err notNil ifTrue:[ |
|
3381 |
self warn:(resources string:err with:(name1 ? '') allBold with:(name2 ? '') allBold). |
|
3382 |
^ self |
|
3383 |
]. |
|
1834 | 3384 |
]. |
3385 |
||
3386 |
"Modified: / 13.8.1998 / 21:26:59 / cg" |
|
3387 |
"Created: / 13.8.1998 / 21:47:14 / cg" |
|
3388 |
! |
|
3389 |
||
2186 | 3390 |
openASN1Browser |
3391 |
self openTool:OSI::ASN1Browser |
|
3392 |
||
3393 |
"Modified: / 7.9.1998 / 21:31:58 / cg" |
|
3394 |
! |
|
3395 |
||
1286
2a464093d865
added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents:
1272
diff
changeset
|
3396 |
openAppletViewer |
2a464093d865
added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents:
1272
diff
changeset
|
3397 |
|numItems| |
2a464093d865
added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents:
1272
diff
changeset
|
3398 |
|
2a464093d865
added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents:
1272
diff
changeset
|
3399 |
(numItems := fileListView selection size) > 2 ifTrue:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3400 |
(self |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3401 |
confirm:(resources string:'open for each of the %1 items ?' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3402 |
with:numItems)) ifFalse:[^ self]. |
1286
2a464093d865
added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents:
1272
diff
changeset
|
3403 |
]. |
2a464093d865
added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents:
1272
diff
changeset
|
3404 |
|
1942 | 3405 |
Java startupJavaSystem. |
3406 |
"/ Java markAllClassesUninitialized. |
|
3407 |
"/ Java initAllStaticFields. |
|
3408 |
"/ Java initAllClasses. |
|
1286
2a464093d865
added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents:
1272
diff
changeset
|
3409 |
|
2a464093d865
added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents:
1272
diff
changeset
|
3410 |
self selectedFilesDo:[:fileName | |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3411 |
|p path| |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3412 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3413 |
path := currentDirectory filenameFor:fileName. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3414 |
path isDirectory ifFalse:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3415 |
p := Java |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3416 |
javaProcessForMainOf:(Java classForName:'sun.applet.AppletViewer') |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3417 |
argumentString:path pathName. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3418 |
p resume. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3419 |
] |
1286
2a464093d865
added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents:
1272
diff
changeset
|
3420 |
]. |
2a464093d865
added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents:
1272
diff
changeset
|
3421 |
|
1942 | 3422 |
"Modified: / 18.9.1997 / 17:00:59 / stefan" |
3423 |
"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
|
3424 |
! |
2a464093d865
added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents:
1272
diff
changeset
|
3425 |
|
2814 | 3426 |
openCBrowser |
3272 | 3427 |
self withWaitCursorDo:[ |
3428 |
CC::Browser openIn:currentDirectory. |
|
3429 |
] |
|
2814 | 3430 |
! |
3431 |
||
172 | 3432 |
openChangesBrowser |
3433 |
"open a change browser on the selected file(s)" |
|
3434 |
||
1939
5947fefec5af
care for newChangesBrowser setting
Claus Gittinger <cg@exept.de>
parents:
1933
diff
changeset
|
3435 |
self openTool:(UserPreferences current changesBrowserClass) |
5947fefec5af
care for newChangesBrowser setting
Claus Gittinger <cg@exept.de>
parents:
1933
diff
changeset
|
3436 |
|
5947fefec5af
care for newChangesBrowser setting
Claus Gittinger <cg@exept.de>
parents:
1933
diff
changeset
|
3437 |
"Modified: / 17.10.1998 / 14:39:15 / cg" |
172 | 3438 |
! |
3439 |
||
252 | 3440 |
openDiffView |
3441 |
"open a diff-view" |
|
3442 |
||
1736
36cab4d1d655
remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents:
1735
diff
changeset
|
3443 |
|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
|
3444 |
|
2969
1ec854b0f2fd
openDiff-viewer - allow two-file-selection
Claus Gittinger <cg@exept.de>
parents:
2956
diff
changeset
|
3445 |
sel := fileListView selection. |
1ec854b0f2fd
openDiff-viewer - allow two-file-selection
Claus Gittinger <cg@exept.de>
parents:
2956
diff
changeset
|
3446 |
(sel size == 2) ifTrue:[ |
1ec854b0f2fd
openDiff-viewer - allow two-file-selection
Claus Gittinger <cg@exept.de>
parents:
2956
diff
changeset
|
3447 |
name1 := fileList at:sel first. |
1ec854b0f2fd
openDiff-viewer - allow two-file-selection
Claus Gittinger <cg@exept.de>
parents:
2956
diff
changeset
|
3448 |
name2 := fileList at:sel last. |
1ec854b0f2fd
openDiff-viewer - allow two-file-selection
Claus Gittinger <cg@exept.de>
parents:
2956
diff
changeset
|
3449 |
] ifFalse:[ |
1ec854b0f2fd
openDiff-viewer - allow two-file-selection
Claus Gittinger <cg@exept.de>
parents:
2956
diff
changeset
|
3450 |
sel := self getSelectedFileName. |
1ec854b0f2fd
openDiff-viewer - allow two-file-selection
Claus Gittinger <cg@exept.de>
parents:
2956
diff
changeset
|
3451 |
|
1ec854b0f2fd
openDiff-viewer - allow two-file-selection
Claus Gittinger <cg@exept.de>
parents:
2956
diff
changeset
|
3452 |
orgName1 := ''. |
1ec854b0f2fd
openDiff-viewer - allow two-file-selection
Claus Gittinger <cg@exept.de>
parents:
2956
diff
changeset
|
3453 |
(sel size > 0 |
1ec854b0f2fd
openDiff-viewer - allow two-file-selection
Claus Gittinger <cg@exept.de>
parents:
2956
diff
changeset
|
3454 |
and:[lastFileDiffDirectory notNil |
1ec854b0f2fd
openDiff-viewer - allow two-file-selection
Claus Gittinger <cg@exept.de>
parents:
2956
diff
changeset
|
3455 |
and:[lastFileDiffDirectory asFilename isDirectory]]) ifTrue:[ |
1ec854b0f2fd
openDiff-viewer - allow two-file-selection
Claus Gittinger <cg@exept.de>
parents:
2956
diff
changeset
|
3456 |
f := lastFileDiffDirectory asFilename construct:sel. |
1ec854b0f2fd
openDiff-viewer - allow two-file-selection
Claus Gittinger <cg@exept.de>
parents:
2956
diff
changeset
|
3457 |
(f exists |
1ec854b0f2fd
openDiff-viewer - allow two-file-selection
Claus Gittinger <cg@exept.de>
parents:
2956
diff
changeset
|
3458 |
and:[f isReadable]) ifTrue:[ |
1ec854b0f2fd
openDiff-viewer - allow two-file-selection
Claus Gittinger <cg@exept.de>
parents:
2956
diff
changeset
|
3459 |
orgName1 := f name |
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 |
]. |
1ec854b0f2fd
openDiff-viewer - allow two-file-selection
Claus Gittinger <cg@exept.de>
parents:
2956
diff
changeset
|
3462 |
name1 := orgName1 asValue. |
1ec854b0f2fd
openDiff-viewer - allow two-file-selection
Claus Gittinger <cg@exept.de>
parents:
2956
diff
changeset
|
3463 |
name2 := self getSelectedFileName asValue. |
1ec854b0f2fd
openDiff-viewer - allow two-file-selection
Claus Gittinger <cg@exept.de>
parents:
2956
diff
changeset
|
3464 |
]. |
1ec854b0f2fd
openDiff-viewer - allow two-file-selection
Claus Gittinger <cg@exept.de>
parents:
2956
diff
changeset
|
3465 |
|
252 | 3466 |
here := currentDirectory pathName. |
3467 |
||
3468 |
box := DialogBox new. |
|
1852 | 3469 |
(box addTextLabel:'show difference between:\\file1 (empty for views contents):' withCRs) adjust:#left. |
252 | 3470 |
box addFilenameInputFieldOn:name1 in:here tabable:true. |
1852 | 3471 |
(box addTextLabel:'and file2:') adjust:#left. |
252 | 3472 |
box addFilenameInputFieldOn:name2 in:here tabable:true. |
3473 |
||
2048 | 3474 |
box addAbortAndOkButtons. |
252 | 3475 |
|
3476 |
box showAtPointer. |
|
3477 |
||
3478 |
box accepted ifTrue:[ |
|
2140
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3479 |
name1 := name1 value. |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3480 |
(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
|
3481 |
"/ text1 := subView contents. |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3482 |
text1 := subView list asStringCollection withTabs. |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3483 |
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
|
3484 |
name1 := nil. |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3485 |
l1 := 'browser contents' |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3486 |
] ifFalse:[ |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3487 |
name1 := currentDirectory filenameFor:name1. |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3488 |
name1 isReadable ifFalse:[ |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3489 |
nm := name1. |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3490 |
name1 exists ifFalse:[ |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3491 |
err := '%1 does not exist'. |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3492 |
] ifTrue:[ |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3493 |
err := '%1 is not readable' |
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 |
]. |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3496 |
l1 := name1 pathName |
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 |
|
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3499 |
name2 := currentDirectory filenameFor:name2 value. |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3500 |
err isNil ifTrue:[ |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3501 |
name2 isReadable ifFalse:[ |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3502 |
nm := name2. |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3503 |
name2 exists ifFalse:[ |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3504 |
err := '%1 does not exist'. |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3505 |
] ifTrue:[ |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3506 |
err := '%1 is not readable' |
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 |
]. |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3510 |
err notNil ifTrue:[ |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3511 |
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
|
3512 |
^ self |
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 |
|
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3515 |
self withWaitCursorDo:[ |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3516 |
(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
|
3517 |
lastFileDiffDirectory := name1 directoryName |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3518 |
]. |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3519 |
name1 notNil ifTrue:[ |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3520 |
text1 := name1 contents. |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3521 |
]. |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3522 |
text2 := name2 contents. |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3523 |
text1 = text2 ifTrue:[ |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3524 |
self information:'same contents' |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3525 |
] ifFalse:[ |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3526 |
d := DiffTextView |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3527 |
openOn:text1 label:l1 |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3528 |
and:text2 label:name2 pathName. |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3529 |
d label:'file differences'. |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3530 |
] |
1614b0a4dcd3
preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents:
2139
diff
changeset
|
3531 |
] |
252 | 3532 |
]. |
3533 |
||
1735
57ebbb06fcd7
only show an infoBox, if files have the same contents
Claus Gittinger <cg@exept.de>
parents:
1732
diff
changeset
|
3534 |
"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
|
3535 |
"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
|
3536 |
"Modified: / 5.5.1999 / 16:04:10 / cg" |
267 | 3537 |
! |
3538 |
||
3539 |
openEditor |
|
3540 |
self openTool:EditTextView |
|
3541 |
! |
|
3542 |
||
3543 |
openHTMLReader |
|
1874 | 3544 |
self openTool:HTMLDocumentView ignoreDirectories:false |
3545 |
||
3546 |
"Modified: / 7.9.1998 / 21:31:58 / cg" |
|
267 | 3547 |
! |
3548 |
||
1834 | 3549 |
openImageEditor |
1874 | 3550 |
[self loadImageAndPerform:#edit] fork |
1834 | 3551 |
|
3552 |
"Modified: / 17.9.1995 / 17:41:24 / claus" |
|
3553 |
"Modified: / 18.9.1997 / 17:05:04 / stefan" |
|
3554 |
"Created: / 13.8.1998 / 22:07:09 / cg" |
|
1874 | 3555 |
"Modified: / 7.9.1998 / 21:31:41 / cg" |
1834 | 3556 |
! |
3557 |
||
267 | 3558 |
openImageInspector |
1874 | 3559 |
[self loadImageAndPerform:#inspect] fork |
1853 | 3560 |
|
3561 |
"Modified: / 17.9.1995 / 17:41:24 / claus" |
|
3562 |
"Modified: / 18.9.1997 / 17:05:04 / stefan" |
|
1874 | 3563 |
"Modified: / 7.9.1998 / 21:31:30 / cg" |
267 | 3564 |
! |
3565 |
||
1964 | 3566 |
openImagePreview |
3567 |
[self loadImageAndPerform:[:img | |
|
3661 | 3568 |
|i top viewer imgFileName| |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3569 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3570 |
top := StandardSystemView new. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3571 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3572 |
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
|
3573 |
i := img. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3574 |
top extent:200@200. |
3661 | 3575 |
imgFileName := img fileName asFilename. |
3576 |
top label:(imgFileName directoryName asFilename baseName , '/' , imgFileName baseName). |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3577 |
top openAndWait. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3578 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3579 |
(i width > 200 or:[i height > 200]) ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3580 |
i := i magnifiedPreservingRatioTo:200@200. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3581 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3582 |
viewer image:i. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3583 |
]. |
1964 | 3584 |
] fork |
1969 | 3585 |
|
3586 |
"Modified: / 4.12.1998 / 15:49:03 / cg" |
|
1964 | 3587 |
! |
3588 |
||
3001 | 3589 |
openMP3Player |
3590 |
|file| |
|
3591 |
||
3592 |
file := self getSelectedFileName. |
|
3593 |
(file isNil) ifTrue:[ |
|
3594 |
^ self. |
|
3595 |
]. |
|
3596 |
file := currentDirectory filenameFor:file. |
|
3597 |
(MP3PlayerApplication ? SaugFix::MP3PlayerApplication) playSong:file. |
|
3598 |
! |
|
3599 |
||
1994 | 3600 |
openSelectedFilename |
3601 |
|sel| |
|
3602 |
||
3603 |
sel := subView selection. |
|
3604 |
sel notNil ifTrue:[ |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3605 |
sel := sel asString withoutSeparators. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3606 |
sel asFilename exists ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3607 |
self doOpenFile:sel viaDoubleClick:false |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
3608 |
] |
1994 | 3609 |
]. |
3610 |
||
3611 |
"Created: / 4.2.1999 / 17:40:42 / cg" |
|
3612 |
"Modified: / 4.2.1999 / 17:47:06 / cg" |
|
3613 |
! |
|
3614 |
||
3536 | 3615 |
openSlideShow |
3616 |
CodingExamples_GUI::SlideShow openIn:currentDirectory |
|
3617 |
||
3618 |
"Created: / 29.12.2001 / 21:56:34 / cg" |
|
3619 |
! |
|
3620 |
||
2825
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
3621 |
openSnapshotImageBrowser |
2844 | 3622 |
^ self openTool:SystemBrowser with:#openOnSnapShotImage: ignoreDirectories:true |
3623 |
! |
|
2825
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
3624 |
|
1731 | 3625 |
openTerminal |
1732 | 3626 |
VT100TerminalView openShellIn:currentDirectory |
1731 | 3627 |
|
3628 |
"Created: / 20.7.1998 / 18:18:15 / cg" |
|
1732 | 3629 |
"Modified: / 20.7.1998 / 18:32:28 / cg" |
1731 | 3630 |
! |
3631 |
||
267 | 3632 |
openTool:aToolClass |
3633 |
"open a tool on the selected file(s)" |
|
3634 |
||
2015 | 3635 |
^ self openTool:aToolClass ignoreDirectories:true |
1874 | 3636 |
|
3637 |
"Modified: / 7.9.1998 / 19:32:10 / cg" |
|
3638 |
! |
|
3639 |
||
3640 |
openTool:aToolClass ignoreDirectories:ignoreDirs |
|
3641 |
"open a tool on the selected file(s)" |
|
3642 |
||
2825
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
3643 |
^ self |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
3644 |
openTool:aToolClass |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
3645 |
with:#openOn: |
2844 | 3646 |
ignoreDirectories:ignoreDirs |
3647 |
! |
|
2825
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
3648 |
|
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
3649 |
openTool:aToolClass with:aSelector ignoreDirectories:ignoreDirs |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
3650 |
"open a tool on the selected file(s)" |
fb93c4772441
added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
3651 |
|
2015 | 3652 |
|numItems path tool| |
865
48395e8ecca9
remember executeCommand actions in history as well.
Claus Gittinger <cg@exept.de>
parents:
851
diff
changeset
|
3653 |
|
1883 | 3654 |
aToolClass isNil ifTrue:[ |
2170 | 3655 |
self warn:'Sorry, that tool seems to be not available'. |
3656 |
^ nil. |
|
1883 | 3657 |
]. |
3658 |
||
865
48395e8ecca9
remember executeCommand actions in history as well.
Claus Gittinger <cg@exept.de>
parents:
851
diff
changeset
|
3659 |
(numItems := fileListView selection size) > 2 ifTrue:[ |
2170 | 3660 |
(self |
3661 |
confirm:(resources string:'open for each of the %1 items ?' |
|
3662 |
with:numItems)) ifFalse:[^ self]. |
|
865
48395e8ecca9
remember executeCommand actions in history as well.
Claus Gittinger <cg@exept.de>
parents:
851
diff
changeset
|
3663 |
]. |
48395e8ecca9
remember executeCommand actions in history as well.
Claus Gittinger <cg@exept.de>
parents:
851
diff
changeset
|
3664 |
|
3272 | 3665 |
self withWaitCursorDo:[ |
3666 |
self selectedFilesDo:[:fileName | |
|
3667 |
path := currentDirectory filenameFor:fileName. |
|
3461 | 3668 |
(ignoreDirs not or:[path isDirectory not]) ifTrue:[ |
3669 |
path isAbsolute ifTrue:[ |
|
3670 |
path := path getName. |
|
3671 |
] ifFalse:[ |
|
3672 |
path := path pathName. |
|
3673 |
]. |
|
3674 |
tool := aToolClass perform:aSelector with:path. |
|
3272 | 3675 |
] |
3676 |
]. |
|
267 | 3677 |
]. |
2015 | 3678 |
^ tool |
865
48395e8ecca9
remember executeCommand actions in history as well.
Claus Gittinger <cg@exept.de>
parents:
851
diff
changeset
|
3679 |
|
1874 | 3680 |
"Modified: / 18.9.1997 / 17:06:18 / stefan" |
3681 |
"Created: / 7.9.1998 / 19:31:49 / cg" |
|
2844 | 3682 |
"Modified: / 25.5.1999 / 16:30:35 / cg" |
3683 |
! |
|
1156
f3df28086973
dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents:
1154
diff
changeset
|
3684 |
|
1853 | 3685 |
openZipTool |
2015 | 3686 |
|zipTool| |
3687 |
||
2170 | 3688 |
(zipTool := self openTool:ZipTool) notNil ifTrue:[ |
3689 |
zipTool initialExtractDirectory:currentDirectory |
|
3690 |
]. |
|
1853 | 3691 |
|
3692 |
"Created: / 26.8.1998 / 16:20:55 / cg" |
|
2170 | 3693 |
"Modified: / 25.5.1999 / 16:30:54 / cg" |
1853 | 3694 |
! |
3695 |
||
2567
dd029fea485d
added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents:
2562
diff
changeset
|
3696 |
readAbbrevFile |
3398 | 3697 |
"read the abbrev file and install classes found there as autoloaded classes" |
3698 |
||
3747
d30bc1e54f15
Remove unused vars and asFilename sends
Stefan Vogel <sv@exept.de>
parents:
3746
diff
changeset
|
3699 |
|sel| |
d30bc1e54f15
Remove unused vars and asFilename sends
Stefan Vogel <sv@exept.de>
parents:
3746
diff
changeset
|
3700 |
|
3555 | 3701 |
sel := fileListView selection. |
3702 |
sel size == 0 ifTrue:[ |
|
3747
d30bc1e54f15
Remove unused vars and asFilename sends
Stefan Vogel <sv@exept.de>
parents:
3746
diff
changeset
|
3703 |
Smalltalk installAutoloadedClassesFrom:(currentDirectory construct:'abbrev.stc'). |
3555 | 3704 |
^ self |
3705 |
]. |
|
3706 |
sel do:[:eachIndex | |
|
3707 |
|f| |
|
3708 |
||
3709 |
f := fileList at:eachIndex ifAbsent:nil. |
|
3747
d30bc1e54f15
Remove unused vars and asFilename sends
Stefan Vogel <sv@exept.de>
parents:
3746
diff
changeset
|
3710 |
f := currentDirectory construct:f. |
3555 | 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 |
|
3747
d30bc1e54f15
Remove unused vars and asFilename sends
Stefan Vogel <sv@exept.de>
parents:
3746
diff
changeset
|
3821 |
currentDirectory := newDirectory. |
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 |
|
3759
366d5ebc3f89
Use #isWindowsStyle instead of comparing to style name.
Stefan Vogel <sv@exept.de>
parents:
3747
diff
changeset
|
3956 |
(styleSheet name = #st80 or:[styleSheet isWindowsStyle]) ifTrue:[ |
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
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 |
3747
d30bc1e54f15
Remove unused vars and asFilename sends
Stefan Vogel <sv@exept.de>
parents:
3746
diff
changeset
|
4239 |
answer:currentDirectory |
2572
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 |
]. |
3747
d30bc1e54f15
Remove unused vars and asFilename sends
Stefan Vogel <sv@exept.de>
parents:
3746
diff
changeset
|
4895 |
f := currentDirectory construct:f. |
1893
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 |
]. |
|
3747
d30bc1e54f15
Remove unused vars and asFilename sends
Stefan Vogel <sv@exept.de>
parents:
3746
diff
changeset
|
4912 |
f := currentDirectory construct:f. |
2368 | 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 |
]. |
3747
d30bc1e54f15
Remove unused vars and asFilename sends
Stefan Vogel <sv@exept.de>
parents:
3746
diff
changeset
|
4929 |
f := currentDirectory construct:f. |
1893
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 |
]. |
|
3747
d30bc1e54f15
Remove unused vars and asFilename sends
Stefan Vogel <sv@exept.de>
parents:
3746
diff
changeset
|
4946 |
f := currentDirectory construct:f. |
2368 | 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) |
|
3747
d30bc1e54f15
Remove unused vars and asFilename sends
Stefan Vogel <sv@exept.de>
parents:
3746
diff
changeset
|
5325 |
inDirectory:currentDirectory) |
2385 | 5326 |
ifTrue:[^true]. |
5327 |
]. |
|
5328 |
]. |
|
5329 |
||
1330 | 5330 |
(currentDirectory construct:aFilename) isExecutableProgram ifTrue:[ |
3747
d30bc1e54f15
Remove unused vars and asFilename sends
Stefan Vogel <sv@exept.de>
parents:
3746
diff
changeset
|
5331 |
(OperatingSystem executeCommand:aFilename inDirectory:currentDirectory) |
2385 | 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 |
||
3729 | 5611 |
|file img errmsg| |
5612 |
||
5613 |
file := currentDirectory construct:aFilename. |
|
5614 |
||
5615 |
(Image isImageFileSuffix:(file suffix)) |
|
1162 | 5616 |
ifTrue:[ |
3729 | 5617 |
Image imageLoadErrorSignal handle:[:ex | |
5618 |
"/ ex signal ~~ Image badImageFormatQuerySignal |
|
5619 |
"/ ifTrue:[ |
|
5620 |
errmsg := ex errorString |
|
5621 |
"/ ] |
|
2158
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5622 |
] do:[ |
3729 | 5623 |
img := Image fromFile:file. |
2158
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5624 |
]. |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5625 |
img notNil ifTrue:[ |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5626 |
ImageEditor openOnImage:img. |
1410 | 5627 |
"/ img inspect. |
2158
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5628 |
^ true |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5629 |
]. |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5630 |
errmsg notNil ifTrue:[ |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5631 |
self warn:errmsg. |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5632 |
] |
1162 | 5633 |
]. |
5634 |
^ false |
|
5635 |
||
2158
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
5636 |
"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
|
5637 |
"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
|
5638 |
"Modified: / 18.5.1999 / 15:45:06 / cg" |
1162 | 5639 |
! |
5640 |
||
5641 |
initialCommandFor:fileName into:aBox |
|
5642 |
"set a useful initial command for execute box." |
|
5643 |
||
2345 | 5644 |
|mime cmd select path suffix| |
5645 |
||
5646 |
path := currentDirectory filenameFor:fileName. |
|
3743 | 5647 |
suffix := fileName asFilename suffix. |
3746 | 5648 |
DefaultCommandPerSuffix notNil ifTrue:[ |
5649 |
cmd := DefaultCommandPerSuffix at:suffix ifAbsent:nil. |
|
5650 |
cmd notNil ifTrue:[ |
|
5651 |
aBox initialText:(cmd , ' ' , fileName) selectFrom:1 to:cmd size. |
|
5652 |
^ self |
|
5653 |
]. |
|
3743 | 5654 |
]. |
5655 |
mime := MIMETypes mimeTypeForSuffix:suffix. |
|
2345 | 5656 |
"/ mime notNil ifTrue:[ |
5657 |
"/ cmd := self initialCommandForMIME:mime file:path |
|
5658 |
"/ ]. |
|
1162 | 5659 |
|
5660 |
"/ XXX should be changed to take stuff from a config file |
|
5661 |
"/ XXX or from resources. |
|
5662 |
||
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
5663 |
(path type == #regular) ifTrue:[ |
2345 | 5664 |
path isExecutableProgram ifTrue:[ |
5665 |
aBox initialText:(fileName , ' <arguments>'). |
|
5666 |
^ self |
|
5667 |
]. |
|
5668 |
||
5669 |
select := true. |
|
5670 |
||
5671 |
"some heuristics - my personal preferences ... |
|
5672 |
(actually this should come from a configfile)" |
|
5673 |
||
5674 |
(fileName endsWith:'akefile') ifTrue:[ |
|
5675 |
aBox initialText:'make target' selectFrom:6 to:11. |
|
5676 |
^ self |
|
5677 |
]. |
|
5678 |
||
2346 | 5679 |
DefaultCommandPerMIME isNil ifTrue:[ |
5680 |
self class initializeDefaultCommands |
|
5681 |
]. |
|
5682 |
||
5683 |
cmd := DefaultCommandPerMIME at:mime ifAbsent:nil. |
|
5684 |
cmd notNil ifTrue:[ |
|
5685 |
select := false |
|
5686 |
]. |
|
5687 |
||
5688 |
cmd isNil ifTrue:[ |
|
5689 |
||
5690 |
suffix := path suffix. |
|
5691 |
(suffix = 'C') ifTrue:[ |
|
2345 | 5692 |
cmd := 'g++ -c %1'. |
5693 |
select := 6. |
|
2346 | 5694 |
] ifFalse:[ |
5695 |
suffix := suffix asLowercase. |
|
5696 |
||
5697 |
(suffix = 'taz') ifTrue:[ |
|
5698 |
aBox initialText:'zcat %1 | tar tvf -'. |
|
5699 |
select := false. |
|
5700 |
]. |
|
5701 |
(suffix = 'tar') ifTrue:[ |
|
5702 |
cmd := 'tar tvf %1'. |
|
5703 |
select := 7. |
|
5704 |
]. |
|
5705 |
(suffix = 'zoo') ifTrue:[ |
|
5706 |
cmd := 'zoo -list %1'. |
|
5707 |
select := 9. |
|
5708 |
]. |
|
5709 |
(suffix = 'zip') ifTrue:[ |
|
5710 |
cmd := 'unzip -l %1'. |
|
5711 |
select := 8. |
|
5712 |
]. |
|
5713 |
(suffix = 'jar') ifTrue:[ |
|
5714 |
cmd := 'unzip -l %1'. |
|
5715 |
select := 8. |
|
5716 |
]. |
|
5717 |
(suffix = 'z') ifTrue:[ |
|
5718 |
(fileName asLowercase endsWith:'tar.z') ifTrue:[ |
|
5719 |
cmd := 'zcat %1 | tar tvf -'. |
|
5720 |
select := false. |
|
5721 |
] ifFalse:[ |
|
5722 |
cmd := 'uncompress %1' |
|
5723 |
]. |
|
5724 |
]. |
|
5725 |
(suffix = 'gz') ifTrue:[ |
|
5726 |
(fileName asLowercase endsWith:'tar.gz') ifTrue:[ |
|
5727 |
cmd := ('gunzip < %1 | tar tvf -' ). |
|
5728 |
select := false. |
|
5729 |
] ifFalse:[ |
|
5730 |
cmd := 'gunzip %1'. |
|
5731 |
]. |
|
5732 |
]. |
|
5733 |
(suffix = 'html') ifTrue:[ |
|
5734 |
cmd := 'netscape %1' |
|
5735 |
]. |
|
5736 |
(suffix = 'htm') ifTrue:[ |
|
5737 |
cmd := 'netscape %1' |
|
5738 |
]. |
|
5739 |
(suffix = 'uue') ifTrue:[ |
|
5740 |
cmd := 'uudecode %1' |
|
5741 |
]. |
|
5742 |
(suffix = 'c') ifTrue:[ |
|
5743 |
cmd := 'cc -c %1'. |
|
5744 |
select := 5. |
|
5745 |
]. |
|
5746 |
(suffix = 'cc') ifTrue:[ |
|
5747 |
cmd := 'g++ -c %1'. |
|
5748 |
select := 6. |
|
5749 |
]. |
|
5750 |
(suffix = 'xbm') ifTrue:[ |
|
5751 |
cmd := 'bitmap %1' |
|
5752 |
]. |
|
5753 |
(suffix = 'ps') ifTrue:[ |
|
5754 |
cmd := 'ghostview %1' |
|
5755 |
]. |
|
5756 |
((suffix = '1') or:[suffix = 'man']) ifTrue:[ |
|
5757 |
cmd := 'nroff -man %1'. |
|
5758 |
select := 10. |
|
5759 |
]. |
|
2345 | 5760 |
]. |
5761 |
]. |
|
5762 |
||
5763 |
cmd isNil ifTrue:[ |
|
5764 |
DefaultCommandPerSuffix isNil ifTrue:[ |
|
5765 |
cmd := '<cmd>' |
|
5766 |
] ifFalse:[ |
|
5767 |
cmd := DefaultCommandPerSuffix |
|
5768 |
at:suffix |
|
5769 |
ifAbsent:'<cmd>'. |
|
5770 |
]. |
|
5771 |
cmd := cmd , ' %1'. |
|
5772 |
]. |
|
5773 |
||
5774 |
cmd := cmd bindWith:fileName. |
|
5775 |
select == false ifTrue:[ |
|
5776 |
aBox initialText:cmd |
|
5777 |
] ifFalse:[ |
|
5778 |
select class == Interval ifTrue:[ |
|
5779 |
aBox initialText:cmd selectFrom:select start to:select stop |
|
5780 |
] ifFalse:[ |
|
5781 |
select isInteger ifFalse:[ |
|
5782 |
select := (cmd indexOf:Character space ifAbsent:[cmd size + 1]) - 1. |
|
5783 |
]. |
|
5784 |
aBox initialText:cmd selectFrom:1 to:select |
|
5785 |
]. |
|
5786 |
] |
|
1162 | 5787 |
] |
5788 |
||
1542 | 5789 |
"Modified: / 24.9.1997 / 16:34:52 / stefan" |
5790 |
"Modified: / 9.4.1998 / 17:15:57 / cg" |
|
1162 | 5791 |
! |
5792 |
||
5793 |
nonBinaryFileAction:aFilename |
|
5794 |
"for some nonBinary files, if double clicked, we can do some useful |
|
5795 |
action ..." |
|
5796 |
||
1493 | 5797 |
|fullPath| |
1162 | 5798 |
|
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
5799 |
fullPath := currentDirectory filenameFor:aFilename. |
2550 | 5800 |
((fullPath hasSuffix:'htm') |
5801 |
or:[(fullPath hasSuffix:'HTM') |
|
5802 |
or:[(fullPath hasSuffix:'html') |
|
5803 |
or:[(fullPath hasSuffix:'HTML')]]]) ifTrue:[ |
|
2385 | 5804 |
HTMLDocumentView openOn:fullPath pathName. |
5805 |
^ true |
|
2091 | 5806 |
]. |
5807 |
((fullPath hasSuffix:'prj') |
|
5808 |
and:[ProjectBrowser notNil]) ifTrue:[ |
|
2385 | 5809 |
ProjectBrowser openOnFile:fullPath pathName. |
5810 |
^ true |
|
1162 | 5811 |
]. |
5812 |
||
5813 |
OperatingSystem isUNIXlike ifTrue:[ |
|
2385 | 5814 |
(#('.man' '.1' '.2' '.3') findFirst:[:suff | fullPath hasSuffix:suff]) ~~ 0 |
5815 |
ifTrue:[ |
|
5816 |
HTMLDocumentView openFullOnText:(HTMLDocGenerator manPageForFile:fullPath pathName). |
|
5817 |
^ true |
|
5818 |
]. |
|
1162 | 5819 |
]. |
5820 |
^ self imageAction:aFilename |
|
5821 |
||
5822 |
"Created: 19.6.1996 / 09:36:38 / cg" |
|
5823 |
"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
|
5824 |
"Modified: 18.9.1997 / 16:58:40 / stefan" |
1162 | 5825 |
! ! |
5826 |
||
5827 |
!FileBrowser methodsFor:'private - directory stuff'! |
|
5828 |
||
1371
a80db8d0e311
remember directory in history when entering (not when leaving)
Claus Gittinger <cg@exept.de>
parents:
1358
diff
changeset
|
5829 |
addToHistory:path |
2951
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
5830 |
self class addToHistory:path |
1371
a80db8d0e311
remember directory in history when entering (not when leaving)
Claus Gittinger <cg@exept.de>
parents:
1358
diff
changeset
|
5831 |
! |
a80db8d0e311
remember directory in history when entering (not when leaving)
Claus Gittinger <cg@exept.de>
parents:
1358
diff
changeset
|
5832 |
|
172 | 5833 |
changeToPreviousDirectory |
5834 |
"if text was modified show a queryBox, |
|
5835 |
otherwise change immediately to previous directory." |
|
93 | 5836 |
|
172 | 5837 |
previousDirectory isNil ifTrue:[^ self]. |
1339
4b712d8c1738
Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents:
1336
diff
changeset
|
5838 |
self discardChangesDialog ifTrue:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5839 |
self doChangeCurrentDirectoryTo:previousDirectory updateHistory:false |
172 | 5840 |
] |
1339
4b712d8c1738
Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents:
1336
diff
changeset
|
5841 |
|
4b712d8c1738
Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents:
1336
diff
changeset
|
5842 |
"Modified: 2.10.1997 / 14:13:40 / stefan" |
36 | 5843 |
! |
5844 |
||
98 | 5845 |
checkIfDirectoryHasChanged |
5846 |
"every checkDelta secs, check if directoy has changed and update the list if so. |
|
5847 |
Also, we check if the file shown has been touched in the meanwhile (for example, |
|
5848 |
from another browser) and say 'outdated' in the label if so. |
|
5849 |
This avoids confusion if the same file is being edited by two browsers. (or other editors). |
|
5850 |
If the text shown in the codeView has been edited, 'modified' is shown. |
|
5851 |
" |
|
5852 |
||
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
5853 |
|oldSelection nOld newState msg newLabel t| |
98 | 5854 |
|
5855 |
shown ifTrue:[ |
|
2220
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
5856 |
currentDirectory notNil ifTrue:[ |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
5857 |
(lockUpdate or:[doAutoUpdate value not]) ifTrue:[ |
3520
83cf11e1bf32
schedule checkBlock for the right process
Claus Gittinger <cg@exept.de>
parents:
3503
diff
changeset
|
5858 |
self scheduleCheckBlock. |
2220
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
5859 |
^ self |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
5860 |
]. |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
5861 |
|
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
5862 |
subView modified ifTrue:[ |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
5863 |
newState := ' (modified)' |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
5864 |
]. |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
5865 |
|
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
5866 |
(currentDirectory isReadable) ifTrue:[ |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
5867 |
Processor removeTimedBlock:checkBlock. |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
5868 |
|
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
5869 |
t := currentDirectory modificationTime. |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
5870 |
(t notNil and:[t > timeOfLastCheck]) ifTrue:[ |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
5871 |
nOld := fileListView numberOfSelections. |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
5872 |
oldSelection := fileListView selectionValue. |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
5873 |
self updateCurrentDirectory. |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
5874 |
nOld ~~ 0 ifTrue:[ |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
5875 |
nOld > 1 ifTrue:[ |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
5876 |
oldSelection do:[:element | |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
5877 |
fileListView addElementToSelection:element |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
5878 |
] |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
5879 |
] ifFalse:[ |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
5880 |
fileListView selectElementWithoutScroll:oldSelection |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
5881 |
] |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
5882 |
]. |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
5883 |
] ifFalse:[ |
3520
83cf11e1bf32
schedule checkBlock for the right process
Claus Gittinger <cg@exept.de>
parents:
3503
diff
changeset
|
5884 |
self scheduleCheckBlock. |
2220
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 |
currentFileName notNil ifTrue:[ |
3399 | 5888 |
|f mod| |
2220
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
5889 |
f := currentDirectory construct:currentFileName. |
3399 | 5890 |
(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
|
5891 |
newState := ' (removed)'. |
3399 | 5892 |
] ifFalse:[ |
5893 |
mod > timeOfFileRead ifTrue:[ |
|
2220
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
5894 |
newState := ' (outdated)'. |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
5895 |
subView modified ifTrue:[ |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
5896 |
newState := ' (modified & outdated)' |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
5897 |
] |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
5898 |
]. |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
5899 |
]. |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
5900 |
]. |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
5901 |
] ifFalse:[ |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
5902 |
" |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
5903 |
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
|
5904 |
" |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
5905 |
(currentDirectory exists) ifFalse:[ |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
5906 |
msg := 'FileBrowser:\\directory %1 is gone ?!!?' |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
5907 |
] ifTrue:[ |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
5908 |
msg := 'FileBrowser:\\directory %1 is no longer readable ?!!?' |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
5909 |
]. |
3417
1fee40dd5af4
win32: do not x-laet backslash in a filename to cr in warnbox
Claus Gittinger <cg@exept.de>
parents:
3414
diff
changeset
|
5910 |
"/ sigh - avoid translating backslashes in WIN-filenames |
3528 | 5911 |
msg := (resources string:msg) withCRs. |
5912 |
Dialog warn:(msg bindWith:currentDirectory pathName allBold). |
|
2220
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
5913 |
|
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
5914 |
fileListView contents:nil. |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
5915 |
newLabel := myName , ': directory is gone !!'. |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
5916 |
]. |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
5917 |
|
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
5918 |
newState notNil ifTrue:[ |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
5919 |
newLabel := myName. |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
5920 |
currentFileName notNil ifTrue:[ |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
5921 |
newLabel := newLabel , ': ' , currentFileName |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
5922 |
]. |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
5923 |
newLabel := newLabel , newState. |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
5924 |
]. |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
5925 |
newLabel notNil ifTrue:[ |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
5926 |
self label:newLabel. |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
5927 |
] |
1ec72aa513c8
added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents:
2216
diff
changeset
|
5928 |
] |
98 | 5929 |
] |
1168
b157f3712548
care for nil returns from userName/groupName * time queries
Claus Gittinger <cg@exept.de>
parents:
1166
diff
changeset
|
5930 |
|
1380
547d31bfa12c
warning string fixed when directory vanishes
Claus Gittinger <cg@exept.de>
parents:
1374
diff
changeset
|
5931 |
"Modified: / 28.4.1997 / 22:31:02 / dq" |
547d31bfa12c
warning string fixed when directory vanishes
Claus Gittinger <cg@exept.de>
parents:
1374
diff
changeset
|
5932 |
"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
|
5933 |
"Modified: / 15.11.2001 / 21:27:05 / cg" |
98 | 5934 |
! |
5935 |
||
172 | 5936 |
doChangeCurrentDirectoryTo:fileName updateHistory:updateHistory |
5937 |
"verify argument is name of a readable & executable directory |
|
5938 |
and if so, go there" |
|
5939 |
||
1317 | 5940 |
|msg path idx f| |
172 | 5941 |
|
5942 |
self label:myName; iconLabel:myName. |
|
5943 |
fileName notNil ifTrue:[ |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5944 |
(f := fileName asFilename) isAbsolute ifFalse:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5945 |
f := currentDirectory filenameFor:fileName. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5946 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5947 |
f := f asAbsoluteFilename. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5948 |
(f isDirectory) ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5949 |
(f isReadable) ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5950 |
(f isExecutable) ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5951 |
path := currentDirectory pathName. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5952 |
previousDirectory := 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 |
remember where we are positioned in the fileList |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5956 |
(in case we want to return) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5957 |
" |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5958 |
idx := DirectoryHistory indexOf:path. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5959 |
idx ~~ 0 ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5960 |
DirectoryHistoryWhere at:idx put:fileListView firstLineShown |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5961 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5962 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5963 |
updateHistory ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5964 |
self addToHistory:path. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5965 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5966 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5967 |
self setCurrentDirectory:(f pathName). |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5968 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5969 |
"/ fetch the new path. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5970 |
path := currentDirectory pathName. |
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 |
if we have already been there, look for the |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5974 |
position offset, and scroll the fileList |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5975 |
" |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5976 |
idx := DirectoryHistory indexOf:path. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5977 |
idx ~~ 0 ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5978 |
|pos| |
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 |
pos := DirectoryHistoryWhere at:idx. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5981 |
pos notNil ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5982 |
fileListView scrollToLine:pos. |
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 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5985 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5986 |
updateHistory ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5987 |
self addToHistory:path. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5988 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5989 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5990 |
^ self |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5991 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5992 |
msg := 'cannot change directory to ''%1'' !!' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5993 |
] ifFalse:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5994 |
msg := 'cannot read directory ''%1'' !!' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5995 |
] |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5996 |
] ifFalse:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5997 |
OperatingSystem isVMSlike ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5998 |
"/ cannot tell if it exists or is simply invisible ... |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
5999 |
msg := '''%1'' is not a directory or unreadable !!' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6000 |
] ifFalse:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6001 |
msg := '''%1'' is not a directory !!' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6002 |
] |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6003 |
]. |
3528 | 6004 |
msg := (resources string:msg) withCRs. |
6005 |
Dialog warn:(msg bindWith:fileName allBold). |
|
172 | 6006 |
] |
1166
0029f77ccea7
when updating the directoryList,
Claus Gittinger <cg@exept.de>
parents:
1162
diff
changeset
|
6007 |
|
1371
a80db8d0e311
remember directory in history when entering (not when leaving)
Claus Gittinger <cg@exept.de>
parents:
1358
diff
changeset
|
6008 |
"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
|
6009 |
"Modified: / 27.4.1999 / 17:10:14 / cg" |
1329 | 6010 |
! |
6011 |
||
6012 |
doChangeToDefaultDirectory |
|
6013 |
"go to parent directory" |
|
6014 |
||
6015 |
self doChangeCurrentDirectoryTo:(Filename currentDirectory pathName) updateHistory:true |
|
6016 |
||
6017 |
"Created: 21.9.1997 / 23:45:59 / cg" |
|
172 | 6018 |
! |
6019 |
||
6020 |
doChangeToHomeDirectory |
|
6021 |
"go to home directory" |
|
6022 |
||
6023 |
self doChangeCurrentDirectoryTo:(OperatingSystem getHomeDirectory) updateHistory:true |
|
6024 |
! |
|
6025 |
||
6026 |
doChangeToParentDirectory |
|
1317 | 6027 |
"go to parent directory" |
36 | 6028 |
|
172 | 6029 |
self doChangeCurrentDirectoryTo:'..' updateHistory:true |
6030 |
! |
|
6031 |
||
6032 |
doCreateDirectory:newName |
|
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
6033 |
|f| |
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
6034 |
|
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
6035 |
f := currentDirectory filenameFor:newName. |
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
6036 |
f exists ifTrue:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6037 |
self warn:'%1 already exists.' with:newName. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6038 |
^ self |
172 | 6039 |
]. |
6040 |
||
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
6041 |
f makeDirectory ifTrue:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6042 |
self updateCurrentDirectory |
172 | 6043 |
] ifFalse:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6044 |
self showAlert:(resources string:'cannot create directory ''%1'' !!' with:newName) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6045 |
with:(OperatingSystem lastErrorString) |
172 | 6046 |
] |
1157
667a57034e40
only update if the directory did change (after execute command)
Claus Gittinger <cg@exept.de>
parents:
1156
diff
changeset
|
6047 |
|
1988 | 6048 |
"Modified: / 18.9.1997 / 17:21:25 / stefan" |
6049 |
"Modified: / 30.1.1999 / 16:24:12 / cg" |
|
172 | 6050 |
! |
6051 |
||
1162 | 6052 |
setCurrentDirectory:aPathName |
6053 |
"setup for another directory" |
|
6054 |
||
6055 |
|newDirectory| |
|
6056 |
||
6057 |
aPathName isEmpty ifTrue:[^ self]. |
|
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
6058 |
newDirectory := currentDirectory filenameFor:aPathName. |
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
6059 |
newDirectory isDirectory ifTrue:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6060 |
self currentDirectory:newDirectory. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6061 |
currentFileName notNil ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6062 |
fileListView contents:nil. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6063 |
currentFileName := nil. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6064 |
] ifFalse:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6065 |
fileListView setSelection:nil. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6066 |
fileListView scrollToTop. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6067 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6068 |
self updateCurrentDirectory. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6069 |
self showInfo. |
172 | 6070 |
] |
294 | 6071 |
|
1162 | 6072 |
"Modified: 21.9.1995 / 11:22:45 / claus" |
6073 |
"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
|
6074 |
"Modified: 18.9.1997 / 17:08:07 / stefan" |
912
dae70963b64c
define language specific commentStrings
Claus Gittinger <cg@exept.de>
parents:
874
diff
changeset
|
6075 |
! |
dae70963b64c
define language specific commentStrings
Claus Gittinger <cg@exept.de>
parents:
874
diff
changeset
|
6076 |
|
1162 | 6077 |
updateCurrentDirectoryIfChanged |
1837 | 6078 |
|t| |
6079 |
||
1975 | 6080 |
OperatingSystem isMSDOSlike ifTrue:[ |
2636 | 6081 |
"/ workaround: DOS has no directory modifiation time ... |
6082 |
self updateCurrentDirectory. |
|
6083 |
^ self |
|
1975 | 6084 |
]. |
6085 |
||
1837 | 6086 |
((t := currentDirectory modificationTime) isNil |
6087 |
or:[t > timeOfLastCheck]) ifTrue:[ |
|
2636 | 6088 |
self updateCurrentDirectory |
1162 | 6089 |
] |
6090 |
||
1837 | 6091 |
"Modified: / 16.9.1997 / 15:35:52 / stefan" |
1975 | 6092 |
"Modified: / 16.12.1998 / 22:55:44 / cg" |
1162 | 6093 |
! ! |
6094 |
||
6095 |
!FileBrowser methodsFor:'private - encoding'! |
|
172 | 6096 |
|
395 | 6097 |
guessEncodingFrom:aBuffer |
988 | 6098 |
"look for a string |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6099 |
encoding #name |
988 | 6100 |
or: |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6101 |
encoding: name |
1209 | 6102 |
within the given buffer |
6103 |
(which is usually the first few bytes of a textFile). |
|
6104 |
If thats not found, use heuristics (in CharacterArray) to guess." |
|
988 | 6105 |
|
395 | 6106 |
|n "{Class: SmallInteger }" |
1209 | 6107 |
binary idx s w enc| |
395 | 6108 |
|
6109 |
binary := false. |
|
6110 |
n := aBuffer size. |
|
6111 |
||
1223 | 6112 |
(idx := aBuffer findString:'charset=') ~~ 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 |
w := s upToSeparator. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6117 |
w notNil ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6118 |
(idx := w indexOf:$") ~~ 0 ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6119 |
w := w copyTo:idx-1 |
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 |
^ w asSymbol |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6122 |
]. |
1223 | 6123 |
]. |
807 | 6124 |
(idx := aBuffer findString:'encoding') ~~ 0 ifTrue:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6125 |
s := ReadStream on:aBuffer. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6126 |
s position:idx + 8. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6127 |
s skipSeparators. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6128 |
s peek == $: ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6129 |
s next. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6130 |
s skipSeparators. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6131 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6132 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6133 |
s peek == $# ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6134 |
s next. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6135 |
s skipSeparators. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6136 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6137 |
w := s upToSeparator. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6138 |
w notNil ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6139 |
^ w asSymbol |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6140 |
]. |
807 | 6141 |
]. |
6142 |
||
395 | 6143 |
1 to:n do:[:i | |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6144 |
(aBuffer at:i) isPrintable ifFalse:[binary := true]. |
395 | 6145 |
]. |
807 | 6146 |
|
395 | 6147 |
binary ifTrue:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6148 |
"/ look for JIS7 / EUC encoding |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6149 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6150 |
enc := CharacterArray guessEncodingFrom:aBuffer. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6151 |
enc notNil ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6152 |
^ enc |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6153 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6154 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6155 |
"/ if the encoding has been set to any non iso setting, |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6156 |
"/ assume its what we defined ... |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6157 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6158 |
(('iso*' match:fileEncoding) or:['ascii*' match:fileEncoding]) ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6159 |
^ #binary |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6160 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6161 |
^ fileEncoding ? #binary |
395 | 6162 |
]. |
6163 |
^ #ascii |
|
6164 |
||
6165 |
"Created: 26.2.1996 / 17:43:08 / cg" |
|
1223 | 6166 |
"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
|
6167 |
! |
02d5bbd925dd
allow decoding errors to be ignored
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
6168 |
|
02d5bbd925dd
allow decoding errors to be ignored
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
6169 |
preferredFontEncodingFor:fileEncoding |
02d5bbd925dd
allow decoding errors to be ignored
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
6170 |
"given a file encoding, return corresponding preferred fontEncoding |
02d5bbd925dd
allow decoding errors to be ignored
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
6171 |
match pattern" |
02d5bbd925dd
allow decoding errors to be ignored
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
6172 |
|
1223 | 6173 |
|fe| |
6174 |
||
6175 |
fe := MIMETypes fontForCharset:fileEncoding. |
|
6176 |
fe notNil ifTrue:[^ fe]. |
|
1221 | 6177 |
^ 'iso8859*' |
1214
02d5bbd925dd
allow decoding errors to be ignored
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
6178 |
|
02d5bbd925dd
allow decoding errors to be ignored
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
6179 |
"Created: 28.6.1997 / 20:47:35 / cg" |
1223 | 6180 |
"Modified: 1.7.1997 / 00:04:56 / cg" |
395 | 6181 |
! |
6182 |
||
1140 | 6183 |
validateFontEncodingFor:newEncoding ask:ask |
6184 |
"if required, query user if he/she wants to change to another font, |
|
6185 |
which is able to display text encoded as specified by newEncoding" |
|
6186 |
||
1214
02d5bbd925dd
allow decoding errors to be ignored
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
6187 |
|fontsEncoding msg filter f defaultFont pref| |
1140 | 6188 |
|
6189 |
fontsEncoding := subView font encoding. |
|
6190 |
||
1221 | 6191 |
pref := self preferredFontEncodingFor:newEncoding. |
6192 |
||
6193 |
(pref match:fontsEncoding) ifTrue:[ |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6194 |
^ self |
1140 | 6195 |
]. |
1221 | 6196 |
"/ stupid ... |
6197 |
pref = 'ascii*' ifTrue:[ |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6198 |
(fontsEncoding match:'iso8859*') ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6199 |
^ self |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6200 |
] |
1140 | 6201 |
]. |
6202 |
||
1221 | 6203 |
filter := [:f | |coding| |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6204 |
(coding := f encoding) notNil |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6205 |
and:[pref match:coding]]. |
1221 | 6206 |
|
6207 |
defaultFont := TextView defaultFont onDevice:device. |
|
6208 |
(pref match:(defaultFont encoding)) ifFalse:[ |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6209 |
defaultFont := nil. |
1140 | 6210 |
]. |
6211 |
||
1221 | 6212 |
defaultFont isNil ifTrue:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6213 |
(pref = 'ascii*' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6214 |
or:[pref = 'iso8859*']) ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6215 |
defaultFont := FontDescription family:'courier' face:'medium' style:'roman' size:12 |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6216 |
] |
1221 | 6217 |
]. |
6218 |
||
6219 |
defaultFont isNil ifTrue:[ |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6220 |
defaultFont := device |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6221 |
listOfAvailableFonts |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6222 |
detect:[:f | filter value:f] |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6223 |
ifNone:nil. |
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 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6226 |
"/ flush list, and refetch font list |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6227 |
"/ (in case someone just changed the font path ...) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6228 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6229 |
device flushListOfAvailableFonts. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6230 |
defaultFont := device |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6231 |
listOfAvailableFonts |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6232 |
detect:[:f | filter value:f] |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6233 |
ifNone:nil. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6234 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6235 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6236 |
defaultFont isNil ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6237 |
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
|
6238 |
^ self. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6239 |
] |
1221 | 6240 |
]. |
6241 |
||
6242 |
msg := 'switch to a %1 encoded font ?'. |
|
6243 |
(ask not or:[self confirm:(resources string:msg with:pref) withCRs]) |
|
6244 |
ifTrue:[ |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6245 |
self withWaitCursorDo:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6246 |
f := FontPanel |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6247 |
fontFromUserInitial:defaultFont |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6248 |
title:(resources string:'font selection') |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6249 |
filter:filter. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6250 |
f notNil ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6251 |
subView font:f |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6252 |
] |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6253 |
] |
1140 | 6254 |
] |
6255 |
||
6256 |
"Created: 26.10.1996 / 12:06:54 / cg" |
|
1221 | 6257 |
"Modified: 30.6.1997 / 17:46:46 / cg" |
1162 | 6258 |
! ! |
6259 |
||
6260 |
!FileBrowser methodsFor:'private - file stuff'! |
|
6261 |
||
6262 |
doCreateFile:newName |
|
6263 |
"create an empty file" |
|
6264 |
||
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
6265 |
|aStream f| |
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
6266 |
|
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
6267 |
f := currentDirectory filenameFor:newName. |
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
6268 |
f exists ifTrue:[ |
3421 | 6269 |
(self |
6270 |
ask:(resources string:'%1 already exists\\truncate ?' with:newName) |
|
6271 |
yesButton:'truncate' |
|
6272 |
) ifFalse:[^ self]. |
|
1162 | 6273 |
]. |
6274 |
||
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
6275 |
FileStream openErrorSignal handle:[:ex| |
3421 | 6276 |
^ self showAlert:(resources string:'Cannot create file ''%1'' !!' with:newName) |
6277 |
with:(FileStream lastErrorString) |
|
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
6278 |
] do:[ |
3421 | 6279 |
aStream := f newReadWriteStream. |
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
6280 |
]. |
1162 | 6281 |
aStream notNil ifTrue:[ |
3421 | 6282 |
aStream close. |
6283 |
self updateCurrentDirectoryIfChanged |
|
1162 | 6284 |
] ifFalse:[ |
3421 | 6285 |
self showAlert:(resources string:'Cannot create file ''%1'' !!' with:newName) |
6286 |
with:(FileStream lastErrorString) |
|
1162 | 6287 |
] |
6288 |
||
3421 | 6289 |
"Modified: / 18.9.1997 / 17:21:45 / stefan" |
6290 |
"Modified: / 16.11.2001 / 00:44:49 / cg" |
|
1140 | 6291 |
! |
6292 |
||
1162 | 6293 |
doFileGet:viaDoubleClick |
6294 |
"get selected file - show contents in subView. |
|
6295 |
This is invoked either by the 'get file' menu item, or via double click. |
|
6296 |
When invoked via the menu (viaDoubleClick argument is false), |
|
6297 |
the automatic file action is not performed - instead, the file is always |
|
6298 |
shown in the codeView (if possible). |
|
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
6299 |
This distinction was done to allow xpm or xbm files (which have an automatic |
1162 | 6300 |
action) to be edited." |
6301 |
||
1994 | 6302 |
|fileName| |
6303 |
||
6304 |
fileName := self getSelectedFileName. |
|
6305 |
fileName notNil ifTrue:[ |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6306 |
self doOpenFile:fileName viaDoubleClick:viaDoubleClick |
1162 | 6307 |
] |
6308 |
||
1955
e10babdbf077
before accepting, see if the file is outdated and warn if so.
Claus Gittinger <cg@exept.de>
parents:
1950
diff
changeset
|
6309 |
"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
|
6310 |
"Modified: / 18.9.1997 / 17:35:31 / stefan" |
1994 | 6311 |
"Modified: / 4.2.1999 / 17:43:51 / cg" |
1162 | 6312 |
! |
6313 |
||
2166
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6314 |
doFindFileNamed:namePatterns ignoreCase:ignCaseInName containingString:contentsString ignoreCaseInContents:ignCaseInString sameContentsAsFile:filenameToCompareContentsOrNil sameContentsAs:bytesToCompareContentsOrNil in:aDirectory |
1965 | 6315 |
|dir subDirs nameMatches contentsMatches lines contentsToCompare| |
6316 |
||
6317 |
bytesToCompareContentsOrNil notNil ifTrue:[ |
|
2166
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6318 |
contentsToCompare := bytesToCompareContentsOrNil |
1965 | 6319 |
]. |
1933 | 6320 |
|
6321 |
subDirs := OrderedCollection new. |
|
6322 |
||
6323 |
dir := aDirectory asFilename. |
|
6324 |
self label:myName , '- searching ' , dir name. |
|
6325 |
(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
|
6326 |
|f| |
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 |
f := dir construct:fn. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6329 |
f isDirectory ifTrue:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6330 |
f isSymbolicLink ifFalse:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6331 |
subDirs add:f |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6332 |
] |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6333 |
] ifFalse:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6334 |
(nameMatches := namePatterns isNil) ifFalse:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6335 |
ignCaseInName ifTrue:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6336 |
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
|
6337 |
] ifFalse:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6338 |
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
|
6339 |
] |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6340 |
]. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6341 |
nameMatches ifTrue:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6342 |
filenameToCompareContentsOrNil notNil ifTrue:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6343 |
"/ contents compare ... |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6344 |
contentsMatches := false. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6345 |
f pathName ~= filenameToCompareContentsOrNil pathName ifTrue:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6346 |
f fileSize == filenameToCompareContentsOrNil fileSize ifTrue:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6347 |
contentsToCompare isNil ifTrue:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6348 |
filenameToCompareContentsOrNil fileSize < (512*1024) ifTrue:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6349 |
contentsToCompare := filenameToCompareContentsOrNil binaryContentsOfEntireFile |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6350 |
] |
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 |
contentsToCompare isNil ifTrue:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6353 |
"/ too large - compare block-wise ... |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6354 |
contentsMatches := (filenameToCompareContentsOrNil sameContentsAs:f). |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6355 |
] ifFalse:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6356 |
contentsMatches := contentsToCompare = (f binaryContentsOfEntireFile). |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6357 |
] |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6358 |
]. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6359 |
] ifFalse:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6360 |
f isSymbolicLink ifTrue:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6361 |
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
|
6362 |
subView cursorDown. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6363 |
] |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6364 |
] |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6365 |
] ifFalse:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6366 |
"/ string search ... |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6367 |
(contentsMatches := contentsString isNil) ifFalse:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6368 |
(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
|
6369 |
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
|
6370 |
subView cursorDown. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6371 |
] ifTrue:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6372 |
f fileSize > (4024*1024) ifTrue:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6373 |
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
|
6374 |
subView cursorDown. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6375 |
] ifFalse:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6376 |
Stream lineTooLongErrorSignal handle:[:ex | |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6377 |
|cont| |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6378 |
|
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6379 |
"/ 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
|
6380 |
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
|
6381 |
ignCaseInString ifTrue:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6382 |
contentsMatches := cont asLowercase includesString:contentsString |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6383 |
] ifFalse:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6384 |
contentsMatches := cont includesString:contentsString |
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 |
] do:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6387 |
lines := f contents ? #(). |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6388 |
ignCaseInString ifTrue:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6389 |
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
|
6390 |
] ifFalse:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6391 |
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
|
6392 |
]. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6393 |
]. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6394 |
]. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6395 |
]. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6396 |
]. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6397 |
]. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6398 |
contentsMatches ifTrue:[ |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6399 |
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
|
6400 |
subView cursorDown. |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6401 |
] |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6402 |
] |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6403 |
] |
1933 | 6404 |
]. |
6405 |
||
6406 |
subDirs do:[:dir | |
|
2166
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6407 |
self |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6408 |
doFindFileNamed:namePatterns |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6409 |
ignoreCase:ignCaseInName |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6410 |
containingString:contentsString |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6411 |
ignoreCaseInContents:ignCaseInString |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6412 |
sameContentsAsFile:filenameToCompareContentsOrNil |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6413 |
sameContentsAs:contentsToCompare |
e1b98bde42c4
allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents:
2158
diff
changeset
|
6414 |
in:dir |
1933 | 6415 |
]. |
6416 |
||
6417 |
"Created: / 15.10.1998 / 11:37:15 / cg" |
|
6418 |
"Modified: / 15.10.1998 / 12:50:48 / cg" |
|
6419 |
! |
|
6420 |
||
1994 | 6421 |
doOpenFile:fileName viaDoubleClick:viaDoubleClick |
6422 |
"get selected file - show contents in subView. |
|
6423 |
This is invoked either by the 'get file' menu item, or via double click. |
|
6424 |
When invoked via the menu (viaDoubleClick argument is false), |
|
6425 |
the automatic file action is not performed - instead, the file is always |
|
6426 |
shown in the codeView (if possible). |
|
6427 |
This distinction was done to allow xpm or xbm files (which have an automatic |
|
6428 |
action) to be edited." |
|
6429 |
||
6430 |
|iconLbl winLbl f| |
|
6431 |
||
6432 |
self withReadCursorDo:[ |
|
2139 | 6433 |
(f := fileName asFilename) isAbsolute ifFalse:[ |
6434 |
f := currentDirectory construct:fileName. |
|
6435 |
]. |
|
6436 |
f isDirectory ifTrue:[ |
|
6437 |
self doChangeCurrentDirectoryTo:fileName updateHistory:true. |
|
6438 |
winLbl := myName. |
|
6439 |
iconLbl := myName |
|
6440 |
] ifFalse:[ |
|
6441 |
f exists ifFalse:[ |
|
2868 | 6442 |
Dialog warn:(resources string:'oops, ''%1'' is gone or unreadable.' withCRs with:f pathName allBold). |
2139 | 6443 |
^ self |
6444 |
]. |
|
6445 |
timeOfFileRead := f modificationTime. |
|
6446 |
self showFile:fileName insert:false encoding:fileEncoding doubleClick:viaDoubleClick. |
|
6447 |
currentFileName := fileName. |
|
6448 |
||
6449 |
self fileTypeSpecificActions. |
|
6450 |
||
6451 |
subView acceptAction:[:theCode | |
|
3498
5c5fff5b60bf
in doAccept: care for file being removed in the meantime
Claus Gittinger <cg@exept.de>
parents:
3478
diff
changeset
|
6452 |
|filesModificationTime| |
5c5fff5b60bf
in doAccept: care for file being removed in the meantime
Claus Gittinger <cg@exept.de>
parents:
3478
diff
changeset
|
6453 |
|
5c5fff5b60bf
in doAccept: care for file being removed in the meantime
Claus Gittinger <cg@exept.de>
parents:
3478
diff
changeset
|
6454 |
filesModificationTime := f modificationTime. |
5c5fff5b60bf
in doAccept: care for file being removed in the meantime
Claus Gittinger <cg@exept.de>
parents:
3478
diff
changeset
|
6455 |
(filesModificationTime isNil |
5c5fff5b60bf
in doAccept: care for file being removed in the meantime
Claus Gittinger <cg@exept.de>
parents:
3478
diff
changeset
|
6456 |
or:[filesModificationTime <= timeOfFileRead |
5c5fff5b60bf
in doAccept: care for file being removed in the meantime
Claus Gittinger <cg@exept.de>
parents:
3478
diff
changeset
|
6457 |
or:[(self |
2139 | 6458 |
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 ?') |
6459 |
yesButton:'save' |
|
3498
5c5fff5b60bf
in doAccept: care for file being removed in the meantime
Claus Gittinger <cg@exept.de>
parents:
3478
diff
changeset
|
6460 |
noButton:'don''t save')]]) |
5c5fff5b60bf
in doAccept: care for file being removed in the meantime
Claus Gittinger <cg@exept.de>
parents:
3478
diff
changeset
|
6461 |
ifTrue:[ |
2139 | 6462 |
self withCursor:(Cursor write) do:[ |
6463 |
self writeFile:fileName text:theCode encoding:fileEncoding. |
|
6464 |
timeOfFileRead := f modificationTime. |
|
6465 |
self label:myName , ': ' , currentFileName |
|
6466 |
] |
|
6467 |
] |
|
6468 |
]. |
|
6469 |
||
6470 |
winLbl := myName , ': ' , fileName. |
|
6471 |
f isWritable ifFalse:[ |
|
6472 |
winLbl := winLbl , ' (readonly)' |
|
6473 |
]. |
|
6474 |
iconLbl := fileName |
|
6475 |
]. |
|
6476 |
self label:winLbl. |
|
6477 |
self iconLabel:iconLbl. |
|
1994 | 6478 |
] |
6479 |
||
6480 |
"Created: / 4.2.1999 / 17:43:26 / cg" |
|
2139 | 6481 |
"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
|
6482 |
"Modified: / 10.12.2001 / 14:33:38 / cg" |
1994 | 6483 |
! |
6484 |
||
1961
f81295571da7
care for updating listView while removing (get selection before)
Claus Gittinger <cg@exept.de>
parents:
1956
diff
changeset
|
6485 |
doRemove:filesToRemove |
1162 | 6486 |
"remove the selected file(s) - no questions asked" |
6487 |
||
3420 | 6488 |
|msg needUpdate toRemove updateRunning yesToAll mTime| |
1162 | 6489 |
|
3281 | 6490 |
self withWaitCursorDo:[ |
6491 |
updateRunning := listUpdateProcess notNil. |
|
6492 |
self stopUpdateProcess. |
|
6493 |
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
|
6494 |
|
84029fca1f3d
use removeFile (a bit faster) if known to be a file
Claus Gittinger <cg@exept.de>
parents:
2771
diff
changeset
|
6495 |
"/ |
3281 | 6496 |
"/ 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
|
6497 |
"/ |
3281 | 6498 |
mTime := currentDirectory modificationTime. |
6499 |
needUpdate := mTime notNil and:[mTime > timeOfLastCheck]. |
|
6500 |
||
6501 |
yesToAll := false. |
|
6502 |
lockUpdate := true. |
|
6503 |
[ |
|
6504 |
filesToRemove keysAndValuesDo:[:idx :fileName | |
|
6505 |
|f| |
|
6506 |
||
6507 |
f := currentDirectory construct:fileName. |
|
6508 |
OperatingSystem accessDeniedErrorSignal handle:[:ex| |
|
6509 |
"was not able to remove it" |
|
3419 | 6510 |
msg := (resources string:'Cannot remove ''%1'' !!' with:fileName). |
3281 | 6511 |
self showAlert:msg with:(OperatingSystem lastErrorString) |
6512 |
] do:[ |
|
6513 |
|answer contents i| |
|
6514 |
||
6515 |
(f isSymbolicLink not and:[f isDirectory]) ifTrue:[ |
|
6516 |
contents := f directoryContents. |
|
6517 |
contents isEmpty ifTrue:[ |
|
6518 |
f remove |
|
6519 |
] ifFalse:[ |
|
6520 |
yesToAll ifFalse:[ |
|
6521 |
idx == filesToRemove size ifTrue:[ |
|
6522 |
answer := Dialog |
|
3419 | 6523 |
confirmWithCancel:(resources string:'Directory ''%1'' is not empty\remove anyway ?' with:fileName allBold) withCRs |
6524 |
labels:(resources array:#('Cancel' 'Remove')) |
|
3281 | 6525 |
values:#(false true) |
6526 |
default:2. |
|
6527 |
] ifFalse:[ |
|
6528 |
answer := Dialog |
|
3419 | 6529 |
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
|
6530 |
labels:(resources array:#('Cancel' 'Remove All' 'Remove')) |
3281 | 6531 |
values:#(false #removeAll true) |
6532 |
default:3. |
|
6533 |
]. |
|
6534 |
answer == false ifTrue:[ |
|
6535 |
^ self |
|
6536 |
]. |
|
6537 |
answer == #removeAll ifTrue:[ |
|
6538 |
yesToAll := true |
|
6539 |
]. |
|
6540 |
]. |
|
6541 |
f recursiveRemove |
|
6542 |
]. |
|
6543 |
] ifFalse:[ |
|
6544 |
f removeFile. |
|
6545 |
]. |
|
6546 |
" |
|
6547 |
self show:nil |
|
6548 |
" |
|
6549 |
i := fileList indexOf:fileName. |
|
6550 |
i ~~ 0 ifTrue:[ |
|
6551 |
toRemove add:i. |
|
6552 |
] |
|
6553 |
]. |
|
6554 |
]. |
|
3596
9761af1f3f72
#valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents:
3568
diff
changeset
|
6555 |
] ensure:[ |
3281 | 6556 |
lockUpdate := false. |
6557 |
fileListView setSelection:nil. |
|
6558 |
||
6559 |
"/ |
|
6560 |
"/ remove reverse - otherwise indices are wrong |
|
6561 |
"/ |
|
6562 |
toRemove sort. |
|
6563 |
toRemove reverseDo:[:idx | |
|
6564 |
fileList removeIndex:idx. |
|
6565 |
fileListView removeIndex:idx. |
|
6566 |
]. |
|
6567 |
||
6568 |
updateRunning ifTrue:[ |
|
6569 |
self updateCurrentDirectory |
|
6570 |
] ifFalse:[ |
|
6571 |
" |
|
6572 |
install a new check after some time |
|
6573 |
" |
|
6574 |
needUpdate ifFalse:[timeOfLastCheck := AbsoluteTime now]. |
|
3520
83cf11e1bf32
schedule checkBlock for the right process
Claus Gittinger <cg@exept.de>
parents:
3503
diff
changeset
|
6575 |
self scheduleCheckBlock. |
3281 | 6576 |
] |
2772
84029fca1f3d
use removeFile (a bit faster) if known to be a file
Claus Gittinger <cg@exept.de>
parents:
2771
diff
changeset
|
6577 |
] |
1162 | 6578 |
] |
6579 |
||
1374
b3a1e95a6220
Do not ask for nonempty directory if remove target is a symlink
Stefan Vogel <sv@exept.de>
parents:
1371
diff
changeset
|
6580 |
"Modified: / 20.11.1997 / 17:39:14 / stefan" |
3420 | 6581 |
"Modified: / 16.11.2001 / 00:43:40 / cg" |
1162 | 6582 |
! |
6583 |
||
6584 |
doRename:oldName to:newName |
|
1331
73e712c85588
Handle errors when renaming files.
Stefan Vogel <sv@exept.de>
parents:
1330
diff
changeset
|
6585 |
"rename a file (or directory)" |
1162 | 6586 |
|
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
6587 |
|old new| |
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
6588 |
|
2989 | 6589 |
(oldName isNil or:[newName isNil]) ifTrue:[ |
6590 |
^ self |
|
6591 |
]. |
|
6592 |
(oldName isBlank or:[newName isBlank]) ifTrue:[ |
|
6593 |
^ self |
|
6594 |
]. |
|
6595 |
(oldName = newName) ifTrue:[ |
|
6596 |
^ self |
|
6597 |
]. |
|
6598 |
||
6599 |
old := currentDirectory filenameFor:oldName. |
|
6600 |
new := currentDirectory filenameFor:newName. |
|
6601 |
||
6602 |
OperatingSystem errorSignal handle:[:ex| |
|
3421 | 6603 |
self showAlert:(resources string:'Cannot rename file ''%1'' to %2 !!' |
2989 | 6604 |
with:oldName with:newName) |
6605 |
with:(OperatingSystem lastErrorString) |
|
6606 |
] do:[ |
|
6607 |
new exists ifTrue:[ |
|
6608 |
(self confirm:(resources string:'''%1'' already exists - rename (i.e. overwrite) anyway ?' with:new baseName allBold)) |
|
6609 |
ifFalse:[ |
|
6610 |
^ self |
|
6611 |
] |
|
6612 |
]. |
|
6613 |
old renameTo:new. |
|
6614 |
]. |
|
3206 | 6615 |
|
3007 | 6616 |
self updateCurrentDirectory |
6617 |
"/ self updateCurrentDirectoryIfChanged. |
|
1162 | 6618 |
|
1911
6d1b77eda98f
check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents:
1903
diff
changeset
|
6619 |
"Modified: / 24.9.1997 / 09:20:00 / stefan" |
3421 | 6620 |
"Modified: / 16.11.2001 / 00:44:27 / cg" |
1162 | 6621 |
! ! |
6622 |
||
6623 |
!FileBrowser methodsFor:'private - file type & info'! |
|
6624 |
||
6625 |
fileCommentStrings |
|
6626 |
"return a useful comment definition; based upon the fileName for now" |
|
6627 |
||
3015
84b5619bd78d
comment strings functionality moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
3013
diff
changeset
|
6628 |
^ MIMETypes commentStringsForFilename:currentFileName |
3072 | 6629 |
ifUnknown:[ |
6630 |
"/ st: |
|
6631 |
#('"/' ('"' '"')) |
|
6632 |
] |
|
1162 | 6633 |
! |
6634 |
||
6635 |
fileTypeSpecificActions |
|
6636 |
"any special fileTypeSpecific actions are done here, |
|
6637 |
when a new file is selected" |
|
6638 |
||
6639 |
|commentStrings| |
|
6640 |
||
6641 |
commentStrings := self fileCommentStrings. |
|
6642 |
commentStrings notNil ifTrue:[ |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6643 |
subView perform:#commentStrings: with:commentStrings ifNotUnderstood:nil |
1162 | 6644 |
]. |
6645 |
||
6646 |
"Modified: 7.1.1997 / 20:30:54 / cg" |
|
6647 |
! |
|
6648 |
||
6649 |
getFileInfoString:longInfo |
|
6650 |
"get stat info on selected file - return a string which can be |
|
6651 |
shown in a box" |
|
6652 |
||
3747
d30bc1e54f15
Remove unused vars and asFilename sends
Stefan Vogel <sv@exept.de>
parents:
3746
diff
changeset
|
6653 |
|fileName f text info fileOutput type modeBits modeString s ts| |
1162 | 6654 |
|
6655 |
fileName := self getSelectedFileName. |
|
6656 |
fileName isNil ifTrue:[^ nil]. |
|
6657 |
||
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
6658 |
f := currentDirectory construct:fileName. |
1162 | 6659 |
info := f info. |
6660 |
||
6661 |
info isNil ifTrue:[ |
|
3421 | 6662 |
self showAlert:(resources string:'Cannot get info of ''%1'' !!' with:fileName) |
6663 |
with:(OperatingSystem lastErrorString). |
|
6664 |
^ nil |
|
1162 | 6665 |
]. |
6666 |
||
6667 |
text := StringCollection new. |
|
6668 |
f isSymbolicLink ifTrue:[ |
|
3421 | 6669 |
text add:(resources string:'symbolic link to: %1' with:(f linkInfo path)) |
1162 | 6670 |
]. |
6671 |
||
6672 |
type := info type. |
|
6673 |
(longInfo and:[type == #regular]) ifTrue:[ |
|
3747
d30bc1e54f15
Remove unused vars and asFilename sends
Stefan Vogel <sv@exept.de>
parents:
3746
diff
changeset
|
6674 |
fileOutput := (currentDirectory construct:fileName) fileType. |
1162 | 6675 |
]. |
6676 |
||
6677 |
s := (resources at:'type: '). |
|
6678 |
fileOutput isNil ifTrue:[ |
|
3421 | 6679 |
s := s , type asString |
1162 | 6680 |
] ifFalse:[ |
3421 | 6681 |
s := s , 'regular (' , fileOutput , ')' |
1162 | 6682 |
]. |
6683 |
text add:s. |
|
6684 |
text add:(resources string:'size: %1' with:(info size) printString). |
|
6685 |
||
6686 |
modeBits := info mode. |
|
6687 |
modeString := self getModeString:modeBits. |
|
6688 |
longInfo ifTrue:[ |
|
3421 | 6689 |
text add:(resources string:'access: %1 (%2)' |
6690 |
with:modeString |
|
6691 |
with:(modeBits printStringRadix:8)) |
|
1162 | 6692 |
] ifFalse:[ |
3421 | 6693 |
text add:(resources string:'access: %1' with:modeString) |
1162 | 6694 |
]. |
6695 |
text add:(resources string:'owner: %1' |
|
3421 | 6696 |
with:(OperatingSystem getUserNameFromID:(info uid))). |
1162 | 6697 |
longInfo ifTrue:[ |
3421 | 6698 |
text add:(resources string:'group: %1' |
6699 |
with:(OperatingSystem getGroupNameFromID:(info gid))). |
|
6700 |
||
6701 |
ts := info accessed. |
|
6702 |
text add:(resources string:'last access: %1 %2' |
|
6703 |
with:(ts asTime printString) |
|
6704 |
with:(ts asDate printString)). |
|
6705 |
||
6706 |
ts := info modified. |
|
6707 |
text add:(resources string:'last modification: %1 %2' |
|
6708 |
with:(ts asTime printString) |
|
6709 |
with:(ts asDate printString)). |
|
1162 | 6710 |
]. |
6711 |
^ text asString |
|
6712 |
||
3421 | 6713 |
"Modified: / 8.9.1995 / 11:59:28 / claus" |
6714 |
"Modified: / 18.9.1997 / 16:34:31 / stefan" |
|
6715 |
"Modified: / 16.11.2001 / 00:45:11 / cg" |
|
1162 | 6716 |
! |
6717 |
||
6718 |
getInfoFile |
|
6719 |
"get filename of a description-file (.dir.info, README etc.); |
|
6720 |
This file is automatically shown when a directory is enterred. |
|
6721 |
You can add more names below if you like." |
|
6722 |
||
6723 |
#( |
|
6724 |
'.dir.info' |
|
6725 |
'README' |
|
6726 |
'ReadMe' |
|
6727 |
'Readme' |
|
6728 |
'readme' |
|
6729 |
'read.me' |
|
6730 |
'Read.me' |
|
6731 |
'READ.ME' |
|
1272 | 6732 |
'README.TXT' |
6733 |
'readme.txt' |
|
6734 |
'Readme.txt' |
|
1307 | 6735 |
'Info.txt' |
6736 |
'info.txt' |
|
6737 |
'INFO.TXT' |
|
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
6738 |
) do:[:f | |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6739 |
|n| |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6740 |
n := currentDirectory construct:f. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6741 |
(n isReadable and:[n isDirectory not]) ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6742 |
^ f. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6743 |
] |
1140 | 6744 |
]. |
1162 | 6745 |
^ nil |
6746 |
||
1272 | 6747 |
"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
|
6748 |
"Modified: 16.9.1997 / 15:26:53 / stefan" |
1162 | 6749 |
! |
6750 |
||
6751 |
getModeString:modeBits |
|
6752 |
"convert file-mode bits into a more user-friendly string. |
|
6753 |
This is wrong here - should be moved into OperatingSystem." |
|
6754 |
||
6755 |
^ self getModeString:modeBits |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6756 |
with:#( 'owner:' $r $w $x |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6757 |
' group:' $r $w $x |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6758 |
' others:' $r $w $x ) |
1140 | 6759 |
! |
6760 |
||
1162 | 6761 |
getModeString:modeBits with:texts |
6762 |
"convert file-mode bits into a more user-friendly string. |
|
6763 |
This is wrong here - should be moved into OperatingSystem." |
|
6764 |
||
6765 |
|bits modeString| |
|
6766 |
||
6767 |
bits := modeBits bitAnd:8r777. |
|
6768 |
modeString := ''. |
|
6769 |
||
6770 |
#( nil 8r400 8r200 8r100 nil 8r040 8r020 8r010 nil 8r004 8r002 8r001 ) |
|
6771 |
with: texts do:[:bitMask :access | |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6772 |
|ch| |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6773 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6774 |
bitMask isNil ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6775 |
modeString := modeString , (resources string:access) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6776 |
] ifFalse:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6777 |
(bits bitAnd:bitMask) == 0 ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6778 |
ch := $- |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6779 |
] ifFalse:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6780 |
ch := access |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6781 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6782 |
modeString := modeString copyWith:ch |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6783 |
] |
633
4630175ed31e
double click on .htm / .html files open a viewer;
Claus Gittinger <cg@exept.de>
parents:
585
diff
changeset
|
6784 |
]. |
1162 | 6785 |
^ modeString |
6786 |
! |
|
6787 |
||
6788 |
showInfo |
|
6789 |
"show directory info when dir has changed" |
|
6790 |
||
6791 |
|info txt| |
|
6792 |
||
6793 |
info := self getInfoFile. |
|
6794 |
info notNil ifTrue:[ |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6795 |
txt := self readFile:info |
1162 | 6796 |
]. |
6797 |
self show:txt. |
|
6798 |
! |
|
6799 |
||
6800 |
sizePrintString:size |
|
6801 |
"helper for update-directory to return a string with a files size. |
|
6802 |
This one gives the size in byte, Kb or Mb depending on size. |
|
6803 |
If you dont like this, just uncomment the first statement below." |
|
6804 |
||
6805 |
|unitString n| |
|
6806 |
||
6807 |
" |
|
6808 |
^ size printString. |
|
6809 |
" |
|
6810 |
unitString := ''. |
|
6811 |
size < (500 * 1024) ifTrue:[ |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6812 |
size < 1024 ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6813 |
n := size |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6814 |
] ifFalse:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6815 |
n := (size * 10 // 1024 / 10.0). |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6816 |
unitString := ' Kb' |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6817 |
] |
1162 | 6818 |
] ifFalse:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6819 |
n := (size * 10 // 1024 // 1024 / 10.0). |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6820 |
unitString := ' Mb' |
1162 | 6821 |
]. |
6822 |
^ (n printStringLeftPaddedTo:5) , unitString. |
|
6823 |
! ! |
|
6824 |
||
6825 |
!FileBrowser methodsFor:'private - file-I/O'! |
|
6826 |
||
6827 |
readFile:fileName |
|
6828 |
"read in the file, answer its contents as StringCollection" |
|
6829 |
||
6830 |
^ self readFile:fileName lineDelimiter:Character cr encoding:nil |
|
6831 |
||
6832 |
"Modified: 22.2.1996 / 14:57:08 / cg" |
|
6833 |
! |
|
6834 |
||
6835 |
readFile:fileName lineDelimiter:aCharacter encoding:encoding |
|
6836 |
"read in the file, return its contents as StringCollection. |
|
6837 |
The files lines are delimited by aCharacter. |
|
6838 |
If encoding is nonNil, the file is assumed to be coded according to |
|
6839 |
that symbol, and #decodeString: should be able to convert it." |
|
6840 |
||
1994 | 6841 |
|f stream text msg sz| |
6842 |
||
6843 |
(f := fileName asFilename) isAbsolute ifFalse:[ |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6844 |
f := (currentDirectory construct:fileName) |
1994 | 6845 |
]. |
6846 |
stream := f readStream. |
|
1162 | 6847 |
stream isNil ifTrue:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6848 |
msg := (resources string:'cannot read file ''%1'' !!' with:fileName). |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6849 |
self showAlert:msg with:(FileStream lastErrorString). |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6850 |
^ nil |
1162 | 6851 |
]. |
6852 |
||
6853 |
" |
|
6854 |
for very big files, give ObjectMemory a hint, to preallocate more |
|
6855 |
" |
|
1311 | 6856 |
(sz := stream fileSize) > 1000000 ifTrue:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6857 |
Processor activeProcess withPriority:Processor userBackgroundPriority do:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6858 |
ObjectMemory announceSpaceNeed:(sz + (sz // 5)) "/ add 20% for tab expansion |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6859 |
]. |
1162 | 6860 |
]. |
6861 |
||
6862 |
text := self readStream:stream lineDelimiter:aCharacter encoding:encoding. |
|
6863 |
stream close. |
|
6864 |
^ text |
|
6865 |
||
1994 | 6866 |
"Created: / 22.2.1996 / 14:56:48 / cg" |
6867 |
"Modified: / 18.9.1997 / 17:06:54 / stefan" |
|
6868 |
"Modified: / 4.2.1999 / 17:52:18 / cg" |
|
1162 | 6869 |
! |
6870 |
||
6871 |
readStream:aStream |
|
6872 |
"read in from aStream, answer its contents as StringCollection" |
|
6873 |
||
6874 |
^ self readStream:aStream lineDelimiter:Character cr encoding:nil |
|
6875 |
||
6876 |
"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
|
6877 |
! |
4630175ed31e
double click on .htm / .html files open a viewer;
Claus Gittinger <cg@exept.de>
parents:
585
diff
changeset
|
6878 |
|
1162 | 6879 |
readStream:aStream lineDelimiter:aCharacter encoding:encoding |
6880 |
"read from aStream, answer its contents as StringCollection. |
|
6881 |
The files lines are delimited by aCharacter. |
|
6882 |
If encoding is nonNil, the file is assumed to be coded according to |
|
6883 |
that symbol, and #decodeString: should be able to convert it." |
|
6884 |
||
6885 |
|text line enc| |
|
6886 |
||
6887 |
text := StringCollection new. |
|
6888 |
||
6889 |
enc := encoding. |
|
6890 |
enc == #iso8859 ifTrue:[ |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6891 |
enc := nil |
1162 | 6892 |
]. |
6893 |
||
6894 |
aCharacter == Character cr ifTrue:[ |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6895 |
FileStream lineTooLongErrorSignal handle:[:ex | |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6896 |
|s partialLine| |
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 |
s := ex parameter at:1. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6899 |
partialLine := ex parameter at:2. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6900 |
ex proceedWith:(partialLine , s upTo:aCharacter) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6901 |
] do:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6902 |
[aStream atEnd] whileFalse:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6903 |
line := aStream nextLine withTabsExpanded. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6904 |
enc notNil ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6905 |
line := line decodeFrom:enc |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6906 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6907 |
text add:line |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6908 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6909 |
]. |
1162 | 6910 |
] ifFalse:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6911 |
[aStream atEnd] whileFalse:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6912 |
line := (aStream upTo:aCharacter) withTabsExpanded. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6913 |
enc notNil ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6914 |
line := line decodeFrom:enc |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6915 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6916 |
text add:line |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6917 |
]. |
633
4630175ed31e
double click on .htm / .html files open a viewer;
Claus Gittinger <cg@exept.de>
parents:
585
diff
changeset
|
6918 |
]. |
1162 | 6919 |
^ text |
6920 |
||
1994 | 6921 |
"Created: / 22.2.1996 / 14:58:25 / cg" |
6922 |
"Modified: / 5.2.1999 / 00:53:22 / cg" |
|
1162 | 6923 |
! |
6924 |
||
6925 |
showFile:fileName |
|
6926 |
"show contents of fileName in subView" |
|
6927 |
||
1689 | 6928 |
fileListView selection:(fileList indexOf:fileName). |
6929 |
self fileGet |
|
6930 |
||
6931 |
"Modified: / 17.6.1998 / 11:26:13 / cg" |
|
1162 | 6932 |
! |
6933 |
||
6934 |
showFile:fileName insert:insert encoding:encoding |
|
6935 |
"show/insert contents of fileName in subView" |
|
6936 |
||
6937 |
^ self |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
6938 |
showFile:fileName insert:insert encoding:encoding doubleClick:false |
1162 | 6939 |
|
6940 |
"Modified: 19.6.1996 / 09:40:19 / cg" |
|
6941 |
! |
|
6942 |
||
3414 | 6943 |
showFile:fileNameString insert:insert encoding:encoding doubleClick:viaDoubleClick |
1162 | 6944 |
"show/insert contents of fileName in subView" |
6945 |
||
3527 | 6946 |
|path buffer s n ok convert text msg eol guess action enc |
3414 | 6947 |
fontsEncoding pref failWarning f answer fileName| |
6948 |
||
6949 |
fileName := fileNameString asFilename. |
|
6950 |
||
6951 |
fileName isAbsolute ifFalse:[ |
|
6952 |
path := currentDirectory filenameFor:fileNameString. |
|
1994 | 6953 |
] ifTrue:[ |
3414 | 6954 |
path := fileName asAbsoluteFilename |
1994 | 6955 |
]. |
6956 |
||
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
6957 |
(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
|
6958 |
"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
|
6959 |
path exists ifFalse:[ |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
6960 |
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
|
6961 |
] ifTrue:[ |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
6962 |
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
|
6963 |
]. |
3528 | 6964 |
msg := (resources string:msg) withCRs. |
6965 |
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
|
6966 |
^ self |
1162 | 6967 |
]. |
6968 |
||
6969 |
"/ |
|
6970 |
"/ check if file is a text file |
|
6971 |
"/ |
|
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
6972 |
s := path readStream. |
1162 | 6973 |
s isNil ifTrue:[ |
3697
e2f7d8dec6e2
menu items/button labels uppercase-first
Claus Gittinger <cg@exept.de>
parents:
3691
diff
changeset
|
6974 |
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
|
6975 |
with:(FileStream lastErrorString). |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
6976 |
^ nil |
1162 | 6977 |
]. |
6978 |
||
1222
f2952fc3ced9
look at more when guessing the encoding
Claus Gittinger <cg@exept.de>
parents:
1221
diff
changeset
|
6979 |
buffer := String new:4096. |
f2952fc3ced9
look at more when guessing the encoding
Claus Gittinger <cg@exept.de>
parents:
1221
diff
changeset
|
6980 |
n := s nextBytes:4096 into:buffer. |
1162 | 6981 |
s close. |
6982 |
||
6983 |
enc := encoding. |
|
6984 |
ok := true. |
|
6985 |
guess := self guessEncodingFrom:buffer. |
|
6986 |
||
6987 |
guess == #binary ifTrue:[ |
|
2158
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
6988 |
ok := false. |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
6989 |
viaDoubleClick ifTrue:[ |
3414 | 6990 |
(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
|
6991 |
]. |
3414 | 6992 |
answer := self confirmWithCancel:(resources string:'''%1'' seems to be a binary file (or unsupported format) - show anyway ?' with:fileNameString). |
3061 | 6993 |
answer == false ifTrue:[^ self]. |
6994 |
answer isNil ifTrue:[AbortSignal raise]. |
|
1162 | 6995 |
] ifFalse:[ |
2158
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
6996 |
viaDoubleClick ifTrue:[ |
3414 | 6997 |
(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
|
6998 |
]. |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
6999 |
|
3413 | 7000 |
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
|
7001 |
pref := self preferredFontEncodingFor:guess. |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
7002 |
|
3381
2a0331ea6dfc
stupid encoding question eliminated
Claus Gittinger <cg@exept.de>
parents:
3342
diff
changeset
|
7003 |
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
|
7004 |
ok ifFalse:[ |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
7005 |
pref = 'iso8859*' ifTrue:[ |
3381
2a0331ea6dfc
stupid encoding question eliminated
Claus Gittinger <cg@exept.de>
parents:
3342
diff
changeset
|
7006 |
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
|
7007 |
] |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
7008 |
]. |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
7009 |
ok ifTrue:[ |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
7010 |
fileEncoding := guess. |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
7011 |
enc := guess. |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
7012 |
] ifFalse:[ |
2779 | 7013 |
doNotShowFontDialog == true ifTrue:[ |
7014 |
action := #show |
|
7015 |
] ifFalse:[ |
|
3414 | 7016 |
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
|
7017 |
labels:(resources array:#('Cancel' 'Show' 'Dont Ask Again' 'Change Font')) |
2779 | 7018 |
values:#(nil #show #showAlways #encoding) |
7019 |
default:#encoding. |
|
7020 |
]. |
|
7021 |
action == #showAlways ifTrue:[ |
|
7022 |
doNotShowFontDialog := true. |
|
7023 |
action := #show. |
|
7024 |
]. |
|
2158
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
7025 |
action isNil ifTrue:[^ self]. |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
7026 |
action == #encoding ifTrue:[ |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
7027 |
fileEncoding := guess asSymbol. |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
7028 |
subView externalEncoding:fileEncoding. |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
7029 |
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
|
7030 |
] ifFalse:[ |
2779 | 7031 |
doNotShowFontDialog ~~ true ifTrue:[ |
7032 |
self information:(resources string:'Individual characters may be invisible/wrong in this font.') |
|
7033 |
] |
|
2158
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
7034 |
]. |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
7035 |
enc := fileEncoding. |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
7036 |
]. |
1162 | 7037 |
]. |
7038 |
||
7039 |
convert := false. |
|
1329 | 7040 |
"/ ok ifTrue:[ |
7041 |
"/ "/ |
|
7042 |
"/ "/ check if line delimiter is a cr |
|
7043 |
"/ "/ |
|
7044 |
"/ i := buffer indexOf:Character cr. |
|
7045 |
"/ i == 0 ifTrue:[ |
|
7046 |
"/ "/ |
|
7047 |
"/ "/ no newline found - try cr |
|
7048 |
"/ "/ |
|
7049 |
"/ i := buffer indexOf:(Character value:13). |
|
7050 |
"/ i ~~ 0 ifTrue:[ |
|
3414 | 7051 |
"/ convert := self confirm:(resources string:'''%1'' seems to have CR as line delimiter - convert to NL ?' with:fileNameString). |
1329 | 7052 |
"/ ] |
7053 |
"/ ] |
|
7054 |
"/ ]. |
|
1162 | 7055 |
|
7056 |
insert ifFalse:[ |
|
2158
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
7057 |
"/ release old text first |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
7058 |
"/ - 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
|
7059 |
"/ (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
|
7060 |
"/ 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
|
7061 |
|
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
7062 |
subView contents:nil. |
1162 | 7063 |
]. |
7064 |
||
7065 |
convert ifTrue:[ |
|
2158
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
7066 |
eol := Character value:13 |
1162 | 7067 |
] ifFalse:[ |
2158
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
7068 |
eol := Character cr |
1162 | 7069 |
]. |
1212 | 7070 |
|
1214
02d5bbd925dd
allow decoding errors to be ignored
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
7071 |
failWarning := false. |
1212 | 7072 |
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
|
7073 |
|errStr| |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
7074 |
|
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
7075 |
failWarning ifFalse:[ |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
7076 |
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
|
7077 |
(self confirm:(resources |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
7078 |
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
|
7079 |
with:errStr) withCRs) |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
7080 |
ifFalse:[ |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
7081 |
^ self |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
7082 |
]. |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
7083 |
failWarning := true. |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
7084 |
]. |
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
7085 |
ex proceed. |
1212 | 7086 |
] do:[ |
3414 | 7087 |
text := self readFile:fileNameString lineDelimiter:eol encoding:enc. |
1212 | 7088 |
]. |
1162 | 7089 |
|
7090 |
insert ifFalse:[ |
|
3414 | 7091 |
(f := fileName) isAbsolute ifFalse:[ |
7092 |
f := (currentDirectory construct:fileNameString) |
|
2951
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
7093 |
]. |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
7094 |
self class addToVisitedFileHistory:f pathName. |
f2dff3a912ef
keep history of edited files
Claus Gittinger <cg@exept.de>
parents:
2939
diff
changeset
|
7095 |
|
2158
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
7096 |
self show:text |
1162 | 7097 |
] ifTrue:[ |
2158
edf13d7fd732
give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
7098 |
subView insertSelectedStringAtCursor:text asString |
1162 | 7099 |
]. |
7100 |
||
1994 | 7101 |
"Created: / 19.6.1996 / 09:39:52 / cg" |
7102 |
"Modified: / 18.9.1997 / 17:10:20 / stefan" |
|
3414 | 7103 |
"Modified: / 15.11.2001 / 17:15:27 / cg" |
1162 | 7104 |
! |
7105 |
||
7106 |
writeFile:fileName text:someText encoding:encoding |
|
1353 | 7107 |
|stream errReason msg startNr nLines string| |
7108 |
||
7109 |
errReason := ''. |
|
7110 |
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
|
7111 |
errReason := ex errorString. |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
7112 |
ex return. |
1353 | 7113 |
] do:[ |
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
7114 |
stream := (currentDirectory filenameFor:fileName) writeStream. |
1353 | 7115 |
]. |
1162 | 7116 |
stream isNil ifTrue:[ |
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
7117 |
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
|
7118 |
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
|
7119 |
^ self. |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
7120 |
]. |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
7121 |
|
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
7122 |
dosEOLMode value == true ifTrue:[ |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
7123 |
stream eolMode:#crlf. |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
7124 |
"/ must do it lineWise ... |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
7125 |
someText asStringCollection do:[:line | |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
7126 |
line notNil ifTrue:[ |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
7127 |
stream nextPutAll:line |
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 |
stream cr |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
7130 |
] |
1162 | 7131 |
] ifFalse:[ |
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
7132 |
(someText isString) ifTrue:[ |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
7133 |
stream nextPutAll:someText. |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
7134 |
] ifFalse:[ |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
7135 |
"/ |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
7136 |
"/ 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
|
7137 |
"/ 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
|
7138 |
"/ 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
|
7139 |
"/ |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
7140 |
startNr := 1. |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
7141 |
nLines := someText size. |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
7142 |
[startNr <= nLines] whileTrue:[ |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
7143 |
string := someText asStringWithCRsFrom:startNr |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
7144 |
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
|
7145 |
compressTabs:compressTabs. |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
7146 |
encoding notNil ifTrue:[ |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
7147 |
string := string encodeInto:encoding |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
7148 |
]. |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
7149 |
stream nextPutAll:string. |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
7150 |
startNr := startNr + 1000 + 1. |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
7151 |
]. |
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
7152 |
]. |
1353 | 7153 |
]. |
7154 |
||
7155 |
stream close. |
|
7156 |
subView modified:false |
|
1162 | 7157 |
|
2142
8897f7ed79fc
added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
7158 |
"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
|
7159 |
"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
|
7160 |
"Modified: / 6.5.1999 / 11:45:50 / cg" |
1140 | 7161 |
! ! |
7162 |
||
7163 |
!FileBrowser methodsFor:'private - presentation'! |
|
7164 |
||
7165 |
defineTabulatorsForLongList |
|
7166 |
"define the tabs for the long list" |
|
7167 |
||
7168 |
tabSpec := TabulatorSpecification new. |
|
7169 |
tabSpec unit:#inch. |
|
7170 |
"/ tabSpec positions:#(0 0.25 2.3 4.3 5.3 6.0 6.5). |
|
7171 |
tabSpec widths: #(0.25 2 2.0 1 0.5 0.5 1"any"). |
|
7172 |
" icon name mode owner group size type" |
|
7173 |
tabSpec align: #(#left #left #left #right #right #decimal #left). |
|
7174 |
tabSpec addDependent:self. |
|
7175 |
||
7176 |
tabRulerView tabulatorSpecification:tabSpec. |
|
7177 |
||
7178 |
"Modified: 17.4.1997 / 02:56:07 / cg" |
|
172 | 7179 |
! |
7180 |
||
1140 | 7181 |
defineTabulatorsForShortList |
7182 |
"define the tabs for the short list" |
|
7183 |
||
7184 |
tabSpec := TabulatorSpecification new. |
|
7185 |
tabSpec unit:#inch. |
|
7186 |
"/ tabSpec positions:#(0 0.25 ). |
|
7187 |
tabSpec widths: #(0.25 2 ). |
|
7188 |
" icon name" |
|
7189 |
tabSpec align: #(#left #left). |
|
7190 |
tabSpec addDependent:self. |
|
7191 |
||
1758 | 7192 |
tabRulerView notNil ifTrue:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7193 |
tabRulerView tabulatorSpecification:tabSpec. |
1758 | 7194 |
]. |
7195 |
||
7196 |
"Created: / 17.4.1997 / 02:51:41 / cg" |
|
7197 |
"Modified: / 27.7.1998 / 20:23:34 / cg" |
|
1140 | 7198 |
! |
7199 |
||
7200 |
iconForFile:aFilenameString |
|
1147 | 7201 |
"given a fileName, return an appropriate icon" |
7202 |
||
1784
329e3a904236
ask MIMETypes when mapping suffixes to icons.
Claus Gittinger <cg@exept.de>
parents:
1758
diff
changeset
|
7203 |
|f icn key key2 suff mimeType| |
1140 | 7204 |
|
1324
9f016fbbae01
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
1320
diff
changeset
|
7205 |
f := currentDirectory construct:aFilenameString. |
1140 | 7206 |
f isDirectory ifTrue:[ |
2187
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
7207 |
f isSymbolicLink ifTrue:[ |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
7208 |
key := #directoryLink |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
7209 |
] ifFalse:[ |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
7210 |
key := #directory. |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
7211 |
(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
|
7212 |
key := #directoryLocked |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
7213 |
]. |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
7214 |
] |
1147 | 7215 |
] ifFalse:[ |
2187
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
7216 |
f isSymbolicLink ifTrue:[ |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
7217 |
f isReadable not ifTrue:[ |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
7218 |
key := #fileLocked |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
7219 |
] ifFalse:[ |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
7220 |
key := #fileLink |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
7221 |
] |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
7222 |
] ifFalse:[ |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
7223 |
key := key2 := #file. |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
7224 |
f isExecutableProgram ifTrue:[ |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
7225 |
key := key2 := #executableFile |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
7226 |
]. |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
7227 |
(f isReadable not) ifTrue:[ |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
7228 |
key := #fileLocked |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
7229 |
] ifFalse:[ |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
7230 |
suff := f suffix. |
2504 | 7231 |
(suff = 'bak' or:[suff = 'sav']) ifTrue:[ |
7232 |
suff := f withoutSuffix suffix. |
|
7233 |
]. |
|
7234 |
suff size > 0 ifTrue:[ |
|
7235 |
mimeType := MIMETypes mimeTypeForSuffix:suff. |
|
7236 |
mimeType notNil ifTrue:[ |
|
7237 |
(mimeType startsWith:'image/') ifTrue:[ |
|
7238 |
key := #imageFile |
|
7239 |
] ifFalse:[ |
|
7240 |
(mimeType startsWith:'text/') ifTrue:[ |
|
7241 |
key := #textFile |
|
7242 |
] |
|
2187
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
7243 |
] |
2504 | 7244 |
]. |
2187
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
7245 |
]. |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
7246 |
]. |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
7247 |
]. |
1141 | 7248 |
]. |
1147 | 7249 |
|
1784
329e3a904236
ask MIMETypes when mapping suffixes to icons.
Claus Gittinger <cg@exept.de>
parents:
1758
diff
changeset
|
7250 |
"/ local (device) icons |
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. |
2796 | 7254 |
] ifFalse:[ |
7255 |
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
|
7256 |
]. |
2796 | 7257 |
icn notNil ifTrue:[^ icn]. |
1141 | 7258 |
]. |
1495 | 7259 |
|
1784
329e3a904236
ask MIMETypes when mapping suffixes to icons.
Claus Gittinger <cg@exept.de>
parents:
1758
diff
changeset
|
7260 |
"/ global icons |
329e3a904236
ask MIMETypes when mapping suffixes to icons.
Claus Gittinger <cg@exept.de>
parents:
1758
diff
changeset
|
7261 |
|
329e3a904236
ask MIMETypes when mapping suffixes to icons.
Claus Gittinger <cg@exept.de>
parents:
1758
diff
changeset
|
7262 |
Icons notNil ifTrue:[ |
2187
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
7263 |
mimeType notNil ifTrue:[ |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
7264 |
icn := Icons at:mimeType ifAbsent:nil. |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
7265 |
"/ sight - check for parent-MIME types ... |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
7266 |
|
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
7267 |
[icn isNil and:[mimeType includes:$/]] whileTrue:[ |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
7268 |
mimeType := mimeType copyTo:(mimeType lastIndexOf:$/) - 1. |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
7269 |
icn := Icons at:mimeType ifAbsent:nil. |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
7270 |
]. |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
7271 |
]. |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
7272 |
icn notNil ifTrue:[ |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
7273 |
key := mimeType |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
7274 |
] ifFalse:[ |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
7275 |
icn := Icons at:key ifAbsent:nil. |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
7276 |
]. |
1784
329e3a904236
ask MIMETypes when mapping suffixes to icons.
Claus Gittinger <cg@exept.de>
parents:
1758
diff
changeset
|
7277 |
]. |
1495 | 7278 |
|
1253 | 7279 |
icn isNil ifTrue:[ |
2187
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
7280 |
( (key := key2) isNil |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
7281 |
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
|
7282 |
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
|
7283 |
) ifTrue:[ |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
7284 |
^ icn |
59aff09bfc2d
added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents:
2186
diff
changeset
|
7285 |
] |
1253 | 7286 |
]. |
1495 | 7287 |
|
1784
329e3a904236
ask MIMETypes when mapping suffixes to icons.
Claus Gittinger <cg@exept.de>
parents:
1758
diff
changeset
|
7288 |
"/ remember device icon |
329e3a904236
ask MIMETypes when mapping suffixes to icons.
Claus Gittinger <cg@exept.de>
parents:
1758
diff
changeset
|
7289 |
icn := icn copy onDevice:device. |
1495 | 7290 |
icn clearMaskedPixels. |
7291 |
icons at:key put:icn. |
|
1239
e58e2cb6639a
allow specification of icons from resource file.
Claus Gittinger <cg@exept.de>
parents:
1235
diff
changeset
|
7292 |
^ icn |
1141 | 7293 |
|
1746
68a187e3f30f
another icon for executable files.
Claus Gittinger <cg@exept.de>
parents:
1737
diff
changeset
|
7294 |
"Modified: / 18.9.1997 / 16:35:28 / stefan" |
2504 | 7295 |
"Modified: / 23.12.1999 / 22:28:00 / cg" |
36 | 7296 |
! |
7297 |
||
2094 | 7298 |
stopImageRenderProcess |
7299 |
imageRenderProcess notNil ifTrue:[ |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7300 |
imageRenderProcess terminate. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7301 |
imageRenderProcess := nil |
2094 | 7302 |
]. |
7303 |
||
7304 |
"Created: 19.4.1997 / 13:51:34 / cg" |
|
7305 |
! |
|
7306 |
||
1156
f3df28086973
dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents:
1154
diff
changeset
|
7307 |
stopUpdateProcess |
f3df28086973
dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents:
1154
diff
changeset
|
7308 |
Processor removeTimedBlock:checkBlock. |
f3df28086973
dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents:
1154
diff
changeset
|
7309 |
listUpdateProcess notNil ifTrue:[ |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7310 |
listUpdateProcess terminate. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7311 |
listUpdateProcess := nil. |
1156
f3df28086973
dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents:
1154
diff
changeset
|
7312 |
]. |
f3df28086973
dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents:
1154
diff
changeset
|
7313 |
|
f3df28086973
dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents:
1154
diff
changeset
|
7314 |
"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
|
7315 |
! |
f3df28086973
dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents:
1154
diff
changeset
|
7316 |
|
36 | 7317 |
updateCurrentDirectory |
7318 |
"update listView with directory contents" |
|
7319 |
||
49 | 7320 |
"the code below may look somewhat complex - |
7321 |
it reads the directory first for the names, |
|
1151
194b10bad6da
great asynchronous list update;
Claus Gittinger <cg@exept.de>
parents:
1147
diff
changeset
|
7322 |
then (in followup sweeps over the files) gets the |
194b10bad6da
great asynchronous list update;
Claus Gittinger <cg@exept.de>
parents:
1147
diff
changeset
|
7323 |
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
|
7324 |
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
|
7325 |
(i.e. stat-calls) may take long - especially on NFS-mounted directories. |
49 | 7326 |
The file reading is done at lower priority, to let user continue |
7327 |
his work in other views. However, to be fair to other fileBrowser, |
|
7328 |
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
|
7329 |
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
|
7330 |
Therefore, browsers which read short directories will finish first. |
49 | 7331 |
ST/X users love this behavior ;-) |
7332 |
" |
|
7333 |
||
3665 | 7334 |
|files matchPattern list passDone ignoreCase oldSelection newSelection times types| |
3419 | 7335 |
|
294 | 7336 |
self withReadCursorDo:[ |
2255
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7337 |
self stopUpdateProcess. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7338 |
|
2636 | 7339 |
timeOfLastCheck := currentDirectory modificationTime. |
2255
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 |
files := currentDirectory asFilename fullDirectoryContents. |
1329 | 7342 |
|
7343 |
"/ (files includes:(Filename parentDirectoryName)) ifTrue:[ |
|
7344 |
"/ upButton enable. |
|
7345 |
"/ ] ifFalse:[ |
|
7346 |
"/ upButton disable. |
|
7347 |
"/ ]. |
|
7348 |
||
2255
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7349 |
"/ show files which are either directories |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7350 |
"/ or match the current pattern |
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 |
matchPattern := filterField contents. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7353 |
(matchPattern notNil and:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7354 |
matchPattern isEmpty not and:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7355 |
matchPattern ~= '*']]) ifTrue:[ |
2498
77c52f2004a4
care for case-insensitive systems in pattern-match (windows)
Claus Gittinger <cg@exept.de>
parents:
2492
diff
changeset
|
7356 |
ignoreCase := Filename isCaseSensitive not. |
2255
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7357 |
files := files select:[:aName | |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7358 |
((currentDirectory construct:aName) isDirectory) |
2498
77c52f2004a4
care for case-insensitive systems in pattern-match (windows)
Claus Gittinger <cg@exept.de>
parents:
2492
diff
changeset
|
7359 |
or:[matchPattern compoundMatch:aName ignoreCase:ignoreCase] |
2255
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7360 |
]. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7361 |
]. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7362 |
|
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7363 |
files size == 0 ifTrue:[ |
3528 | 7364 |
Dialog warn:((resources string:'Directory ''%1'' is gone.') |
7365 |
withCRs |
|
7366 |
bindWith:currentDirectory pathName allBold). |
|
2255
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7367 |
^ self |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7368 |
]. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7369 |
(sortByWhat value == #name) ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7370 |
sortCaseless value == true ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7371 |
files sort:[:a :b | a asLowercase < b asLowercase] |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7372 |
] ifFalse:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7373 |
files sort. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7374 |
] |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7375 |
] ifFalse:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7376 |
(sortByWhat value == #time) ifTrue:[ |
3665 | 7377 |
times := Dictionary new. |
7378 |
files do:[:fn | |t f| |
|
7379 |
f := currentDirectory construct:fn. |
|
7380 |
t := f isSymbolicLink |
|
7381 |
ifFalse:[f modificationTime] |
|
7382 |
ifTrue:[f linkInfo modified]. |
|
7383 |
t isNil ifTrue:[t := AbsoluteTime now]. |
|
7384 |
times at:fn put:t. |
|
7385 |
]. |
|
2255
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7386 |
files sort:[:a :b | |f1 f2 t1 t2| |
3665 | 7387 |
t1 := times at:a. |
7388 |
t2 := times at:b. |
|
7389 |
||
7390 |
"/ f1 := (currentDirectory construct:a). |
|
7391 |
"/ f2 := (currentDirectory construct:b). |
|
7392 |
"/ t1 := f1 isSymbolicLink |
|
7393 |
"/ ifFalse:[f1 modificationTime] |
|
7394 |
"/ ifTrue:[f1 linkInfo modified]. |
|
7395 |
"/ t2 := f2 isSymbolicLink |
|
7396 |
"/ ifFalse:[f2 modificationTime] |
|
7397 |
"/ ifTrue:[f2 linkInfo modified]. |
|
7398 |
"/ t1 := t1 ? (AbsoluteTime now). |
|
7399 |
"/ t2 := t2 ? (AbsoluteTime now). |
|
2255
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7400 |
t1 > t2 |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7401 |
] |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7402 |
] ifFalse:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7403 |
(sortByWhat value == #type) ifTrue:[ |
3665 | 7404 |
types := Dictionary new. |
7405 |
files do:[:fn | |t f| |
|
7406 |
f := currentDirectory construct:fn. |
|
7407 |
t := f type ? #xbadLink. |
|
7408 |
types at:fn put:t. |
|
7409 |
]. |
|
2255
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7410 |
files sort:[:a :b | |f1 f2 t1 t2 suff1 suff2| |
3665 | 7411 |
t1 := types at:a. |
7412 |
t2 := types at:b. |
|
7413 |
"/ f1 := (currentDirectory construct:a). |
|
7414 |
"/ f2 := (currentDirectory construct:b). |
|
7415 |
"/ t1 := f1 type ? #xbadLink. |
|
7416 |
"/ t2 := f2 type ? #xbadLink. |
|
2255
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7417 |
t1 = t2 ifTrue:[ |
3665 | 7418 |
f1 := (currentDirectory construct:a). |
7419 |
f2 := (currentDirectory construct:b). |
|
2255
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7420 |
suff1 := f1 suffix. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7421 |
suff2 := f2 suffix. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7422 |
suff1 = suff2 ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7423 |
sortCaseless value == true ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7424 |
a asLowercase < b asLowercase |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7425 |
] ifFalse:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7426 |
a < b |
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:[ |
3665 | 7429 |
suff1 asLowercase = suff2 asLowercase ifTrue:[ |
7430 |
sortCaseless value == true ifTrue:[ |
|
7431 |
a asLowercase < b asLowercase |
|
7432 |
] ifFalse:[ |
|
7433 |
a < b |
|
7434 |
] |
|
7435 |
] ifFalse:[ |
|
7436 |
suff1 asLowercase < suff2 asLowercase |
|
7437 |
] |
|
2255
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 |
] ifFalse:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7440 |
t1 < t2 |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7441 |
] |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7442 |
] |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7443 |
] |
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 |
files := self withoutHiddenFiles:files. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7448 |
fileList := files copy. |
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 |
tabSpec isNil ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7451 |
showingDetails value "showLongList" ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7452 |
self defineTabulatorsForLongList |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7453 |
] ifFalse:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7454 |
self defineTabulatorsForShortList |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7455 |
]. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7456 |
]. |
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 |
"/ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7459 |
"/ 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
|
7460 |
"/ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7461 |
list := files collect:[:fileName | |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7462 |
|entry| |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7463 |
|
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7464 |
entry := MultiColListEntry new. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7465 |
entry tabulatorSpecification:tabSpec. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7466 |
entry colAt:1 put:nil. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7467 |
entry colAt:2 put:fileName. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7468 |
]. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7469 |
|
3206 | 7470 |
oldSelection := fileListView selectionValue. |
2255
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7471 |
fileListView setList:list expandTabs:false. |
3206 | 7472 |
newSelection := oldSelection collect:[:nm | list indexOf:nm]. |
7473 |
fileListView selectWithoutScroll:newSelection. |
|
7474 |
||
2255
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7475 |
passDone := Array new:list size withAll:0. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7476 |
|
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7477 |
" |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7478 |
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
|
7479 |
NFS-mounted directory); therefore, start a low prio process, |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7480 |
which fills in the remaining fields in the fileList ... |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7481 |
" |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7482 |
|
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7483 |
listUpdateProcess := [ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7484 |
|prevUid prevGid fileNameString nameString groupString |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7485 |
modeString info line len |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7486 |
anyImages lineIndex aFileName |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7487 |
entry typ f p typeString done endIndex |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7488 |
state stopAtEnd nextState img prevFirstLine prevLastLine |
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7489 |
numVisible dirSuffix prevWidth t| |
2255
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 |
dirSuffix := Filename directorySuffix. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7492 |
dirSuffix size > 0 ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7493 |
dirSuffix := '.' , dirSuffix asLowercase. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7494 |
]. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7495 |
|
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7496 |
"/ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7497 |
"/ then walk over the files, adding more info |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7498 |
"/ (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
|
7499 |
"/ Visible items are always filled first. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7500 |
|
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7501 |
"/ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7502 |
"/ the state machine |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7503 |
"/ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7504 |
nextState := IdentityDictionary new. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7505 |
showingDetails value "showLongList" ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7506 |
nextState add:(#visibleIcons -> #visibleAttributes). |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7507 |
nextState add:(#visibleAttributes -> #visibleTypes). |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7508 |
nextState add:(#visibleTypes -> #visibleImages). |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7509 |
nextState add:(#visibleImages -> #nextPageIcons). |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7510 |
|
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7511 |
nextState add:(#nextPageIcons -> #nextPageAttributes). |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7512 |
nextState add:(#nextPageAttributes -> #nextPageTypes). |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7513 |
nextState add:(#nextPageTypes -> #nextPageImages). |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7514 |
nextState add:(#nextPageImages -> #previousPageIcons). |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7515 |
|
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7516 |
nextState add:(#previousPageIcons -> #previousPageAttributes). |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7517 |
nextState add:(#previousPageAttributes -> #previousPageTypes). |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7518 |
nextState add:(#previousPageTypes -> #previousPageImages). |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7519 |
nextState add:(#previousPageImages -> #remainingIcons). |
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 |
nextState add:(#remainingIcons -> #remainingAttributes). |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7522 |
nextState add:(#remainingAttributes -> #remainingTypes). |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7523 |
nextState add:(#remainingTypes -> #remainingImages). |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7524 |
nextState add:(#remainingImages -> nil). |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7525 |
] ifFalse:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7526 |
nextState add:(#visibleIcons -> #nextPageIcons). |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7527 |
nextState add:(#nextPageIcons -> #previousPageIcons). |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7528 |
nextState add:(#previousPageIcons -> #remainingIcons). |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7529 |
nextState add:(#remainingIcons -> nil). |
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 |
|
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7532 |
anyImages := false. |
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 |
lineIndex := prevFirstLine := fileListView firstLineShown. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7535 |
endIndex := prevLastLine := fileListView lastLineShown. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7536 |
endIndex := endIndex min:(files size). |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7537 |
state := #visibleIcons. |
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 |
done := false. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7540 |
[done] whileFalse:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7541 |
"/ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7542 |
"/ if multiple FileBrowsers are reading, let others |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7543 |
"/ make some progress too |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7544 |
"/ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7545 |
Processor yield. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7546 |
|
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7547 |
"/ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7548 |
"/ could be destroyed in the meanwhile ... |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7549 |
"/ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7550 |
realized ifFalse:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7551 |
listUpdateProcess := nil. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7552 |
Processor activeProcess terminate |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7553 |
]. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7554 |
|
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7555 |
((prevFirstLine ~~ fileListView firstLineShown) |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7556 |
or:[prevLastLine ~~ fileListView lastLineShown]) ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7557 |
"/ start all over again |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7558 |
lineIndex := prevFirstLine := fileListView firstLineShown. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7559 |
endIndex := prevLastLine := fileListView lastLineShown. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7560 |
endIndex := endIndex min:(files size). |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7561 |
state := #visibleIcons. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7562 |
]. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7563 |
|
2257
02dc5c0000e1
oops - must send size-changeNotification manually
Claus Gittinger <cg@exept.de>
parents:
2256
diff
changeset
|
7564 |
showingDetails value ifTrue:[ |
02dc5c0000e1
oops - must send size-changeNotification manually
Claus Gittinger <cg@exept.de>
parents:
2256
diff
changeset
|
7565 |
prevWidth := fileListView widthOfContents. |
02dc5c0000e1
oops - must send size-changeNotification manually
Claus Gittinger <cg@exept.de>
parents:
2256
diff
changeset
|
7566 |
]. |
02dc5c0000e1
oops - must send size-changeNotification manually
Claus Gittinger <cg@exept.de>
parents:
2256
diff
changeset
|
7567 |
|
2255
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7568 |
(lineIndex between:1 and:(files size)) ifTrue:[ |
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 |
"/ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7571 |
"/ expand the next entry ... |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7572 |
"/ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7573 |
aFileName := files at:lineIndex. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7574 |
entry := fileListView at:lineIndex. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7575 |
f := currentDirectory construct:aFileName. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7576 |
|
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7577 |
(state endsWith:'Icons') ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7578 |
"/ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7579 |
"/ pass 1 - icons |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7580 |
"/ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7581 |
(passDone at:lineIndex) < 1 ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7582 |
(f isDirectory |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7583 |
and:[(aFileName ~= '..') and:[aFileName ~= '.']] |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7584 |
) ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7585 |
|
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7586 |
"/ the following suffix cutOff is not really required, |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7587 |
"/ but makes the list look better on VMS ... |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7588 |
fileNameString := aFileName. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7589 |
dirSuffix notNil ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7590 |
(aFileName asLowercase endsWith:dirSuffix) ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7591 |
fileNameString := aFileName copyWithoutLast:(dirSuffix size). |
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 |
fileNameString := fileNameString , ' ...' |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7595 |
] ifFalse:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7596 |
fileNameString := aFileName. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7597 |
OperatingSystem isVMSlike ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7598 |
(aFileName endsWith:'.') ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7599 |
aFileName ~= '..' ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7600 |
fileNameString := aFileName copyWithoutLast:1 |
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 |
] |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7603 |
] |
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 |
|
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7606 |
showingDetails value "showLongList" ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7607 |
len := fileNameString size. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7608 |
(len > 20) ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7609 |
fileNameString := (fileNameString contractTo:20) |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7610 |
]. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7611 |
]. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7612 |
|
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7613 |
entry colAt:1 put:(self iconForFile:aFileName). |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7614 |
entry colAt:2 put:fileNameString. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7615 |
|
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7616 |
"/fileListView at:lineIndex put:entry. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7617 |
fileListView withoutRedrawAt:lineIndex put:entry. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7618 |
fileListView invalidateLine:lineIndex. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7619 |
|
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7620 |
anyImages ifFalse:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7621 |
(Image isImageFileSuffix:(aFileName asFilename suffix)) |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7622 |
ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7623 |
anyImages := true |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7624 |
] |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7625 |
]. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7626 |
passDone at:lineIndex put:1 |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7627 |
] |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7628 |
]. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7629 |
|
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7630 |
(state endsWith:'Attributes') ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7631 |
"/ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7632 |
"/ pass 2 - everything except fileType (which takes very long) |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7633 |
"/ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7634 |
(passDone at:lineIndex) < 2 ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7635 |
info := f info. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7636 |
info isNil ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7637 |
"not accessable - usually a symlink, |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7638 |
to a nonexisting/nonreadable file |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7639 |
" |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7640 |
f isSymbolicLink ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7641 |
p := f linkInfo path. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7642 |
typeString := 'broken symbolic link to ' , p |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7643 |
] ifFalse:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7644 |
typeString := 'unknown' |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7645 |
]. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7646 |
] ifFalse:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7647 |
typ := (info type). |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7648 |
|
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7649 |
modeString := self getModeString:(info at:#mode) |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7650 |
with:#( '' $r $w $x |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7651 |
' ' $r $w $x |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7652 |
' ' $r $w $x ). |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7653 |
entry colAt:3 put:modeString. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7654 |
|
3448
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7655 |
showingTimeAndDate value ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7656 |
t := f isSymbolicLink |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7657 |
ifFalse:[f modificationTime] |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7658 |
ifTrue:[f linkInfo modified]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7659 |
entry colAt:4 put:t asDate printString. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7660 |
entry colAt:5 put:t asTime printString. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7661 |
] ifFalse:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7662 |
((info uid) ~~ prevUid) ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7663 |
prevUid := (info uid). |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7664 |
nameString := OperatingSystem getUserNameFromID:prevUid. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7665 |
nameString := nameString contractTo:10. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7666 |
nameString := nameString , (String new:(10 - nameString size)) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7667 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7668 |
nameString isNil ifTrue:[nameString := '???']. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7669 |
entry colAt:4 put:nameString withoutSpaces. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7670 |
|
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7671 |
((info gid) ~~ prevGid) ifTrue:[ |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7672 |
prevGid := (info gid). |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7673 |
groupString := OperatingSystem getGroupNameFromID:prevGid. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7674 |
groupString := groupString contractTo:10. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7675 |
groupString := groupString , (String new:(10 - groupString size)) |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7676 |
]. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7677 |
groupString isNil ifTrue:[groupString := '???']. |
1310d33d3134
bookmarks & showingTime+date
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
7678 |
entry colAt:5 put:groupString withoutSpaces. |
2255
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 |
(typ == #regular) ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7682 |
entry colAt:6 put:(self sizePrintString:(info size)). |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7683 |
]. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7684 |
|
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7685 |
f isSymbolicLink ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7686 |
p := f linkInfo path. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7687 |
typeString := 'symbolic link to ' , p |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7688 |
] ifFalse:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7689 |
typeString := typ asString |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7690 |
]. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7691 |
]. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7692 |
entry colAt:7 put:typeString. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7693 |
|
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7694 |
"/ fileListView at:lineIndex put:entry. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7695 |
fileListView withoutRedrawAt:lineIndex put:entry. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7696 |
fileListView invalidateLine:lineIndex. |
2257
02dc5c0000e1
oops - must send size-changeNotification manually
Claus Gittinger <cg@exept.de>
parents:
2256
diff
changeset
|
7697 |
|
2255
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7698 |
passDone at:lineIndex put:2. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7699 |
]. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7700 |
]. |
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 |
(state endsWith:'Types') ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7703 |
"/ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7704 |
"/ pass 3: add fileType |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7705 |
"/ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7706 |
(passDone at:lineIndex) < 3 ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7707 |
info := f info. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7708 |
info notNil ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7709 |
f isSymbolicLink ifFalse:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7710 |
(Image isImageFileSuffix:(f suffix)) ifFalse:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7711 |
typeString := f fileType. |
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 |
entry colAt:7 put:typeString. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7714 |
"/ fileListView at:lineIndex put:entry |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7715 |
fileListView withoutRedrawAt:lineIndex put:entry. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7716 |
fileListView invalidateLine:lineIndex. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7717 |
]. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7718 |
]. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7719 |
]. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7720 |
|
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7721 |
passDone at:lineIndex put:3 |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7722 |
]. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7723 |
]. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7724 |
|
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7725 |
(state endsWith:'Images') ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7726 |
"/ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7727 |
"/ pass 4: read images |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7728 |
"/ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7729 |
(passDone at:lineIndex) < 4 ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7730 |
(Image isImageFileSuffix:(f suffix)) ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7731 |
f isDirectory ifFalse:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7732 |
img := Image fromFile:(f pathName). |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7733 |
img notNil ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7734 |
showingBigImagePreview value == true ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7735 |
img := img magnifiedTo:32@32. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7736 |
] ifFalse:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7737 |
img := img magnifiedTo:16@16. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7738 |
]. |
2339 | 7739 |
img := img onDevice:self device. |
2255
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7740 |
entry colAt:7 put:img. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7741 |
"/ fileListView at:lineIndex put:entry |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7742 |
fileListView withoutRedrawAt:lineIndex put:entry. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7743 |
fileListView invalidateLine:lineIndex. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7744 |
] |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7745 |
] |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7746 |
]. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7747 |
passDone at:lineIndex put:4 |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7748 |
]. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7749 |
]. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7750 |
]. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7751 |
|
2257
02dc5c0000e1
oops - must send size-changeNotification manually
Claus Gittinger <cg@exept.de>
parents:
2256
diff
changeset
|
7752 |
showingDetails value ifTrue:[ |
02dc5c0000e1
oops - must send size-changeNotification manually
Claus Gittinger <cg@exept.de>
parents:
2256
diff
changeset
|
7753 |
fileListView widthOfContents ~~ prevWidth ifTrue:[ |
02dc5c0000e1
oops - must send size-changeNotification manually
Claus Gittinger <cg@exept.de>
parents:
2256
diff
changeset
|
7754 |
fileListView contentsChanged. |
02dc5c0000e1
oops - must send size-changeNotification manually
Claus Gittinger <cg@exept.de>
parents:
2256
diff
changeset
|
7755 |
] |
02dc5c0000e1
oops - must send size-changeNotification manually
Claus Gittinger <cg@exept.de>
parents:
2256
diff
changeset
|
7756 |
]. |
02dc5c0000e1
oops - must send size-changeNotification manually
Claus Gittinger <cg@exept.de>
parents:
2256
diff
changeset
|
7757 |
|
2255
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7758 |
"/ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7759 |
"/ advance to the next line |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7760 |
"/ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7761 |
lineIndex := lineIndex + 1. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7762 |
lineIndex > endIndex ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7763 |
"/ finished this round ... |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7764 |
"/ see what we are going for ... |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7765 |
numVisible := (fileListView lastLineShown - fileListView firstLineShown + 1). |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7766 |
|
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7767 |
state := nextState at:state ifAbsent:nil. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7768 |
|
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7769 |
state isNil ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7770 |
done := true |
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:'visible') ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7773 |
lineIndex := fileListView firstLineShown. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7774 |
endIndex := fileListView lastLineShown. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7775 |
endIndex := endIndex min:(files size). |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7776 |
] ifFalse:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7777 |
(state startsWith:'nextPage') ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7778 |
lineIndex := fileListView lastLineShown + 1. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7779 |
endIndex := lineIndex + numVisible. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7780 |
endIndex := endIndex min:(files size). |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7781 |
lineIndex := lineIndex min:(files size). |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7782 |
] ifFalse:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7783 |
(state startsWith:'previousPage') ifTrue:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7784 |
endIndex := fileListView firstLineShown - 1. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7785 |
lineIndex := endIndex - numVisible. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7786 |
lineIndex := lineIndex max:1. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7787 |
endIndex := endIndex min:(files size). |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7788 |
endIndex := endIndex max:1. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7789 |
] ifFalse:[ |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7790 |
"/ remaining |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7791 |
lineIndex := 1. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7792 |
endIndex := files size. |
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 |
] |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7795 |
] |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7796 |
] |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7797 |
] |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7798 |
]. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7799 |
|
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7800 |
listUpdateProcess := nil. |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7801 |
|
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7802 |
] forkAt:(Processor activePriority - 1). |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7803 |
|
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7804 |
" |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7805 |
install a new check after some time |
cc33278ab00a
autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
7806 |
" |
3520
83cf11e1bf32
schedule checkBlock for the right process
Claus Gittinger <cg@exept.de>
parents:
3503
diff
changeset
|
7807 |
self scheduleCheckBlock. |
36 | 7808 |
] |
142 | 7809 |
|
1487
c8d32d8b039c
oops - dont sort a nil object
Claus Gittinger <cg@exept.de>
parents:
1481
diff
changeset
|
7810 |
"Modified: / 21.9.1995 / 11:40:23 / claus" |
c8d32d8b039c
oops - dont sort a nil object
Claus Gittinger <cg@exept.de>
parents:
1481
diff
changeset
|
7811 |
"Modified: / 28.4.1997 / 22:30:30 / dq" |
c8d32d8b039c
oops - dont sort a nil object
Claus Gittinger <cg@exept.de>
parents:
1481
diff
changeset
|
7812 |
"Modified: / 18.9.1997 / 18:28:30 / stefan" |
3419 | 7813 |
"Modified: / 15.11.2001 / 23:49:03 / cg" |
386
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
7814 |
! ! |
3fd24d9116b3
added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents:
381
diff
changeset
|
7815 |
|
172 | 7816 |
!FileBrowser methodsFor:'queries'! |
73 | 7817 |
|
1700
5067b3c4cafa
added access to fileName (kludge to fileIn RefactoryBrowser)
Claus Gittinger <cg@exept.de>
parents:
1689
diff
changeset
|
7818 |
fileName |
1702
962056a31c06
remember the current file during fileIn,
Claus Gittinger <cg@exept.de>
parents:
1700
diff
changeset
|
7819 |
"return my current fileName - during fileIn, the file |
962056a31c06
remember the current file during fileIn,
Claus Gittinger <cg@exept.de>
parents:
1700
diff
changeset
|
7820 |
which is being loaded is returned. |
962056a31c06
remember the current file during fileIn,
Claus Gittinger <cg@exept.de>
parents:
1700
diff
changeset
|
7821 |
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
|
7822 |
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
|
7823 |
|
962056a31c06
remember the current file during fileIn,
Claus Gittinger <cg@exept.de>
parents:
1700
diff
changeset
|
7824 |
|f| |
962056a31c06
remember the current file during fileIn,
Claus Gittinger <cg@exept.de>
parents:
1700
diff
changeset
|
7825 |
|
962056a31c06
remember the current file during fileIn,
Claus Gittinger <cg@exept.de>
parents:
1700
diff
changeset
|
7826 |
f := currentFileInFileName ? currentFileName. |
962056a31c06
remember the current file during fileIn,
Claus Gittinger <cg@exept.de>
parents:
1700
diff
changeset
|
7827 |
f isNil ifTrue:[^ nil]. |
962056a31c06
remember the current file during fileIn,
Claus Gittinger <cg@exept.de>
parents:
1700
diff
changeset
|
7828 |
^ self path asFilename construct:f |
1700
5067b3c4cafa
added access to fileName (kludge to fileIn RefactoryBrowser)
Claus Gittinger <cg@exept.de>
parents:
1689
diff
changeset
|
7829 |
|
5067b3c4cafa
added access to fileName (kludge to fileIn RefactoryBrowser)
Claus Gittinger <cg@exept.de>
parents:
1689
diff
changeset
|
7830 |
" |
5067b3c4cafa
added access to fileName (kludge to fileIn RefactoryBrowser)
Claus Gittinger <cg@exept.de>
parents:
1689
diff
changeset
|
7831 |
(FileBrowser openOnFileNamed:'Makefile') fileName |
5067b3c4cafa
added access to fileName (kludge to fileIn RefactoryBrowser)
Claus Gittinger <cg@exept.de>
parents:
1689
diff
changeset
|
7832 |
" |
5067b3c4cafa
added access to fileName (kludge to fileIn RefactoryBrowser)
Claus Gittinger <cg@exept.de>
parents:
1689
diff
changeset
|
7833 |
|
1702
962056a31c06
remember the current file during fileIn,
Claus Gittinger <cg@exept.de>
parents:
1700
diff
changeset
|
7834 |
"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
|
7835 |
! |
5067b3c4cafa
added access to fileName (kludge to fileIn RefactoryBrowser)
Claus Gittinger <cg@exept.de>
parents:
1689
diff
changeset
|
7836 |
|
172 | 7837 |
path |
7838 |
"return my currentDirectories pathName; |
|
1329 | 7839 |
sent from the pathField to aquire the pathname when I changed directory" |
7840 |
||
7841 |
"/ somewhat tricky: first ask it for the full pathName, |
|
7842 |
"/ then convert it to a directory name |
|
7843 |
"/ (which only makes a difference on VMS) |
|
7844 |
||
3747
d30bc1e54f15
Remove unused vars and asFilename sends
Stefan Vogel <sv@exept.de>
parents:
3746
diff
changeset
|
7845 |
^ currentDirectory pathName "/ asFilename osNameForDirectory |
1828 | 7846 |
|
7847 |
"Modified: / 12.8.1998 / 14:45:48 / cg" |
|
49 | 7848 |
! ! |
7849 |
||
763
94a8d188b52d
care for the nameSpace Query when loading binary classes
Claus Gittinger <cg@exept.de>
parents:
749
diff
changeset
|
7850 |
!FileBrowser class methodsFor:'documentation'! |
203 | 7851 |
|
7852 |
version |
|
3762 | 7853 |
^ '$Header: /cvs/stx/stx/libtool/FileBrowser.st,v 1.480 2002-07-31 13:21:48 penk Exp $' |
381 | 7854 |
! ! |