author | Claus Gittinger <cg@exept.de> |
Sat, 16 Oct 2004 14:58:38 +0200 | |
changeset 6095 | a6f6eb0c7b9d |
parent 6094 | ad13d826103c |
child 6096 | ad7437953ee4 |
permissions | -rw-r--r-- |
5140 | 1 |
" |
2 |
COPYRIGHT (c) 2002 by eXept Software AG |
|
3 |
All Rights Reserved |
|
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 |
||
3892 | 13 |
"{ Package: 'stx:libtool' }" |
14 |
||
15 |
ApplicationModel subclass:#AbstractFileBrowser |
|
4959 | 16 |
instanceVariableNames:'aspects' |
17 |
classVariableNames:'DirectoryHistory RuntimeAspects DirectoryBookmarks |
|
18 |
LastEnforcedNameSpace CommandHistory DefaultCommandPerSuffix |
|
19 |
CommandHistorySize LastFileDiffFile DefaultFilters RootHolder |
|
5880 | 20 |
LastFileSelection LastMoveDestination LastScriptBlockString' |
4959 | 21 |
poolDictionaries:'' |
22 |
category:'Interface-Tools-File' |
|
3892 | 23 |
! |
24 |
||
25 |
AbstractFileBrowser class instanceVariableNames:'DisabledCursorImage EnabledCursorImage' |
|
26 |
||
27 |
" |
|
28 |
The following class instance variables are inherited by this class: |
|
29 |
||
4959 | 30 |
ApplicationModel - ClassResources |
31 |
Model - |
|
32 |
Object - |
|
3892 | 33 |
" |
34 |
! |
|
35 |
||
36 |
Object subclass:#Clipboard |
|
4959 | 37 |
instanceVariableNames:'method files' |
38 |
classVariableNames:'' |
|
39 |
poolDictionaries:'' |
|
40 |
privateIn:AbstractFileBrowser |
|
3892 | 41 |
! |
42 |
||
43 |
Object subclass:#CodeExecutionLock |
|
4959 | 44 |
instanceVariableNames:'locked' |
45 |
classVariableNames:'' |
|
46 |
poolDictionaries:'' |
|
47 |
privateIn:AbstractFileBrowser |
|
3892 | 48 |
! |
49 |
||
4366 | 50 |
List subclass:#DirectoryHistory |
4959 | 51 |
instanceVariableNames:'forwardList backList lastWasForwardPath lastBackPath lastAddPath |
52 |
backForwardList backForwardIndex' |
|
53 |
classVariableNames:'HistorySize' |
|
54 |
poolDictionaries:'' |
|
55 |
privateIn:AbstractFileBrowser |
|
3952 | 56 |
! |
57 |
||
58 |
Object subclass:#DirectoryHistoryItem |
|
4959 | 59 |
instanceVariableNames:'path position' |
60 |
classVariableNames:'' |
|
61 |
poolDictionaries:'' |
|
62 |
privateIn:AbstractFileBrowser::DirectoryHistory |
|
3892 | 63 |
! |
64 |
||
65 |
OrderedSet subclass:#FilenameHistory |
|
4959 | 66 |
instanceVariableNames:'' |
67 |
classVariableNames:'' |
|
68 |
poolDictionaries:'' |
|
69 |
privateIn:AbstractFileBrowser |
|
3892 | 70 |
! |
71 |
||
72 |
Object subclass:#SaveAspectItem |
|
4959 | 73 |
instanceVariableNames:'value isHolder' |
74 |
classVariableNames:'' |
|
75 |
poolDictionaries:'' |
|
76 |
privateIn:AbstractFileBrowser |
|
3892 | 77 |
! |
78 |
||
5140 | 79 |
!AbstractFileBrowser class methodsFor:'documentation'! |
80 |
||
81 |
copyright |
|
82 |
" |
|
83 |
COPYRIGHT (c) 2002 by eXept Software AG |
|
84 |
All Rights Reserved |
|
85 |
||
86 |
This software is furnished under a license and may be used |
|
87 |
only in accordance with the terms of that license and with the |
|
88 |
inclusion of the above copyright notice. This software may not |
|
89 |
be provided or otherwise made available to, or used by, any |
|
90 |
other person. No title to or ownership of the software is |
|
91 |
hereby transferred. |
|
92 |
" |
|
5967 | 93 |
! |
94 |
||
95 |
documentation |
|
96 |
" |
|
97 |
[Author:] |
|
98 |
Christian Penk |
|
99 |
" |
|
5140 | 100 |
! ! |
3892 | 101 |
|
4672
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
102 |
!AbstractFileBrowser class methodsFor:'accessing'! |
3952 | 103 |
|
4368
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
104 |
currentSelection |
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
105 |
|
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
106 |
LastFileSelection isNil ifTrue:[ |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
107 |
LastFileSelection := #(). |
4368
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
108 |
]. |
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
109 |
^ LastFileSelection |
4368
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
110 |
! |
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
111 |
|
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
112 |
currentSelection:aFilenameCol |
5476 | 113 |
LastFileSelection := aFilenameCol collect:[:file | file asFilename] |
4368
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
114 |
! |
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
115 |
|
3952 | 116 |
directoryHistory |
117 |
||
118 |
DirectoryHistory isNil ifTrue:[ |
|
4414 | 119 |
DirectoryHistory := self directoryHistoryClass new. |
3964 | 120 |
"/ DirectoryHistory inspect. |
3952 | 121 |
]. |
122 |
^ DirectoryHistory |
|
123 |
! |
|
124 |
||
125 |
resetClassVars |
|
126 |
DirectoryHistory := nil. |
|
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
127 |
LastFileSelection := nil. |
5936 | 128 |
|
129 |
" |
|
130 |
AbstractFileBrowser resetClassVars |
|
131 |
" |
|
4368
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
132 |
! |
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
133 |
|
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
134 |
rootHolder |
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
135 |
|
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
136 |
^ RootHolder |
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
137 |
! |
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
138 |
|
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
139 |
rootHolder:aRoot |
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
140 |
|
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
141 |
RootHolder := aRoot |
3952 | 142 |
! ! |
143 |
||
4915 | 144 |
!AbstractFileBrowser class methodsFor:'accessing-bookmarks'! |
4672
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
145 |
|
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
146 |
addBookmark:aDirectoryPath |
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
147 |
|bookmarks idx| |
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
148 |
|
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
149 |
bookmarks := self directoryBookmarks. |
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
150 |
idx := bookmarks indexOf:aDirectoryPath. |
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
151 |
idx == 0 ifTrue:[ |
4680 | 152 |
bookmarks addLast:aDirectoryPath asFilename. |
4672
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
153 |
]. |
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
154 |
! |
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
155 |
|
4679 | 156 |
defaultBookMarksFileDirectory |
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
157 |
^ Filename homeDirectory |
4679 | 158 |
! |
159 |
||
160 |
defaultBookMarksFilename |
|
161 |
^ '.fileBrowserBookmarks' |
|
162 |
! |
|
163 |
||
164 |
directoryBookmarks |
|
165 |
DirectoryBookmarks isNil ifTrue:[ |
|
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
166 |
self loadBookmarksFrom:(self defaultBookMarksFileDirectory construct:self defaultBookMarksFilename). |
4679 | 167 |
|
168 |
DirectoryBookmarks isEmptyOrNil ifTrue:[ |
|
169 |
DirectoryBookmarks := OrderedCollection new. |
|
170 |
DirectoryBookmarks add:Filename homeDirectory asAbsoluteFilename. |
|
171 |
DirectoryBookmarks add:Filename currentDirectory asAbsoluteFilename. |
|
172 |
] |
|
173 |
]. |
|
174 |
^ DirectoryBookmarks |
|
175 |
||
176 |
" |
|
5438
fa19d526d85d
directoryBookmarks must be stored without lineLimit (see base64 encoder)
Claus Gittinger <cg@exept.de>
parents:
5437
diff
changeset
|
177 |
DirectoryBookmarks := nil. |
fa19d526d85d
directoryBookmarks must be stored without lineLimit (see base64 encoder)
Claus Gittinger <cg@exept.de>
parents:
5437
diff
changeset
|
178 |
self directoryBookmarks. |
4679 | 179 |
" |
180 |
! |
|
181 |
||
4672
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
182 |
hasBookmarks |
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
183 |
^ self directoryBookmarks notEmptyOrNil |
4672
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
184 |
! |
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
185 |
|
4679 | 186 |
loadBookmarksFrom:aFileNameOrString |
187 |
|bookmarks s fileName| |
|
188 |
||
189 |
fileName := aFileNameOrString asFilename. |
|
5356
d08261ab1567
care for nonexisting bookmarks file in open
Claus Gittinger <cg@exept.de>
parents:
5334
diff
changeset
|
190 |
FileStream openErrorSignal catch:[ |
d08261ab1567
care for nonexisting bookmarks file in open
Claus Gittinger <cg@exept.de>
parents:
5334
diff
changeset
|
191 |
s := fileName readStream. |
d08261ab1567
care for nonexisting bookmarks file in open
Claus Gittinger <cg@exept.de>
parents:
5334
diff
changeset
|
192 |
]. |
4679 | 193 |
s isNil ifTrue:[ |
194 |
^ self. |
|
195 |
]. |
|
196 |
||
197 |
bookmarks := OrderedCollection new. |
|
198 |
[s atEnd] whileFalse:[ |
|
199 |
|line path| |
|
200 |
||
201 |
line := s nextLine. |
|
5418 | 202 |
path := (Base64Coder decodingOf:line) asString. |
4679 | 203 |
bookmarks add:path. |
204 |
]. |
|
205 |
s close. |
|
206 |
||
207 |
DirectoryBookmarks := OrderedCollection new. |
|
208 |
bookmarks do:[:eachPath | |
|
209 |
self addBookmark:eachPath asFilename |
|
210 |
]. |
|
211 |
! |
|
212 |
||
4672
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
213 |
removeBookmark:aDirectoryPath |
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
214 |
|bookmarks| |
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
215 |
|
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
216 |
bookmarks := self directoryBookmarks. |
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
217 |
bookmarks isEmptyOrNil ifTrue:[ ^ self]. |
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
218 |
|
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
219 |
bookmarks remove:aDirectoryPath ifAbsent:[]. |
4679 | 220 |
! |
221 |
||
222 |
saveBookmarks |
|
223 |
|fn| |
|
224 |
||
225 |
fn := Dialog |
|
226 |
requestFileName:'Save Bookmarks' |
|
227 |
default:(self defaultBookMarksFilename) |
|
228 |
fromDirectory:(self defaultBookMarksFileDirectory). |
|
229 |
fn isEmptyOrNil ifTrue:[^ self]. |
|
230 |
||
231 |
self saveBookmarksIn:fn |
|
232 |
! |
|
233 |
||
234 |
saveBookmarksIn:aFileNameOrString |
|
235 |
|bookmarks s fileName| |
|
236 |
||
237 |
bookmarks := self directoryBookmarks. |
|
238 |
bookmarks isEmptyOrNil ifTrue:[ ^ self]. |
|
239 |
||
240 |
fileName := aFileNameOrString asFilename. |
|
241 |
fileName exists ifTrue:[ |
|
242 |
fileName renameTo:(fileName withSuffix:'sav'). |
|
243 |
]. |
|
244 |
s := fileName writeStream. |
|
245 |
bookmarks do:[:eachPath | |
|
246 |
|absolutePath| |
|
247 |
||
248 |
absolutePath := eachPath asFilename pathName. |
|
5438
fa19d526d85d
directoryBookmarks must be stored without lineLimit (see base64 encoder)
Claus Gittinger <cg@exept.de>
parents:
5437
diff
changeset
|
249 |
s nextPutLine:(Base64Coder new lineLimit:nil; encodingOf:absolutePath). |
4679 | 250 |
]. |
251 |
s close. |
|
5960 | 252 |
! |
253 |
||
254 |
saveBookmarksInDefaultBookmarksFile |
|
255 |
self saveBookmarksIn:(self defaultBookMarksFileDirectory construct:self defaultBookMarksFilename) |
|
4672
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
256 |
! ! |
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
257 |
|
4915 | 258 |
!AbstractFileBrowser class methodsFor:'accessing-classes'! |
4672
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
259 |
|
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
260 |
directoryHistoryClass |
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
261 |
|
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
262 |
^ AbstractFileBrowser::DirectoryHistory |
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
263 |
! |
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
264 |
|
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
265 |
filenameHistoryClass |
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
266 |
|
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
267 |
^ FilenameHistory |
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
268 |
! ! |
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
269 |
|
3892 | 270 |
!AbstractFileBrowser class methodsFor:'defaults'! |
271 |
||
272 |
commandHistory |
|
273 |
||
274 |
CommandHistory isNil ifTrue:[ |
|
4414 | 275 |
CommandHistory := OrderedCollection new. |
3892 | 276 |
]. |
277 |
^ CommandHistory |
|
278 |
! |
|
279 |
||
280 |
commandHistorySize |
|
281 |
||
4190 | 282 |
"max no of entries in the HistoryList " |
3892 | 283 |
CommandHistorySize isNil ifTrue:[ |
4414 | 284 |
CommandHistorySize := 50 |
3892 | 285 |
]. |
286 |
^ CommandHistorySize |
|
287 |
! |
|
288 |
||
289 |
defaultFilterList |
|
290 |
||
291 |
DefaultFilters isNil ifTrue:[ |
|
4414 | 292 |
DefaultFilters := #( '*' |
293 |
'*.st' |
|
294 |
'*.htm*' |
|
295 |
'*.txt' |
|
296 |
'*.gif' |
|
297 |
'*.xpm' |
|
298 |
'*.jpg' |
|
299 |
'*.[h,c]*' |
|
300 |
) |
|
3892 | 301 |
]. |
302 |
^ DefaultFilters. |
|
303 |
! |
|
304 |
||
4496
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
305 |
initialCommandFor:fileName in:aDirectory intoBox:aBox |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
306 |
"set a useful initial command in an execute box." |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
307 |
|
4523 | 308 |
|mime cmd select path suffix baseName pathName| |
4496
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
309 |
|
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
310 |
path := aDirectory filenameFor:fileName. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
311 |
baseName := path baseName. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
312 |
suffix := path suffix. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
313 |
|
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
314 |
mime := MIMETypes mimeTypeForSuffix:suffix. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
315 |
"/ mime notNil ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
316 |
"/ cmd := self initialCommandForMIME:mime file:path |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
317 |
"/ ]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
318 |
|
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
319 |
"/ XXX should be changed to take stuff from a config file |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
320 |
"/ XXX or from resources. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
321 |
|
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
322 |
(path type == #regular) ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
323 |
path isExecutableProgram ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
324 |
aBox initialText:(path pathName , ' <arguments>'). |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
325 |
^ self |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
326 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
327 |
|
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
328 |
select := true. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
329 |
|
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
330 |
"some heuristics - my personal preferences ... |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
331 |
(actually this should come from a configfile)" |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
332 |
|
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
333 |
(baseName endsWith:'akefile') ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
334 |
aBox initialText:'make target' selectFrom:6 to:11. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
335 |
^ self |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
336 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
337 |
|
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
338 |
cmd := MIMETypes defaultCommandPerMIME at:mime ifAbsent:nil. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
339 |
cmd notNil ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
340 |
select := false |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
341 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
342 |
|
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
343 |
cmd isNil ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
344 |
suffix := path suffix. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
345 |
(suffix = 'C') ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
346 |
cmd := 'g++ -c %1'. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
347 |
select := 6. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
348 |
] ifFalse:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
349 |
suffix := suffix asLowercase. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
350 |
|
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
351 |
(suffix = 'taz') ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
352 |
aBox initialText:'zcat %1 | tar tvf -'. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
353 |
select := false. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
354 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
355 |
(suffix = 'tar') ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
356 |
cmd := 'tar tvf %1'. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
357 |
select := 7. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
358 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
359 |
(suffix = 'zoo') ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
360 |
cmd := 'zoo -list %1'. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
361 |
select := 9. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
362 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
363 |
(suffix = 'zip') ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
364 |
cmd := 'unzip -l %1'. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
365 |
select := 8. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
366 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
367 |
(suffix = 'jar') ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
368 |
cmd := 'unzip -l %1'. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
369 |
select := 8. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
370 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
371 |
(suffix = 'z') ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
372 |
(baseName asLowercase endsWith:'tar.z') ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
373 |
cmd := 'zcat %1 | tar tvf -'. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
374 |
select := false. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
375 |
] ifFalse:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
376 |
cmd := 'uncompress %1' |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
377 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
378 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
379 |
(suffix = 'gz') ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
380 |
(baseName asLowercase endsWith:'tar.gz') ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
381 |
cmd := ('gunzip < %1 | tar tvf -' ). |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
382 |
select := false. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
383 |
] ifFalse:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
384 |
cmd := 'gunzip %1'. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
385 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
386 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
387 |
(suffix = 'html') ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
388 |
cmd := 'netscape %1' |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
389 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
390 |
(suffix = 'htm') ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
391 |
cmd := 'netscape %1' |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
392 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
393 |
(suffix = 'uue') ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
394 |
cmd := 'uudecode %1' |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
395 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
396 |
(suffix = 'c') ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
397 |
cmd := 'cc -c %1'. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
398 |
select := 5. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
399 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
400 |
(suffix = 'cc') ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
401 |
cmd := 'g++ -c %1'. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
402 |
select := 6. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
403 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
404 |
(suffix = 'xbm') ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
405 |
cmd := 'bitmap %1' |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
406 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
407 |
(suffix = 'ps') ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
408 |
cmd := 'ghostview %1' |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
409 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
410 |
((suffix = '1') or:[suffix = 'man']) ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
411 |
cmd := 'nroff -man %1'. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
412 |
select := 10. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
413 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
414 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
415 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
416 |
|
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
417 |
cmd isNil ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
418 |
DefaultCommandPerSuffix isNil ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
419 |
cmd := '<cmd>' |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
420 |
] ifFalse:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
421 |
cmd := DefaultCommandPerSuffix |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
422 |
at:suffix |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
423 |
ifAbsent:'<cmd>'. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
424 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
425 |
cmd := cmd , ' %1'. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
426 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
427 |
|
4523 | 428 |
pathName := path pathName. |
429 |
OperatingSystem isUNIXlike ifTrue:[ |
|
430 |
pathName includesSeparator ifTrue:[ |
|
431 |
pathName := '"' , pathName , '"' |
|
432 |
] |
|
433 |
]. |
|
434 |
||
435 |
cmd := cmd bindWith:pathName. |
|
4496
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
436 |
select == false ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
437 |
aBox initialText:cmd |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
438 |
] ifFalse:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
439 |
select class == Interval ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
440 |
aBox initialText:cmd selectFrom:select start to:select stop |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
441 |
] ifFalse:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
442 |
select isInteger ifFalse:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
443 |
select := (cmd indexOf:Character space ifAbsent:[cmd size + 1]) - 1. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
444 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
445 |
aBox initialText:cmd selectFrom:1 to:select |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
446 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
447 |
] |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
448 |
] |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
449 |
|
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
450 |
"Modified: / 24.9.1997 / 16:34:52 / stefan" |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
451 |
"Modified: / 9.4.1998 / 17:15:57 / cg" |
3892 | 452 |
! |
453 |
||
5941 | 454 |
listOfRuntimeValuesToRemember |
455 |
" list of all aspects that will be remembered after closing a FileBrowserV2" |
|
456 |
||
457 |
^ #( |
|
458 |
"/ #filterModel |
|
459 |
#enableFileHistory |
|
460 |
#fileHistory |
|
461 |
#currentSortOrder |
|
462 |
#sortBlockProperty |
|
463 |
) |
|
3892 | 464 |
! |
465 |
||
466 |
resetAspects |
|
467 |
||
468 |
RuntimeAspects := nil. |
|
469 |
||
5941 | 470 |
" |
471 |
self resetAspects |
|
472 |
" |
|
3892 | 473 |
! |
474 |
||
475 |
runtimeAspects |
|
476 |
||
477 |
RuntimeAspects isNil ifTrue:[ |
|
4414 | 478 |
RuntimeAspects := Dictionary new. |
3892 | 479 |
]. |
480 |
^ RuntimeAspects |
|
481 |
! |
|
482 |
||
4201 | 483 |
userPreferencesAspectList |
484 |
||
485 |
" list of all aspects that will be saved with save settings |
|
486 |
that aspects will be image consistent if the settings are saved in Launcher |
|
487 |
dont forget to add a access methos in Userpreferences if you add a aspect here |
|
488 |
" |
|
489 |
||
490 |
^ #( |
|
491 |
#viewDirsInContentsBrowser |
|
492 |
#showDirectoryTree |
|
493 |
#showHiddenFiles |
|
494 |
#viewDescription |
|
495 |
#viewDetails |
|
496 |
#viewDirectoryDescription |
|
497 |
#viewFilesInDirectoryTree |
|
498 |
#viewGroup |
|
499 |
#viewOwner |
|
500 |
#viewPermissions |
|
501 |
#viewPreview |
|
502 |
#viewSize |
|
5312 | 503 |
#viewSizeInKiloBytes |
4974 | 504 |
#viewSizeInBytes |
4201 | 505 |
#viewTime |
506 |
#viewType |
|
507 |
#openMultipleApplicationsForType |
|
508 |
#filenameEntryFieldVisibleHolder |
|
509 |
#toolBarVisibleHolder |
|
510 |
#sortDirectoriesBeforeFiles |
|
511 |
#openAlwaysInTextEditor |
|
512 |
#sortCaseless |
|
513 |
) |
|
3892 | 514 |
! ! |
515 |
||
5398 | 516 |
!AbstractFileBrowser class methodsFor:'help specs'! |
517 |
||
518 |
helpSpec |
|
519 |
"This resource specification was automatically generated |
|
520 |
by the UIHelpTool of ST/X." |
|
521 |
||
522 |
"Do not manually edit this!! If it is corrupted, |
|
523 |
the UIHelpTool may not be able to read the specification." |
|
524 |
||
525 |
" |
|
526 |
UIHelpTool openOnClass:AbstractFileBrowser |
|
527 |
" |
|
528 |
||
529 |
<resource: #help> |
|
530 |
||
531 |
^ super helpSpec addPairsFrom:#( |
|
532 |
||
5737 | 533 |
#lockFileEncoding |
534 |
'Do not guess the encoding from the files contents.' |
|
535 |
||
5398 | 536 |
) |
537 |
! ! |
|
538 |
||
3892 | 539 |
!AbstractFileBrowser class methodsFor:'image'! |
540 |
||
4337
f2eed806e854
change first letter uppercase methods on class side to lowercase ones
penk
parents:
4317
diff
changeset
|
541 |
disabledCursorImage |
3892 | 542 |
|
543 |
DisabledCursorImage isNil ifTrue:[ |
|
4337
f2eed806e854
change first letter uppercase methods on class side to lowercase ones
penk
parents:
4317
diff
changeset
|
544 |
DisabledCursorImage := Image fromFile:'xpmBitmaps/cursors/no_entry.xpm' |
3892 | 545 |
]. |
546 |
^ DisabledCursorImage |
|
547 |
! |
|
548 |
||
4337
f2eed806e854
change first letter uppercase methods on class side to lowercase ones
penk
parents:
4317
diff
changeset
|
549 |
enabledCursorImage |
3892 | 550 |
|
551 |
EnabledCursorImage isNil ifTrue:[ |
|
4337
f2eed806e854
change first letter uppercase methods on class side to lowercase ones
penk
parents:
4317
diff
changeset
|
552 |
EnabledCursorImage := Image fromFile:'xpmBitmaps/cursors/double_crossHair.xpm' |
3892 | 553 |
]. |
554 |
^ EnabledCursorImage |
|
555 |
! ! |
|
556 |
||
557 |
!AbstractFileBrowser class methodsFor:'image specs'! |
|
558 |
||
559 |
clearHistoryIcon |
|
6074 | 560 |
<resource: #programImage> |
561 |
||
3892 | 562 |
^ Icon deleteIcon |
563 |
! |
|
564 |
||
565 |
copyIcon |
|
566 |
<resource: #programImage> |
|
567 |
||
6093 | 568 |
^ ToolbarIconLibrary copyIcon |
3892 | 569 |
! |
570 |
||
571 |
cutIcon |
|
572 |
<resource: #programImage> |
|
573 |
||
574 |
^ ToolbarIconLibrary cut20x20Icon2 "cut28x28Icon" |
|
575 |
! |
|
576 |
||
577 |
deleteIcon |
|
578 |
<resource: #programImage> |
|
579 |
||
580 |
^ ToolbarIconLibrary erase20x20Icon "/ delete28x28Icon |
|
581 |
! |
|
582 |
||
583 |
diffIcon |
|
584 |
"This resource specification was automatically generated |
|
585 |
by the ImageEditor of ST/X." |
|
586 |
||
587 |
"Do not manually edit this!! If it is corrupted, |
|
588 |
the ImageEditor may not be able to read the specification." |
|
589 |
||
590 |
" |
|
591 |
self diffIcon inspect |
|
592 |
ImageEditor openOnClass:self andSelector:#diffIcon |
|
5412
f90f3404359d
icons must be language independent
Claus Gittinger <cg@exept.de>
parents:
5398
diff
changeset
|
593 |
Icon flushCachedIcons |
3892 | 594 |
" |
595 |
||
596 |
<resource: #image> |
|
597 |
||
598 |
^Icon |
|
4414 | 599 |
constantNamed:#'AbstractFileBrowser class diffIcon' |
5412
f90f3404359d
icons must be language independent
Claus Gittinger <cg@exept.de>
parents:
5398
diff
changeset
|
600 |
ifAbsentPut:[(Depth8Image new) width: 16; height: 15; photometric:(#palette); bitsPerSample:(#(8)); samplesPerPixel:(1); bits:(ByteArray fromPackedString:' |
f90f3404359d
icons must be language independent
Claus Gittinger <cg@exept.de>
parents:
5398
diff
changeset
|
601 |
@@@@@@@@@@@@@@@@@@@@@@@DA@PDA@PDA@P@@@@@@@@@A@XFA XFA XD@@@@@@@@@@PFA XF@@@@@@@@@@@@@@@DA XF@@XFA P@@@@@@@@@A@XF@@XFA XD |
f90f3404359d
icons must be language independent
Claus Gittinger <cg@exept.de>
parents:
5398
diff
changeset
|
602 |
@@@@@@@@@@PFA @FA XFA@@@@@@@@@@DA X@A XFA P@@@@@@@@@A@XF@@XFA XD@@@@@@@@@@PFA X@A XFA@@@@@@@@@@DA XFA @@@@@@@@@@@@@@A@XF |
f90f3404359d
icons must be language independent
Claus Gittinger <cg@exept.de>
parents:
5398
diff
changeset
|
603 |
A XFA XD@@@@@@@@@@PFA XFA XFA@@@@@@@@@@DA@PDA@PDA@P@@@@@@@@@@@@@@@@@@@@@@@@@@@@@') ; colorMapFromArray:#[0 0 0 129 129 129 0 0 0 194 194 194 132 132 132 198 198 198 255 255 255]; mask:((Depth1Image new) width: 16; height: 15; photometric:(#blackIs0); bitsPerSample:(#(1)); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@A?0G?@_<A?8G?P_=A?4G?P_?A?>G?\_<9?1 @@') ; yourself); yourself] |
3892 | 604 |
! |
605 |
||
6083 | 606 |
directoryUpIcon |
607 |
<resource: #programImage> |
|
608 |
||
609 |
^ ToolbarIconLibrary directoryUpIcon |
|
610 |
! |
|
611 |
||
3892 | 612 |
fileInIcon |
613 |
<resource: #programImage> |
|
614 |
||
4094 | 615 |
^ ToolbarIconLibrary fileIn20x20Icon3 |
3892 | 616 |
! |
617 |
||
618 |
goHomeIcon |
|
6074 | 619 |
<resource: #programImage> |
620 |
||
621 |
^ self homeIcon |
|
3892 | 622 |
! |
623 |
||
4593 | 624 |
gotoDefaultDirectoryIcon |
6074 | 625 |
<resource: #programImage> |
626 |
||
627 |
^ self stxHomeIcon |
|
4593 | 628 |
! |
629 |
||
3892 | 630 |
hexToggle22x22Icon |
631 |
"This resource specification was automatically generated |
|
632 |
by the ImageEditor of ST/X." |
|
633 |
||
634 |
"Do not manually edit this!! If it is corrupted, |
|
635 |
the ImageEditor may not be able to read the specification." |
|
636 |
||
637 |
" |
|
638 |
self hexToggle22x22Icon inspect |
|
639 |
ImageEditor openOnClass:self andSelector:#hexToggle22x22Icon |
|
5412
f90f3404359d
icons must be language independent
Claus Gittinger <cg@exept.de>
parents:
5398
diff
changeset
|
640 |
Icon flushCachedIcons |
3892 | 641 |
" |
642 |
||
643 |
<resource: #image> |
|
644 |
||
645 |
^Icon |
|
4414 | 646 |
constantNamed:#'AbstractFileBrowser class hexToggle22x22Icon' |
5412
f90f3404359d
icons must be language independent
Claus Gittinger <cg@exept.de>
parents:
5398
diff
changeset
|
647 |
ifAbsentPut:[(Depth8Image new) width: 14; height: 17; photometric:(#palette); bitsPerSample:(#(8)); samplesPerPixel:(1); bits:(ByteArray fromPackedString:' |
f90f3404359d
icons must be language independent
Claus Gittinger <cg@exept.de>
parents:
5398
diff
changeset
|
648 |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@APTEAPTEAPTEAP@@@@@E@@@@AP@@@@TE@@@@@@TEAP@E@@TEAPT@@@@@APT@@@T@@@TEAP@@@@@EAPT@ |
f90f3404359d
icons must be language independent
Claus Gittinger <cg@exept.de>
parents:
5398
diff
changeset
|
649 |
AP@EAPTE@@@@@@T@@@@E@@TEAPT@@@@@APTEAPTEAPTEAP@@@@@E@@@@AP@@@@TE@@@@@@T@AP@E@@T@APT@@@@@AP@@@@T@@@@EAP@@@@@E@@T@AP@E@@TE |
f90f3404359d
icons must be language independent
Claus Gittinger <cg@exept.de>
parents:
5398
diff
changeset
|
650 |
@@@@@@T@AP@E@@@@APT@@@@@APTEAPTEAPTEAP@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@a') ; colorMapFromArray:#[0 0 0 105 133 190 129 129 129 194 194 194 255 0 0 255 255 255]; mask:((Depth1Image new) width: 14; height: 17; photometric:(#blackIs0); bitsPerSample:(#(1)); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@A?>G?8_?!!?>G?8_?!!?>G?8_?!!?>G?8_?!!?>G?8_? @@@@a') ; yourself); yourself] |
3892 | 651 |
! |
652 |
||
6079 | 653 |
historyBackIcon |
654 |
<resource: #programImage> |
|
655 |
||
656 |
^ ToolbarIconLibrary historyBackIcon |
|
657 |
! |
|
658 |
||
659 |
historyForwardIcon |
|
660 |
<resource: #programImage> |
|
661 |
||
662 |
^ ToolbarIconLibrary historyForwardIcon |
|
663 |
! |
|
664 |
||
3892 | 665 |
homeIcon |
666 |
<resource: #programImage> |
|
667 |
||
6079 | 668 |
^ ToolbarIconLibrary homeIcon |
3892 | 669 |
! |
670 |
||
6074 | 671 |
homeIcon2 |
6079 | 672 |
<resource: #programImage> |
673 |
||
674 |
^ ToolbarIconLibrary homeIcon2 |
|
6074 | 675 |
! |
676 |
||
677 |
htmlReloadIcon |
|
678 |
<resource: #programImage> |
|
679 |
||
680 |
^ ToolbarIconLibrary reload22x22Icon |
|
681 |
! |
|
682 |
||
3892 | 683 |
leftDownIcon |
684 |
"This resource specification was automatically generated |
|
685 |
by the ImageEditor of ST/X." |
|
686 |
||
687 |
"Do not manually edit this!! If it is corrupted, |
|
688 |
the ImageEditor may not be able to read the specification." |
|
689 |
||
690 |
" |
|
691 |
self leftDownIcon inspect |
|
692 |
ImageEditor openOnClass:self andSelector:#leftDownIcon |
|
693 |
" |
|
694 |
||
695 |
<resource: #image> |
|
696 |
||
697 |
^Icon |
|
4414 | 698 |
constantNamed:#'AbstractFileBrowser class leftDownIcon' |
699 |
ifAbsentPut:[(Depth2Image new) width: 28; height: 28; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:' |
|
3892 | 700 |
UUUUUUUUUUUPAUUUUUUUP@UUUUUUUPB!!UUUUUU@B*AUUUUU@B*(UUUUUPB** UUUUPB***AUUUTB***(EUUUB****%UUUR*****UUUUU@*%UUUUUUPJ)UUUU |
701 |
UUTB*UUUUUUU@*%UUUUUUPJ)UUUUUUTB*UUUUUUU@*%UUUUUUPJ)UUUUUUTB*UUUUUUU@*$@@@@AUPJ*****)UTB******UU@******%UPJ*****)UTAUUUU |
|
702 |
UUUU@@@@@@@AUUUUUUUUUP@a') ; colorMapFromArray:#[255 255 255 0 0 0 40 40 100 255 0 0]; mask:((Depth1Image new) width: 28; height: 28; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:' |
|
703 |
@@@@@@@@@@@@ @@@@\@@@@O @@@G<@@@C? @@A?<@@@?? @@_?<@@G?? @@C<@@@@?@@@@O0@@@C<@@@@?@@@@O0@@@C<@@@@?@@@@O0@@@C??? @???8@O? |
|
704 |
?>@C??? @???8@O??>@@@@@@@@@@@@@a') ; yourself); yourself] |
|
705 |
! |
|
706 |
||
707 |
menuHistoryList9x20Icon |
|
708 |
"This resource specification was automatically generated |
|
709 |
by the ImageEditor of ST/X." |
|
710 |
||
711 |
"Do not manually edit this!! If it is corrupted, |
|
712 |
the ImageEditor may not be able to read the specification." |
|
713 |
||
714 |
" |
|
715 |
self menuHistoryList9x20Icon inspect |
|
716 |
ImageEditor openOnClass:self andSelector:#menuHistoryList9x20Icon |
|
717 |
Icon flushCachedIcons |
|
718 |
" |
|
719 |
||
720 |
<resource: #image> |
|
721 |
||
722 |
^Icon |
|
4414 | 723 |
constantNamed:#'AbstractFileBrowser class menuHistoryList9x20Icon' |
724 |
ifAbsentPut:[(Depth1Image new) width: 9; height: 20; photometric:(#palette); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@A0@G@@\@A0@G@@\@A0@G@@\@A0@G@A?@C8@G@@H@G<@@@@@@@@a') ; colorMapFromArray:#[255 255 255 0 0 0]; mask:((Depth1Image new) width: 9; height: 20; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@A0@G@@\@A0@G@@\@A0@G@@\@A0@G@A?@C8@G@@H@G<@@@@@@@@a') ; yourself); yourself] |
|
3892 | 725 |
! |
726 |
||
727 |
menuHistoryListIcon |
|
728 |
"This resource specification was automatically generated |
|
729 |
by the ImageEditor of ST/X." |
|
730 |
||
731 |
"Do not manually edit this!! If it is corrupted, |
|
732 |
the ImageEditor may not be able to read the specification." |
|
733 |
||
734 |
" |
|
735 |
self menuHistoryListIcon inspect |
|
736 |
ImageEditor openOnClass:self andSelector:#menuHistoryListIcon |
|
737 |
" |
|
738 |
||
739 |
<resource: #image> |
|
740 |
||
741 |
^Icon |
|
4414 | 742 |
constantNamed:#'AbstractFileBrowser class menuHistoryListIcon' |
743 |
ifAbsentPut:[(Depth1Image new) width: 12; height: 12; photometric:(#palette); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'??S?<O?0??C?<O?0??/?=_?0??C?<O?0') ; colorMapFromArray:#[255 255 255 0 0 0]; mask:((Depth1Image new) width: 12; height: 12; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@O@@<@C0A?8C?@G8@O@@X@@@A?8@@@') ; yourself); yourself] |
|
3892 | 744 |
! |
745 |
||
6087 | 746 |
newDirectoryIcon |
6074 | 747 |
<resource: #programImage> |
748 |
||
6087 | 749 |
^ ToolbarIconLibrary newDirectoryIcon |
3923 | 750 |
! |
751 |
||
6091 | 752 |
removeTabIcon |
753 |
<resource: #programImage> |
|
754 |
||
755 |
^ ToolbarIconLibrary removeTabIcon |
|
756 |
! |
|
757 |
||
6074 | 758 |
stxHomeIcon |
6079 | 759 |
<resource: #programImage> |
760 |
||
761 |
^ ToolbarIconLibrary stxHomeIcon |
|
6074 | 762 |
! |
763 |
||
3892 | 764 |
vt100Terminal |
765 |
<resource: #programImage> |
|
766 |
||
767 |
^ ToolbarIconLibrary shell20x20Icon |
|
768 |
! ! |
|
769 |
||
5528 | 770 |
!AbstractFileBrowser class methodsFor:'interface specs'! |
771 |
||
772 |
encodingDialogSpec |
|
773 |
"This resource specification was automatically generated |
|
774 |
by the UIPainter of ST/X." |
|
775 |
||
776 |
"Do not manually edit this!! If it is corrupted, |
|
777 |
the UIPainter may not be able to read the specification." |
|
778 |
||
779 |
" |
|
780 |
UIPainter new openOnClass:AbstractFileBrowser andSelector:#encodingDialogSpec |
|
781 |
AbstractFileBrowser new openInterface:#encodingDialogSpec |
|
782 |
" |
|
783 |
||
784 |
<resource: #canvas> |
|
785 |
||
786 |
^ |
|
787 |
#(FullSpec |
|
788 |
name: encodingDialogSpec |
|
789 |
window: |
|
790 |
(WindowSpec |
|
791 |
label: 'File Encoding' |
|
792 |
name: 'File Encoding' |
|
793 |
min: (Point 10 10) |
|
5626 | 794 |
bounds: (Rectangle 0 0 379 590) |
5528 | 795 |
) |
796 |
component: |
|
797 |
(SpecCollection |
|
798 |
collection: ( |
|
799 |
(LabelSpec |
|
800 |
label: 'Label' |
|
801 |
name: 'Select the Character Encoding' |
|
802 |
layout: (LayoutFrame 0 0 0 0 0 1 30 0) |
|
803 |
translateLabel: true |
|
804 |
adjust: left |
|
805 |
) |
|
806 |
(DataSetSpec |
|
807 |
name: 'Table1' |
|
5737 | 808 |
layout: (LayoutFrame 0 0 30 0 0 1 -60 1) |
5528 | 809 |
model: selectedEncoding |
810 |
hasHorizontalScrollBar: true |
|
811 |
hasVerticalScrollBar: true |
|
812 |
dataList: encodingList |
|
813 |
has3Dsepartors: true |
|
814 |
has3Dseparators: true |
|
815 |
columns: |
|
816 |
(OrderedCollection |
|
817 |
||
818 |
(DataSetColumnSpec |
|
819 |
label: 'Encoding' |
|
820 |
translateLabel: true |
|
821 |
labelButtonType: Button |
|
822 |
model: at: |
|
823 |
canSelect: false |
|
824 |
isResizeable: false |
|
825 |
showRowSeparator: false |
|
826 |
showColSeparator: false |
|
827 |
) |
|
828 |
(DataSetColumnSpec |
|
829 |
label: 'Description' |
|
830 |
translateLabel: true |
|
831 |
labelButtonType: Button |
|
832 |
model: at: |
|
833 |
canSelect: false |
|
834 |
isResizeable: false |
|
835 |
showRowSeparator: false |
|
836 |
showColSeparator: false |
|
837 |
) |
|
838 |
) |
|
5626 | 839 |
doubleClickChannel: accept |
5528 | 840 |
) |
841 |
(HorizontalPanelViewSpec |
|
5737 | 842 |
name: 'ButtonPanel' |
5528 | 843 |
layout: (LayoutFrame 0 0 -30 1 0 1 0 1) |
844 |
horizontalLayout: fitSpace |
|
845 |
verticalLayout: center |
|
846 |
horizontalSpace: 3 |
|
847 |
verticalSpace: 3 |
|
848 |
reverseOrderIfOKAtLeft: true |
|
849 |
component: |
|
850 |
(SpecCollection |
|
851 |
collection: ( |
|
852 |
(ActionButtonSpec |
|
853 |
label: 'Cancel' |
|
854 |
name: 'Button2' |
|
855 |
translateLabel: true |
|
856 |
model: cancel |
|
5737 | 857 |
extent: (Point 185 22) |
5528 | 858 |
) |
859 |
(ActionButtonSpec |
|
860 |
label: 'OK' |
|
861 |
name: 'Button1' |
|
862 |
translateLabel: true |
|
863 |
model: accept |
|
864 |
isDefault: true |
|
5737 | 865 |
extent: (Point 185 22) |
5528 | 866 |
) |
867 |
) |
|
868 |
||
869 |
) |
|
870 |
) |
|
5737 | 871 |
(CheckBoxSpec |
872 |
label: 'Lock Encoding' |
|
873 |
name: 'LockEncodingCheckBox' |
|
874 |
layout: (LayoutFrame 3 0 -60 1 217 0 -30 1) |
|
875 |
activeHelpKey: lockFileEncoding |
|
876 |
model: lockFileEncoding |
|
877 |
translateLabel: true |
|
878 |
) |
|
5528 | 879 |
) |
880 |
||
881 |
) |
|
882 |
) |
|
883 |
! ! |
|
884 |
||
3892 | 885 |
!AbstractFileBrowser class methodsFor:'menu specs'! |
886 |
||
887 |
baseBookmarksMenuSpec |
|
888 |
"This resource specification was automatically generated |
|
889 |
by the MenuEditor of ST/X." |
|
890 |
||
891 |
"Do not manually edit this!! If it is corrupted, |
|
892 |
the MenuEditor may not be able to read the specification." |
|
893 |
||
894 |
" |
|
895 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#baseBookmarksMenuSpec |
|
896 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser baseBookmarksMenuSpec)) startUp |
|
897 |
" |
|
898 |
||
899 |
<resource: #menu> |
|
900 |
||
901 |
^ |
|
902 |
#(#Menu |
|
4414 | 903 |
#( |
904 |
#(#MenuItem |
|
905 |
#label: 'Add Bookmark' |
|
906 |
#translateLabel: true |
|
907 |
#value: #addBookmark |
|
908 |
#enabled: #currentFilesHasDirectories |
|
909 |
) |
|
910 |
#(#MenuItem |
|
911 |
#label: 'Remove Bookmark' |
|
912 |
#translateLabel: true |
|
913 |
#value: #removeBookmark |
|
914 |
#enabled: #hasBookmarksToRemove |
|
915 |
) |
|
4679 | 916 |
#(#MenuItem |
917 |
#label: 'Save Bookmarks In...' |
|
918 |
#translateLabel: true |
|
919 |
#value: #saveBookmarks |
|
920 |
) |
|
4414 | 921 |
) |
922 |
nil |
|
923 |
nil |
|
3892 | 924 |
) |
925 |
! |
|
926 |
||
4110 | 927 |
browserMenu |
928 |
"This resource specification was automatically generated |
|
929 |
by the MenuEditor of ST/X." |
|
930 |
||
931 |
"Do not manually edit this!! If it is corrupted, |
|
932 |
the MenuEditor may not be able to read the specification." |
|
933 |
||
934 |
" |
|
935 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#browserMenu |
|
936 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser browserMenu)) startUp |
|
937 |
" |
|
938 |
||
939 |
<resource: #menu> |
|
940 |
||
941 |
^ |
|
5273 | 942 |
#(Menu |
943 |
( |
|
944 |
(MenuItem |
|
945 |
label: 'Spawn' |
|
946 |
itemValue: doSpawn |
|
947 |
translateLabel: true |
|
5962
ed6a7de8cc91
Add accelerators: Ctrl-t for new tab and Ctrl-n for new window
Stefan Vogel <sv@exept.de>
parents:
5961
diff
changeset
|
948 |
shortcutKey: Ctrln |
4201 | 949 |
) |
5273 | 950 |
(MenuItem |
951 |
label: '-' |
|
4201 | 952 |
) |
5273 | 953 |
(MenuItem |
954 |
label: 'Add Text Editor' |
|
955 |
itemValue: newTextEditor |
|
956 |
translateLabel: true |
|
5963
57ae5e061db8
Accelerator Ctrl-t for new text editor
Stefan Vogel <sv@exept.de>
parents:
5962
diff
changeset
|
957 |
shortcutKey: Ctrlt |
4392 | 958 |
) |
5273 | 959 |
(MenuItem |
960 |
label: 'Add Shell Terminal' |
|
961 |
itemValue: doAddTerminal |
|
962 |
translateLabel: true |
|
4201 | 963 |
) |
5273 | 964 |
(MenuItem |
965 |
label: 'Add Search Tile' |
|
966 |
itemValue: doOpenSearchFile |
|
967 |
translateLabel: true |
|
4201 | 968 |
) |
5273 | 969 |
(MenuItem |
970 |
label: '-' |
|
4201 | 971 |
) |
5273 | 972 |
(MenuItem |
973 |
label: 'Settings...' |
|
974 |
itemValue: doOpenSettings |
|
975 |
translateLabel: true |
|
5104 | 976 |
) |
5273 | 977 |
(MenuItem |
5528 | 978 |
label: 'Encoding...' |
979 |
itemValue: fileEncodingDialog |
|
980 |
translateLabel: true |
|
981 |
) |
|
982 |
(MenuItem |
|
5273 | 983 |
label: '-' |
5104 | 984 |
) |
5273 | 985 |
(MenuItem |
986 |
label: 'Exit' |
|
987 |
itemValue: closeRequest |
|
988 |
translateLabel: true |
|
4201 | 989 |
) |
990 |
) |
|
991 |
nil |
|
992 |
nil |
|
4110 | 993 |
) |
5962
ed6a7de8cc91
Add accelerators: Ctrl-t for new tab and Ctrl-n for new window
Stefan Vogel <sv@exept.de>
parents:
5961
diff
changeset
|
994 |
|
5963
57ae5e061db8
Accelerator Ctrl-t for new text editor
Stefan Vogel <sv@exept.de>
parents:
5962
diff
changeset
|
995 |
"Modified: / 03-08-2004 / 19:46:50 / stefan" |
4110 | 996 |
! |
997 |
||
4107 | 998 |
cvsMenu |
999 |
"This resource specification was automatically generated |
|
1000 |
by the MenuEditor of ST/X." |
|
1001 |
||
1002 |
"Do not manually edit this!! If it is corrupted, |
|
1003 |
the MenuEditor may not be able to read the specification." |
|
1004 |
||
1005 |
" |
|
1006 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#cvsMenu |
|
1007 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser cvsMenu)) startUp |
|
1008 |
" |
|
1009 |
||
1010 |
<resource: #menu> |
|
1011 |
||
1012 |
^ |
|
1013 |
#(#Menu |
|
4414 | 1014 |
#( |
1015 |
#(#MenuItem |
|
1016 |
#enabled: #hasSelection |
|
1017 |
#label: 'Update selected Files/Directories' |
|
1018 |
#itemValue: #cvsUpdateSelection |
|
1019 |
#translateLabel: true |
|
1020 |
) |
|
1021 |
#(#MenuItem |
|
1022 |
#label: 'Update Directory Local' |
|
1023 |
#itemValue: #cvsUpdateAll |
|
1024 |
#translateLabel: true |
|
1025 |
) |
|
1026 |
#(#MenuItem |
|
1027 |
#label: 'Update Directory Recursive' |
|
1028 |
#itemValue: #cvsUpdateAllRecursive |
|
1029 |
#translateLabel: true |
|
1030 |
) |
|
1031 |
#(#MenuItem |
|
1032 |
#label: '-' |
|
1033 |
) |
|
1034 |
#(#MenuItem |
|
1035 |
#label: 'Commit...' |
|
1036 |
#itemValue: #cvsCommit |
|
1037 |
#translateLabel: true |
|
1038 |
) |
|
1039 |
#(#MenuItem |
|
1040 |
#enabled: #canCvsAddAndCommit |
|
1041 |
#label: 'Add && Commit...' |
|
1042 |
#itemValue: #cvsAddAndCommit |
|
1043 |
#translateLabel: true |
|
1044 |
) |
|
1045 |
#(#MenuItem |
|
4849 | 1046 |
#enabled: #canCvsAddAndCommit |
1047 |
#label: 'Add as Binary && Commit...' |
|
1048 |
#itemValue: #cvsAddBinaryAndCommit |
|
1049 |
#translateLabel: true |
|
1050 |
) |
|
1051 |
#(#MenuItem |
|
4414 | 1052 |
#label: '-' |
1053 |
) |
|
1054 |
#(#MenuItem |
|
1055 |
#enabled: #canRemoveCVSContainer |
|
1056 |
#label: 'Remove File && CVS Container...' |
|
1057 |
#itemValue: #cvsRemoveFileAndCVSContainer |
|
1058 |
#translateLabel: true |
|
1059 |
) |
|
1060 |
) |
|
1061 |
nil |
|
1062 |
nil |
|
4107 | 1063 |
) |
1064 |
! |
|
1065 |
||
3892 | 1066 |
directoryMenu |
1067 |
"This resource specification was automatically generated |
|
1068 |
by the MenuEditor of ST/X." |
|
1069 |
||
1070 |
"Do not manually edit this!! If it is corrupted, |
|
1071 |
the MenuEditor may not be able to read the specification." |
|
1072 |
||
1073 |
" |
|
1074 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#directoryMenu |
|
1075 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser directoryMenu)) startUp |
|
1076 |
" |
|
1077 |
||
1078 |
<resource: #menu> |
|
1079 |
||
1080 |
^ |
|
1081 |
#(#Menu |
|
4414 | 1082 |
#( |
1083 |
#(#MenuItem |
|
1084 |
#label: 'Up' |
|
1085 |
#translateLabel: true |
|
1086 |
#value: #doGoDirectoryUp |
|
1087 |
) |
|
1088 |
#(#MenuItem |
|
1089 |
#label: '-' |
|
1090 |
) |
|
1091 |
#(#MenuItem |
|
1092 |
#label: 'Back' |
|
1093 |
#translateLabel: true |
|
1094 |
#value: #doBack |
|
1095 |
#activeHelpKey: #directoryBack |
|
1096 |
#enabled: #enableBack |
|
1097 |
) |
|
1098 |
#(#MenuItem |
|
1099 |
#label: 'Forward' |
|
1100 |
#translateLabel: true |
|
1101 |
#value: #doForward |
|
1102 |
#activeHelpKey: #directoryBack |
|
1103 |
#enabled: #enableForward |
|
1104 |
) |
|
1105 |
#(#MenuItem |
|
1106 |
#label: '-' |
|
1107 |
) |
|
1108 |
#(#MenuItem |
|
5632 | 1109 |
#label: 'Default Directory' |
4414 | 1110 |
#translateLabel: true |
1111 |
#value: #doGotoDefaultDirectory |
|
1112 |
) |
|
1113 |
#(#MenuItem |
|
5632 | 1114 |
#label: 'Home Directory' |
4414 | 1115 |
#translateLabel: true |
1116 |
#value: #doGotoHomeDirectory |
|
1117 |
) |
|
1118 |
#(#MenuItem |
|
1119 |
#label: 'Visited Directories' |
|
1120 |
#translateLabel: true |
|
1121 |
#submenuChannel: #visitedDirectoriesMenu |
|
1122 |
) |
|
1123 |
#(#MenuItem |
|
1124 |
#label: 'Bookmarks' |
|
1125 |
#translateLabel: true |
|
1126 |
#submenuChannel: #bookmarksMenuSpec |
|
1127 |
) |
|
1128 |
) |
|
1129 |
nil |
|
1130 |
nil |
|
3892 | 1131 |
) |
1132 |
! |
|
1133 |
||
1134 |
editMenu |
|
1135 |
"This resource specification was automatically generated |
|
1136 |
by the MenuEditor of ST/X." |
|
1137 |
||
1138 |
"Do not manually edit this!! If it is corrupted, |
|
1139 |
the MenuEditor may not be able to read the specification." |
|
1140 |
||
1141 |
" |
|
1142 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#editMenu |
|
1143 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser editMenu)) startUp |
|
1144 |
" |
|
1145 |
||
1146 |
<resource: #menu> |
|
1147 |
||
1148 |
^ |
|
5888 | 1149 |
#(Menu |
1150 |
( |
|
1151 |
(MenuItem |
|
1152 |
enabled: hasFileSelection |
|
1153 |
label: 'Copy Selected Filenames to Clipboard' |
|
1154 |
itemValue: copySelectedFilenames |
|
1155 |
translateLabel: true |
|
4414 | 1156 |
) |
5888 | 1157 |
(MenuItem |
1158 |
enabled: fileListIsNotEmpty |
|
1159 |
label: 'Copy All Filenames to Clipboard' |
|
1160 |
itemValue: copyFileList |
|
1161 |
translateLabel: true |
|
4940
4964068c4718
allow settings dialog to be opened from browser
Claus Gittinger <cg@exept.de>
parents:
4930
diff
changeset
|
1162 |
) |
5888 | 1163 |
(MenuItem |
1164 |
label: '-' |
|
4940
4964068c4718
allow settings dialog to be opened from browser
Claus Gittinger <cg@exept.de>
parents:
4930
diff
changeset
|
1165 |
) |
5888 | 1166 |
(MenuItem |
1167 |
label: 'Settings...' |
|
1168 |
itemValue: openSettingsDialog |
|
1169 |
translateLabel: true |
|
4414 | 1170 |
) |
1171 |
) |
|
1172 |
nil |
|
1173 |
nil |
|
3892 | 1174 |
) |
1175 |
! |
|
1176 |
||
1177 |
fileMenu |
|
1178 |
"This resource specification was automatically generated |
|
1179 |
by the MenuEditor of ST/X." |
|
1180 |
||
1181 |
"Do not manually edit this!! If it is corrupted, |
|
1182 |
the MenuEditor may not be able to read the specification." |
|
1183 |
||
1184 |
" |
|
1185 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#fileMenu |
|
1186 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser fileMenu)) startUp |
|
1187 |
" |
|
1188 |
||
1189 |
<resource: #menu> |
|
1190 |
||
1191 |
^ |
|
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1192 |
#(Menu |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1193 |
( |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1194 |
(MenuItem |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1195 |
label: 'New' |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1196 |
translateLabel: true |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1197 |
submenuChannel: newMenu |
5425 | 1198 |
keepLinkedMenu: true |
4414 | 1199 |
) |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1200 |
(MenuItem |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1201 |
label: '-' |
4534 | 1202 |
) |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1203 |
(MenuItem |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1204 |
enabled: hasSelection |
5945 | 1205 |
label: 'Cut' |
1206 |
itemValue: cutFiles |
|
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1207 |
translateLabel: true |
4789
238d5e783f5c
editMenu was really a file menu
Claus Gittinger <cg@exept.de>
parents:
4785
diff
changeset
|
1208 |
) |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1209 |
(MenuItem |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1210 |
enabled: hasSelection |
5945 | 1211 |
label: 'Copy' |
1212 |
itemValue: copyFiles |
|
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1213 |
translateLabel: true |
4789
238d5e783f5c
editMenu was really a file menu
Claus Gittinger <cg@exept.de>
parents:
4785
diff
changeset
|
1214 |
) |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1215 |
(MenuItem |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1216 |
enabled: canPaste |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1217 |
label: 'Paste' |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1218 |
itemValue: pasteFiles |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1219 |
translateLabel: true |
4789
238d5e783f5c
editMenu was really a file menu
Claus Gittinger <cg@exept.de>
parents:
4785
diff
changeset
|
1220 |
) |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1221 |
(MenuItem |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1222 |
enabled: hasSelection |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1223 |
label: 'Delete' |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1224 |
itemValue: deleteFiles |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1225 |
translateLabel: true |
4789
238d5e783f5c
editMenu was really a file menu
Claus Gittinger <cg@exept.de>
parents:
4785
diff
changeset
|
1226 |
) |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1227 |
(MenuItem |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1228 |
label: '-' |
4789
238d5e783f5c
editMenu was really a file menu
Claus Gittinger <cg@exept.de>
parents:
4785
diff
changeset
|
1229 |
) |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1230 |
(MenuItem |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1231 |
enabled: hasSelection |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1232 |
label: 'Rename...' |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1233 |
itemValue: renameSelection |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1234 |
translateLabel: true |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1235 |
shortcutKey: Replace |
4414 | 1236 |
) |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1237 |
(MenuItem |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1238 |
enabled: hasSelection |
5634 | 1239 |
label: 'Move To...' |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1240 |
itemValue: moveSelection |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1241 |
translateLabel: true |
4414 | 1242 |
) |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1243 |
(MenuItem |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1244 |
enabled: hasSelection |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1245 |
label: 'Properties...' |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1246 |
itemValue: doShowProperties |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1247 |
translateLabel: true |
4554 | 1248 |
) |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1249 |
(MenuItem |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1250 |
label: '-' |
4531 | 1251 |
) |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1252 |
(MenuItem |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1253 |
label: 'Operations' |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1254 |
translateLabel: true |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1255 |
submenuChannel: fileOpMenu |
5425 | 1256 |
keepLinkedMenu: true |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1257 |
) |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1258 |
(MenuItem |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1259 |
label: 'Edit' |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1260 |
itemValue: doShowFileContents |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1261 |
translateLabel: true |
4414 | 1262 |
) |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1263 |
(MenuItem |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1264 |
enabled: hasFileSelection |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1265 |
label: 'FileIn' |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1266 |
itemValue: fileFileIn |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1267 |
translateLabel: true |
4414 | 1268 |
) |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1269 |
(MenuItem |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1270 |
enabled: hasFileSelection |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1271 |
label: 'FileIn to Namespace...' |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1272 |
itemValue: fileFileInToNameSpace |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1273 |
translateLabel: true |
4414 | 1274 |
) |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1275 |
(MenuItem |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1276 |
label: '-' |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1277 |
isVisible: javaSupportLoaded |
4414 | 1278 |
) |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1279 |
(MenuItem |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1280 |
enabled: canAddToClassPath |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1281 |
label: 'Add to Java Class Path' |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1282 |
translateLabel: true |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1283 |
isVisible: javaSupportLoaded |
4414 | 1284 |
) |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1285 |
(MenuItem |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1286 |
enabled: canRemoveFromClassPath |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1287 |
label: 'Remove from Java Class Path' |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1288 |
translateLabel: true |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1289 |
isVisible: javaSupportLoaded |
4414 | 1290 |
) |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1291 |
(MenuItem |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1292 |
enabled: canAddToSourcePath |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1293 |
label: 'Add to Java Source Path' |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1294 |
translateLabel: true |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1295 |
isVisible: javaSupportLoaded |
4414 | 1296 |
) |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1297 |
(MenuItem |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1298 |
enabled: canRemoveFromSourcePath |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1299 |
label: 'Remove from Java Source Path' |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1300 |
translateLabel: true |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1301 |
isVisible: javaSupportLoaded |
4414 | 1302 |
) |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1303 |
(MenuItem |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1304 |
label: '-' |
5242
04616d3a672c
history fixed (only kept the oldest items, instead of the newest ones)
Claus Gittinger <cg@exept.de>
parents:
5162
diff
changeset
|
1305 |
) |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1306 |
(MenuItem |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1307 |
enabled: enableFileHistory |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1308 |
label: 'File History' |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1309 |
translateLabel: true |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1310 |
submenuChannel: menuFileHistory |
5242
04616d3a672c
history fixed (only kept the oldest items, instead of the newest ones)
Claus Gittinger <cg@exept.de>
parents:
5162
diff
changeset
|
1311 |
) |
4414 | 1312 |
) |
1313 |
nil |
|
1314 |
nil |
|
3892 | 1315 |
) |
1316 |
! |
|
1317 |
||
4930 | 1318 |
fileOpMenu |
1319 |
"This resource specification was automatically generated |
|
1320 |
by the MenuEditor of ST/X." |
|
1321 |
||
1322 |
"Do not manually edit this!! If it is corrupted, |
|
1323 |
the MenuEditor may not be able to read the specification." |
|
1324 |
||
1325 |
" |
|
1326 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#fileOpMenu |
|
1327 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser fileOpMenu)) startUp |
|
1328 |
" |
|
1329 |
||
1330 |
<resource: #menu> |
|
1331 |
||
1332 |
^ |
|
1333 |
#(#Menu |
|
1334 |
#( |
|
1335 |
#(#MenuItem |
|
1336 |
#label: 'Split...' |
|
1337 |
#itemValue: #splitSelectedFiles |
|
1338 |
#translateLabel: true |
|
1339 |
) |
|
1340 |
#(#MenuItem |
|
1341 |
#label: 'Join...' |
|
1342 |
#itemValue: #joinSelectedFiles |
|
1343 |
#translateLabel: true |
|
1344 |
) |
|
1345 |
#(#MenuItem |
|
1346 |
#label: '-' |
|
1347 |
) |
|
1348 |
#(#MenuItem |
|
1349 |
#label: 'Rot13...' |
|
1350 |
#itemValue: #filterSelectedFiles: |
|
1351 |
#translateLabel: true |
|
1352 |
#argument: #rot13 |
|
1353 |
) |
|
1354 |
#(#MenuItem |
|
1355 |
#label: '-' |
|
1356 |
) |
|
1357 |
#(#MenuItem |
|
1358 |
#label: 'Truncate...' |
|
1359 |
#itemValue: #truncateSelectedFilesToZeroSize |
|
1360 |
#translateLabel: true |
|
1361 |
) |
|
1362 |
) |
|
1363 |
nil |
|
1364 |
nil |
|
1365 |
) |
|
1366 |
! |
|
1367 |
||
3892 | 1368 |
newMenu |
1369 |
"This resource specification was automatically generated |
|
1370 |
by the MenuEditor of ST/X." |
|
1371 |
||
1372 |
"Do not manually edit this!! If it is corrupted, |
|
1373 |
the MenuEditor may not be able to read the specification." |
|
1374 |
||
1375 |
" |
|
1376 |
MenuEditor new openOnClass:DirectoryTreeBrowser andSelector:#newMenu |
|
1377 |
(Menu new fromLiteralArrayEncoding:(DirectoryTreeBrowser newMenu)) startUp |
|
1378 |
" |
|
1379 |
||
1380 |
<resource: #menu> |
|
1381 |
||
1382 |
^ |
|
1383 |
#(#Menu |
|
4414 | 1384 |
#( |
1385 |
#(#MenuItem |
|
1386 |
#label: 'Directory...' |
|
1387 |
#translateLabel: true |
|
1388 |
#value: #newDirectory |
|
1389 |
) |
|
1390 |
#(#MenuItem |
|
1391 |
#label: 'File...' |
|
1392 |
#translateLabel: true |
|
1393 |
#value: #newFile |
|
1394 |
) |
|
1395 |
#(#MenuItem |
|
1396 |
#label: 'Hard Link...' |
|
1397 |
#translateLabel: true |
|
1398 |
#isVisible: #systemIsUnix |
|
1399 |
#value: #newHardLink |
|
1400 |
) |
|
1401 |
#(#MenuItem |
|
1402 |
#label: 'Symbolic Link...' |
|
1403 |
#translateLabel: true |
|
1404 |
#isVisible: #systemIsUnix |
|
1405 |
#value: #newSoftLink |
|
1406 |
) |
|
1407 |
) |
|
1408 |
nil |
|
1409 |
nil |
|
3892 | 1410 |
) |
3906 | 1411 |
! |
1412 |
||
4201 | 1413 |
showMenuSpec |
1414 |
"This resource specification was automatically generated |
|
1415 |
by the MenuEditor of ST/X." |
|
1416 |
||
1417 |
"Do not manually edit this!! If it is corrupted, |
|
1418 |
the MenuEditor may not be able to read the specification." |
|
1419 |
||
1420 |
" |
|
1421 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#showMenuSpec |
|
1422 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser showMenuSpec)) startUp |
|
1423 |
" |
|
1424 |
||
1425 |
<resource: #menu> |
|
1426 |
||
1427 |
^ |
|
1428 |
#(#Menu |
|
1429 |
#( |
|
1430 |
#(#MenuItem |
|
1431 |
#label: 'Hidden Files' |
|
1432 |
#translateLabel: true |
|
1433 |
#indication: #showHiddenFiles |
|
1434 |
) |
|
1435 |
#(#MenuItem |
|
1436 |
#label: '-' |
|
1437 |
) |
|
1438 |
#(#MenuItem |
|
1439 |
#label: 'Directory Tree' |
|
1440 |
#translateLabel: true |
|
1441 |
#indication: #showDirectoryTree |
|
1442 |
) |
|
1443 |
#(#MenuItem |
|
1444 |
#label: 'Regular Files in TreeView (Left)' |
|
1445 |
#translateLabel: true |
|
1446 |
#indication: #viewFilesInDirectoryTree |
|
1447 |
) |
|
1448 |
#(#MenuItem |
|
1449 |
#label: 'Directories in ContentsView (Right)' |
|
1450 |
#translateLabel: true |
|
1451 |
#indication: #viewDirsInContentsBrowser |
|
1452 |
) |
|
1453 |
#(#MenuItem |
|
1454 |
#enabled: #enableViewNoteBookApplication |
|
1455 |
#label: 'File Applications' |
|
1456 |
#translateLabel: true |
|
1457 |
#indication: #viewNoteBookApplicationHolder |
|
1458 |
) |
|
4554 | 1459 |
#(#MenuItem |
1460 |
#label: '-' |
|
1461 |
) |
|
1462 |
#(#MenuItem |
|
1463 |
#label: 'DiskUsage' |
|
1464 |
#translateLabel: true |
|
1465 |
#hideMenuOnActivated: false |
|
1466 |
#indication: #showDiskUsageHolder |
|
1467 |
) |
|
4201 | 1468 |
) |
1469 |
nil |
|
1470 |
nil |
|
1471 |
) |
|
1472 |
! |
|
1473 |
||
3906 | 1474 |
sortMenu |
1475 |
"This resource specification was automatically generated |
|
1476 |
by the MenuEditor of ST/X." |
|
1477 |
||
1478 |
"Do not manually edit this!! If it is corrupted, |
|
1479 |
the MenuEditor may not be able to read the specification." |
|
1480 |
||
1481 |
" |
|
3907 | 1482 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#sortMenu |
1483 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser sortMenu)) startUp |
|
3906 | 1484 |
" |
1485 |
||
1486 |
<resource: #menu> |
|
1487 |
||
1488 |
^ |
|
1489 |
#(#Menu |
|
4414 | 1490 |
#( |
1491 |
#(#MenuItem |
|
1492 |
#label: 'By Filename' |
|
1493 |
#translateLabel: true |
|
1494 |
#hideMenuOnActivated: false |
|
1495 |
#choice: #sortBlockProperty |
|
1496 |
#choiceValue: #baseName |
|
1497 |
) |
|
1498 |
#(#MenuItem |
|
5122 | 1499 |
#label: 'By Extension' |
4414 | 1500 |
#translateLabel: true |
1501 |
#hideMenuOnActivated: false |
|
1502 |
#choice: #sortBlockProperty |
|
1503 |
#choiceValue: #suffix |
|
1504 |
) |
|
1505 |
#(#MenuItem |
|
1506 |
#label: 'By Permissions' |
|
1507 |
#translateLabel: true |
|
1508 |
#hideMenuOnActivated: false |
|
1509 |
#choice: #sortBlockProperty |
|
1510 |
#choiceValue: #permissions |
|
1511 |
) |
|
1512 |
#(#MenuItem |
|
1513 |
#label: 'By Owner' |
|
1514 |
#translateLabel: true |
|
1515 |
#isVisible: #viewOwner |
|
1516 |
#hideMenuOnActivated: false |
|
1517 |
#choice: #sortBlockProperty |
|
1518 |
#choiceValue: #owner |
|
1519 |
) |
|
1520 |
#(#MenuItem |
|
1521 |
#label: 'By Group' |
|
1522 |
#translateLabel: true |
|
1523 |
#isVisible: #viewOwner |
|
1524 |
#hideMenuOnActivated: false |
|
1525 |
#choice: #sortBlockProperty |
|
1526 |
#choiceValue: #group |
|
1527 |
) |
|
1528 |
#(#MenuItem |
|
1529 |
#label: 'By Size' |
|
1530 |
#translateLabel: true |
|
1531 |
#hideMenuOnActivated: false |
|
1532 |
#choice: #sortBlockProperty |
|
1533 |
#choiceValue: #fileSize |
|
1534 |
) |
|
1535 |
#(#MenuItem |
|
1536 |
#label: 'By Date && Time' |
|
1537 |
#translateLabel: true |
|
1538 |
#hideMenuOnActivated: false |
|
1539 |
#choice: #sortBlockProperty |
|
1540 |
#choiceValue: #modificationTime |
|
1541 |
) |
|
1542 |
#(#MenuItem |
|
1543 |
#label: '-' |
|
1544 |
) |
|
1545 |
#(#MenuItem |
|
1546 |
#label: 'Ignore Case in Sort' |
|
1547 |
#translateLabel: true |
|
1548 |
#hideMenuOnActivated: false |
|
1549 |
#indication: #sortCaseless |
|
1550 |
) |
|
1551 |
#(#MenuItem |
|
1552 |
#label: 'Directories before Files' |
|
1553 |
#translateLabel: true |
|
1554 |
#hideMenuOnActivated: false |
|
1555 |
#indication: #sortDirectoriesBeforeFiles |
|
1556 |
) |
|
1557 |
) |
|
1558 |
nil |
|
1559 |
nil |
|
3906 | 1560 |
) |
4018 | 1561 |
! |
1562 |
||
4164
81154143d447
move toolsMenuSpec from FileBrowserV2 to AbstractFileBrowser
penk
parents:
4163
diff
changeset
|
1563 |
toolsMenuSpec |
81154143d447
move toolsMenuSpec from FileBrowserV2 to AbstractFileBrowser
penk
parents:
4163
diff
changeset
|
1564 |
"This resource specification was automatically generated |
81154143d447
move toolsMenuSpec from FileBrowserV2 to AbstractFileBrowser
penk
parents:
4163
diff
changeset
|
1565 |
by the MenuEditor of ST/X." |
81154143d447
move toolsMenuSpec from FileBrowserV2 to AbstractFileBrowser
penk
parents:
4163
diff
changeset
|
1566 |
|
81154143d447
move toolsMenuSpec from FileBrowserV2 to AbstractFileBrowser
penk
parents:
4163
diff
changeset
|
1567 |
"Do not manually edit this!! If it is corrupted, |
81154143d447
move toolsMenuSpec from FileBrowserV2 to AbstractFileBrowser
penk
parents:
4163
diff
changeset
|
1568 |
the MenuEditor may not be able to read the specification." |
81154143d447
move toolsMenuSpec from FileBrowserV2 to AbstractFileBrowser
penk
parents:
4163
diff
changeset
|
1569 |
|
81154143d447
move toolsMenuSpec from FileBrowserV2 to AbstractFileBrowser
penk
parents:
4163
diff
changeset
|
1570 |
" |
4367 | 1571 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#toolsMenuSpec |
1572 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser toolsMenuSpec)) startUp |
|
4164
81154143d447
move toolsMenuSpec from FileBrowserV2 to AbstractFileBrowser
penk
parents:
4163
diff
changeset
|
1573 |
" |
81154143d447
move toolsMenuSpec from FileBrowserV2 to AbstractFileBrowser
penk
parents:
4163
diff
changeset
|
1574 |
|
81154143d447
move toolsMenuSpec from FileBrowserV2 to AbstractFileBrowser
penk
parents:
4163
diff
changeset
|
1575 |
<resource: #menu> |
81154143d447
move toolsMenuSpec from FileBrowserV2 to AbstractFileBrowser
penk
parents:
4163
diff
changeset
|
1576 |
|
81154143d447
move toolsMenuSpec from FileBrowserV2 to AbstractFileBrowser
penk
parents:
4163
diff
changeset
|
1577 |
^ |
5830 | 1578 |
#(Menu |
1579 |
( |
|
1580 |
(MenuItem |
|
1581 |
label: 'Execute Command...' |
|
1582 |
itemValue: doExecuteCommand |
|
1583 |
translateLabel: true |
|
4230 | 1584 |
) |
5830 | 1585 |
(MenuItem |
5880 | 1586 |
label: 'Execute Script...' |
1587 |
itemValue: doExecuteScript |
|
1588 |
translateLabel: true |
|
1589 |
isVisible: true |
|
1590 |
) |
|
1591 |
(MenuItem |
|
5830 | 1592 |
enabled: canDoTerminal |
1593 |
label: 'Shell Terminal' |
|
1594 |
itemValue: openTerminal |
|
1595 |
translateLabel: true |
|
1596 |
isVisible: canDoTerminalAndSystemIsUnix |
|
4230 | 1597 |
) |
5830 | 1598 |
(MenuItem |
1599 |
enabled: canDoTerminal |
|
1600 |
label: 'DOS Terminal' |
|
1601 |
itemValue: openTerminal |
|
1602 |
translateLabel: true |
|
1603 |
isVisible: canDoTerminalAndSystemIsDOS |
|
4230 | 1604 |
) |
5830 | 1605 |
(MenuItem |
1606 |
label: '-' |
|
4230 | 1607 |
) |
5830 | 1608 |
(MenuItem |
1609 |
enabled: hasFileSelection |
|
1610 |
label: 'Changes Browser' |
|
1611 |
itemValue: openChangesBrowser |
|
1612 |
translateLabel: true |
|
4230 | 1613 |
) |
5830 | 1614 |
(MenuItem |
1615 |
enabled: hasFileSelection |
|
1616 |
label: 'ChangeSet Browser' |
|
1617 |
itemValue: openChangeSetBrowser |
|
1618 |
translateLabel: true |
|
1619 |
isVisible: false |
|
4230 | 1620 |
) |
5830 | 1621 |
(MenuItem |
6022 | 1622 |
enabled: hasFileSelection |
1623 |
label: 'Workspace' |
|
1624 |
itemValue: openWorkspace |
|
1625 |
translateLabel: true |
|
1626 |
) |
|
1627 |
(MenuItem |
|
5830 | 1628 |
enabled: hasSnapshotSelection |
1629 |
label: 'Snapshot Image Browser' |
|
1630 |
itemValue: openSnapshotImageBrowser |
|
1631 |
translateLabel: true |
|
4230 | 1632 |
) |
5830 | 1633 |
(MenuItem |
1634 |
enabled: canCreateNewProject |
|
1635 |
label: 'Create Smalltalk Project' |
|
1636 |
itemValue: createProjectAndOpenProjectBrowser |
|
1637 |
translateLabel: true |
|
4230 | 1638 |
) |
5830 | 1639 |
(MenuItem |
6022 | 1640 |
label: '-' |
1641 |
) |
|
1642 |
(MenuItem |
|
5830 | 1643 |
enabled: canReadAbbrevFile |
1644 |
label: 'Install Autoloaded' |
|
1645 |
itemValue: readAbbrevFile |
|
1646 |
translateLabel: true |
|
4230 | 1647 |
) |
5830 | 1648 |
(MenuItem |
1649 |
enabled: anySTFilesPresent |
|
5960 | 1650 |
label: 'Install All as Autoloaded' |
5830 | 1651 |
itemValue: installAllAsAutoloaded |
1652 |
translateLabel: true |
|
4230 | 1653 |
) |
5830 | 1654 |
(MenuItem |
1655 |
label: '-' |
|
4230 | 1656 |
) |
5830 | 1657 |
(MenuItem |
1658 |
label: 'File Utilities' |
|
1659 |
translateLabel: true |
|
1660 |
submenu: |
|
1661 |
(Menu |
|
1662 |
( |
|
1663 |
(MenuItem |
|
1664 |
enabled: hasFileSelection |
|
1665 |
label: 'Editor' |
|
1666 |
itemValue: openEditor |
|
1667 |
translateLabel: true |
|
4820 | 1668 |
) |
5830 | 1669 |
(MenuItem |
1670 |
enabled: hasFileSelection |
|
1671 |
label: 'HTML Reader' |
|
1672 |
itemValue: openHTMLReader |
|
1673 |
translateLabel: true |
|
4820 | 1674 |
) |
5830 | 1675 |
(MenuItem |
1676 |
enabled: hasFileSelection |
|
1677 |
label: 'Acroread (PDF Viewer)' |
|
1678 |
itemValue: openPDFViewer |
|
1679 |
translateLabel: true |
|
4820 | 1680 |
) |
5830 | 1681 |
(MenuItem |
1682 |
enabled: hasASN1AndSelection |
|
1683 |
label: 'ASN1 Browser' |
|
1684 |
itemValue: openASN1Browser |
|
1685 |
translateLabel: true |
|
1686 |
isVisible: hasASN1 |
|
4820 | 1687 |
) |
5830 | 1688 |
(MenuItem |
1689 |
enabled: hasCBrowser |
|
1690 |
label: 'C Browser' |
|
1691 |
itemValue: openCBrowser |
|
1692 |
translateLabel: true |
|
1693 |
isVisible: hasCBrowser |
|
4820 | 1694 |
) |
5830 | 1695 |
(MenuItem |
1696 |
enabled: hasJavaAndSelection |
|
1697 |
label: 'Applet Viewer' |
|
1698 |
itemValue: openAppletViewer |
|
1699 |
translateLabel: true |
|
1700 |
isVisible: hasJava |
|
4820 | 1701 |
) |
5830 | 1702 |
(MenuItem |
1703 |
enabled: hasMP3PlayerAndSelection |
|
1704 |
label: 'MP3 Player' |
|
1705 |
itemValue: openMP3Player |
|
1706 |
translateLabel: true |
|
1707 |
isVisible: hasMP3Player |
|
4820 | 1708 |
) |
5830 | 1709 |
(MenuItem |
1710 |
enabled: hasFileSelection |
|
1711 |
label: 'xv (Image Viewer)' |
|
1712 |
itemValue: openXV |
|
1713 |
translateLabel: true |
|
4950 | 1714 |
) |
5830 | 1715 |
(MenuItem |
1716 |
enabled: currentFilesAreInSameDirectory |
|
1717 |
label: 'Slide Show' |
|
1718 |
itemValue: openSlideShow |
|
1719 |
translateLabel: true |
|
1720 |
isVisible: hasSlideShow |
|
4820 | 1721 |
) |
5830 | 1722 |
(MenuItem |
1723 |
enabled: hasFileSelection |
|
1724 |
label: 'gv (Postscript Viewer)' |
|
1725 |
itemValue: openGV |
|
1726 |
translateLabel: true |
|
4957 | 1727 |
) |
5830 | 1728 |
(MenuItem |
1729 |
enabled: hasFileSelection |
|
1730 |
label: 'realplay (avi viewer)' |
|
1731 |
itemValue: openRP |
|
1732 |
translateLabel: true |
|
4958 | 1733 |
) |
4820 | 1734 |
) |
1735 |
nil |
|
1736 |
nil |
|
1737 |
) |
|
4230 | 1738 |
) |
5830 | 1739 |
(MenuItem |
1740 |
label: 'Image' |
|
1741 |
translateLabel: true |
|
1742 |
submenu: |
|
1743 |
(Menu |
|
1744 |
( |
|
1745 |
(MenuItem |
|
1746 |
enabled: hasFileSelection |
|
1747 |
label: 'Image Editor' |
|
1748 |
itemValue: openImageEditor |
|
1749 |
translateLabel: true |
|
4367 | 1750 |
) |
5830 | 1751 |
(MenuItem |
1752 |
enabled: hasFileSelection |
|
1753 |
label: 'Image Preview' |
|
1754 |
itemValue: openImagePreview |
|
1755 |
translateLabel: true |
|
4367 | 1756 |
) |
5830 | 1757 |
(MenuItem |
1758 |
enabled: hasFileSelection |
|
1759 |
label: 'Image Inspector' |
|
1760 |
itemValue: openImageInspector |
|
1761 |
translateLabel: true |
|
4531 | 1762 |
) |
5830 | 1763 |
(MenuItem |
1764 |
label: '-' |
|
4367 | 1765 |
) |
5830 | 1766 |
(MenuItem |
1767 |
enabled: hasFileSelection |
|
1768 |
label: 'Convert to GIF' |
|
1769 |
itemValue: convertImageToGIF |
|
1770 |
translateLabel: true |
|
4367 | 1771 |
) |
5830 | 1772 |
(MenuItem |
1773 |
enabled: hasFileSelection |
|
1774 |
label: 'Convert to PNG' |
|
1775 |
itemValue: convertImageToPNG |
|
1776 |
translateLabel: true |
|
4531 | 1777 |
) |
5830 | 1778 |
(MenuItem |
1779 |
enabled: hasFileSelection |
|
1780 |
label: 'Convert to XPM' |
|
1781 |
itemValue: convertImageToXPM |
|
1782 |
translateLabel: true |
|
4721
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
1783 |
) |
5830 | 1784 |
(MenuItem |
1785 |
enabled: hasFileSelection |
|
1786 |
label: 'Convert to JPG' |
|
1787 |
itemValue: convertImageToJPG |
|
1788 |
translateLabel: true |
|
4721
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
1789 |
) |
4367 | 1790 |
) |
1791 |
nil |
|
1792 |
nil |
|
1793 |
) |
|
4230 | 1794 |
) |
5830 | 1795 |
(MenuItem |
1796 |
enabled: hasZipFileSelected |
|
1797 |
label: 'ZipFile Tool' |
|
1798 |
itemValue: openZipTool |
|
1799 |
translateLabel: true |
|
4230 | 1800 |
) |
5830 | 1801 |
(MenuItem |
1802 |
label: 'Find' |
|
1803 |
translateLabel: true |
|
1804 |
submenu: |
|
1805 |
(Menu |
|
1806 |
( |
|
1807 |
(MenuItem |
|
1808 |
label: 'File...' |
|
1809 |
itemValue: fileFindFile |
|
1810 |
translateLabel: true |
|
4367 | 1811 |
) |
5830 | 1812 |
(MenuItem |
1813 |
label: 'Duplicate Files' |
|
1814 |
itemValue: fileFindDuplicates |
|
1815 |
translateLabel: true |
|
5082 | 1816 |
) |
5830 | 1817 |
(MenuItem |
1818 |
enabled: hasSelection |
|
1819 |
label: 'All Duplicate Files (Recursive)' |
|
1820 |
itemValue: fileFindAllDuplicates |
|
1821 |
translateLabel: true |
|
4367 | 1822 |
) |
1823 |
) |
|
1824 |
nil |
|
1825 |
nil |
|
1826 |
) |
|
4230 | 1827 |
) |
5830 | 1828 |
(MenuItem |
1829 |
enabled: hasSelection |
|
1830 |
label: 'File Differences' |
|
1831 |
itemValue: openDiffView |
|
1832 |
translateLabel: true |
|
1833 |
isVisible: hasTwoFilesSelectedHolder |
|
4230 | 1834 |
) |
5830 | 1835 |
(MenuItem |
1836 |
enabled: hasSelection |
|
1837 |
label: 'File Differences...' |
|
1838 |
itemValue: openDiffView |
|
1839 |
translateLabel: true |
|
1840 |
isVisible: hasNotTwoFilesSelectedHolder |
|
1841 |
) |
|
1842 |
(MenuItem |
|
1843 |
enabled: hasFileSelection |
|
1844 |
label: 'Hex Dump' |
|
1845 |
itemValue: fileHexDump |
|
1846 |
translateLabel: true |
|
4230 | 1847 |
) |
1848 |
) |
|
1849 |
nil |
|
1850 |
nil |
|
4164
81154143d447
move toolsMenuSpec from FileBrowserV2 to AbstractFileBrowser
penk
parents:
4163
diff
changeset
|
1851 |
) |
81154143d447
move toolsMenuSpec from FileBrowserV2 to AbstractFileBrowser
penk
parents:
4163
diff
changeset
|
1852 |
! |
81154143d447
move toolsMenuSpec from FileBrowserV2 to AbstractFileBrowser
penk
parents:
4163
diff
changeset
|
1853 |
|
4018 | 1854 |
viewDetailsMenuSpec |
1855 |
"This resource specification was automatically generated |
|
1856 |
by the MenuEditor of ST/X." |
|
1857 |
||
1858 |
"Do not manually edit this!! If it is corrupted, |
|
1859 |
the MenuEditor may not be able to read the specification." |
|
1860 |
||
1861 |
" |
|
4648 | 1862 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#viewDetailsMenuSpec |
1863 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser viewDetailsMenuSpec)) startUp |
|
4018 | 1864 |
" |
1865 |
||
1866 |
<resource: #menu> |
|
1867 |
||
1868 |
^ |
|
1869 |
#(#Menu |
|
4414 | 1870 |
#( |
1871 |
#(#MenuItem |
|
1872 |
#label: '-' |
|
1873 |
) |
|
1874 |
#(#MenuItem |
|
1875 |
#label: 'Hidden Files' |
|
1876 |
#translateLabel: true |
|
1877 |
#indication: #showHiddenFiles |
|
1878 |
) |
|
1879 |
) |
|
1880 |
nil |
|
1881 |
nil |
|
4018 | 1882 |
) |
3892 | 1883 |
! ! |
1884 |
||
1885 |
!AbstractFileBrowser class methodsFor:'misc'! |
|
1886 |
||
1887 |
newLock |
|
1888 |
^ CodeExecutionLock new |
|
1889 |
! ! |
|
1890 |
||
5644
e24749db1f5f
share resources with FileBrowser
Claus Gittinger <cg@exept.de>
parents:
5634
diff
changeset
|
1891 |
!AbstractFileBrowser class methodsFor:'resources'! |
e24749db1f5f
share resources with FileBrowser
Claus Gittinger <cg@exept.de>
parents:
5634
diff
changeset
|
1892 |
|
e24749db1f5f
share resources with FileBrowser
Claus Gittinger <cg@exept.de>
parents:
5634
diff
changeset
|
1893 |
classResources |
e24749db1f5f
share resources with FileBrowser
Claus Gittinger <cg@exept.de>
parents:
5634
diff
changeset
|
1894 |
^ FileBrowser classResources |
e24749db1f5f
share resources with FileBrowser
Claus Gittinger <cg@exept.de>
parents:
5634
diff
changeset
|
1895 |
! ! |
e24749db1f5f
share resources with FileBrowser
Claus Gittinger <cg@exept.de>
parents:
5634
diff
changeset
|
1896 |
|
4610 | 1897 |
!AbstractFileBrowser class methodsFor:'utilities'! |
1898 |
||
1899 |
contentsOfFileAsHexDump:f |
|
1900 |
|resources fileName stream data offs |
|
1901 |
addrDigits col line lineStream asciiLineStream lines| |
|
1902 |
||
1903 |
resources := self classResources. |
|
1904 |
||
1905 |
fileName := f baseName. |
|
1906 |
f isDirectory ifTrue:[ |
|
1907 |
Dialog warn:(resources string:'%1 is a directory.' with:fileName). |
|
1908 |
^ nil |
|
1909 |
]. |
|
1910 |
f exists ifFalse:[ |
|
1911 |
Dialog warn:(resources string:'oops, ''%1'' is gone or unreadable.' with:fileName). |
|
1912 |
^ nil |
|
1913 |
]. |
|
1914 |
f isReadable ifFalse:[ |
|
1915 |
Dialog warn:(resources string:'''%1'' is unreadable.' with:fileName). |
|
1916 |
^ nil |
|
1917 |
]. |
|
1918 |
f fileSize > (512*1024) ifTrue:[ |
|
1919 |
(Dialog confirm:(resources |
|
5046 | 1920 |
string:'Warning: the file is big (%1b). Show anyway ?' |
4610 | 1921 |
with:(UnitConverter fileSizeStringFor:f fileSize))) |
1922 |
ifFalse:[ |
|
1923 |
^ nil |
|
1924 |
] |
|
1925 |
]. |
|
1926 |
||
1927 |
stream := f readStream binary. |
|
1928 |
data := stream contents. |
|
1929 |
stream close. |
|
1930 |
||
1931 |
col := 1. |
|
1932 |
offs := 0. |
|
1933 |
lines := StringCollection new. |
|
1934 |
||
1935 |
addrDigits := ((f fileSize + 1) log:16) truncated + 1. |
|
1936 |
||
5755
5e8165d55605
replaced '' writeStream by String writeStream
Claus Gittinger <cg@exept.de>
parents:
5753
diff
changeset
|
1937 |
lineStream := String writeStream. |
5e8165d55605
replaced '' writeStream by String writeStream
Claus Gittinger <cg@exept.de>
parents:
5753
diff
changeset
|
1938 |
asciiLineStream := String writeStream. |
4610 | 1939 |
|
1940 |
lineStream nextPutAll:(offs hexPrintString:addrDigits). |
|
1941 |
lineStream nextPutAll:': '. |
|
1942 |
||
1943 |
data do:[:byte | |
|
1944 |
lineStream nextPutAll:(byte hexPrintString:2). |
|
1945 |
(byte between:32 and:127) ifTrue:[ |
|
1946 |
asciiLineStream nextPut:(Character value:byte) |
|
1947 |
] ifFalse:[ |
|
1948 |
asciiLineStream nextPut:$. |
|
1949 |
]. |
|
1950 |
||
1951 |
offs := offs + 1. |
|
1952 |
col := col + 1. |
|
1953 |
col > 16 ifTrue:[ |
|
1954 |
lineStream nextPutAll:' '. |
|
1955 |
lineStream nextPutAll:asciiLineStream contents. |
|
1956 |
lines add:(lineStream contents). |
|
1957 |
(offs bitAnd:16rFF) == 0 ifTrue:[ |
|
1958 |
lines add:nil |
|
1959 |
]. |
|
1960 |
lineStream reset. |
|
1961 |
asciiLineStream reset. |
|
1962 |
||
1963 |
lineStream nextPutAll:(offs hexPrintString:addrDigits). |
|
1964 |
lineStream nextPutAll:': '. |
|
1965 |
col := 1. |
|
1966 |
] ifFalse:[ |
|
1967 |
lineStream space |
|
1968 |
] |
|
1969 |
]. |
|
1970 |
line := lineStream contents paddedTo:(3*16 + addrDigits + 1). |
|
1971 |
lines add:(line , ' ' , asciiLineStream contents). |
|
1972 |
^ lines |
|
1973 |
! ! |
|
1974 |
||
3892 | 1975 |
!AbstractFileBrowser methodsFor:'actions'! |
1976 |
||
1977 |
askForCommandFor:fileName thenDo:aBlock |
|
1978 |
"setup and launch a querybox to ask for unix command. |
|
1979 |
Then evaluate aBlock passing the command-string as argument." |
|
1980 |
||
4523 | 1981 |
|box osName commandString| |
3892 | 1982 |
|
1983 |
osName := OperatingSystem platformName. |
|
1984 |
||
1985 |
box := FilenameEnterBox |
|
4414 | 1986 |
title:(resources string:'Execute %1 command:' with:osName) |
1987 |
okText:(resources string:'Execute') |
|
4523 | 1988 |
action:[:cmd | commandString := cmd]. |
3892 | 1989 |
|
1990 |
fileName notNil ifTrue:[ |
|
4414 | 1991 |
self initialCommandFor:fileName into:box. |
3892 | 1992 |
]. |
1993 |
box directory:(self getDirWithoutFileName:fileName). |
|
5003
a14ce263ada5
boxes no longer show at pointer
Claus Gittinger <cg@exept.de>
parents:
4982
diff
changeset
|
1994 |
box show. |
3892 | 1995 |
box destroy. |
1996 |
||
4523 | 1997 |
commandString notNil ifTrue:[ |
1998 |
aBlock value:commandString |
|
1999 |
]. |
|
2000 |
||
3892 | 2001 |
"Modified: / 7.9.1995 / 10:31:54 / claus" |
2002 |
"Modified: / 16.9.1997 / 15:35:10 / stefan" |
|
2003 |
"Modified: / 14.8.1998 / 14:12:52 / cg" |
|
2004 |
! |
|
2005 |
||
2006 |
changeFileBrowserTitleTo:aString |
|
4774 | 2007 |
self |
2008 |
applicationNamed:#FileBrowserV2 |
|
5009 | 2009 |
ifPresentDo:[:app | app changeFileBrowserTitleTo:aString] |
3892 | 2010 |
! |
2011 |
||
2012 |
copyFileList |
|
4774 | 2013 |
"copy the fileList to the clipBoard" |
2014 |
||
4973
e4b72eec43d3
refactoring the browserItemList access in directoryContentsBrowser
penk
parents:
4963
diff
changeset
|
2015 |
|fileList| |
e4b72eec43d3
refactoring the browserItemList access in directoryContentsBrowser
penk
parents:
4963
diff
changeset
|
2016 |
|
e4b72eec43d3
refactoring the browserItemList access in directoryContentsBrowser
penk
parents:
4963
diff
changeset
|
2017 |
fileList := self |
4774 | 2018 |
applicationNamed:#DirectoryContentsBrowser |
5009 | 2019 |
ifPresentDo:[:app | app browserFileList]. |
2020 |
||
2021 |
fileList notNil ifTrue:[ |
|
2022 |
self copyFileListToClipBoard:fileList. |
|
2023 |
] |
|
4973
e4b72eec43d3
refactoring the browserItemList access in directoryContentsBrowser
penk
parents:
4963
diff
changeset
|
2024 |
! |
e4b72eec43d3
refactoring the browserItemList access in directoryContentsBrowser
penk
parents:
4963
diff
changeset
|
2025 |
|
e4b72eec43d3
refactoring the browserItemList access in directoryContentsBrowser
penk
parents:
4963
diff
changeset
|
2026 |
copyFileListToClipBoard:fileList |
4774 | 2027 |
"copy the itemList to the clipBoard" |
2028 |
||
2029 |
|stream| |
|
2030 |
||
4973
e4b72eec43d3
refactoring the browserItemList access in directoryContentsBrowser
penk
parents:
4963
diff
changeset
|
2031 |
fileList isEmpty ifTrue:[^ self]. |
4774 | 2032 |
|
5772
603abfa8cf99
copy name(s) to clipboard - on lineFeed if only one file is selected
Claus Gittinger <cg@exept.de>
parents:
5756
diff
changeset
|
2033 |
stream := String writeStream. |
603abfa8cf99
copy name(s) to clipboard - on lineFeed if only one file is selected
Claus Gittinger <cg@exept.de>
parents:
5756
diff
changeset
|
2034 |
fileList size == 1 ifTrue:[ |
603abfa8cf99
copy name(s) to clipboard - on lineFeed if only one file is selected
Claus Gittinger <cg@exept.de>
parents:
5756
diff
changeset
|
2035 |
stream nextPutAll:(fileList first asString). |
603abfa8cf99
copy name(s) to clipboard - on lineFeed if only one file is selected
Claus Gittinger <cg@exept.de>
parents:
5756
diff
changeset
|
2036 |
] ifFalse:[ |
603abfa8cf99
copy name(s) to clipboard - on lineFeed if only one file is selected
Claus Gittinger <cg@exept.de>
parents:
5756
diff
changeset
|
2037 |
fileList do:[:fileName | |
603abfa8cf99
copy name(s) to clipboard - on lineFeed if only one file is selected
Claus Gittinger <cg@exept.de>
parents:
5756
diff
changeset
|
2038 |
(fileName baseName ~= '..') ifTrue:[ |
603abfa8cf99
copy name(s) to clipboard - on lineFeed if only one file is selected
Claus Gittinger <cg@exept.de>
parents:
5756
diff
changeset
|
2039 |
stream nextPutLine:(fileName asString). |
603abfa8cf99
copy name(s) to clipboard - on lineFeed if only one file is selected
Claus Gittinger <cg@exept.de>
parents:
5756
diff
changeset
|
2040 |
] |
603abfa8cf99
copy name(s) to clipboard - on lineFeed if only one file is selected
Claus Gittinger <cg@exept.de>
parents:
5756
diff
changeset
|
2041 |
]. |
3892 | 2042 |
]. |
6034 | 2043 |
self window setClipboardText:stream contents. |
3892 | 2044 |
! |
2045 |
||
2046 |
copySelectedFilenames |
|
4774 | 2047 |
"copy the selected fileNames to the clipBoard" |
2048 |
||
4973
e4b72eec43d3
refactoring the browserItemList access in directoryContentsBrowser
penk
parents:
4963
diff
changeset
|
2049 |
|fileList| |
e4b72eec43d3
refactoring the browserItemList access in directoryContentsBrowser
penk
parents:
4963
diff
changeset
|
2050 |
|
e4b72eec43d3
refactoring the browserItemList access in directoryContentsBrowser
penk
parents:
4963
diff
changeset
|
2051 |
fileList := self |
4774 | 2052 |
applicationNamed:#DirectoryContentsBrowser |
5009 | 2053 |
ifPresentDo:[:appl | appl selectedFileNames]. |
2054 |
fileList notNil ifTrue:[ |
|
2055 |
self copyFileListToClipBoard:fileList. |
|
2056 |
]. |
|
3892 | 2057 |
! |
2058 |
||
2059 |
doAddTerminal |
|
5960 | 2060 |
|dir| |
2061 |
||
2062 |
dir := self currentDirectory. |
|
3892 | 2063 |
|
5960 | 2064 |
dir isNil ifTrue:[ |
4414 | 2065 |
dir := Filename homeDirectory |
3892 | 2066 |
]. |
4774 | 2067 |
|
5009 | 2068 |
self |
2069 |
applicationNamed:#FileApplicationNoteBook |
|
2070 |
ifPresentDo:[:appl | appl addTerminalIn:dir]. |
|
3892 | 2071 |
! |
2072 |
||
2073 |
doOpenSearchFile |
|
5961 | 2074 |
|item file| |
2075 |
||
2076 |
file := self firstSelectedFileName. |
|
2077 |
file isNil ifTrue:[ |
|
2078 |
file := Filename homeDirectory asAbsoluteFilename. |
|
2079 |
]. |
|
2080 |
item := DirectoryContentsBrowser itemClass fileName:file. |
|
3892 | 2081 |
self openSearchFileOn:item. |
2082 |
! |
|
2083 |
||
2084 |
doShowFileContents |
|
5009 | 2085 |
self |
2086 |
applicationNamed:#DirectoryContentsBrowser |
|
2087 |
ifPresentDo:[:appl | ^ appl doShowFileContents]. |
|
2088 |
||
2089 |
^ nil |
|
3892 | 2090 |
! |
2091 |
||
2092 |
doShowProperties |
|
2093 |
||
2094 |
"show long stat (file)-info" |
|
2095 |
||
2096 |
self fileGetInfo:true |
|
2097 |
! |
|
2098 |
||
5528 | 2099 |
fileEncodingDialog |
2100 |
"open a dialog to allow change of the files character encoding. |
|
2101 |
Files are converted to internal encoding when read, and converted back |
|
2102 |
to this encoding when saved. |
|
2103 |
Notice: currently, not too many encodings are supported by the system." |
|
2104 |
||
2105 |
|bindings encodings encodingDescr idx selectedEncoding| |
|
2106 |
||
2107 |
encodingDescr := CharacterEncoder supportedExternalEncodings. |
|
2108 |
encodings := encodingDescr collect:[:d | d isNil ifTrue:[nil] ifFalse:[d first]]. |
|
2109 |
||
2110 |
bindings := IdentityDictionary new. |
|
2111 |
bindings at:#encodingList put:encodingDescr. |
|
2112 |
bindings at:#selectedEncoding put:(encodings indexOf:self fileEncoding ifAbsent:1) asValue. |
|
5737 | 2113 |
bindings at:#lockFileEncoding put:(self lockFileEncodingHolder value asValue). |
2114 |
||
5528 | 2115 |
(self openDialogInterface:#encodingDialogSpec withBindings:bindings) |
2116 |
ifTrue:[ |
|
2117 |
idx := (bindings at:#selectedEncoding) value. |
|
2118 |
selectedEncoding := encodings at:idx. |
|
2119 |
selectedEncoding notNil ifTrue:[ |
|
5704 | 2120 |
self fileEncoding:selectedEncoding asSymbol. |
5528 | 2121 |
]. |
5737 | 2122 |
self lockFileEncoding:(bindings at:#lockFileEncoding) value. |
5528 | 2123 |
]. |
2124 |
||
2125 |
"Modified: 30.6.1997 / 14:41:12 / cg" |
|
2126 |
! |
|
2127 |
||
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
2128 |
gotoFile:aFilename |
5380
2f738f3a34b1
fixed bug introduced by stefans beautification ;-)
Claus Gittinger <cg@exept.de>
parents:
5374
diff
changeset
|
2129 |
"select only if the file is not already in the selection" |
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
2130 |
|
5959 | 2131 |
|currentFileNameHolder currentSel| |
2132 |
||
2133 |
currentFileNameHolder := self currentFileNameHolder. |
|
2134 |
||
2135 |
currentSel := currentFileNameHolder value. |
|
5380
2f738f3a34b1
fixed bug introduced by stefans beautification ;-)
Claus Gittinger <cg@exept.de>
parents:
5374
diff
changeset
|
2136 |
(currentSel includes:aFilename) ifFalse:[ |
5959 | 2137 |
currentFileNameHolder value:(OrderedCollection with:(aFilename asAbsoluteFilename)). |
3964 | 2138 |
]. |
3892 | 2139 |
! |
2140 |
||
4392 | 2141 |
newTextEditor |
5009 | 2142 |
self |
2143 |
applicationNamed:#FileApplicationNoteBook |
|
2144 |
ifPresentDo:[:appl | ^ appl newTextEditor]. |
|
2145 |
||
2146 |
^ nil. |
|
2147 |
! |
|
2148 |
||
2149 |
openApplByFileItem:anItem |
|
5306 | 2150 |
^ self |
5009 | 2151 |
applicationNamed:#FileApplicationNoteBook |
5306 | 2152 |
ifPresentDo:[:appl | appl openApplByFileItem:anItem]. |
3892 | 2153 |
! |
2154 |
||
4392 | 2155 |
openApplForFile:aFilename |
5306 | 2156 |
^ self openApplByFileItem:(DirectoryContentsBrowser itemClass fileName:aFilename). |
4392 | 2157 |
! |
2158 |
||
3892 | 2159 |
openCommandResultApplication |
2160 |
||
5009 | 2161 |
self |
2162 |
applicationNamed:#FileApplicationNoteBook |
|
2163 |
ifPresentDo:[:appl | ^ appl openCommandResultApplication]. |
|
2164 |
||
2165 |
^ nil |
|
3892 | 2166 |
! |
2167 |
||
5010 | 2168 |
openNewTextEditorOn:anItem |
5009 | 2169 |
self |
2170 |
applicationNamed:#FileApplicationNoteBook |
|
5010 | 2171 |
ifPresentDo:[:appl | ^ appl openNewTextEditorOn:anItem ]. |
5009 | 2172 |
|
2173 |
^ nil |
|
4880
87f511659680
edit file in context menu of DirectoryContentsBroser opens a new tab
penk
parents:
4878
diff
changeset
|
2174 |
! |
87f511659680
edit file in context menu of DirectoryContentsBroser opens a new tab
penk
parents:
4878
diff
changeset
|
2175 |
|
5010 | 2176 |
openSearchFileOn:anItem |
5009 | 2177 |
self |
2178 |
applicationNamed:#FileApplicationNoteBook |
|
5010 | 2179 |
ifPresentDo:[:appl | ^ appl openSearchFileOn:anItem]. |
5009 | 2180 |
|
2181 |
^ nil. |
|
3892 | 2182 |
! |
2183 |
||
5162 | 2184 |
openTextEditorForFile:aFilename |
2185 |
^ self openTextEditorOn:(DirectoryContentsBrowser itemClass fileName:aFilename). |
|
2186 |
! |
|
2187 |
||
5010 | 2188 |
openTextEditorOn:anItem |
5009 | 2189 |
self |
2190 |
applicationNamed:#FileApplicationNoteBook |
|
5010 | 2191 |
ifPresentDo:[:appl | ^ appl openTextEditorOn:anItem ]. |
5009 | 2192 |
|
2193 |
^ nil. |
|
3892 | 2194 |
! |
2195 |
||
5010 | 2196 |
openTextEditorOn:anItem type:aDirDescrOrFile |
5009 | 2197 |
self |
2198 |
applicationNamed:#FileApplicationNoteBook |
|
5010 | 2199 |
ifPresentDo:[:appl | ^ appl openTextEditorOn:anItem type:aDirDescrOrFile]. |
5009 | 2200 |
|
2201 |
^ nil. |
|
4618 | 2202 |
! |
2203 |
||
5959 | 2204 |
setCurrentFileName:aFilename |
2205 |
self setCurrentFileNames:(OrderedCollection with:aFilename). |
|
2206 |
! |
|
2207 |
||
2208 |
setCurrentFileNames:aCollectionOfFilenames |
|
2209 |
self currentFileNameHolder value:aCollectionOfFilenames. |
|
2210 |
! |
|
2211 |
||
3892 | 2212 |
updateAndSelect:aColOfFiles |
4785
5a3f7a0c3ff1
symbolic link creation code fixed
Claus Gittinger <cg@exept.de>
parents:
4782
diff
changeset
|
2213 |
self updateCurrentDirectory. |
4707
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
2214 |
aColOfFiles notNil ifTrue:[ |
5959 | 2215 |
self setCurrentFileNames:aColOfFiles |
4707
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
2216 |
]. |
3892 | 2217 |
! |
2218 |
||
2219 |
updateCurrentDirectory |
|
5739 | 2220 |
self updateCurrentDirectory:false |
2221 |
! |
|
2222 |
||
2223 |
updateCurrentDirectory:withReread |
|
4785
5a3f7a0c3ff1
symbolic link creation code fixed
Claus Gittinger <cg@exept.de>
parents:
4782
diff
changeset
|
2224 |
DirectoryContents flushCachedDirectoryFor:(self getBestDirectory). |
5a3f7a0c3ff1
symbolic link creation code fixed
Claus Gittinger <cg@exept.de>
parents:
4782
diff
changeset
|
2225 |
|
5009 | 2226 |
self |
2227 |
applicationNamed:#DirectoryContentsBrowser |
|
5739 | 2228 |
ifPresentDo:[:appl | withReread ifTrue:[appl doUpdate] ifFalse:[appl doUpdateDirectoryContents]]. |
5009 | 2229 |
self |
2230 |
applicationNamed:#DirectoryTreeBrowser |
|
2231 |
ifPresentDo:[:appl | appl doUpdate]. |
|
4345 | 2232 |
! |
2233 |
||
5739 | 2234 |
updateCurrentDirectoryWithReread |
2235 |
self updateCurrentDirectory:true |
|
2236 |
! |
|
2237 |
||
4345 | 2238 |
withActivityIndicationDo:aBlock |
2239 |
||
2240 |
self activityVisibilityChannel value:true. |
|
2241 |
[ |
|
2242 |
aBlock value. |
|
2243 |
] ensure:[ |
|
2244 |
self activityVisibilityChannel value:false. |
|
2245 |
] |
|
3892 | 2246 |
! ! |
2247 |
||
2248 |
!AbstractFileBrowser methodsFor:'actions bookmarks'! |
|
2249 |
||
2250 |
addBookmark |
|
2251 |
|directories| |
|
2252 |
||
2253 |
self currentFilesAreInSameDirectory ifFalse:[^ self]. |
|
2254 |
directories := self currentDirectories value. |
|
4679 | 2255 |
self addBookmarks:directories. |
5960 | 2256 |
self class saveBookmarksInDefaultBookmarksFile |
4679 | 2257 |
! |
2258 |
||
2259 |
addBookmarks:aColOfDirectories |
|
4672
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
2260 |
aColOfDirectories do:[ :path | |
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
2261 |
self class addBookmark:path |
3892 | 2262 |
]. |
2263 |
! |
|
2264 |
||
2265 |
hasBookmarks |
|
4672
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
2266 |
^ self class hasBookmarks |
3892 | 2267 |
! |
2268 |
||
2269 |
hasBookmarksToRemove |
|
2270 |
|bookmarks directories| |
|
2271 |
||
3982 | 2272 |
directories := self currentSelectedDirectories. |
3892 | 2273 |
bookmarks := self class directoryBookmarks. |
2274 |
^ (bookmarks size > 0 and:[directories notEmpty]) |
|
2275 |
! |
|
2276 |
||
2277 |
removeBookmark |
|
4672
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
2278 |
self currentSelectedDirectories do:[:dir| |
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
2279 |
self class removeBookmark:dir |
3892 | 2280 |
]. |
4679 | 2281 |
! |
2282 |
||
2283 |
saveBookmarks |
|
2284 |
self class saveBookmarks |
|
3892 | 2285 |
! ! |
2286 |
||
2287 |
!AbstractFileBrowser methodsFor:'actions history'! |
|
2288 |
||
2289 |
addToCommandHistory:aCommandString for:aFilename |
|
2290 |
|cmd suffix cmdHist| |
|
2291 |
||
2292 |
cmdHist := self class commandHistory. |
|
2293 |
(aCommandString notNil and:[aCommandString notEmpty]) ifTrue:[ |
|
4414 | 2294 |
cmdHist notNil ifTrue:[ |
2295 |
cmdHist addFirst:aCommandString. |
|
2296 |
cmdHist size > self class commandHistorySize ifTrue:[ |
|
2297 |
cmdHist removeLast |
|
2298 |
] |
|
2299 |
]. |
|
2300 |
aFilename notNil ifTrue:[ |
|
2301 |
cmd := aCommandString copyTo:(aCommandString indexOf:Character space ifAbsent:[aCommandString size + 1])-1. |
|
2302 |
DefaultCommandPerSuffix isNil ifTrue:[ |
|
2303 |
DefaultCommandPerSuffix := Dictionary new. |
|
2304 |
]. |
|
2305 |
suffix := aFilename asFilename suffix. |
|
2306 |
suffix notNil ifTrue:[ |
|
2307 |
DefaultCommandPerSuffix at:suffix put:cmd. |
|
2308 |
] |
|
2309 |
] |
|
3892 | 2310 |
] |
2311 |
! |
|
2312 |
||
2313 |
doBack |
|
2314 |
||
4022 | 2315 |
| fileName| |
2316 |
||
4347 | 2317 |
fileName := self dirHistory goBackward. |
3892 | 2318 |
fileName notNil ifTrue:[ |
4347 | 2319 |
self gotoFile:(fileName asFilename). |
3892 | 2320 |
] |
2321 |
! |
|
2322 |
||
2323 |
doForward |
|
2324 |
||
3964 | 2325 |
| fileName| |
2326 |
||
3952 | 2327 |
fileName := self dirHistory goForward. |
3892 | 2328 |
fileName notNil ifTrue:[ |
4414 | 2329 |
self gotoFile:(fileName asFilename). |
4022 | 2330 |
] ifFalse:[ |
4414 | 2331 |
self enableForward value:false. |
4022 | 2332 |
|
2333 |
]. |
|
3892 | 2334 |
! ! |
2335 |
||
2336 |
!AbstractFileBrowser methodsFor:'applications'! |
|
2337 |
||
5009 | 2338 |
applicationNamed:anApplicationName ifPresentDo:aBlock |
2339 |
|appl| |
|
2340 |
||
2341 |
appl := self applications at:anApplicationName ifAbsent:nil. |
|
2342 |
appl notNil ifTrue:[ |
|
2343 |
^ aBlock value:appl |
|
2344 |
]. |
|
2345 |
^ nil. |
|
2346 |
! |
|
2347 |
||
4004 | 2348 |
directoryContentsBrowser |
2349 |
^ self applications at:#DirectoryContentsBrowser ifAbsent:nil. |
|
3892 | 2350 |
! ! |
2351 |
||
2352 |
!AbstractFileBrowser methodsFor:'aspects'! |
|
2353 |
||
2354 |
applications |
|
2355 |
"returns the list of registered applications |
|
2356 |
" |
|
2357 |
^ aspects at:#applications |
|
2358 |
! |
|
2359 |
||
2360 |
backgroundProcesses |
|
2361 |
||
2362 |
^ self aspectFor:#backgroundProcesses ifAbsent:[List new] |
|
2363 |
! |
|
2364 |
||
4230 | 2365 |
canMake |
6095 | 2366 |
^ self aspectFor:#canMake ifAbsent:[ false asValue ]. |
4230 | 2367 |
! |
2368 |
||
3892 | 2369 |
currentDirectories |
2370 |
||
2371 |
" returns a Ordered Collection of all directories currently selected |
|
2372 |
if only a file is selected currentDirectories holds the directory of the file |
|
2373 |
" |
|
2374 |
||
2375 |
^ self aspectFor:#currentDirectories ifAbsent:[ (OrderedCollection new) asValue ]. |
|
2376 |
! |
|
2377 |
||
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
2378 |
currentDirectory |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
2379 |
"return the single current directory or nil" |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
2380 |
|
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
2381 |
|directories| |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
2382 |
|
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
2383 |
directories := self currentDirectories value. |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
2384 |
(directories size ~= 1) ifTrue:[ |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
2385 |
^ nil |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
2386 |
]. |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
2387 |
^ directories first. |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
2388 |
! |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
2389 |
|
3892 | 2390 |
currentFileNameHolder |
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
2391 |
"return a ValueHolder with an OrderedCollection containing all selected files. |
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
2392 |
If no file but a directory is selected it contains the directories |
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
2393 |
in contrast to currentDirectories which have only the directories" |
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
2394 |
|
4213
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
2395 |
^ self aspectFor:#currentFileNameHolder ifAbsent:[ |
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
2396 |
|currentSel| |
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
2397 |
|
4692 | 2398 |
currentSel := self class currentSelection. |
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
2399 |
currentSel isEmpty ifTrue:[ |
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
2400 |
currentSel := OrderedCollection with:(Filename currentDirectory asAbsoluteFilename) |
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
2401 |
]. |
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
2402 |
currentSel asValue |
4213
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
2403 |
] notPresentDo:[:holder| |
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
2404 |
|filenames newFilenames| |
4213
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
2405 |
filenames := holder value. |
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
2406 |
newFilenames := Set new. |
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
2407 |
filenames do:[:eachFilename| |existingFilename| |
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
2408 |
existingFilename := eachFilename. |
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
2409 |
existingFilename notNil ifTrue:[ |
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
2410 |
[existingFilename exists] whileFalse:[ |
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
2411 |
existingFilename := existingFilename directory. |
4955
378481247391
if no item is selected directory up action do nothing now
penk
parents:
4950
diff
changeset
|
2412 |
]. |
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
2413 |
newFilenames add:existingFilename. |
4955
378481247391
if no item is selected directory up action do nothing now
penk
parents:
4950
diff
changeset
|
2414 |
] |
4213
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
2415 |
]. |
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
2416 |
newFilenames asOrderedCollection. |
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
2417 |
] |
3892 | 2418 |
! |
2419 |
||
5528 | 2420 |
defaultFileEncoding |
2421 |
^ #'iso8859-1' "/ #'utf-8' |
|
2422 |
! |
|
2423 |
||
3892 | 2424 |
enableDirectoryUp |
2425 |
||
2426 |
^ self aspectFor:#enableDirectoryUp ifAbsent:[false asValue] |
|
2427 |
! |
|
2428 |
||
4593 | 2429 |
enableGotoDefault |
2430 |
||
2431 |
^ self aspectFor:#enableGotoDefault ifAbsent:[ true asValue ]. |
|
2432 |
! |
|
2433 |
||
3892 | 2434 |
enableHome |
2435 |
||
2436 |
^ self aspectFor:#enableHome ifAbsent:[ true asValue ]. |
|
2437 |
! |
|
2438 |
||
2439 |
enableViewNoteBookApplication |
|
2440 |
||
2441 |
^ self aspectFor:#enableViewNoteBookApplication ifAbsent:[false asValue] |
|
2442 |
! |
|
2443 |
||
5528 | 2444 |
fileEncoding |
2445 |
^ self fileEncodingHolder value |
|
2446 |
! |
|
2447 |
||
2448 |
fileEncoding:newEncoding |
|
5533 | 2449 |
self fileEncodingHolder value:newEncoding. |
2450 |
||
2451 |
self |
|
2452 |
applicationNamed:#FileApplicationNoteBook |
|
2453 |
ifPresentDo:[:nb | |
|
2454 |
|appl| |
|
2455 |
||
2456 |
appl := nb selectedApplication. |
|
5535 | 2457 |
(appl notNil and:[appl isTextEditor]) ifTrue:[ |
5533 | 2458 |
appl fileEncoding:newEncoding |
2459 |
] |
|
2460 |
]. |
|
5528 | 2461 |
! |
2462 |
||
5737 | 2463 |
fileEncodingHolder |
2464 |
^ self |
|
2465 |
aspectFor:#fileEncodingHolder |
|
2466 |
ifAbsent:[ |
|
2467 |
self |
|
2468 |
applicationNamed:#FileApplicationNoteBook |
|
2469 |
ifPresentDo:[:appl | appl fileEncodingHolder]. |
|
2470 |
] |
|
2471 |
! |
|
2472 |
||
5961 | 2473 |
firstSelectedFileName |
2474 |
|files| |
|
2475 |
||
2476 |
files := self currentFileNameHolder value. |
|
2477 |
files notEmpty ifTrue:[ |
|
2478 |
^ files first |
|
2479 |
]. |
|
2480 |
^ nil |
|
2481 |
! |
|
2482 |
||
4618 | 2483 |
hasFileSelection |
2484 |
^ self aspectFor:#hasFileSelection ifAbsent:[ false asValue ]. |
|
2485 |
! |
|
2486 |
||
5830 | 2487 |
hasNotTwoFilesSelectedHolder |
2488 |
^ self aspectFor:#hasNotTwoFilesSelectedHolder |
|
2489 |
ifAbsent:[ |
|
2490 |
BlockValue |
|
2491 |
with:[:m | self hasTwoFilesSelected not] |
|
2492 |
argument:self currentFileNameHolder |
|
2493 |
]. |
|
2494 |
! |
|
2495 |
||
3892 | 2496 |
hasSelection |
2497 |
||
2498 |
^ self aspectFor:#hasSelection ifAbsent:[ false asValue ]. |
|
2499 |
! |
|
2500 |
||
4414 | 2501 |
hasTwoFilesSelectedHolder |
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
2502 |
^ self aspectFor:#hasTwoFilesSelectedHolder |
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
2503 |
ifAbsent:[ |
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
2504 |
BlockValue |
5830 | 2505 |
with:[:m | self hasTwoFilesSelected] |
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
2506 |
argument:self currentFileNameHolder |
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
2507 |
]. |
4414 | 2508 |
! |
2509 |
||
5737 | 2510 |
lockFileEncoding:aBoolean |
2511 |
self lockFileEncodingHolder value:aBoolean. |
|
2512 |
||
2513 |
self |
|
2514 |
applicationNamed:#FileApplicationNoteBook |
|
2515 |
ifPresentDo:[:nb | |
|
2516 |
|appl| |
|
2517 |
||
2518 |
appl := nb selectedApplication. |
|
2519 |
(appl notNil and:[appl isTextEditor]) ifTrue:[ |
|
2520 |
appl lockFileEncoding:aBoolean |
|
2521 |
] |
|
2522 |
]. |
|
2523 |
! |
|
2524 |
||
2525 |
lockFileEncodingHolder |
|
2526 |
^ self |
|
2527 |
aspectFor:#lockFileEncodingHolder |
|
2528 |
ifAbsent:[ |
|
2529 |
self |
|
2530 |
applicationNamed:#FileApplicationNoteBook |
|
2531 |
ifPresentDo:[:appl | appl lockFileEncodingHolder]. |
|
2532 |
] |
|
2533 |
! |
|
2534 |
||
4523 | 2535 |
notify:aString |
2536 |
self notifyChannel value:aString |
|
2537 |
! |
|
2538 |
||
3892 | 2539 |
notifyChannel |
2540 |
||
2541 |
^ self aspectFor:#notifyChannel ifAbsent:['' asValue] |
|
4071 | 2542 |
! |
2543 |
||
2544 |
rootHolder |
|
2545 |
"holder, which keeps the rootHolder of the treeView |
|
2546 |
" |
|
2547 |
||
4368
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
2548 |
^ self aspectFor:#rootHolder ifAbsent:[ |
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
2549 |
self class rootHolder asValue. |
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
2550 |
]. |
3892 | 2551 |
! ! |
2552 |
||
2553 |
!AbstractFileBrowser methodsFor:'aspects handling'! |
|
2554 |
||
2555 |
aspectFor:something ifAbsent:aBlock |
|
2556 |
"returns the model for an aspect |
|
2557 |
" |
|
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
2558 |
^ self aspectFor:something ifAbsent:aBlock notPresentDo:nil |
3892 | 2559 |
! |
2560 |
||
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
2561 |
aspectFor:aKey ifAbsent:aBlock notPresentDo:notPresentBlock |
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
2562 |
"return the model for an aspect" |
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
2563 |
|
4213
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
2564 |
|holder saveAspectItem aspect| |
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
2565 |
|
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
2566 |
holder := aspects at:aKey ifAbsent:[ |
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
2567 |
masterApplication notNil ifTrue:[ |
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
2568 |
holder := masterApplication aspectOrNil:aKey forSubApplication:self. |
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
2569 |
]. |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
2570 |
holder isNil ifTrue:[ |
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
2571 |
saveAspectItem := self runtimeAspectValueFor:aKey. |
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
2572 |
saveAspectItem notNil ifTrue:[ |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
2573 |
saveAspectItem isHolder ifTrue:[ |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
2574 |
holder := ValueHolder with:saveAspectItem value |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
2575 |
] ifFalse:[ |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
2576 |
holder := saveAspectItem value |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
2577 |
]. |
4213
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
2578 |
] ifFalse:[ |
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
2579 |
aspect := self userPreferencesAspectValueFor:aKey. |
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
2580 |
aspect notNil ifTrue:[ |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
2581 |
holder := aspect asValue |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
2582 |
] ifFalse:[ |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
2583 |
holder := aBlock value. |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
2584 |
] |
4213
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
2585 |
]. |
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
2586 |
]. |
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
2587 |
holder notNil ifTrue:[ |
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
2588 |
notPresentBlock notNil ifTrue:[ |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
2589 |
holder value:(notPresentBlock value:holder). |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
2590 |
]. |
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
2591 |
aspects at:aKey put:holder |
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
2592 |
]. |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
2593 |
holder |
4213
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
2594 |
]. |
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
2595 |
^ holder |
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
2596 |
! |
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
2597 |
|
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
2598 |
aspectFor:something put:aValueHolder |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
2599 |
aspects at:something put:aValueHolder |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
2600 |
! |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
2601 |
|
3892 | 2602 |
aspects |
2603 |
^ aspects |
|
2604 |
! |
|
2605 |
||
2606 |
runtimeAspectValueFor:something |
|
2607 |
"returns the default aspect item from the class variable RuntimeAspects |
|
2608 |
" |
|
2609 |
^ self class runtimeAspects at:something ifAbsent:nil. |
|
2610 |
! |
|
2611 |
||
4201 | 2612 |
saveAspectValues |
2613 |
|saveAspects aspectValue| |
|
2614 |
||
2615 |
||
2616 |
saveAspects := self class userPreferencesAspectList. |
|
2617 |
saveAspects do:[ : aspectKey | |
|
2618 |
aspectValue := (self perform:aspectKey) value. |
|
2619 |
UserPreferences current perform:((aspectKey asString, ':') asSymbol) with:aspectValue. |
|
2620 |
]. |
|
2621 |
! |
|
2622 |
||
3892 | 2623 |
saveRuntimeAspectValues |
2624 |
|savedAspects dictionary value isHolder aspect| |
|
2625 |
||
5941 | 2626 |
savedAspects := self class listOfRuntimeValuesToRemember. |
3892 | 2627 |
dictionary := Dictionary new. |
5941 | 2628 |
savedAspects do:[:aspectKey | |
4414 | 2629 |
aspect := self perform:aspectKey. |
2630 |
isHolder := aspect isValueModel. |
|
5941 | 2631 |
isHolder ifTrue:[ |
2632 |
value := aspect value |
|
2633 |
] ifFalse:[ |
|
2634 |
value := aspect |
|
2635 |
]. |
|
2636 |
dictionary at:aspectKey |
|
2637 |
put:(SaveAspectItem withValue:value isHolder:isHolder) |
|
2638 |
]. |
|
2639 |
RuntimeAspects := dictionary. |
|
3892 | 2640 |
! |
2641 |
||
4201 | 2642 |
userPreferencesAspectValueFor:something |
2643 |
"returns the default aspect from the Userpreferences |
|
3892 | 2644 |
" |
4201 | 2645 |
|
2646 |
(self class userPreferencesAspectList includes:something) not ifTrue:[ ^ nil]. |
|
2647 |
^ UserPreferences current perform:something. |
|
3892 | 2648 |
! ! |
2649 |
||
4011 | 2650 |
!AbstractFileBrowser methodsFor:'aspects-filter'! |
2651 |
||
4018 | 2652 |
filterBackgroundColor |
2653 |
||
2654 |
^ self aspectFor:#filterBackgroundColor ifAbsent:[Color white asValue] |
|
2655 |
! |
|
2656 |
||
4011 | 2657 |
filterBlockHolder |
2658 |
||
5658
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
2659 |
^ self aspectFor:#filterBlockHolder ifAbsent:[self makeFilterBlock asValue] |
4011 | 2660 |
! |
2661 |
||
2662 |
filterListModel |
|
2663 |
||
2664 |
^ self aspectFor:#filterListModel ifAbsent:[self class defaultFilterList] |
|
2665 |
! |
|
2666 |
||
2667 |
filterModel |
|
5941 | 2668 |
|m| |
2669 |
||
2670 |
m := self aspectFor:#filterModel ifAbsent:[(self filterListModel at:1) asValue]. |
|
2671 |
^ m |
|
4011 | 2672 |
! |
2673 |
||
4018 | 2674 |
filterValueBox |
2675 |
||
2676 |
^ self aspectFor:#filterValueBox ifAbsent:[ValueHolder new] |
|
2677 |
! |
|
2678 |
||
5658
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
2679 |
makeFilterBlock |
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
2680 |
| filterString filterStrings filters showHidden yesOrNo filterBlock| |
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
2681 |
|
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
2682 |
filterString := self filterModel value. |
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
2683 |
filterString = '' ifTrue:[filterString := '*']. |
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
2684 |
|
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
2685 |
filterStrings := filterString asCollectionOfSubstringsSeparatedBy:$;. |
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
2686 |
filters := filterStrings |
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
2687 |
collect:[:eachPattern | |
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
2688 |
|
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
2689 |
|pattern| |
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
2690 |
|
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
2691 |
pattern := eachPattern withoutSeparators. |
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
2692 |
yesOrNo := true. |
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
2693 |
(pattern startsWith:'~') ifTrue:[ |
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
2694 |
yesOrNo := false. |
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
2695 |
pattern := pattern copyFrom:2. |
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
2696 |
]. |
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
2697 |
yesOrNo ifTrue:[ |
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
2698 |
[:name | pattern match:name ] |
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
2699 |
] ifFalse:[ |
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
2700 |
[:name | (pattern match:name) not ] |
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
2701 |
]. |
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
2702 |
]. |
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
2703 |
|
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
2704 |
filters size == 1 ifTrue:[ |
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
2705 |
filterBlock := filters first |
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
2706 |
] ifFalse:[ |
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
2707 |
filterBlock := [: name | filters contains:[:aFilter | aFilter value:name ]]. |
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
2708 |
]. |
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
2709 |
|
4011 | 2710 |
showHidden := self showHiddenFiles value. |
2711 |
showHidden ifTrue:[ |
|
5658
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
2712 |
^ filterBlock. |
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
2713 |
]. |
5870 | 2714 |
^ [: el | ((el asString startsWith:'.') not) and:[filterBlock value:el]]. |
4018 | 2715 |
! |
2716 |
||
2717 |
shownFiles |
|
2718 |
||
2719 |
^ self aspectFor:#shownFiles ifAbsent:['-/-' asValue] |
|
4011 | 2720 |
! ! |
2721 |
||
3892 | 2722 |
!AbstractFileBrowser methodsFor:'aspects-history'! |
2723 |
||
2724 |
dirHistory |
|
3952 | 2725 |
^ self class directoryHistory |
3892 | 2726 |
! |
2727 |
||
2728 |
enableBack |
|
2729 |
||
2730 |
^ self aspectFor:#enableBack ifAbsent:[false asValue] |
|
2731 |
! |
|
2732 |
||
2733 |
enableFileHistory |
|
2734 |
||
2735 |
^ self aspectFor:#enableFileHistory ifAbsent:[false asValue] |
|
2736 |
! |
|
2737 |
||
2738 |
enableForward |
|
2739 |
||
2740 |
^ self aspectFor:#enableForward ifAbsent:[false asValue] |
|
2741 |
! |
|
2742 |
||
2743 |
fileHistory |
|
2744 |
||
2745 |
^ self aspectFor:#fileHistory ifAbsent:[FilenameHistory new] |
|
2746 |
! ! |
|
2747 |
||
2748 |
!AbstractFileBrowser methodsFor:'aspects-visibility'! |
|
2749 |
||
4345 | 2750 |
activityVisibilityChannel |
2751 |
" activityVisibilityChannel switches the activity indicator on/off |
|
2752 |
" |
|
2753 |
||
2754 |
^ self aspectFor:#activityVisibilityChannel ifAbsent:[ false asValue ]. |
|
2755 |
! |
|
2756 |
||
4110 | 2757 |
openAlwaysInTextEditor |
4201 | 2758 |
" aspect for open every file in TextEditor dont use e.g. HtmlEditor for *.html'" |
4110 | 2759 |
|
2760 |
^ self aspectFor:#openAlwaysInTextEditor ifAbsent:[ false asValue ]. |
|
2761 |
! |
|
2762 |
||
3892 | 2763 |
openMultipleApplicationsForType |
2764 |
||
4201 | 2765 |
" aspect for open more applications for e.g. TextEditor and not change the contents of already |
2766 |
open TextEditor " |
|
2767 |
||
3892 | 2768 |
^ self aspectFor:#openMultipleApplicationsForType ifAbsent:[ false asValue ]. |
2769 |
! |
|
2770 |
||
4201 | 2771 |
showDirectoryTree |
2772 |
||
2773 |
^ self aspectFor:#showDirectoryTree ifAbsent:[ true asValue ] |
|
3892 | 2774 |
! |
2775 |
||
4554 | 2776 |
showDiskUsageHolder |
2777 |
|holder| |
|
2778 |
||
4560
0d3db5e27bc0
default for disk usage is false
Claus Gittinger <cg@exept.de>
parents:
4558
diff
changeset
|
2779 |
holder := self aspectFor:#showDiskUsageHolder ifAbsent:[ false asValue]. |
4781 | 2780 |
holder addDependent:self. |
4554 | 2781 |
^ holder |
2782 |
! |
|
2783 |
||
3892 | 2784 |
showHiddenFiles |
2785 |
||
2786 |
^ self aspectFor:#showHiddenFiles ifAbsent:[ true asValue ]. |
|
2787 |
! |
|
2788 |
||
4648 | 2789 |
userContextAvailable |
2790 |
||
2791 |
" aspect for show group and user columns in contents view |
|
2792 |
windows provides no user context" |
|
2793 |
||
2794 |
^ OperatingSystem isMSWINDOWSlike not |
|
2795 |
! |
|
2796 |
||
3892 | 2797 |
viewDescription |
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
2798 |
"aspect for show file description in DirectoryContentsBrowser" |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
2799 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
2800 |
^ self directoryContentsBrowser viewDescription |
3892 | 2801 |
! |
2802 |
||
2803 |
viewDetails |
|
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
2804 |
"aspect for show more file properties in DirectoryContentsBrowser |
4201 | 2805 |
" |
3892 | 2806 |
|
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
2807 |
^ self directoryContentsBrowser viewDetails |
3892 | 2808 |
! |
2809 |
||
2810 |
viewDirectoryDescription |
|
2811 |
||
4201 | 2812 |
" aspect for auto open a TextView for Readme and other see getInfoItem Method files |
2813 |
on change directory " |
|
2814 |
||
3892 | 2815 |
^ self aspectFor:#viewDirectoryDescription ifAbsent:[ true asValue ]. |
2816 |
! |
|
2817 |
||
4201 | 2818 |
viewDirsInContentsBrowser |
2819 |
||
2820 |
^ self aspectFor:#viewDirsInContentsBrowser ifAbsent:[ false asValue ]. |
|
2821 |
! |
|
2822 |
||
5870 | 2823 |
viewFilesInContentsBrowser |
2824 |
||
2825 |
^ self aspectFor:#viewFilesInContentsBrowser ifAbsent:[ true asValue ]. |
|
2826 |
! |
|
2827 |
||
3892 | 2828 |
viewFilesInDirectoryTree |
2829 |
||
4201 | 2830 |
" aspect for view files in tree view (not only directories) " |
2831 |
||
3892 | 2832 |
^ self aspectFor:#viewFilesInDirectoryTree ifAbsent:[ false asValue ]. |
2833 |
! |
|
2834 |
||
2835 |
viewGroup |
|
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
2836 |
" aspect for show group information in DirectoryContentsBrowser " |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
2837 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
2838 |
^ self directoryContentsBrowser viewGroup |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
2839 |
! |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
2840 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
2841 |
viewIcon |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
2842 |
" aspect for show file-type icon in DirectoryContentsBrowser " |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
2843 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
2844 |
^ self directoryContentsBrowser viewIcon |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
2845 |
! |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
2846 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
2847 |
viewInodeNumber |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
2848 |
" aspect for show inode numbers in DirectoryContentsBrowser " |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
2849 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
2850 |
^ self directoryContentsBrowser viewInodeNumber |
3892 | 2851 |
! |
2852 |
||
2853 |
viewNoteBookApplicationHolder |
|
2854 |
||
2855 |
^ self aspectFor:#viewNoteBookApplicationHolder ifAbsent:[ false asValue]. |
|
2856 |
! |
|
2857 |
||
2858 |
viewOwner |
|
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
2859 |
" aspect for show owner information in DirectoryContentsBrowser " |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
2860 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
2861 |
^ self directoryContentsBrowser viewOwner |
3892 | 2862 |
! |
2863 |
||
2864 |
viewPermissions |
|
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
2865 |
" aspect for show permission information in DirectoryContentsBrowser " |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
2866 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
2867 |
^ self directoryContentsBrowser viewPermissions |
3892 | 2868 |
! |
2869 |
||
2870 |
viewPreview |
|
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
2871 |
" aspect for show image previev in DirectoryContentsBrowser " |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
2872 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
2873 |
^ self directoryContentsBrowser viewPreview |
3892 | 2874 |
! |
2875 |
||
2876 |
viewSize |
|
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
2877 |
" aspect for show size information in DirectoryContentsBrowser " |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
2878 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
2879 |
^ self directoryContentsBrowser viewSize |
3892 | 2880 |
! |
2881 |
||
4974 | 2882 |
viewSizeInBytes |
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
2883 |
" aspect for show size-in-bytes information in DirectoryContentsBrowser " |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
2884 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
2885 |
^ self directoryContentsBrowser viewSizeInBytes |
4974 | 2886 |
! |
2887 |
||
5312 | 2888 |
viewSizeInKiloBytes |
2889 |
" aspect for show size-in-kilobytes information in DirectoryContentsBrowser " |
|
2890 |
||
2891 |
^ self directoryContentsBrowser viewSizeInKiloBytes |
|
2892 |
! |
|
2893 |
||
3892 | 2894 |
viewTime |
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
2895 |
" aspect for show time information in DirectoryContentsBrowser" |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
2896 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
2897 |
^ self directoryContentsBrowser viewTime |
3892 | 2898 |
! |
2899 |
||
2900 |
viewType |
|
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
2901 |
" aspect for show suffix (type) information in DirectoryContentsBrowser" |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
2902 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
2903 |
^ self directoryContentsBrowser viewType |
3892 | 2904 |
! ! |
2905 |
||
2906 |
!AbstractFileBrowser methodsFor:'background processing'! |
|
2907 |
||
2908 |
executeCommand:cmd |
|
2909 |
||
2910 |
self executeCommand:cmd inDirectory:nil |
|
2911 |
! |
|
2912 |
||
5880 | 2913 |
executeCommand:cmd inDirectory:aDirectoryOrNil |
3892 | 2914 |
| nameString executionBlock| |
2915 |
||
5880 | 2916 |
executionBlock := self getExecutionBlockForCommand:cmd inDirectory:aDirectoryOrNil. |
4516
dc3b7a89598a
close command view if no output was generated
Claus Gittinger <cg@exept.de>
parents:
4496
diff
changeset
|
2917 |
nameString := 'Execute: ', cmd. |
3892 | 2918 |
self makeExecutionResultProcessFor:executionBlock withName:nameString. |
2919 |
! |
|
2920 |
||
2921 |
getExecutionBlockForCommand:cmd |
|
2922 |
||
2923 |
^ self getExecutionBlockForCommand:cmd inDirectory:nil |
|
2924 |
! |
|
2925 |
||
5880 | 2926 |
getExecutionBlockForCommand:cmd inDirectory:directoryOrNil |
2927 |
| dir| |
|
2928 |
||
2929 |
dir := directoryOrNil. |
|
2930 |
directoryOrNil isNil ifTrue:[ |
|
2931 |
dir := self theSingleSelectedDirectoryOrNil. |
|
2932 |
dir isNil ifTrue:[ ^ self]. |
|
3892 | 2933 |
]. |
4523 | 2934 |
|
2935 |
^ [:stream| |
|
2936 |
stream notNil ifTrue:[ |
|
4414 | 2937 |
OperatingSystem |
2938 |
executeCommand:cmd |
|
2939 |
inputFrom:nil |
|
2940 |
outputTo:stream |
|
2941 |
errorTo:stream |
|
2942 |
inDirectory:dir |
|
2943 |
onError:[:status| false]. |
|
2944 |
] |
|
4523 | 2945 |
]. |
3892 | 2946 |
! |
2947 |
||
2948 |
killAllRunningBackgroundProcesses |
|
2949 |
||
2950 |
self backgroundProcesses do:[ : process | |
|
4523 | 2951 |
self notify:'kill ', process name. |
4414 | 2952 |
process terminate. |
3892 | 2953 |
]. |
2954 |
! |
|
2955 |
||
2956 |
makeExecutionResultProcessFor:aBlock withName:aString |
|
2957 |
| stream process appl nameString| |
|
2958 |
||
2959 |
appl := self openCommandResultApplication. |
|
2960 |
stream := appl resultStream. |
|
2961 |
nameString := aString ? 'Execution Result'. |
|
2962 |
appl changeTabTo:nameString. |
|
4523 | 2963 |
|
4516
dc3b7a89598a
close command view if no output was generated
Claus Gittinger <cg@exept.de>
parents:
4496
diff
changeset
|
2964 |
process := [ [aBlock value:stream] |
4891
5422df926e2d
Stream streamErrorSignal -> StreamError
Stefan Vogel <sv@exept.de>
parents:
4881
diff
changeset
|
2965 |
ensure:[ |
4516
dc3b7a89598a
close command view if no output was generated
Claus Gittinger <cg@exept.de>
parents:
4496
diff
changeset
|
2966 |
self backgroundProcesses remove:process ifAbsent:[]. |
dc3b7a89598a
close command view if no output was generated
Claus Gittinger <cg@exept.de>
parents:
4496
diff
changeset
|
2967 |
appl process value:nil. |
dc3b7a89598a
close command view if no output was generated
Claus Gittinger <cg@exept.de>
parents:
4496
diff
changeset
|
2968 |
|
dc3b7a89598a
close command view if no output was generated
Claus Gittinger <cg@exept.de>
parents:
4496
diff
changeset
|
2969 |
"/ close automatically, if there was no output. |
4571 | 2970 |
"/ appl resultStream contents isEmpty ifTrue:[ |
2971 |
"/ appl doClose. |
|
2972 |
"/ ] |
|
4516
dc3b7a89598a
close command view if no output was generated
Claus Gittinger <cg@exept.de>
parents:
4496
diff
changeset
|
2973 |
] |
dc3b7a89598a
close command view if no output was generated
Claus Gittinger <cg@exept.de>
parents:
4496
diff
changeset
|
2974 |
] newProcess. |
3892 | 2975 |
process priority:(Processor userBackgroundPriority). |
2976 |
process name:nameString. |
|
2977 |
self backgroundProcesses add:process. |
|
2978 |
appl process value:process. |
|
2979 |
process resume. |
|
2980 |
! ! |
|
2981 |
||
2982 |
!AbstractFileBrowser methodsFor:'change & update'! |
|
2983 |
||
4915 | 2984 |
currentFileNameHolderChanged |
2985 |
"/ self currentFileNameHolderChangedForCommon |
|
2986 |
! |
|
2987 |
||
4577 | 2988 |
currentFileNameHolderChangedForCommon |
5476 | 2989 |
|newDirectories oldDirectories size rootInTreeView selection selectionNotEmpty| |
4368
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
2990 |
|
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
2991 |
selection := self currentFileNameHolder value. |
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
2992 |
self class currentSelection:selection. |
4734 | 2993 |
|
5476 | 2994 |
selectionNotEmpty := selection notEmpty. |
2995 |
self hasSelection value:selectionNotEmpty. |
|
2996 |
self hasFileSelection value:(selectionNotEmpty and:[self firstSelectedFile notNil]). |
|
4734 | 2997 |
|
4368
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
2998 |
newDirectories := self directoriesForFiles:selection. |
4011 | 2999 |
oldDirectories := self currentDirectories value. |
3000 |
oldDirectories ~= newDirectories ifTrue:[ |
|
4347 | 3001 |
self currentDirectories value:newDirectories. |
3002 |
size := newDirectories size. |
|
4774 | 3003 |
rootInTreeView := self |
3004 |
applicationNamed:#DirectoryTreeBrowser |
|
5009 | 3005 |
ifPresentDo:[:appl | appl rootHolder]. |
3006 |
rootInTreeView := rootInTreeView value. |
|
5437
3556b0348494
directory up not allowed for drive root under windows
penk
parents:
5432
diff
changeset
|
3007 |
self enableDirectoryUp value:(((size == 1) and:[newDirectories first isRootDirectory not]) "or:[(rootInTreeView notNil and:[rootInTreeView value asFilename isRootDirectory not])]"). |
3556b0348494
directory up not allowed for drive root under windows
penk
parents:
5432
diff
changeset
|
3008 |
|
4347 | 3009 |
newDirectories notEmpty ifTrue:[ |
3010 |
self dirHistory addToHistory:(newDirectories first asString). |
|
3011 |
]. |
|
5074 | 3012 |
self enableHome value:((newDirectories includes:(Filename homeDirectory asAbsoluteFilename))not). |
3013 |
self enableGotoDefault value:((newDirectories includes:(Filename defaultDirectory asAbsoluteFilename))not). |
|
4011 | 3014 |
]. |
4022 | 3015 |
self enableForward value:self canForward. |
4734 | 3016 |
self enableBack value:self canBackward. |
6095 | 3017 |
|
3018 |
self updateCanMake. |
|
4011 | 3019 |
! |
3020 |
||
3021 |
filterModelChanged |
|
3022 |
||
5658
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
3023 |
self filterBlockHolder value:(self makeFilterBlock). |
4011 | 3024 |
! |
3025 |
||
3892 | 3026 |
update:something with:aParameter from:changedObject |
3027 |
||
3028 |
" do here all the things that have to be done for every part of the FileBrowserV2 |
|
3029 |
and the things that have to be done if it runs standalone " |
|
3030 |
||
3031 |
changedObject == self currentFileNameHolder ifTrue:[ |
|
4577 | 3032 |
self currentFileNameHolderChangedForCommon. |
4368
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
3033 |
^ self |
3892 | 3034 |
]. |
3989 | 3035 |
changedObject == self sortCaseless ifTrue:[ |
4368
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
3036 |
self sortFileListsBy:#baseName withReverse:false. |
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
3037 |
^ self |
3989 | 3038 |
]. |
4011 | 3039 |
(changedObject == self filterModel or:[changedObject == self showHiddenFiles]) ifTrue:[ |
4368
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
3040 |
self filterModelChanged. |
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
3041 |
^ self |
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
3042 |
]. |
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
3043 |
changedObject == self rootHolder ifTrue:[ |
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
3044 |
self class rootHolder:(self rootHolder value). |
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
3045 |
^ self |
4004 | 3046 |
]. |
4781 | 3047 |
changedObject == self showDiskUsageHolder ifTrue:[ |
3048 |
self notify:''. |
|
3049 |
^ self |
|
3050 |
]. |
|
3989 | 3051 |
|
3892 | 3052 |
super update:something with:aParameter from:changedObject |
5543 | 3053 |
! |
3054 |
||
6095 | 3055 |
updateCanMake |
3056 |
|dir can| |
|
3057 |
||
3058 |
can := false. |
|
3059 |
dir := self currentDirectory. |
|
3060 |
dir notNil ifTrue:[ |
|
3061 |
can := (dir asFilename construct:'Makefile') exists. |
|
3062 |
OperatingSystem isMSWINDOWSlike ifTrue:[ |
|
3063 |
can ifFalse:[ |
|
3064 |
can := (self currentDirectory asFilename construct:'nt.mak') exists. |
|
3065 |
] |
|
3066 |
]. |
|
3067 |
]. |
|
3068 |
self canMake value:can. |
|
3069 |
! |
|
3070 |
||
5543 | 3071 |
updateListAfterDelete:colOfFiles |
3072 |
self updateCurrentDirectory |
|
3892 | 3073 |
! ! |
3074 |
||
3075 |
!AbstractFileBrowser methodsFor:'clipboard'! |
|
3076 |
||
3077 |
canPaste |
|
3078 |
||
3079 |
^ self aspectFor:#canPaste ifAbsent:[ false asValue ]. |
|
3080 |
! |
|
3081 |
||
3082 |
clipboard |
|
3083 |
||
3084 |
^ self aspectFor:#clipboard ifAbsent:[Clipboard new] |
|
3085 |
! |
|
3086 |
||
3087 |
copyFilesToClipBoard:colOfFiles |
|
3088 |
"defete current selected files/directories |
|
3089 |
" |
|
3090 |
self putInClipBoard:colOfFiles as:#copy. |
|
3091 |
! |
|
3092 |
||
3093 |
cutFilesToClipBoard:colOfFiles |
|
3094 |
"defete current selected files/directories |
|
3095 |
" |
|
3096 |
self putInClipBoard:colOfFiles as:#cut. |
|
3097 |
! |
|
3098 |
||
3099 |
emptyClipBoard |
|
3100 |
||
3101 |
self clipboard files:nil. |
|
3102 |
self canPaste value:false. |
|
3103 |
! |
|
3104 |
||
3105 |
putInClipBoard:colOfFiles as:aSymbol |
|
3106 |
| stream clp| |
|
3107 |
||
3108 |
colOfFiles isEmpty ifTrue:[ ^ self]. |
|
3109 |
clp := self clipboard. |
|
3110 |
clp files:nil. |
|
3111 |
clp method:aSymbol. |
|
5772
603abfa8cf99
copy name(s) to clipboard - on lineFeed if only one file is selected
Claus Gittinger <cg@exept.de>
parents:
5756
diff
changeset
|
3112 |
|
603abfa8cf99
copy name(s) to clipboard - on lineFeed if only one file is selected
Claus Gittinger <cg@exept.de>
parents:
5756
diff
changeset
|
3113 |
stream := String writeStream. |
3892 | 3114 |
stream nextPutAll:aSymbol asString. |
3115 |
stream nextPutAll:' <'. |
|
3116 |
stream nextPutAll:colOfFiles first asString. |
|
3117 |
colOfFiles size > 1 ifTrue:[ |
|
4414 | 3118 |
stream nextPutAll:' ...'. |
3892 | 3119 |
]. |
3120 |
stream nextPutAll:'> to clipboard'. |
|
3121 |
||
4523 | 3122 |
self notify:stream contents. |
3892 | 3123 |
stream close. |
3124 |
clp files:colOfFiles. |
|
3125 |
self canPaste value:true. |
|
3126 |
! ! |
|
3127 |
||
3128 |
!AbstractFileBrowser methodsFor:'drag & drop'! |
|
3129 |
||
3130 |
canDropFiles:dropedObjects for:filename |
|
4963
7ce6eae41e33
do not check if dropFile exists, if its an archive file
Claus Gittinger <cg@exept.de>
parents:
4959
diff
changeset
|
3131 |
| filenameDirString filenameDir| |
3892 | 3132 |
|
3133 |
dropedObjects isEmpty ifTrue:[^ false]. |
|
3134 |
filenameDir := self getDirWithoutFileName:filename. |
|
3135 |
filenameDir isWritable not ifTrue:[^ false]. |
|
3136 |
filenameDirString := filenameDir asString. |
|
4963
7ce6eae41e33
do not check if dropFile exists, if its an archive file
Claus Gittinger <cg@exept.de>
parents:
4959
diff
changeset
|
3137 |
|
7ce6eae41e33
do not check if dropFile exists, if its an archive file
Claus Gittinger <cg@exept.de>
parents:
4959
diff
changeset
|
3138 |
dropedObjects do:[:aDropObject | |
7ce6eae41e33
do not check if dropFile exists, if its an archive file
Claus Gittinger <cg@exept.de>
parents:
4959
diff
changeset
|
3139 |
|dropFileName dropFileNameString| |
7ce6eae41e33
do not check if dropFile exists, if its an archive file
Claus Gittinger <cg@exept.de>
parents:
4959
diff
changeset
|
3140 |
dropFileName := aDropObject theObject. |
7ce6eae41e33
do not check if dropFile exists, if its an archive file
Claus Gittinger <cg@exept.de>
parents:
4959
diff
changeset
|
3141 |
dropFileNameString := dropFileName asString. |
7ce6eae41e33
do not check if dropFile exists, if its an archive file
Claus Gittinger <cg@exept.de>
parents:
4959
diff
changeset
|
3142 |
dropFileName isDirectory ifTrue:[ |
7ce6eae41e33
do not check if dropFile exists, if its an archive file
Claus Gittinger <cg@exept.de>
parents:
4959
diff
changeset
|
3143 |
(self fileName:filenameDirString startsWith:dropFileNameString) ifTrue:[ |
5036 | 3144 |
self notify:'Cannot drop a directory into one of its parent directories'. |
4414 | 3145 |
^ false |
3146 |
] |
|
3147 |
] ifFalse:[ |
|
5956 | 3148 |
| physicalPathName | |
3149 |
physicalPathName := dropFileName physicalPathName. |
|
4963
7ce6eae41e33
do not check if dropFile exists, if its an archive file
Claus Gittinger <cg@exept.de>
parents:
4959
diff
changeset
|
3150 |
(filenameDirString = dropFileName directory asString |
5956 | 3151 |
or:[ aDropObject isFileInArchive not and:[physicalPathName notNil |
3152 |
and:[ filenameDirString = physicalPathName asFilename directory asString]]]) ifTrue:[ |
|
5036 | 3153 |
self notify:'Cannot drop a file into same directory'. |
4414 | 3154 |
^ false |
3155 |
] |
|
3156 |
] |
|
3892 | 3157 |
]. |
3158 |
^ true |
|
3159 |
! |
|
3160 |
||
3161 |
doStartDrag:aDropSource in:aView |
|
3162 |
"set the cursors before starting the drag & drop operation |
|
3163 |
" |
|
3164 |
|hdl| |
|
3165 |
||
3166 |
hdl := DragAndDropManager new. |
|
3167 |
||
4337
f2eed806e854
change first letter uppercase methods on class side to lowercase ones
penk
parents:
4317
diff
changeset
|
3168 |
hdl disabledCursor:self class disabledCursorImage. |
f2eed806e854
change first letter uppercase methods on class side to lowercase ones
penk
parents:
4317
diff
changeset
|
3169 |
hdl enabledCursor:self class enabledCursorImage. |
3892 | 3170 |
hdl alienCursor:nil. |
3171 |
||
4745 | 3172 |
hdl startDragFrom:aView dropSource:aDropSource offset:#topLeft. |
3173 |
||
3892 | 3174 |
! ! |
3175 |
||
3176 |
!AbstractFileBrowser methodsFor:'file operations'! |
|
3177 |
||
3178 |
copyFile:aSourceFile to:aDestFile |
|
3179 |
"copy to |
|
3180 |
" |
|
3181 |
|copy| |
|
3182 |
||
5961 | 3183 |
copy := FileOperation copyFile:aSourceFile to:aDestFile withOverWriteWarning:true copyFileIfSame:true. |
3892 | 3184 |
copy result ifTrue:[ |
4523 | 3185 |
self notify:('copy ', aSourceFile baseName, ' to:,', aDestFile baseName). |
3892 | 3186 |
] ifFalse:[ |
4523 | 3187 |
self notify:copy errorString. |
3892 | 3188 |
]. |
3189 |
^ copy result |
|
3190 |
! |
|
3191 |
||
3192 |
copyFiles:aColOfSourceFiles to:aDirectory |
|
3193 |
"copy aColOfSourceFiles to aDirectory |
|
3194 |
" |
|
3195 |
|copy| |
|
3196 |
||
4629
e8739857466c
show busyCursor while moving/copying files.
Claus Gittinger <cg@exept.de>
parents:
4624
diff
changeset
|
3197 |
self withWaitCursorDo:[ |
5961 | 3198 |
copy := FileOperation copyFiles:aColOfSourceFiles to:aDirectory. |
4629
e8739857466c
show busyCursor while moving/copying files.
Claus Gittinger <cg@exept.de>
parents:
4624
diff
changeset
|
3199 |
copy result ifFalse:[ |
e8739857466c
show busyCursor while moving/copying files.
Claus Gittinger <cg@exept.de>
parents:
4624
diff
changeset
|
3200 |
self notify:copy errorString. |
e8739857466c
show busyCursor while moving/copying files.
Claus Gittinger <cg@exept.de>
parents:
4624
diff
changeset
|
3201 |
]. |
e8739857466c
show busyCursor while moving/copying files.
Claus Gittinger <cg@exept.de>
parents:
4624
diff
changeset
|
3202 |
self updateCurrentDirectory. |
3892 | 3203 |
]. |
3204 |
^ copy colOfCopiedFiles |
|
3205 |
! |
|
3206 |
||
4707
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
3207 |
copyOrMoveDialog:aCollectionOfFiles for:aDestinationDirectory |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
3208 |
|size stream msg answer file| |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
3209 |
|
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
3210 |
size := aCollectionOfFiles size. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
3211 |
|
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
3212 |
"/ stream := WriteStream on:'' asText. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
3213 |
"/ stream nextPutAll:'Copy or move'; cr; cr; nextPutAll:'file'. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
3214 |
"/ size == 1 ifFalse:[ |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
3215 |
"/ stream nextPutAll:'s'. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
3216 |
"/ ]. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
3217 |
"/ stream nextPutAll:': '. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
3218 |
"/ stream nextPutAll:aCollectionOfFiles first baseName asString allBold. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
3219 |
"/ size == 1 ifFalse:[ |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
3220 |
"/ stream nextPutAll:' ... '. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
3221 |
"/ stream nextPutAll:aCollectionOfFiles last baseName asString. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
3222 |
"/ ]. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
3223 |
"/ stream cr; nextPutAll:'to: '. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
3224 |
"/ stream nextPutAll:aDestinationDirectory asFilename pathName allBold. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
3225 |
"/ msg := stream contents |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
3226 |
size == 1 ifTrue:[ |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
3227 |
file := aCollectionOfFiles first. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
3228 |
msg := resources |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
3229 |
stringWithCRs:'Copy or move\\%1:\ %2\to:\ %3 ?' |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
3230 |
with:(file type == #regular ifTrue:'file' ifFalse:[file isDirectory ifTrue:'directory' ifFalse:'object']) |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
3231 |
with:(file baseName allBold) |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
3232 |
with:(aDestinationDirectory asFilename pathName allBold). |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
3233 |
] ifFalse:[ |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
3234 |
msg := resources |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
3235 |
stringWithCRs:'Copy or move\\ %1 objects\to:\ %2 ?' |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
3236 |
with:size |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
3237 |
with:(aDestinationDirectory asFilename pathName allBold). |
3892 | 3238 |
]. |
4707
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
3239 |
|
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
3240 |
answer := OptionBox |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
3241 |
request:msg |
4354
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
3242 |
label:'Move or Copy' |
5898
f6214812e1d2
dont send obsolete message to OptionBox
Claus Gittinger <cg@exept.de>
parents:
5888
diff
changeset
|
3243 |
image:(WarningBox iconBitmap) |
4354
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
3244 |
buttonLabels:#('Cancel' 'Move' 'Copy' 'Copy As...') |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
3245 |
values:#(#cancel #move #copy #copyAs) |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
3246 |
default:#copy. |
4707
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
3247 |
answer isNil ifTrue:[answer := #cancel]. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
3248 |
^ answer. |
3892 | 3249 |
! |
3250 |
||
4354
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
3251 |
copyOrMoveFiles:aColOfSourceFiles to:aDestinationDirectory |
4745 | 3252 |
"copy or move aColOfSourceFiles to aDirectory. |
3253 |
Asks the used if a move or a copy is wanted. |
|
3254 |
Returns true if the copyOrMove happened, false if user aborted the operation." |
|
3255 |
||
4707
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
3256 |
|answer lastOld lastNew| |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
3257 |
|
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
3258 |
answer := self copyOrMoveDialog:aColOfSourceFiles for:aDestinationDirectory. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
3259 |
answer == #copyAs ifTrue:[ |
4354
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
3260 |
aColOfSourceFiles do:[:eachSourceFile | |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
3261 |
|initial destFile srcBase dstBase| |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
3262 |
|
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
3263 |
srcBase := eachSourceFile asFilename baseName. |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
3264 |
lastOld isNil ifTrue:[ |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
3265 |
initial := srcBase |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
3266 |
] ifFalse:[ |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
3267 |
initial := DoWhatIMeanSupport |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
3268 |
goodRenameDefaultForFile:srcBase lastOld:lastOld lastNew:lastNew. |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
3269 |
]. |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
3270 |
dstBase := Dialog request:('Copy %1 as:' bindWith:srcBase) initialAnswer:initial. |
4745 | 3271 |
dstBase isNil ifTrue:[^ false]. |
4354
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
3272 |
self copyFile:eachSourceFile to:(aDestinationDirectory construct:dstBase). |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
3273 |
lastOld := srcBase. |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
3274 |
lastNew := dstBase. |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
3275 |
]. |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
3276 |
|
4745 | 3277 |
^ true. |
4354
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
3278 |
]. |
4707
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
3279 |
answer == #copy ifTrue:[ |
4354
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
3280 |
self copyFiles:aColOfSourceFiles to:aDestinationDirectory. |
4745 | 3281 |
^ true. |
3892 | 3282 |
]. |
4707
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
3283 |
answer == #move ifTrue:[ |
4354
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
3284 |
self moveFiles:aColOfSourceFiles to:aDestinationDirectory. |
4745 | 3285 |
^ true. |
3892 | 3286 |
]. |
4745 | 3287 |
^ false. |
3892 | 3288 |
! |
3289 |
||
3290 |
deleteFile:aFile |
|
3291 |
"delete current selected files/directories |
|
3292 |
" |
|
3293 |
||
3294 |
^ self deleteFiles:(OrderedCollection with:aFile). |
|
3295 |
! |
|
3296 |
||
3297 |
deleteFiles:colOfFiles |
|
3298 |
"delete current selected files/directories |
|
3299 |
" |
|
5081 | 3300 |
^ self deleteFiles:colOfFiles confirm:true. |
3301 |
! |
|
3302 |
||
3303 |
deleteFiles:colOfFiles confirm:confirm |
|
3304 |
"delete current selected files/directories |
|
3305 |
" |
|
5673 | 3306 |
|delete result| |
3892 | 3307 |
|
5418 | 3308 |
self windowGroup withWaitCursorDo:[ |
5961 | 3309 |
delete := FileOperation deleteFiles:colOfFiles confirm:confirm. |
5673 | 3310 |
result := delete result. |
3311 |
result notNil ifTrue:[ |
|
3312 |
result ifFalse:[ |
|
3313 |
self notify:delete errorString. |
|
5753 | 3314 |
] ifTrue:[ |
3315 |
self updateListAfterDelete:colOfFiles. |
|
3316 |
] |
|
4394 | 3317 |
]. |
5673 | 3318 |
]. |
3319 |
^ result. |
|
3892 | 3320 |
! |
3321 |
||
3322 |
moveFile:aSourceFile to:aDestFile |
|
3323 |
"defete current selected files/directories |
|
3324 |
" |
|
3325 |
||
3326 |
|move| |
|
3327 |
||
5961 | 3328 |
move := FileOperation moveFile:aSourceFile to:aDestFile. |
3892 | 3329 |
move result ifTrue:[ |
4523 | 3330 |
self notify:('move ', aSourceFile asString, ' to ', aDestFile asString). |
3892 | 3331 |
] ifFalse:[ |
4523 | 3332 |
self notify:move errorString. |
3892 | 3333 |
]. |
3334 |
self updateCurrentDirectory. |
|
3335 |
^ move result |
|
3336 |
! |
|
3337 |
||
3338 |
moveFiles:aColOfSourceFiles to:aDirectory |
|
3339 |
"move aColOfSourceFiles to aDirectory |
|
3340 |
" |
|
3341 |
|move| |
|
3342 |
||
5419 | 3343 |
self windowGroup withWaitCursorDo:[ |
5961 | 3344 |
move := FileOperation moveFiles:aColOfSourceFiles to:aDirectory. |
4629
e8739857466c
show busyCursor while moving/copying files.
Claus Gittinger <cg@exept.de>
parents:
4624
diff
changeset
|
3345 |
move result ifFalse:[ |
e8739857466c
show busyCursor while moving/copying files.
Claus Gittinger <cg@exept.de>
parents:
4624
diff
changeset
|
3346 |
self notify:move errorString. |
e8739857466c
show busyCursor while moving/copying files.
Claus Gittinger <cg@exept.de>
parents:
4624
diff
changeset
|
3347 |
]. |
e8739857466c
show busyCursor while moving/copying files.
Claus Gittinger <cg@exept.de>
parents:
4624
diff
changeset
|
3348 |
self updateCurrentDirectory. |
3892 | 3349 |
]. |
3350 |
^ move colOfMovedFiles |
|
3351 |
! |
|
3352 |
||
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
3353 |
moveSelection |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
3354 |
"move the selected file(s) to another directory" |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
3355 |
|
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
3356 |
|destinationDirectory| |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
3357 |
|
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
3358 |
destinationDirectory := Dialog |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
3359 |
requestDirectoryName:(resources at:'Move Selected Items To:') withCRs |
5789 | 3360 |
default:(LastMoveDestination ? self currentDirectory) |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
3361 |
ok:'Move' |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
3362 |
abort:nil. |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
3363 |
destinationDirectory isEmptyOrNil ifTrue:[^ self]. |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
3364 |
|
5789 | 3365 |
LastMoveDestination := destinationDirectory. |
3366 |
self moveFiles:(self currentFileNameHolder value copy) to:destinationDirectory asFilename |
|
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
3367 |
! |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
3368 |
|
3892 | 3369 |
newDirectory |
3370 |
"ask for and create a new directory" |
|
3371 |
||
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
3372 |
|selectedFiles singleSelectedFile defaultAnswer directory createOp newFile mime| |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
3373 |
|
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
3374 |
directory := self currentDirectory. |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
3375 |
directory isNil ifTrue:[ |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
3376 |
self warn:'Select a single directory to create a directory'. |
4979
366465d1a8a5
warn on create new file or directory if nothing selected or more than one directory
penk
parents:
4976
diff
changeset
|
3377 |
^ self |
366465d1a8a5
warn on create new file or directory if nothing selected or more than one directory
penk
parents:
4976
diff
changeset
|
3378 |
]. |
4521 | 3379 |
|
3380 |
"/ clever default if selection is an archive... |
|
4979
366465d1a8a5
warn on create new file or directory if nothing selected or more than one directory
penk
parents:
4976
diff
changeset
|
3381 |
selectedFiles := self currentSelectedFiles. |
4521 | 3382 |
selectedFiles size == 1 ifTrue:[ |
3383 |
singleSelectedFile := selectedFiles first. |
|
3384 |
||
3385 |
mime := MIMETypes mimeTypeForFilename:singleSelectedFile. |
|
3386 |
(mime notNil and:[mime isArchive]) ifTrue:[ |
|
3387 |
defaultAnswer := singleSelectedFile asFilename withoutSuffix baseName. |
|
3388 |
||
3389 |
mime := MIMETypes mimeTypeForFilename:defaultAnswer. |
|
4982
c38742d99bfd
care for nil mime in newDirectory
Claus Gittinger <cg@exept.de>
parents:
4979
diff
changeset
|
3390 |
(mime notNil and:[mime isArchive]) ifTrue:[ |
4521 | 3391 |
defaultAnswer := defaultAnswer asFilename withoutSuffix baseName |
3392 |
]. |
|
3393 |
]. |
|
3394 |
]. |
|
3395 |
||
5961 | 3396 |
|
4521 | 3397 |
defaultAnswer notNil ifTrue:[ |
5961 | 3398 |
createOp := FileOperation createDirectoryIn:directory initialAnswer:defaultAnswer. |
4521 | 3399 |
] ifFalse:[ |
5961 | 3400 |
createOp := FileOperation createDirectoryIn:directory. |
4521 | 3401 |
]. |
3402 |
createOp result ifFalse:[ ^ self]. |
|
3403 |
newFile := createOp createdFile. |
|
3892 | 3404 |
newFile notNil ifTrue:[ |
4414 | 3405 |
self updateCurrentDirectory. |
3892 | 3406 |
] |
3407 |
! |
|
3408 |
||
3409 |
newFile |
|
3410 |
"ask for and create a new file" |
|
3411 |
||
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
3412 |
| curFile directory create file| |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
3413 |
|
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
3414 |
directory := self currentDirectory. |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
3415 |
directory isNil ifTrue:[ |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
3416 |
self warn:'Select a single directory to create a file.'. |
4979
366465d1a8a5
warn on create new file or directory if nothing selected or more than one directory
penk
parents:
4976
diff
changeset
|
3417 |
^ self. |
366465d1a8a5
warn on create new file or directory if nothing selected or more than one directory
penk
parents:
4976
diff
changeset
|
3418 |
]. |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
3419 |
|
3982 | 3420 |
curFile := self firstSelectedFile. |
3892 | 3421 |
curFile notNil ifTrue:[ |
4414 | 3422 |
file := curFile. |
3892 | 3423 |
] ifFalse:[ |
4414 | 3424 |
file := directory. |
3892 | 3425 |
]. |
5961 | 3426 |
create := FileOperation createFileIn:file. |
3892 | 3427 |
create result ifFalse:[ ^ self]. |
3428 |
self updateAndSelect:(OrderedCollection with:(create createdFile)). |
|
3429 |
! |
|
3430 |
||
3431 |
newHardLink |
|
3432 |
"ask for and create a hard link (unix only)" |
|
3433 |
||
3434 |
self newLink:false. |
|
3435 |
! |
|
3436 |
||
3437 |
newLink:symbolic |
|
3438 |
||
3439 |
"ask for and create a symbolic if symbolic is true otherwise a hard link (unix only)" |
|
3440 |
||
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
3441 |
| sel dir create createdFile| |
3892 | 3442 |
|
3443 |
sel := self currentFileNameHolder value. |
|
4979
366465d1a8a5
warn on create new file or directory if nothing selected or more than one directory
penk
parents:
4976
diff
changeset
|
3444 |
(sel size ~= 1) ifTrue:[ |
366465d1a8a5
warn on create new file or directory if nothing selected or more than one directory
penk
parents:
4976
diff
changeset
|
3445 |
self warn:'Select one directory to link'. |
366465d1a8a5
warn on create new file or directory if nothing selected or more than one directory
penk
parents:
4976
diff
changeset
|
3446 |
^ self |
366465d1a8a5
warn on create new file or directory if nothing selected or more than one directory
penk
parents:
4976
diff
changeset
|
3447 |
]. |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
3448 |
dir := sel first. |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
3449 |
|
3892 | 3450 |
symbolic ifTrue:[ |
5961 | 3451 |
create := FileOperation createSoftLinkIn:dir. |
3892 | 3452 |
] ifFalse:[ |
5961 | 3453 |
create := FileOperation createHardLinkIn:dir. |
3892 | 3454 |
]. |
3455 |
create result ifFalse:[ ^ self]. |
|
3456 |
createdFile := create createdFile. |
|
3457 |
createdFile notNil ifTrue:[ |
|
4785
5a3f7a0c3ff1
symbolic link creation code fixed
Claus Gittinger <cg@exept.de>
parents:
4782
diff
changeset
|
3458 |
symbolic ifTrue:[ |
5a3f7a0c3ff1
symbolic link creation code fixed
Claus Gittinger <cg@exept.de>
parents:
4782
diff
changeset
|
3459 |
self updateCurrentDirectory. |
5a3f7a0c3ff1
symbolic link creation code fixed
Claus Gittinger <cg@exept.de>
parents:
4782
diff
changeset
|
3460 |
] ifFalse:[ |
5a3f7a0c3ff1
symbolic link creation code fixed
Claus Gittinger <cg@exept.de>
parents:
4782
diff
changeset
|
3461 |
self updateAndSelect:(OrderedCollection with:createdFile). |
5a3f7a0c3ff1
symbolic link creation code fixed
Claus Gittinger <cg@exept.de>
parents:
4782
diff
changeset
|
3462 |
] |
3892 | 3463 |
]. |
3464 |
! |
|
3465 |
||
3466 |
newSoftLink |
|
3467 |
"ask for and create a soft link (unix only)" |
|
3468 |
||
3469 |
self newLink:true. |
|
3470 |
! |
|
3471 |
||
3472 |
pasteFiles |
|
3473 |
"defete current selected files/directories |
|
3474 |
" |
|
3475 |
| buffer destination files directories copiedFiles| |
|
3476 |
||
3477 |
files := self clipboard files. |
|
3478 |
(files isNil or:[files isEmpty]) ifTrue:[ ^ self ]. |
|
3479 |
buffer := self clipboard copy. |
|
3982 | 3480 |
directories := self currentSelectedDirectories. |
5880 | 3481 |
directories size ~~ 1 ifTrue:[ |
4414 | 3482 |
|box dirStringCol| |
5880 | 3483 |
|
4414 | 3484 |
dirStringCol := directories collect:[:aDir| aDir asString]. |
3485 |
box := ListSelectionBox new. |
|
3486 |
box title:'In which directory you want to paste ?'. |
|
3487 |
box list:dirStringCol. |
|
3488 |
box okAction:[:sel | destination := sel asFilename]. |
|
5003
a14ce263ada5
boxes no longer show at pointer
Claus Gittinger <cg@exept.de>
parents:
4982
diff
changeset
|
3489 |
box show. |
a14ce263ada5
boxes no longer show at pointer
Claus Gittinger <cg@exept.de>
parents:
4982
diff
changeset
|
3490 |
box destroy. |
3892 | 3491 |
] ifFalse:[ |
5880 | 3492 |
destination := directories anElement. |
3892 | 3493 |
]. |
3494 |
(self clipboard method == #cut) ifTrue:[ |
|
5081 | 3495 |
buffer files copy do:[:aFile| |
3496 |
aFile directory = destination ifTrue:[ |
|
3497 |
buffer files remove:aFile. |
|
3498 |
]. |
|
3499 |
]. |
|
3500 |
]. |
|
3501 |
copiedFiles := self copyFiles:(buffer files) to:destination. |
|
3502 |
(self clipboard method == #cut) ifTrue:[ |
|
3503 |
self deleteFiles:copiedFiles confirm:false. |
|
3504 |
]. |
|
3892 | 3505 |
! |
3506 |
||
3507 |
renameFile:aFile |
|
3508 |
"rename the selected file(s)" |
|
3509 |
||
3510 |
^ self renameFiles:(OrderedCollection with:aFile). |
|
3511 |
! |
|
3512 |
||
4230 | 3513 |
renameFile:filename to:newFileString update:aBoolean |
3892 | 3514 |
"rename filename to newFileString" |
3515 |
||
3516 |
|rename| |
|
3517 |
||
5961 | 3518 |
rename := FileOperation renameFile:filename to:newFileString. |
3892 | 3519 |
rename result ifTrue:[ |
4230 | 3520 |
aBoolean ifTrue:[ |
3521 |
self updateAndSelect:(rename renamedFiles). |
|
3522 |
]. |
|
3892 | 3523 |
] ifFalse:[ |
4523 | 3524 |
self notify:rename errorString. |
3892 | 3525 |
]. |
3526 |
^ rename result |
|
3527 |
! |
|
3528 |
||
3529 |
renameFiles:aColOfFiles |
|
3530 |
"rename the selected file(s)" |
|
3531 |
||
3532 |
|rename| |
|
3533 |
||
5961 | 3534 |
rename := FileOperation renameFiles:aColOfFiles. |
3892 | 3535 |
rename result ifFalse:[ |
4523 | 3536 |
self notify:rename errorString |
3892 | 3537 |
] ifTrue:[ |
4707
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
3538 |
self updateAndSelect:nil. "/ (rename renamedFiles) |
3892 | 3539 |
]. |
3540 |
^ rename result |
|
3541 |
! |
|
3542 |
||
3543 |
renameSelection |
|
3544 |
"rename the selected file(s)" |
|
3545 |
||
4881
e6fc72aac6e6
multiple select allowed in DirectoryTreeBrowser some changes in DirectoryContentsBrowser
penk
parents:
4880
diff
changeset
|
3546 |
self renameFiles:(self currentFileNameHolder value deepCopy) |
3892 | 3547 |
! ! |
3548 |
||
4080 | 3549 |
!AbstractFileBrowser methodsFor:'menu accessing'! |
3892 | 3550 |
|
3952 | 3551 |
bookmarksMenuSpec |
3552 |
<resource: #programMenu> |
|
3553 |
||
4672
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
3554 |
|menu bookmarks| |
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
3555 |
|
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
3556 |
menu := self class baseBookmarksMenuSpec decodeAsLiteralArray. |
4080 | 3557 |
menu findGuiResourcesIn:self. |
3952 | 3558 |
menu receiver:self. |
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
3559 |
|
4672
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
3560 |
"/ add the bookmark items ... |
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
3561 |
bookmarks := self class directoryBookmarks. |
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
3562 |
bookmarks notEmptyOrNil ifTrue:[ |
4414 | 3563 |
menu addItem:(MenuItem labeled:'-'). |
3564 |
bookmarks do:[:dirName | |
|
3565 |
menu addItem:((MenuItem label:dirName asString value:[ |
|
3566 |
(self currentDirectories value includes:dirName) ifFalse:[ |
|
5959 | 3567 |
self setCurrentFileName:dirName. |
4414 | 3568 |
]. |
3569 |
])). |
|
3570 |
]. |
|
3952 | 3571 |
]. |
3572 |
^ menu |
|
3573 |
||
3574 |
"Modified: / 17.8.1998 / 10:13:05 / cg" |
|
3575 |
! |
|
3576 |
||
4347 | 3577 |
canBackward |
3578 |
||
3579 |
||
3580 |
^ self dirHistory canBackward. |
|
3906 | 3581 |
! |
3582 |
||
3583 |
canForward |
|
3584 |
||
3585 |
^ self dirHistory canForward. |
|
3586 |
! |
|
3587 |
||
3892 | 3588 |
menuDirHistory:backOrForward |
3589 |
"initialize the directory menu |
|
3590 |
" |
|
3591 |
<resource: #programMenu > |
|
3592 |
||
3964 | 3593 |
|menu pathList currentSel currentPath| |
3892 | 3594 |
|
3595 |
menu := Menu new. |
|
3596 |
menu receiver:self. |
|
3597 |
||
3598 |
self dirHistory isEmpty ifTrue:[^ nil]. |
|
3599 |
backOrForward == #back ifTrue:[ |
|
4347 | 3600 |
currentSel := self currentDirectories value. |
3601 |
currentSel size == 1 ifTrue:[ |
|
3602 |
currentPath := currentSel first asString. |
|
3603 |
] ifFalse:[ |
|
3604 |
currentPath := nil. |
|
3605 |
]. |
|
3606 |
pathList := self dirHistory getBackCollection. |
|
3892 | 3607 |
] ifFalse:[ |
4347 | 3608 |
pathList := self dirHistory getForwardCollection. |
3892 | 3609 |
]. |
4022 | 3610 |
pathList isEmpty ifTrue:[ ^ nil]. |
3964 | 3611 |
pathList do:[:aPath| |
4347 | 3612 |
| menuItem | |
3613 |
menuItem := MenuItem new. |
|
3614 |
menuItem label:aPath. |
|
3615 |
menuItem value:[ |
|
5959 | 3616 |
self setCurrentFileName:(aPath asFilename). |
4347 | 3617 |
]. |
3618 |
menu addItem:menuItem. |
|
3952 | 3619 |
]. |
3892 | 3620 |
^ menu |
3621 |
! |
|
3622 |
||
3623 |
menuDirHistoryBack |
|
3624 |
"initialize the directory menu |
|
3625 |
" |
|
3626 |
<resource: #programMenu > |
|
3627 |
||
3628 |
^ self menuDirHistory:#back. |
|
3629 |
! |
|
3630 |
||
3631 |
menuDirHistoryForward |
|
3632 |
"initialize the directory menu |
|
3633 |
" |
|
3634 |
<resource: #programMenu > |
|
3635 |
||
3636 |
^ self menuDirHistory:#forward. |
|
3906 | 3637 |
! |
3638 |
||
3639 |
menuFileHistory |
|
3640 |
"initialize the file history menu |
|
3641 |
" |
|
3642 |
<resource: #programMenu > |
|
3643 |
||
3644 |
|menu hist text removeItem removeCol| |
|
3645 |
||
3646 |
menu := Menu new. |
|
4080 | 3647 |
menu findGuiResourcesIn:self. |
3906 | 3648 |
menu receiver:self. |
3649 |
||
3650 |
hist := self fileHistory. |
|
3651 |
hist isEmpty ifTrue:[^ nil]. |
|
4391
05ad03de6f3c
no icon in clearHistory menuItem
Claus Gittinger <cg@exept.de>
parents:
4368
diff
changeset
|
3652 |
|
3906 | 3653 |
removeCol := OrderedCollection new. |
3654 |
hist do:[:aFileItem| |
|
4391
05ad03de6f3c
no icon in clearHistory menuItem
Claus Gittinger <cg@exept.de>
parents:
4368
diff
changeset
|
3655 |
aFileItem fileName exists ifTrue:[ |
05ad03de6f3c
no icon in clearHistory menuItem
Claus Gittinger <cg@exept.de>
parents:
4368
diff
changeset
|
3656 |
menu addItem:(MenuItem label: aFileItem fileName asString value:[ |
5959 | 3657 |
self setCurrentFileName:(aFileItem fileName). |
4391
05ad03de6f3c
no icon in clearHistory menuItem
Claus Gittinger <cg@exept.de>
parents:
4368
diff
changeset
|
3658 |
self openApplByFileItem:aFileItem |
05ad03de6f3c
no icon in clearHistory menuItem
Claus Gittinger <cg@exept.de>
parents:
4368
diff
changeset
|
3659 |
]). |
05ad03de6f3c
no icon in clearHistory menuItem
Claus Gittinger <cg@exept.de>
parents:
4368
diff
changeset
|
3660 |
] ifFalse:[ |
05ad03de6f3c
no icon in clearHistory menuItem
Claus Gittinger <cg@exept.de>
parents:
4368
diff
changeset
|
3661 |
removeCol add:aFileItem. |
05ad03de6f3c
no icon in clearHistory menuItem
Claus Gittinger <cg@exept.de>
parents:
4368
diff
changeset
|
3662 |
] |
3906 | 3663 |
]. |
3664 |
"/ remove all not existing history entries |
|
3665 |
removeCol do:[ : el | |
|
4391
05ad03de6f3c
no icon in clearHistory menuItem
Claus Gittinger <cg@exept.de>
parents:
4368
diff
changeset
|
3666 |
hist remove:el. |
3906 | 3667 |
]. |
4080 | 3668 |
removeItem := MenuItem new. |
3669 |
removeItem translateLabel:true. |
|
4391
05ad03de6f3c
no icon in clearHistory menuItem
Claus Gittinger <cg@exept.de>
parents:
4368
diff
changeset
|
3670 |
text := resources string:'Clear History'. |
05ad03de6f3c
no icon in clearHistory menuItem
Claus Gittinger <cg@exept.de>
parents:
4368
diff
changeset
|
3671 |
"/ text := LabelAndIcon icon:(self class clearHistoryIcon) string:text. |
4080 | 3672 |
removeItem label:text. |
3673 |
removeItem value:[ |
|
4391
05ad03de6f3c
no icon in clearHistory menuItem
Claus Gittinger <cg@exept.de>
parents:
4368
diff
changeset
|
3674 |
self fileHistory removeAll. |
05ad03de6f3c
no icon in clearHistory menuItem
Claus Gittinger <cg@exept.de>
parents:
4368
diff
changeset
|
3675 |
self enableFileHistory value:false. |
3906 | 3676 |
]. |
5977 | 3677 |
menu addSeparator. |
3906 | 3678 |
menu addItem:removeItem. |
3679 |
^ menu |
|
3952 | 3680 |
! |
3681 |
||
4080 | 3682 |
sortMenu |
3683 |
||
3684 |
<resource: #programMenu > |
|
3685 |
||
3686 |
|menu| |
|
3687 |
||
3688 |
menu := Menu new fromLiteralArrayEncoding:self class sortMenu. |
|
3689 |
menu ifNil:[ ^ nil ]. |
|
3690 |
menu findGuiResourcesIn:self. |
|
3691 |
menu receiver:self. |
|
3692 |
^ menu |
|
3693 |
! |
|
3694 |
||
3695 |
viewDetailsMenuSpec |
|
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3696 |
|specContentsBrowser itemsContentsBrowser specHere itemsHere spec| |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3697 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3698 |
specHere := self class viewDetailsMenuSpec. |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3699 |
itemsHere := specHere at:2. |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3700 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3701 |
specContentsBrowser := self directoryContentsBrowser class viewBrowserMenuSpec. |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3702 |
itemsContentsBrowser := (specContentsBrowser at:2). |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3703 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3704 |
spec := specHere copy. |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3705 |
spec at:2 put:(itemsContentsBrowser , itemsHere). |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3706 |
^ spec |
4080 | 3707 |
! |
3708 |
||
3709 |
viewInContentsBrowserMenu |
|
5009 | 3710 |
self |
3711 |
applicationNamed:#DirectoryContentsBrowser |
|
3712 |
ifPresentDo:[:appl | ^ appl viewBrowserMenu]. |
|
3713 |
||
3714 |
^ nil. |
|
4080 | 3715 |
! |
3716 |
||
3952 | 3717 |
visitedDirectoriesMenu |
3718 |
||
3719 |
<resource: #programMenu > |
|
3720 |
||
3721 |
|menu histCopy text removeItem| |
|
3722 |
||
3723 |
menu := Menu new. |
|
3724 |
menu receiver:self. |
|
3725 |
||
3726 |
self dirHistory isEmpty ifTrue:[^ nil]. |
|
4672
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
3727 |
"/ text := LabelAndIcon icon:(self class clearHistoryIcon) string:(resources string:'Clear History'). |
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
3728 |
text := (resources string:'Clear History'). |
3952 | 3729 |
removeItem := MenuItem new. |
4040 | 3730 |
removeItem translateLabel:true. |
3952 | 3731 |
removeItem label:text. |
3732 |
removeItem value:[ |
|
4347 | 3733 |
self dirHistory removeAll. |
3734 |
self enableForward value:self canForward. |
|
3735 |
self enableBack value:self canBackward. |
|
3952 | 3736 |
]. |
3737 |
histCopy := self dirHistory. |
|
3738 |
histCopy do:[:aFile| |
|
4347 | 3739 |
menu addItem:(MenuItem label:aFile asString value:[ |
5959 | 3740 |
self setCurrentFileName:(aFile path asFilename). |
4347 | 3741 |
]). |
3952 | 3742 |
]. |
5977 | 3743 |
menu addSeparator. |
3952 | 3744 |
menu addItem:removeItem. |
3745 |
^ menu |
|
3892 | 3746 |
! ! |
3747 |
||
5880 | 3748 |
!AbstractFileBrowser methodsFor:'menu actions'! |
3749 |
||
3750 |
doCompareTwoFiles |
|
3751 |
||
3752 |
self openDiffView. |
|
3753 |
! |
|
3754 |
||
3755 |
doGoDirectoryUp |
|
5960 | 3756 |
| upDir directory rootInTreeView| |
5880 | 3757 |
|
3758 |
self enableDirectoryUp value ifFalse:[ ^ self]. |
|
3759 |
self currentFilesAreInSameDirectory ifTrue:[ |
|
5960 | 3760 |
directory := self currentDirectory. |
3761 |
directory isNil ifTrue:[ ^ self]. |
|
5880 | 3762 |
] ifFalse:[ |
3763 |
rootInTreeView := self |
|
3764 |
applicationNamed:#DirectoryTreeBrowser |
|
3765 |
ifPresentDo:[:appl | appl rootHolder]. |
|
5960 | 3766 |
directory := rootInTreeView value asFilename. |
3767 |
]. |
|
3768 |
upDir := directory directory. |
|
5959 | 3769 |
self setCurrentFileName:upDir. |
5880 | 3770 |
! |
3771 |
||
3772 |
doGotoDefaultDirectory |
|
3773 |
self gotoFile:(Filename defaultDirectory). |
|
3774 |
! |
|
3775 |
||
3776 |
doGotoHomeDirectory |
|
3777 |
||
3778 |
| home | |
|
3779 |
||
3780 |
home := Filename homeDirectory. |
|
3781 |
self gotoFile:home. |
|
3782 |
! |
|
3783 |
||
3784 |
fileGetInfo:longInfo |
|
3785 |
"get info on selected file - show it in a box" |
|
3786 |
||
3787 |
|string box updater| |
|
3788 |
||
3789 |
string := self getFileInfoStringForFirstSelectedFile:longInfo. |
|
3790 |
string notNil ifTrue:[ |
|
3791 |
box := InfoBox title:string. |
|
3792 |
updater := [ |
|
3793 |
[true] whileTrue:[ |
|
3794 |
Delay waitForSeconds:2. |
|
3795 |
string := self getFileInfoStringForFirstSelectedFile:longInfo. |
|
3796 |
string isNil ifTrue:[ ^ self]. |
|
3797 |
box title:string |
|
3798 |
] |
|
3799 |
] fork. |
|
3800 |
box show. |
|
3801 |
updater terminate. |
|
3802 |
box destroy |
|
3803 |
] |
|
3804 |
! ! |
|
3805 |
||
4849 | 3806 |
!AbstractFileBrowser methodsFor:'menu actions-cvs'! |
3892 | 3807 |
|
3808 |
cvsAddAndCommit |
|
4849 | 3809 |
self cvsAddAndCommitAsBinary:false |
3810 |
! |
|
3811 |
||
3812 |
cvsAddAndCommitAsBinary:asBinary |
|
3892 | 3813 |
|
4046
2f096def132b
commit in after add checks now only the added files in not all
penk
parents:
4040
diff
changeset
|
3814 |
|sel log cmd dir executionBlock nameString block| |
3892 | 3815 |
|
3816 |
log := Dialog |
|
4849 | 3817 |
requestText:(resources string:'Enter initial log message') |
4414 | 3818 |
lines:10 |
3819 |
columns:70 |
|
3820 |
initialAnswer:nil. |
|
3892 | 3821 |
|
3982 | 3822 |
sel := self currentSelectedFiles. |
3892 | 3823 |
executionBlock := [ : stream | |
4414 | 3824 |
log notNil ifTrue:[ |
3825 |
sel size > 0 ifTrue:[ |
|
3826 |
sel do:[:fn | |
|
3827 |
dir := self getDirWithoutFileName:fn. |
|
4849 | 3828 |
|
4414 | 3829 |
cmd := ('cvs add -m ''' , log , ''' ' , fn baseName). |
3830 |
block := self getExecutionBlockForCommand:cmd inDirectory:dir. |
|
3831 |
block value:stream. |
|
4849 | 3832 |
|
4414 | 3833 |
cmd := ('cvs commit -l -m ''' , log , ''' ' , fn baseName). |
3834 |
block := self getExecutionBlockForCommand:cmd inDirectory:dir. |
|
3835 |
block value:stream. |
|
4849 | 3836 |
|
3837 |
cmd := ('cvs admin -kb ' , fn baseName). |
|
3838 |
block := self getExecutionBlockForCommand:cmd inDirectory:dir. |
|
3839 |
block value:stream. |
|
3840 |
||
3841 |
cmd := ('cvs upd ' , fn baseName). |
|
3842 |
block := self getExecutionBlockForCommand:cmd inDirectory:dir. |
|
3843 |
block value:stream. |
|
4414 | 3844 |
] |
3845 |
] |
|
3846 |
] |
|
3892 | 3847 |
]. |
4107 | 3848 |
nameString := 'Command> cvs add and commit'. |
3892 | 3849 |
self makeExecutionResultProcessFor:executionBlock withName:nameString. |
3850 |
! |
|
3851 |
||
4849 | 3852 |
cvsAddBinaryAndCommit |
3853 |
self cvsAddAndCommitAsBinary:true |
|
3854 |
! |
|
3855 |
||
3892 | 3856 |
cvsCommit |
3857 |
||
4107 | 3858 |
|nSel log msg cmd selectedFiles sel executionBlock nameString| |
3892 | 3859 |
|
3982 | 3860 |
selectedFiles:= self currentSelectedFiles. |
3892 | 3861 |
nSel := selectedFiles size. |
3862 |
||
3863 |
nSel == 1 ifTrue:[ |
|
4414 | 3864 |
msg := resources string:'enter log message for checkIn of ''%1''' with:(selectedFiles first baseName) |
3892 | 3865 |
] ifFalse:[ |
4414 | 3866 |
nSel > 1 ifTrue:[ |
3867 |
msg := resources string:'enter log message for %1 files to checkIn' with:nSel printString |
|
3868 |
] ifFalse:[ |
|
3869 |
msg := resources string:'enter log message for checkIn' |
|
3870 |
] |
|
3892 | 3871 |
]. |
3872 |
||
3873 |
log := Dialog |
|
4414 | 3874 |
requestText:msg |
3875 |
lines:10 |
|
3876 |
columns:70 |
|
3877 |
initialAnswer:nil. |
|
3892 | 3878 |
|
4663 | 3879 |
log isNil ifTrue:[^ self]. |
3880 |
sel := self currentFileNameHolder value. |
|
3881 |
sel isEmpty ifTrue:[ ^ self ]. |
|
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
3882 |
executionBlock := [:stream | |
4663 | 3883 |
log notNil ifTrue:[ |
3884 |
sel size > 0 ifTrue:[ |
|
3885 |
sel do:[:fn | |
|
3886 |
| dir block | |
|
3887 |
dir := fn directory. |
|
3888 |
cmd := ('cvs commit -m ''' , log , ''' ' , fn baseName). |
|
3889 |
block := self getExecutionBlockForCommand:cmd inDirectory:dir. |
|
3890 |
block value:stream. |
|
3891 |
] |
|
3892 |
] |
|
3893 |
] |
|
4107 | 3894 |
]. |
3895 |
nameString := 'Command> cvs commit'. |
|
3896 |
self makeExecutionResultProcessFor:executionBlock withName:nameString. |
|
3892 | 3897 |
! |
3898 |
||
3899 |
cvsRemoveAndRemoveFromCVS:filesToRemove |
|
3900 |
"remove the selected file(s) and their CVS containers - no questions asked" |
|
3901 |
||
3902 |
|msg toRemove updateRunning cmd executionBlock nameString| |
|
3903 |
||
3904 |
updateRunning := self backgroundProcesses value notEmpty. |
|
3905 |
self killAllRunningBackgroundProcesses. |
|
3906 |
toRemove := OrderedCollection new. |
|
3907 |
||
3908 |
executionBlock := [ : stream | |
|
4414 | 3909 |
| block | |
3910 |
filesToRemove do:[:fileName | |
|
3911 |
OperatingSystem accessDeniedErrorSignal handle:[:ex| |
|
3912 |
"was not able to remove it" |
|
3913 |
| lastError | |
|
3914 |
lastError := OperatingSystem lastErrorString. |
|
3915 |
msg := (resources string:'cannot remove ''%1'' !!' with:fileName). |
|
3916 |
lastError isNil ifFalse:[ |
|
3917 |
msg := msg , '\\(' , lastError , ')' |
|
3918 |
]. |
|
3919 |
Dialog warn:msg withCRs |
|
3920 |
] do:[ |
|
3921 |
|answer contents| |
|
3922 |
||
3923 |
(fileName isSymbolicLink not) ifTrue:[ |
|
3924 |
fileName remove. |
|
3925 |
cmd := ('cvs remove -f ' , fileName baseName). |
|
3926 |
block := self getExecutionBlockForCommand:cmd. |
|
3927 |
block value:stream. |
|
3928 |
] |
|
3929 |
]. |
|
3930 |
]. |
|
3931 |
||
3932 |
cmd := ('cvs commit -m ''removed via FileBrowser'''). |
|
3933 |
block := self getExecutionBlockForCommand:cmd. |
|
3934 |
block value:stream. |
|
3892 | 3935 |
]. |
4107 | 3936 |
nameString := 'Command> cvs remove and commit ', filesToRemove first baseName. |
3892 | 3937 |
filesToRemove size > 1 ifTrue:[ |
4414 | 3938 |
nameString := nameString, ' ...'. |
3892 | 3939 |
]. |
3940 |
self makeExecutionResultProcessFor:executionBlock withName:nameString. |
|
3941 |
! |
|
3942 |
||
3943 |
cvsRemoveFileAndCVSContainer |
|
3944 |
||
3945 |
|sel question aswer| |
|
3946 |
||
4294 | 3947 |
sel := self currentSelectedFiles copy. |
3892 | 3948 |
sel size > 0 ifTrue:[ |
4294 | 3949 |
sel size > 1 ifTrue:[ |
3950 |
question := resources string:'Remove %1 selected files and their CVS containers ?' with:(sel size) |
|
3951 |
] ifFalse:[ |
|
3952 |
question := resources string:'Remove ''%1'' and its CVS container ?' with:(sel first baseName allBold) |
|
3953 |
]. |
|
3954 |
||
3955 |
aswer := Dialog |
|
3956 |
confirm:question withCRs |
|
3957 |
yesLabel:(resources at:'Remove') |
|
3958 |
noLabel:(resources at:'Cancel'). |
|
3959 |
aswer ifTrue:[ |
|
3960 |
self withCursor:(Cursor wait) do:[ |
|
3961 |
self cvsRemoveAndRemoveFromCVS:sel |
|
3962 |
] |
|
3963 |
] |
|
3892 | 3964 |
] |
3965 |
! |
|
3966 |
||
3967 |
cvsUpdateAll |
|
3968 |
||
3969 |
| cmd | |
|
3970 |
||
3971 |
cmd := 'cvs upd -l'. |
|
3972 |
self executeCommand:cmd. |
|
3973 |
! |
|
3974 |
||
3975 |
cvsUpdateAllRecursive |
|
3976 |
||
3977 |
| cmd | |
|
3978 |
||
3979 |
cmd := 'cvs upd -d'. |
|
3980 |
self executeCommand:cmd. |
|
3981 |
! |
|
3982 |
||
3983 |
cvsUpdateSelection |
|
3984 |
||
3985 |
| selectedFiles stream| |
|
3986 |
||
3987 |
||
3982 | 3988 |
selectedFiles:= self currentSelectedFiles. |
3892 | 3989 |
stream := WriteStream on:''. |
3990 |
stream nextPutAll:'cvs upd '. |
|
3991 |
selectedFiles do:[: file | |
|
4414 | 3992 |
stream nextPutAll:file baseName. |
3993 |
stream space. |
|
3892 | 3994 |
]. |
3995 |
self executeCommand:stream contents. |
|
3996 |
stream close. |
|
3997 |
! ! |
|
3998 |
||
4849 | 3999 |
!AbstractFileBrowser methodsFor:'menu actions-edit'! |
3892 | 4000 |
|
4453
00e639bf2723
cut and copy files in toolbarmenu goes not to contentsbrowser only
penk
parents:
4432
diff
changeset
|
4001 |
copyFiles |
00e639bf2723
cut and copy files in toolbarmenu goes not to contentsbrowser only
penk
parents:
4432
diff
changeset
|
4002 |
|
00e639bf2723
cut and copy files in toolbarmenu goes not to contentsbrowser only
penk
parents:
4432
diff
changeset
|
4003 |
| files dirs| |
00e639bf2723
cut and copy files in toolbarmenu goes not to contentsbrowser only
penk
parents:
4432
diff
changeset
|
4004 |
|
00e639bf2723
cut and copy files in toolbarmenu goes not to contentsbrowser only
penk
parents:
4432
diff
changeset
|
4005 |
files := self currentSelectedFiles. |
00e639bf2723
cut and copy files in toolbarmenu goes not to contentsbrowser only
penk
parents:
4432
diff
changeset
|
4006 |
files notEmpty ifTrue:[ |
00e639bf2723
cut and copy files in toolbarmenu goes not to contentsbrowser only
penk
parents:
4432
diff
changeset
|
4007 |
self copyFilesToClipBoard:(files). |
00e639bf2723
cut and copy files in toolbarmenu goes not to contentsbrowser only
penk
parents:
4432
diff
changeset
|
4008 |
] ifFalse:[ |
00e639bf2723
cut and copy files in toolbarmenu goes not to contentsbrowser only
penk
parents:
4432
diff
changeset
|
4009 |
dirs := self currentSelectedDirectories. |
00e639bf2723
cut and copy files in toolbarmenu goes not to contentsbrowser only
penk
parents:
4432
diff
changeset
|
4010 |
dirs notEmpty ifTrue:[ |
00e639bf2723
cut and copy files in toolbarmenu goes not to contentsbrowser only
penk
parents:
4432
diff
changeset
|
4011 |
self copyFilesToClipBoard:(dirs). |
00e639bf2723
cut and copy files in toolbarmenu goes not to contentsbrowser only
penk
parents:
4432
diff
changeset
|
4012 |
]. |
00e639bf2723
cut and copy files in toolbarmenu goes not to contentsbrowser only
penk
parents:
4432
diff
changeset
|
4013 |
]. |
00e639bf2723
cut and copy files in toolbarmenu goes not to contentsbrowser only
penk
parents:
4432
diff
changeset
|
4014 |
! |
00e639bf2723
cut and copy files in toolbarmenu goes not to contentsbrowser only
penk
parents:
4432
diff
changeset
|
4015 |
|
00e639bf2723
cut and copy files in toolbarmenu goes not to contentsbrowser only
penk
parents:
4432
diff
changeset
|
4016 |
cutFiles |
00e639bf2723
cut and copy files in toolbarmenu goes not to contentsbrowser only
penk
parents:
4432
diff
changeset
|
4017 |
|
00e639bf2723
cut and copy files in toolbarmenu goes not to contentsbrowser only
penk
parents:
4432
diff
changeset
|
4018 |
| files dirs| |
00e639bf2723
cut and copy files in toolbarmenu goes not to contentsbrowser only
penk
parents:
4432
diff
changeset
|
4019 |
|
00e639bf2723
cut and copy files in toolbarmenu goes not to contentsbrowser only
penk
parents:
4432
diff
changeset
|
4020 |
files := self currentSelectedFiles. |
00e639bf2723
cut and copy files in toolbarmenu goes not to contentsbrowser only
penk
parents:
4432
diff
changeset
|
4021 |
files notEmpty ifTrue:[ |
00e639bf2723
cut and copy files in toolbarmenu goes not to contentsbrowser only
penk
parents:
4432
diff
changeset
|
4022 |
self cutFilesToClipBoard:(files). |
00e639bf2723
cut and copy files in toolbarmenu goes not to contentsbrowser only
penk
parents:
4432
diff
changeset
|
4023 |
] ifFalse:[ |
00e639bf2723
cut and copy files in toolbarmenu goes not to contentsbrowser only
penk
parents:
4432
diff
changeset
|
4024 |
dirs := self currentSelectedDirectories. |
00e639bf2723
cut and copy files in toolbarmenu goes not to contentsbrowser only
penk
parents:
4432
diff
changeset
|
4025 |
dirs notEmpty ifTrue:[ |
00e639bf2723
cut and copy files in toolbarmenu goes not to contentsbrowser only
penk
parents:
4432
diff
changeset
|
4026 |
self cutFilesToClipBoard:(dirs). |
00e639bf2723
cut and copy files in toolbarmenu goes not to contentsbrowser only
penk
parents:
4432
diff
changeset
|
4027 |
]. |
00e639bf2723
cut and copy files in toolbarmenu goes not to contentsbrowser only
penk
parents:
4432
diff
changeset
|
4028 |
]. |
00e639bf2723
cut and copy files in toolbarmenu goes not to contentsbrowser only
penk
parents:
4432
diff
changeset
|
4029 |
! |
00e639bf2723
cut and copy files in toolbarmenu goes not to contentsbrowser only
penk
parents:
4432
diff
changeset
|
4030 |
|
00e639bf2723
cut and copy files in toolbarmenu goes not to contentsbrowser only
penk
parents:
4432
diff
changeset
|
4031 |
deleteFiles |
00e639bf2723
cut and copy files in toolbarmenu goes not to contentsbrowser only
penk
parents:
4432
diff
changeset
|
4032 |
|
00e639bf2723
cut and copy files in toolbarmenu goes not to contentsbrowser only
penk
parents:
4432
diff
changeset
|
4033 |
| files dirs| |
00e639bf2723
cut and copy files in toolbarmenu goes not to contentsbrowser only
penk
parents:
4432
diff
changeset
|
4034 |
|
00e639bf2723
cut and copy files in toolbarmenu goes not to contentsbrowser only
penk
parents:
4432
diff
changeset
|
4035 |
files := self currentSelectedFiles. |
00e639bf2723
cut and copy files in toolbarmenu goes not to contentsbrowser only
penk
parents:
4432
diff
changeset
|
4036 |
files notEmpty ifTrue:[ |
00e639bf2723
cut and copy files in toolbarmenu goes not to contentsbrowser only
penk
parents:
4432
diff
changeset
|
4037 |
self deleteFiles:(files). |
00e639bf2723
cut and copy files in toolbarmenu goes not to contentsbrowser only
penk
parents:
4432
diff
changeset
|
4038 |
] ifFalse:[ |
00e639bf2723
cut and copy files in toolbarmenu goes not to contentsbrowser only
penk
parents:
4432
diff
changeset
|
4039 |
dirs := self currentSelectedDirectories. |
00e639bf2723
cut and copy files in toolbarmenu goes not to contentsbrowser only
penk
parents:
4432
diff
changeset
|
4040 |
dirs notEmpty ifTrue:[ |
00e639bf2723
cut and copy files in toolbarmenu goes not to contentsbrowser only
penk
parents:
4432
diff
changeset
|
4041 |
self deleteFiles:(dirs). |
00e639bf2723
cut and copy files in toolbarmenu goes not to contentsbrowser only
penk
parents:
4432
diff
changeset
|
4042 |
]. |
00e639bf2723
cut and copy files in toolbarmenu goes not to contentsbrowser only
penk
parents:
4432
diff
changeset
|
4043 |
]. |
4940
4964068c4718
allow settings dialog to be opened from browser
Claus Gittinger <cg@exept.de>
parents:
4930
diff
changeset
|
4044 |
! |
4964068c4718
allow settings dialog to be opened from browser
Claus Gittinger <cg@exept.de>
parents:
4930
diff
changeset
|
4045 |
|
4964068c4718
allow settings dialog to be opened from browser
Claus Gittinger <cg@exept.de>
parents:
4930
diff
changeset
|
4046 |
openSettingsDialog |
4964068c4718
allow settings dialog to be opened from browser
Claus Gittinger <cg@exept.de>
parents:
4930
diff
changeset
|
4047 |
|dialog| |
4964068c4718
allow settings dialog to be opened from browser
Claus Gittinger <cg@exept.de>
parents:
4930
diff
changeset
|
4048 |
|
4964068c4718
allow settings dialog to be opened from browser
Claus Gittinger <cg@exept.de>
parents:
4930
diff
changeset
|
4049 |
dialog := FileBrowserV2SettingsDialog new. |
5034 | 4050 |
dialog settingsDialog:self. |
4940
4964068c4718
allow settings dialog to be opened from browser
Claus Gittinger <cg@exept.de>
parents:
4930
diff
changeset
|
4051 |
dialog allButOpen. |
4964068c4718
allow settings dialog to be opened from browser
Claus Gittinger <cg@exept.de>
parents:
4930
diff
changeset
|
4052 |
dialog doReload. |
4964068c4718
allow settings dialog to be opened from browser
Claus Gittinger <cg@exept.de>
parents:
4930
diff
changeset
|
4053 |
dialog openWindow |
3892 | 4054 |
! ! |
4055 |
||
4849 | 4056 |
!AbstractFileBrowser methodsFor:'menu actions-help'! |
4057 |
||
4058 |
openAboutThisApplication |
|
4059 |
"opens an about box for this application." |
|
4060 |
||
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4061 |
Dialog aboutClass:self class. |
4849 | 4062 |
! |
4063 |
||
4064 |
openHTMLDocument:relativeDocPath |
|
4065 |
HTMLDocumentView openFullOnDocumentationFile:relativeDocPath |
|
4066 |
! ! |
|
4067 |
||
4068 |
!AbstractFileBrowser methodsFor:'menu actions-tools'! |
|
3892 | 4069 |
|
4721
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
4070 |
conversionChainFrom:inSuffix to:outSuffix |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
4071 |
|conv| |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
4072 |
|
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
4073 |
inSuffix = outSuffix ifTrue:[ |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
4074 |
^ nil |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
4075 |
]. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
4076 |
|
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
4077 |
"/ q&d hack to get my images converted for old html-browsers... |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
4078 |
"/ this should come from somewhere else (do we need an ImageConverter class ?). |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
4079 |
|
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
4080 |
conv := OrderedCollection new. |
4722 | 4081 |
conv add:('anytopnm %1 > %2' -> 'pnm'). |
4721
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
4082 |
|
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
4083 |
outSuffix = 'png' ifTrue:[ |
4722 | 4084 |
conv add:('pnmtopng %1 > %2' -> 'png'). |
4721
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
4085 |
^ conv. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
4086 |
]. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
4087 |
outSuffix = 'gif' ifTrue:[ |
4722 | 4088 |
conv add:('ppmquant 256 %1 | ppmtogif > %2' -> 'gif'). |
4721
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
4089 |
^ conv. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
4090 |
]. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
4091 |
outSuffix = 'xpm' ifTrue:[ |
4722 | 4092 |
conv add:('ppmtoxpm %1 > %2' -> 'xpm'). |
4721
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
4093 |
^ conv. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
4094 |
]. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
4095 |
outSuffix = 'jpg' ifTrue:[ |
4722 | 4096 |
conv add:('ppmtojpeg %1 > %2' -> 'jpg'). |
4721
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
4097 |
^ conv. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
4098 |
]. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
4099 |
self error:'unimplemented conversion'. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
4100 |
! |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
4101 |
|
4367 | 4102 |
convertImageToGIF |
4721
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
4103 |
self convertImageToSuffix:'gif' |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
4104 |
! |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
4105 |
|
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
4106 |
convertImageToJPG |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
4107 |
self convertImageToSuffix:'jpg' |
4531 | 4108 |
! |
4109 |
||
4110 |
convertImageToPNG |
|
4721
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
4111 |
self convertImageToSuffix:'png' |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
4112 |
! |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
4113 |
|
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
4114 |
convertImageToSuffix:outSuffix |
4922 | 4115 |
|image writer tempFileXPM chainOfConversions conversionStream skipSignal |
4116 |
inFile outFile eachConversionSuffixCommandPair doneWithThisFile |
|
5880 | 4117 |
eachConversionSuffix eachConversionCommand tempFileTemplate |
4118 |
filesToConvert| |
|
4721
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
4119 |
|
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
4120 |
"/ [ |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
4121 |
skipSignal := Signal new. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
4122 |
|
4367 | 4123 |
self withActivityIndicationDo:[ |
5880 | 4124 |
filesToConvert := self currentFileNameHolder value copy. |
4125 |
filesToConvert do:[:fileName | |
|
4721
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
4126 |
skipSignal handle:[:ex | ] |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
4127 |
do:[ |
4722 | 4128 |
|answer| |
4129 |
||
4130 |
self notify:(resources string:'Converting: %1...' with:fileName baseName). |
|
4721
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
4131 |
|
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
4132 |
fileName isDirectory ifFalse:[ |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
4133 |
outFile := fileName withSuffix:outSuffix. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
4134 |
outFile exists ifTrue:[ |
4722 | 4135 |
answer := Dialog |
4136 |
confirmWithCancel:(resources string:'Overwrite existing %1 ?' with:outFile baseName allBold) |
|
4137 |
default:false. |
|
4138 |
answer isNil ifTrue:[AbortSignal raise]. |
|
4139 |
answer ifFalse:[ |
|
4721
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
4140 |
skipSignal raise. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
4141 |
]. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
4142 |
]. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
4143 |
|
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
4144 |
image := Image fromFile:fileName. |
4922 | 4145 |
image notNil ifTrue:[ |
4721
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
4146 |
writer := MIMETypes imageReaderForSuffix:outSuffix. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
4147 |
(writer notNil and:[writer canRepresent:image]) ifTrue:[ |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
4148 |
writer save:image onFile:outFile. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
4149 |
skipSignal raise. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
4150 |
]. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
4151 |
]. |
4922 | 4152 |
chainOfConversions := self conversionChainFrom:(fileName suffix) to:outSuffix. |
4721
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
4153 |
|
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
4154 |
chainOfConversions isNil ifTrue:[ skipSignal raise ]. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
4155 |
conversionStream := chainOfConversions readStream. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
4156 |
|
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
4157 |
doneWithThisFile := false. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
4158 |
|
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
4159 |
tempFileTemplate := Filename newTemporary. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
4160 |
|
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
4161 |
inFile := fileName. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
4162 |
eachConversionSuffixCommandPair := conversionStream next. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
4163 |
eachConversionCommand := eachConversionSuffixCommandPair key. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
4164 |
|
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
4165 |
eachConversionCommand == #readToXPM ifTrue:[ |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
4166 |
image := Image fromFile:(inFile pathName). |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
4167 |
image isNil ifTrue:[ |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
4168 |
self warn:'Unknown format/not an image: ' , inFile baseName. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
4169 |
skipSignal raise. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
4170 |
] ifFalse:[ |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
4171 |
tempFileXPM := tempFileTemplate withSuffix:'xpm'. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
4172 |
image saveOn:tempFileXPM using:XPMReader. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
4173 |
inFile := tempFileXPM. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
4174 |
]. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
4175 |
eachConversionSuffixCommandPair := conversionStream next. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
4176 |
]. |
4531 | 4177 |
|
4367 | 4178 |
[ |
5880 | 4179 |
|command errOutput errMsg| |
4721
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
4180 |
|
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
4181 |
[eachConversionSuffixCommandPair notNil] whileTrue:[ |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
4182 |
eachConversionCommand := eachConversionSuffixCommandPair key. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
4183 |
eachConversionSuffix := eachConversionSuffixCommandPair value. |
4531 | 4184 |
|
4722 | 4185 |
self notify:(resources string:'Converting: %1 to %2...' with:fileName baseName with:eachConversionSuffix). |
4186 |
||
4721
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
4187 |
outFile := tempFileTemplate withSuffix:eachConversionSuffix. |
4722 | 4188 |
command := eachConversionCommand |
4189 |
bindWith:(inFile pathName) |
|
4190 |
with:(outFile pathName). |
|
4191 |
||
5755
5e8165d55605
replaced '' writeStream by String writeStream
Claus Gittinger <cg@exept.de>
parents:
5753
diff
changeset
|
4192 |
errOutput := String writeStream. |
4922 | 4193 |
|
4722 | 4194 |
(OperatingSystem executeCommand:command errorTo:errOutput) |
4367 | 4195 |
ifFalse:[ |
5880 | 4196 |
errMsg := resources |
4722 | 4197 |
stringWithCRs:'Conversion of %1 to %2 using %3 failed:\\%4.' |
4198 |
with:inFile baseName allBold |
|
4199 |
with:eachConversionSuffix |
|
4200 |
with:eachConversionCommand allBold |
|
5880 | 4201 |
with:errOutput contents. |
4202 |
filesToConvert size == 1 ifTrue:[ |
|
4203 |
Dialog warn:errMsg |
|
4204 |
] ifFalse:[ |
|
4205 |
(Dialog confirm:errMsg yesLabel:(resources string:'OK') noLabel:(resources string:'Cancel')) ifFalse:[ |
|
4206 |
^ self |
|
4207 |
] |
|
4208 |
]. |
|
4721
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
4209 |
|
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
4210 |
(inFile ~= fileName) ifTrue:[inFile delete]. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
4211 |
outFile delete. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
4212 |
skipSignal raise |
4367 | 4213 |
]. |
4721
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
4214 |
(inFile ~= fileName) ifTrue:[inFile delete]. |
4531 | 4215 |
inFile := outFile. |
4721
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
4216 |
eachConversionSuffixCommandPair := conversionStream next |
4367 | 4217 |
]. |
4721
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
4218 |
] ifCurtailed:[ |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
4219 |
(inFile ~= fileName) ifTrue:[inFile delete]. |
4531 | 4220 |
outFile delete. |
4221 |
]. |
|
4222 |
||
4721
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
4223 |
outFile moveTo:(fileName withSuffix:(chainOfConversions last value)). |
4531 | 4224 |
self updateAndSelect:nil. |
4367 | 4225 |
] |
4226 |
] |
|
4227 |
]. |
|
4523 | 4228 |
self notify:''. |
4367 | 4229 |
] |
4721
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
4230 |
"/ ] fork. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
4231 |
! |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
4232 |
|
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
4233 |
convertImageToXPM |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
4234 |
self convertImageToSuffix:'xpm' |
4367 | 4235 |
! |
4236 |
||
3892 | 4237 |
createProjectAndOpenProjectBrowser |
4238 |
|nm f s directory| |
|
4239 |
||
4240 |
self currentFilesAreInSameDirectory ifFalse:[^ self]. |
|
5960 | 4241 |
directory := self currentDirectory. |
3892 | 4242 |
nm := directory baseName. |
4243 |
f := (directory construct:nm) withSuffix:'prj'. |
|
4244 |
f exists ifTrue:[ |
|
4414 | 4245 |
Dialog warn:'A file named ' , f baseName , ' already exists.'. |
4246 |
^ self. |
|
3892 | 4247 |
]. |
4248 |
s := f writeStream. |
|
4249 |
s nextPutAll:' |
|
4250 |
name ''' , nm , ''' |
|
4251 |
type #classLibrary |
|
4252 |
package #''private:' , nm , ''' |
|
4253 |
prerequisites nil |
|
4254 |
||
4255 |
classes #( ) |
|
4256 |
'. |
|
4257 |
s close. |
|
4258 |
ProjectBrowser openOnFile:f. |
|
4259 |
! |
|
4260 |
||
5880 | 4261 |
doExecuteCommand |
4262 |
"execute an OperatingSystem-command" |
|
4263 |
||
4264 |
| action fileName| |
|
4265 |
||
4266 |
fileName := self firstSelectedFile. |
|
4267 |
action := [:command | |
|
4268 |
self addToCommandHistory:command for:fileName. |
|
4269 |
self executeCommand:command. |
|
4270 |
]. |
|
4271 |
self askForCommandFor:fileName thenDo:action |
|
4272 |
! |
|
4273 |
||
4274 |
doExecuteScript |
|
4275 |
"execute a smalltalk script" |
|
4276 |
||
4277 |
|textHolder dialog template dummyClass dummyInstance| |
|
4278 |
||
4279 |
template := |
|
4280 |
'"/ Smalltalk script: |
|
4281 |
||
4282 |
"/ the following variables are accessable: |
|
4283 |
"/ directory (= ' , (self theSingleSelectedDirectoryOrNil ? Filename homeDirectory) pathName , ') |
|
4284 |
"/ selectedFiles (= ...) |
|
4285 |
"/ |
|
4286 |
"/ Beginner warning: Smalltalk know-how is useful here ;-). |
|
4287 |
"/ |
|
4288 |
"/ Useful operations are: |
|
4289 |
"/ directory directoryContentsDo:[:eachBaseNameString | ...] |
|
4290 |
"/ directory directoryContentsAsFilenamesDo:[:eachFilename | ...] |
|
4291 |
"/ directory directory |
|
4292 |
"/ |
|
4293 |
"/ example: move all files which match a aarticular pattern to |
|
4294 |
"/ a separate directory: |
|
4295 |
"/ |
|
4296 |
"/ |directory idx prefix rest newDir oldFile newFile| |
|
4297 |
"/ |
|
4298 |
"/ directory := ''/mnt/var/priv/image/tv/frank/frank2/2131_008.jpg'' asFilename. |
|
4299 |
"/ |
|
4300 |
"/ directory directoryContentsDo:[:eachBaseNameString | |
|
4301 |
"/ (eachBaseNameString includes:$_) ifTrue:[ |
|
4302 |
"/ idx := eachBaseNameString indexOf:$_. |
|
4303 |
"/ prefix := eachBaseNameString copyTo:(idx - 1). |
|
4304 |
"/ rest := eachBaseNameString copyFrom:(idx + 1). |
|
4305 |
"/ newDir := directory construct:prefix. |
|
4306 |
"/ newDir exists ifFalse:[ |
|
4307 |
"/ (Dialog confirm:''Create '' , newDir pathName) ifTrue:[ |
|
4308 |
"/ newDir makeDirectory. |
|
4309 |
"/ ]. |
|
4310 |
"/ ]. |
|
4311 |
"/ newDir exists ifTrue:[ |
|
4312 |
"/ oldFile := directory construct:eachBaseNameString. |
|
4313 |
"/ newFile := newDir construct:rest. |
|
4314 |
"/ oldFile moveTo:newFile |
|
4315 |
"/ ] |
|
4316 |
"/ ] |
|
4317 |
"/ ] |
|
4318 |
'. |
|
4319 |
||
4320 |
LastScriptBlockString isNil ifTrue:[ |
|
4321 |
LastScriptBlockString := template. |
|
4322 |
]. |
|
4323 |
||
4324 |
textHolder := ValueHolder new. |
|
4325 |
dialog := Dialog |
|
4326 |
forRequestText:(resources string:'Enter script') |
|
4327 |
editViewClass:CodeView |
|
4328 |
lines:25 |
|
4329 |
columns:70 |
|
4330 |
initialAnswer:LastScriptBlockString |
|
4331 |
model:textHolder. |
|
4332 |
dialog addButton:(Button label:'Template' action:[textHolder value:template. textHolder changed:#value.]). |
|
4333 |
dialog open. |
|
4334 |
dialog accepted ifFalse:[^ self]. |
|
4335 |
||
4336 |
LastScriptBlockString := textHolder value. |
|
4337 |
||
4338 |
Class classConventionViolationConfirmationQuerySignal |
|
4339 |
answer:true |
|
4340 |
do:[ |
|
4341 |
dummyClass := Object class |
|
4342 |
name:#Dummy |
|
4343 |
inEnvironment:nil |
|
4344 |
subclassOf:Object |
|
4345 |
instanceVariableNames:'directory selectedFiles' |
|
4346 |
variable:false |
|
4347 |
words:true |
|
4348 |
pointers:true |
|
4349 |
classVariableNames:'' |
|
4350 |
poolDictionaries:'' |
|
4351 |
category:#dummyCategory |
|
4352 |
comment:nil |
|
4353 |
changed:true. |
|
4354 |
]. |
|
4355 |
||
4356 |
dummyInstance := dummyClass basicNew. |
|
4357 |
dummyInstance instVarAt:1 put:(self theSingleSelectedDirectoryOrNil ? Filename homeDirectory). |
|
4358 |
dummyInstance instVarAt:2 put:(self currentSelectedFiles value). |
|
4359 |
||
4360 |
Compiler |
|
4361 |
evaluate:textHolder value |
|
4362 |
in:nil |
|
4363 |
receiver:dummyInstance |
|
4364 |
notifying:nil |
|
4365 |
logged:false |
|
4366 |
ifFail:[] |
|
4367 |
compile:true. |
|
4368 |
||
4369 |
"/ fileName := self firstSelectedFile. |
|
4370 |
"/ action := [:command | |
|
4371 |
"/ self addToCommandHistory:command for:fileName. |
|
4372 |
"/ self executeCommand:command. |
|
4373 |
"/ ]. |
|
4374 |
"/ self askForCommandFor:fileName thenDo:action |
|
4375 |
! |
|
4376 |
||
4230 | 4377 |
doMake |
4378 |
||
4379 |
| cmd | |
|
4380 |
||
4381 |
cmd := 'make'. |
|
4382 |
self executeCommand:cmd. |
|
4383 |
! |
|
4384 |
||
4317
bf3f150809c2
settings is a new application now and will be inserted under tools in
penk
parents:
4294
diff
changeset
|
4385 |
doOpenSettings |
bf3f150809c2
settings is a new application now and will be inserted under tools in
penk
parents:
4294
diff
changeset
|
4386 |
|
bf3f150809c2
settings is a new application now and will be inserted under tools in
penk
parents:
4294
diff
changeset
|
4387 |
| inst | |
bf3f150809c2
settings is a new application now and will be inserted under tools in
penk
parents:
4294
diff
changeset
|
4388 |
|
4581 | 4389 |
inst := FileBrowserV2SettingsDialog new. |
5034 | 4390 |
inst settingsDialog:self. |
4317
bf3f150809c2
settings is a new application now and will be inserted under tools in
penk
parents:
4294
diff
changeset
|
4391 |
inst open. |
bf3f150809c2
settings is a new application now and will be inserted under tools in
penk
parents:
4294
diff
changeset
|
4392 |
! |
bf3f150809c2
settings is a new application now and will be inserted under tools in
penk
parents:
4294
diff
changeset
|
4393 |
|
3892 | 4394 |
fileFileIn |
4395 |
"fileIn the selected file(s)" |
|
4396 |
||
4397 |
self fileFileInLazy:false |
|
4398 |
! |
|
4399 |
||
4400 |
fileFileInLazy |
|
4401 |
"fileIn the selected file(s). Do a quick load (no compilation)" |
|
4402 |
||
4403 |
self fileFileInLazy:true |
|
4404 |
! |
|
4405 |
||
4406 |
fileFileInLazy:lazy |
|
4407 |
"fileIn the selected file(s)" |
|
4408 |
||
4345 | 4409 |
|
4878 | 4410 |
"/ [ |
4345 | 4411 |
self withActivityIndicationDo:[ |
4412 |
| selectedFiles| |
|
4413 |
selectedFiles:= self currentSelectedFiles. |
|
4414 |
selectedFiles do:[:fileName | |
|
4523 | 4415 |
self notify:('File in:', fileName baseName). |
4345 | 4416 |
self singleFileFileIn:fileName lazy:lazy |
4417 |
]. |
|
4523 | 4418 |
self notify:''. |
4345 | 4419 |
] |
4878 | 4420 |
"/ ] fork. |
4421 |
||
3892 | 4422 |
! |
4423 |
||
4424 |
fileFileInToNameSpace |
|
4425 |
"fileIn the selected file(s)<into a nameSpace" |
|
4426 |
||
4427 |
|ns listOfKnownNameSpaces| |
|
4428 |
||
4429 |
listOfKnownNameSpaces := Set new. |
|
4430 |
NameSpace |
|
4414 | 4431 |
allNamespaces |
4432 |
do:[:eachNameSpace | |
|
4433 |
listOfKnownNameSpaces add:eachNameSpace name |
|
4434 |
]. |
|
3892 | 4435 |
listOfKnownNameSpaces := listOfKnownNameSpaces asOrderedCollection sort. |
4436 |
||
4437 |
ns := Dialog |
|
4414 | 4438 |
request:'During fileIn, new classes are created in nameSpace:' |
4439 |
initialAnswer:(LastEnforcedNameSpace ? Class nameSpaceQuerySignal query name) |
|
4440 |
list:listOfKnownNameSpaces. |
|
3892 | 4441 |
ns isEmptyOrNil ifTrue:[^ self]. |
4442 |
||
4443 |
LastEnforcedNameSpace := ns. |
|
4444 |
ns := NameSpace name:ns. |
|
4445 |
||
4446 |
Class nameSpaceQuerySignal |
|
4414 | 4447 |
answer:ns |
4448 |
do:[ |
|
4449 |
self fileFileInLazy:false |
|
4450 |
] |
|
3892 | 4451 |
! |
4452 |
||
4453 |
fileFindAllDuplicates |
|
4454 |
"scan directory and all subdirs for duplicate files" |
|
4455 |
||
4456 |
|fileNames dir infoDir filesBySize |
|
4457 |
result info dirPrefix myName stream textBox maxLength directories| |
|
4458 |
||
4459 |
||
4460 |
self withWaitCursorDo:[ |
|
4414 | 4461 |
result := Dictionary new. |
4462 |
myName := self class name asString. |
|
4463 |
directories := self currentSelectedDirectories. |
|
4464 |
directories isEmpty ifTrue:[^ self]. |
|
3892 | 4465 |
|
4414 | 4466 |
dir := directories first. |
3892 | 4467 |
"/ self label: myName, '- gathering file names ...'. |
4636
08b2b63e3107
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4629
diff
changeset
|
4468 |
[ |
08b2b63e3107
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4629
diff
changeset
|
4469 |
fileNames := dir recursiveDirectoryContents. |
08b2b63e3107
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4629
diff
changeset
|
4470 |
] on:FileStream openErrorSignal do:[:ex| |
08b2b63e3107
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4629
diff
changeset
|
4471 |
self warn:('Cannot access: %1\(%2)' |
5810
4661bf4c3bbf
openErrorSignal arg: always a string
Claus Gittinger <cg@exept.de>
parents:
5789
diff
changeset
|
4472 |
bindWith:ex pathName |
4636
08b2b63e3107
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4629
diff
changeset
|
4473 |
with:ex description) withCRs. |
08b2b63e3107
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4629
diff
changeset
|
4474 |
^ self |
08b2b63e3107
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4629
diff
changeset
|
4475 |
]. |
4765 | 4476 |
fileNames := fileNames |
4477 |
collect:[:fn | dir construct:fn] |
|
4478 |
thenSelect:[:fn | fn isDirectory not]. |
|
3892 | 4479 |
|
4480 |
"/ self label:myName , '- gathering sizes ...'. |
|
4414 | 4481 |
infoDir := Dictionary new. |
4482 |
fileNames do:[:fn | |
|
4483 |
infoDir at:fn put:(fn fileSize) |
|
4484 |
]. |
|
4485 |
||
4486 |
"/ for each, get the files size. |
|
4487 |
"/ in a first pass, look for files of the same size and |
|
4488 |
"/ compare them ... |
|
3892 | 4489 |
|
4490 |
"/ self label:myName , '- preselect possible duplicates ...'. |
|
4414 | 4491 |
filesBySize := Dictionary new. |
4492 |
infoDir keysAndValuesDo:[:fn :sz | |
|
4493 |
|entry| |
|
4494 |
||
4495 |
entry := filesBySize at:sz ifAbsentPut:[Set new]. |
|
4496 |
entry add:fn. |
|
4497 |
]. |
|
4498 |
||
4499 |
"/ any of same size ? |
|
3892 | 4500 |
|
4501 |
"/ self label:myName , '- checking for duplicates ...'. |
|
4414 | 4502 |
filesBySize do:[:entry | |
4503 |
|files| |
|
4504 |
||
4505 |
entry size > 1 ifTrue:[ |
|
4506 |
files := entry asArray. |
|
4507 |
1 to:files size-1 do:[:idx1 | |
|
4508 |
idx1+1 to:files size do:[:idx2 | |
|
4509 |
|fn1 fn2| |
|
4510 |
||
4511 |
fn1 := files at:idx1. |
|
4512 |
fn2 := files at:idx2. |
|
3892 | 4513 |
|
4514 |
"/ self label:myName , '- checking ' , fn1 baseName , ' vs. ' , fn2 baseName , ' ...'. |
|
4414 | 4515 |
(result at:fn2 ifAbsent:nil) ~= fn1 ifTrue:[ |
4516 |
"/ compare the files |
|
4517 |
(fn1 sameContentsAs:fn2) ifTrue:[ |
|
3892 | 4518 |
"/ Transcript show:'Same: '; show:fn1 baseName; show:' and '; showCR:fn2 baseName. |
4414 | 4519 |
result at:fn1 put:fn2. |
4520 |
] |
|
4521 |
] |
|
4522 |
] |
|
4523 |
] |
|
4524 |
] |
|
4525 |
]. |
|
3892 | 4526 |
|
4527 |
"/ self label:myName , '- sorting ...'. |
|
4414 | 4528 |
dirPrefix := dir pathName. |
4529 |
result := result associations. |
|
4530 |
result := result collect:[:assoc | |
|
4531 |
|f1 f2| |
|
4532 |
||
4533 |
f1 := assoc key name. |
|
4534 |
f2 := assoc value name. |
|
4535 |
(f1 startsWith:dirPrefix) ifTrue:[ |
|
4536 |
f1 := f1 copyFrom:dirPrefix size + 2. |
|
4537 |
]. |
|
4538 |
(f2 startsWith:dirPrefix) ifTrue:[ |
|
4539 |
f2 := f2 copyFrom:dirPrefix size + 2. |
|
4540 |
]. |
|
4541 |
f1 < f2 ifTrue:[ |
|
4542 |
f2 -> f1 |
|
4543 |
] ifFalse:[ |
|
4544 |
f1 -> f2 |
|
4545 |
] |
|
4546 |
]. |
|
4547 |
result sort:[:f1 :f2 | f2 value < f1 value]. |
|
4548 |
||
4549 |
info := OrderedCollection new. |
|
4550 |
result do:[:assoc | |
|
4551 |
info add:(assoc key , ' same as ' , assoc value) |
|
4552 |
]. |
|
4553 |
info isEmpty ifTrue:[ |
|
5543 | 4554 |
Dialog information:'No duplicate files found.'. |
4555 |
^ self. |
|
4414 | 4556 |
]. |
3892 | 4557 |
]. |
4558 |
||
4559 |
stream := WriteStream on:''. |
|
4560 |
info do:[:el| |
|
4535 | 4561 |
stream nextPutLine:el. |
3892 | 4562 |
]. |
5542 | 4563 |
|
3892 | 4564 |
textBox := TextBox new. |
4565 |
textBox initialText:(stream contents). |
|
5542 | 4566 |
stream close. |
4636
08b2b63e3107
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4629
diff
changeset
|
4567 |
textBox title:'File duplicates in directory: ', dir asString. |
3892 | 4568 |
textBox readOnly:true. |
4569 |
textBox noCancel. |
|
4636
08b2b63e3107
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4629
diff
changeset
|
4570 |
textBox label:'Duplicates in ', dir asString. |
3892 | 4571 |
maxLength := 10. |
4572 |
info do:[: el | |
|
4414 | 4573 |
maxLength := maxLength max:(el size). |
3892 | 4574 |
]. |
4575 |
textBox extent:((maxLength * 5)@(info size * 20)); sizeFixed:false. |
|
5542 | 4576 |
textBox maxExtent:Screen current extent. |
4577 |
textBox openModeless. |
|
3892 | 4578 |
! |
4579 |
||
4580 |
fileFindDuplicates |
|
4581 |
"scan directory for duplicate files" |
|
4582 |
||
5543 | 4583 |
|fileNames infoDir filesBySize result info stream textBox maxLength directories allFiles titleStream size| |
3892 | 4584 |
|
4585 |
"/ (self askIfModified:'contents has not been saved.\\Modifications will be lost when you proceed.' |
|
4586 |
"/ yesButton:'proceed') ifFalse:[^ self]. |
|
4587 |
||
4588 |
self withWaitCursorDo:[ |
|
4355 | 4589 |
result := Dictionary new. |
4590 |
||
4591 |
directories := self currentSelectedDirectories. |
|
4592 |
directories isEmpty ifTrue:[^ self]. |
|
4593 |
||
4594 |
allFiles := OrderedCollection new. |
|
4595 |
directories do:[ : dir| |
|
4636
08b2b63e3107
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4629
diff
changeset
|
4596 |
[ |
08b2b63e3107
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4629
diff
changeset
|
4597 |
fileNames := dir directoryContents. |
5810
4661bf4c3bbf
openErrorSignal arg: always a string
Claus Gittinger <cg@exept.de>
parents:
5789
diff
changeset
|
4598 |
fileNames notNil ifTrue:[ |
4661bf4c3bbf
openErrorSignal arg: always a string
Claus Gittinger <cg@exept.de>
parents:
5789
diff
changeset
|
4599 |
fileNames := fileNames |
4661bf4c3bbf
openErrorSignal arg: always a string
Claus Gittinger <cg@exept.de>
parents:
5789
diff
changeset
|
4600 |
collect:[:fn | dir construct:fn] |
4661bf4c3bbf
openErrorSignal arg: always a string
Claus Gittinger <cg@exept.de>
parents:
5789
diff
changeset
|
4601 |
thenSelect:[:fn | fn isDirectory not]. |
4661bf4c3bbf
openErrorSignal arg: always a string
Claus Gittinger <cg@exept.de>
parents:
5789
diff
changeset
|
4602 |
allFiles addAll:fileNames. |
4661bf4c3bbf
openErrorSignal arg: always a string
Claus Gittinger <cg@exept.de>
parents:
5789
diff
changeset
|
4603 |
] |
4636
08b2b63e3107
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4629
diff
changeset
|
4604 |
] on:FileStream openErrorSignal do:[:ex| |
08b2b63e3107
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4629
diff
changeset
|
4605 |
self warn:('Cannot access: %1\(%2)' |
5810
4661bf4c3bbf
openErrorSignal arg: always a string
Claus Gittinger <cg@exept.de>
parents:
5789
diff
changeset
|
4606 |
bindWith:ex pathName |
4636
08b2b63e3107
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4629
diff
changeset
|
4607 |
with:ex description) withCRs. |
5810
4661bf4c3bbf
openErrorSignal arg: always a string
Claus Gittinger <cg@exept.de>
parents:
5789
diff
changeset
|
4608 |
ex proceedWith:nil. |
4636
08b2b63e3107
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4629
diff
changeset
|
4609 |
]. |
4355 | 4610 |
]. |
4611 |
||
4612 |
infoDir := Dictionary new. |
|
4613 |
allFiles do:[:fn | |
|
4614 |
infoDir at:fn put:(fn info) |
|
4615 |
]. |
|
4616 |
||
4617 |
"/ for each, get the files size. |
|
4618 |
"/ in a first pass, look for files of the same size and |
|
4619 |
"/ compare them ... |
|
4620 |
||
4621 |
filesBySize := Dictionary new. |
|
4622 |
infoDir keysAndValuesDo:[:fn :info | |
|
4623 |
|sz entry| |
|
4624 |
||
4625 |
sz := info size. |
|
4626 |
entry := filesBySize at:sz ifAbsentPut:[Set new]. |
|
4627 |
entry add:fn. |
|
4628 |
]. |
|
4629 |
||
4630 |
"/ any of same size ? |
|
4631 |
||
4632 |
filesBySize do:[:entry | |
|
4633 |
|files| |
|
4634 |
||
4635 |
entry size > 1 ifTrue:[ |
|
4636 |
files := entry asArray. |
|
4637 |
1 to:files size-1 do:[:idx1 | |
|
4638 |
idx1+1 to:files size do:[:idx2 | |
|
4639 |
|fn1 fn2| |
|
4640 |
||
4641 |
fn1 := files at:idx1. |
|
4642 |
fn2 := files at:idx2. |
|
4643 |
||
4644 |
(result at:fn2 ifAbsent:nil) ~= fn1 ifTrue:[ |
|
4645 |
"/ compare the files |
|
4646 |
(fn1 sameContentsAs:fn2) ifTrue:[ |
|
3892 | 4647 |
"/ Transcript show:'Same: '; show:fn1 baseName; show:' and '; showCR:fn2 baseName. |
4355 | 4648 |
result at:fn1 put:fn2. |
4649 |
] |
|
4650 |
] |
|
4651 |
] |
|
4652 |
] |
|
4653 |
] |
|
4654 |
]. |
|
4655 |
||
4656 |
result := result associations. |
|
4657 |
result := result collect:[:assoc | |
|
4658 |
|f1 f2| |
|
4659 |
||
4660 |
f1 := assoc key asString. |
|
4661 |
f2 := assoc value asString. |
|
4662 |
f1 < f2 ifTrue:[ |
|
4663 |
f2 -> f1 |
|
4664 |
] ifFalse:[ |
|
4665 |
f1 -> f2 |
|
4666 |
] |
|
4667 |
]. |
|
5789 | 4668 |
"/ result sort:[:f1 :f2 | f1 key > f2 key "f2 value < f1 key value"]. |
4669 |
result sort:[:f1 :f2 | " f1 key > f2 key" f2 value < f1 key value]. |
|
4355 | 4670 |
|
4671 |
info := OrderedCollection new. |
|
4672 |
size := self getBestDirectory asString size. |
|
4673 |
result do:[:assoc | |
|
4674 |
|fn1 fn2| |
|
4675 |
||
4676 |
fn1 := assoc key. |
|
4677 |
fn2 := assoc value. |
|
4678 |
size > 1 ifTrue:[ |
|
4679 |
fn1 := ('..', (fn1 copyFrom:(size + 1))). |
|
4680 |
fn2 := ('..', (fn2 copyFrom:(size + 1))). |
|
4681 |
]. |
|
4682 |
(fn1 includes:Character space) ifTrue:[ |
|
4683 |
fn1 := '"' , fn1 , '"' |
|
4684 |
]. |
|
4685 |
(fn2 includes:Character space) ifTrue:[ |
|
4686 |
fn2 := '"' , fn2 , '"' |
|
4687 |
]. |
|
4688 |
info add:(fn1 , ' same as ' , fn2) |
|
4689 |
]. |
|
4690 |
info isEmpty ifTrue:[ |
|
5543 | 4691 |
Dialog information:'No duplicate files found.'. |
4692 |
^ self. |
|
4355 | 4693 |
]. |
3892 | 4694 |
]. |
4695 |
stream := WriteStream on:''. |
|
4696 |
info do:[:el| |
|
4535 | 4697 |
stream nextPutLine:el. |
3892 | 4698 |
]. |
4699 |
titleStream := WriteStream on:''. |
|
4636
08b2b63e3107
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4629
diff
changeset
|
4700 |
titleStream nextPutAll:'File duplicates in director'. |
3892 | 4701 |
directories size == 1 ifTrue:[ |
4355 | 4702 |
titleStream nextPutAll:'y: ', directories first asString. |
3892 | 4703 |
] ifFalse:[ |
4535 | 4704 |
titleStream nextPutLine:'ies: '. |
4355 | 4705 |
directories do:[:dir| |
4706 |
size > 1 ifTrue:[ |
|
4707 |
titleStream nextPutAll:'..'. |
|
4535 | 4708 |
titleStream nextPutLine:((dir asString) copyFrom:(size + 1)). |
4355 | 4709 |
] ifFalse:[ |
4535 | 4710 |
titleStream nextPutLine:(dir asString). |
4355 | 4711 |
]. |
4712 |
] |
|
3892 | 4713 |
]. |
5543 | 4714 |
|
3892 | 4715 |
textBox := TextBox new. |
4716 |
textBox initialText:(stream contents). |
|
4717 |
textBox title:(titleStream contents). |
|
4718 |
textBox readOnly:true. |
|
4719 |
textBox noCancel. |
|
4636
08b2b63e3107
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4629
diff
changeset
|
4720 |
stream := WriteStream on:'Duplicates in '. |
4170 | 4721 |
directories do:[ :aDirectory | |
4355 | 4722 |
stream nextPutAll:aDirectory baseName. |
4723 |
stream space. |
|
4050 | 4724 |
]. |
4170 | 4725 |
textBox label:stream contents. |
3892 | 4726 |
maxLength := 10. |
4727 |
info do:[: el | |
|
4355 | 4728 |
maxLength := maxLength max:(el size). |
3892 | 4729 |
]. |
5092 | 4730 |
textBox extent:((maxLength * 5)@((info size max:40)* 10)). |
4731 |
textBox maxExtent:Screen current extent. |
|
4355 | 4732 |
textBox openModeless. "/ showAtPointer. |
3892 | 4733 |
! |
4734 |
||
4735 |
fileFindFile |
|
5961 | 4736 |
|filename| |
4737 |
||
4738 |
filename := self firstSelectedFileName. |
|
4739 |
filename isNil ifTrue:[ |
|
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
4740 |
filename := Filename homeDirectory. |
3892 | 4741 |
]. |
4101 | 4742 |
FindFileApplication openOnFileName:filename for:self. |
3892 | 4743 |
! |
4744 |
||
4618 | 4745 |
fileHexDump |
4746 |
||
4747 |
| file item| |
|
4748 |
||
4749 |
file := self firstSelectedFile. |
|
4750 |
file notNil ifTrue:[ |
|
4751 |
item := DirectoryContentsBrowser itemClass fileName:file. |
|
5009 | 4752 |
self |
4753 |
applicationNamed:#FileApplicationNoteBook |
|
4754 |
ifPresentDo:[:appl | appl openTextEditorWithHexPresentationOn:item]. |
|
4618 | 4755 |
]. |
4756 |
! |
|
4757 |
||
4930 | 4758 |
filterSelectedFiles:whichFilter |
4759 |
|selectedFiles numFiles msg filterBlock| |
|
4760 |
||
4761 |
selectedFiles := self currentFileNameHolder value. |
|
4762 |
(numFiles := selectedFiles size) == 0 ifTrue:[^ self]. |
|
4763 |
||
4764 |
msg := 'Replace contents of file ''%2'' with output of %3-filter ?'. |
|
4765 |
numFiles > 1 ifTrue:[ |
|
4766 |
msg := 'Replace contents of %1 files with output of %3-filter ?'. |
|
4767 |
]. |
|
4768 |
||
4769 |
(Dialog |
|
4770 |
confirm:(msg bindWith:numFiles with:selectedFiles first baseName allBold with:whichFilter) withCRs |
|
4771 |
initialAnswer:false |
|
4772 |
) ifFalse:[ |
|
4773 |
^ self |
|
4774 |
]. |
|
4775 |
||
4776 |
whichFilter == #rot13 ifTrue:[ |
|
4777 |
filterBlock := [:charIn | charIn rot13 ]. |
|
4778 |
]. |
|
4779 |
"/ add more here... |
|
4780 |
||
4781 |
filterBlock isNil ifTrue:[ |
|
4782 |
self information:'No such filter: ' , whichFilter. |
|
4783 |
^ self. |
|
4784 |
]. |
|
4785 |
||
4786 |
selectedFiles do:[:fileName | |
|
4787 |
|s| |
|
4788 |
||
4789 |
self notify:('Processing:', fileName baseName). |
|
4790 |
fileName isDirectory ifFalse:[ |
|
4791 |
[ |
|
4792 |
|inFile outFile in out| |
|
4793 |
||
4794 |
inFile := fileName asFilename. |
|
4795 |
outFile := (fileName pathName , '.filter') asFilename. |
|
4796 |
||
4797 |
[ |
|
4798 |
|charIn charOut| |
|
4799 |
||
4800 |
in := inFile readStream. |
|
4801 |
out := outFile writeStream. |
|
4802 |
[in atEnd] whileFalse:[ |
|
4803 |
charIn := in next. |
|
4804 |
charOut := filterBlock value:charIn. |
|
4805 |
out nextPut:charOut. |
|
4806 |
]. |
|
4807 |
outFile renameTo:inFile. |
|
4808 |
] ensure:[ |
|
4809 |
out notNil ifTrue:[ out close ]. |
|
4810 |
in notNil ifTrue:[ in close ]. |
|
4811 |
outFile delete. |
|
4812 |
] |
|
4813 |
] on:FileStream openErrorSignal do:[:ex| |
|
4814 |
self warn:('Cannot process "%1".' bindWith:fileName baseName allBold). |
|
4815 |
]. |
|
4816 |
] |
|
4817 |
]. |
|
4818 |
self notify:''. |
|
4819 |
! |
|
4820 |
||
3892 | 4821 |
installAllAsAutoloaded |
4822 |
"install all classes found here as autoloaded classes" |
|
4823 |
||
4345 | 4824 |
[ |
4825 |
self withActivityIndicationDo:[ |
|
4343 | 4826 |
self allItemsOfCurrentDirectory do:[:fileItem | |
4827 |
(fileItem hasMimeType and:[fileItem mimeType isSmalltalkSource]) ifTrue:[ |
|
4774 | 4828 |
|
4829 |
self notify:('Install as autoloaded:', fileItem baseName). |
|
4343 | 4830 |
self installAsAutoloaded:(fileItem fileName). |
4831 |
] |
|
4832 |
]. |
|
4523 | 4833 |
self notify:''. |
4345 | 4834 |
] |
4835 |
] fork. |
|
3892 | 4836 |
! |
4837 |
||
4838 |
installAsAutoloaded:aFilename |
|
4839 |
"install aFilename as autoloaded class" |
|
4840 |
||
5971
af337e1a857f
Use #setFilename:forClass:package: to define an abbreviation
Stefan Vogel <sv@exept.de>
parents:
5967
diff
changeset
|
4841 |
|chunks s filename| |
af337e1a857f
Use #setFilename:forClass:package: to define an abbreviation
Stefan Vogel <sv@exept.de>
parents:
5967
diff
changeset
|
4842 |
|
af337e1a857f
Use #setFilename:forClass:package: to define an abbreviation
Stefan Vogel <sv@exept.de>
parents:
5967
diff
changeset
|
4843 |
filename := aFilename asFilename. |
af337e1a857f
Use #setFilename:forClass:package: to define an abbreviation
Stefan Vogel <sv@exept.de>
parents:
5967
diff
changeset
|
4844 |
|
af337e1a857f
Use #setFilename:forClass:package: to define an abbreviation
Stefan Vogel <sv@exept.de>
parents:
5967
diff
changeset
|
4845 |
chunks := ChangeSet fromStream:(s := filename readStream). s close. |
3892 | 4846 |
chunks |
4414 | 4847 |
select:[:eachChunk | eachChunk isClassDefinitionChange] |
5971
af337e1a857f
Use #setFilename:forClass:package: to define an abbreviation
Stefan Vogel <sv@exept.de>
parents:
5967
diff
changeset
|
4848 |
thenDo:[:eachClassChunk | |
af337e1a857f
Use #setFilename:forClass:package: to define an abbreviation
Stefan Vogel <sv@exept.de>
parents:
5967
diff
changeset
|
4849 |
eachClassChunk installAsAutoloadedClassIfPublicWithFilename:filename withoutSuffix baseName |
af337e1a857f
Use #setFilename:forClass:package: to define an abbreviation
Stefan Vogel <sv@exept.de>
parents:
5967
diff
changeset
|
4850 |
]. |
3892 | 4851 |
! |
4852 |
||
4558 | 4853 |
joinSelectedFiles |
4854 |
|selectedFiles numFiles msg outFile outStream| |
|
4855 |
||
4856 |
selectedFiles := self currentFileNameHolder value. |
|
4857 |
(numFiles := selectedFiles size) <= 1 ifTrue:[^ self]. |
|
4858 |
||
4859 |
msg := 'Join each of the %1 files into single file named:\\Attention: order in which files were selected is relevant here !!'. |
|
4860 |
outFile := Dialog |
|
4861 |
request:(msg bindWith:numFiles with:selectedFiles first baseName) withCRs. |
|
4862 |
outFile size == 0 ifTrue:[^ self]. |
|
4863 |
outFile := selectedFiles first directory construct:outFile. |
|
4864 |
||
4865 |
outStream := outFile writeStream. |
|
4866 |
||
4867 |
selectedFiles do:[:fileName | |
|
4868 |
|inStream| |
|
4869 |
||
4870 |
self notify:('Adding:', fileName baseName). |
|
4871 |
inStream := fileName readStream. |
|
4872 |
inStream copyToEndInto:outStream. |
|
4873 |
inStream close. |
|
4874 |
]. |
|
4875 |
outStream close. |
|
4876 |
self notify:''. |
|
4877 |
! |
|
4878 |
||
3892 | 4879 |
loadImageAndPerform:aSelectorOrBlock |
4880 |
||
4881 |
|img path files| |
|
4882 |
||
3982 | 4883 |
files := self currentSelectedFiles. |
3892 | 4884 |
files isEmpty ifTrue:[ ^ self]. |
4885 |
files do:[:fileName | |
|
4414 | 4886 |
path := fileName. |
4887 |
path isDirectory ifFalse:[ |
|
4888 |
img := Image fromFile:(path pathName). |
|
4889 |
img notNil ifTrue:[ |
|
4890 |
aSelectorOrBlock isSymbol ifTrue:[ |
|
4891 |
img perform:aSelectorOrBlock |
|
4892 |
] ifFalse:[ |
|
4893 |
aSelectorOrBlock value:img |
|
4894 |
] |
|
4895 |
] ifFalse:[ |
|
4896 |
Dialog warn:'unknown format: ' , fileName asString |
|
4897 |
] |
|
4898 |
] |
|
3892 | 4899 |
]. |
4900 |
! |
|
4901 |
||
4902 |
openASN1Browser |
|
4903 |
||
4904 |
self openTool:OSI::ASN1Browser |
|
4905 |
! |
|
4906 |
||
4907 |
openAppletViewer |
|
4908 |
|numItems files| |
|
4909 |
||
3982 | 4910 |
files := self currentSelectedFiles. |
3892 | 4911 |
(numItems := files size) > 2 ifTrue:[ |
4414 | 4912 |
(self |
4913 |
confirm:(resources string:'open for each of the %1 items ?' |
|
4914 |
with:numItems)) ifFalse:[^ self]. |
|
3892 | 4915 |
]. |
4916 |
||
4917 |
Java startupJavaSystem. |
|
4918 |
"/ Java markAllClassesUninitialized. |
|
4919 |
"/ Java initAllStaticFields. |
|
4920 |
"/ Java initAllClasses. |
|
4921 |
||
4922 |
files do:[:fileName | |
|
4414 | 4923 |
|p path| |
4924 |
||
4925 |
path := fileName. |
|
4926 |
path isDirectory ifFalse:[ |
|
4927 |
p := Java |
|
4928 |
javaProcessForMainOf:(Java classForName:'sun.applet.AppletViewer') |
|
4929 |
argumentString:path pathName. |
|
4930 |
p resume. |
|
4931 |
] |
|
3892 | 4932 |
]. |
4933 |
! |
|
4934 |
||
4935 |
openCBrowser |
|
6031 | 4936 |
|dir files| |
5880 | 4937 |
|
4938 |
dir := self theSingleSelectedDirectoryOrNil. |
|
4939 |
dir isNil ifTrue:[ ^ self]. |
|
3892 | 4940 |
self withWaitCursorDo:[ |
6031 | 4941 |
files := self currentFileNameHolder value. |
4942 |
files notEmptyOrNil ifTrue:[ |
|
4943 |
CBrowser::Browser openOn:files first. |
|
4944 |
] ifFalse:[ |
|
4945 |
CBrowser::Browser openIn:dir. |
|
4946 |
] |
|
3892 | 4947 |
] |
4948 |
! |
|
4949 |
||
4230 | 4950 |
openChangeSetBrowser |
4951 |
self |
|
4952 |
openTool:ChangeSetBrowser |
|
4953 |
with:#openOnFile: |
|
4954 |
ignoreDirectories:true |
|
4955 |
! |
|
4956 |
||
3892 | 4957 |
openChangesBrowser |
4958 |
"open a change browser on the selected file(s)" |
|
4959 |
||
4960 |
self openTool:(UserPreferences current changesBrowserClass) |
|
4961 |
! |
|
4962 |
||
4963 |
openDiffView |
|
4964 |
"open a diff-view" |
|
4965 |
||
4170 | 4966 |
| name1 name2 text1 text2 d err nm l1 files title defaultName lastFile| |
3892 | 4967 |
|
3982 | 4968 |
files := self currentSelectedFiles. |
3892 | 4969 |
files isEmpty ifTrue:[ |
4629
e8739857466c
show busyCursor while moving/copying files.
Claus Gittinger <cg@exept.de>
parents:
4624
diff
changeset
|
4970 |
Dialog warn:'You have to select a file first'. |
4414 | 4971 |
^ self. |
3892 | 4972 |
]. |
4973 |
(files size == 2) ifTrue:[ |
|
4414 | 4974 |
name1 := files last. |
4975 |
name2 := files first. |
|
3892 | 4976 |
] ifFalse:[ |
4414 | 4977 |
LastFileDiffFile notNil ifTrue:[ |
5960 | 4978 |
| directory | |
4979 |
directory := self currentDirectory. |
|
4980 |
directory notNil ifTrue:[ |
|
4981 |
lastFile := directory asFilename construct:(LastFileDiffFile baseName). |
|
4414 | 4982 |
(lastFile exists and:[lastFile isReadable]) ifTrue:[ |
4983 |
name1 := lastFile. |
|
4984 |
] |
|
4985 |
] |
|
4986 |
]. |
|
4987 |
name2 := files first. |
|
4432 | 4988 |
title := 'Show differences between ', name2 baseName, ' and:'. |
4414 | 4989 |
defaultName := name1 notNil ifTrue:[name1 baseName] ifFalse:[nil]. |
4990 |
name1 := DialogBox |
|
4991 |
requestFileName:title |
|
4992 |
default:defaultName |
|
4993 |
ok:'OK' |
|
5830 | 4994 |
abort:'Compare against File List' |
4414 | 4995 |
pattern:'*' |
4996 |
fromDirectory:(name2 asFilename directory). |
|
3892 | 4997 |
]. |
4998 |
||
4999 |
(name1 isNil or:[name1 asString isEmpty]) ifTrue:[ |
|
4768 | 5000 |
text1 := self getAllFilesAsStrings asStringCollection withTabs. |
4414 | 5001 |
text1 := text1 collect:[:l | l isNil ifTrue:[' '] ifFalse:[l]]. |
5002 |
name1 := nil. |
|
5003 |
l1 := 'browser contents' |
|
3892 | 5004 |
] ifFalse:[ |
4414 | 5005 |
name1 := name1 asFilename. |
5006 |
LastFileDiffFile := name1. |
|
5832 | 5007 |
name1 isReadable ifFalse:[ |
4414 | 5008 |
nm := name1. |
5832 | 5009 |
name1 exists ifFalse:[ |
4629
e8739857466c
show busyCursor while moving/copying files.
Claus Gittinger <cg@exept.de>
parents:
4624
diff
changeset
|
5010 |
err := '"%1" does not exist.'. |
4414 | 5011 |
] ifTrue:[ |
4629
e8739857466c
show busyCursor while moving/copying files.
Claus Gittinger <cg@exept.de>
parents:
4624
diff
changeset
|
5012 |
err := '"%1" is not readable.' |
4414 | 5013 |
]. |
5014 |
]. |
|
5832 | 5015 |
l1 := name1 pathName |
3892 | 5016 |
]. |
5017 |
||
5018 |
err isNil ifTrue:[ |
|
4414 | 5019 |
name2 isReadable ifFalse:[ |
5020 |
nm := name2. |
|
5021 |
name2 exists ifFalse:[ |
|
4629
e8739857466c
show busyCursor while moving/copying files.
Claus Gittinger <cg@exept.de>
parents:
4624
diff
changeset
|
5022 |
err := '"%1" does not exist.'. |
4414 | 5023 |
] ifTrue:[ |
4629
e8739857466c
show busyCursor while moving/copying files.
Claus Gittinger <cg@exept.de>
parents:
4624
diff
changeset
|
5024 |
err := '"%1" is not readable.' |
4414 | 5025 |
]. |
5026 |
]. |
|
3892 | 5027 |
]. |
5028 |
err notNil ifTrue:[ |
|
4629
e8739857466c
show busyCursor while moving/copying files.
Claus Gittinger <cg@exept.de>
parents:
4624
diff
changeset
|
5029 |
Dialog warn:(resources string:err with:nm pathName allBold). |
4414 | 5030 |
^ self |
3892 | 5031 |
]. |
5032 |
||
5033 |
self withWaitCursorDo:[ |
|
4414 | 5034 |
name1 notNil ifTrue:[ |
5035 |
text1 := name1 contents. |
|
5036 |
]. |
|
5037 |
text2 := name2 contents. |
|
5038 |
text1 = text2 ifTrue:[ |
|
4629
e8739857466c
show busyCursor while moving/copying files.
Claus Gittinger <cg@exept.de>
parents:
4624
diff
changeset
|
5039 |
self information:'Same contents.' |
4414 | 5040 |
] ifFalse:[ |
5041 |
d := DiffTextView |
|
5042 |
openOn:text1 label:l1 |
|
5043 |
and:text2 label:name2 pathName. |
|
4629
e8739857466c
show busyCursor while moving/copying files.
Claus Gittinger <cg@exept.de>
parents:
4624
diff
changeset
|
5044 |
d topView label:'File Differences'. |
4414 | 5045 |
] |
3892 | 5046 |
] |
5047 |
! |
|
5048 |
||
5049 |
openEditor |
|
5050 |
self openTool:EditTextView |
|
5051 |
! |
|
5052 |
||
4957 | 5053 |
openGV |
5054 |
self openOSCommandWithFiles:'gv' |
|
5055 |
! |
|
5056 |
||
3892 | 5057 |
openHTMLReader |
5058 |
||
5059 |
self openTool:HTMLDocumentView ignoreDirectories:false |
|
5060 |
! |
|
5061 |
||
5062 |
openImageEditor |
|
5063 |
||
5064 |
[self loadImageAndPerform:#edit] fork |
|
5065 |
! |
|
5066 |
||
5067 |
openImageInspector |
|
5068 |
[self loadImageAndPerform:#inspect] fork |
|
5069 |
! |
|
5070 |
||
5071 |
openImagePreview |
|
5072 |
||
5778 | 5073 |
[ |
5074 |
self |
|
5075 |
loadImageAndPerform: |
|
5076 |
[:img | |
|
5077 |
|i top viewer| |
|
5078 |
||
5079 |
top := StandardSystemView new. |
|
5080 |
||
5081 |
viewer := ImageView origin:0.0@0.0 corner:1.0@1.0 in:top. |
|
5082 |
i := img. |
|
5083 |
top extent:200@200. |
|
5084 |
top label:(img fileName asFilename directory baseName , Filename separator , img fileName asFilename baseName). |
|
5085 |
top openAndWait. |
|
5086 |
||
5087 |
(i width > 200 or:[i height > 200]) ifTrue:[ |
|
5088 |
i := i magnifiedPreservingRatioTo:200@200. |
|
5089 |
]. |
|
5090 |
viewer image:i. |
|
5091 |
]. |
|
3892 | 5092 |
] fork |
5093 |
! |
|
5094 |
||
5095 |
openMP3Player |
|
5096 |
|file| |
|
5097 |
||
3982 | 5098 |
file := self currentSelectedFiles. |
3892 | 5099 |
(file isEmpty) ifTrue:[ |
4414 | 5100 |
^ self. |
3892 | 5101 |
]. |
5102 |
file := file first. |
|
5103 |
(MP3PlayerApplication ? SaugFix::MP3PlayerApplication) playSong:file. |
|
5104 |
! |
|
5105 |
||
4957 | 5106 |
openOSCommandWithFiles:command |
5107 |
|files fileNames| |
|
5108 |
||
5109 |
files := self currentSelectedFiles. |
|
5110 |
(files isEmpty) ifTrue:[ |
|
5111 |
^ self. |
|
5112 |
]. |
|
5113 |
||
5114 |
fileNames := files collect:[:each | |
|
5115 |
'"' , each asFilename pathName , '"' |
|
5116 |
]. |
|
5117 |
||
5118 |
[ |
|
5119 |
OperatingSystem |
|
4959 | 5120 |
executeCommand:command , ' ' , fileNames asStringCollection asString |
5121 |
inDirectory:(files first asFilename directory). |
|
4957 | 5122 |
] fork |
5123 |
! |
|
5124 |
||
4820 | 5125 |
openPDFViewer |
5836
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
5126 |
|files fileNames cmd arg| |
4820 | 5127 |
|
5128 |
files := self currentSelectedFiles. |
|
5129 |
(files isEmpty) ifTrue:[ |
|
5130 |
^ self. |
|
5131 |
]. |
|
5836
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
5132 |
cmd := MIMETypes defaultCommandForMimeType:'application/pdf'. |
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
5133 |
cmd isNil ifTrue:[ |
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
5134 |
Dialog warn:'No viewer has been defined for pdf-files (See MIMETypes initialization).'. |
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
5135 |
^ self. |
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
5136 |
]. |
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
5137 |
|
4820 | 5138 |
fileNames := |
5139 |
files |
|
5140 |
collect: |
|
5141 |
[:each | |
|
5142 |
'"' , each asFilename pathName , '"' |
|
5143 |
]. |
|
5836
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
5144 |
arg := fileNames asStringCollection asStringWith:' '. |
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
5145 |
|
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
5146 |
(cmd includesString:'"%1"') ifTrue:[ |
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
5147 |
cmd := cmd copyReplaceString:'"%1"' withString:'%1' |
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
5148 |
]. |
4820 | 5149 |
|
4950 | 5150 |
[ |
5836
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
5151 |
OperatingSystem executeCommand:(cmd bindWith:arg). |
4950 | 5152 |
] fork |
5836
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
5153 |
|
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
5154 |
"Modified: / 12-05-2004 / 12:31:20 / cg" |
4820 | 5155 |
! |
5156 |
||
4958 | 5157 |
openRP |
5158 |
self openOSCommandWithFiles:'realplay' |
|
5159 |
! |
|
5160 |
||
3892 | 5161 |
openSlideShow |
5880 | 5162 |
|dir| |
5163 |
||
5164 |
dir := self theSingleSelectedDirectoryOrNil. |
|
5165 |
dir isNil ifTrue:[^ self]. |
|
5166 |
||
3892 | 5167 |
CodingExamples_GUI::SlideShow openIn:dir. |
5168 |
! |
|
5169 |
||
5170 |
openSnapshotImageBrowser |
|
4491 | 5171 |
"Sorry, for now, only the old browser can handle snapShotImages." |
5172 |
||
3892 | 5173 |
^ self openTool:SystemBrowser with:#openOnSnapShotImage: ignoreDirectories:true |
5174 |
! |
|
5175 |
||
5176 |
openTerminal |
|
5880 | 5177 |
|dir| |
5178 |
||
5179 |
dir := self theSingleSelectedDirectoryOrHomeDir. |
|
3892 | 5180 |
|
5300 | 5181 |
TerminalApplication notNil ifTrue:[ |
5182 |
TerminalApplication openIn:dir |
|
5183 |
] ifFalse:[ |
|
5184 |
VT100TerminalView openShellIn:dir. |
|
5185 |
]. |
|
3892 | 5186 |
! |
5187 |
||
5188 |
openTool:aToolClass |
|
5189 |
"open a tool on the selected file(s)" |
|
5190 |
||
5191 |
^ self openTool:aToolClass ignoreDirectories:true |
|
5192 |
! |
|
5193 |
||
5194 |
openTool:aToolClass ignoreDirectories:ignoreDirs |
|
5195 |
"open a tool on the selected file(s)" |
|
5196 |
||
5197 |
^ self |
|
4414 | 5198 |
openTool:aToolClass |
5199 |
with:#openOn: |
|
5200 |
ignoreDirectories:ignoreDirs |
|
3892 | 5201 |
! |
5202 |
||
5203 |
openTool:aToolClass with:aSelector ignoreDirectories:ignoreDirs |
|
5204 |
"open a tool on the selected file(s)" |
|
5205 |
||
5206 |
|numItems path tool files| |
|
5207 |
||
5208 |
aToolClass isNil ifTrue:[ |
|
4414 | 5209 |
Dialog warn:'Sorry, that tool seems to be not available'. |
5210 |
^ nil. |
|
3892 | 5211 |
]. |
3982 | 5212 |
files := self currentSelectedFiles. |
3892 | 5213 |
|
5214 |
(numItems := files size) > 2 ifTrue:[ |
|
4414 | 5215 |
(self |
5216 |
confirm:(resources string:'open for each of the %1 items ?' |
|
5217 |
with:numItems)) ifFalse:[^ self]. |
|
3892 | 5218 |
]. |
5219 |
||
5220 |
self withWaitCursorDo:[ |
|
4414 | 5221 |
files do:[:fileName | |
5222 |
(ignoreDirs not or:[fileName isDirectory not]) ifTrue:[ |
|
5223 |
fileName isAbsolute ifTrue:[ |
|
5224 |
path := fileName getName. |
|
5225 |
] ifFalse:[ |
|
5226 |
path := fileName pathName. |
|
5227 |
]. |
|
5228 |
tool := aToolClass perform:aSelector with:path. |
|
5229 |
] |
|
5230 |
]. |
|
3892 | 5231 |
]. |
5232 |
^ tool |
|
5233 |
! |
|
5234 |
||
6022 | 5235 |
openWorkspace |
5236 |
self |
|
5237 |
openTool:WorkspaceApplication |
|
5238 |
with:#openOnFile: |
|
5239 |
ignoreDirectories:true |
|
5240 |
! |
|
5241 |
||
4950 | 5242 |
openXV |
4957 | 5243 |
self openOSCommandWithFiles:'xv' |
4950 | 5244 |
! |
5245 |
||
3892 | 5246 |
openZipTool |
5880 | 5247 |
|zipTool| |
3892 | 5248 |
|
5249 |
(zipTool := self openTool:ZipTool) notNil ifTrue:[ |
|
5880 | 5250 |
zipTool initialExtractDirectory:(self theSingleSelectedDirectoryOrHomeDir). |
3892 | 5251 |
]. |
5252 |
! |
|
5253 |
||
5254 |
readAbbrevFile |
|
5255 |
"read the abbrev file and install classes found there as autoloaded classes" |
|
5256 |
||
5880 | 5257 |
|directories| |
3892 | 5258 |
|
3982 | 5259 |
directories := self currentSelectedDirectories. |
3892 | 5260 |
directories isEmpty ifTrue:[^ self]. |
5261 |
||
5828 | 5262 |
self withWaitCursorDo:[ |
5880 | 5263 |
directories do:[:eachDir | |
5264 |
Smalltalk installAutoloadedClassesFrom:(eachDir construct:'abbrev.stc'). |
|
5265 |
] |
|
5828 | 5266 |
] |
3892 | 5267 |
! |
5268 |
||
5269 |
singleFileFileIn:fileName lazy:lazy |
|
5270 |
"fileIn the selected file(s)" |
|
5271 |
||
4345 | 5272 |
|aStream wasLazy notifyString| |
3892 | 5273 |
|
5274 |
fileName type == #regular ifTrue:[ |
|
4345 | 5275 |
(ObjectFileLoader notNil |
5491 | 5276 |
and:[ObjectFileLoader hasValidBinaryExtension:fileName]) ifTrue:[ |
4345 | 5277 |
AbortOperationRequest catch:[ |
5278 |
|p| |
|
5279 |
||
5280 |
"/ |
|
5281 |
"/ look if already loaded ... then unload first |
|
5282 |
"/ |
|
5283 |
p := fileName pathName. |
|
5284 |
(ObjectFileLoader loadedObjectFiles includes:p) ifTrue:[ |
|
5285 |
(Dialog confirm:(resources |
|
5286 |
string:'%1 is already loaded; load anyway ?' |
|
5287 |
with:p)) ifFalse:[ |
|
5288 |
^ self |
|
5289 |
]. |
|
5290 |
notifyString := 'unloading old ' , p , ' ...'. |
|
5291 |
Transcript showCR:notifyString. |
|
4523 | 5292 |
self notify:notifyString. |
4345 | 5293 |
ObjectFileLoader unloadObjectFile:p. |
5294 |
]. |
|
5295 |
||
5296 |
notifyString := 'loading ' , p , ' ...'. |
|
5297 |
Transcript showCR:notifyString. |
|
4523 | 5298 |
self notify:notifyString. |
4345 | 5299 |
ObjectFileLoader loadObjectFile:p. |
5300 |
Class addInfoRecord:('fileIn ' , fileName asFilename pathName) |
|
5301 |
] |
|
5302 |
] ifFalse:[ ((fileName hasSuffix:'cls') |
|
5303 |
and:[((fileName mimeTypeOfContents ? '') startsWith:'application/x-smalltalk-source') not ]) ifTrue:[ |
|
5304 |
"/ loading a binary class file |
|
4636
08b2b63e3107
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4629
diff
changeset
|
5305 |
aStream := fileName readStreamOrNil. |
4345 | 5306 |
aStream notNil ifTrue:[ |
5307 |
aStream fileInBinary. |
|
5308 |
] |
|
5309 |
] ifFalse:[ |
|
5310 |
((fileName hasSuffix:'class') |
|
5491 | 5311 |
or:[(fileName hasSuffix:'cla')]) ifTrue:[ |
4345 | 5312 |
"/ loading a java class file |
5313 |
JavaClassReader notNil ifTrue:[ |
|
5491 | 5314 |
JavaClassReader loadFile:fileName |
4345 | 5315 |
] |
5316 |
] ifFalse:[ (fileName hasSuffix:'sif') ifTrue:[ |
|
5317 |
"/ loading a sif (smalltalk interchange format) file |
|
5318 |
SmalltalkInterchangeSTXFileInManager autoload. |
|
5319 |
SmalltalkInterchangeFileManager newForFileIn |
|
5320 |
fileName: fileName pathName; |
|
5321 |
fileIn. |
|
5756 | 5322 |
] ifFalse:[ (fileName hasSuffix:'js') ifTrue:[ |
5323 |
"/ loading a javaScript file |
|
5324 |
JavaScriptSourceReader new fileIn:fileName. |
|
4345 | 5325 |
] ifFalse:[ (fileName hasSuffix:'pcl') ifTrue:[ |
5326 |
Parcel isNil ifTrue:[ |
|
5327 |
Dialog warn:'Parcel support not loaded.' |
|
5328 |
] ifFalse:[ |
|
5329 |
Parcel loadParcelFrom: fileName pathName |
|
5330 |
] |
|
5331 |
] ifFalse:[ |
|
5332 |
"/ loading a regular (chunk) or xml source file |
|
5491 | 5333 |
Error handle:[ : ex | |
5334 |
Dialog warn:'Error on file in: ', ex errorString. |
|
5335 |
] do:[ |
|
5336 |
aStream := fileName readStream. |
|
5337 |
[ |
|
5338 |
Class withoutUpdatingChangesDo:[ |
|
5339 |
wasLazy := Compiler compileLazy:lazy. |
|
5948 | 5340 |
Smalltalk fileInStream:aStream. |
5491 | 5341 |
]. |
5342 |
Class addInfoRecord:('fileIn ' , fileName asString) |
|
5343 |
] ensure:[ |
|
5344 |
Compiler compileLazy:wasLazy. |
|
5345 |
aStream close |
|
4345 | 5346 |
] |
5347 |
] |
|
5756 | 5348 |
]]]] |
4345 | 5349 |
]] |
3892 | 5350 |
]. |
4531 | 5351 |
! |
5352 |
||
4558 | 5353 |
splitFile:infile intoPiecesOfSize:kiloBytes |
5354 |
|bytesPerSplit splitIndex bufferSize buffer n |
|
5355 |
inStream outFile outStream remaining remainingInThisOutfile| |
|
5356 |
||
5357 |
bufferSize := 32*1024. |
|
5358 |
||
5359 |
inStream := infile readStream. |
|
5360 |
||
5361 |
bytesPerSplit := kiloBytes * 1024. |
|
5362 |
||
5363 |
remaining := infile fileSize. |
|
5364 |
splitIndex := 1. |
|
5365 |
[remaining > 0] whileTrue:[ |
|
5366 |
outFile := infile pathName , '_' , (splitIndex printString leftPaddedTo:3 with:$0). |
|
5367 |
outStream := outFile asFilename writeStream. |
|
5368 |
remainingInThisOutfile := remaining min:bytesPerSplit. |
|
5369 |
[remainingInThisOutfile > 0] whileTrue:[ |
|
5370 |
buffer := ByteArray new:bufferSize. |
|
5371 |
n := inStream |
|
5372 |
nextBytes:(bufferSize min:remainingInThisOutfile) |
|
5373 |
into:buffer |
|
5374 |
startingAt:1. |
|
5375 |
outStream nextPutBytes:n from:buffer startingAt:1. |
|
5376 |
remainingInThisOutfile := remainingInThisOutfile - n. |
|
5377 |
remaining := remaining - n. |
|
5378 |
]. |
|
5379 |
outStream close. |
|
5380 |
splitIndex := splitIndex + 1. |
|
5381 |
]. |
|
5382 |
inStream close. |
|
5383 |
! |
|
5384 |
||
5385 |
splitSelectedFiles |
|
5386 |
|selectedFiles numFiles msg answer kiloBytes| |
|
5387 |
||
5388 |
selectedFiles := self currentFileNameHolder value. |
|
5389 |
(numFiles := selectedFiles size) == 0 ifTrue:[^ self]. |
|
5390 |
||
5391 |
msg := 'Split %2 into pieces of size (in kB):'. |
|
5392 |
numFiles > 1 ifTrue:[ |
|
5393 |
msg := 'Split each of the %1 files into pieces of size (in kB):'. |
|
5394 |
]. |
|
5395 |
||
5396 |
answer := Dialog |
|
5397 |
request:(msg bindWith:numFiles with:selectedFiles first baseName) withCRs. |
|
5398 |
answer size == 0 ifTrue:[^ self]. |
|
5399 |
kiloBytes := Integer readFrom:answer onError:nil. |
|
5400 |
kiloBytes isNil ifTrue:[^ self]. |
|
5401 |
||
5402 |
selectedFiles do:[:fileName | |
|
5403 |
self notify:('Splitting:', fileName baseName). |
|
5404 |
fileName isDirectory ifFalse:[ |
|
5405 |
self splitFile:fileName intoPiecesOfSize:kiloBytes. |
|
5406 |
] |
|
5407 |
]. |
|
5408 |
self notify:''. |
|
5409 |
! |
|
5410 |
||
4531 | 5411 |
truncateSelectedFilesToZeroSize |
4554 | 5412 |
|selectedFiles numFiles msg| |
4531 | 5413 |
|
5414 |
selectedFiles := self currentFileNameHolder value. |
|
4554 | 5415 |
(numFiles := selectedFiles size) == 0 ifTrue:[^ self]. |
5416 |
||
4930 | 5417 |
msg := 'Really truncate file ''%2'' to zero length ?\\WARNING: contents of file is lost !!\This cannot be undone.'. |
4554 | 5418 |
numFiles > 1 ifTrue:[ |
4930 | 5419 |
msg := 'Really truncate %1 files to zero length ?\\WARNING: contents of files is lost !!\This cannot be undone.'. |
4554 | 5420 |
]. |
4531 | 5421 |
|
5422 |
(Dialog |
|
4930 | 5423 |
confirm:(msg bindWith:numFiles with:selectedFiles first baseName allBold) withCRs |
4531 | 5424 |
initialAnswer:false |
5425 |
) ifFalse:[ |
|
5426 |
^ self |
|
5427 |
]. |
|
5428 |
||
5429 |
selectedFiles do:[:fileName | |
|
5430 |
|s| |
|
5431 |
||
5432 |
self notify:('Truncating:', fileName baseName). |
|
5433 |
fileName isDirectory ifFalse:[ |
|
4636
08b2b63e3107
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4629
diff
changeset
|
5434 |
[ |
08b2b63e3107
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4629
diff
changeset
|
5435 |
s := fileName writeStream. |
08b2b63e3107
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4629
diff
changeset
|
5436 |
s close. |
08b2b63e3107
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4629
diff
changeset
|
5437 |
] on:FileStream openErrorSignal do:[:ex| |
4531 | 5438 |
self warn:('Cannot truncate "%1".' bindWith:fileName baseName allBold). |
4636
08b2b63e3107
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4629
diff
changeset
|
5439 |
]. |
4531 | 5440 |
] |
5441 |
]. |
|
5442 |
self notify:''. |
|
3892 | 5443 |
! ! |
5444 |
||
4849 | 5445 |
!AbstractFileBrowser methodsFor:'menu queries-cvs'! |
3892 | 5446 |
|
5447 |
canCvsAddAndCommit |
|
5448 |
||
3982 | 5449 |
|selectedFiles| |
5450 |
||
5451 |
selectedFiles := self currentSelectedFiles. |
|
5452 |
^ (selectedFiles notEmpty and:[self currentFilesAreInSameDirectory]). |
|
3892 | 5453 |
! |
5454 |
||
5455 |
canRemoveCVSContainer |
|
5356
d08261ab1567
care for nonexisting bookmarks file in open
Claus Gittinger <cg@exept.de>
parents:
5334
diff
changeset
|
5456 |
^ self currentSelectedFiles |
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
5457 |
contains:[:fileName| |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
5458 |
|dirOfFile cvsDir| |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
5459 |
|
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
5460 |
dirOfFile := self getDirWithoutFileName:fileName. |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
5461 |
cvsDir := dirOfFile construct:'CVS'. |
5318 | 5462 |
cvsDir isDirectory |
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
5463 |
]. |
3892 | 5464 |
! ! |
5465 |
||
4849 | 5466 |
!AbstractFileBrowser methodsFor:'menu queries-tools'! |
3892 | 5467 |
|
5468 |
anySTFilesPresent |
|
5469 |
||
5470 |
^ self anyFilesPresentWithSuffix:'st' |
|
5471 |
! |
|
5472 |
||
5473 |
canCreateNewProject |
|
5474 |
||
3982 | 5475 |
| selectedFiles | |
3892 | 5476 |
|
5477 |
self currentFilesAreInSameDirectory ifFalse:[^ false]. |
|
3982 | 5478 |
selectedFiles := self currentSelectedFiles. |
3892 | 5479 |
^ [ |
4414 | 5480 |
((selectedFiles detect:[:fileName| | suffix| |
5481 |
suffix := fileName suffix asLowercase. |
|
5482 |
(suffix = 'prj' or:[suffix = 'st']) |
|
5483 |
] ifNone:[nil]) notNil) |
|
3982 | 5484 |
] |
3892 | 5485 |
! |
5486 |
||
5487 |
canDoTerminal |
|
5488 |
||
5489 |
^ OperatingSystem isUNIXlike |
|
5490 |
or:[OperatingSystem isMSWINDOWSlike] |
|
5491 |
! |
|
5492 |
||
5493 |
canDoTerminalAndSystemIsDOS |
|
5494 |
||
5495 |
^ self canDoTerminal and:[OperatingSystem isMSWINDOWSlike] |
|
5496 |
! |
|
5497 |
||
5498 |
canDoTerminalAndSystemIsUnix |
|
5499 |
||
5500 |
^ self canDoTerminal and:[OperatingSystem isUNIXlike] |
|
5501 |
! |
|
5502 |
||
5503 |
canReadAbbrevFile |
|
5504 |
||
5960 | 5505 |
|currentDirectory| |
3892 | 5506 |
|
5507 |
self currentFilesAreInSameDirectory ifFalse:[^ false]. |
|
5960 | 5508 |
currentDirectory := self currentDirectory. |
5509 |
^ currentDirectory notNil |
|
5510 |
and:[ (currentDirectory construct:'abbrev.stc') exists ] |
|
3892 | 5511 |
! |
5512 |
||
5513 |
canRemoveFromSourcePath |
|
5514 |
||
5515 |
^ false |
|
5516 |
! |
|
5517 |
||
5518 |
hasASN1 |
|
5519 |
^ [ OSI::ASN1Parser notNil |
|
4414 | 5520 |
and:[OSI::ASN1Parser isLoaded]] |
3892 | 5521 |
|
5522 |
! |
|
5523 |
||
5524 |
hasASN1AndSelection |
|
5525 |
^ [ self hasSelection value |
|
4414 | 5526 |
and:[self currentSelectedFiles size > 0 |
5527 |
and:[OSI::ASN1Parser notNil |
|
5528 |
and:[OSI::ASN1Parser isLoaded]]]] |
|
3892 | 5529 |
! |
5530 |
||
5531 |
hasCBrowser |
|
5532 |
^ [ CBrowser::Browser notNil ] |
|
5533 |
! |
|
5534 |
||
5535 |
hasJava |
|
5536 |
||
5537 |
^ [ JavaClassReader notNil |
|
4414 | 5538 |
and:[JavaClassReader isLoaded]] |
3892 | 5539 |
! |
5540 |
||
5541 |
hasJavaAndSelection |
|
5542 |
||
3982 | 5543 |
^ [ self currentSelectedFiles size > 0 |
4414 | 5544 |
and:[JavaClassReader notNil |
5545 |
and:[JavaClassReader isLoaded]]] |
|
3892 | 5546 |
! |
5547 |
||
5548 |
hasMP3Player |
|
5549 |
||
5550 |
^ [ MP3PlayerApplication notNil |
|
4414 | 5551 |
or:[SaugFix::MP3PlayerApplication notNil ]] |
3892 | 5552 |
! |
5553 |
||
5554 |
hasMP3PlayerAndSelection |
|
5555 |
||
3982 | 5556 |
^ [ self currentSelectedFiles size > 0 |
4414 | 5557 |
and:[ self hasMP3Player value]] |
3892 | 5558 |
! |
5559 |
||
5560 |
hasSlideShow |
|
5561 |
||
5562 |
^ [CodingExamples_GUI::SlideShow notNil] |
|
5563 |
! |
|
5564 |
||
5565 |
hasSnapshotSelection |
|
5566 |
||
5567 |
^ [ |
|
4414 | 5568 |
| files | |
5569 |
files := self currentSelectedFiles. |
|
5570 |
((files size == 1) |
|
5571 |
and:[ files first hasSuffix:'img' ]) |
|
3892 | 5572 |
] |
5573 |
! |
|
5574 |
||
5575 |
hasZipFileSelected |
|
5576 |
||
3982 | 5577 |
^ [|sel fileName fn suff| |
5578 |
||
4414 | 5579 |
sel := self currentSelectedFiles. |
5580 |
sel size == 1 ifTrue:[ |
|
5581 |
fileName := sel first. |
|
5582 |
fileName notNil ifTrue:[ |
|
5583 |
suff := fileName suffix asLowercase. |
|
5584 |
suff = 'zip' or:[suff = 'jar'] |
|
5585 |
] ifFalse:[ |
|
5586 |
false |
|
5587 |
] |
|
5588 |
] ifFalse:[ |
|
5589 |
false |
|
5590 |
] |
|
3892 | 5591 |
] |
5592 |
! |
|
5593 |
||
5594 |
javaSupportLoaded |
|
5595 |
||
5596 |
^ false |
|
5597 |
! ! |
|
5598 |
||
3906 | 5599 |
!AbstractFileBrowser methodsFor:'presentation'! |
5600 |
||
5601 |
getModeString:modeBits |
|
5602 |
"convert file-mode bits into a more user-friendly string. |
|
5603 |
This is wrong here - should be moved into OperatingSystem." |
|
5604 |
||
5605 |
^ self getModeString:modeBits |
|
4414 | 5606 |
with:#( 'owner:' $r $w $x |
5607 |
' group:' $r $w $x |
|
5608 |
' others:' $r $w $x ) |
|
3906 | 5609 |
! |
5610 |
||
5611 |
getModeString:modeBits with:texts |
|
5612 |
"convert file-mode bits into a more user-friendly string. |
|
5613 |
This is wrong here - should be moved into OperatingSystem." |
|
5614 |
||
5615 |
|bits modeString| |
|
5616 |
||
5617 |
bits := modeBits bitAnd:8r777. |
|
5618 |
modeString := ''. |
|
5619 |
||
5620 |
#( nil 8r400 8r200 8r100 nil 8r040 8r020 8r010 nil 8r004 8r002 8r001 ) |
|
5621 |
with: texts do:[:bitMask :access | |
|
4414 | 5622 |
|ch| |
5623 |
||
5624 |
bitMask isNil ifTrue:[ |
|
5625 |
modeString := modeString , access |
|
5626 |
] ifFalse:[ |
|
5627 |
(bits bitAnd:bitMask) == 0 ifTrue:[ |
|
5628 |
ch := $- |
|
5629 |
] ifFalse:[ |
|
5630 |
ch := access |
|
5631 |
]. |
|
5632 |
modeString := modeString copyWith:ch |
|
5633 |
] |
|
3906 | 5634 |
]. |
5635 |
^ modeString |
|
5636 |
! ! |
|
5637 |
||
5880 | 5638 |
!AbstractFileBrowser methodsFor:'private'! |
5639 |
||
5640 |
theSingleSelectedDirectoryOrHomeDir |
|
5641 |
|dir| |
|
5642 |
||
5888 | 5643 |
dir := self theSingleSelectedDirectoryOrNil. |
5880 | 5644 |
dir isNil ifTrue:[ dir := Filename homeDirectory]. |
5645 |
^ dir. |
|
5646 |
! |
|
5647 |
||
5648 |
theSingleSelectedDirectoryOrNil |
|
5649 |
|dirs| |
|
5650 |
||
5651 |
dirs := self currentSelectedDirectories. |
|
5652 |
dirs size ~= 1 ifTrue:[ ^ nil]. |
|
5653 |
^ dirs anElement. |
|
5654 |
! ! |
|
5655 |
||
3892 | 5656 |
!AbstractFileBrowser methodsFor:'queries'! |
5657 |
||
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
5658 |
getAllFilesAsStrings |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
5659 |
"raise an error: must be redefined in concrete subclass(es)" |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
5660 |
|
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
5661 |
^ self subclassResponsibility |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
5662 |
! |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
5663 |
|
3906 | 5664 |
getFileInfoStringForFirstSelectedFile:longInfo |
5665 |
"get stat info on selected file - return a string which can be |
|
5666 |
shown in a box" |
|
5667 |
||
5973
0baf6c6b685f
#linkInfo now returns the info also for files that are not a symlink
Stefan Vogel <sv@exept.de>
parents:
5971
diff
changeset
|
5668 |
|selFiles filename fileOutput modeBits modeString s info |
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
5669 |
sizeString fileSize tAccess tModification buffer| |
3906 | 5670 |
|
5671 |
selFiles := self currentFileNameHolder value. |
|
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
5672 |
selFiles size ~~ 1 ifTrue:[ ^ nil]. |
3906 | 5673 |
filename := selFiles first. |
5674 |
||
5755
5e8165d55605
replaced '' writeStream by String writeStream
Claus Gittinger <cg@exept.de>
parents:
5753
diff
changeset
|
5675 |
buffer := Text writeStream. |
4765 | 5676 |
|
5677 |
buffer |
|
5678 |
nextPutAll:'filename: '; |
|
5679 |
nextPutLine:filename asString. |
|
5680 |
||
5360
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
5681 |
buffer nextPutAll:'type: '. |
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
5682 |
|
5973
0baf6c6b685f
#linkInfo now returns the info also for files that are not a symlink
Stefan Vogel <sv@exept.de>
parents:
5971
diff
changeset
|
5683 |
info := filename linkInfo. |
0baf6c6b685f
#linkInfo now returns the info also for files that are not a symlink
Stefan Vogel <sv@exept.de>
parents:
5971
diff
changeset
|
5684 |
info isSymbolicLink ifTrue:[ |
0baf6c6b685f
#linkInfo now returns the info also for files that are not a symlink
Stefan Vogel <sv@exept.de>
parents:
5971
diff
changeset
|
5685 |
filename exists ifFalse:[ |
5360
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
5686 |
buffer nextPutAll:'broken '. |
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
5687 |
]. |
4765 | 5688 |
buffer |
5689 |
nextPutAll:'symbolic link to: '; |
|
5973
0baf6c6b685f
#linkInfo now returns the info also for files that are not a symlink
Stefan Vogel <sv@exept.de>
parents:
5971
diff
changeset
|
5690 |
nextPutLine:info path. |
3906 | 5691 |
] ifFalse:[ |
5973
0baf6c6b685f
#linkInfo now returns the info also for files that are not a symlink
Stefan Vogel <sv@exept.de>
parents:
5971
diff
changeset
|
5692 |
(longInfo and:[info isRegular]) ifTrue:[ |
5360
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
5693 |
fileOutput := filename fileType. |
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
5694 |
]. |
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
5695 |
|
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
5696 |
fileOutput isNil ifTrue:[ |
5973
0baf6c6b685f
#linkInfo now returns the info also for files that are not a symlink
Stefan Vogel <sv@exept.de>
parents:
5971
diff
changeset
|
5697 |
s := info type asString |
5360
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
5698 |
] ifFalse:[ |
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
5699 |
s := 'regular (' , fileOutput , ')' |
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
5700 |
]. |
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
5701 |
buffer nextPutLine:s. |
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
5702 |
]. |
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
5703 |
|
4707
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
5704 |
fileSize := info fileSize. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
5705 |
sizeString := 'size: ', fileSize printString. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
5706 |
longInfo ifTrue:[ |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
5707 |
fileSize > 1024 ifTrue:[ |
4708 | 5708 |
sizeString := sizeString , ' (' , ((fileSize / 1024) asFixedPoint:1) printString , ' K'. |
4707
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
5709 |
fileSize > (1024*1024) ifTrue:[ |
4708 | 5710 |
sizeString := sizeString , ' or ' , ((fileSize / (1024*1024)) asFixedPoint:1) printString , ' M'. |
4707
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
5711 |
]. |
5360
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
5712 |
sizeString := sizeString , ')'. |
4707
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
5713 |
]. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
5714 |
]. |
4765 | 5715 |
buffer nextPutLine:sizeString. |
3906 | 5716 |
|
5717 |
modeBits := info mode. |
|
5718 |
modeString := self getModeString:modeBits. |
|
4765 | 5719 |
|
5720 |
buffer nextPutAll:'access: '; nextPutAll:modeString. |
|
3906 | 5721 |
longInfo ifTrue:[ |
5973
0baf6c6b685f
#linkInfo now returns the info also for files that are not a symlink
Stefan Vogel <sv@exept.de>
parents:
5971
diff
changeset
|
5722 |
buffer nextPutAll:' ('; nextPutAll:(modeBits printStringRadix:8); nextPut:$). |
3906 | 5723 |
]. |
4765 | 5724 |
buffer |
5725 |
cr; |
|
5726 |
nextPutAll:'owner: '; |
|
5727 |
nextPutLine:(OperatingSystem getUserNameFromID:(info uid)). |
|
5728 |
||
3906 | 5729 |
longInfo ifTrue:[ |
4765 | 5730 |
buffer |
5731 |
nextPutAll:'group: '; |
|
5732 |
nextPutLine:(OperatingSystem getGroupNameFromID:(info gid)). |
|
5733 |
||
5734 |
tAccess := info accessTime. |
|
5735 |
buffer |
|
5736 |
nextPutAll:'last access: '; |
|
5973
0baf6c6b685f
#linkInfo now returns the info also for files that are not a symlink
Stefan Vogel <sv@exept.de>
parents:
5971
diff
changeset
|
5737 |
nextPutAll:tAccess asDate printString; |
4765 | 5738 |
space; |
5973
0baf6c6b685f
#linkInfo now returns the info also for files that are not a symlink
Stefan Vogel <sv@exept.de>
parents:
5971
diff
changeset
|
5739 |
nextPutLine:tAccess asTime printString. |
4765 | 5740 |
|
5741 |
tModification := info modificationTime. |
|
5742 |
buffer |
|
5973
0baf6c6b685f
#linkInfo now returns the info also for files that are not a symlink
Stefan Vogel <sv@exept.de>
parents:
5971
diff
changeset
|
5743 |
nextPutAll:'last modification: '; |
0baf6c6b685f
#linkInfo now returns the info also for files that are not a symlink
Stefan Vogel <sv@exept.de>
parents:
5971
diff
changeset
|
5744 |
nextPutAll:tModification asDate printString; |
4765 | 5745 |
space; |
5973
0baf6c6b685f
#linkInfo now returns the info also for files that are not a symlink
Stefan Vogel <sv@exept.de>
parents:
5971
diff
changeset
|
5746 |
nextPutLine:tModification asTime printString. |
3906 | 5747 |
]. |
4765 | 5748 |
^ buffer contents |
3906 | 5749 |
! |
5750 |
||
3892 | 5751 |
initialCommandFor:fileName into:aBox |
5752 |
"set a useful initial command for execute box." |
|
5753 |
||
4496
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
5754 |
self class initialCommandFor:fileName in:Filename currentDirectory intoBox:aBox |
3892 | 5755 |
! |
5756 |
||
5757 |
isAbstractFileBrowser |
|
5758 |
||
5759 |
^ true |
|
5760 |
! |
|
5761 |
||
5762 |
systemIsDOS |
|
5763 |
||
5764 |
^ OperatingSystem isMSDOSlike |
|
5765 |
! |
|
5766 |
||
5767 |
systemIsUnix |
|
5768 |
^ OperatingSystem isUNIXlike |
|
5769 |
! ! |
|
5770 |
||
5771 |
!AbstractFileBrowser methodsFor:'queries-file'! |
|
5772 |
||
5773 |
allItemsOfCurrentDirectory |
|
5009 | 5774 |
self |
4774 | 5775 |
applicationNamed:#DirectoryContentsBrowser |
5009 | 5776 |
ifPresentDo:[:app | ^ app allItemsOfCurrentDirectory]. |
5777 |
||
5778 |
^ nil |
|
3892 | 5779 |
! |
5780 |
||
5781 |
anyFilesPresentWithSuffix:suffix |
|
5782 |
||
4636
08b2b63e3107
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4629
diff
changeset
|
5783 |
|directories| |
3892 | 5784 |
|
5785 |
directories := self currentDirectories value. |
|
4636
08b2b63e3107
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4629
diff
changeset
|
5786 |
directories do:[:dir| |
08b2b63e3107
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4629
diff
changeset
|
5787 |
[ |
5810
4661bf4c3bbf
openErrorSignal arg: always a string
Claus Gittinger <cg@exept.de>
parents:
5789
diff
changeset
|
5788 |
(dir directoryContentsAsFilenamesDo:[:fn | (fn suffix = suffix) ifTrue:[ ^ true]]) |
4636
08b2b63e3107
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4629
diff
changeset
|
5789 |
] on:FileStream openErrorSignal do:[:ex|]. |
3892 | 5790 |
]. |
5791 |
^ false. |
|
5792 |
! |
|
5793 |
||
4771
9290fdb65a5d
#getCommonForCurrentFiles renamed to #commonPrefixOfSelectedFiles
Claus Gittinger <cg@exept.de>
parents:
4769
diff
changeset
|
5794 |
commonPrefixOfSelectedFiles |
4773 | 5795 |
|selFiles stringCol firstPre| |
4771
9290fdb65a5d
#getCommonForCurrentFiles renamed to #commonPrefixOfSelectedFiles
Claus Gittinger <cg@exept.de>
parents:
4769
diff
changeset
|
5796 |
|
9290fdb65a5d
#getCommonForCurrentFiles renamed to #commonPrefixOfSelectedFiles
Claus Gittinger <cg@exept.de>
parents:
4769
diff
changeset
|
5797 |
selFiles := self currentFileNameHolder value. |
9290fdb65a5d
#getCommonForCurrentFiles renamed to #commonPrefixOfSelectedFiles
Claus Gittinger <cg@exept.de>
parents:
4769
diff
changeset
|
5798 |
selFiles isEmpty ifTrue:[^ nil]. |
9290fdb65a5d
#getCommonForCurrentFiles renamed to #commonPrefixOfSelectedFiles
Claus Gittinger <cg@exept.de>
parents:
4769
diff
changeset
|
5799 |
|
4772 | 5800 |
stringCol := selFiles collect:[:file | file asString]. |
4773 | 5801 |
firstPre := stringCol at:1. |
4771
9290fdb65a5d
#getCommonForCurrentFiles renamed to #commonPrefixOfSelectedFiles
Claus Gittinger <cg@exept.de>
parents:
4769
diff
changeset
|
5802 |
stringCol from:2 do:[:el| |
4773 | 5803 |
firstPre := firstPre commonPrefixWith:el. |
4771
9290fdb65a5d
#getCommonForCurrentFiles renamed to #commonPrefixOfSelectedFiles
Claus Gittinger <cg@exept.de>
parents:
4769
diff
changeset
|
5804 |
]. |
4773 | 5805 |
^ firstPre asFilename |
4771
9290fdb65a5d
#getCommonForCurrentFiles renamed to #commonPrefixOfSelectedFiles
Claus Gittinger <cg@exept.de>
parents:
4769
diff
changeset
|
5806 |
! |
9290fdb65a5d
#getCommonForCurrentFiles renamed to #commonPrefixOfSelectedFiles
Claus Gittinger <cg@exept.de>
parents:
4769
diff
changeset
|
5807 |
|
3892 | 5808 |
currentFilesAreInSameDirectory |
5809 |
||
4881
e6fc72aac6e6
multiple select allowed in DirectoryTreeBrowser some changes in DirectoryContentsBrowser
penk
parents:
4880
diff
changeset
|
5810 |
^ self parentDirectoriesOfCurrentFiles size < 2 |
3892 | 5811 |
! |
5812 |
||
5813 |
currentFilesHasDirectories |
|
5814 |
||
5815 |
^ self currentDirectories value notEmpty. |
|
5816 |
! |
|
5817 |
||
3982 | 5818 |
directoriesForFiles:aFileCol |
5819 |
||
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
5820 |
^ (aFileCol collect:[:file| self getDirWithoutFileName:file]) asSet. |
3982 | 5821 |
! |
5822 |
||
3892 | 5823 |
fileListIsEmpty |
5009 | 5824 |
self |
5825 |
applicationNamed:#DirectoryContentsBrowser |
|
5826 |
ifPresentDo:[:appl | ^ appl fileListIsEmpty]. |
|
5827 |
||
5828 |
^ nil. |
|
3892 | 5829 |
! |
5830 |
||
5831 |
fileListIsNotEmpty |
|
5832 |
||
5833 |
^ self fileListIsEmpty not. |
|
5834 |
! |
|
5835 |
||
5836 |
fileName:aFilename1 startsWith:aFilename2 |
|
5837 |
||
5838 |
" check if aFilename2 starts with the same directories like aFilename1 " |
|
5839 |
||
5840 |
| file1 file2 | |
|
5841 |
||
5842 |
aFilename2 isNil ifTrue:[ ^ false]. |
|
3982 | 5843 |
aFilename1 isNil ifTrue:[ ^ false]. |
3892 | 5844 |
file1 := aFilename1 asFilename. |
5845 |
file2 := aFilename2 asFilename. |
|
5846 |
file2 isRootDirectory ifTrue:[ ^ true]. |
|
5847 |
((file1 isDirectory) |
|
5848 |
and:[(file2 isDirectory) |
|
5849 |
and:[file1 directory = file2 directory]]) ifTrue:[ |
|
4414 | 5850 |
^ file1 baseName = file2 baseName |
3892 | 5851 |
]. |
3982 | 5852 |
^ (file1 pathName) startsWith:(file2 pathName) |
3892 | 5853 |
! |
5854 |
||
5855 |
getAllFilesAsStringCollection |
|
5009 | 5856 |
self |
5857 |
applicationNamed:#DirectoryContentsBrowser |
|
5858 |
ifPresentDo:[:appl | ^ appl getAllFilesAsStringCollection]. |
|
5859 |
||
5860 |
^ nil |
|
3892 | 5861 |
! |
5862 |
||
5863 |
getBestDirectory |
|
5864 |
||
5865 |
|selFiles stringCol firstPre| |
|
5866 |
||
5867 |
selFiles := self currentDirectories value. |
|
5868 |
selFiles isEmpty ifTrue:[^ nil]. |
|
5869 |
selFiles size == 1 ifTrue:[^ selFiles first]. |
|
4486 | 5870 |
stringCol := (selFiles collect:[:file| file asString]) asOrderedCollection. |
3892 | 5871 |
firstPre := stringCol at:1. |
5872 |
stringCol from:2 do:[:el| |
|
4414 | 5873 |
firstPre := firstPre commonPrefixWith:el. |
3892 | 5874 |
]. |
5875 |
(firstPre endsWith:(OperatingSystem fileSeparator)) ifTrue:[ |
|
4414 | 5876 |
firstPre removeLast. |
3892 | 5877 |
]. |
5878 |
^ firstPre asFilename |
|
5879 |
! |
|
5880 |
||
5881 |
getDirWithoutFileName:aFileName |
|
5882 |
||
5883 |
| dir | |
|
5884 |
aFileName isNil ifTrue:[ |
|
4414 | 5885 |
^ aFileName. |
3892 | 5886 |
]. |
5887 |
dir := aFileName asFilename. |
|
5888 |
dir isDirectory ifFalse:[ |
|
4414 | 5889 |
dir := dir directory. |
3892 | 5890 |
]. |
5891 |
^ dir. |
|
5892 |
! |
|
5893 |
||
5894 |
getInfoItem |
|
5895 |
"get filename of a description-file (.dir.info, README etc.); |
|
5896 |
This file is automatically shown when a directory is enterred. |
|
5897 |
You can add more names below if you like." |
|
5898 |
||
5880 | 5899 |
|dir| |
5900 |
||
5901 |
dir := self theSingleSelectedDirectoryOrNil. |
|
5902 |
dir isNil ifTrue:[ ^ nil]. |
|
3892 | 5903 |
|
5904 |
#( |
|
5905 |
'.dir.info' |
|
5906 |
'README' |
|
5907 |
'ReadMe' |
|
5908 |
'Readme' |
|
5909 |
'readme' |
|
5910 |
'read.me' |
|
5911 |
'Read.me' |
|
5912 |
'READ.ME' |
|
5913 |
'README.TXT' |
|
5914 |
'readme.txt' |
|
5915 |
'Readme.txt' |
|
5916 |
'Info.txt' |
|
5917 |
'info.txt' |
|
5918 |
'INFO.TXT' |
|
5919 |
) do:[:f | |
|
5883 | 5920 |
|n| |
4414 | 5921 |
|
5880 | 5922 |
n := dir construct:f. |
4414 | 5923 |
(n isReadable and:[n isDirectory not]) ifTrue:[ |
5924 |
^ DirectoryContentsBrowser itemClass fileName:n |
|
5925 |
] |
|
3892 | 5926 |
]. |
5927 |
^ nil |
|
4881
e6fc72aac6e6
multiple select allowed in DirectoryTreeBrowser some changes in DirectoryContentsBrowser
penk
parents:
4880
diff
changeset
|
5928 |
! |
e6fc72aac6e6
multiple select allowed in DirectoryTreeBrowser some changes in DirectoryContentsBrowser
penk
parents:
4880
diff
changeset
|
5929 |
|
e6fc72aac6e6
multiple select allowed in DirectoryTreeBrowser some changes in DirectoryContentsBrowser
penk
parents:
4880
diff
changeset
|
5930 |
parentDirectoriesOfCurrentFiles |
e6fc72aac6e6
multiple select allowed in DirectoryTreeBrowser some changes in DirectoryContentsBrowser
penk
parents:
4880
diff
changeset
|
5931 |
|
e6fc72aac6e6
multiple select allowed in DirectoryTreeBrowser some changes in DirectoryContentsBrowser
penk
parents:
4880
diff
changeset
|
5932 |
^ (self currentFileNameHolder value collect:[:file | file directory]) asSet |
3982 | 5933 |
! ! |
5934 |
||
5935 |
!AbstractFileBrowser methodsFor:'selection'! |
|
5936 |
||
5937 |
currentSelectedDirectories |
|
5938 |
||
5939 |
^ self currentDirectories value. |
|
5940 |
! |
|
5941 |
||
5942 |
currentSelectedFiles |
|
5943 |
||
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
5944 |
^ self currentFileNameHolder value select:[:file | file isDirectory not]. |
3982 | 5945 |
! |
5946 |
||
5947 |
firstSelectedFile |
|
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
5948 |
^ self currentFileNameHolder value |
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
5949 |
detect:[:file | file asFilename isDirectory not] |
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
5950 |
ifNone:[]. |
4414 | 5951 |
! |
5952 |
||
5953 |
hasOnlyFilesSelected |
|
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
5954 |
|
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
5955 |
^ self currentFileNameHolder value conform:[:file | file isDirectory not]. |
4414 | 5956 |
! |
5957 |
||
5958 |
hasTwoFilesSelected |
|
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
5959 |
|
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
5960 |
^ self currentFileNameHolder value size == 2 |
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
5961 |
and:[self hasOnlyFilesSelected] |
3892 | 5962 |
! ! |
5963 |
||
3964 | 5964 |
!AbstractFileBrowser methodsFor:'sorting'! |
5965 |
||
3989 | 5966 |
currentSortOrder |
5967 |
||
5968 |
" returns a Ordered Collection of all directories currently selected |
|
5969 |
if only a file is selected currentDirectories holds the directory of the file |
|
5970 |
" |
|
5971 |
||
4027 | 5972 |
^ self aspectFor:#currentSortOrder ifAbsent:[ Dictionary new asValue ]. |
3989 | 5973 |
! |
5974 |
||
5975 |
sortBlockHolder |
|
5976 |
^ self aspectFor:#sortBlockHolder ifAbsent:[ |
|
5383 | 5977 |
(FileSorter directoriesBeforeFiles:(self sortDirectoriesBeforeFiles value and:[self viewDirsInContentsBrowser value]) |
5978 |
selector:#fileName |
|
5979 |
sortCaseless:self sortCaseless value |
|
5980 |
sortReverse:false) asValue. |
|
3989 | 5981 |
]. |
5982 |
! |
|
5983 |
||
5984 |
sortBlockProperty |
|
5985 |
||
4027 | 5986 |
|
3989 | 5987 |
^ self aspectFor:#sortBlockProperty ifAbsent:[ #baseName asValue ]. |
5988 |
! |
|
5989 |
||
5990 |
sortCaseless |
|
4201 | 5991 |
" aspect for sort caseless " |
3989 | 5992 |
|
5993 |
^ self aspectFor:#sortCaseless ifAbsent:[ |
|
4201 | 5994 |
| holder | |
5995 |
holder := (Filename isCaseSensitive not) asValue. |
|
5996 |
holder |
|
3989 | 5997 |
] |
5998 |
! |
|
5999 |
||
4074 | 6000 |
sortDirectoriesBeforeFiles |
6001 |
||
4201 | 6002 |
" aspect for sort directories always before files" |
4074 | 6003 |
^ self aspectFor:#sortDirectoriesBeforeFiles ifAbsent:[ true asValue ]. |
6004 |
! |
|
6005 |
||
3989 | 6006 |
sortFileListsBy:instanceName |
6007 |
||
6008 |
self sortFileListsBy:instanceName withReverse:true |
|
6009 |
! |
|
6010 |
||
6011 |
sortFileListsBy:instanceName withReverse:aBoolean |
|
6012 |
||
5383 | 6013 |
| aSymbol sortCaselessLocal currentSortOrder sorter| |
3964 | 6014 |
|
6015 |
aSymbol := instanceName asSymbol. |
|
4027 | 6016 |
self sortBlockProperty setValue:instanceName asSymbol. |
4151 | 6017 |
sortCaselessLocal := self sortCaseless value. |
4027 | 6018 |
currentSortOrder := self currentSortOrder value. |
3989 | 6019 |
currentSortOrder isEmpty ifTrue:[ |
4343 | 6020 |
currentSortOrder at:#column put:aSymbol. |
6021 |
currentSortOrder at:#reverse put:false. |
|
6022 |
currentSortOrder at:#sortCaseless put:sortCaselessLocal. |
|
3964 | 6023 |
] ifFalse:[ |
4343 | 6024 |
(currentSortOrder at:#sortCaseless) ~= sortCaselessLocal ifTrue:[ |
6025 |
"/ sort caseless changed |
|
6026 |
currentSortOrder at:#sortCaseless put:sortCaselessLocal. |
|
6027 |
] ifFalse:[ |
|
6028 |
(currentSortOrder at:#column) = aSymbol ifTrue:[ |
|
6029 |
"/ same column like before - change sort order ifReverse is true |
|
6030 |
aBoolean ifTrue:[ |
|
6031 |
| isReverse | |
|
6032 |
isReverse := currentSortOrder at:#reverse. |
|
6033 |
currentSortOrder at:#reverse put:(isReverse not). |
|
6034 |
]. |
|
6035 |
] ifFalse:[ |
|
6036 |
"/ another column - remark column |
|
6037 |
currentSortOrder at:#column put:aSymbol. |
|
6038 |
] |
|
6039 |
] |
|
3964 | 6040 |
]. |
4027 | 6041 |
self currentSortOrder changed. |
5383 | 6042 |
sorter := FileSorter directoriesBeforeFiles:(self sortDirectoriesBeforeFiles value and:[self viewDirsInContentsBrowser value]) |
6043 |
selector:instanceName |
|
6044 |
sortCaseless:sortCaselessLocal |
|
6045 |
sortReverse:(currentSortOrder at:#reverse). |
|
6046 |
self sortBlockHolder value:sorter. |
|
3964 | 6047 |
! ! |
6048 |
||
3892 | 6049 |
!AbstractFileBrowser methodsFor:'startup & release'! |
6050 |
||
6051 |
makeDependent |
|
4074 | 6052 |
self filterModel addDependent:self. |
4004 | 6053 |
self currentFileNameHolder addDependent:self. |
4074 | 6054 |
self sortDirectoriesBeforeFiles addDependent:self. |
4004 | 6055 |
self sortCaseless addDependent:self. |
4011 | 6056 |
self showHiddenFiles addDependent:self. |
4368
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
6057 |
self rootHolder addDependent:self. |
3892 | 6058 |
! |
6059 |
||
6060 |
masterApplication:anApplication |
|
6061 |
||
6062 |
masterApplication isNil ifTrue:[ |
|
4414 | 6063 |
(anApplication notNil and:[anApplication askFor:#isAbstractFileBrowser]) ifTrue:[ |
6064 |
aspects := anApplication aspects |
|
6065 |
] ifFalse:[ |
|
6066 |
aspects isNil ifTrue:[ |
|
6067 |
aspects := IdentityDictionary new. |
|
6068 |
aspects at:#applications put:(IdentityDictionary new). |
|
6069 |
] |
|
6070 |
]. |
|
6071 |
self applications at:(self className) put:self. |
|
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
6072 |
"/ self makeDependent. |
3892 | 6073 |
]. |
3952 | 6074 |
^ super masterApplication:anApplication. |
3892 | 6075 |
! |
6076 |
||
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
6077 |
postBuildWith:aBuilder |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
6078 |
self makeDependent. |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
6079 |
super postBuildWith:aBuilder. |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
6080 |
! |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
6081 |
|
3892 | 6082 |
postOpenWith:aBuilder |
6083 |
||
6084 |
super postOpenWith:aBuilder. |
|
6085 |
! ! |
|
6086 |
||
6087 |
!AbstractFileBrowser::Clipboard methodsFor:'accessing'! |
|
6088 |
||
6089 |
files |
|
6090 |
"return the value of the instance variable 'files' (automatically generated)" |
|
6091 |
||
6092 |
^ files |
|
6093 |
! |
|
6094 |
||
6095 |
files:something |
|
6096 |
"set the value of the instance variable 'files' (automatically generated)" |
|
6097 |
||
6098 |
files := something. |
|
6099 |
! |
|
6100 |
||
6101 |
method |
|
6102 |
"return the value of the instance variable 'method' (automatically generated)" |
|
6103 |
||
6104 |
^ method |
|
6105 |
! |
|
6106 |
||
6107 |
method:something |
|
6108 |
"set the value of the instance variable 'method' (automatically generated)" |
|
6109 |
||
6110 |
method := something. |
|
6111 |
! ! |
|
6112 |
||
6113 |
!AbstractFileBrowser::CodeExecutionLock methodsFor:'accessing'! |
|
6114 |
||
6115 |
locked |
|
6116 |
"return the value of the instance variable 'locked' (automatically generated)" |
|
6117 |
||
6118 |
locked isNil ifTrue:[ |
|
4414 | 6119 |
locked := false. |
3892 | 6120 |
]. |
6121 |
^ locked |
|
6122 |
! ! |
|
6123 |
||
6124 |
!AbstractFileBrowser::CodeExecutionLock methodsFor:'actions'! |
|
6125 |
||
6126 |
doIfUnLocked:aBlock |
|
6127 |
||
6128 |
self locked ifFalse:[ |
|
4414 | 6129 |
aBlock value. |
3892 | 6130 |
]. |
6131 |
! |
|
6132 |
||
6133 |
doLocked:aBlock |
|
6134 |
||
6135 |
locked := true. |
|
4004 | 6136 |
aBlock ensure:[ |
4414 | 6137 |
locked := false. |
4004 | 6138 |
] |
3892 | 6139 |
! ! |
6140 |
||
3952 | 6141 |
!AbstractFileBrowser::DirectoryHistory class methodsFor:'defaults'! |
6142 |
||
6143 |
historySize |
|
3892 | 6144 |
|
6145 |
^ 20 |
|
6146 |
! ! |
|
6147 |
||
4032 | 6148 |
!AbstractFileBrowser::DirectoryHistory class methodsFor:'new'! |
6149 |
||
6150 |
new |
|
6151 |
||
6152 |
^ super new initialize. |
|
6153 |
! ! |
|
6154 |
||
3892 | 6155 |
!AbstractFileBrowser::DirectoryHistory methodsFor:'actions'! |
6156 |
||
3952 | 6157 |
addToHistory:aPath |
6158 |
| item| |
|
6159 |
||
6160 |
item := self getItemFor:aPath. |
|
4347 | 6161 |
self backForwardListAdd:aPath. |
3952 | 6162 |
item isNil ifTrue:[ |
4347 | 6163 |
" not already in history" |
6164 |
self size >= self class historySize ifTrue:[ |
|
6165 |
self removeLast. |
|
6166 |
]. |
|
6167 |
item := DirectoryHistoryItem path:aPath. |
|
6168 |
self addFirst:item |
|
3952 | 6169 |
] ifFalse:[ |
4347 | 6170 |
"already been there before; move the entry to |
6171 |
the beginning, so it will fall out later." |
|
6172 |
self remove:item. |
|
6173 |
self addFirst:item |
|
3892 | 6174 |
]. |
3952 | 6175 |
! |
6176 |
||
4347 | 6177 |
backForwardListAdd:aPath |
6178 |
||
6179 |
|pathIndex| |
|
6180 |
||
6181 |
pathIndex := backForwardList indexOf:aPath. |
|
6182 |
pathIndex == 0 ifTrue:[ |
|
6183 |
" a new path comes in remove forward paths " |
|
6184 |
(backForwardList size) > backForwardIndex ifTrue:[ |
|
6185 |
backForwardList removeFromIndex:(backForwardIndex + 1) toIndex:(backForwardList size). |
|
6186 |
]. |
|
6187 |
] ifFalse:[ |
|
6188 |
backForwardList remove:aPath. |
|
6189 |
pathIndex <= backForwardIndex ifTrue:[ |
|
6190 |
backForwardIndex := backForwardIndex - 1. |
|
6191 |
] |
|
4022 | 6192 |
]. |
4347 | 6193 |
backForwardList add:aPath afterIndex:backForwardIndex. |
6194 |
backForwardIndex := backForwardIndex + 1. |
|
6195 |
backForwardIndex > self class historySize ifTrue:[ |
|
6196 |
backForwardList removeFirst. |
|
6197 |
backForwardIndex := backForwardIndex - 1. |
|
3892 | 6198 |
]. |
4347 | 6199 |
! |
6200 |
||
6201 |
goBackward |
|
4288 | 6202 |
"return the first path of the backward list; |
6203 |
remove it from the back list and add it ti the forward list." |
|
4022 | 6204 |
|
4347 | 6205 |
|retPath| |
6206 |
||
6207 |
self canBackward ifTrue:[ |
|
6208 |
retPath := backForwardList at:(backForwardIndex - 1). |
|
6209 |
backForwardIndex := backForwardIndex - 1. |
|
4288 | 6210 |
]. |
4022 | 6211 |
^ retPath. |
6212 |
! |
|
6213 |
||
6214 |
goForward |
|
4288 | 6215 |
"return the first path of the forward list; |
6216 |
remove it from the list." |
|
4022 | 6217 |
|
4347 | 6218 |
|retPath| |
6219 |
||
6220 |
self canForward ifTrue:[ |
|
6221 |
retPath := backForwardList at:backForwardIndex + 1. |
|
6222 |
backForwardIndex := backForwardIndex + 1. |
|
4288 | 6223 |
]. |
4022 | 6224 |
^ retPath. |
6225 |
! |
|
6226 |
||
6227 |
resetForwardBackward |
|
6228 |
||
4347 | 6229 |
self initialize |
4022 | 6230 |
! |
6231 |
||
6232 |
setPosition:aPosition for:aPath |
|
6233 |
||
6234 |
self do:[:item| |
|
4414 | 6235 |
item path = aPath ifTrue:[ |
6236 |
item position:aPosition. |
|
6237 |
] |
|
4022 | 6238 |
]. |
3892 | 6239 |
! ! |
6240 |
||
4870 | 6241 |
!AbstractFileBrowser::DirectoryHistory methodsFor:'initialization'! |
4032 | 6242 |
|
6243 |
initialize |
|
6244 |
||
4347 | 6245 |
backForwardList := OrderedCollection new. |
6246 |
self reverseDo:[:el| |
|
6247 |
backForwardList add:el path. |
|
6248 |
]. |
|
6249 |
backForwardIndex := backForwardList size. |
|
4032 | 6250 |
! ! |
6251 |
||
3892 | 6252 |
!AbstractFileBrowser::DirectoryHistory methodsFor:'queries'! |
6253 |
||
4288 | 6254 |
canBackward |
4347 | 6255 |
|
6256 |
^ backForwardIndex > 1 |
|
4288 | 6257 |
! |
6258 |
||
3892 | 6259 |
canForward |
4347 | 6260 |
|
6261 |
^ (backForwardList size >= (backForwardIndex + 1)) |
|
6262 |
! |
|
6263 |
||
6264 |
getBackCollection |
|
6265 |
||
6266 |
| backCol | |
|
6267 |
||
6268 |
backCol := OrderedCollection new. |
|
6269 |
self canBackward ifTrue:[ |
|
6270 |
| tmpCol | |
|
6271 |
tmpCol := backForwardList copyTo:backForwardIndex - 1. |
|
6272 |
tmpCol reverseDo:[ :el| |
|
6273 |
backCol add:el. |
|
6274 |
] |
|
6275 |
]. |
|
6276 |
^ backCol |
|
3952 | 6277 |
! |
6278 |
||
6279 |
getForwardCollection |
|
6280 |
||
4347 | 6281 |
| forwCol | |
6282 |
||
6283 |
forwCol := OrderedCollection new. |
|
6284 |
self canForward ifTrue:[ |
|
6285 |
forwCol := backForwardList copyFrom:(backForwardIndex + 1) |
|
6286 |
]. |
|
6287 |
^ forwCol |
|
3952 | 6288 |
! |
6289 |
||
6290 |
getItemFor:aPath |
|
6291 |
||
6292 |
self do:[:item| item path = aPath ifTrue:[^ item]]. |
|
6293 |
^ nil. |
|
6294 |
! |
|
6295 |
||
6296 |
getPositionFor:aPath |
|
6297 |
||
6298 |
|item| |
|
6299 |
||
6300 |
item := self getItemFor:aPath. |
|
6301 |
||
6302 |
item notNil ifTrue:[ |
|
4414 | 6303 |
^ item position. |
3952 | 6304 |
]. |
6305 |
^ nil |
|
6306 |
! |
|
6307 |
||
6308 |
includesPath:aPath |
|
6309 |
||
6310 |
self do:[:item| item path = aPath ifTrue:[^ true]]. |
|
6311 |
^ false. |
|
4347 | 6312 |
! |
6313 |
||
6314 |
nextBackwardItem |
|
6315 |
"return the first path of the backward list" |
|
6316 |
||
6317 |
|retPath| |
|
6318 |
||
6319 |
self canBackward ifTrue:[ |
|
6320 |
retPath := backForwardList at:backForwardIndex. |
|
6321 |
]. |
|
6322 |
^ retPath. |
|
6323 |
! |
|
6324 |
||
6325 |
nextForwardItem |
|
6326 |
"return the first path of the forward list" |
|
6327 |
||
6328 |
|retPath| |
|
6329 |
||
6330 |
self canForward ifTrue:[ |
|
6331 |
retPath := backForwardList at:backForwardIndex + 1. |
|
6332 |
]. |
|
6333 |
^ retPath. |
|
3952 | 6334 |
! ! |
6335 |
||
6336 |
!AbstractFileBrowser::DirectoryHistory::DirectoryHistoryItem class methodsFor:'instance creation'! |
|
6337 |
||
6338 |
path:aPath |
|
6339 |
||
6340 |
^ self new path:aPath |
|
6341 |
! ! |
|
6342 |
||
6343 |
!AbstractFileBrowser::DirectoryHistory::DirectoryHistoryItem methodsFor:'accessing'! |
|
6344 |
||
6345 |
path |
|
6346 |
"return the value of the instance variable 'path' (automatically generated)" |
|
6347 |
||
6348 |
^ path |
|
6349 |
! |
|
6350 |
||
6351 |
path:something |
|
6352 |
"set the value of the instance variable 'path' (automatically generated)" |
|
6353 |
||
6354 |
path := something. |
|
6355 |
! |
|
6356 |
||
6357 |
position |
|
6358 |
"return the value of the instance variable 'position' (automatically generated)" |
|
6359 |
||
6360 |
^ position |
|
6361 |
! |
|
6362 |
||
6363 |
position:something |
|
6364 |
"set the value of the instance variable 'position' (automatically generated)" |
|
6365 |
||
6366 |
position := something. |
|
6367 |
! |
|
6368 |
||
6369 |
printString |
|
6370 |
||
6371 |
^ self path asString |
|
3892 | 6372 |
! ! |
6373 |
||
4915 | 6374 |
!AbstractFileBrowser::FilenameHistory class methodsFor:'accessing-attributes'! |
3892 | 6375 |
|
4337
f2eed806e854
change first letter uppercase methods on class side to lowercase ones
penk
parents:
4317
diff
changeset
|
6376 |
filenameHistorySize |
3892 | 6377 |
|
6378 |
^ 20 |
|
6379 |
! ! |
|
6380 |
||
6381 |
!AbstractFileBrowser::FilenameHistory methodsFor:'adding & removing'! |
|
6382 |
||
5242
04616d3a672c
history fixed (only kept the oldest items, instead of the newest ones)
Claus Gittinger <cg@exept.de>
parents:
5162
diff
changeset
|
6383 |
add:aFileItem |
04616d3a672c
history fixed (only kept the oldest items, instead of the newest ones)
Claus Gittinger <cg@exept.de>
parents:
5162
diff
changeset
|
6384 |
(self includes:aFileItem) ifTrue:[ |
04616d3a672c
history fixed (only kept the oldest items, instead of the newest ones)
Claus Gittinger <cg@exept.de>
parents:
5162
diff
changeset
|
6385 |
self remove:aFileItem. |
04616d3a672c
history fixed (only kept the oldest items, instead of the newest ones)
Claus Gittinger <cg@exept.de>
parents:
5162
diff
changeset
|
6386 |
]. |
04616d3a672c
history fixed (only kept the oldest items, instead of the newest ones)
Claus Gittinger <cg@exept.de>
parents:
5162
diff
changeset
|
6387 |
self addFirst:aFileItem. |
3892 | 6388 |
! ! |
6389 |
||
6390 |
!AbstractFileBrowser::SaveAspectItem class methodsFor:'instance creation'! |
|
6391 |
||
6392 |
withValue:aValue isHolder:aBoolean |
|
6393 |
||
6394 |
| instance | |
|
6395 |
||
6396 |
instance := self basicNew. |
|
6397 |
instance value:aValue. |
|
6398 |
instance isHolder:aBoolean. |
|
6399 |
^ instance |
|
6400 |
! ! |
|
6401 |
||
6402 |
!AbstractFileBrowser::SaveAspectItem methodsFor:'accessing'! |
|
6403 |
||
6404 |
isHolder |
|
6405 |
"return the value of the instance variable 'isHolder' (automatically generated)" |
|
6406 |
||
6407 |
^ isHolder |
|
6408 |
! |
|
6409 |
||
6410 |
isHolder:something |
|
6411 |
"set the value of the instance variable 'isHolder' (automatically generated)" |
|
6412 |
||
6413 |
isHolder := something. |
|
6414 |
! |
|
6415 |
||
6416 |
value |
|
6417 |
"return the value of the instance variable 'value' (automatically generated)" |
|
6418 |
||
6419 |
^ value |
|
6420 |
! |
|
6421 |
||
6422 |
value:something |
|
6423 |
"set the value of the instance variable 'value' (automatically generated)" |
|
6424 |
||
6425 |
value := something. |
|
6426 |
! ! |
|
6427 |
||
6428 |
!AbstractFileBrowser class methodsFor:'documentation'! |
|
6429 |
||
6430 |
version |
|
6095 | 6431 |
^ '$Header: /cvs/stx/stx/libtool/AbstractFileBrowser.st,v 1.264 2004-10-16 12:58:31 cg Exp $' |
3892 | 6432 |
! ! |