author | Claus Gittinger <cg@exept.de> |
Fri, 06 Nov 2009 12:15:29 +0100 | |
changeset 9206 | 7ed728324dbf |
parent 9173 | 5d01c91bcfd6 |
child 9267 | a8afd9424514 |
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 |
" |
|
3892 | 12 |
"{ Package: 'stx:libtool' }" |
13 |
||
14 |
ApplicationModel subclass:#AbstractFileBrowser |
|
4959 | 15 |
instanceVariableNames:'aspects' |
16 |
classVariableNames:'DirectoryHistory RuntimeAspects DirectoryBookmarks |
|
17 |
LastEnforcedNameSpace CommandHistory DefaultCommandPerSuffix |
|
18 |
CommandHistorySize LastFileDiffFile DefaultFilters RootHolder |
|
5880 | 19 |
LastFileSelection LastMoveDestination LastScriptBlockString' |
4959 | 20 |
poolDictionaries:'' |
21 |
category:'Interface-Tools-File' |
|
3892 | 22 |
! |
23 |
||
24 |
AbstractFileBrowser class instanceVariableNames:'DisabledCursorImage EnabledCursorImage' |
|
25 |
||
26 |
" |
|
27 |
The following class instance variables are inherited by this class: |
|
28 |
||
4959 | 29 |
ApplicationModel - ClassResources |
30 |
Model - |
|
31 |
Object - |
|
3892 | 32 |
" |
33 |
! |
|
34 |
||
35 |
Object subclass:#Clipboard |
|
4959 | 36 |
instanceVariableNames:'method files' |
37 |
classVariableNames:'' |
|
38 |
poolDictionaries:'' |
|
39 |
privateIn:AbstractFileBrowser |
|
3892 | 40 |
! |
41 |
||
42 |
Object subclass:#CodeExecutionLock |
|
4959 | 43 |
instanceVariableNames:'locked' |
44 |
classVariableNames:'' |
|
45 |
poolDictionaries:'' |
|
46 |
privateIn:AbstractFileBrowser |
|
3892 | 47 |
! |
48 |
||
4366 | 49 |
List subclass:#DirectoryHistory |
4959 | 50 |
instanceVariableNames:'forwardList backList lastWasForwardPath lastBackPath lastAddPath |
6369 | 51 |
backForwardList backForwardIndex historySize' |
4959 | 52 |
classVariableNames:'HistorySize' |
53 |
poolDictionaries:'' |
|
54 |
privateIn:AbstractFileBrowser |
|
3952 | 55 |
! |
56 |
||
57 |
Object subclass:#DirectoryHistoryItem |
|
4959 | 58 |
instanceVariableNames:'path position' |
59 |
classVariableNames:'' |
|
60 |
poolDictionaries:'' |
|
61 |
privateIn:AbstractFileBrowser::DirectoryHistory |
|
3892 | 62 |
! |
63 |
||
64 |
OrderedSet subclass:#FilenameHistory |
|
4959 | 65 |
instanceVariableNames:'' |
66 |
classVariableNames:'' |
|
67 |
poolDictionaries:'' |
|
68 |
privateIn:AbstractFileBrowser |
|
3892 | 69 |
! |
70 |
||
71 |
Object subclass:#SaveAspectItem |
|
4959 | 72 |
instanceVariableNames:'value isHolder' |
73 |
classVariableNames:'' |
|
74 |
poolDictionaries:'' |
|
75 |
privateIn:AbstractFileBrowser |
|
3892 | 76 |
! |
77 |
||
5140 | 78 |
!AbstractFileBrowser class methodsFor:'documentation'! |
79 |
||
80 |
copyright |
|
81 |
" |
|
82 |
COPYRIGHT (c) 2002 by eXept Software AG |
|
83 |
All Rights Reserved |
|
84 |
||
85 |
This software is furnished under a license and may be used |
|
86 |
only in accordance with the terms of that license and with the |
|
87 |
inclusion of the above copyright notice. This software may not |
|
88 |
be provided or otherwise made available to, or used by, any |
|
89 |
other person. No title to or ownership of the software is |
|
90 |
hereby transferred. |
|
91 |
" |
|
5967 | 92 |
! |
93 |
||
94 |
documentation |
|
95 |
" |
|
96 |
[Author:] |
|
97 |
Christian Penk |
|
9111
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
98 |
|
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
99 |
Notice: this certainly needs a redesign - all those abstract-abstract classes which |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
100 |
define stuff which is only needed in some parts makes this hard to understand. |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
101 |
Especially the fact, that AbstractFileBrowser defines things both as abstract superclass |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
102 |
and as a container is almost incomprehensable... |
5967 | 103 |
" |
5140 | 104 |
! ! |
3892 | 105 |
|
4672
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
106 |
!AbstractFileBrowser class methodsFor:'accessing'! |
3952 | 107 |
|
4368
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
108 |
currentSelection |
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
109 |
|
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
110 |
LastFileSelection isNil ifTrue:[ |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
111 |
LastFileSelection := #(). |
4368
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
112 |
]. |
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
113 |
^ LastFileSelection |
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 |
|
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
116 |
currentSelection:aFilenameCol |
6589 | 117 |
aFilenameCol notEmptyOrNil ifTrue:[ |
118 |
LastFileSelection := aFilenameCol collect:[:file | file asFilename] |
|
119 |
] |
|
4368
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
120 |
! |
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
121 |
|
3952 | 122 |
directoryHistory |
123 |
||
124 |
DirectoryHistory isNil ifTrue:[ |
|
4414 | 125 |
DirectoryHistory := self directoryHistoryClass new. |
3964 | 126 |
"/ DirectoryHistory inspect. |
3952 | 127 |
]. |
128 |
^ DirectoryHistory |
|
129 |
! |
|
130 |
||
131 |
resetClassVars |
|
132 |
DirectoryHistory := nil. |
|
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
133 |
LastFileSelection := nil. |
5936 | 134 |
|
135 |
" |
|
136 |
AbstractFileBrowser resetClassVars |
|
137 |
" |
|
4368
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 |
|
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
140 |
rootHolder |
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
141 |
|
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
142 |
^ RootHolder |
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
143 |
! |
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
144 |
|
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
145 |
rootHolder:aRoot |
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
146 |
|
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
147 |
RootHolder := aRoot |
3952 | 148 |
! ! |
149 |
||
4915 | 150 |
!AbstractFileBrowser class methodsFor:'accessing-bookmarks'! |
4672
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
151 |
|
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
152 |
addBookmark:aDirectoryPath |
6114
36fb19194510
Rename Base64Coder>>#decodingOf: to #decode:
Stefan Vogel <sv@exept.de>
parents:
6113
diff
changeset
|
153 |
"add aDirectoryPath to the list of our known bookmarks. |
36fb19194510
Rename Base64Coder>>#decodingOf: to #decode:
Stefan Vogel <sv@exept.de>
parents:
6113
diff
changeset
|
154 |
Do not add duplicates." |
36fb19194510
Rename Base64Coder>>#decodingOf: to #decode:
Stefan Vogel <sv@exept.de>
parents:
6113
diff
changeset
|
155 |
|
36fb19194510
Rename Base64Coder>>#decodingOf: to #decode:
Stefan Vogel <sv@exept.de>
parents:
6113
diff
changeset
|
156 |
|bookmarks| |
4672
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
157 |
|
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
158 |
bookmarks := self directoryBookmarks. |
6114
36fb19194510
Rename Base64Coder>>#decodingOf: to #decode:
Stefan Vogel <sv@exept.de>
parents:
6113
diff
changeset
|
159 |
(bookmarks includes:aDirectoryPath) ifFalse:[ |
36fb19194510
Rename Base64Coder>>#decodingOf: to #decode:
Stefan Vogel <sv@exept.de>
parents:
6113
diff
changeset
|
160 |
bookmarks add:aDirectoryPath asFilename. |
4672
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
161 |
]. |
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
162 |
! |
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
163 |
|
8013 | 164 |
bookmarksFrom:aFileNameOrString |
165 |
|bookmarks s fileName| |
|
166 |
||
167 |
fileName := aFileNameOrString asFilename. |
|
168 |
[ |
|
169 |
s := fileName readStream. |
|
170 |
] on:OpenError do:[:ex| |
|
171 |
^ nil. |
|
172 |
]. |
|
173 |
||
174 |
bookmarks := OrderedCollection new. |
|
175 |
[s atEnd] whileFalse:[ |
|
176 |
bookmarks add:(Base64Coder decode:s nextLine) asString. |
|
177 |
]. |
|
178 |
s close. |
|
179 |
||
180 |
^ bookmarks |
|
181 |
! |
|
182 |
||
4679 | 183 |
defaultBookMarksFileDirectory |
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
184 |
^ Filename homeDirectory |
4679 | 185 |
! |
186 |
||
187 |
defaultBookMarksFilename |
|
188 |
^ '.fileBrowserBookmarks' |
|
189 |
! |
|
190 |
||
191 |
directoryBookmarks |
|
192 |
DirectoryBookmarks isNil ifTrue:[ |
|
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
193 |
self loadBookmarksFrom:(self defaultBookMarksFileDirectory construct:self defaultBookMarksFilename). |
4679 | 194 |
|
195 |
DirectoryBookmarks isEmptyOrNil ifTrue:[ |
|
196 |
DirectoryBookmarks := OrderedCollection new. |
|
197 |
DirectoryBookmarks add:Filename homeDirectory asAbsoluteFilename. |
|
198 |
DirectoryBookmarks add:Filename currentDirectory asAbsoluteFilename. |
|
199 |
] |
|
200 |
]. |
|
201 |
^ DirectoryBookmarks |
|
202 |
||
203 |
" |
|
5438
fa19d526d85d
directoryBookmarks must be stored without lineLimit (see base64 encoder)
Claus Gittinger <cg@exept.de>
parents:
5437
diff
changeset
|
204 |
DirectoryBookmarks := nil. |
fa19d526d85d
directoryBookmarks must be stored without lineLimit (see base64 encoder)
Claus Gittinger <cg@exept.de>
parents:
5437
diff
changeset
|
205 |
self directoryBookmarks. |
4679 | 206 |
" |
207 |
! |
|
208 |
||
8013 | 209 |
directoryBookmarks: collectionOfFilenames |
210 |
||
211 |
DirectoryBookmarks := collectionOfFilenames. |
|
212 |
self saveBookmarksInDefaultBookmarksFile. |
|
213 |
! |
|
214 |
||
215 |
editBookmarksWithDefault: aFilenameOrNil |
|
216 |
||
217 |
| oldBookmarks newBookmarks | |
|
218 |
||
219 |
oldBookmarks := self directoryBookmarks copy. |
|
220 |
newBookmarks := BookmarksEditDialog openWith: oldBookmarks defaultBookmark: aFilenameOrNil. |
|
221 |
newBookmarks isNil ifTrue:[^ self]. |
|
222 |
self directoryBookmarks: newBookmarks. |
|
223 |
! |
|
224 |
||
4672
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
225 |
hasBookmarks |
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
226 |
^ self directoryBookmarks notEmptyOrNil |
4672
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
227 |
! |
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
228 |
|
4679 | 229 |
loadBookmarksFrom:aFileNameOrString |
8013 | 230 |
|bookmarks| |
231 |
||
232 |
bookmarks := self bookmarksFrom: aFileNameOrString. |
|
233 |
bookmarks isNil ifTrue:[^ self]. |
|
4679 | 234 |
|
235 |
DirectoryBookmarks := OrderedCollection new. |
|
236 |
bookmarks do:[:eachPath | |
|
237 |
self addBookmark:eachPath asFilename |
|
238 |
]. |
|
239 |
! |
|
240 |
||
4672
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
241 |
removeBookmark:aDirectoryPath |
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
242 |
|bookmarks| |
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
243 |
|
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
244 |
bookmarks := self directoryBookmarks. |
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
245 |
bookmarks isEmptyOrNil ifTrue:[ ^ self]. |
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
246 |
|
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
247 |
bookmarks remove:aDirectoryPath ifAbsent:[]. |
4679 | 248 |
! |
249 |
||
250 |
saveBookmarks |
|
251 |
|fn| |
|
252 |
||
253 |
fn := Dialog |
|
254 |
requestFileName:'Save Bookmarks' |
|
255 |
default:(self defaultBookMarksFilename) |
|
256 |
fromDirectory:(self defaultBookMarksFileDirectory). |
|
257 |
fn isEmptyOrNil ifTrue:[^ self]. |
|
258 |
||
259 |
self saveBookmarksIn:fn |
|
260 |
! |
|
261 |
||
8013 | 262 |
saveBookmarks: bookmarks in:aFileNameOrString |
6114
36fb19194510
Rename Base64Coder>>#decodingOf: to #decode:
Stefan Vogel <sv@exept.de>
parents:
6113
diff
changeset
|
263 |
"save the bokmarks in aFileNameOrString. |
36fb19194510
Rename Base64Coder>>#decodingOf: to #decode:
Stefan Vogel <sv@exept.de>
parents:
6113
diff
changeset
|
264 |
Use Base64 coding" |
36fb19194510
Rename Base64Coder>>#decodingOf: to #decode:
Stefan Vogel <sv@exept.de>
parents:
6113
diff
changeset
|
265 |
|
8013 | 266 |
| bookmarkStream fileName coder| |
4679 | 267 |
|
268 |
fileName := aFileNameOrString asFilename. |
|
269 |
fileName exists ifTrue:[ |
|
270 |
fileName renameTo:(fileName withSuffix:'sav'). |
|
271 |
]. |
|
6114
36fb19194510
Rename Base64Coder>>#decodingOf: to #decode:
Stefan Vogel <sv@exept.de>
parents:
6113
diff
changeset
|
272 |
bookmarkStream := fileName writeStream. |
36fb19194510
Rename Base64Coder>>#decodingOf: to #decode:
Stefan Vogel <sv@exept.de>
parents:
6113
diff
changeset
|
273 |
|
36fb19194510
Rename Base64Coder>>#decodingOf: to #decode:
Stefan Vogel <sv@exept.de>
parents:
6113
diff
changeset
|
274 |
"save each bookmark in one line" |
36fb19194510
Rename Base64Coder>>#decodingOf: to #decode:
Stefan Vogel <sv@exept.de>
parents:
6113
diff
changeset
|
275 |
coder := (Base64Coder on:bookmarkStream) lineLimit:nil. |
4679 | 276 |
bookmarks do:[:eachPath | |
6114
36fb19194510
Rename Base64Coder>>#decodingOf: to #decode:
Stefan Vogel <sv@exept.de>
parents:
6113
diff
changeset
|
277 |
eachPath asFilename pathName acceptVisitor:coder. |
36fb19194510
Rename Base64Coder>>#decodingOf: to #decode:
Stefan Vogel <sv@exept.de>
parents:
6113
diff
changeset
|
278 |
coder flush. |
36fb19194510
Rename Base64Coder>>#decodingOf: to #decode:
Stefan Vogel <sv@exept.de>
parents:
6113
diff
changeset
|
279 |
bookmarkStream cr. |
36fb19194510
Rename Base64Coder>>#decodingOf: to #decode:
Stefan Vogel <sv@exept.de>
parents:
6113
diff
changeset
|
280 |
]. |
36fb19194510
Rename Base64Coder>>#decodingOf: to #decode:
Stefan Vogel <sv@exept.de>
parents:
6113
diff
changeset
|
281 |
bookmarkStream close. |
5960 | 282 |
! |
283 |
||
8013 | 284 |
saveBookmarksIn:aFileNameOrString |
285 |
"save the bokmarks in aFileNameOrString. |
|
286 |
Use Base64 coding" |
|
287 |
||
288 |
| bookmarks | |
|
289 |
||
290 |
bookmarks := self directoryBookmarks. |
|
291 |
self saveBookmarks: bookmarks in:aFileNameOrString |
|
292 |
! |
|
293 |
||
5960 | 294 |
saveBookmarksInDefaultBookmarksFile |
295 |
self saveBookmarksIn:(self defaultBookMarksFileDirectory construct:self defaultBookMarksFilename) |
|
4672
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
296 |
! ! |
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
297 |
|
4915 | 298 |
!AbstractFileBrowser class methodsFor:'accessing-classes'! |
4672
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
299 |
|
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
300 |
directoryHistoryClass |
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
301 |
|
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
302 |
^ AbstractFileBrowser::DirectoryHistory |
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
303 |
! |
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
304 |
|
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
305 |
filenameHistoryClass |
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
306 |
|
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
307 |
^ FilenameHistory |
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
308 |
! ! |
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
309 |
|
3892 | 310 |
!AbstractFileBrowser class methodsFor:'defaults'! |
311 |
||
312 |
commandHistory |
|
313 |
||
314 |
CommandHistory isNil ifTrue:[ |
|
4414 | 315 |
CommandHistory := OrderedCollection new. |
3892 | 316 |
]. |
317 |
^ CommandHistory |
|
318 |
! |
|
319 |
||
320 |
commandHistorySize |
|
4190 | 321 |
"max no of entries in the HistoryList " |
6369 | 322 |
|
3892 | 323 |
CommandHistorySize isNil ifTrue:[ |
6369 | 324 |
CommandHistorySize := 150 |
3892 | 325 |
]. |
326 |
^ CommandHistorySize |
|
327 |
! |
|
328 |
||
329 |
defaultFilterList |
|
330 |
||
331 |
DefaultFilters isNil ifTrue:[ |
|
4414 | 332 |
DefaultFilters := #( '*' |
333 |
'*.st' |
|
334 |
'*.htm*' |
|
335 |
'*.txt' |
|
336 |
'*.gif' |
|
337 |
'*.xpm' |
|
338 |
'*.jpg' |
|
339 |
'*.[h,c]*' |
|
340 |
) |
|
3892 | 341 |
]. |
342 |
^ DefaultFilters. |
|
343 |
! |
|
344 |
||
4496
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
345 |
initialCommandFor:fileName in:aDirectory intoBox:aBox |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
346 |
"set a useful initial command in an execute box." |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
347 |
|
4523 | 348 |
|mime cmd select path suffix baseName pathName| |
4496
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
349 |
|
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
350 |
path := aDirectory filenameFor:fileName. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
351 |
baseName := path baseName. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
352 |
suffix := path suffix. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
353 |
|
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
354 |
mime := MIMETypes mimeTypeForSuffix:suffix. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
355 |
"/ mime notNil ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
356 |
"/ cmd := self initialCommandForMIME:mime file:path |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
357 |
"/ ]. |
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 |
"/ 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
|
360 |
"/ XXX or from resources. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
361 |
|
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
362 |
(path type == #regular) ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
363 |
path isExecutableProgram ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
364 |
aBox initialText:(path pathName , ' <arguments>'). |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
365 |
^ self |
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 |
|
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
368 |
select := true. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
369 |
|
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
370 |
"some heuristics - my personal preferences ... |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
371 |
(actually this should come from a configfile)" |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
372 |
|
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
373 |
(baseName endsWith:'akefile') ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
374 |
aBox initialText:'make target' selectFrom:6 to:11. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
375 |
^ self |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
376 |
]. |
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 |
cmd := MIMETypes defaultCommandPerMIME at:mime ifAbsent:nil. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
379 |
cmd notNil ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
380 |
select := false |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
381 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
382 |
|
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
383 |
cmd isNil ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
384 |
suffix := path suffix. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
385 |
(suffix = 'C') ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
386 |
cmd := 'g++ -c %1'. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
387 |
select := 6. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
388 |
] ifFalse:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
389 |
suffix := suffix asLowercase. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
390 |
|
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
391 |
(suffix = 'taz') ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
392 |
aBox initialText:'zcat %1 | tar tvf -'. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
393 |
select := false. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
394 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
395 |
(suffix = 'tar') ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
396 |
cmd := 'tar tvf %1'. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
397 |
select := 7. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
398 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
399 |
(suffix = 'zoo') ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
400 |
cmd := 'zoo -list %1'. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
401 |
select := 9. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
402 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
403 |
(suffix = 'zip') ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
404 |
cmd := 'unzip -l %1'. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
405 |
select := 8. |
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 = 'jar') ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
408 |
cmd := 'unzip -l %1'. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
409 |
select := 8. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
410 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
411 |
(suffix = 'z') ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
412 |
(baseName asLowercase endsWith:'tar.z') ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
413 |
cmd := 'zcat %1 | tar tvf -'. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
414 |
select := false. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
415 |
] ifFalse:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
416 |
cmd := 'uncompress %1' |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
417 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
418 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
419 |
(suffix = 'gz') ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
420 |
(baseName asLowercase endsWith:'tar.gz') ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
421 |
cmd := ('gunzip < %1 | tar tvf -' ). |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
422 |
select := false. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
423 |
] ifFalse:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
424 |
cmd := 'gunzip %1'. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
425 |
]. |
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 |
(suffix = 'html') ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
428 |
cmd := 'netscape %1' |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
429 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
430 |
(suffix = 'htm') ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
431 |
cmd := 'netscape %1' |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
432 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
433 |
(suffix = 'uue') ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
434 |
cmd := 'uudecode %1' |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
435 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
436 |
(suffix = 'c') ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
437 |
cmd := 'cc -c %1'. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
438 |
select := 5. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
439 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
440 |
(suffix = 'cc') ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
441 |
cmd := 'g++ -c %1'. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
442 |
select := 6. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
443 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
444 |
(suffix = 'xbm') ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
445 |
cmd := 'bitmap %1' |
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 |
(suffix = 'ps') ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
448 |
cmd := 'ghostview %1' |
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 |
((suffix = '1') or:[suffix = 'man']) ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
451 |
cmd := 'nroff -man %1'. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
452 |
select := 10. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
453 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
454 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
455 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
456 |
|
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
457 |
cmd isNil ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
458 |
DefaultCommandPerSuffix isNil ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
459 |
cmd := '<cmd>' |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
460 |
] ifFalse:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
461 |
cmd := DefaultCommandPerSuffix |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
462 |
at:suffix |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
463 |
ifAbsent:'<cmd>'. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
464 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
465 |
cmd := cmd , ' %1'. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
466 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
467 |
|
4523 | 468 |
pathName := path pathName. |
469 |
OperatingSystem isUNIXlike ifTrue:[ |
|
470 |
pathName includesSeparator ifTrue:[ |
|
471 |
pathName := '"' , pathName , '"' |
|
472 |
] |
|
473 |
]. |
|
474 |
||
475 |
cmd := cmd bindWith:pathName. |
|
4496
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
476 |
select == false ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
477 |
aBox initialText:cmd |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
478 |
] ifFalse:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
479 |
select class == Interval ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
480 |
aBox initialText:cmd selectFrom:select start to:select stop |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
481 |
] ifFalse:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
482 |
select isInteger ifFalse:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
483 |
select := (cmd indexOf:Character space ifAbsent:[cmd size + 1]) - 1. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
484 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
485 |
aBox initialText:cmd selectFrom:1 to:select |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
486 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
487 |
] |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
488 |
] |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
489 |
|
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
490 |
"Modified: / 24.9.1997 / 16:34:52 / stefan" |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
491 |
"Modified: / 9.4.1998 / 17:15:57 / cg" |
3892 | 492 |
! |
493 |
||
5941 | 494 |
listOfRuntimeValuesToRemember |
495 |
" list of all aspects that will be remembered after closing a FileBrowserV2" |
|
496 |
||
497 |
^ #( |
|
498 |
"/ #filterModel |
|
499 |
#enableFileHistory |
|
500 |
#fileHistory |
|
501 |
#currentSortOrder |
|
502 |
#sortBlockProperty |
|
503 |
) |
|
3892 | 504 |
! |
505 |
||
506 |
resetAspects |
|
507 |
||
508 |
RuntimeAspects := nil. |
|
509 |
||
5941 | 510 |
" |
511 |
self resetAspects |
|
512 |
" |
|
3892 | 513 |
! |
514 |
||
515 |
runtimeAspects |
|
516 |
||
517 |
RuntimeAspects isNil ifTrue:[ |
|
4414 | 518 |
RuntimeAspects := Dictionary new. |
3892 | 519 |
]. |
520 |
^ RuntimeAspects |
|
521 |
! |
|
522 |
||
4201 | 523 |
userPreferencesAspectList |
524 |
" list of all aspects that will be saved with save settings |
|
525 |
that aspects will be image consistent if the settings are saved in Launcher |
|
7078
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
526 |
dont forget to add a access methos in UserPreferences if you add a aspect here |
4201 | 527 |
" |
528 |
||
7078
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
529 |
^ Dictionary |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
530 |
withKeysAndValues:#( |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
531 |
viewDirsInContentsBrowser true |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
532 |
showDirectoryTree true |
9119
77cc26a119cf
changed: #userPreferencesAspectList
Claus Gittinger <cg@exept.de>
parents:
9118
diff
changeset
|
533 |
showHiddenFiles false |
7078
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
534 |
viewDescription false |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
535 |
viewDetails true |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
536 |
viewDirectoryDescription false |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
537 |
viewFilesInDirectoryTree false |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
538 |
viewGroup false |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
539 |
viewOwner false |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
540 |
viewPermissions false |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
541 |
viewPreview false |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
542 |
viewSize true |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
543 |
viewSizeInKiloBytes false |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
544 |
viewSizeInBytes false |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
545 |
viewTime true |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
546 |
viewType false |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
547 |
openMultipleApplicationsForType false |
7788 | 548 |
filenameEntryFieldVisibleHolder true |
549 |
toolBarVisibleHolder true |
|
7078
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
550 |
sortDirectoriesBeforeFiles true |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
551 |
openAlwaysInTextEditor false |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
552 |
sortCaseless false |
4201 | 553 |
) |
7078
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
554 |
|
7788 | 555 |
"Modified: / 03-04-2007 / 08:47:45 / cg" |
3892 | 556 |
! ! |
557 |
||
5398 | 558 |
!AbstractFileBrowser class methodsFor:'help specs'! |
559 |
||
8261 | 560 |
basicFlyByHelpSpec |
6099 | 561 |
<resource: #help> |
562 |
||
8261 | 563 |
^ super flyByHelpSpec addPairsFrom:#( |
6099 | 564 |
|
6100 | 565 |
#closeTabButton |
566 |
'Close this Tab' |
|
567 |
||
6099 | 568 |
#addTerminal |
569 |
'Shell Terminal' |
|
570 |
||
571 |
#make |
|
572 |
'Make' |
|
573 |
||
574 |
#searchFile |
|
575 |
'Search a File' |
|
576 |
||
577 |
#directoryUp |
|
578 |
'Directory Up' |
|
579 |
||
580 |
#directoryBack |
|
581 |
'Directory Back' |
|
582 |
||
583 |
#directoryForward |
|
584 |
'Directory Forward' |
|
585 |
||
586 |
#directoryHistory |
|
587 |
'Directory' |
|
588 |
||
589 |
#copyFile |
|
6146 | 590 |
'Copy the Selected File(s)' |
6099 | 591 |
|
592 |
#cutFile |
|
6146 | 593 |
'Cut the Selected File(s)' |
6099 | 594 |
|
595 |
#editFile |
|
6146 | 596 |
'Edit the Selected File' |
6099 | 597 |
|
598 |
#fileHome |
|
599 |
'Goto Home Directory' |
|
600 |
||
8093 | 601 |
#fileDesktop |
602 |
'Goto Desktop Directory' |
|
603 |
||
6099 | 604 |
#fileGotoDefault |
605 |
'Goto Default Directory (ST/X Start Directory)' |
|
606 |
||
6454 | 607 |
#fileGotoSmalltalkDirectory |
608 |
'Goto Smalltalk Directory (ST/X Application)' |
|
609 |
||
6456 | 610 |
#fileGotoDefaultDirectory |
611 |
'Goto Current Directory' |
|
612 |
||
6099 | 613 |
#pasteFile |
614 |
'Paste File(s)' |
|
615 |
||
616 |
#deleteFile |
|
6146 | 617 |
'Delete the Selected File(s)' |
6099 | 618 |
|
619 |
#fileIn |
|
620 |
'File In' |
|
621 |
||
622 |
#fileHistory |
|
623 |
'File History' |
|
624 |
||
625 |
#fileGotoBookmark |
|
626 |
'Goto Bookmarked Directory' |
|
627 |
||
628 |
#hideToolBar |
|
629 |
'Hide Toolbar' |
|
630 |
||
631 |
#hideFilenameEntryField |
|
6307 | 632 |
'Hide Filename & Filter Fields' |
6099 | 633 |
|
634 |
#openChangeBrowser |
|
635 |
'Open a ChangeBrowser on File' |
|
636 |
||
637 |
#showFileDetails |
|
638 |
'Show File Details' |
|
639 |
||
640 |
#hideFileDetails |
|
641 |
'Hide File Details' |
|
642 |
||
643 |
#toggleDetails |
|
644 |
'Show/Hide File Details' |
|
645 |
||
646 |
#viewDetails |
|
647 |
'Show/Hide File Details' |
|
648 |
||
649 |
#selectDetails |
|
650 |
'Select File Details to be Shown' |
|
651 |
||
8088 | 652 |
#showDifferences |
653 |
'Show Differences between File and Editor Versions' |
|
654 |
||
655 |
#toggleHexDisplay |
|
656 |
'Toggle between Hexadecimal and Textual Representation' |
|
657 |
||
658 |
#findInBrowser |
|
659 |
'Navigate the Browsers File List to the Edited File' |
|
660 |
||
661 |
#saveFile |
|
662 |
'Save the Editor''s Contents into the File' |
|
663 |
||
664 |
#reloadFile |
|
665 |
'Reload from the File' |
|
666 |
||
667 |
||
668 |
'Send to the Printer' |
|
669 |
||
6099 | 670 |
). |
671 |
||
8261 | 672 |
" |
673 |
self flyByHelpSpec |
|
674 |
" |
|
675 |
||
676 |
"Modified: / 03-11-2007 / 12:05:01 / cg" |
|
677 |
! |
|
678 |
||
679 |
flyByHelpSpec |
|
680 |
<resource: #programHelp> |
|
681 |
||
682 |
|spec hist resources| |
|
683 |
||
684 |
spec := self basicFlyByHelpSpec. |
|
685 |
||
686 |
"/ add help items for the history |
|
6099 | 687 |
hist := self directoryHistory. |
688 |
hist notNil ifTrue:[ |
|
689 |
resources := self classResources. |
|
690 |
hist canForward ifTrue:[ |
|
7879
9c64dea1b14a
block as a flyByHelpText item.
Claus Gittinger <cg@exept.de>
parents:
7869
diff
changeset
|
691 |
spec at:#directoryForward put:[ resources string:'Forward to: %1' with:hist nextForwardItem ]. |
6099 | 692 |
]. |
693 |
hist canBackward ifTrue:[ |
|
7879
9c64dea1b14a
block as a flyByHelpText item.
Claus Gittinger <cg@exept.de>
parents:
7869
diff
changeset
|
694 |
spec at:#directoryBack put:[ resources string:'Back to: %1' with:hist nextBackwardItem ]. |
6099 | 695 |
]. |
696 |
]. |
|
697 |
^ spec. |
|
698 |
||
699 |
" |
|
700 |
self flyByHelpSpec |
|
701 |
" |
|
702 |
||
7879
9c64dea1b14a
block as a flyByHelpText item.
Claus Gittinger <cg@exept.de>
parents:
7869
diff
changeset
|
703 |
"Modified: / 03-11-2007 / 12:05:01 / cg" |
6099 | 704 |
! |
705 |
||
5398 | 706 |
helpSpec |
707 |
"This resource specification was automatically generated |
|
708 |
by the UIHelpTool of ST/X." |
|
709 |
||
710 |
"Do not manually edit this!! If it is corrupted, |
|
711 |
the UIHelpTool may not be able to read the specification." |
|
712 |
||
713 |
" |
|
714 |
UIHelpTool openOnClass:AbstractFileBrowser |
|
715 |
" |
|
716 |
||
717 |
<resource: #help> |
|
718 |
||
719 |
^ super helpSpec addPairsFrom:#( |
|
720 |
||
5737 | 721 |
#lockFileEncoding |
722 |
'Do not guess the encoding from the files contents.' |
|
723 |
||
5398 | 724 |
) |
725 |
! ! |
|
726 |
||
8994
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
727 |
!AbstractFileBrowser class methodsFor:'image specs'! |
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
728 |
|
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
729 |
clearHistoryIcon |
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
730 |
<resource: #programImage> |
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
731 |
|
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
732 |
^ Icon deleteIcon |
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
733 |
! |
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
734 |
|
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
735 |
copyIcon |
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
736 |
<resource: #programImage> |
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
737 |
|
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
738 |
^ ToolbarIconLibrary copyIcon |
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
739 |
! |
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
740 |
|
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
741 |
cutIcon |
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
742 |
<resource: #programImage> |
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
743 |
|
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
744 |
^ ToolbarIconLibrary cut20x20Icon2 "cut28x28Icon" |
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
745 |
! |
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
746 |
|
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
747 |
deleteIcon |
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
748 |
<resource: #programImage> |
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
749 |
|
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
750 |
^ ToolbarIconLibrary erase20x20Icon "/ delete28x28Icon |
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
751 |
! |
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
752 |
|
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
753 |
directoryUpIcon |
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
754 |
<resource: #programImage> |
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
755 |
|
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
756 |
^ ToolbarIconLibrary directoryUpIcon |
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
757 |
! |
3892 | 758 |
|
6337 | 759 |
disabledCursorIcon |
760 |
"This resource specification was automatically generated |
|
761 |
by the ImageEditor of ST/X." |
|
762 |
||
763 |
"Do not manually edit this!! If it is corrupted, |
|
764 |
the ImageEditor may not be able to read the specification." |
|
765 |
||
766 |
" |
|
767 |
self disabledCursorImage inspect |
|
768 |
ImageEditor openOnClass:self andSelector:#disabledCursorImage |
|
769 |
Icon flushCachedIcons |
|
770 |
" |
|
771 |
||
772 |
<resource: #image> |
|
773 |
||
774 |
^Icon |
|
8473 | 775 |
constantNamed:#'AbstractFileBrowser class disabledCursorIcon' |
6337 | 776 |
ifAbsentPut:[(Depth1Image new) width: 32; height: 32; photometric:(#palette); bitsPerSample:(#[1]); samplesPerPixel:(1); bits:(ByteArray fromPackedString:' |
777 |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@_ @@@XF@@@H@P@@DOB@@BLLP@AA@"@@RHD @H1AD@BRHI@@$QBP@IBH$@BPQI@@"BLP@D QH@ADBB@@H0Q@@AC |
|
778 |
8 @@H@P@@A X@@@G8@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@b') ; colorMapFromArray:#[0 0 0 255 255 255]; mask:((ImageMask new) width: 32; height: 32; photometric:(#blackIs0); bitsPerSample:(#[1]); samplesPerPixel:(1); bits:(ByteArray fromPackedString:' |
|
779 |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@_ @@@_>@@@O?0@@G?>@@C<O0@A?@>@@_8G @O?A<@C38O@@<_C0@OC8<@C0_O@@>C?0@G _8@A<C>@@O0_@@A? |
|
780 |
? @@O?0@@A?8@@@G8@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@b') ; yourself); yourself] |
|
781 |
! |
|
782 |
||
4337
f2eed806e854
change first letter uppercase methods on class side to lowercase ones
penk
parents:
4317
diff
changeset
|
783 |
disabledCursorImage |
6337 | 784 |
"/ DisabledCursorImage isNil ifTrue:[ |
785 |
"/ DisabledCursorImage := self disabledCursorIcon. "/ Image fromFile:'xpmBitmaps/cursors/no_entry.xpm' |
|
786 |
"/ ]. |
|
3892 | 787 |
^ DisabledCursorImage |
788 |
! |
|
789 |
||
6337 | 790 |
enabledCursorIcon |
791 |
"This resource specification was automatically generated |
|
792 |
by the ImageEditor of ST/X." |
|
793 |
||
794 |
"Do not manually edit this!! If it is corrupted, |
|
795 |
the ImageEditor may not be able to read the specification." |
|
796 |
||
797 |
" |
|
798 |
self enabledCursorImage inspect |
|
799 |
ImageEditor openOnClass:self andSelector:#enabledCursorImage |
|
800 |
Icon flushCachedIcons |
|
801 |
" |
|
802 |
||
803 |
<resource: #image> |
|
804 |
||
805 |
^Icon |
|
8473 | 806 |
constantNamed:#'AbstractFileBrowser class enabledCursorIcon' |
6337 | 807 |
ifAbsentPut:[(Depth1Image new) width: 32; height: 32; photometric:(#palette); bitsPerSample:(#[1]); samplesPerPixel:(1); bits:(ByteArray fromPackedString:' |
808 |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@E@@@@AP@@@@T@@@@E@@@@AP@@@@T@@@@E@@@@AP@@@@@@@@?0_0@@@@@@C?A?@@@@@@@@AP@@@@T@@@@E@@@@A |
|
809 |
P@@@@T@@@@E@@@@AP@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@b') ; colorMapFromArray:#[0 0 0 255 255 255]; mask:((ImageMask new) width: 32; height: 32; photometric:(#blackIs0); bitsPerSample:(#[1]); samplesPerPixel:(1); bits:(ByteArray fromPackedString:' |
|
810 |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@G@@@@A0@@@@\@@@@G@@@@A0@@@@\@@@@G@@@@A0@@@@\@@@?8?0@O>O<@C?#?@@@G@@@@A0@@@@\@@@@G@@@@A |
|
811 |
0@@@@\@@@@G@@@@A0@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@b') ; yourself); yourself] |
|
812 |
! |
|
813 |
||
4337
f2eed806e854
change first letter uppercase methods on class side to lowercase ones
penk
parents:
4317
diff
changeset
|
814 |
enabledCursorImage |
6337 | 815 |
"/ EnabledCursorImage isNil ifTrue:[ |
816 |
"/ EnabledCursorImage := self enabledCursorIcon. "/ Image fromFile:'xpmBitmaps/cursors/double_crossHair.xpm' |
|
817 |
"/ ]. |
|
3892 | 818 |
^ EnabledCursorImage |
6083 | 819 |
! |
820 |
||
3892 | 821 |
fileInIcon |
822 |
<resource: #programImage> |
|
823 |
||
6116 | 824 |
^ ToolbarIconLibrary fileInIcon |
3892 | 825 |
! |
826 |
||
6079 | 827 |
historyBackIcon |
828 |
<resource: #programImage> |
|
829 |
||
830 |
^ ToolbarIconLibrary historyBackIcon |
|
831 |
! |
|
832 |
||
833 |
historyForwardIcon |
|
834 |
<resource: #programImage> |
|
835 |
||
836 |
^ ToolbarIconLibrary historyForwardIcon |
|
837 |
! |
|
838 |
||
3892 | 839 |
homeIcon |
840 |
<resource: #programImage> |
|
841 |
||
6079 | 842 |
^ ToolbarIconLibrary homeIcon |
3892 | 843 |
! |
844 |
||
6074 | 845 |
homeIcon2 |
6079 | 846 |
<resource: #programImage> |
847 |
||
848 |
^ ToolbarIconLibrary homeIcon2 |
|
6074 | 849 |
! |
850 |
||
851 |
htmlReloadIcon |
|
852 |
<resource: #programImage> |
|
853 |
||
854 |
^ ToolbarIconLibrary reload22x22Icon |
|
855 |
! |
|
856 |
||
3892 | 857 |
leftDownIcon |
858 |
"This resource specification was automatically generated |
|
859 |
by the ImageEditor of ST/X." |
|
860 |
||
861 |
"Do not manually edit this!! If it is corrupted, |
|
862 |
the ImageEditor may not be able to read the specification." |
|
863 |
||
864 |
" |
|
865 |
self leftDownIcon inspect |
|
866 |
ImageEditor openOnClass:self andSelector:#leftDownIcon |
|
867 |
" |
|
868 |
||
869 |
<resource: #image> |
|
870 |
||
871 |
^Icon |
|
4414 | 872 |
constantNamed:#'AbstractFileBrowser class leftDownIcon' |
873 |
ifAbsentPut:[(Depth2Image new) width: 28; height: 28; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:' |
|
3892 | 874 |
UUUUUUUUUUUPAUUUUUUUP@UUUUUUUPB!!UUUUUU@B*AUUUUU@B*(UUUUUPB** UUUUPB***AUUUTB***(EUUUB****%UUUR*****UUUUU@*%UUUUUUPJ)UUUU |
875 |
UUTB*UUUUUUU@*%UUUUUUPJ)UUUUUUTB*UUUUUUU@*%UUUUUUPJ)UUUUUUTB*UUUUUUU@*$@@@@AUPJ*****)UTB******UU@******%UPJ*****)UTAUUUU |
|
876 |
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:' |
|
877 |
@@@@@@@@@@@@ @@@@\@@@@O @@@G<@@@C? @@A?<@@@?? @@_?<@@G?? @@C<@@@@?@@@@O0@@@C<@@@@?@@@@O0@@@C<@@@@?@@@@O0@@@C??? @???8@O? |
|
878 |
?>@C??? @???8@O??>@@@@@@@@@@@@@a') ; yourself); yourself] |
|
879 |
! |
|
880 |
||
881 |
menuHistoryList9x20Icon |
|
882 |
"This resource specification was automatically generated |
|
883 |
by the ImageEditor of ST/X." |
|
884 |
||
885 |
"Do not manually edit this!! If it is corrupted, |
|
886 |
the ImageEditor may not be able to read the specification." |
|
887 |
||
888 |
" |
|
889 |
self menuHistoryList9x20Icon inspect |
|
890 |
ImageEditor openOnClass:self andSelector:#menuHistoryList9x20Icon |
|
891 |
Icon flushCachedIcons |
|
892 |
" |
|
893 |
||
894 |
<resource: #image> |
|
895 |
||
896 |
^Icon |
|
4414 | 897 |
constantNamed:#'AbstractFileBrowser class menuHistoryList9x20Icon' |
898 |
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 | 899 |
! |
900 |
||
901 |
menuHistoryListIcon |
|
902 |
"This resource specification was automatically generated |
|
903 |
by the ImageEditor of ST/X." |
|
904 |
||
905 |
"Do not manually edit this!! If it is corrupted, |
|
906 |
the ImageEditor may not be able to read the specification." |
|
907 |
||
908 |
" |
|
909 |
self menuHistoryListIcon inspect |
|
910 |
ImageEditor openOnClass:self andSelector:#menuHistoryListIcon |
|
911 |
" |
|
912 |
||
913 |
<resource: #image> |
|
914 |
||
915 |
^Icon |
|
4414 | 916 |
constantNamed:#'AbstractFileBrowser class menuHistoryListIcon' |
917 |
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 | 918 |
! |
919 |
||
6087 | 920 |
newDirectoryIcon |
6074 | 921 |
<resource: #programImage> |
922 |
||
6087 | 923 |
^ ToolbarIconLibrary newDirectoryIcon |
3923 | 924 |
! |
925 |
||
6091 | 926 |
removeTabIcon |
927 |
<resource: #programImage> |
|
928 |
||
929 |
^ ToolbarIconLibrary removeTabIcon |
|
930 |
! |
|
931 |
||
3892 | 932 |
vt100Terminal |
933 |
<resource: #programImage> |
|
934 |
||
935 |
^ ToolbarIconLibrary shell20x20Icon |
|
936 |
! ! |
|
937 |
||
5528 | 938 |
!AbstractFileBrowser class methodsFor:'interface specs'! |
939 |
||
940 |
encodingDialogSpec |
|
941 |
"This resource specification was automatically generated |
|
942 |
by the UIPainter of ST/X." |
|
943 |
||
944 |
"Do not manually edit this!! If it is corrupted, |
|
945 |
the UIPainter may not be able to read the specification." |
|
946 |
||
947 |
" |
|
948 |
UIPainter new openOnClass:AbstractFileBrowser andSelector:#encodingDialogSpec |
|
949 |
AbstractFileBrowser new openInterface:#encodingDialogSpec |
|
950 |
" |
|
951 |
||
952 |
<resource: #canvas> |
|
953 |
||
954 |
^ |
|
955 |
#(FullSpec |
|
956 |
name: encodingDialogSpec |
|
957 |
window: |
|
958 |
(WindowSpec |
|
959 |
label: 'File Encoding' |
|
960 |
name: 'File Encoding' |
|
961 |
min: (Point 10 10) |
|
5626 | 962 |
bounds: (Rectangle 0 0 379 590) |
5528 | 963 |
) |
964 |
component: |
|
965 |
(SpecCollection |
|
966 |
collection: ( |
|
967 |
(LabelSpec |
|
6339 | 968 |
label: 'Select the External (File-) Encoding' |
6236 | 969 |
name: 'Label1' |
5528 | 970 |
layout: (LayoutFrame 0 0 0 0 0 1 30 0) |
971 |
translateLabel: true |
|
972 |
adjust: left |
|
973 |
) |
|
974 |
(DataSetSpec |
|
975 |
name: 'Table1' |
|
5737 | 976 |
layout: (LayoutFrame 0 0 30 0 0 1 -60 1) |
5528 | 977 |
model: selectedEncoding |
978 |
hasHorizontalScrollBar: true |
|
979 |
hasVerticalScrollBar: true |
|
980 |
dataList: encodingList |
|
981 |
has3Dsepartors: true |
|
982 |
has3Dseparators: true |
|
983 |
columns: |
|
984 |
(OrderedCollection |
|
985 |
||
986 |
(DataSetColumnSpec |
|
987 |
label: 'Encoding' |
|
988 |
translateLabel: true |
|
989 |
labelButtonType: Button |
|
990 |
model: at: |
|
991 |
canSelect: false |
|
992 |
isResizeable: false |
|
993 |
showRowSeparator: false |
|
994 |
showColSeparator: false |
|
995 |
) |
|
996 |
(DataSetColumnSpec |
|
997 |
label: 'Description' |
|
998 |
translateLabel: true |
|
999 |
labelButtonType: Button |
|
1000 |
model: at: |
|
1001 |
canSelect: false |
|
1002 |
isResizeable: false |
|
1003 |
showRowSeparator: false |
|
1004 |
showColSeparator: false |
|
1005 |
) |
|
1006 |
) |
|
5626 | 1007 |
doubleClickChannel: accept |
5528 | 1008 |
) |
1009 |
(HorizontalPanelViewSpec |
|
5737 | 1010 |
name: 'ButtonPanel' |
5528 | 1011 |
layout: (LayoutFrame 0 0 -30 1 0 1 0 1) |
1012 |
horizontalLayout: fitSpace |
|
1013 |
verticalLayout: center |
|
1014 |
horizontalSpace: 3 |
|
1015 |
verticalSpace: 3 |
|
1016 |
reverseOrderIfOKAtLeft: true |
|
1017 |
component: |
|
1018 |
(SpecCollection |
|
1019 |
collection: ( |
|
1020 |
(ActionButtonSpec |
|
1021 |
label: 'Cancel' |
|
1022 |
name: 'Button2' |
|
1023 |
translateLabel: true |
|
1024 |
model: cancel |
|
5737 | 1025 |
extent: (Point 185 22) |
5528 | 1026 |
) |
1027 |
(ActionButtonSpec |
|
1028 |
label: 'OK' |
|
1029 |
name: 'Button1' |
|
1030 |
translateLabel: true |
|
1031 |
model: accept |
|
1032 |
isDefault: true |
|
5737 | 1033 |
extent: (Point 185 22) |
5528 | 1034 |
) |
1035 |
) |
|
1036 |
||
1037 |
) |
|
1038 |
) |
|
5737 | 1039 |
(CheckBoxSpec |
1040 |
label: 'Lock Encoding' |
|
1041 |
name: 'LockEncodingCheckBox' |
|
1042 |
layout: (LayoutFrame 3 0 -60 1 217 0 -30 1) |
|
1043 |
activeHelpKey: lockFileEncoding |
|
1044 |
model: lockFileEncoding |
|
1045 |
translateLabel: true |
|
1046 |
) |
|
5528 | 1047 |
) |
1048 |
||
1049 |
) |
|
1050 |
) |
|
1051 |
! ! |
|
1052 |
||
3892 | 1053 |
!AbstractFileBrowser class methodsFor:'menu specs'! |
1054 |
||
1055 |
baseBookmarksMenuSpec |
|
1056 |
"This resource specification was automatically generated |
|
1057 |
by the MenuEditor of ST/X." |
|
1058 |
||
1059 |
"Do not manually edit this!! If it is corrupted, |
|
1060 |
the MenuEditor may not be able to read the specification." |
|
1061 |
||
1062 |
" |
|
1063 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#baseBookmarksMenuSpec |
|
1064 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser baseBookmarksMenuSpec)) startUp |
|
1065 |
" |
|
1066 |
||
1067 |
<resource: #menu> |
|
1068 |
||
1069 |
^ |
|
6551 | 1070 |
#(Menu |
1071 |
( |
|
1072 |
(MenuItem |
|
1073 |
enabled: currentFilesHasDirectories |
|
1074 |
label: 'Add Bookmark' |
|
1075 |
itemValue: addBookmark |
|
1076 |
translateLabel: true |
|
4414 | 1077 |
) |
6551 | 1078 |
(MenuItem |
1079 |
enabled: hasBookmarksToRemove |
|
1080 |
label: 'Remove Bookmark' |
|
1081 |
itemValue: removeBookmark |
|
1082 |
translateLabel: true |
|
4414 | 1083 |
) |
6551 | 1084 |
(MenuItem |
1085 |
label: 'Save Bookmarks In...' |
|
1086 |
itemValue: saveBookmarks |
|
1087 |
translateLabel: true |
|
4679 | 1088 |
) |
4414 | 1089 |
) |
1090 |
nil |
|
1091 |
nil |
|
3892 | 1092 |
) |
1093 |
! |
|
1094 |
||
6102 | 1095 |
baseBookmarksMenuSpec2 |
1096 |
"This resource specification was automatically generated |
|
1097 |
by the MenuEditor of ST/X." |
|
1098 |
||
1099 |
"Do not manually edit this!! If it is corrupted, |
|
1100 |
the MenuEditor may not be able to read the specification." |
|
1101 |
||
1102 |
" |
|
8013 | 1103 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#baseBookmarksMenuSpec2 |
1104 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser baseBookmarksMenuSpec2)) startUp |
|
6102 | 1105 |
" |
1106 |
||
1107 |
<resource: #menu> |
|
1108 |
||
1109 |
^ |
|
8013 | 1110 |
#(Menu |
1111 |
( |
|
1112 |
(MenuItem |
|
1113 |
label: 'Edit Bookmarks' |
|
1114 |
itemValue: editBookmarks |
|
1115 |
translateLabel: true |
|
1116 |
) |
|
1117 |
(MenuItem |
|
1118 |
label: '-' |
|
1119 |
) |
|
1120 |
(MenuItem |
|
1121 |
enabled: currentFilesHasDirectories |
|
1122 |
label: 'Add Bookmark' |
|
1123 |
itemValue: addBookmark |
|
1124 |
translateLabel: true |
|
6102 | 1125 |
) |
1126 |
) |
|
1127 |
nil |
|
1128 |
nil |
|
1129 |
) |
|
1130 |
! |
|
1131 |
||
4110 | 1132 |
browserMenu |
1133 |
"This resource specification was automatically generated |
|
1134 |
by the MenuEditor of ST/X." |
|
1135 |
||
1136 |
"Do not manually edit this!! If it is corrupted, |
|
1137 |
the MenuEditor may not be able to read the specification." |
|
1138 |
||
1139 |
" |
|
1140 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#browserMenu |
|
1141 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser browserMenu)) startUp |
|
1142 |
" |
|
1143 |
||
1144 |
<resource: #menu> |
|
1145 |
||
1146 |
^ |
|
5273 | 1147 |
#(Menu |
1148 |
( |
|
1149 |
(MenuItem |
|
7315 | 1150 |
label: 'Spawn Filebrowser' |
5273 | 1151 |
itemValue: doSpawn |
1152 |
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
|
1153 |
shortcutKey: Ctrln |
4201 | 1154 |
) |
5273 | 1155 |
(MenuItem |
7829 | 1156 |
label: 'Windows Explorer' |
1157 |
itemValue: doOpenExplorer |
|
1158 |
translateLabel: true |
|
8256 | 1159 |
isVisible: systemIsDOS |
7829 | 1160 |
shortcutKey: Ctrle |
8256 | 1161 |
) |
1162 |
(MenuItem |
|
1163 |
label: 'C Browser' |
|
1164 |
itemValue: doOpenCBrowser |
|
1165 |
translateLabel: true |
|
1166 |
isVisible: cBrowserLoaded |
|
7829 | 1167 |
) |
1168 |
(MenuItem |
|
5273 | 1169 |
label: '-' |
4201 | 1170 |
) |
5273 | 1171 |
(MenuItem |
6335 | 1172 |
label: 'Add Text Editor Page' |
5273 | 1173 |
itemValue: newTextEditor |
1174 |
translateLabel: true |
|
5963
57ae5e061db8
Accelerator Ctrl-t for new text editor
Stefan Vogel <sv@exept.de>
parents:
5962
diff
changeset
|
1175 |
shortcutKey: Ctrlt |
4392 | 1176 |
) |
5273 | 1177 |
(MenuItem |
6335 | 1178 |
label: 'Add Shell Terminal Page' |
5273 | 1179 |
itemValue: doAddTerminal |
1180 |
translateLabel: true |
|
4201 | 1181 |
) |
5273 | 1182 |
(MenuItem |
6335 | 1183 |
label: 'Add Search Page' |
5273 | 1184 |
itemValue: doOpenSearchFile |
1185 |
translateLabel: true |
|
4201 | 1186 |
) |
5273 | 1187 |
(MenuItem |
1188 |
label: '-' |
|
4201 | 1189 |
) |
5273 | 1190 |
(MenuItem |
1191 |
label: 'Settings...' |
|
1192 |
itemValue: doOpenSettings |
|
1193 |
translateLabel: true |
|
5104 | 1194 |
) |
5273 | 1195 |
(MenuItem |
5528 | 1196 |
label: 'Encoding...' |
1197 |
itemValue: fileEncodingDialog |
|
1198 |
translateLabel: true |
|
1199 |
) |
|
1200 |
(MenuItem |
|
5273 | 1201 |
label: '-' |
5104 | 1202 |
) |
5273 | 1203 |
(MenuItem |
1204 |
label: 'Exit' |
|
1205 |
itemValue: closeRequest |
|
1206 |
translateLabel: true |
|
4201 | 1207 |
) |
1208 |
) |
|
1209 |
nil |
|
1210 |
nil |
|
4110 | 1211 |
) |
1212 |
! |
|
1213 |
||
4107 | 1214 |
cvsMenu |
1215 |
"This resource specification was automatically generated |
|
1216 |
by the MenuEditor of ST/X." |
|
1217 |
||
1218 |
"Do not manually edit this!! If it is corrupted, |
|
1219 |
the MenuEditor may not be able to read the specification." |
|
1220 |
||
1221 |
" |
|
1222 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#cvsMenu |
|
1223 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser cvsMenu)) startUp |
|
1224 |
" |
|
1225 |
||
1226 |
<resource: #menu> |
|
1227 |
||
1228 |
^ |
|
1229 |
#(#Menu |
|
4414 | 1230 |
#( |
1231 |
#(#MenuItem |
|
1232 |
#label: 'Commit...' |
|
1233 |
#itemValue: #cvsCommit |
|
1234 |
#translateLabel: true |
|
1235 |
) |
|
1236 |
#(#MenuItem |
|
1237 |
#enabled: #canCvsAddAndCommit |
|
1238 |
#label: 'Add && Commit...' |
|
1239 |
#itemValue: #cvsAddAndCommit |
|
1240 |
#translateLabel: true |
|
1241 |
) |
|
1242 |
#(#MenuItem |
|
4849 | 1243 |
#enabled: #canCvsAddAndCommit |
1244 |
#label: 'Add as Binary && Commit...' |
|
1245 |
#itemValue: #cvsAddBinaryAndCommit |
|
1246 |
#translateLabel: true |
|
1247 |
) |
|
1248 |
#(#MenuItem |
|
4414 | 1249 |
#label: '-' |
1250 |
) |
|
1251 |
#(#MenuItem |
|
6316 | 1252 |
#enabled: #hasSelection |
8562 | 1253 |
#label: 'Tag...' |
1254 |
#itemValue: #cvsTagSelection |
|
1255 |
#translateLabel: true |
|
1256 |
) |
|
1257 |
#(#MenuItem |
|
1258 |
#label: '-' |
|
1259 |
) |
|
1260 |
#(#MenuItem |
|
1261 |
#enabled: #hasSelection |
|
6316 | 1262 |
#label: 'Update selected Files/Directories' |
1263 |
#itemValue: #cvsUpdateSelection |
|
1264 |
#translateLabel: true |
|
1265 |
) |
|
1266 |
#(#MenuItem |
|
1267 |
#label: 'Update Directory Local' |
|
1268 |
#itemValue: #cvsUpdateAll |
|
1269 |
#translateLabel: true |
|
1270 |
) |
|
1271 |
#(#MenuItem |
|
1272 |
#label: 'Update Directory Recursive' |
|
1273 |
#itemValue: #cvsUpdateAllRecursive |
|
1274 |
#translateLabel: true |
|
1275 |
) |
|
1276 |
#(#MenuItem |
|
1277 |
#label: '-' |
|
1278 |
) |
|
1279 |
#(#MenuItem |
|
4414 | 1280 |
#enabled: #canRemoveCVSContainer |
1281 |
#label: 'Remove File && CVS Container...' |
|
1282 |
#itemValue: #cvsRemoveFileAndCVSContainer |
|
1283 |
#translateLabel: true |
|
1284 |
) |
|
1285 |
) |
|
1286 |
nil |
|
1287 |
nil |
|
4107 | 1288 |
) |
1289 |
! |
|
1290 |
||
3892 | 1291 |
directoryMenu |
1292 |
"This resource specification was automatically generated |
|
1293 |
by the MenuEditor of ST/X." |
|
1294 |
||
1295 |
"Do not manually edit this!! If it is corrupted, |
|
1296 |
the MenuEditor may not be able to read the specification." |
|
1297 |
||
1298 |
" |
|
1299 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#directoryMenu |
|
1300 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser directoryMenu)) startUp |
|
1301 |
" |
|
1302 |
||
1303 |
<resource: #menu> |
|
1304 |
||
1305 |
^ |
|
6220 | 1306 |
#(Menu |
1307 |
( |
|
1308 |
(MenuItem |
|
1309 |
label: 'Up' |
|
1310 |
itemValue: doGoDirectoryUp |
|
1311 |
translateLabel: true |
|
4414 | 1312 |
) |
6220 | 1313 |
(MenuItem |
1314 |
label: '-' |
|
4414 | 1315 |
) |
6220 | 1316 |
(MenuItem |
1317 |
activeHelpKey: directoryBack |
|
1318 |
enabled: enableBack |
|
1319 |
label: 'Back' |
|
1320 |
itemValue: doBack |
|
1321 |
translateLabel: true |
|
4414 | 1322 |
) |
6220 | 1323 |
(MenuItem |
1324 |
activeHelpKey: directoryBack |
|
1325 |
enabled: enableForward |
|
1326 |
label: 'Forward' |
|
1327 |
itemValue: doForward |
|
1328 |
translateLabel: true |
|
4414 | 1329 |
) |
6220 | 1330 |
(MenuItem |
1331 |
label: '-' |
|
4414 | 1332 |
) |
6220 | 1333 |
(MenuItem |
6434 | 1334 |
label: 'Home Directory' |
1335 |
itemValue: doGotoHomeDirectory |
|
6456 | 1336 |
enabled: enableHome |
6434 | 1337 |
translateLabel: true |
1338 |
) |
|
1339 |
(MenuItem |
|
1340 |
label: 'Default (Current) Directory' |
|
6220 | 1341 |
itemValue: doGotoDefaultDirectory |
6456 | 1342 |
isVisible: gotoDefaultDirectoryIsVisible |
1343 |
enabled: enableGotoDefaultDirectory |
|
6220 | 1344 |
translateLabel: true |
4414 | 1345 |
) |
6220 | 1346 |
(MenuItem |
6434 | 1347 |
label: 'Smalltalk (Application) Directory' |
1348 |
itemValue: doGotoSmalltalkDirectory |
|
1349 |
enabled: enableGotoSmalltalkDirectory |
|
6220 | 1350 |
translateLabel: true |
4414 | 1351 |
) |
6220 | 1352 |
(MenuItem |
1353 |
label: 'Bookmarks' |
|
1354 |
translateLabel: true |
|
9111
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1355 |
submenuChannel: bookmarksMenu |
4414 | 1356 |
) |
6220 | 1357 |
(MenuItem |
1358 |
label: 'Visited Directories' |
|
1359 |
translateLabel: true |
|
1360 |
submenuChannel: visitedDirectoriesMenu |
|
4414 | 1361 |
) |
1362 |
) |
|
1363 |
nil |
|
1364 |
nil |
|
3892 | 1365 |
) |
1366 |
! |
|
1367 |
||
1368 |
editMenu |
|
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:AbstractFileBrowser andSelector:#editMenu |
|
1377 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser editMenu)) startUp |
|
1378 |
" |
|
1379 |
||
1380 |
<resource: #menu> |
|
1381 |
||
1382 |
^ |
|
5888 | 1383 |
#(Menu |
1384 |
( |
|
1385 |
(MenuItem |
|
1386 |
enabled: hasFileSelection |
|
1387 |
label: 'Copy Selected Filenames to Clipboard' |
|
1388 |
itemValue: copySelectedFilenames |
|
1389 |
translateLabel: true |
|
4414 | 1390 |
) |
5888 | 1391 |
(MenuItem |
1392 |
enabled: fileListIsNotEmpty |
|
1393 |
label: 'Copy All Filenames to Clipboard' |
|
1394 |
itemValue: copyFileList |
|
1395 |
translateLabel: true |
|
4940
4964068c4718
allow settings dialog to be opened from browser
Claus Gittinger <cg@exept.de>
parents:
4930
diff
changeset
|
1396 |
) |
4414 | 1397 |
) |
1398 |
nil |
|
1399 |
nil |
|
3892 | 1400 |
) |
1401 |
! |
|
1402 |
||
6099 | 1403 |
emptyMenuSpec |
1404 |
"This resource specification was automatically generated |
|
1405 |
by the MenuEditor of ST/X." |
|
1406 |
||
1407 |
"Do not manually edit this!! If it is corrupted, |
|
1408 |
the MenuEditor may not be able to read the specification." |
|
1409 |
||
1410 |
" |
|
1411 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#emptyMenuSpec |
|
1412 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser emptyMenuSpec)) startUp |
|
1413 |
" |
|
1414 |
||
1415 |
<resource: #menu> |
|
1416 |
||
1417 |
^ |
|
1418 |
#(#Menu |
|
1419 |
#( |
|
1420 |
) |
|
1421 |
nil |
|
1422 |
nil |
|
1423 |
) |
|
1424 |
! |
|
1425 |
||
3892 | 1426 |
fileMenu |
1427 |
"This resource specification was automatically generated |
|
1428 |
by the MenuEditor of ST/X." |
|
1429 |
||
1430 |
"Do not manually edit this!! If it is corrupted, |
|
1431 |
the MenuEditor may not be able to read the specification." |
|
1432 |
||
1433 |
" |
|
1434 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#fileMenu |
|
1435 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser fileMenu)) startUp |
|
1436 |
" |
|
1437 |
||
1438 |
<resource: #menu> |
|
1439 |
||
1440 |
^ |
|
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1441 |
#(Menu |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1442 |
( |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1443 |
(MenuItem |
6593 | 1444 |
label: 'Open' |
1445 |
itemValue: doShowFileContents |
|
1446 |
translateLabel: true |
|
1447 |
) |
|
1448 |
(MenuItem |
|
1449 |
enabled: hasFileSelection |
|
1450 |
label: 'FileIn' |
|
1451 |
itemValue: fileFileIn |
|
1452 |
translateLabel: true |
|
1453 |
) |
|
1454 |
(MenuItem |
|
1455 |
enabled: hasFileSelection |
|
1456 |
label: 'FileIn to Namespace...' |
|
1457 |
itemValue: fileFileInToNameSpace |
|
1458 |
translateLabel: true |
|
1459 |
) |
|
1460 |
(MenuItem |
|
1461 |
label: '-' |
|
1462 |
) |
|
1463 |
(MenuItem |
|
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1464 |
label: 'New' |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1465 |
translateLabel: true |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1466 |
submenuChannel: newMenu |
5425 | 1467 |
keepLinkedMenu: true |
4414 | 1468 |
) |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1469 |
(MenuItem |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1470 |
label: '-' |
4534 | 1471 |
) |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1472 |
(MenuItem |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1473 |
enabled: hasSelection |
5945 | 1474 |
label: 'Cut' |
1475 |
itemValue: cutFiles |
|
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1476 |
translateLabel: true |
4789
238d5e783f5c
editMenu was really a file menu
Claus Gittinger <cg@exept.de>
parents:
4785
diff
changeset
|
1477 |
) |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1478 |
(MenuItem |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1479 |
enabled: hasSelection |
5945 | 1480 |
label: 'Copy' |
1481 |
itemValue: copyFiles |
|
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1482 |
translateLabel: true |
4789
238d5e783f5c
editMenu was really a file menu
Claus Gittinger <cg@exept.de>
parents:
4785
diff
changeset
|
1483 |
) |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1484 |
(MenuItem |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1485 |
enabled: canPaste |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1486 |
label: 'Paste' |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1487 |
itemValue: pasteFiles |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1488 |
translateLabel: true |
4789
238d5e783f5c
editMenu was really a file menu
Claus Gittinger <cg@exept.de>
parents:
4785
diff
changeset
|
1489 |
) |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1490 |
(MenuItem |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1491 |
enabled: hasSelection |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1492 |
label: 'Delete' |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1493 |
itemValue: deleteFiles |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1494 |
translateLabel: true |
4789
238d5e783f5c
editMenu was really a file menu
Claus Gittinger <cg@exept.de>
parents:
4785
diff
changeset
|
1495 |
) |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1496 |
(MenuItem |
6169 | 1497 |
enabled: hasSelection |
1498 |
label: 'Erase' |
|
1499 |
itemValue: eraseFiles |
|
1500 |
translateLabel: true |
|
1501 |
) |
|
1502 |
(MenuItem |
|
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1503 |
label: '-' |
4789
238d5e783f5c
editMenu was really a file menu
Claus Gittinger <cg@exept.de>
parents:
4785
diff
changeset
|
1504 |
) |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1505 |
(MenuItem |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1506 |
enabled: hasSelection |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1507 |
label: 'Rename...' |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1508 |
itemValue: renameSelection |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1509 |
translateLabel: true |
8716 | 1510 |
shortcutKey: Rename |
4414 | 1511 |
) |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1512 |
(MenuItem |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1513 |
enabled: hasSelection |
5634 | 1514 |
label: 'Move To...' |
6107 | 1515 |
itemValue: moveSelectionTo |
1516 |
translateLabel: true |
|
1517 |
) |
|
1518 |
(MenuItem |
|
1519 |
enabled: hasSelection |
|
1520 |
label: 'Copy To...' |
|
1521 |
itemValue: copySelectionTo |
|
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1522 |
translateLabel: true |
4414 | 1523 |
) |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1524 |
(MenuItem |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1525 |
enabled: hasSelection |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1526 |
label: 'Properties...' |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1527 |
itemValue: doShowProperties |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1528 |
translateLabel: true |
4554 | 1529 |
) |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1530 |
(MenuItem |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1531 |
label: '-' |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1532 |
isVisible: javaSupportLoaded |
4414 | 1533 |
) |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1534 |
(MenuItem |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1535 |
enabled: canAddToClassPath |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1536 |
label: 'Add to Java Class Path' |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1537 |
translateLabel: true |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1538 |
isVisible: javaSupportLoaded |
4414 | 1539 |
) |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1540 |
(MenuItem |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1541 |
enabled: canRemoveFromClassPath |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1542 |
label: 'Remove from Java Class Path' |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1543 |
translateLabel: true |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1544 |
isVisible: javaSupportLoaded |
4414 | 1545 |
) |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1546 |
(MenuItem |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1547 |
enabled: canAddToSourcePath |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1548 |
label: 'Add to Java Source Path' |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1549 |
translateLabel: true |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1550 |
isVisible: javaSupportLoaded |
4414 | 1551 |
) |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1552 |
(MenuItem |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1553 |
enabled: canRemoveFromSourcePath |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1554 |
label: 'Remove from Java Source Path' |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1555 |
translateLabel: true |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1556 |
isVisible: javaSupportLoaded |
4414 | 1557 |
) |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1558 |
(MenuItem |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1559 |
label: '-' |
5242
04616d3a672c
history fixed (only kept the oldest items, instead of the newest ones)
Claus Gittinger <cg@exept.de>
parents:
5162
diff
changeset
|
1560 |
) |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1561 |
(MenuItem |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1562 |
enabled: enableFileHistory |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1563 |
label: 'File History' |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1564 |
translateLabel: true |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1565 |
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
|
1566 |
) |
4414 | 1567 |
) |
1568 |
nil |
|
1569 |
nil |
|
3892 | 1570 |
) |
7635 | 1571 |
|
1572 |
"Modified: / 07-02-2007 / 18:44:54 / cg" |
|
3892 | 1573 |
! |
1574 |
||
4930 | 1575 |
fileOpMenu |
1576 |
"This resource specification was automatically generated |
|
1577 |
by the MenuEditor of ST/X." |
|
1578 |
||
1579 |
"Do not manually edit this!! If it is corrupted, |
|
1580 |
the MenuEditor may not be able to read the specification." |
|
1581 |
||
1582 |
" |
|
1583 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#fileOpMenu |
|
1584 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser fileOpMenu)) startUp |
|
1585 |
" |
|
1586 |
||
1587 |
<resource: #menu> |
|
1588 |
||
1589 |
^ |
|
8640
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1590 |
#(Menu |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1591 |
( |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1592 |
(MenuItem |
8648
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
1593 |
label: 'Generate Signed Files' |
8640
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1594 |
itemValue: generateSignaturesForSelectedFiles |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1595 |
translateLabel: true |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1596 |
isVisible: canGenerateSignatureFiles |
4930 | 1597 |
) |
8640
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1598 |
(MenuItem |
8648
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
1599 |
label: 'Generate Detached Signature Files (use for dll)' |
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
1600 |
itemValue: generateDetachedSignaturesForSelectedFiles |
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
1601 |
translateLabel: true |
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
1602 |
isVisible: canGenerateSignatureFiles |
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
1603 |
) |
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
1604 |
(MenuItem |
8640
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1605 |
label: '-' |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1606 |
isVisible: canGenerateSignatureFiles |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1607 |
) |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1608 |
(MenuItem |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1609 |
label: 'Split...' |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1610 |
itemValue: splitSelectedFiles |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1611 |
translateLabel: true |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1612 |
) |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1613 |
(MenuItem |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1614 |
label: 'Join...' |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1615 |
itemValue: joinSelectedFiles |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1616 |
translateLabel: true |
4930 | 1617 |
) |
7635 | 1618 |
(MenuItem |
1619 |
label: 'Copy Corrupted File To...' |
|
1620 |
itemValue: copySelectionToRepairingCorruptedFiles |
|
1621 |
translateLabel: true |
|
1622 |
) |
|
8640
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1623 |
(MenuItem |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1624 |
label: '-' |
4930 | 1625 |
) |
8640
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1626 |
(MenuItem |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1627 |
label: 'Rot13...' |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1628 |
itemValue: filterSelectedFiles: |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1629 |
translateLabel: true |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1630 |
argument: rot13 |
4930 | 1631 |
) |
8640
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1632 |
(MenuItem |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1633 |
label: '-' |
4930 | 1634 |
) |
8640
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1635 |
(MenuItem |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1636 |
label: 'Truncate...' |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1637 |
itemValue: truncateSelectedFilesToZeroSize |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1638 |
translateLabel: true |
4930 | 1639 |
) |
1640 |
) |
|
1641 |
nil |
|
1642 |
nil |
|
1643 |
) |
|
1644 |
! |
|
1645 |
||
3892 | 1646 |
newMenu |
1647 |
"This resource specification was automatically generated |
|
1648 |
by the MenuEditor of ST/X." |
|
1649 |
||
1650 |
"Do not manually edit this!! If it is corrupted, |
|
1651 |
the MenuEditor may not be able to read the specification." |
|
1652 |
||
1653 |
" |
|
1654 |
MenuEditor new openOnClass:DirectoryTreeBrowser andSelector:#newMenu |
|
1655 |
(Menu new fromLiteralArrayEncoding:(DirectoryTreeBrowser newMenu)) startUp |
|
1656 |
" |
|
1657 |
||
1658 |
<resource: #menu> |
|
1659 |
||
1660 |
^ |
|
1661 |
#(#Menu |
|
4414 | 1662 |
#( |
1663 |
#(#MenuItem |
|
1664 |
#label: 'Directory...' |
|
1665 |
#translateLabel: true |
|
1666 |
#value: #newDirectory |
|
1667 |
) |
|
1668 |
#(#MenuItem |
|
1669 |
#label: 'File...' |
|
1670 |
#translateLabel: true |
|
1671 |
#value: #newFile |
|
1672 |
) |
|
1673 |
#(#MenuItem |
|
1674 |
#label: 'Hard Link...' |
|
1675 |
#translateLabel: true |
|
1676 |
#isVisible: #systemIsUnix |
|
1677 |
#value: #newHardLink |
|
1678 |
) |
|
1679 |
#(#MenuItem |
|
1680 |
#label: 'Symbolic Link...' |
|
1681 |
#translateLabel: true |
|
1682 |
#isVisible: #systemIsUnix |
|
1683 |
#value: #newSoftLink |
|
1684 |
) |
|
1685 |
) |
|
1686 |
nil |
|
1687 |
nil |
|
3892 | 1688 |
) |
3906 | 1689 |
! |
1690 |
||
4201 | 1691 |
showMenuSpec |
1692 |
"This resource specification was automatically generated |
|
1693 |
by the MenuEditor of ST/X." |
|
1694 |
||
1695 |
"Do not manually edit this!! If it is corrupted, |
|
1696 |
the MenuEditor may not be able to read the specification." |
|
1697 |
||
1698 |
" |
|
1699 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#showMenuSpec |
|
1700 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser showMenuSpec)) startUp |
|
1701 |
" |
|
1702 |
||
1703 |
<resource: #menu> |
|
1704 |
||
1705 |
^ |
|
9111
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1706 |
#(Menu |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1707 |
( |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1708 |
(MenuItem |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1709 |
label: 'Hidden Files' |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1710 |
translateLabel: true |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1711 |
hideMenuOnActivated: false |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1712 |
indication: showHiddenFiles |
4201 | 1713 |
) |
9111
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1714 |
(MenuItem |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1715 |
label: '-' |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1716 |
) |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1717 |
(MenuItem |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1718 |
label: 'Directory Tree' |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1719 |
translateLabel: true |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1720 |
hideMenuOnActivated: false |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1721 |
indication: showDirectoryTree |
4201 | 1722 |
) |
9111
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1723 |
(MenuItem |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1724 |
label: 'Regular Files in TreeView (Left)' |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1725 |
translateLabel: true |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1726 |
hideMenuOnActivated: false |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1727 |
indication: viewFilesInDirectoryTree |
4201 | 1728 |
) |
9111
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1729 |
(MenuItem |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1730 |
label: 'Directories in ContentsView (Right)' |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1731 |
translateLabel: true |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1732 |
hideMenuOnActivated: false |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1733 |
indication: viewDirsInContentsBrowser |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1734 |
) |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1735 |
(MenuItem |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1736 |
enabled: enableViewNoteBookApplication |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1737 |
label: 'File Applications' |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1738 |
translateLabel: true |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1739 |
hideMenuOnActivated: false |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1740 |
indication: viewNoteBookApplicationHolder |
4201 | 1741 |
) |
9111
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1742 |
(MenuItem |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1743 |
label: '-' |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1744 |
) |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1745 |
(MenuItem |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1746 |
label: 'DiskUsage' |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1747 |
translateLabel: true |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1748 |
hideMenuOnActivated: false |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1749 |
indication: showDiskUsageHolder |
4201 | 1750 |
) |
9111
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1751 |
) |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1752 |
nil |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1753 |
nil |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1754 |
) |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1755 |
! |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1756 |
|
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1757 |
showMenuSpecForDialog |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1758 |
"This resource specification was automatically generated |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1759 |
by the MenuEditor of ST/X." |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1760 |
|
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1761 |
"Do not manually edit this!! If it is corrupted, |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1762 |
the MenuEditor may not be able to read the specification." |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1763 |
|
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1764 |
" |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1765 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#showMenuSpecForDialog |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1766 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser showMenuSpecForDialog)) startUp |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1767 |
" |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1768 |
|
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1769 |
<resource: #menu> |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1770 |
|
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1771 |
^ |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1772 |
#(Menu |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1773 |
( |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1774 |
(MenuItem |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1775 |
label: 'Hidden Files' |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1776 |
translateLabel: true |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1777 |
hideMenuOnActivated: false |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1778 |
indication: showHiddenFiles |
4554 | 1779 |
) |
4201 | 1780 |
) |
1781 |
nil |
|
1782 |
nil |
|
1783 |
) |
|
1784 |
! |
|
1785 |
||
3906 | 1786 |
sortMenu |
1787 |
"This resource specification was automatically generated |
|
1788 |
by the MenuEditor of ST/X." |
|
1789 |
||
1790 |
"Do not manually edit this!! If it is corrupted, |
|
1791 |
the MenuEditor may not be able to read the specification." |
|
1792 |
||
1793 |
" |
|
3907 | 1794 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#sortMenu |
1795 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser sortMenu)) startUp |
|
3906 | 1796 |
" |
1797 |
||
1798 |
<resource: #menu> |
|
1799 |
||
1800 |
^ |
|
1801 |
#(#Menu |
|
4414 | 1802 |
#( |
1803 |
#(#MenuItem |
|
1804 |
#label: 'By Filename' |
|
1805 |
#translateLabel: true |
|
1806 |
#hideMenuOnActivated: false |
|
1807 |
#choice: #sortBlockProperty |
|
1808 |
#choiceValue: #baseName |
|
1809 |
) |
|
1810 |
#(#MenuItem |
|
5122 | 1811 |
#label: 'By Extension' |
4414 | 1812 |
#translateLabel: true |
1813 |
#hideMenuOnActivated: false |
|
1814 |
#choice: #sortBlockProperty |
|
1815 |
#choiceValue: #suffix |
|
1816 |
) |
|
1817 |
#(#MenuItem |
|
1818 |
#label: 'By Permissions' |
|
1819 |
#translateLabel: true |
|
1820 |
#hideMenuOnActivated: false |
|
1821 |
#choice: #sortBlockProperty |
|
1822 |
#choiceValue: #permissions |
|
1823 |
) |
|
1824 |
#(#MenuItem |
|
1825 |
#label: 'By Owner' |
|
1826 |
#translateLabel: true |
|
1827 |
#isVisible: #viewOwner |
|
1828 |
#hideMenuOnActivated: false |
|
1829 |
#choice: #sortBlockProperty |
|
1830 |
#choiceValue: #owner |
|
1831 |
) |
|
1832 |
#(#MenuItem |
|
1833 |
#label: 'By Group' |
|
1834 |
#translateLabel: true |
|
1835 |
#isVisible: #viewOwner |
|
1836 |
#hideMenuOnActivated: false |
|
1837 |
#choice: #sortBlockProperty |
|
1838 |
#choiceValue: #group |
|
1839 |
) |
|
1840 |
#(#MenuItem |
|
1841 |
#label: 'By Size' |
|
1842 |
#translateLabel: true |
|
1843 |
#hideMenuOnActivated: false |
|
1844 |
#choice: #sortBlockProperty |
|
1845 |
#choiceValue: #fileSize |
|
1846 |
) |
|
1847 |
#(#MenuItem |
|
1848 |
#label: 'By Date && Time' |
|
1849 |
#translateLabel: true |
|
1850 |
#hideMenuOnActivated: false |
|
1851 |
#choice: #sortBlockProperty |
|
1852 |
#choiceValue: #modificationTime |
|
1853 |
) |
|
1854 |
#(#MenuItem |
|
1855 |
#label: '-' |
|
1856 |
) |
|
1857 |
#(#MenuItem |
|
1858 |
#label: 'Ignore Case in Sort' |
|
1859 |
#translateLabel: true |
|
1860 |
#hideMenuOnActivated: false |
|
1861 |
#indication: #sortCaseless |
|
1862 |
) |
|
1863 |
#(#MenuItem |
|
1864 |
#label: 'Directories before Files' |
|
1865 |
#translateLabel: true |
|
1866 |
#hideMenuOnActivated: false |
|
1867 |
#indication: #sortDirectoriesBeforeFiles |
|
1868 |
) |
|
1869 |
) |
|
1870 |
nil |
|
1871 |
nil |
|
3906 | 1872 |
) |
4018 | 1873 |
! |
1874 |
||
4164
81154143d447
move toolsMenuSpec from FileBrowserV2 to AbstractFileBrowser
penk
parents:
4163
diff
changeset
|
1875 |
toolsMenuSpec |
81154143d447
move toolsMenuSpec from FileBrowserV2 to AbstractFileBrowser
penk
parents:
4163
diff
changeset
|
1876 |
"This resource specification was automatically generated |
81154143d447
move toolsMenuSpec from FileBrowserV2 to AbstractFileBrowser
penk
parents:
4163
diff
changeset
|
1877 |
by the MenuEditor of ST/X." |
81154143d447
move toolsMenuSpec from FileBrowserV2 to AbstractFileBrowser
penk
parents:
4163
diff
changeset
|
1878 |
|
81154143d447
move toolsMenuSpec from FileBrowserV2 to AbstractFileBrowser
penk
parents:
4163
diff
changeset
|
1879 |
"Do not manually edit this!! If it is corrupted, |
81154143d447
move toolsMenuSpec from FileBrowserV2 to AbstractFileBrowser
penk
parents:
4163
diff
changeset
|
1880 |
the MenuEditor may not be able to read the specification." |
81154143d447
move toolsMenuSpec from FileBrowserV2 to AbstractFileBrowser
penk
parents:
4163
diff
changeset
|
1881 |
|
81154143d447
move toolsMenuSpec from FileBrowserV2 to AbstractFileBrowser
penk
parents:
4163
diff
changeset
|
1882 |
" |
4367 | 1883 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#toolsMenuSpec |
1884 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser toolsMenuSpec)) startUp |
|
4164
81154143d447
move toolsMenuSpec from FileBrowserV2 to AbstractFileBrowser
penk
parents:
4163
diff
changeset
|
1885 |
" |
81154143d447
move toolsMenuSpec from FileBrowserV2 to AbstractFileBrowser
penk
parents:
4163
diff
changeset
|
1886 |
|
81154143d447
move toolsMenuSpec from FileBrowserV2 to AbstractFileBrowser
penk
parents:
4163
diff
changeset
|
1887 |
<resource: #menu> |
81154143d447
move toolsMenuSpec from FileBrowserV2 to AbstractFileBrowser
penk
parents:
4163
diff
changeset
|
1888 |
|
81154143d447
move toolsMenuSpec from FileBrowserV2 to AbstractFileBrowser
penk
parents:
4163
diff
changeset
|
1889 |
^ |
5830 | 1890 |
#(Menu |
1891 |
( |
|
1892 |
(MenuItem |
|
6528 | 1893 |
label: 'Execute UNIX Command...' |
5830 | 1894 |
itemValue: doExecuteCommand |
1895 |
translateLabel: true |
|
6528 | 1896 |
isVisible: systemIsUnix |
1897 |
) |
|
1898 |
(MenuItem |
|
1899 |
label: 'Execute DOS Command...' |
|
1900 |
itemValue: doExecuteCommand |
|
1901 |
translateLabel: true |
|
1902 |
isVisible: systemIsDOS |
|
4230 | 1903 |
) |
5830 | 1904 |
(MenuItem |
5880 | 1905 |
label: 'Execute Script...' |
1906 |
itemValue: doExecuteScript |
|
1907 |
translateLabel: true |
|
1908 |
) |
|
1909 |
(MenuItem |
|
5830 | 1910 |
enabled: canDoTerminal |
1911 |
label: 'Shell Terminal' |
|
1912 |
itemValue: openTerminal |
|
1913 |
translateLabel: true |
|
1914 |
isVisible: canDoTerminalAndSystemIsUnix |
|
4230 | 1915 |
) |
5830 | 1916 |
(MenuItem |
1917 |
enabled: canDoTerminal |
|
1918 |
label: 'DOS Terminal' |
|
1919 |
itemValue: openTerminal |
|
1920 |
translateLabel: true |
|
1921 |
isVisible: canDoTerminalAndSystemIsDOS |
|
4230 | 1922 |
) |
5830 | 1923 |
(MenuItem |
1924 |
label: '-' |
|
4230 | 1925 |
) |
5830 | 1926 |
(MenuItem |
1927 |
enabled: hasFileSelection |
|
1928 |
label: 'Changes Browser' |
|
1929 |
itemValue: openChangesBrowser |
|
1930 |
translateLabel: true |
|
4230 | 1931 |
) |
5830 | 1932 |
(MenuItem |
1933 |
enabled: hasFileSelection |
|
1934 |
label: 'ChangeSet Browser' |
|
1935 |
itemValue: openChangeSetBrowser |
|
1936 |
translateLabel: true |
|
6602 | 1937 |
isVisible: changeSetBrowserItemVisible |
4230 | 1938 |
) |
5830 | 1939 |
(MenuItem |
6022 | 1940 |
enabled: hasFileSelection |
1941 |
label: 'Workspace' |
|
1942 |
itemValue: openWorkspace |
|
1943 |
translateLabel: true |
|
1944 |
) |
|
1945 |
(MenuItem |
|
1946 |
label: '-' |
|
1947 |
) |
|
1948 |
(MenuItem |
|
5830 | 1949 |
enabled: canReadAbbrevFile |
1950 |
label: 'Install Autoloaded' |
|
1951 |
itemValue: readAbbrevFile |
|
1952 |
translateLabel: true |
|
4230 | 1953 |
) |
5830 | 1954 |
(MenuItem |
1955 |
enabled: anySTFilesPresent |
|
6521 | 1956 |
label: 'Install All ST-Files as Autoloaded' |
5830 | 1957 |
itemValue: installAllAsAutoloaded |
1958 |
translateLabel: true |
|
4230 | 1959 |
) |
5830 | 1960 |
(MenuItem |
6586 | 1961 |
enabled: recursiveAnySTFilesPresent |
6521 | 1962 |
label: 'Recursive Install All ST-Files as Autoloaded' |
1963 |
itemValue: installAllAsAutoloadedRecursive |
|
1964 |
translateLabel: true |
|
1965 |
) |
|
1966 |
(MenuItem |
|
5830 | 1967 |
label: '-' |
4230 | 1968 |
) |
5830 | 1969 |
(MenuItem |
6593 | 1970 |
label: 'File Operations' |
1971 |
translateLabel: true |
|
1972 |
submenuChannel: fileOpMenu |
|
1973 |
) |
|
1974 |
(MenuItem |
|
5830 | 1975 |
label: 'File Utilities' |
1976 |
translateLabel: true |
|
1977 |
submenu: |
|
1978 |
(Menu |
|
1979 |
( |
|
1980 |
(MenuItem |
|
1981 |
enabled: hasFileSelection |
|
1982 |
label: 'Editor' |
|
1983 |
itemValue: openEditor |
|
1984 |
translateLabel: true |
|
4820 | 1985 |
) |
5830 | 1986 |
(MenuItem |
1987 |
enabled: hasFileSelection |
|
1988 |
label: 'HTML Reader' |
|
1989 |
itemValue: openHTMLReader |
|
1990 |
translateLabel: true |
|
4820 | 1991 |
) |
5830 | 1992 |
(MenuItem |
8832 | 1993 |
enabled: hasFileSelection |
1994 |
label: 'Web Browser' |
|
1995 |
itemValue: openWebBrowser |
|
1996 |
translateLabel: true |
|
1997 |
) |
|
1998 |
(MenuItem |
|
8611
3d979ab577b7
xml-inspector always enabled.
Claus Gittinger <cg@exept.de>
parents:
8601
diff
changeset
|
1999 |
"/ enabled: hasXmlFileSelected |
7869 | 2000 |
label: 'XML Inspector' |
2001 |
itemValue: parseXmlFile |
|
2002 |
translateLabel: true |
|
2003 |
isVisible: hasXml |
|
7897
598301fad7b4
Missing aspect #hasXmlFileSelection
Stefan Vogel <sv@exept.de>
parents:
7879
diff
changeset
|
2004 |
showBusyCursorWhilePerforming: true |
7869 | 2005 |
) |
2006 |
(MenuItem |
|
5830 | 2007 |
enabled: hasFileSelection |
2008 |
label: 'Acroread (PDF Viewer)' |
|
2009 |
itemValue: openPDFViewer |
|
2010 |
translateLabel: true |
|
4820 | 2011 |
) |
5830 | 2012 |
(MenuItem |
2013 |
enabled: hasASN1AndSelection |
|
2014 |
label: 'ASN1 Browser' |
|
2015 |
itemValue: openASN1Browser |
|
2016 |
translateLabel: true |
|
2017 |
isVisible: hasASN1 |
|
4820 | 2018 |
) |
5830 | 2019 |
(MenuItem |
2020 |
enabled: hasCBrowser |
|
2021 |
label: 'C Browser' |
|
2022 |
itemValue: openCBrowser |
|
2023 |
translateLabel: true |
|
2024 |
isVisible: hasCBrowser |
|
4820 | 2025 |
) |
5830 | 2026 |
(MenuItem |
2027 |
enabled: hasJavaAndSelection |
|
2028 |
label: 'Applet Viewer' |
|
2029 |
itemValue: openAppletViewer |
|
2030 |
translateLabel: true |
|
2031 |
isVisible: hasJava |
|
4820 | 2032 |
) |
5830 | 2033 |
(MenuItem |
2034 |
enabled: hasMP3PlayerAndSelection |
|
2035 |
label: 'MP3 Player' |
|
2036 |
itemValue: openMP3Player |
|
2037 |
translateLabel: true |
|
2038 |
isVisible: hasMP3Player |
|
4820 | 2039 |
) |
5830 | 2040 |
(MenuItem |
2041 |
enabled: hasFileSelection |
|
2042 |
label: 'xv (Image Viewer)' |
|
2043 |
itemValue: openXV |
|
2044 |
translateLabel: true |
|
6460 | 2045 |
isVisible: systemIsUnix |
4950 | 2046 |
) |
5830 | 2047 |
(MenuItem |
2048 |
enabled: currentFilesAreInSameDirectory |
|
2049 |
label: 'Slide Show' |
|
2050 |
itemValue: openSlideShow |
|
2051 |
translateLabel: true |
|
2052 |
isVisible: hasSlideShow |
|
4820 | 2053 |
) |
5830 | 2054 |
(MenuItem |
2055 |
enabled: hasFileSelection |
|
2056 |
label: 'gv (Postscript Viewer)' |
|
2057 |
itemValue: openGV |
|
2058 |
translateLabel: true |
|
6460 | 2059 |
isVisible: systemIsUnix |
2060 |
) |
|
2061 |
(MenuItem |
|
2062 |
enabled: hasMP3PlayerAndSelection |
|
2063 |
label: 'MP3 Player' |
|
2064 |
itemValue: openMP3Player |
|
2065 |
translateLabel: true |
|
2066 |
isVisible: hasMP3Player |
|
4957 | 2067 |
) |
5830 | 2068 |
(MenuItem |
2069 |
enabled: hasFileSelection |
|
2070 |
label: 'realplay (avi viewer)' |
|
2071 |
itemValue: openRP |
|
2072 |
translateLabel: true |
|
6460 | 2073 |
isVisible: systemIsUnix |
2074 |
) |
|
2075 |
(MenuItem |
|
2076 |
label: '-' |
|
2077 |
) |
|
2078 |
(MenuItem |
|
2079 |
label: 'Smalltalk' |
|
2080 |
translateLabel: true |
|
2081 |
submenu: |
|
2082 |
(Menu |
|
2083 |
( |
|
2084 |
(MenuItem |
|
2085 |
enabled: hasSnapshotSelection |
|
2086 |
label: 'Snapshot Image Browser' |
|
2087 |
itemValue: openSnapshotImageBrowser |
|
2088 |
translateLabel: true |
|
2089 |
) |
|
2090 |
(MenuItem |
|
2091 |
enabled: canCreateNewProject |
|
2092 |
label: 'Create Smalltalk Project' |
|
2093 |
itemValue: createProjectAndOpenProjectBrowser |
|
2094 |
translateLabel: true |
|
2095 |
) |
|
2096 |
(MenuItem |
|
2097 |
label: '-' |
|
2098 |
) |
|
2099 |
(MenuItem |
|
8426 | 2100 |
enabled: hasResourceFileSelected |
6460 | 2101 |
label: 'Show Contents of Resourcefile' |
2102 |
itemValue: readAndShowResources |
|
2103 |
translateLabel: true |
|
2104 |
) |
|
8426 | 2105 |
(MenuItem |
2106 |
enabled: hasResourceFileSelected |
|
2107 |
label: 'Resource File Editor' |
|
2108 |
itemValue: openResourceFileEditor |
|
2109 |
translateLabel: true |
|
2110 |
showBusyCursorWhilePerforming: true |
|
2111 |
) |
|
8454
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
2112 |
(MenuItem |
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
2113 |
label: '-' |
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
2114 |
) |
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
2115 |
(MenuItem |
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
2116 |
enabled: hasFileSelection |
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
2117 |
label: 'Contents as ByteArray' |
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
2118 |
itemValue: fileContentsAsByteArray |
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
2119 |
translateLabel: true |
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
2120 |
) |
6460 | 2121 |
) |
2122 |
nil |
|
2123 |
nil |
|
2124 |
) |
|
2125 |
) |
|
2126 |
(MenuItem |
|
2127 |
label: 'Image' |
|
2128 |
translateLabel: true |
|
2129 |
submenu: |
|
2130 |
(Menu |
|
2131 |
( |
|
2132 |
(MenuItem |
|
2133 |
enabled: hasFileSelection |
|
2134 |
label: 'Image Editor' |
|
2135 |
itemValue: openImageEditor |
|
2136 |
translateLabel: true |
|
2137 |
) |
|
2138 |
(MenuItem |
|
2139 |
enabled: hasFileSelection |
|
2140 |
label: 'Image Preview' |
|
2141 |
itemValue: openImagePreview |
|
2142 |
translateLabel: true |
|
2143 |
) |
|
2144 |
(MenuItem |
|
2145 |
enabled: hasFileSelection |
|
2146 |
label: 'Image Inspector' |
|
2147 |
itemValue: openImageInspector |
|
2148 |
translateLabel: true |
|
2149 |
) |
|
2150 |
(MenuItem |
|
2151 |
label: '-' |
|
2152 |
) |
|
2153 |
(MenuItem |
|
2154 |
enabled: hasFileSelection |
|
2155 |
label: 'Convert to GIF' |
|
2156 |
itemValue: convertImageToGIF |
|
2157 |
translateLabel: true |
|
2158 |
) |
|
2159 |
(MenuItem |
|
2160 |
enabled: hasFileSelection |
|
2161 |
label: 'Convert to PNG' |
|
2162 |
itemValue: convertImageToPNG |
|
2163 |
translateLabel: true |
|
2164 |
) |
|
2165 |
(MenuItem |
|
2166 |
enabled: hasFileSelection |
|
2167 |
label: 'Convert to XPM' |
|
2168 |
itemValue: convertImageToXPM |
|
2169 |
translateLabel: true |
|
2170 |
) |
|
2171 |
(MenuItem |
|
2172 |
enabled: hasFileSelection |
|
2173 |
label: 'Convert to JPG' |
|
2174 |
itemValue: convertImageToJPG |
|
2175 |
translateLabel: true |
|
2176 |
) |
|
2177 |
) |
|
2178 |
nil |
|
2179 |
nil |
|
2180 |
) |
|
2181 |
) |
|
2182 |
(MenuItem |
|
2183 |
enabled: hasZipFileSelected |
|
2184 |
label: 'ZipFile Tool' |
|
2185 |
itemValue: openZipTool |
|
2186 |
translateLabel: true |
|
2187 |
) |
|
2188 |
(MenuItem |
|
2189 |
enabled: hasFileSelection |
|
2190 |
label: 'Hex Dump' |
|
2191 |
itemValue: fileHexDump |
|
2192 |
translateLabel: true |
|
4958 | 2193 |
) |
4820 | 2194 |
) |
2195 |
nil |
|
2196 |
nil |
|
2197 |
) |
|
4230 | 2198 |
) |
5830 | 2199 |
(MenuItem |
2200 |
label: 'Find' |
|
2201 |
translateLabel: true |
|
2202 |
submenu: |
|
2203 |
(Menu |
|
2204 |
( |
|
2205 |
(MenuItem |
|
2206 |
label: 'File...' |
|
2207 |
itemValue: fileFindFile |
|
2208 |
translateLabel: true |
|
4367 | 2209 |
) |
5830 | 2210 |
(MenuItem |
2211 |
label: 'Duplicate Files' |
|
2212 |
itemValue: fileFindDuplicates |
|
2213 |
translateLabel: true |
|
5082 | 2214 |
) |
5830 | 2215 |
(MenuItem |
2216 |
enabled: hasSelection |
|
2217 |
label: 'All Duplicate Files (Recursive)' |
|
2218 |
itemValue: fileFindAllDuplicates |
|
2219 |
translateLabel: true |
|
4367 | 2220 |
) |
8510 | 2221 |
(MenuItem |
2222 |
label: 'Similar Image Files' |
|
2223 |
itemValue: fileFindSimilarImages |
|
2224 |
translateLabel: true |
|
2225 |
isVisible: hasImageColorHistogram |
|
2226 |
) |
|
4367 | 2227 |
) |
2228 |
nil |
|
2229 |
nil |
|
2230 |
) |
|
4230 | 2231 |
) |
5830 | 2232 |
(MenuItem |
2233 |
enabled: hasSelection |
|
2234 |
label: 'File Differences' |
|
2235 |
itemValue: openDiffView |
|
2236 |
translateLabel: true |
|
2237 |
isVisible: hasTwoFilesSelectedHolder |
|
4230 | 2238 |
) |
5830 | 2239 |
(MenuItem |
2240 |
enabled: hasSelection |
|
2241 |
label: 'File Differences...' |
|
2242 |
itemValue: openDiffView |
|
2243 |
translateLabel: true |
|
2244 |
isVisible: hasNotTwoFilesSelectedHolder |
|
2245 |
) |
|
4230 | 2246 |
) |
2247 |
nil |
|
2248 |
nil |
|
4164
81154143d447
move toolsMenuSpec from FileBrowserV2 to AbstractFileBrowser
penk
parents:
4163
diff
changeset
|
2249 |
) |
81154143d447
move toolsMenuSpec from FileBrowserV2 to AbstractFileBrowser
penk
parents:
4163
diff
changeset
|
2250 |
! |
81154143d447
move toolsMenuSpec from FileBrowserV2 to AbstractFileBrowser
penk
parents:
4163
diff
changeset
|
2251 |
|
4018 | 2252 |
viewDetailsMenuSpec |
2253 |
"This resource specification was automatically generated |
|
2254 |
by the MenuEditor of ST/X." |
|
2255 |
||
2256 |
"Do not manually edit this!! If it is corrupted, |
|
2257 |
the MenuEditor may not be able to read the specification." |
|
2258 |
||
2259 |
" |
|
4648 | 2260 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#viewDetailsMenuSpec |
2261 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser viewDetailsMenuSpec)) startUp |
|
4018 | 2262 |
" |
2263 |
||
2264 |
<resource: #menu> |
|
2265 |
||
2266 |
^ |
|
2267 |
#(#Menu |
|
4414 | 2268 |
#( |
2269 |
#(#MenuItem |
|
2270 |
#label: '-' |
|
2271 |
) |
|
2272 |
#(#MenuItem |
|
2273 |
#label: 'Hidden Files' |
|
2274 |
#translateLabel: true |
|
2275 |
#indication: #showHiddenFiles |
|
2276 |
) |
|
2277 |
) |
|
2278 |
nil |
|
2279 |
nil |
|
4018 | 2280 |
) |
3892 | 2281 |
! ! |
2282 |
||
2283 |
!AbstractFileBrowser class methodsFor:'misc'! |
|
2284 |
||
2285 |
newLock |
|
2286 |
^ CodeExecutionLock new |
|
2287 |
! ! |
|
2288 |
||
5644
e24749db1f5f
share resources with FileBrowser
Claus Gittinger <cg@exept.de>
parents:
5634
diff
changeset
|
2289 |
!AbstractFileBrowser class methodsFor:'resources'! |
e24749db1f5f
share resources with FileBrowser
Claus Gittinger <cg@exept.de>
parents:
5634
diff
changeset
|
2290 |
|
e24749db1f5f
share resources with FileBrowser
Claus Gittinger <cg@exept.de>
parents:
5634
diff
changeset
|
2291 |
classResources |
e24749db1f5f
share resources with FileBrowser
Claus Gittinger <cg@exept.de>
parents:
5634
diff
changeset
|
2292 |
^ FileBrowser classResources |
e24749db1f5f
share resources with FileBrowser
Claus Gittinger <cg@exept.de>
parents:
5634
diff
changeset
|
2293 |
! ! |
e24749db1f5f
share resources with FileBrowser
Claus Gittinger <cg@exept.de>
parents:
5634
diff
changeset
|
2294 |
|
4610 | 2295 |
!AbstractFileBrowser class methodsFor:'utilities'! |
2296 |
||
2297 |
contentsOfFileAsHexDump:f |
|
8472 | 2298 |
^ self contentsOfFileAsHexDump:f withLimit:nil lastPart:nil |
2299 |
! |
|
2300 |
||
2301 |
contentsOfFileAsHexDump:f withLimit:limitOrNil lastPart:showLastPartOrNil |
|
4610 | 2302 |
|resources fileName stream data offs |
8472 | 2303 |
addrDigits col line lineStream asciiLineStream lines answer sizeLimit showLastPart| |
4610 | 2304 |
|
2305 |
resources := self classResources. |
|
2306 |
||
2307 |
fileName := f baseName. |
|
2308 |
f isDirectory ifTrue:[ |
|
2309 |
Dialog warn:(resources string:'%1 is a directory.' with:fileName). |
|
2310 |
^ nil |
|
2311 |
]. |
|
2312 |
f exists ifFalse:[ |
|
2313 |
Dialog warn:(resources string:'oops, ''%1'' is gone or unreadable.' with:fileName). |
|
2314 |
^ nil |
|
2315 |
]. |
|
2316 |
f isReadable ifFalse:[ |
|
2317 |
Dialog warn:(resources string:'''%1'' is unreadable.' with:fileName). |
|
2318 |
^ nil |
|
2319 |
]. |
|
6672
478b83a3753a
max size to be shown without dialog
Claus Gittinger <cg@exept.de>
parents:
6671
diff
changeset
|
2320 |
f fileSize > (1024*1024) ifTrue:[ |
8472 | 2321 |
limitOrNil notNil ifTrue:[ |
2322 |
sizeLimit := limitOrNil. |
|
2323 |
showLastPart := showLastPartOrNil |
|
2324 |
] ifFalse:[ |
|
2325 |
answer := Dialog |
|
2326 |
confirmWithCancel:(resources |
|
2327 |
stringWithCRs:'"%1" is very large (%2).\\Show all or only the first 4 Mb ?' |
|
2328 |
with:(fileName contractTo:40) allBold |
|
2329 |
with:(UnitConverter fileSizeStringFor:f fileSize)) |
|
2330 |
labels:#('Cancel' 'Show All' 'Show First Part' ). |
|
2331 |
||
2332 |
answer isNil ifTrue:[^ nil]. |
|
2333 |
answer ifTrue:[ |
|
2334 |
sizeLimit := 4 * 1024 * 1024 |
|
2335 |
]. |
|
8436 | 2336 |
]. |
4610 | 2337 |
]. |
2338 |
||
2339 |
stream := f readStream binary. |
|
8436 | 2340 |
sizeLimit notNil ifTrue:[ |
8472 | 2341 |
showLastPart == true ifTrue:[ |
2342 |
stream position:(f fileSize - sizeLimit). |
|
2343 |
]. |
|
8436 | 2344 |
data := stream nextBytes:sizeLimit. |
2345 |
] ifFalse:[ |
|
2346 |
data := stream contents. |
|
2347 |
]. |
|
4610 | 2348 |
stream close. |
2349 |
||
2350 |
col := 1. |
|
2351 |
offs := 0. |
|
2352 |
lines := StringCollection new. |
|
2353 |
||
2354 |
addrDigits := ((f fileSize + 1) log:16) truncated + 1. |
|
2355 |
||
5755
5e8165d55605
replaced '' writeStream by String writeStream
Claus Gittinger <cg@exept.de>
parents:
5753
diff
changeset
|
2356 |
lineStream := String writeStream. |
5e8165d55605
replaced '' writeStream by String writeStream
Claus Gittinger <cg@exept.de>
parents:
5753
diff
changeset
|
2357 |
asciiLineStream := String writeStream. |
4610 | 2358 |
|
2359 |
lineStream nextPutAll:(offs hexPrintString:addrDigits). |
|
2360 |
lineStream nextPutAll:': '. |
|
2361 |
||
2362 |
data do:[:byte | |
|
2363 |
lineStream nextPutAll:(byte hexPrintString:2). |
|
2364 |
(byte between:32 and:127) ifTrue:[ |
|
2365 |
asciiLineStream nextPut:(Character value:byte) |
|
2366 |
] ifFalse:[ |
|
2367 |
asciiLineStream nextPut:$. |
|
2368 |
]. |
|
2369 |
||
2370 |
offs := offs + 1. |
|
2371 |
col := col + 1. |
|
2372 |
col > 16 ifTrue:[ |
|
2373 |
lineStream nextPutAll:' '. |
|
2374 |
lineStream nextPutAll:asciiLineStream contents. |
|
2375 |
lines add:(lineStream contents). |
|
2376 |
(offs bitAnd:16rFF) == 0 ifTrue:[ |
|
2377 |
lines add:nil |
|
2378 |
]. |
|
2379 |
lineStream reset. |
|
2380 |
asciiLineStream reset. |
|
2381 |
||
2382 |
lineStream nextPutAll:(offs hexPrintString:addrDigits). |
|
2383 |
lineStream nextPutAll:': '. |
|
2384 |
col := 1. |
|
2385 |
] ifFalse:[ |
|
2386 |
lineStream space |
|
2387 |
] |
|
2388 |
]. |
|
2389 |
line := lineStream contents paddedTo:(3*16 + addrDigits + 1). |
|
2390 |
lines add:(line , ' ' , asciiLineStream contents). |
|
2391 |
^ lines |
|
2392 |
! ! |
|
2393 |
||
3892 | 2394 |
!AbstractFileBrowser methodsFor:'actions'! |
2395 |
||
2396 |
askForCommandFor:fileName thenDo:aBlock |
|
6284 | 2397 |
"setup and launch a querybox to ask for a unix command. |
3892 | 2398 |
Then evaluate aBlock passing the command-string as argument." |
2399 |
||
4523 | 2400 |
|box osName commandString| |
3892 | 2401 |
|
2402 |
osName := OperatingSystem platformName. |
|
2403 |
||
2404 |
box := FilenameEnterBox |
|
4414 | 2405 |
title:(resources string:'Execute %1 command:' with:osName) |
2406 |
okText:(resources string:'Execute') |
|
4523 | 2407 |
action:[:cmd | commandString := cmd]. |
3892 | 2408 |
|
2409 |
fileName notNil ifTrue:[ |
|
4414 | 2410 |
self initialCommandFor:fileName into:box. |
3892 | 2411 |
]. |
2412 |
box directory:(self getDirWithoutFileName:fileName). |
|
5003
a14ce263ada5
boxes no longer show at pointer
Claus Gittinger <cg@exept.de>
parents:
4982
diff
changeset
|
2413 |
box show. |
3892 | 2414 |
box destroy. |
2415 |
||
4523 | 2416 |
commandString notNil ifTrue:[ |
2417 |
aBlock value:commandString |
|
2418 |
]. |
|
2419 |
||
3892 | 2420 |
"Modified: / 7.9.1995 / 10:31:54 / claus" |
2421 |
"Modified: / 16.9.1997 / 15:35:10 / stefan" |
|
2422 |
"Modified: / 14.8.1998 / 14:12:52 / cg" |
|
2423 |
! |
|
2424 |
||
2425 |
changeFileBrowserTitleTo:aString |
|
4774 | 2426 |
self |
2427 |
applicationNamed:#FileBrowserV2 |
|
5009 | 2428 |
ifPresentDo:[:app | app changeFileBrowserTitleTo:aString] |
3892 | 2429 |
! |
2430 |
||
2431 |
copyFileList |
|
4774 | 2432 |
"copy the fileList to the clipBoard" |
2433 |
||
4973
e4b72eec43d3
refactoring the browserItemList access in directoryContentsBrowser
penk
parents:
4963
diff
changeset
|
2434 |
|fileList| |
e4b72eec43d3
refactoring the browserItemList access in directoryContentsBrowser
penk
parents:
4963
diff
changeset
|
2435 |
|
e4b72eec43d3
refactoring the browserItemList access in directoryContentsBrowser
penk
parents:
4963
diff
changeset
|
2436 |
fileList := self |
4774 | 2437 |
applicationNamed:#DirectoryContentsBrowser |
5009 | 2438 |
ifPresentDo:[:app | app browserFileList]. |
2439 |
||
2440 |
fileList notNil ifTrue:[ |
|
2441 |
self copyFileListToClipBoard:fileList. |
|
2442 |
] |
|
4973
e4b72eec43d3
refactoring the browserItemList access in directoryContentsBrowser
penk
parents:
4963
diff
changeset
|
2443 |
! |
e4b72eec43d3
refactoring the browserItemList access in directoryContentsBrowser
penk
parents:
4963
diff
changeset
|
2444 |
|
e4b72eec43d3
refactoring the browserItemList access in directoryContentsBrowser
penk
parents:
4963
diff
changeset
|
2445 |
copyFileListToClipBoard:fileList |
4774 | 2446 |
"copy the itemList to the clipBoard" |
2447 |
||
2448 |
|stream| |
|
2449 |
||
4973
e4b72eec43d3
refactoring the browserItemList access in directoryContentsBrowser
penk
parents:
4963
diff
changeset
|
2450 |
fileList isEmpty ifTrue:[^ self]. |
4774 | 2451 |
|
5772
603abfa8cf99
copy name(s) to clipboard - on lineFeed if only one file is selected
Claus Gittinger <cg@exept.de>
parents:
5756
diff
changeset
|
2452 |
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
|
2453 |
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
|
2454 |
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
|
2455 |
] ifFalse:[ |
603abfa8cf99
copy name(s) to clipboard - on lineFeed if only one file is selected
Claus Gittinger <cg@exept.de>
parents:
5756
diff
changeset
|
2456 |
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
|
2457 |
(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
|
2458 |
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
|
2459 |
] |
603abfa8cf99
copy name(s) to clipboard - on lineFeed if only one file is selected
Claus Gittinger <cg@exept.de>
parents:
5756
diff
changeset
|
2460 |
]. |
3892 | 2461 |
]. |
6034 | 2462 |
self window setClipboardText:stream contents. |
3892 | 2463 |
! |
2464 |
||
2465 |
copySelectedFilenames |
|
4774 | 2466 |
"copy the selected fileNames to the clipBoard" |
2467 |
||
4973
e4b72eec43d3
refactoring the browserItemList access in directoryContentsBrowser
penk
parents:
4963
diff
changeset
|
2468 |
|fileList| |
e4b72eec43d3
refactoring the browserItemList access in directoryContentsBrowser
penk
parents:
4963
diff
changeset
|
2469 |
|
e4b72eec43d3
refactoring the browserItemList access in directoryContentsBrowser
penk
parents:
4963
diff
changeset
|
2470 |
fileList := self |
4774 | 2471 |
applicationNamed:#DirectoryContentsBrowser |
5009 | 2472 |
ifPresentDo:[:appl | appl selectedFileNames]. |
2473 |
fileList notNil ifTrue:[ |
|
2474 |
self copyFileListToClipBoard:fileList. |
|
2475 |
]. |
|
3892 | 2476 |
! |
2477 |
||
2478 |
doAddTerminal |
|
5960 | 2479 |
|dir| |
2480 |
||
2481 |
dir := self currentDirectory. |
|
3892 | 2482 |
|
5960 | 2483 |
dir isNil ifTrue:[ |
4414 | 2484 |
dir := Filename homeDirectory |
3892 | 2485 |
]. |
4774 | 2486 |
|
5009 | 2487 |
self |
2488 |
applicationNamed:#FileApplicationNoteBook |
|
2489 |
ifPresentDo:[:appl | appl addTerminalIn:dir]. |
|
3892 | 2490 |
! |
2491 |
||
2492 |
doOpenSearchFile |
|
5961 | 2493 |
|item file| |
2494 |
||
2495 |
file := self firstSelectedFileName. |
|
2496 |
file isNil ifTrue:[ |
|
2497 |
file := Filename homeDirectory asAbsoluteFilename. |
|
2498 |
]. |
|
2499 |
item := DirectoryContentsBrowser itemClass fileName:file. |
|
3892 | 2500 |
self openSearchFileOn:item. |
2501 |
! |
|
2502 |
||
2503 |
doShowFileContents |
|
5009 | 2504 |
self |
2505 |
applicationNamed:#DirectoryContentsBrowser |
|
2506 |
ifPresentDo:[:appl | ^ appl doShowFileContents]. |
|
2507 |
||
2508 |
^ nil |
|
3892 | 2509 |
! |
2510 |
||
2511 |
doShowProperties |
|
2512 |
"show long stat (file)-info" |
|
2513 |
||
2514 |
self fileGetInfo:true |
|
2515 |
! |
|
2516 |
||
5528 | 2517 |
fileEncodingDialog |
2518 |
"open a dialog to allow change of the files character encoding. |
|
2519 |
Files are converted to internal encoding when read, and converted back |
|
2520 |
to this encoding when saved. |
|
2521 |
Notice: currently, not too many encodings are supported by the system." |
|
2522 |
||
2523 |
|bindings encodings encodingDescr idx selectedEncoding| |
|
2524 |
||
2525 |
encodingDescr := CharacterEncoder supportedExternalEncodings. |
|
2526 |
encodings := encodingDescr collect:[:d | d isNil ifTrue:[nil] ifFalse:[d first]]. |
|
2527 |
||
2528 |
bindings := IdentityDictionary new. |
|
2529 |
bindings at:#encodingList put:encodingDescr. |
|
2530 |
bindings at:#selectedEncoding put:(encodings indexOf:self fileEncoding ifAbsent:1) asValue. |
|
5737 | 2531 |
bindings at:#lockFileEncoding put:(self lockFileEncodingHolder value asValue). |
2532 |
||
5528 | 2533 |
(self openDialogInterface:#encodingDialogSpec withBindings:bindings) |
2534 |
ifTrue:[ |
|
2535 |
idx := (bindings at:#selectedEncoding) value. |
|
2536 |
selectedEncoding := encodings at:idx. |
|
2537 |
selectedEncoding notNil ifTrue:[ |
|
5704 | 2538 |
self fileEncoding:selectedEncoding asSymbol. |
5528 | 2539 |
]. |
5737 | 2540 |
self lockFileEncoding:(bindings at:#lockFileEncoding) value. |
5528 | 2541 |
]. |
2542 |
||
2543 |
"Modified: 30.6.1997 / 14:41:12 / cg" |
|
2544 |
! |
|
2545 |
||
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
2546 |
gotoFile:aFilename |
5380
2f738f3a34b1
fixed bug introduced by stefans beautification ;-)
Claus Gittinger <cg@exept.de>
parents:
5374
diff
changeset
|
2547 |
"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
|
2548 |
|
5959 | 2549 |
|currentFileNameHolder currentSel| |
2550 |
||
2551 |
currentFileNameHolder := self currentFileNameHolder. |
|
2552 |
||
2553 |
currentSel := currentFileNameHolder value. |
|
5380
2f738f3a34b1
fixed bug introduced by stefans beautification ;-)
Claus Gittinger <cg@exept.de>
parents:
5374
diff
changeset
|
2554 |
(currentSel includes:aFilename) ifFalse:[ |
5959 | 2555 |
currentFileNameHolder value:(OrderedCollection with:(aFilename asAbsoluteFilename)). |
3964 | 2556 |
]. |
3892 | 2557 |
! |
2558 |
||
4392 | 2559 |
newTextEditor |
5009 | 2560 |
self |
2561 |
applicationNamed:#FileApplicationNoteBook |
|
2562 |
ifPresentDo:[:appl | ^ appl newTextEditor]. |
|
2563 |
||
2564 |
^ nil. |
|
2565 |
! |
|
2566 |
||
2567 |
openApplByFileItem:anItem |
|
8490 | 2568 |
"/ q: is the following always wanted ? |
2569 |
"/ self window sensor shiftDown ifFalse:[ |
|
2570 |
"/ OperatingSystem isMSWINDOWSlike ifTrue:[ |
|
2571 |
"/ Error handle:[:ex | |
|
2572 |
"/ ] do:[ |
|
2573 |
"/ OperatingSystem |
|
2574 |
"/ shellExecute:nil |
|
2575 |
"/ lpOperation:'open' |
|
2576 |
"/ lpFile:(anItem fileName pathName) |
|
2577 |
"/ lpParameters:nil |
|
2578 |
"/ lpDirectory:(self directory pathName) |
|
2579 |
"/ nShowCmd:#SW_SHOWNORMAL. |
|
2580 |
"/ ^ self. |
|
2581 |
"/ ] |
|
2582 |
"/ ] |
|
2583 |
"/ ]. |
|
5306 | 2584 |
^ self |
5009 | 2585 |
applicationNamed:#FileApplicationNoteBook |
5306 | 2586 |
ifPresentDo:[:appl | appl openApplByFileItem:anItem]. |
3892 | 2587 |
! |
2588 |
||
4392 | 2589 |
openApplForFile:aFilename |
5306 | 2590 |
^ self openApplByFileItem:(DirectoryContentsBrowser itemClass fileName:aFilename). |
4392 | 2591 |
! |
2592 |
||
3892 | 2593 |
openCommandResultApplication |
2594 |
||
5009 | 2595 |
self |
2596 |
applicationNamed:#FileApplicationNoteBook |
|
2597 |
ifPresentDo:[:appl | ^ appl openCommandResultApplication]. |
|
2598 |
||
2599 |
^ nil |
|
3892 | 2600 |
! |
2601 |
||
5010 | 2602 |
openNewTextEditorOn:anItem |
5009 | 2603 |
self |
2604 |
applicationNamed:#FileApplicationNoteBook |
|
5010 | 2605 |
ifPresentDo:[:appl | ^ appl openNewTextEditorOn:anItem ]. |
5009 | 2606 |
|
2607 |
^ nil |
|
4880
87f511659680
edit file in context menu of DirectoryContentsBroser opens a new tab
penk
parents:
4878
diff
changeset
|
2608 |
! |
87f511659680
edit file in context menu of DirectoryContentsBroser opens a new tab
penk
parents:
4878
diff
changeset
|
2609 |
|
5010 | 2610 |
openSearchFileOn:anItem |
5009 | 2611 |
self |
2612 |
applicationNamed:#FileApplicationNoteBook |
|
5010 | 2613 |
ifPresentDo:[:appl | ^ appl openSearchFileOn:anItem]. |
5009 | 2614 |
|
2615 |
^ nil. |
|
3892 | 2616 |
! |
2617 |
||
5162 | 2618 |
openTextEditorForFile:aFilename |
2619 |
^ self openTextEditorOn:(DirectoryContentsBrowser itemClass fileName:aFilename). |
|
2620 |
! |
|
2621 |
||
5010 | 2622 |
openTextEditorOn:anItem |
5009 | 2623 |
self |
2624 |
applicationNamed:#FileApplicationNoteBook |
|
5010 | 2625 |
ifPresentDo:[:appl | ^ appl openTextEditorOn:anItem ]. |
5009 | 2626 |
|
2627 |
^ nil. |
|
3892 | 2628 |
! |
2629 |
||
5010 | 2630 |
openTextEditorOn:anItem type:aDirDescrOrFile |
5009 | 2631 |
self |
2632 |
applicationNamed:#FileApplicationNoteBook |
|
5010 | 2633 |
ifPresentDo:[:appl | ^ appl openTextEditorOn:anItem type:aDirDescrOrFile]. |
5009 | 2634 |
|
2635 |
^ nil. |
|
4618 | 2636 |
! |
2637 |
||
5959 | 2638 |
setCurrentFileName:aFilename |
2639 |
self setCurrentFileNames:(OrderedCollection with:aFilename). |
|
2640 |
! |
|
2641 |
||
2642 |
setCurrentFileNames:aCollectionOfFilenames |
|
2643 |
self currentFileNameHolder value:aCollectionOfFilenames. |
|
2644 |
! |
|
2645 |
||
3892 | 2646 |
updateAndSelect:aColOfFiles |
4785
5a3f7a0c3ff1
symbolic link creation code fixed
Claus Gittinger <cg@exept.de>
parents:
4782
diff
changeset
|
2647 |
self updateCurrentDirectory. |
4707
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
2648 |
aColOfFiles notNil ifTrue:[ |
5959 | 2649 |
self setCurrentFileNames:aColOfFiles |
4707
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
2650 |
]. |
3892 | 2651 |
! |
2652 |
||
2653 |
updateCurrentDirectory |
|
5739 | 2654 |
self updateCurrentDirectory:false |
2655 |
! |
|
2656 |
||
2657 |
updateCurrentDirectory:withReread |
|
4785
5a3f7a0c3ff1
symbolic link creation code fixed
Claus Gittinger <cg@exept.de>
parents:
4782
diff
changeset
|
2658 |
DirectoryContents flushCachedDirectoryFor:(self getBestDirectory). |
5a3f7a0c3ff1
symbolic link creation code fixed
Claus Gittinger <cg@exept.de>
parents:
4782
diff
changeset
|
2659 |
|
5009 | 2660 |
self |
2661 |
applicationNamed:#DirectoryContentsBrowser |
|
5739 | 2662 |
ifPresentDo:[:appl | withReread ifTrue:[appl doUpdate] ifFalse:[appl doUpdateDirectoryContents]]. |
5009 | 2663 |
self |
2664 |
applicationNamed:#DirectoryTreeBrowser |
|
2665 |
ifPresentDo:[:appl | appl doUpdate]. |
|
4345 | 2666 |
! |
2667 |
||
5739 | 2668 |
updateCurrentDirectoryWithReread |
2669 |
self updateCurrentDirectory:true |
|
2670 |
! |
|
2671 |
||
4345 | 2672 |
withActivityIndicationDo:aBlock |
2673 |
||
2674 |
self activityVisibilityChannel value:true. |
|
2675 |
[ |
|
2676 |
aBlock value. |
|
2677 |
] ensure:[ |
|
2678 |
self activityVisibilityChannel value:false. |
|
2679 |
] |
|
3892 | 2680 |
! ! |
2681 |
||
2682 |
!AbstractFileBrowser methodsFor:'actions bookmarks'! |
|
2683 |
||
2684 |
addBookmark |
|
2685 |
self currentFilesAreInSameDirectory ifFalse:[^ self]. |
|
6725 | 2686 |
self addBookmarks:(self currentSelectedDirectories). |
5960 | 2687 |
self class saveBookmarksInDefaultBookmarksFile |
4679 | 2688 |
! |
2689 |
||
2690 |
addBookmarks:aColOfDirectories |
|
4672
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
2691 |
aColOfDirectories do:[ :path | |
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
2692 |
self class addBookmark:path |
3892 | 2693 |
]. |
2694 |
! |
|
2695 |
||
8013 | 2696 |
editBookmarks |
2697 |
||
2698 |
| default selectedDirectories | |
|
2699 |
||
2700 |
selectedDirectories := self currentSelectedDirectories. |
|
2701 |
selectedDirectories notEmpty ifTrue:[default := selectedDirectories first]. |
|
2702 |
self class editBookmarksWithDefault: default. |
|
2703 |
! |
|
2704 |
||
3892 | 2705 |
hasBookmarks |
4672
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
2706 |
^ self class hasBookmarks |
3892 | 2707 |
! |
2708 |
||
2709 |
hasBookmarksToRemove |
|
2710 |
|bookmarks directories| |
|
2711 |
||
3982 | 2712 |
directories := self currentSelectedDirectories. |
3892 | 2713 |
bookmarks := self class directoryBookmarks. |
2714 |
^ (bookmarks size > 0 and:[directories notEmpty]) |
|
2715 |
! |
|
2716 |
||
2717 |
removeBookmark |
|
4672
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
2718 |
self currentSelectedDirectories do:[:dir| |
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
2719 |
self class removeBookmark:dir |
3892 | 2720 |
]. |
4679 | 2721 |
! |
2722 |
||
2723 |
saveBookmarks |
|
2724 |
self class saveBookmarks |
|
3892 | 2725 |
! ! |
2726 |
||
2727 |
!AbstractFileBrowser methodsFor:'actions history'! |
|
2728 |
||
2729 |
addToCommandHistory:aCommandString for:aFilename |
|
6369 | 2730 |
|cmd suffix cmdHist historySize| |
3892 | 2731 |
|
2732 |
cmdHist := self class commandHistory. |
|
6482
00207f456339
isEmptyOrNil / notEmptyOrNil refactoring
Claus Gittinger <cg@exept.de>
parents:
6479
diff
changeset
|
2733 |
(aCommandString notEmptyOrNil) ifTrue:[ |
4414 | 2734 |
cmdHist notNil ifTrue:[ |
2735 |
cmdHist addFirst:aCommandString. |
|
6369 | 2736 |
historySize := self class commandHistorySize. |
2737 |
(historySize notNil and:[cmdHist size > historySize]) ifTrue:[ |
|
4414 | 2738 |
cmdHist removeLast |
2739 |
] |
|
2740 |
]. |
|
2741 |
aFilename notNil ifTrue:[ |
|
2742 |
cmd := aCommandString copyTo:(aCommandString indexOf:Character space ifAbsent:[aCommandString size + 1])-1. |
|
2743 |
DefaultCommandPerSuffix isNil ifTrue:[ |
|
2744 |
DefaultCommandPerSuffix := Dictionary new. |
|
2745 |
]. |
|
2746 |
suffix := aFilename asFilename suffix. |
|
2747 |
suffix notNil ifTrue:[ |
|
2748 |
DefaultCommandPerSuffix at:suffix put:cmd. |
|
2749 |
] |
|
2750 |
] |
|
3892 | 2751 |
] |
2752 |
! |
|
2753 |
||
2754 |
doBack |
|
6286 | 2755 |
"go backward in the history" |
3892 | 2756 |
|
4022 | 2757 |
| fileName| |
2758 |
||
6369 | 2759 |
fileName := self directoryHistory goBackward. |
3892 | 2760 |
fileName notNil ifTrue:[ |
4347 | 2761 |
self gotoFile:(fileName asFilename). |
3892 | 2762 |
] |
2763 |
! |
|
2764 |
||
2765 |
doForward |
|
6286 | 2766 |
"go forward in the history" |
3892 | 2767 |
|
3964 | 2768 |
| fileName| |
2769 |
||
6369 | 2770 |
fileName := self directoryHistory goForward. |
3892 | 2771 |
fileName notNil ifTrue:[ |
4414 | 2772 |
self gotoFile:(fileName asFilename). |
4022 | 2773 |
] ifFalse:[ |
4414 | 2774 |
self enableForward value:false. |
4022 | 2775 |
|
2776 |
]. |
|
3892 | 2777 |
! ! |
2778 |
||
2779 |
!AbstractFileBrowser methodsFor:'applications'! |
|
2780 |
||
5009 | 2781 |
applicationNamed:anApplicationName ifPresentDo:aBlock |
2782 |
|appl| |
|
2783 |
||
2784 |
appl := self applications at:anApplicationName ifAbsent:nil. |
|
2785 |
appl notNil ifTrue:[ |
|
2786 |
^ aBlock value:appl |
|
2787 |
]. |
|
2788 |
^ nil. |
|
2789 |
! |
|
2790 |
||
4004 | 2791 |
directoryContentsBrowser |
2792 |
^ self applications at:#DirectoryContentsBrowser ifAbsent:nil. |
|
3892 | 2793 |
! ! |
2794 |
||
2795 |
!AbstractFileBrowser methodsFor:'aspects'! |
|
2796 |
||
2797 |
applications |
|
2798 |
^ aspects at:#applications |
|
2799 |
! |
|
2800 |
||
2801 |
backgroundProcesses |
|
2802 |
||
2803 |
^ self aspectFor:#backgroundProcesses ifAbsent:[List new] |
|
2804 |
! |
|
2805 |
||
4230 | 2806 |
canMake |
6095 | 2807 |
^ self aspectFor:#canMake ifAbsent:[ false asValue ]. |
4230 | 2808 |
! |
2809 |
||
3892 | 2810 |
currentDirectories |
6725 | 2811 |
" returns a holder on a Collection of all currently selected directories |
2812 |
if only a file is selected, currentDirectories holds the directory of the file |
|
3892 | 2813 |
" |
2814 |
||
2815 |
^ self aspectFor:#currentDirectories ifAbsent:[ (OrderedCollection new) asValue ]. |
|
2816 |
! |
|
2817 |
||
6725 | 2818 |
currentDirectoriesValue |
2819 |
" returns a Collection of all currently selected directories |
|
2820 |
if only a file is selected, currentDirectories holds the directory of the file |
|
2821 |
" |
|
2822 |
||
2823 |
^ self currentDirectories value |
|
2824 |
! |
|
2825 |
||
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
2826 |
currentDirectory |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
2827 |
"return the single current directory or nil" |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
2828 |
|
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
2829 |
|directories| |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
2830 |
|
6725 | 2831 |
directories := self currentSelectedDirectories. |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
2832 |
(directories size ~= 1) ifTrue:[ |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
2833 |
^ nil |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
2834 |
]. |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
2835 |
^ directories first. |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
2836 |
! |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
2837 |
|
3892 | 2838 |
currentFileNameHolder |
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
2839 |
"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
|
2840 |
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
|
2841 |
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
|
2842 |
|
6589 | 2843 |
^ self aspectFor:#currentFileNameHolder |
2844 |
ifAbsent:[ |
|
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
2845 |
|currentSel| |
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
2846 |
|
4692 | 2847 |
currentSel := self class currentSelection. |
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
2848 |
currentSel isEmpty ifTrue:[ |
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
2849 |
currentSel := OrderedCollection with:(Filename currentDirectory asAbsoluteFilename) |
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
2850 |
]. |
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
2851 |
currentSel asValue |
6589 | 2852 |
] |
2853 |
notPresentDo:[:holder| |
|
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
2854 |
|filenames newFilenames| |
4213
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
2855 |
filenames := holder value. |
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
2856 |
newFilenames := Set new. |
6589 | 2857 |
filenames do:[:eachFilename| |
2858 |
|existingFilename| |
|
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
2859 |
existingFilename := eachFilename. |
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
2860 |
existingFilename notNil ifTrue:[ |
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
2861 |
[existingFilename exists] whileFalse:[ |
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
2862 |
existingFilename := existingFilename directory. |
4955
378481247391
if no item is selected directory up action do nothing now
penk
parents:
4950
diff
changeset
|
2863 |
]. |
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
2864 |
newFilenames add:existingFilename. |
4955
378481247391
if no item is selected directory up action do nothing now
penk
parents:
4950
diff
changeset
|
2865 |
] |
4213
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
2866 |
]. |
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
2867 |
newFilenames asOrderedCollection. |
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
2868 |
] |
3892 | 2869 |
! |
2870 |
||
5528 | 2871 |
defaultFileEncoding |
2872 |
^ #'iso8859-1' "/ #'utf-8' |
|
2873 |
! |
|
2874 |
||
3892 | 2875 |
enableDirectoryUp |
2876 |
||
2877 |
^ self aspectFor:#enableDirectoryUp ifAbsent:[false asValue] |
|
2878 |
! |
|
2879 |
||
6456 | 2880 |
enableGotoDefaultDirectory |
2881 |
^ self aspectFor:#enableGotoDefaultDirectory ifAbsent:[ true asValue ]. |
|
4593 | 2882 |
! |
2883 |
||
8168 | 2884 |
enableGotoDesktop |
2885 |
^ self aspectFor:#enableGotoDesktop ifAbsent:[ true asValue ]. |
|
2886 |
! |
|
2887 |
||
6434 | 2888 |
enableGotoSmalltalkDirectory |
6456 | 2889 |
^ self aspectFor:#enableGotoSmalltalkDirectory ifAbsent:[ true asValue ]. |
6434 | 2890 |
! |
2891 |
||
3892 | 2892 |
enableHome |
2893 |
||
2894 |
^ self aspectFor:#enableHome ifAbsent:[ true asValue ]. |
|
2895 |
! |
|
2896 |
||
2897 |
enableViewNoteBookApplication |
|
2898 |
||
2899 |
^ self aspectFor:#enableViewNoteBookApplication ifAbsent:[false asValue] |
|
2900 |
! |
|
2901 |
||
5528 | 2902 |
fileEncoding |
2903 |
^ self fileEncodingHolder value |
|
2904 |
! |
|
2905 |
||
2906 |
fileEncoding:newEncoding |
|
5533 | 2907 |
self fileEncodingHolder value:newEncoding. |
2908 |
||
2909 |
self |
|
2910 |
applicationNamed:#FileApplicationNoteBook |
|
2911 |
ifPresentDo:[:nb | |
|
2912 |
|appl| |
|
2913 |
||
2914 |
appl := nb selectedApplication. |
|
5535 | 2915 |
(appl notNil and:[appl isTextEditor]) ifTrue:[ |
5533 | 2916 |
appl fileEncoding:newEncoding |
2917 |
] |
|
2918 |
]. |
|
5528 | 2919 |
! |
2920 |
||
5737 | 2921 |
fileEncodingHolder |
2922 |
^ self |
|
2923 |
aspectFor:#fileEncodingHolder |
|
2924 |
ifAbsent:[ |
|
2925 |
self |
|
2926 |
applicationNamed:#FileApplicationNoteBook |
|
2927 |
ifPresentDo:[:appl | appl fileEncodingHolder]. |
|
2928 |
] |
|
2929 |
! |
|
2930 |
||
5961 | 2931 |
firstSelectedFileName |
2932 |
|files| |
|
2933 |
||
7560 | 2934 |
files := self currentSelectedObjects. |
5961 | 2935 |
files notEmpty ifTrue:[ |
2936 |
^ files first |
|
2937 |
]. |
|
2938 |
^ nil |
|
7560 | 2939 |
|
2940 |
"Modified: / 04-12-2006 / 13:14:53 / cg" |
|
5961 | 2941 |
! |
2942 |
||
6456 | 2943 |
gotoDefaultDirectoryIsVisible |
2944 |
^ (Filename defaultDirectory asAbsoluteFilename) ~= (self smalltalkDirectory asAbsoluteFilename). |
|
2945 |
! |
|
2946 |
||
4618 | 2947 |
hasFileSelection |
2948 |
^ self aspectFor:#hasFileSelection ifAbsent:[ false asValue ]. |
|
2949 |
! |
|
2950 |
||
5830 | 2951 |
hasNotTwoFilesSelectedHolder |
2952 |
^ self aspectFor:#hasNotTwoFilesSelectedHolder |
|
2953 |
ifAbsent:[ |
|
2954 |
BlockValue |
|
2955 |
with:[:m | self hasTwoFilesSelected not] |
|
2956 |
argument:self currentFileNameHolder |
|
2957 |
]. |
|
2958 |
! |
|
2959 |
||
3892 | 2960 |
hasSelection |
2961 |
||
2962 |
^ self aspectFor:#hasSelection ifAbsent:[ false asValue ]. |
|
2963 |
! |
|
2964 |
||
4414 | 2965 |
hasTwoFilesSelectedHolder |
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
2966 |
^ self aspectFor:#hasTwoFilesSelectedHolder |
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
2967 |
ifAbsent:[ |
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
2968 |
BlockValue |
5830 | 2969 |
with:[:m | self hasTwoFilesSelected] |
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
2970 |
argument:self currentFileNameHolder |
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
2971 |
]. |
4414 | 2972 |
! |
2973 |
||
5737 | 2974 |
lockFileEncoding:aBoolean |
2975 |
self lockFileEncodingHolder value:aBoolean. |
|
2976 |
||
2977 |
self |
|
2978 |
applicationNamed:#FileApplicationNoteBook |
|
2979 |
ifPresentDo:[:nb | |
|
2980 |
|appl| |
|
2981 |
||
2982 |
appl := nb selectedApplication. |
|
2983 |
(appl notNil and:[appl isTextEditor]) ifTrue:[ |
|
2984 |
appl lockFileEncoding:aBoolean |
|
2985 |
] |
|
2986 |
]. |
|
2987 |
! |
|
2988 |
||
2989 |
lockFileEncodingHolder |
|
2990 |
^ self |
|
2991 |
aspectFor:#lockFileEncodingHolder |
|
2992 |
ifAbsent:[ |
|
2993 |
self |
|
2994 |
applicationNamed:#FileApplicationNoteBook |
|
2995 |
ifPresentDo:[:appl | appl lockFileEncodingHolder]. |
|
2996 |
] |
|
2997 |
! |
|
2998 |
||
4523 | 2999 |
notify:aString |
3000 |
self notifyChannel value:aString |
|
3001 |
! |
|
3002 |
||
3892 | 3003 |
notifyChannel |
3004 |
||
3005 |
^ self aspectFor:#notifyChannel ifAbsent:['' asValue] |
|
4071 | 3006 |
! |
3007 |
||
3008 |
rootHolder |
|
3009 |
"holder, which keeps the rootHolder of the treeView |
|
3010 |
" |
|
3011 |
||
4368
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
3012 |
^ self aspectFor:#rootHolder ifAbsent:[ |
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
3013 |
self class rootHolder asValue. |
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
3014 |
]. |
8192
26660fb61e7a
Make FileDialog usable as SubCanvas
Stefan Vogel <sv@exept.de>
parents:
8185
diff
changeset
|
3015 |
! |
26660fb61e7a
Make FileDialog usable as SubCanvas
Stefan Vogel <sv@exept.de>
parents:
8185
diff
changeset
|
3016 |
|
26660fb61e7a
Make FileDialog usable as SubCanvas
Stefan Vogel <sv@exept.de>
parents:
8185
diff
changeset
|
3017 |
rootHolder:aHolder |
26660fb61e7a
Make FileDialog usable as SubCanvas
Stefan Vogel <sv@exept.de>
parents:
8185
diff
changeset
|
3018 |
|
26660fb61e7a
Make FileDialog usable as SubCanvas
Stefan Vogel <sv@exept.de>
parents:
8185
diff
changeset
|
3019 |
self aspectFor:#rootHolder put:aHolder |
3892 | 3020 |
! ! |
3021 |
||
3022 |
!AbstractFileBrowser methodsFor:'aspects handling'! |
|
3023 |
||
3024 |
aspectFor:something ifAbsent:aBlock |
|
6284 | 3025 |
"returns the model for an aspect; these are stored in a common dictionary" |
3026 |
||
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3027 |
^ self aspectFor:something ifAbsent:aBlock notPresentDo:nil |
3892 | 3028 |
! |
3029 |
||
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3030 |
aspectFor:aKey ifAbsent:aBlock notPresentDo:notPresentBlock |
6284 | 3031 |
"returns the model for an aspect; these are stored in a common dictionary" |
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
3032 |
|
4213
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
3033 |
|holder saveAspectItem aspect| |
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
3034 |
|
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3035 |
holder := aspects at:aKey ifAbsent:[ |
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3036 |
masterApplication notNil ifTrue:[ |
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3037 |
holder := masterApplication aspectOrNil:aKey forSubApplication:self. |
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3038 |
]. |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3039 |
holder isNil ifTrue:[ |
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3040 |
saveAspectItem := self runtimeAspectValueFor:aKey. |
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3041 |
saveAspectItem notNil ifTrue:[ |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3042 |
saveAspectItem isHolder ifTrue:[ |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3043 |
holder := ValueHolder with:saveAspectItem value |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3044 |
] ifFalse:[ |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3045 |
holder := saveAspectItem value |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3046 |
]. |
4213
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
3047 |
] ifFalse:[ |
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3048 |
aspect := self userPreferencesAspectValueFor:aKey. |
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3049 |
aspect notNil ifTrue:[ |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3050 |
holder := aspect asValue |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3051 |
] ifFalse:[ |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3052 |
holder := aBlock value. |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3053 |
] |
4213
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
3054 |
]. |
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
3055 |
]. |
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
3056 |
holder notNil ifTrue:[ |
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3057 |
notPresentBlock notNil ifTrue:[ |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3058 |
holder value:(notPresentBlock value:holder). |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3059 |
]. |
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3060 |
aspects at:aKey put:holder |
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3061 |
]. |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3062 |
holder |
4213
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
3063 |
]. |
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
3064 |
^ holder |
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
3065 |
! |
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
3066 |
|
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3067 |
aspectFor:something put:aValueHolder |
6284 | 3068 |
"stores the model for an aspect; these are stored in a common dictionary" |
3069 |
||
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3070 |
aspects at:something put:aValueHolder |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3071 |
! |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3072 |
|
3892 | 3073 |
aspects |
6284 | 3074 |
"returns the common aspect dictionary" |
3075 |
||
3892 | 3076 |
^ aspects |
3077 |
! |
|
3078 |
||
3079 |
runtimeAspectValueFor:something |
|
3080 |
"returns the default aspect item from the class variable RuntimeAspects |
|
3081 |
" |
|
3082 |
^ self class runtimeAspects at:something ifAbsent:nil. |
|
3083 |
! |
|
3084 |
||
4201 | 3085 |
saveAspectValues |
3086 |
|saveAspects aspectValue| |
|
3087 |
||
3088 |
||
7078
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
3089 |
saveAspects := self class userPreferencesAspectList keys. |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
3090 |
saveAspects do:[ :aspectKey | |
4201 | 3091 |
aspectValue := (self perform:aspectKey) value. |
7078
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
3092 |
UserPreferences current |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
3093 |
at: ('fileBrowser_',aspectKey asString) asSymbol |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
3094 |
put: aspectValue. |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
3095 |
]. |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
3096 |
|
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
3097 |
"Modified: / 04-09-2006 / 10:02:41 / cg" |
4201 | 3098 |
! |
3099 |
||
3892 | 3100 |
saveRuntimeAspectValues |
3101 |
|savedAspects dictionary value isHolder aspect| |
|
3102 |
||
5941 | 3103 |
savedAspects := self class listOfRuntimeValuesToRemember. |
3892 | 3104 |
dictionary := Dictionary new. |
5941 | 3105 |
savedAspects do:[:aspectKey | |
4414 | 3106 |
aspect := self perform:aspectKey. |
3107 |
isHolder := aspect isValueModel. |
|
5941 | 3108 |
isHolder ifTrue:[ |
3109 |
value := aspect value |
|
3110 |
] ifFalse:[ |
|
3111 |
value := aspect |
|
3112 |
]. |
|
3113 |
dictionary at:aspectKey |
|
3114 |
put:(SaveAspectItem withValue:value isHolder:isHolder) |
|
3115 |
]. |
|
3116 |
RuntimeAspects := dictionary. |
|
3892 | 3117 |
! |
3118 |
||
4201 | 3119 |
userPreferencesAspectValueFor:something |
3120 |
"returns the default aspect from the Userpreferences |
|
3892 | 3121 |
" |
4201 | 3122 |
|
7078
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
3123 |
(self class userPreferencesAspectList includesKey:something) ifFalse:[ ^ nil]. |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
3124 |
^ UserPreferences current |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
3125 |
at:('fileBrowser_',something) asSymbol |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
3126 |
ifAbsent:(self class userPreferencesAspectList at:something). |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
3127 |
|
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
3128 |
"Modified: / 04-09-2006 / 10:02:34 / cg" |
3892 | 3129 |
! ! |
3130 |
||
4011 | 3131 |
!AbstractFileBrowser methodsFor:'aspects-filter'! |
3132 |
||
9015 | 3133 |
filter:aString |
3134 |
self filterModel value:aString |
|
3135 |
! |
|
3136 |
||
4018 | 3137 |
filterBackgroundColor |
3138 |
||
3139 |
^ self aspectFor:#filterBackgroundColor ifAbsent:[Color white asValue] |
|
3140 |
! |
|
3141 |
||
4011 | 3142 |
filterBlockHolder |
3143 |
||
5658
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
3144 |
^ self aspectFor:#filterBlockHolder ifAbsent:[self makeFilterBlock asValue] |
4011 | 3145 |
! |
3146 |
||
3147 |
filterListModel |
|
3148 |
||
3149 |
^ self aspectFor:#filterListModel ifAbsent:[self class defaultFilterList] |
|
3150 |
! |
|
3151 |
||
3152 |
filterModel |
|
5941 | 3153 |
|m| |
3154 |
||
3155 |
m := self aspectFor:#filterModel ifAbsent:[(self filterListModel at:1) asValue]. |
|
3156 |
^ m |
|
4011 | 3157 |
! |
3158 |
||
8185
8b6f11fd7fbf
Make #filterModel reusable as SubCanvas
Stefan Vogel <sv@exept.de>
parents:
8172
diff
changeset
|
3159 |
filterModel:aHolder |
8b6f11fd7fbf
Make #filterModel reusable as SubCanvas
Stefan Vogel <sv@exept.de>
parents:
8172
diff
changeset
|
3160 |
self aspectFor:#filterModel put:aHolder. |
8b6f11fd7fbf
Make #filterModel reusable as SubCanvas
Stefan Vogel <sv@exept.de>
parents:
8172
diff
changeset
|
3161 |
! |
8b6f11fd7fbf
Make #filterModel reusable as SubCanvas
Stefan Vogel <sv@exept.de>
parents:
8172
diff
changeset
|
3162 |
|
4018 | 3163 |
filterValueBox |
3164 |
||
3165 |
^ self aspectFor:#filterValueBox ifAbsent:[ValueHolder new] |
|
3166 |
! |
|
3167 |
||
5658
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
3168 |
makeFilterBlock |
9102 | 3169 |
"return a two-arg filterblock on the files path- and base-name. This block should return true for files |
3170 |
to be shown" |
|
3171 |
||
7565
521264d23941
ignoreCase if Filename is not case sensitive in #makeFilterBlock
fm
parents:
7560
diff
changeset
|
3172 |
| filterString filterStrings filters showHidden yesOrNo filterBlock ignoreCase| |
5658
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
3173 |
|
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
3174 |
filterString := self filterModel value. |
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
3175 |
filterString = '' ifTrue:[filterString := '*']. |
7565
521264d23941
ignoreCase if Filename is not case sensitive in #makeFilterBlock
fm
parents:
7560
diff
changeset
|
3176 |
ignoreCase := "ignoreCaseInPattern ? "(Filename isCaseSensitive not). |
5658
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
3177 |
|
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
3178 |
filterStrings := filterString asCollectionOfSubstringsSeparatedBy:$;. |
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
3179 |
filters := filterStrings |
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
3180 |
collect:[:eachPattern | |
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
3181 |
|
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
3182 |
|pattern| |
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
3183 |
|
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
3184 |
pattern := eachPattern withoutSeparators. |
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
3185 |
yesOrNo := true. |
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
3186 |
(pattern startsWith:'~') ifTrue:[ |
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
3187 |
yesOrNo := false. |
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
3188 |
pattern := pattern copyFrom:2. |
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
3189 |
]. |
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
3190 |
yesOrNo ifTrue:[ |
9102 | 3191 |
[:name :baseName | pattern match:baseName ignoreCase:ignoreCase ] |
5658
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
3192 |
] ifFalse:[ |
9102 | 3193 |
[:name :baseName | (pattern match:baseName ignoreCase:ignoreCase) not ] |
5658
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
3194 |
]. |
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
3195 |
]. |
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
3196 |
|
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
3197 |
filters size == 1 ifTrue:[ |
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
3198 |
filterBlock := filters first |
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
3199 |
] ifFalse:[ |
9102 | 3200 |
filterBlock := [:name :baseName | filters contains:[:aFilter | aFilter value:name value:baseName ]]. |
5658
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
3201 |
]. |
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
3202 |
|
4011 | 3203 |
showHidden := self showHiddenFiles value. |
3204 |
showHidden ifTrue:[ |
|
5658
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
3205 |
^ filterBlock. |
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
3206 |
]. |
9102 | 3207 |
^ [:name :baseName | (baseName includesString:'Andwend')ifTrue:[self halt]. |
3208 |
(name isHidden) not and:[filterBlock value:name value:baseName]]. |
|
4018 | 3209 |
! |
3210 |
||
3211 |
shownFiles |
|
3212 |
||
3213 |
^ self aspectFor:#shownFiles ifAbsent:['-/-' asValue] |
|
4011 | 3214 |
! ! |
3215 |
||
3892 | 3216 |
!AbstractFileBrowser methodsFor:'aspects-history'! |
3217 |
||
3218 |
dirHistory |
|
6369 | 3219 |
"obsolete" |
3220 |
^ self directoryHistory |
|
3221 |
! |
|
3222 |
||
3223 |
directoryHistory |
|
3952 | 3224 |
^ self class directoryHistory |
3892 | 3225 |
! |
3226 |
||
3227 |
enableBack |
|
3228 |
||
3229 |
^ self aspectFor:#enableBack ifAbsent:[false asValue] |
|
3230 |
! |
|
3231 |
||
3232 |
enableFileHistory |
|
3233 |
||
3234 |
^ self aspectFor:#enableFileHistory ifAbsent:[false asValue] |
|
3235 |
! |
|
3236 |
||
3237 |
enableForward |
|
3238 |
||
3239 |
^ self aspectFor:#enableForward ifAbsent:[false asValue] |
|
3240 |
! |
|
3241 |
||
3242 |
fileHistory |
|
3243 |
||
3244 |
^ self aspectFor:#fileHistory ifAbsent:[FilenameHistory new] |
|
3245 |
! ! |
|
3246 |
||
3247 |
!AbstractFileBrowser methodsFor:'aspects-visibility'! |
|
3248 |
||
4345 | 3249 |
activityVisibilityChannel |
6284 | 3250 |
" activityVisibilityChannel switches the activity indicator on/off" |
4345 | 3251 |
|
3252 |
^ self aspectFor:#activityVisibilityChannel ifAbsent:[ false asValue ]. |
|
3253 |
! |
|
3254 |
||
6602 | 3255 |
changeSetBrowserItemVisible |
3256 |
^ Screen current ctrlDown. |
|
3257 |
! |
|
3258 |
||
4110 | 3259 |
openAlwaysInTextEditor |
4201 | 3260 |
" aspect for open every file in TextEditor dont use e.g. HtmlEditor for *.html'" |
4110 | 3261 |
|
3262 |
^ self aspectFor:#openAlwaysInTextEditor ifAbsent:[ false asValue ]. |
|
3263 |
! |
|
3264 |
||
3892 | 3265 |
openMultipleApplicationsForType |
3266 |
||
4201 | 3267 |
" aspect for open more applications for e.g. TextEditor and not change the contents of already |
3268 |
open TextEditor " |
|
3269 |
||
3892 | 3270 |
^ self aspectFor:#openMultipleApplicationsForType ifAbsent:[ false asValue ]. |
3271 |
! |
|
3272 |
||
4201 | 3273 |
showDirectoryTree |
3274 |
||
3275 |
^ self aspectFor:#showDirectoryTree ifAbsent:[ true asValue ] |
|
3892 | 3276 |
! |
3277 |
||
4554 | 3278 |
showDiskUsageHolder |
3279 |
|holder| |
|
3280 |
||
4560
0d3db5e27bc0
default for disk usage is false
Claus Gittinger <cg@exept.de>
parents:
4558
diff
changeset
|
3281 |
holder := self aspectFor:#showDiskUsageHolder ifAbsent:[ false asValue]. |
4781 | 3282 |
holder addDependent:self. |
4554 | 3283 |
^ holder |
3284 |
! |
|
3285 |
||
3892 | 3286 |
showHiddenFiles |
3287 |
||
9118 | 3288 |
^ self aspectFor:#showHiddenFiles ifAbsent:[ false asValue ]. |
3892 | 3289 |
! |
3290 |
||
9108 | 3291 |
showHiddenFiles:aHolder |
3292 |
self aspectFor:#showHiddenFiles put:aHolder. |
|
3293 |
! |
|
3294 |
||
3295 |
shownFiles:aHolder |
|
3296 |
self aspectFor:#shownFiles put:aHolder. |
|
3297 |
! |
|
3298 |
||
4648 | 3299 |
userContextAvailable |
3300 |
||
3301 |
" aspect for show group and user columns in contents view |
|
3302 |
windows provides no user context" |
|
3303 |
||
3304 |
^ OperatingSystem isMSWINDOWSlike not |
|
3305 |
! |
|
3306 |
||
3892 | 3307 |
viewDescription |
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3308 |
"aspect for show file description in DirectoryContentsBrowser" |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3309 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3310 |
^ self directoryContentsBrowser viewDescription |
3892 | 3311 |
! |
3312 |
||
3313 |
viewDetails |
|
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3314 |
"aspect for show more file properties in DirectoryContentsBrowser |
4201 | 3315 |
" |
3892 | 3316 |
|
6121 | 3317 |
|directoryContentsBrowser| |
3318 |
||
3319 |
directoryContentsBrowser := self directoryContentsBrowser. |
|
3320 |
directoryContentsBrowser isNil ifTrue:[^ nil]. |
|
3321 |
^ directoryContentsBrowser viewDetails |
|
3892 | 3322 |
! |
3323 |
||
3324 |
viewDirectoryDescription |
|
3325 |
||
4201 | 3326 |
" aspect for auto open a TextView for Readme and other see getInfoItem Method files |
3327 |
on change directory " |
|
3328 |
||
3892 | 3329 |
^ self aspectFor:#viewDirectoryDescription ifAbsent:[ true asValue ]. |
3330 |
! |
|
3331 |
||
4201 | 3332 |
viewDirsInContentsBrowser |
3333 |
||
3334 |
^ self aspectFor:#viewDirsInContentsBrowser ifAbsent:[ false asValue ]. |
|
3335 |
! |
|
3336 |
||
5870 | 3337 |
viewFilesInContentsBrowser |
3338 |
||
3339 |
^ self aspectFor:#viewFilesInContentsBrowser ifAbsent:[ true asValue ]. |
|
3340 |
! |
|
3341 |
||
3892 | 3342 |
viewFilesInDirectoryTree |
3343 |
||
4201 | 3344 |
" aspect for view files in tree view (not only directories) " |
3345 |
||
3892 | 3346 |
^ self aspectFor:#viewFilesInDirectoryTree ifAbsent:[ false asValue ]. |
3347 |
! |
|
3348 |
||
3349 |
viewGroup |
|
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3350 |
" aspect for show group information in DirectoryContentsBrowser " |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3351 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3352 |
^ self directoryContentsBrowser viewGroup |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3353 |
! |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3354 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3355 |
viewIcon |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3356 |
" aspect for show file-type icon in DirectoryContentsBrowser " |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3357 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3358 |
^ self directoryContentsBrowser viewIcon |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3359 |
! |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3360 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3361 |
viewInodeNumber |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3362 |
" aspect for show inode numbers in DirectoryContentsBrowser " |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3363 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3364 |
^ self directoryContentsBrowser viewInodeNumber |
3892 | 3365 |
! |
3366 |
||
3367 |
viewNoteBookApplicationHolder |
|
3368 |
||
3369 |
^ self aspectFor:#viewNoteBookApplicationHolder ifAbsent:[ false asValue]. |
|
3370 |
! |
|
3371 |
||
3372 |
viewOwner |
|
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3373 |
" aspect for show owner information in DirectoryContentsBrowser " |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3374 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3375 |
^ self directoryContentsBrowser viewOwner |
3892 | 3376 |
! |
3377 |
||
3378 |
viewPermissions |
|
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3379 |
" aspect for show permission information in DirectoryContentsBrowser " |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3380 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3381 |
^ self directoryContentsBrowser viewPermissions |
3892 | 3382 |
! |
3383 |
||
3384 |
viewPreview |
|
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3385 |
" aspect for show image previev in DirectoryContentsBrowser " |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3386 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3387 |
^ self directoryContentsBrowser viewPreview |
3892 | 3388 |
! |
3389 |
||
3390 |
viewSize |
|
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3391 |
" aspect for show size information in DirectoryContentsBrowser " |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3392 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3393 |
^ self directoryContentsBrowser viewSize |
3892 | 3394 |
! |
3395 |
||
4974 | 3396 |
viewSizeInBytes |
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3397 |
" aspect for show size-in-bytes information in DirectoryContentsBrowser " |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3398 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3399 |
^ self directoryContentsBrowser viewSizeInBytes |
4974 | 3400 |
! |
3401 |
||
5312 | 3402 |
viewSizeInKiloBytes |
3403 |
" aspect for show size-in-kilobytes information in DirectoryContentsBrowser " |
|
3404 |
||
3405 |
^ self directoryContentsBrowser viewSizeInKiloBytes |
|
3406 |
! |
|
3407 |
||
3892 | 3408 |
viewTime |
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3409 |
" aspect for show time information in DirectoryContentsBrowser" |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3410 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3411 |
^ self directoryContentsBrowser viewTime |
3892 | 3412 |
! |
3413 |
||
3414 |
viewType |
|
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3415 |
" aspect for show suffix (type) information in DirectoryContentsBrowser" |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3416 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3417 |
^ self directoryContentsBrowser viewType |
3892 | 3418 |
! ! |
3419 |
||
3420 |
!AbstractFileBrowser methodsFor:'background processing'! |
|
3421 |
||
3422 |
executeCommand:cmd |
|
3423 |
||
3424 |
self executeCommand:cmd inDirectory:nil |
|
3425 |
! |
|
3426 |
||
5880 | 3427 |
executeCommand:cmd inDirectory:aDirectoryOrNil |
3892 | 3428 |
| nameString executionBlock| |
3429 |
||
5880 | 3430 |
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
|
3431 |
nameString := 'Execute: ', cmd. |
3892 | 3432 |
self makeExecutionResultProcessFor:executionBlock withName:nameString. |
3433 |
! |
|
3434 |
||
3435 |
getExecutionBlockForCommand:cmd |
|
3436 |
||
3437 |
^ self getExecutionBlockForCommand:cmd inDirectory:nil |
|
3438 |
! |
|
3439 |
||
5880 | 3440 |
getExecutionBlockForCommand:cmd inDirectory:directoryOrNil |
3441 |
| dir| |
|
3442 |
||
3443 |
dir := directoryOrNil. |
|
3444 |
directoryOrNil isNil ifTrue:[ |
|
3445 |
dir := self theSingleSelectedDirectoryOrNil. |
|
6671 | 3446 |
dir isNil ifTrue:[ |
3447 |
Dialog warn:'Please select a single directory.'. |
|
3448 |
AbortSignal raise. |
|
3449 |
^ nil |
|
3450 |
]. |
|
3892 | 3451 |
]. |
4523 | 3452 |
|
3453 |
^ [:stream| |
|
3454 |
stream notNil ifTrue:[ |
|
4414 | 3455 |
OperatingSystem |
3456 |
executeCommand:cmd |
|
3457 |
inputFrom:nil |
|
3458 |
outputTo:stream |
|
3459 |
errorTo:stream |
|
3460 |
inDirectory:dir |
|
3461 |
onError:[:status| false]. |
|
3462 |
] |
|
4523 | 3463 |
]. |
3892 | 3464 |
! |
3465 |
||
3466 |
killAllRunningBackgroundProcesses |
|
3467 |
||
3468 |
self backgroundProcesses do:[ : process | |
|
4523 | 3469 |
self notify:'kill ', process name. |
4414 | 3470 |
process terminate. |
3892 | 3471 |
]. |
3472 |
! |
|
3473 |
||
3474 |
makeExecutionResultProcessFor:aBlock withName:aString |
|
3475 |
| stream process appl nameString| |
|
3476 |
||
3477 |
appl := self openCommandResultApplication. |
|
3478 |
stream := appl resultStream. |
|
3479 |
nameString := aString ? 'Execution Result'. |
|
3480 |
appl changeTabTo:nameString. |
|
4523 | 3481 |
|
8355 | 3482 |
process := [ |
3483 |
[aBlock value:stream] |
|
4891
5422df926e2d
Stream streamErrorSignal -> StreamError
Stefan Vogel <sv@exept.de>
parents:
4881
diff
changeset
|
3484 |
ensure:[ |
4516
dc3b7a89598a
close command view if no output was generated
Claus Gittinger <cg@exept.de>
parents:
4496
diff
changeset
|
3485 |
self backgroundProcesses remove:process ifAbsent:[]. |
dc3b7a89598a
close command view if no output was generated
Claus Gittinger <cg@exept.de>
parents:
4496
diff
changeset
|
3486 |
appl process value:nil. |
dc3b7a89598a
close command view if no output was generated
Claus Gittinger <cg@exept.de>
parents:
4496
diff
changeset
|
3487 |
|
dc3b7a89598a
close command view if no output was generated
Claus Gittinger <cg@exept.de>
parents:
4496
diff
changeset
|
3488 |
"/ close automatically, if there was no output. |
4571 | 3489 |
"/ appl resultStream contents isEmpty ifTrue:[ |
3490 |
"/ appl doClose. |
|
3491 |
"/ ] |
|
8355 | 3492 |
stream nextPutLine:'Done.' |
4516
dc3b7a89598a
close command view if no output was generated
Claus Gittinger <cg@exept.de>
parents:
4496
diff
changeset
|
3493 |
] |
dc3b7a89598a
close command view if no output was generated
Claus Gittinger <cg@exept.de>
parents:
4496
diff
changeset
|
3494 |
] newProcess. |
3892 | 3495 |
process priority:(Processor userBackgroundPriority). |
3496 |
process name:nameString. |
|
3497 |
self backgroundProcesses add:process. |
|
3498 |
appl process value:process. |
|
3499 |
process resume. |
|
3500 |
! ! |
|
3501 |
||
3502 |
!AbstractFileBrowser methodsFor:'change & update'! |
|
3503 |
||
4915 | 3504 |
currentFileNameHolderChanged |
3505 |
"/ self currentFileNameHolderChangedForCommon |
|
3506 |
! |
|
3507 |
||
4577 | 3508 |
currentFileNameHolderChangedForCommon |
5476 | 3509 |
|newDirectories oldDirectories size rootInTreeView selection selectionNotEmpty| |
4368
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
3510 |
|
7560 | 3511 |
selection := self currentSelectedObjects. |
4368
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
3512 |
self class currentSelection:selection. |
4734 | 3513 |
|
5476 | 3514 |
selectionNotEmpty := selection notEmpty. |
3515 |
self hasSelection value:selectionNotEmpty. |
|
3516 |
self hasFileSelection value:(selectionNotEmpty and:[self firstSelectedFile notNil]). |
|
4734 | 3517 |
|
4368
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
3518 |
newDirectories := self directoriesForFiles:selection. |
6725 | 3519 |
oldDirectories := self currentSelectedDirectories. |
4011 | 3520 |
oldDirectories ~= newDirectories ifTrue:[ |
4347 | 3521 |
self currentDirectories value:newDirectories. |
3522 |
size := newDirectories size. |
|
4774 | 3523 |
rootInTreeView := self |
3524 |
applicationNamed:#DirectoryTreeBrowser |
|
5009 | 3525 |
ifPresentDo:[:appl | appl rootHolder]. |
3526 |
rootInTreeView := rootInTreeView value. |
|
5437
3556b0348494
directory up not allowed for drive root under windows
penk
parents:
5432
diff
changeset
|
3527 |
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
|
3528 |
|
4347 | 3529 |
newDirectories notEmpty ifTrue:[ |
6369 | 3530 |
self directoryHistory addToHistory:(newDirectories first asString). |
4347 | 3531 |
]. |
5074 | 3532 |
self enableHome value:((newDirectories includes:(Filename homeDirectory asAbsoluteFilename))not). |
8168 | 3533 |
self enableGotoDesktop value:((newDirectories includes:(Filename desktopDirectory asAbsoluteFilename))not). |
6456 | 3534 |
self enableGotoDefaultDirectory value:((newDirectories includes:(Filename defaultDirectory asAbsoluteFilename))not). |
3535 |
self enableGotoSmalltalkDirectory value:((newDirectories includes:(self smalltalkDirectory asAbsoluteFilename))not). |
|
4011 | 3536 |
]. |
4022 | 3537 |
self enableForward value:self canForward. |
4734 | 3538 |
self enableBack value:self canBackward. |
6095 | 3539 |
|
3540 |
self updateCanMake. |
|
7560 | 3541 |
|
3542 |
"Modified: / 04-12-2006 / 13:14:36 / cg" |
|
4011 | 3543 |
! |
3544 |
||
3545 |
filterModelChanged |
|
3546 |
||
5658
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
3547 |
self filterBlockHolder value:(self makeFilterBlock). |
4011 | 3548 |
! |
3549 |
||
3892 | 3550 |
update:something with:aParameter from:changedObject |
3551 |
||
3552 |
" do here all the things that have to be done for every part of the FileBrowserV2 |
|
3553 |
and the things that have to be done if it runs standalone " |
|
3554 |
||
3555 |
changedObject == self currentFileNameHolder ifTrue:[ |
|
4577 | 3556 |
self currentFileNameHolderChangedForCommon. |
4368
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
3557 |
^ self |
3892 | 3558 |
]. |
3989 | 3559 |
changedObject == self sortCaseless ifTrue:[ |
4368
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
3560 |
self sortFileListsBy:#baseName withReverse:false. |
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
3561 |
^ self |
3989 | 3562 |
]. |
6785
cac8107d889c
clear reverseSort flag, when sort-order is changed via menu.
Claus Gittinger <cg@exept.de>
parents:
6767
diff
changeset
|
3563 |
changedObject == self sortBlockProperty ifTrue:[ |
cac8107d889c
clear reverseSort flag, when sort-order is changed via menu.
Claus Gittinger <cg@exept.de>
parents:
6767
diff
changeset
|
3564 |
self currentSortOrder value at:#reverse put:false. |
cac8107d889c
clear reverseSort flag, when sort-order is changed via menu.
Claus Gittinger <cg@exept.de>
parents:
6767
diff
changeset
|
3565 |
^ self |
cac8107d889c
clear reverseSort flag, when sort-order is changed via menu.
Claus Gittinger <cg@exept.de>
parents:
6767
diff
changeset
|
3566 |
]. |
4011 | 3567 |
(changedObject == self filterModel or:[changedObject == self showHiddenFiles]) ifTrue:[ |
4368
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
3568 |
self filterModelChanged. |
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
3569 |
^ self |
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
3570 |
]. |
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
3571 |
changedObject == self rootHolder ifTrue:[ |
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
3572 |
self class rootHolder:(self rootHolder value). |
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
3573 |
^ self |
4004 | 3574 |
]. |
4781 | 3575 |
changedObject == self showDiskUsageHolder ifTrue:[ |
6190 | 3576 |
self notify:nil. |
4781 | 3577 |
^ self |
3578 |
]. |
|
3989 | 3579 |
|
3892 | 3580 |
super update:something with:aParameter from:changedObject |
5543 | 3581 |
! |
3582 |
||
6095 | 3583 |
updateCanMake |
3584 |
|dir can| |
|
3585 |
||
3586 |
can := false. |
|
3587 |
dir := self currentDirectory. |
|
3588 |
dir notNil ifTrue:[ |
|
3589 |
can := (dir asFilename construct:'Makefile') exists. |
|
3590 |
OperatingSystem isMSWINDOWSlike ifTrue:[ |
|
3591 |
can ifFalse:[ |
|
3592 |
can := (self currentDirectory asFilename construct:'nt.mak') exists. |
|
3593 |
] |
|
3594 |
]. |
|
3595 |
]. |
|
3596 |
self canMake value:can. |
|
3597 |
! |
|
3598 |
||
5543 | 3599 |
updateListAfterDelete:colOfFiles |
3600 |
self updateCurrentDirectory |
|
3892 | 3601 |
! ! |
3602 |
||
3603 |
!AbstractFileBrowser methodsFor:'clipboard'! |
|
3604 |
||
3605 |
canPaste |
|
3606 |
||
3607 |
^ self aspectFor:#canPaste ifAbsent:[ false asValue ]. |
|
3608 |
! |
|
3609 |
||
3610 |
clipboard |
|
3611 |
||
3612 |
^ self aspectFor:#clipboard ifAbsent:[Clipboard new] |
|
3613 |
! |
|
3614 |
||
3615 |
copyFilesToClipBoard:colOfFiles |
|
3616 |
self putInClipBoard:colOfFiles as:#copy. |
|
3617 |
! |
|
3618 |
||
3619 |
cutFilesToClipBoard:colOfFiles |
|
3620 |
"defete current selected files/directories |
|
3621 |
" |
|
3622 |
self putInClipBoard:colOfFiles as:#cut. |
|
3623 |
! |
|
3624 |
||
3625 |
emptyClipBoard |
|
3626 |
||
3627 |
self clipboard files:nil. |
|
3628 |
self canPaste value:false. |
|
3629 |
! |
|
3630 |
||
3631 |
putInClipBoard:colOfFiles as:aSymbol |
|
3632 |
| stream clp| |
|
3633 |
||
3634 |
colOfFiles isEmpty ifTrue:[ ^ self]. |
|
3635 |
clp := self clipboard. |
|
3636 |
clp files:nil. |
|
3637 |
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
|
3638 |
|
603abfa8cf99
copy name(s) to clipboard - on lineFeed if only one file is selected
Claus Gittinger <cg@exept.de>
parents:
5756
diff
changeset
|
3639 |
stream := String writeStream. |
3892 | 3640 |
stream nextPutAll:aSymbol asString. |
3641 |
stream nextPutAll:' <'. |
|
3642 |
stream nextPutAll:colOfFiles first asString. |
|
3643 |
colOfFiles size > 1 ifTrue:[ |
|
4414 | 3644 |
stream nextPutAll:' ...'. |
3892 | 3645 |
]. |
3646 |
stream nextPutAll:'> to clipboard'. |
|
3647 |
||
4523 | 3648 |
self notify:stream contents. |
3892 | 3649 |
stream close. |
3650 |
clp files:colOfFiles. |
|
3651 |
self canPaste value:true. |
|
3652 |
! ! |
|
3653 |
||
3654 |
!AbstractFileBrowser methodsFor:'drag & drop'! |
|
3655 |
||
3656 |
canDropFiles:dropedObjects for:filename |
|
6284 | 3657 |
|filenameDirString filenameDir| |
3892 | 3658 |
|
3659 |
dropedObjects isEmpty ifTrue:[^ false]. |
|
6284 | 3660 |
|
3892 | 3661 |
filenameDir := self getDirWithoutFileName:filename. |
7491 | 3662 |
filenameDir isNil ifTrue:[^ false ]. |
6250
5b0673ccff1c
refactored intention revealing code:
Claus Gittinger <cg@exept.de>
parents:
6236
diff
changeset
|
3663 |
filenameDir isWritable ifFalse:[^ false]. |
6284 | 3664 |
|
3892 | 3665 |
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
|
3666 |
|
7ce6eae41e33
do not check if dropFile exists, if its an archive file
Claus Gittinger <cg@exept.de>
parents:
4959
diff
changeset
|
3667 |
dropedObjects do:[:aDropObject | |
6284 | 3668 |
(self canDropObject:aDropObject into:filenameDir) ifFalse:[^ false]. |
3669 |
"/ |dropFileName dropFileNameString physicalPathName| |
|
3670 |
"/ |
|
3671 |
"/ dropFileName := aDropObject theObject. |
|
3672 |
"/ dropFileNameString := dropFileName asString. |
|
3673 |
"/ dropFileName isDirectory ifTrue:[ |
|
3674 |
"/ (self fileName:filenameDirString startsWith:dropFileNameString) ifTrue:[ |
|
3675 |
"/ self notify:'Cannot drop a directory into one of its parent directories'. |
|
3676 |
"/ ^ false |
|
3677 |
"/ ] |
|
3678 |
"/ ] ifFalse:[ |
|
3679 |
"/ physicalPathName := dropFileName physicalPathName. |
|
3680 |
"/ (filenameDirString = dropFileName directory asString |
|
3681 |
"/ or:[ aDropObject isFileInArchive not and:[physicalPathName notNil |
|
3682 |
"/ and:[ filenameDirString = physicalPathName asFilename directory asString]]]) ifTrue:[ |
|
3683 |
"/ self notify:'Cannot drop a file into same directory'. |
|
3684 |
"/ ^ false |
|
3685 |
"/ ] |
|
3686 |
"/ ] |
|
3687 |
]. |
|
3688 |
self notify:nil. |
|
3689 |
^ true |
|
3690 |
! |
|
3691 |
||
3692 |
canDropObject:aDropObject into:aDirectory |
|
3693 |
|filenameDirString dropFileName dropFileNameString physicalPathName| |
|
3694 |
||
3695 |
dropFileName := aDropObject theObject. |
|
3696 |
dropFileNameString := dropFileName asString. |
|
3697 |
dropFileName isDirectory ifTrue:[ |
|
3698 |
filenameDirString := aDirectory asString. |
|
3699 |
(self fileName:filenameDirString startsWith:dropFileNameString) ifTrue:[ |
|
3700 |
self notify:'Cannot drop a directory into one of its parent directories'. |
|
3701 |
^ false |
|
4414 | 3702 |
] |
6284 | 3703 |
] ifFalse:[ |
3704 |
physicalPathName := dropFileName physicalPathName. |
|
3705 |
(aDirectory = dropFileName directory |
|
3706 |
or:[ aDropObject isFileInArchive not |
|
3707 |
and:[physicalPathName notNil |
|
3708 |
and:[ aDirectory = physicalPathName asFilename directory]]]) ifTrue:[ |
|
3709 |
self notify:'Cannot drop a file into same directory'. |
|
3710 |
^ false |
|
3711 |
] |
|
3712 |
]. |
|
3713 |
^ true. |
|
3892 | 3714 |
! |
3715 |
||
7406 | 3716 |
canDropObjects:aCollectionOfDropObjects in:aWidget |
3717 |
^ aCollectionOfDropObjects contains:[:dropObject | dropObject isFileObject] |
|
3718 |
||
3719 |
"Created: / 13-10-2006 / 15:52:49 / cg" |
|
3720 |
! |
|
3721 |
||
3892 | 3722 |
doStartDrag:aDropSource in:aView |
7829 | 3723 |
"set the cursors before starting the drag & drop operation" |
3724 |
||
3892 | 3725 |
|hdl| |
3726 |
||
3727 |
hdl := DragAndDropManager new. |
|
3728 |
||
4337
f2eed806e854
change first letter uppercase methods on class side to lowercase ones
penk
parents:
4317
diff
changeset
|
3729 |
hdl disabledCursor:self class disabledCursorImage. |
f2eed806e854
change first letter uppercase methods on class side to lowercase ones
penk
parents:
4317
diff
changeset
|
3730 |
hdl enabledCursor:self class enabledCursorImage. |
3892 | 3731 |
hdl alienCursor:nil. |
3732 |
||
4745 | 3733 |
hdl startDragFrom:aView dropSource:aDropSource offset:#topLeft. |
3734 |
||
7829 | 3735 |
"Modified: / 23-07-2007 / 23:00:38 / cg" |
6479 | 3736 |
! |
3737 |
||
7408 | 3738 |
dropObjects:aCollectionOfDropObjects in:aWidget at:position |
7990 | 3739 |
|fileEntryFieldHolder destDir dropObject fn d| |
3740 |
||
3741 |
fileEntryFieldHolder := self masterApplication notNil |
|
3742 |
ifTrue:[ self masterApplication fileEntryFieldHolder ] |
|
3743 |
ifFalse:[ self fileEntryFieldHolder ]. |
|
3744 |
||
3745 |
aWidget model == fileEntryFieldHolder ifTrue:[ |
|
7900
52ad708471ad
drop into fileName-path-field: goto that directory
Claus Gittinger <cg@exept.de>
parents:
7897
diff
changeset
|
3746 |
dropObject := aCollectionOfDropObjects first. |
52ad708471ad
drop into fileName-path-field: goto that directory
Claus Gittinger <cg@exept.de>
parents:
7897
diff
changeset
|
3747 |
dropObject isFileObject ifTrue:[ |
52ad708471ad
drop into fileName-path-field: goto that directory
Claus Gittinger <cg@exept.de>
parents:
7897
diff
changeset
|
3748 |
fn := dropObject theObject asFilename. |
52ad708471ad
drop into fileName-path-field: goto that directory
Claus Gittinger <cg@exept.de>
parents:
7897
diff
changeset
|
3749 |
dropObject isDirectory ifTrue:[ |
52ad708471ad
drop into fileName-path-field: goto that directory
Claus Gittinger <cg@exept.de>
parents:
7897
diff
changeset
|
3750 |
d := fn. |
52ad708471ad
drop into fileName-path-field: goto that directory
Claus Gittinger <cg@exept.de>
parents:
7897
diff
changeset
|
3751 |
] ifFalse:[ |
52ad708471ad
drop into fileName-path-field: goto that directory
Claus Gittinger <cg@exept.de>
parents:
7897
diff
changeset
|
3752 |
d := fn directory. |
52ad708471ad
drop into fileName-path-field: goto that directory
Claus Gittinger <cg@exept.de>
parents:
7897
diff
changeset
|
3753 |
]. |
7990 | 3754 |
fileEntryFieldHolder value:d pathName. |
7900
52ad708471ad
drop into fileName-path-field: goto that directory
Claus Gittinger <cg@exept.de>
parents:
7897
diff
changeset
|
3755 |
]. |
52ad708471ad
drop into fileName-path-field: goto that directory
Claus Gittinger <cg@exept.de>
parents:
7897
diff
changeset
|
3756 |
^ self. |
52ad708471ad
drop into fileName-path-field: goto that directory
Claus Gittinger <cg@exept.de>
parents:
7897
diff
changeset
|
3757 |
]. |
6479 | 3758 |
|
3759 |
destDir := self currentDirectory. |
|
3760 |
destDir isNil ifTrue:[^ self]. |
|
3761 |
||
8601 | 3762 |
self withWaitCursorDo:[ |
3763 |
aCollectionOfDropObjects do:[:dropObject | |
|
3764 |
|fn| |
|
3765 |
||
3766 |
dropObject isFileObject ifTrue:[ |
|
3767 |
fn := dropObject theObject asFilename. |
|
3768 |
dropObject isDirectory ifTrue:[ |
|
8808
cb6476c0cd3a
oops - drop of directories was broken
Claus Gittinger <cg@exept.de>
parents:
8716
diff
changeset
|
3769 |
fn recursiveCopyTo:destDir |
8601 | 3770 |
] ifFalse:[ |
8950
48c69259d82d
changed: #dropObjects:in:at:
Claus Gittinger <cg@exept.de>
parents:
8887
diff
changeset
|
3771 |
fn copyTo:(destDir / fn baseName ) |
8601 | 3772 |
] |
6479 | 3773 |
] |
8601 | 3774 |
]. |
3775 |
]. |
|
3776 |
||
6479 | 3777 |
self directoryContentsBrowser |
3778 |
directoryContentsChangeFlag:true; |
|
3779 |
wakeUp |
|
7408 | 3780 |
|
3781 |
"Created: / 13-10-2006 / 18:26:41 / cg" |
|
3892 | 3782 |
! ! |
3783 |
||
3784 |
!AbstractFileBrowser methodsFor:'file operations'! |
|
3785 |
||
3786 |
copyFile:aSourceFile to:aDestFile |
|
6190 | 3787 |
"copy to" |
3788 |
||
7635 | 3789 |
^ self copyFile:aSourceFile to:aDestFile repairCorruptedFiles:false |
3790 |
||
3791 |
"Modified: / 07-02-2007 / 18:46:44 / cg" |
|
3792 |
! |
|
3793 |
||
3794 |
copyFile:aSourceFile to:aDestFile repairCorruptedFiles:repairCorruptedFiles |
|
3795 |
"copy to" |
|
3796 |
||
3797 |
|copyOperation msg| |
|
3798 |
||
3799 |
repairCorruptedFiles ifTrue:[ |
|
3800 |
copyOperation := FileOperation copyCorruptedFile:aSourceFile to:aDestFile |
|
3801 |
] ifFalse:[ |
|
3802 |
copyOperation := FileOperation copyFile:aSourceFile to:aDestFile withOverWriteWarning:true copyFileIfSame:true. |
|
3803 |
]. |
|
3804 |
copyOperation result ifTrue:[ |
|
6190 | 3805 |
msg := ('copy ', aSourceFile baseName, ' to:,', aDestFile baseName). |
3892 | 3806 |
] ifFalse:[ |
7635 | 3807 |
msg := copyOperation errorString. |
6190 | 3808 |
]. |
3809 |
self notify:msg. |
|
7635 | 3810 |
^ copyOperation result |
3811 |
||
3812 |
"Created: / 07-02-2007 / 18:46:34 / cg" |
|
3892 | 3813 |
! |
3814 |
||
3815 |
copyFiles:aColOfSourceFiles to:aDirectory |
|
6374 | 3816 |
|copy result| |
3892 | 3817 |
|
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
3818 |
self withActivityIndicationDo:[ |
5961 | 3819 |
copy := FileOperation copyFiles:aColOfSourceFiles to:aDirectory. |
6374 | 3820 |
copy result ifTrue:[ |
3821 |
result := Dictionary withKeys:(copy collectionOfCopiedFiles) andValues:(copy collectionOfNewFiles). |
|
3822 |
] ifFalse:[ |
|
4629
e8739857466c
show busyCursor while moving/copying files.
Claus Gittinger <cg@exept.de>
parents:
4624
diff
changeset
|
3823 |
self notify:copy errorString. |
e8739857466c
show busyCursor while moving/copying files.
Claus Gittinger <cg@exept.de>
parents:
4624
diff
changeset
|
3824 |
]. |
e8739857466c
show busyCursor while moving/copying files.
Claus Gittinger <cg@exept.de>
parents:
4624
diff
changeset
|
3825 |
self updateCurrentDirectory. |
3892 | 3826 |
]. |
6374 | 3827 |
^ result |
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
3828 |
|
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
3829 |
"Modified: / 25-07-2006 / 09:07:04 / cg" |
3892 | 3830 |
! |
3831 |
||
4707
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
3832 |
copyOrMoveDialog:aCollectionOfFiles for:aDestinationDirectory |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
3833 |
|size stream msg answer file| |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
3834 |
|
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
3835 |
size := aCollectionOfFiles size. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
3836 |
|
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
3837 |
"/ stream := WriteStream on:'' asText. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
3838 |
"/ 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
|
3839 |
"/ size == 1 ifFalse:[ |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
3840 |
"/ stream nextPutAll:'s'. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
3841 |
"/ ]. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
3842 |
"/ stream nextPutAll:': '. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
3843 |
"/ 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
|
3844 |
"/ size == 1 ifFalse:[ |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
3845 |
"/ stream nextPutAll:' ... '. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
3846 |
"/ 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
|
3847 |
"/ ]. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
3848 |
"/ stream cr; nextPutAll:'to: '. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
3849 |
"/ 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
|
3850 |
"/ msg := stream contents |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
3851 |
size == 1 ifTrue:[ |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
3852 |
file := aCollectionOfFiles first. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
3853 |
msg := resources |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
3854 |
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
|
3855 |
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
|
3856 |
with:(file baseName allBold) |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
3857 |
with:(aDestinationDirectory asFilename pathName allBold). |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
3858 |
] ifFalse:[ |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
3859 |
msg := resources |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
3860 |
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
|
3861 |
with:size |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
3862 |
with:(aDestinationDirectory asFilename pathName allBold). |
3892 | 3863 |
]. |
4707
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
3864 |
|
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
3865 |
answer := OptionBox |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
3866 |
request:msg |
8127 | 3867 |
label:(resources string:'Copy or Move') |
5898
f6214812e1d2
dont send obsolete message to OptionBox
Claus Gittinger <cg@exept.de>
parents:
5888
diff
changeset
|
3868 |
image:(WarningBox iconBitmap) |
8127 | 3869 |
buttonLabels:(resources array:#('Cancel' 'Move' 'Copy' 'Copy As...')) |
4354
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
3870 |
values:#(#cancel #move #copy #copyAs) |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
3871 |
default:#copy. |
4707
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
3872 |
answer isNil ifTrue:[answer := #cancel]. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
3873 |
^ answer. |
3892 | 3874 |
! |
3875 |
||
4354
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
3876 |
copyOrMoveFiles:aColOfSourceFiles to:aDestinationDirectory |
4745 | 3877 |
"copy or move aColOfSourceFiles to aDirectory. |
3878 |
Asks the used if a move or a copy is wanted. |
|
3879 |
Returns true if the copyOrMove happened, false if user aborted the operation." |
|
3880 |
||
4707
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
3881 |
|answer lastOld lastNew| |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
3882 |
|
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
3883 |
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
|
3884 |
answer == #copyAs ifTrue:[ |
4354
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
3885 |
aColOfSourceFiles do:[:eachSourceFile | |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
3886 |
|initial destFile srcBase dstBase| |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
3887 |
|
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
3888 |
srcBase := eachSourceFile asFilename baseName. |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
3889 |
lastOld isNil ifTrue:[ |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
3890 |
initial := srcBase |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
3891 |
] ifFalse:[ |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
3892 |
initial := DoWhatIMeanSupport |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
3893 |
goodRenameDefaultForFile:srcBase lastOld:lastOld lastNew:lastNew. |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
3894 |
]. |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
3895 |
dstBase := Dialog request:('Copy %1 as:' bindWith:srcBase) initialAnswer:initial. |
4745 | 3896 |
dstBase isNil ifTrue:[^ false]. |
4354
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
3897 |
self copyFile:eachSourceFile to:(aDestinationDirectory construct:dstBase). |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
3898 |
lastOld := srcBase. |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
3899 |
lastNew := dstBase. |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
3900 |
]. |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
3901 |
|
4745 | 3902 |
^ true. |
4354
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
3903 |
]. |
4707
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
3904 |
answer == #copy ifTrue:[ |
4354
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
3905 |
self copyFiles:aColOfSourceFiles to:aDestinationDirectory. |
4745 | 3906 |
^ true. |
3892 | 3907 |
]. |
4707
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
3908 |
answer == #move ifTrue:[ |
4354
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
3909 |
self moveFiles:aColOfSourceFiles to:aDestinationDirectory. |
4745 | 3910 |
^ true. |
3892 | 3911 |
]. |
4745 | 3912 |
^ false. |
3892 | 3913 |
! |
3914 |
||
6107 | 3915 |
copySelectionTo |
3916 |
"copy the selected file(s) to another directory" |
|
3917 |
||
7635 | 3918 |
self copySelectionToRepairingCorruptedFiles:false |
3919 |
||
3920 |
"Modified: / 07-02-2007 / 18:42:48 / cg" |
|
3921 |
! |
|
3922 |
||
3923 |
copySelectionToRepairingCorruptedFiles |
|
3924 |
"copy the selected file(s) to another directory" |
|
3925 |
||
3926 |
self copySelectionToRepairingCorruptedFiles:true |
|
3927 |
||
3928 |
"Created: / 07-02-2007 / 18:42:59 / cg" |
|
3929 |
! |
|
3930 |
||
3931 |
copySelectionToRepairingCorruptedFiles:repairingCorruptedFiles |
|
3932 |
"copy the selected file(s) to another directory" |
|
3933 |
||
6299 | 3934 |
|selectedFiles msg destination directory| |
3935 |
||
7560 | 3936 |
selectedFiles := self currentSelectedObjects copy. |
6299 | 3937 |
selectedFiles isEmptyOrNil ifTrue:[^ self]. |
3938 |
||
3939 |
msg := (selectedFiles size > 1) |
|
3940 |
ifTrue:[ 'Copy Selected Items To Directory:' ] |
|
3941 |
ifFalse:[ 'Copy "%1" To Directory:' ]. |
|
3942 |
||
3943 |
destination := Dialog |
|
7635 | 3944 |
requestDirectoryName:(resources stringWithCRs:msg with:selectedFiles first pathName) |
3945 |
default:(LastMoveDestination ? self currentDirectory) |
|
3946 |
ok:(resources string:'Copy') |
|
3947 |
abort:nil. |
|
3948 |
||
6299 | 3949 |
destination isEmptyOrNil ifTrue:[^ self]. |
3950 |
destination := destination asFilename. |
|
3951 |
||
3952 |
destination isDirectory ifFalse:[ |
|
3953 |
selectedFiles size == 1 ifTrue:[ |
|
3954 |
directory := destination directory. |
|
3955 |
directory isDirectory ifTrue:[ |
|
3956 |
LastMoveDestination := directory. |
|
7635 | 3957 |
self copyFile:selectedFiles first to:destination repairCorruptedFiles:repairingCorruptedFiles. |
6299 | 3958 |
^ self. |
3959 |
] |
|
3960 |
] |
|
3961 |
]. |
|
3962 |
||
3963 |
LastMoveDestination := destination. |
|
7635 | 3964 |
repairingCorruptedFiles ifTrue:[ |
3965 |
selectedFiles do:[:eachFile | |
|
3966 |
self copyFile:eachFile to:destination repairCorruptedFiles:repairingCorruptedFiles. |
|
3967 |
]. |
|
3968 |
^ self. |
|
3969 |
] ifFalse:[ |
|
3970 |
self copyFiles:selectedFiles to:destination |
|
3971 |
] |
|
3972 |
||
3973 |
"Created: / 07-02-2007 / 18:42:35 / cg" |
|
6107 | 3974 |
! |
3975 |
||
3892 | 3976 |
deleteFile:aFile |
6373 | 3977 |
"delete the selected files/directories" |
3892 | 3978 |
|
3979 |
^ self deleteFiles:(OrderedCollection with:aFile). |
|
3980 |
! |
|
3981 |
||
3982 |
deleteFiles:colOfFiles |
|
6373 | 3983 |
"delete some files/directories" |
3984 |
||
5081 | 3985 |
^ self deleteFiles:colOfFiles confirm:true. |
3986 |
! |
|
3987 |
||
3988 |
deleteFiles:colOfFiles confirm:confirm |
|
6373 | 3989 |
"delete some files/directories" |
3990 |
||
5673 | 3991 |
|delete result| |
3892 | 3992 |
|
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
3993 |
self withActivityIndicationDo:[ |
5961 | 3994 |
delete := FileOperation deleteFiles:colOfFiles confirm:confirm. |
5673 | 3995 |
result := delete result. |
3996 |
result notNil ifTrue:[ |
|
3997 |
result ifFalse:[ |
|
3998 |
self notify:delete errorString. |
|
5753 | 3999 |
] ifTrue:[ |
4000 |
self updateListAfterDelete:colOfFiles. |
|
4001 |
] |
|
4394 | 4002 |
]. |
5673 | 4003 |
]. |
4004 |
^ result. |
|
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
4005 |
|
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
4006 |
"Modified: / 25-07-2006 / 09:07:13 / cg" |
3892 | 4007 |
! |
4008 |
||
6169 | 4009 |
eraseFiles:colOfFiles |
6373 | 4010 |
"erase (clear and delete) some files/directories" |
4011 |
||
6169 | 4012 |
^ self eraseFiles:colOfFiles confirm:true. |
4013 |
! |
|
4014 |
||
4015 |
eraseFiles:colOfFiles confirm:confirm |
|
6373 | 4016 |
"erase (clear and delete) some files/directories" |
4017 |
||
8462
a5d12742a900
changed #eraseFiles:confirm:
Claus Gittinger <cg@exept.de>
parents:
8454
diff
changeset
|
4018 |
|deleteOperation result fileSize| |
6169 | 4019 |
|
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
4020 |
self withActivityIndicationDo:[ |
8462
a5d12742a900
changed #eraseFiles:confirm:
Claus Gittinger <cg@exept.de>
parents:
8454
diff
changeset
|
4021 |
fileSize := colOfFiles first asFilename fileSize. |
8294 | 4022 |
deleteOperation := FileOperation eraseFiles:colOfFiles confirm:confirm. |
8462
a5d12742a900
changed #eraseFiles:confirm:
Claus Gittinger <cg@exept.de>
parents:
8454
diff
changeset
|
4023 |
(colOfFiles size == 1 and:[ fileSize < (10*1024*1024) ]) |
8294 | 4024 |
ifTrue:[ |
4025 |
result := deleteOperation result. |
|
4026 |
] ifFalse:[ |
|
4027 |
ProgressIndicator |
|
4028 |
displayProgressNotifications:'Erasing' |
|
4029 |
abortable:true |
|
4030 |
at:nil |
|
4031 |
during:[ |
|
4032 |
result := deleteOperation result. |
|
4033 |
]. |
|
4034 |
]. |
|
4035 |
||
6169 | 4036 |
result notNil ifTrue:[ |
4037 |
result ifFalse:[ |
|
8294 | 4038 |
self notify:deleteOperation errorString. |
6169 | 4039 |
] ifTrue:[ |
4040 |
self updateListAfterDelete:colOfFiles. |
|
4041 |
] |
|
4042 |
]. |
|
4043 |
]. |
|
4044 |
^ result. |
|
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
4045 |
|
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
4046 |
"Modified: / 25-07-2006 / 09:07:16 / cg" |
6169 | 4047 |
! |
4048 |
||
3892 | 4049 |
moveFile:aSourceFile to:aDestFile |
6373 | 4050 |
"move a file/directory" |
3892 | 4051 |
|
4052 |
|move| |
|
4053 |
||
5961 | 4054 |
move := FileOperation moveFile:aSourceFile to:aDestFile. |
3892 | 4055 |
move result ifTrue:[ |
4523 | 4056 |
self notify:('move ', aSourceFile asString, ' to ', aDestFile asString). |
3892 | 4057 |
] ifFalse:[ |
4523 | 4058 |
self notify:move errorString. |
3892 | 4059 |
]. |
4060 |
self updateCurrentDirectory. |
|
4061 |
^ move result |
|
4062 |
! |
|
4063 |
||
4064 |
moveFiles:aColOfSourceFiles to:aDirectory |
|
6373 | 4065 |
"move some files to aDirectory" |
4066 |
||
3892 | 4067 |
|move| |
4068 |
||
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
4069 |
self withActivityIndicationDo:[ |
5961 | 4070 |
move := FileOperation moveFiles:aColOfSourceFiles to:aDirectory. |
4629
e8739857466c
show busyCursor while moving/copying files.
Claus Gittinger <cg@exept.de>
parents:
4624
diff
changeset
|
4071 |
move result ifFalse:[ |
e8739857466c
show busyCursor while moving/copying files.
Claus Gittinger <cg@exept.de>
parents:
4624
diff
changeset
|
4072 |
self notify:move errorString. |
e8739857466c
show busyCursor while moving/copying files.
Claus Gittinger <cg@exept.de>
parents:
4624
diff
changeset
|
4073 |
]. |
e8739857466c
show busyCursor while moving/copying files.
Claus Gittinger <cg@exept.de>
parents:
4624
diff
changeset
|
4074 |
self updateCurrentDirectory. |
3892 | 4075 |
]. |
6373 | 4076 |
^ move collectionOfMovedFiles |
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
4077 |
|
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
4078 |
"Modified: / 25-07-2006 / 09:07:32 / cg" |
3892 | 4079 |
! |
4080 |
||
6107 | 4081 |
moveSelectionTo |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4082 |
"move the selected file(s) to another directory" |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4083 |
|
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4084 |
|destinationDirectory| |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4085 |
|
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4086 |
destinationDirectory := Dialog |
6352 | 4087 |
requestDirectoryName:(resources stringWithCRs:'Move Selected Items To:') |
5789 | 4088 |
default:(LastMoveDestination ? self currentDirectory) |
6952 | 4089 |
ok:(resources string:'Move') |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4090 |
abort:nil. |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4091 |
destinationDirectory isEmptyOrNil ifTrue:[^ self]. |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4092 |
|
5789 | 4093 |
LastMoveDestination := destinationDirectory. |
7560 | 4094 |
self moveFiles:(self currentSelectedObjects copy) to:destinationDirectory asFilename |
4095 |
||
4096 |
"Modified: / 04-12-2006 / 13:15:12 / cg" |
|
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4097 |
! |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4098 |
|
3892 | 4099 |
newDirectory |
4100 |
"ask for and create a new directory" |
|
4101 |
||
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4102 |
|selectedFiles singleSelectedFile defaultAnswer directory createOp newFile mime| |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4103 |
|
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4104 |
directory := self currentDirectory. |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4105 |
directory isNil ifTrue:[ |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4106 |
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
|
4107 |
^ self |
366465d1a8a5
warn on create new file or directory if nothing selected or more than one directory
penk
parents:
4976
diff
changeset
|
4108 |
]. |
4521 | 4109 |
|
4110 |
"/ 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
|
4111 |
selectedFiles := self currentSelectedFiles. |
4521 | 4112 |
selectedFiles size == 1 ifTrue:[ |
4113 |
singleSelectedFile := selectedFiles first. |
|
4114 |
||
4115 |
mime := MIMETypes mimeTypeForFilename:singleSelectedFile. |
|
4116 |
(mime notNil and:[mime isArchive]) ifTrue:[ |
|
4117 |
defaultAnswer := singleSelectedFile asFilename withoutSuffix baseName. |
|
4118 |
||
4119 |
mime := MIMETypes mimeTypeForFilename:defaultAnswer. |
|
4982
c38742d99bfd
care for nil mime in newDirectory
Claus Gittinger <cg@exept.de>
parents:
4979
diff
changeset
|
4120 |
(mime notNil and:[mime isArchive]) ifTrue:[ |
4521 | 4121 |
defaultAnswer := defaultAnswer asFilename withoutSuffix baseName |
4122 |
]. |
|
4123 |
]. |
|
4124 |
]. |
|
4125 |
||
5961 | 4126 |
|
4521 | 4127 |
defaultAnswer notNil ifTrue:[ |
5961 | 4128 |
createOp := FileOperation createDirectoryIn:directory initialAnswer:defaultAnswer. |
4521 | 4129 |
] ifFalse:[ |
5961 | 4130 |
createOp := FileOperation createDirectoryIn:directory. |
4521 | 4131 |
]. |
4132 |
createOp result ifFalse:[ ^ self]. |
|
4133 |
newFile := createOp createdFile. |
|
3892 | 4134 |
newFile notNil ifTrue:[ |
4414 | 4135 |
self updateCurrentDirectory. |
3892 | 4136 |
] |
4137 |
! |
|
4138 |
||
4139 |
newFile |
|
4140 |
"ask for and create a new file" |
|
4141 |
||
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4142 |
| curFile directory create file| |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4143 |
|
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4144 |
directory := self currentDirectory. |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4145 |
directory isNil ifTrue:[ |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4146 |
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
|
4147 |
^ self. |
366465d1a8a5
warn on create new file or directory if nothing selected or more than one directory
penk
parents:
4976
diff
changeset
|
4148 |
]. |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4149 |
|
3982 | 4150 |
curFile := self firstSelectedFile. |
3892 | 4151 |
curFile notNil ifTrue:[ |
4414 | 4152 |
file := curFile. |
3892 | 4153 |
] ifFalse:[ |
4414 | 4154 |
file := directory. |
3892 | 4155 |
]. |
5961 | 4156 |
create := FileOperation createFileIn:file. |
3892 | 4157 |
create result ifFalse:[ ^ self]. |
4158 |
self updateAndSelect:(OrderedCollection with:(create createdFile)). |
|
4159 |
! |
|
4160 |
||
4161 |
newHardLink |
|
4162 |
"ask for and create a hard link (unix only)" |
|
4163 |
||
6151 | 4164 |
self newLink:#hard. |
4165 |
! |
|
4166 |
||
4167 |
newLink:typeOfLink |
|
3892 | 4168 |
"ask for and create a symbolic if symbolic is true otherwise a hard link (unix only)" |
4169 |
||
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4170 |
| sel dir create createdFile| |
3892 | 4171 |
|
7560 | 4172 |
sel := self currentSelectedObjects. |
4979
366465d1a8a5
warn on create new file or directory if nothing selected or more than one directory
penk
parents:
4976
diff
changeset
|
4173 |
(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
|
4174 |
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
|
4175 |
^ self |
366465d1a8a5
warn on create new file or directory if nothing selected or more than one directory
penk
parents:
4976
diff
changeset
|
4176 |
]. |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4177 |
dir := sel first. |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4178 |
|
6151 | 4179 |
create := FileOperation createLinkIn:dir soft:(typeOfLink == #soft). |
3892 | 4180 |
create result ifFalse:[ ^ self]. |
4181 |
createdFile := create createdFile. |
|
4182 |
createdFile notNil ifTrue:[ |
|
6151 | 4183 |
typeOfLink == #soft ifTrue:[ |
4785
5a3f7a0c3ff1
symbolic link creation code fixed
Claus Gittinger <cg@exept.de>
parents:
4782
diff
changeset
|
4184 |
self updateCurrentDirectory. |
5a3f7a0c3ff1
symbolic link creation code fixed
Claus Gittinger <cg@exept.de>
parents:
4782
diff
changeset
|
4185 |
] ifFalse:[ |
5a3f7a0c3ff1
symbolic link creation code fixed
Claus Gittinger <cg@exept.de>
parents:
4782
diff
changeset
|
4186 |
self updateAndSelect:(OrderedCollection with:createdFile). |
5a3f7a0c3ff1
symbolic link creation code fixed
Claus Gittinger <cg@exept.de>
parents:
4782
diff
changeset
|
4187 |
] |
3892 | 4188 |
]. |
7560 | 4189 |
|
4190 |
"Modified: / 04-12-2006 / 13:15:15 / cg" |
|
3892 | 4191 |
! |
4192 |
||
4193 |
newSoftLink |
|
4194 |
"ask for and create a soft link (unix only)" |
|
4195 |
||
6151 | 4196 |
self newLink:#soft. |
3892 | 4197 |
! |
4198 |
||
4199 |
pasteFiles |
|
6373 | 4200 |
"paste from clipBoard" |
4201 |
||
4202 |
|buffer destination files directories copiedFiles thisIsAFileMoveOperation| |
|
3892 | 4203 |
|
4204 |
files := self clipboard files. |
|
6482
00207f456339
isEmptyOrNil / notEmptyOrNil refactoring
Claus Gittinger <cg@exept.de>
parents:
6479
diff
changeset
|
4205 |
files isEmptyOrNil ifTrue:[ ^ self ]. |
6373 | 4206 |
|
4207 |
thisIsAFileMoveOperation := self clipboard method == #cut. |
|
4208 |
||
3892 | 4209 |
buffer := self clipboard copy. |
3982 | 4210 |
directories := self currentSelectedDirectories. |
5880 | 4211 |
directories size ~~ 1 ifTrue:[ |
4414 | 4212 |
|box dirStringCol| |
5880 | 4213 |
|
4414 | 4214 |
dirStringCol := directories collect:[:aDir| aDir asString]. |
4215 |
box := ListSelectionBox new. |
|
6373 | 4216 |
box title:'Paste into which directory ?'. |
4414 | 4217 |
box list:dirStringCol. |
4218 |
box okAction:[:sel | destination := sel asFilename]. |
|
5003
a14ce263ada5
boxes no longer show at pointer
Claus Gittinger <cg@exept.de>
parents:
4982
diff
changeset
|
4219 |
box show. |
a14ce263ada5
boxes no longer show at pointer
Claus Gittinger <cg@exept.de>
parents:
4982
diff
changeset
|
4220 |
box destroy. |
3892 | 4221 |
] ifFalse:[ |
5880 | 4222 |
destination := directories anElement. |
3892 | 4223 |
]. |
6373 | 4224 |
|
4225 |
thisIsAFileMoveOperation ifTrue:[ |
|
5081 | 4226 |
buffer files copy do:[:aFile| |
4227 |
aFile directory = destination ifTrue:[ |
|
4228 |
buffer files remove:aFile. |
|
4229 |
]. |
|
4230 |
]. |
|
4231 |
]. |
|
4232 |
copiedFiles := self copyFiles:(buffer files) to:destination. |
|
6374 | 4233 |
copiedFiles notEmptyOrNil ifTrue:[ |
4234 |
thisIsAFileMoveOperation ifTrue:[ |
|
4235 |
self deleteFiles:(copiedFiles keys) confirm:false. |
|
4236 |
]. |
|
4237 |
||
4238 |
"/ select those pasted files. |
|
4239 |
self updateCurrentDirectory:true. |
|
4240 |
self currentFileNameHolder value:copiedFiles values. |
|
4241 |
] |
|
3892 | 4242 |
! |
4243 |
||
4244 |
renameFile:aFile |
|
4245 |
"rename the selected file(s)" |
|
4246 |
||
4247 |
^ self renameFiles:(OrderedCollection with:aFile). |
|
4248 |
! |
|
4249 |
||
4230 | 4250 |
renameFile:filename to:newFileString update:aBoolean |
3892 | 4251 |
"rename filename to newFileString" |
4252 |
||
4253 |
|rename| |
|
4254 |
||
5961 | 4255 |
rename := FileOperation renameFile:filename to:newFileString. |
3892 | 4256 |
rename result ifTrue:[ |
4230 | 4257 |
aBoolean ifTrue:[ |
4258 |
self updateAndSelect:(rename renamedFiles). |
|
4259 |
]. |
|
3892 | 4260 |
] ifFalse:[ |
4523 | 4261 |
self notify:rename errorString. |
3892 | 4262 |
]. |
4263 |
^ rename result |
|
4264 |
! |
|
4265 |
||
4266 |
renameFiles:aColOfFiles |
|
6373 | 4267 |
"rename some file(s)" |
3892 | 4268 |
|
4269 |
|rename| |
|
4270 |
||
5961 | 4271 |
rename := FileOperation renameFiles:aColOfFiles. |
3892 | 4272 |
rename result ifFalse:[ |
4523 | 4273 |
self notify:rename errorString |
3892 | 4274 |
] ifTrue:[ |
4707
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4275 |
self updateAndSelect:nil. "/ (rename renamedFiles) |
3892 | 4276 |
]. |
4277 |
^ rename result |
|
4278 |
! |
|
4279 |
||
4280 |
renameSelection |
|
4281 |
"rename the selected file(s)" |
|
4282 |
||
7560 | 4283 |
self renameFiles:(self currentSelectedObjects copy) |
4284 |
||
4285 |
"Modified: / 04-12-2006 / 13:15:24 / cg" |
|
3892 | 4286 |
! ! |
4287 |
||
4080 | 4288 |
!AbstractFileBrowser methodsFor:'menu accessing'! |
3892 | 4289 |
|
9111
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
4290 |
bookmarksMenu |
3952 | 4291 |
<resource: #programMenu> |
4292 |
||
4672
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
4293 |
|menu bookmarks| |
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
4294 |
|
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
4295 |
menu := self class baseBookmarksMenuSpec decodeAsLiteralArray. |
7763 | 4296 |
|
4297 |
"/ add the bookmark items ... |
|
4298 |
bookmarks := self class directoryBookmarks. |
|
4299 |
bookmarks notEmptyOrNil ifTrue:[ |
|
4300 |
menu addItem:(MenuItem labeled:'-'). |
|
4301 |
bookmarks do:[:dirName | |
|
4302 |
menu addItem:((MenuItem label:dirName asString value:[ |
|
4303 |
(self currentSelectedDirectories includes:dirName) ifFalse:[ |
|
4304 |
self setCurrentFileName:dirName. |
|
4305 |
]. |
|
4306 |
])). |
|
4307 |
]. |
|
4308 |
]. |
|
4080 | 4309 |
menu findGuiResourcesIn:self. |
7763 | 4310 |
^ menu |
4311 |
||
4312 |
"Modified: / 27-03-2007 / 10:55:08 / cg" |
|
4313 |
! |
|
4314 |
||
4315 |
canBackward |
|
4316 |
^ self directoryHistory canBackward. |
|
4317 |
||
4318 |
"Modified: / 27-03-2007 / 10:54:55 / cg" |
|
4319 |
! |
|
4320 |
||
4321 |
canForward |
|
4322 |
^ self directoryHistory canForward. |
|
4323 |
||
4324 |
"Modified: / 27-03-2007 / 10:54:57 / cg" |
|
4325 |
! |
|
4326 |
||
9111
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
4327 |
gotoBookmarksMenu |
7763 | 4328 |
<resource: #programMenu> |
4329 |
||
4330 |
|menu bookmarks| |
|
4331 |
||
4332 |
menu := self class baseBookmarksMenuSpec2 decodeAsLiteralArray. |
|
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
4333 |
|
4672
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
4334 |
"/ add the bookmark items ... |
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
4335 |
bookmarks := self class directoryBookmarks. |
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
4336 |
bookmarks notEmptyOrNil ifTrue:[ |
4414 | 4337 |
menu addItem:(MenuItem labeled:'-'). |
4338 |
bookmarks do:[:dirName | |
|
4339 |
menu addItem:((MenuItem label:dirName asString value:[ |
|
6725 | 4340 |
(self currentSelectedDirectories includes:dirName) ifFalse:[ |
5959 | 4341 |
self setCurrentFileName:dirName. |
4414 | 4342 |
]. |
4343 |
])). |
|
4344 |
]. |
|
3952 | 4345 |
]. |
7763 | 4346 |
menu findGuiResourcesIn:self. |
3952 | 4347 |
^ menu |
4348 |
||
7763 | 4349 |
"Modified: / 27-03-2007 / 10:54:50 / cg" |
6099 | 4350 |
! |
4351 |
||
3892 | 4352 |
menuDirHistory:backOrForward |
7763 | 4353 |
"initialize the history menu" |
4354 |
||
3892 | 4355 |
<resource: #programMenu > |
4356 |
||
7763 | 4357 |
|hist menu pathList currentSel currentPath| |
4358 |
||
4359 |
hist := self directoryHistory. |
|
4360 |
hist isEmpty ifTrue:[^ nil]. |
|
4361 |
||
3892 | 4362 |
backOrForward == #back ifTrue:[ |
6725 | 4363 |
currentSel := self currentSelectedDirectories. |
4347 | 4364 |
currentSel size == 1 ifTrue:[ |
4365 |
currentPath := currentSel first asString. |
|
4366 |
] ifFalse:[ |
|
4367 |
currentPath := nil. |
|
4368 |
]. |
|
7763 | 4369 |
pathList := hist getBackCollection. |
3892 | 4370 |
] ifFalse:[ |
7763 | 4371 |
pathList := hist getForwardCollection. |
3892 | 4372 |
]. |
4022 | 4373 |
pathList isEmpty ifTrue:[ ^ nil]. |
7763 | 4374 |
|
6370 | 4375 |
pathList size > 30 ifTrue:[ |
4376 |
pathList := pathList copyTo:30 |
|
4377 |
]. |
|
7763 | 4378 |
|
4379 |
menu := Menu new. |
|
4380 |
||
3964 | 4381 |
pathList do:[:aPath| |
4347 | 4382 |
| menuItem | |
4383 |
menuItem := MenuItem new. |
|
4384 |
menuItem label:aPath. |
|
4385 |
menuItem value:[ |
|
5959 | 4386 |
self setCurrentFileName:(aPath asFilename). |
4347 | 4387 |
]. |
4388 |
menu addItem:menuItem. |
|
3952 | 4389 |
]. |
7763 | 4390 |
menu findGuiResourcesIn:self. |
3892 | 4391 |
^ menu |
7763 | 4392 |
|
4393 |
"Modified: / 27-03-2007 / 10:54:29 / cg" |
|
3892 | 4394 |
! |
4395 |
||
4396 |
menuDirHistoryBack |
|
4397 |
"initialize the directory menu |
|
4398 |
" |
|
4399 |
<resource: #programMenu > |
|
4400 |
||
4401 |
^ self menuDirHistory:#back. |
|
4402 |
! |
|
4403 |
||
4404 |
menuDirHistoryForward |
|
4405 |
"initialize the directory menu |
|
4406 |
" |
|
4407 |
<resource: #programMenu > |
|
4408 |
||
4409 |
^ self menuDirHistory:#forward. |
|
3906 | 4410 |
! |
4411 |
||
4412 |
menuFileHistory |
|
4413 |
"initialize the file history menu |
|
4414 |
" |
|
4415 |
<resource: #programMenu > |
|
4416 |
||
7763 | 4417 |
|menu hist text removeItem| |
3906 | 4418 |
|
4419 |
hist := self fileHistory. |
|
4420 |
hist isEmpty ifTrue:[^ nil]. |
|
4391
05ad03de6f3c
no icon in clearHistory menuItem
Claus Gittinger <cg@exept.de>
parents:
4368
diff
changeset
|
4421 |
|
7763 | 4422 |
menu := Menu new. |
4423 |
||
4424 |
hist copy do:[:aFileItem| |
|
4391
05ad03de6f3c
no icon in clearHistory menuItem
Claus Gittinger <cg@exept.de>
parents:
4368
diff
changeset
|
4425 |
aFileItem fileName exists ifTrue:[ |
05ad03de6f3c
no icon in clearHistory menuItem
Claus Gittinger <cg@exept.de>
parents:
4368
diff
changeset
|
4426 |
menu addItem:(MenuItem label: aFileItem fileName asString value:[ |
5959 | 4427 |
self setCurrentFileName:(aFileItem fileName). |
4391
05ad03de6f3c
no icon in clearHistory menuItem
Claus Gittinger <cg@exept.de>
parents:
4368
diff
changeset
|
4428 |
self openApplByFileItem:aFileItem |
05ad03de6f3c
no icon in clearHistory menuItem
Claus Gittinger <cg@exept.de>
parents:
4368
diff
changeset
|
4429 |
]). |
05ad03de6f3c
no icon in clearHistory menuItem
Claus Gittinger <cg@exept.de>
parents:
4368
diff
changeset
|
4430 |
] ifFalse:[ |
7763 | 4431 |
"/ remove all not existing history entries |
4432 |
hist remove:aFileItem. |
|
4391
05ad03de6f3c
no icon in clearHistory menuItem
Claus Gittinger <cg@exept.de>
parents:
4368
diff
changeset
|
4433 |
] |
3906 | 4434 |
]. |
7763 | 4435 |
menu addSeparator. |
4436 |
||
4080 | 4437 |
removeItem := MenuItem new. |
4438 |
removeItem translateLabel:true. |
|
4391
05ad03de6f3c
no icon in clearHistory menuItem
Claus Gittinger <cg@exept.de>
parents:
4368
diff
changeset
|
4439 |
text := resources string:'Clear History'. |
05ad03de6f3c
no icon in clearHistory menuItem
Claus Gittinger <cg@exept.de>
parents:
4368
diff
changeset
|
4440 |
"/ text := LabelAndIcon icon:(self class clearHistoryIcon) string:text. |
4080 | 4441 |
removeItem label:text. |
4442 |
removeItem value:[ |
|
4391
05ad03de6f3c
no icon in clearHistory menuItem
Claus Gittinger <cg@exept.de>
parents:
4368
diff
changeset
|
4443 |
self fileHistory removeAll. |
05ad03de6f3c
no icon in clearHistory menuItem
Claus Gittinger <cg@exept.de>
parents:
4368
diff
changeset
|
4444 |
self enableFileHistory value:false. |
3906 | 4445 |
]. |
4446 |
menu addItem:removeItem. |
|
7763 | 4447 |
menu findGuiResourcesIn:self. |
3906 | 4448 |
^ menu |
7763 | 4449 |
|
4450 |
"Modified: / 27-03-2007 / 10:52:40 / cg" |
|
3952 | 4451 |
! |
4452 |
||
4080 | 4453 |
sortMenu |
4454 |
<resource: #programMenu > |
|
4455 |
||
4456 |
|menu| |
|
4457 |
||
7763 | 4458 |
menu := Menu decodeFromLiteralArray:self class sortMenu. |
4080 | 4459 |
menu findGuiResourcesIn:self. |
4460 |
^ menu |
|
7763 | 4461 |
|
4462 |
"Modified: / 27-03-2007 / 10:47:42 / cg" |
|
4080 | 4463 |
! |
4464 |
||
4465 |
viewDetailsMenuSpec |
|
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4466 |
|specContentsBrowser itemsContentsBrowser specHere itemsHere spec| |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4467 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4468 |
specHere := self class viewDetailsMenuSpec. |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4469 |
itemsHere := specHere at:2. |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4470 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4471 |
specContentsBrowser := self directoryContentsBrowser class viewBrowserMenuSpec. |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4472 |
itemsContentsBrowser := (specContentsBrowser at:2). |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4473 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4474 |
spec := specHere copy. |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4475 |
spec at:2 put:(itemsContentsBrowser , itemsHere). |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4476 |
^ spec |
4080 | 4477 |
! |
4478 |
||
4479 |
viewInContentsBrowserMenu |
|
5009 | 4480 |
self |
4481 |
applicationNamed:#DirectoryContentsBrowser |
|
4482 |
ifPresentDo:[:appl | ^ appl viewBrowserMenu]. |
|
4483 |
||
4484 |
^ nil. |
|
4080 | 4485 |
! |
4486 |
||
3952 | 4487 |
visitedDirectoriesMenu |
4488 |
<resource: #programMenu > |
|
4489 |
||
4490 |
|menu histCopy text removeItem| |
|
4491 |
||
7763 | 4492 |
histCopy := self directoryHistory. |
4493 |
histCopy isEmpty ifTrue:[^ nil]. |
|
4494 |
||
3952 | 4495 |
menu := Menu new. |
7763 | 4496 |
|
4497 |
histCopy do:[:aFile| |
|
4498 |
menu addItem:(MenuItem label:aFile asString value:[ |
|
4499 |
self setCurrentFileName:(aFile path asFilename). |
|
4500 |
]). |
|
4501 |
]. |
|
4502 |
menu addSeparator. |
|
4503 |
||
4672
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
4504 |
"/ 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
|
4505 |
text := (resources string:'Clear History'). |
3952 | 4506 |
removeItem := MenuItem new. |
4040 | 4507 |
removeItem translateLabel:true. |
3952 | 4508 |
removeItem label:text. |
4509 |
removeItem value:[ |
|
6369 | 4510 |
self directoryHistory removeAll. |
4347 | 4511 |
self enableForward value:self canForward. |
4512 |
self enableBack value:self canBackward. |
|
3952 | 4513 |
]. |
7763 | 4514 |
|
3952 | 4515 |
menu addItem:removeItem. |
7763 | 4516 |
menu findGuiResourcesIn:self. |
3952 | 4517 |
^ menu |
7763 | 4518 |
|
4519 |
"Modified: / 27-03-2007 / 10:50:39 / cg" |
|
3892 | 4520 |
! ! |
4521 |
||
5880 | 4522 |
!AbstractFileBrowser methodsFor:'menu actions'! |
4523 |
||
4524 |
doCompareTwoFiles |
|
4525 |
self openDiffView. |
|
4526 |
! |
|
4527 |
||
4528 |
doGoDirectoryUp |
|
5960 | 4529 |
| upDir directory rootInTreeView| |
5880 | 4530 |
|
4531 |
self enableDirectoryUp value ifFalse:[ ^ self]. |
|
4532 |
self currentFilesAreInSameDirectory ifTrue:[ |
|
5960 | 4533 |
directory := self currentDirectory. |
4534 |
directory isNil ifTrue:[ ^ self]. |
|
5880 | 4535 |
] ifFalse:[ |
4536 |
rootInTreeView := self |
|
4537 |
applicationNamed:#DirectoryTreeBrowser |
|
4538 |
ifPresentDo:[:appl | appl rootHolder]. |
|
5960 | 4539 |
directory := rootInTreeView value asFilename. |
4540 |
]. |
|
4541 |
upDir := directory directory. |
|
5959 | 4542 |
self setCurrentFileName:upDir. |
5880 | 4543 |
! |
4544 |
||
4545 |
doGotoDefaultDirectory |
|
4546 |
self gotoFile:(Filename defaultDirectory). |
|
4547 |
! |
|
4548 |
||
8091 | 4549 |
doGotoDesktopDirectory |
4550 |
self gotoFile:(Filename desktopDirectory). |
|
4551 |
! |
|
4552 |
||
5880 | 4553 |
doGotoHomeDirectory |
8091 | 4554 |
self gotoFile:(Filename homeDirectory). |
5880 | 4555 |
! |
4556 |
||
6434 | 4557 |
doGotoSmalltalkDirectory |
4558 |
self gotoFile:(self smalltalkDirectory). |
|
4559 |
! |
|
4560 |
||
5880 | 4561 |
fileGetInfo:longInfo |
4562 |
"get info on selected file - show it in a box" |
|
4563 |
||
4564 |
|string box updater| |
|
4565 |
||
4566 |
string := self getFileInfoStringForFirstSelectedFile:longInfo. |
|
4567 |
string notNil ifTrue:[ |
|
4568 |
box := InfoBox title:string. |
|
4569 |
updater := [ |
|
4570 |
[true] whileTrue:[ |
|
4571 |
Delay waitForSeconds:2. |
|
4572 |
string := self getFileInfoStringForFirstSelectedFile:longInfo. |
|
4573 |
string isNil ifTrue:[ ^ self]. |
|
4574 |
box title:string |
|
4575 |
] |
|
4576 |
] fork. |
|
4577 |
box show. |
|
4578 |
updater terminate. |
|
4579 |
box destroy |
|
4580 |
] |
|
6434 | 4581 |
! |
4582 |
||
4583 |
smalltalkDirectory |
|
8590 | 4584 |
|stxPath| |
6434 | 4585 |
|
4586 |
stxPath := OperatingSystem pathOfSTXExecutable. |
|
8590 | 4587 |
stxPath isNil ifTrue:[ |
4588 |
^ Filename currentDirectory |
|
4589 |
]. |
|
4590 |
^ stxPath asFilename directory. |
|
5880 | 4591 |
! ! |
4592 |
||
4849 | 4593 |
!AbstractFileBrowser methodsFor:'menu actions-cvs'! |
3892 | 4594 |
|
4595 |
cvsAddAndCommit |
|
4849 | 4596 |
self cvsAddAndCommitAsBinary:false |
4597 |
! |
|
4598 |
||
4599 |
cvsAddAndCommitAsBinary:asBinary |
|
8588 | 4600 |
|sel log logArg binArg cmd dir executionBlock nameString| |
3892 | 4601 |
|
4602 |
log := Dialog |
|
4849 | 4603 |
requestText:(resources string:'Enter initial log message') |
4414 | 4604 |
lines:10 |
4605 |
columns:70 |
|
4606 |
initialAnswer:nil. |
|
8322
cf10f08b6164
care for cancel in #cvsAddAndCommitAsBinary:
Claus Gittinger <cg@exept.de>
parents:
8294
diff
changeset
|
4607 |
log isNil ifTrue:[^ self]. |
3892 | 4608 |
|
6205
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
4609 |
OperatingSystem isMSWINDOWSlike ifTrue:[ |
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
4610 |
logArg := '-m "' , log , '"'. |
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
4611 |
] ifFalse:[ |
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
4612 |
logArg := '-m ''' , log , ''''. |
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
4613 |
]. |
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
4614 |
|
8588 | 4615 |
binArg := ''. |
4616 |
asBinary ifTrue:[ |
|
4617 |
binArg := '-kb '. |
|
4618 |
]. |
|
3982 | 4619 |
sel := self currentSelectedFiles. |
3892 | 4620 |
executionBlock := [ : stream | |
4414 | 4621 |
log notNil ifTrue:[ |
4622 |
sel size > 0 ifTrue:[ |
|
4623 |
sel do:[:fn | |
|
8567
bcbadc9d40c3
allow checkin of files with a space
Claus Gittinger <cg@exept.de>
parents:
8563
diff
changeset
|
4624 |
|nameArg| |
bcbadc9d40c3
allow checkin of files with a space
Claus Gittinger <cg@exept.de>
parents:
8563
diff
changeset
|
4625 |
|
bcbadc9d40c3
allow checkin of files with a space
Claus Gittinger <cg@exept.de>
parents:
8563
diff
changeset
|
4626 |
nameArg := '"',fn baseName,'"'. |
bcbadc9d40c3
allow checkin of files with a space
Claus Gittinger <cg@exept.de>
parents:
8563
diff
changeset
|
4627 |
|
4414 | 4628 |
dir := self getDirWithoutFileName:fn. |
8588 | 4629 |
cmd := 'cvs add ',logArg,' ',binArg,nameArg. |
6204 | 4630 |
(self getExecutionBlockForCommand:cmd inDirectory:dir) value:stream. |
4849 | 4631 |
|
8567
bcbadc9d40c3
allow checkin of files with a space
Claus Gittinger <cg@exept.de>
parents:
8563
diff
changeset
|
4632 |
cmd := ('cvs commit -l ',logArg,' ',nameArg). |
6204 | 4633 |
(self getExecutionBlockForCommand:cmd inDirectory:dir) value:stream. |
8588 | 4634 |
"/ mhmh - it seems that only old CVS implementations (at least turqoise) |
4635 |
"/ support and need the 'admin -kb' command. |
|
4636 |
"/ newer ones use the '-kb' option in the 'cvs add' command |
|
6205
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
4637 |
asBinary ifTrue:[ |
8567
bcbadc9d40c3
allow checkin of files with a space
Claus Gittinger <cg@exept.de>
parents:
8563
diff
changeset
|
4638 |
cmd := ('cvs admin -kb ' , nameArg). |
6205
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
4639 |
(self getExecutionBlockForCommand:cmd inDirectory:dir) value:stream. |
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
4640 |
|
8567
bcbadc9d40c3
allow checkin of files with a space
Claus Gittinger <cg@exept.de>
parents:
8563
diff
changeset
|
4641 |
cmd := ('cvs upd ' , nameArg). |
6205
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
4642 |
(self getExecutionBlockForCommand:cmd inDirectory:dir) value:stream. |
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
4643 |
]. |
4414 | 4644 |
] |
4645 |
] |
|
4646 |
] |
|
3892 | 4647 |
]. |
4107 | 4648 |
nameString := 'Command> cvs add and commit'. |
3892 | 4649 |
self makeExecutionResultProcessFor:executionBlock withName:nameString. |
4650 |
! |
|
4651 |
||
4849 | 4652 |
cvsAddBinaryAndCommit |
4653 |
self cvsAddAndCommitAsBinary:true |
|
4654 |
! |
|
4655 |
||
3892 | 4656 |
cvsCommit |
6205
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
4657 |
|nSel log logArg msg cmd selectedFiles sel executionBlock nameString| |
3892 | 4658 |
|
3982 | 4659 |
selectedFiles:= self currentSelectedFiles. |
3892 | 4660 |
nSel := selectedFiles size. |
4661 |
||
4662 |
nSel == 1 ifTrue:[ |
|
8440 | 4663 |
msg := resources string:'Enter log message for checkIn of "%1"' with:(selectedFiles first baseName) |
3892 | 4664 |
] ifFalse:[ |
4414 | 4665 |
nSel > 1 ifTrue:[ |
6627 | 4666 |
msg := resources string:'Enter log message for %1 files to checkIn' with:nSel printString |
4414 | 4667 |
] ifFalse:[ |
6627 | 4668 |
msg := resources string:'Enter log message for checkIn' |
4414 | 4669 |
] |
3892 | 4670 |
]. |
4671 |
||
4672 |
log := Dialog |
|
4414 | 4673 |
requestText:msg |
4674 |
lines:10 |
|
4675 |
columns:70 |
|
4676 |
initialAnswer:nil. |
|
3892 | 4677 |
|
4663 | 4678 |
log isNil ifTrue:[^ self]. |
6205
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
4679 |
|
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
4680 |
OperatingSystem isMSWINDOWSlike ifTrue:[ |
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
4681 |
logArg := '-m "' , log , '"'. |
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
4682 |
] ifFalse:[ |
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
4683 |
logArg := '-m ''' , log , ''''. |
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
4684 |
]. |
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
4685 |
|
7560 | 4686 |
sel := self currentSelectedObjects. |
4663 | 4687 |
sel isEmpty ifTrue:[ ^ self ]. |
7560 | 4688 |
|
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
4689 |
executionBlock := [:stream | |
4663 | 4690 |
log notNil ifTrue:[ |
4691 |
sel size > 0 ifTrue:[ |
|
4692 |
sel do:[:fn | |
|
8568
fe221c53eead
allow checkin of files with a space
Claus Gittinger <cg@exept.de>
parents:
8567
diff
changeset
|
4693 |
| dir nameArg | |
fe221c53eead
allow checkin of files with a space
Claus Gittinger <cg@exept.de>
parents:
8567
diff
changeset
|
4694 |
|
fe221c53eead
allow checkin of files with a space
Claus Gittinger <cg@exept.de>
parents:
8567
diff
changeset
|
4695 |
nameArg := '"',fn baseName,'"'. |
4663 | 4696 |
dir := fn directory. |
8568
fe221c53eead
allow checkin of files with a space
Claus Gittinger <cg@exept.de>
parents:
8567
diff
changeset
|
4697 |
cmd := 'cvs commit ',logArg,' ' , nameArg. |
6204 | 4698 |
(self getExecutionBlockForCommand:cmd inDirectory:dir) value:stream. |
4663 | 4699 |
] |
4700 |
] |
|
4701 |
] |
|
4107 | 4702 |
]. |
4703 |
nameString := 'Command> cvs commit'. |
|
4704 |
self makeExecutionResultProcessFor:executionBlock withName:nameString. |
|
7560 | 4705 |
|
4706 |
"Modified: / 04-12-2006 / 13:16:39 / cg" |
|
3892 | 4707 |
! |
4708 |
||
4709 |
cvsRemoveAndRemoveFromCVS:filesToRemove |
|
4710 |
"remove the selected file(s) and their CVS containers - no questions asked" |
|
4711 |
||
6205
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
4712 |
|toRemove updateRunning executionBlock nameString| |
3892 | 4713 |
|
4714 |
updateRunning := self backgroundProcesses value notEmpty. |
|
4715 |
self killAllRunningBackgroundProcesses. |
|
4716 |
toRemove := OrderedCollection new. |
|
4717 |
||
4718 |
executionBlock := [ : stream | |
|
6205
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
4719 |
|cmd logArg| |
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
4720 |
|
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
4721 |
OperatingSystem isMSWINDOWSlike ifTrue:[ |
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
4722 |
logArg := '-m "' , 'removed via FileBrowser' , '"'. |
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
4723 |
] ifFalse:[ |
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
4724 |
logArg := '-m ''' , 'removed via FileBrowser' , ''''. |
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
4725 |
]. |
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
4726 |
|
4414 | 4727 |
filesToRemove do:[:fileName | |
4728 |
OperatingSystem accessDeniedErrorSignal handle:[:ex| |
|
4729 |
"was not able to remove it" |
|
6205
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
4730 |
| lastError msg | |
4414 | 4731 |
lastError := OperatingSystem lastErrorString. |
4732 |
msg := (resources string:'cannot remove ''%1'' !!' with:fileName). |
|
4733 |
lastError isNil ifFalse:[ |
|
4734 |
msg := msg , '\\(' , lastError , ')' |
|
4735 |
]. |
|
4736 |
Dialog warn:msg withCRs |
|
4737 |
] do:[ |
|
6250
5b0673ccff1c
refactored intention revealing code:
Claus Gittinger <cg@exept.de>
parents:
6236
diff
changeset
|
4738 |
(fileName isSymbolicLink) ifFalse:[ |
4414 | 4739 |
fileName remove. |
8568
fe221c53eead
allow checkin of files with a space
Claus Gittinger <cg@exept.de>
parents:
8567
diff
changeset
|
4740 |
cmd := ('cvs remove -f "',fileName baseName,'"'). |
6204 | 4741 |
(self getExecutionBlockForCommand:cmd) value:stream. |
4414 | 4742 |
] |
4743 |
]. |
|
4744 |
]. |
|
6205
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
4745 |
cmd := 'cvs commit -l ',logArg. |
6204 | 4746 |
(self getExecutionBlockForCommand:cmd) value:stream. |
3892 | 4747 |
]. |
4107 | 4748 |
nameString := 'Command> cvs remove and commit ', filesToRemove first baseName. |
3892 | 4749 |
filesToRemove size > 1 ifTrue:[ |
4414 | 4750 |
nameString := nameString, ' ...'. |
3892 | 4751 |
]. |
4752 |
self makeExecutionResultProcessFor:executionBlock withName:nameString. |
|
4753 |
! |
|
4754 |
||
4755 |
cvsRemoveFileAndCVSContainer |
|
4756 |
|sel question aswer| |
|
4757 |
||
4294 | 4758 |
sel := self currentSelectedFiles copy. |
3892 | 4759 |
sel size > 0 ifTrue:[ |
4294 | 4760 |
sel size > 1 ifTrue:[ |
4761 |
question := resources string:'Remove %1 selected files and their CVS containers ?' with:(sel size) |
|
4762 |
] ifFalse:[ |
|
4763 |
question := resources string:'Remove ''%1'' and its CVS container ?' with:(sel first baseName allBold) |
|
4764 |
]. |
|
4765 |
||
4766 |
aswer := Dialog |
|
4767 |
confirm:question withCRs |
|
6627 | 4768 |
yesLabel:(resources string:'Remove') |
4769 |
noLabel:(resources string:'Cancel'). |
|
4294 | 4770 |
aswer ifTrue:[ |
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
4771 |
self withActivityIndicationDo:[ |
4294 | 4772 |
self cvsRemoveAndRemoveFromCVS:sel |
4773 |
] |
|
4774 |
] |
|
3892 | 4775 |
] |
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
4776 |
|
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
4777 |
"Modified: / 25-07-2006 / 09:07:09 / cg" |
3892 | 4778 |
! |
4779 |
||
8562 | 4780 |
cvsTagSelection |
4781 |
|tag stream cmd| |
|
4782 |
||
4783 |
tag := Dialog request:(resources string:'Tag:'). |
|
4784 |
||
4785 |
CVSSourceCodeManager notNil ifTrue:[ |
|
4786 |
cmd := CVSSourceCodeManager cvsExecutable. |
|
4787 |
] ifFalse:[ |
|
4788 |
cmd := 'cvs'. |
|
4789 |
]. |
|
4790 |
||
4791 |
stream := WriteStream on:''. |
|
4792 |
stream |
|
4793 |
nextPutAll:cmd; |
|
4794 |
nextPutAll:' tag -F '; |
|
4795 |
nextPutAll:'"'; |
|
4796 |
nextPutAll:tag; |
|
8563 | 4797 |
nextPutAll:'" '; |
4798 |
nextPutAll:(self makeFileNameArgumentString). |
|
4799 |
||
8562 | 4800 |
self executeCommand:stream contents. |
4801 |
! |
|
4802 |
||
3892 | 4803 |
cvsUpdateAll |
4804 |
| cmd | |
|
4805 |
||
8042
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
4806 |
CVSSourceCodeManager notNil ifTrue:[ |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
4807 |
cmd := CVSSourceCodeManager cvsExecutable. |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
4808 |
] ifFalse:[ |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
4809 |
cmd := 'cvs'. |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
4810 |
]. |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
4811 |
|
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
4812 |
self executeCommand:(cmd, ' upd -l'). |
3892 | 4813 |
! |
4814 |
||
4815 |
cvsUpdateAllRecursive |
|
4816 |
| cmd | |
|
4817 |
||
8042
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
4818 |
CVSSourceCodeManager notNil ifTrue:[ |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
4819 |
cmd := CVSSourceCodeManager cvsExecutable. |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
4820 |
] ifFalse:[ |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
4821 |
cmd := 'cvs'. |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
4822 |
]. |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
4823 |
self executeCommand:(cmd, ' upd -d'). |
3892 | 4824 |
! |
4825 |
||
4826 |
cvsUpdateSelection |
|
8042
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
4827 |
|stream cmd| |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
4828 |
|
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
4829 |
CVSSourceCodeManager notNil ifTrue:[ |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
4830 |
cmd := CVSSourceCodeManager cvsExecutable. |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
4831 |
] ifFalse:[ |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
4832 |
cmd := 'cvs'. |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
4833 |
]. |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
4834 |
|
3892 | 4835 |
stream := WriteStream on:''. |
8563 | 4836 |
stream |
4837 |
nextPutAll:cmd; |
|
4838 |
nextPutAll:' upd '; |
|
4839 |
nextPutAll:(self makeFileNameArgumentString). |
|
4840 |
||
4841 |
self executeCommand:stream contents. |
|
4842 |
! |
|
4843 |
||
4844 |
makeFileNameArgumentString |
|
4845 |
|stream| |
|
4846 |
||
4847 |
stream := WriteStream on:''. |
|
8042
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
4848 |
self currentSelectedFiles do:[: file | |
8563 | 4849 |
stream nextPut:$". |
4414 | 4850 |
stream nextPutAll:file baseName. |
8563 | 4851 |
stream nextPutAll:'" '. |
4852 |
]. |
|
4853 |
^ stream contents. |
|
3892 | 4854 |
! ! |
4855 |
||
6169 | 4856 |
!AbstractFileBrowser methodsFor:'menu actions-file'! |
3892 | 4857 |
|
4453
00e639bf2723
cut and copy files in toolbarmenu goes not to contentsbrowser only
penk
parents:
4432
diff
changeset
|
4858 |
copyFiles |
6169 | 4859 |
self |
4860 |
withSelectedFilesOrDirectoriesDo:[:filesOrDirs | self copyFilesToClipBoard:filesOrDirs] |
|
4453
00e639bf2723
cut and copy files in toolbarmenu goes not to contentsbrowser only
penk
parents:
4432
diff
changeset
|
4861 |
! |
00e639bf2723
cut and copy files in toolbarmenu goes not to contentsbrowser only
penk
parents:
4432
diff
changeset
|
4862 |
|
00e639bf2723
cut and copy files in toolbarmenu goes not to contentsbrowser only
penk
parents:
4432
diff
changeset
|
4863 |
cutFiles |
6169 | 4864 |
self |
4865 |
withSelectedFilesOrDirectoriesDo:[:filesOrDirs | self cutFilesToClipBoard:filesOrDirs] |
|
4453
00e639bf2723
cut and copy files in toolbarmenu goes not to contentsbrowser only
penk
parents:
4432
diff
changeset
|
4866 |
! |
00e639bf2723
cut and copy files in toolbarmenu goes not to contentsbrowser only
penk
parents:
4432
diff
changeset
|
4867 |
|
00e639bf2723
cut and copy files in toolbarmenu goes not to contentsbrowser only
penk
parents:
4432
diff
changeset
|
4868 |
deleteFiles |
6169 | 4869 |
self |
4870 |
withSelectedFilesOrDirectoriesDo:[:filesOrDirs | self deleteFiles:filesOrDirs] |
|
4871 |
! |
|
4872 |
||
4873 |
eraseFiles |
|
4874 |
self |
|
4875 |
withSelectedFilesOrDirectoriesDo:[:filesOrDirs | self eraseFiles:filesOrDirs] |
|
4940
4964068c4718
allow settings dialog to be opened from browser
Claus Gittinger <cg@exept.de>
parents:
4930
diff
changeset
|
4876 |
! |
4964068c4718
allow settings dialog to be opened from browser
Claus Gittinger <cg@exept.de>
parents:
4930
diff
changeset
|
4877 |
|
4964068c4718
allow settings dialog to be opened from browser
Claus Gittinger <cg@exept.de>
parents:
4930
diff
changeset
|
4878 |
openSettingsDialog |
4964068c4718
allow settings dialog to be opened from browser
Claus Gittinger <cg@exept.de>
parents:
4930
diff
changeset
|
4879 |
|dialog| |
4964068c4718
allow settings dialog to be opened from browser
Claus Gittinger <cg@exept.de>
parents:
4930
diff
changeset
|
4880 |
|
4964068c4718
allow settings dialog to be opened from browser
Claus Gittinger <cg@exept.de>
parents:
4930
diff
changeset
|
4881 |
dialog := FileBrowserV2SettingsDialog new. |
5034 | 4882 |
dialog settingsDialog:self. |
4940
4964068c4718
allow settings dialog to be opened from browser
Claus Gittinger <cg@exept.de>
parents:
4930
diff
changeset
|
4883 |
dialog allButOpen. |
4964068c4718
allow settings dialog to be opened from browser
Claus Gittinger <cg@exept.de>
parents:
4930
diff
changeset
|
4884 |
dialog doReload. |
4964068c4718
allow settings dialog to be opened from browser
Claus Gittinger <cg@exept.de>
parents:
4930
diff
changeset
|
4885 |
dialog openWindow |
6169 | 4886 |
! |
4887 |
||
4888 |
withSelectedFilesOrDirectoriesDo:aBlock |
|
4889 |
|files dirs| |
|
4890 |
||
4891 |
files := self currentSelectedFiles. |
|
4892 |
files notEmpty ifTrue:[ |
|
4893 |
aBlock value:files. |
|
4894 |
] ifFalse:[ |
|
4895 |
dirs := self currentSelectedDirectories. |
|
4896 |
dirs notEmpty ifTrue:[ |
|
4897 |
aBlock value:dirs. |
|
4898 |
]. |
|
4899 |
]. |
|
3892 | 4900 |
! ! |
4901 |
||
4849 | 4902 |
!AbstractFileBrowser methodsFor:'menu actions-help'! |
4903 |
||
4904 |
openAboutThisApplication |
|
4905 |
"opens an about box for this application." |
|
4906 |
||
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4907 |
Dialog aboutClass:self class. |
4849 | 4908 |
! |
4909 |
||
4910 |
openHTMLDocument:relativeDocPath |
|
4911 |
HTMLDocumentView openFullOnDocumentationFile:relativeDocPath |
|
4912 |
! ! |
|
4913 |
||
4914 |
!AbstractFileBrowser methodsFor:'menu actions-tools'! |
|
3892 | 4915 |
|
8510 | 4916 |
allFilesInSelectedDirectoriesForWhich:aBlock |
4917 |
|directories allFiles| |
|
4918 |
||
4919 |
directories := self currentSelectedDirectories. |
|
4920 |
directories isEmpty ifTrue:[^ self]. |
|
4921 |
||
4922 |
allFiles := OrderedCollection new. |
|
4923 |
directories do:[:dir| |
|
4924 |
[ |
|
4925 |
|fileNames| |
|
4926 |
||
4927 |
fileNames := dir directoryContents. |
|
4928 |
fileNames notNil ifTrue:[ |
|
4929 |
fileNames := fileNames |
|
4930 |
collect:[:fn | dir construct:fn] |
|
4931 |
thenSelect:[:fn | fn isDirectory not and:[aBlock value:fn]]. |
|
4932 |
allFiles addAll:fileNames. |
|
4933 |
] |
|
4934 |
] on:FileStream openErrorSignal do:[:ex| |
|
4935 |
self warn:(resources stringWithCRs:'Cannot access: %1\(%2)' |
|
4936 |
with:ex pathName |
|
4937 |
with:ex description). |
|
4938 |
ex proceedWith:nil. |
|
4939 |
]. |
|
4940 |
]. |
|
4941 |
||
4942 |
^ allFiles |
|
4943 |
! |
|
4944 |
||
4721
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
4945 |
conversionChainFrom:inSuffix to:outSuffix |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
4946 |
|conv| |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
4947 |
|
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
4948 |
inSuffix = outSuffix ifTrue:[ |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
4949 |
^ nil |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
4950 |
]. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
4951 |
|
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
4952 |
"/ 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
|
4953 |
"/ 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
|
4954 |
|
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
4955 |
conv := OrderedCollection new. |
4722 | 4956 |
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
|
4957 |
|
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
4958 |
outSuffix = 'png' ifTrue:[ |
4722 | 4959 |
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
|
4960 |
^ conv. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
4961 |
]. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
4962 |
outSuffix = 'gif' ifTrue:[ |
4722 | 4963 |
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
|
4964 |
^ conv. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
4965 |
]. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
4966 |
outSuffix = 'xpm' ifTrue:[ |
4722 | 4967 |
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
|
4968 |
^ conv. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
4969 |
]. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
4970 |
outSuffix = 'jpg' ifTrue:[ |
4722 | 4971 |
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
|
4972 |
^ conv. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
4973 |
]. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
4974 |
self error:'unimplemented conversion'. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
4975 |
! |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
4976 |
|
4367 | 4977 |
convertImageToGIF |
4721
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
4978 |
self convertImageToSuffix:'gif' |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
4979 |
! |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
4980 |
|
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
4981 |
convertImageToJPG |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
4982 |
self convertImageToSuffix:'jpg' |
4531 | 4983 |
! |
4984 |
||
4985 |
convertImageToPNG |
|
4721
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
4986 |
self convertImageToSuffix:'png' |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
4987 |
! |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
4988 |
|
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
4989 |
convertImageToSuffix:outSuffix |
4922 | 4990 |
|image writer tempFileXPM chainOfConversions conversionStream skipSignal |
4991 |
inFile outFile eachConversionSuffixCommandPair doneWithThisFile |
|
5880 | 4992 |
eachConversionSuffix eachConversionCommand tempFileTemplate |
4993 |
filesToConvert| |
|
4721
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
4994 |
|
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
4995 |
"/ [ |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
4996 |
skipSignal := Signal new. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
4997 |
|
4367 | 4998 |
self withActivityIndicationDo:[ |
7560 | 4999 |
filesToConvert := self currentSelectedObjects copy. |
5880 | 5000 |
filesToConvert do:[:fileName | |
6627 | 5001 |
skipSignal catch:[ |
4722 | 5002 |
|answer| |
5003 |
||
5004 |
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
|
5005 |
|
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5006 |
fileName isDirectory ifFalse:[ |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5007 |
outFile := fileName withSuffix:outSuffix. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5008 |
outFile exists ifTrue:[ |
4722 | 5009 |
answer := Dialog |
5010 |
confirmWithCancel:(resources string:'Overwrite existing %1 ?' with:outFile baseName allBold) |
|
5011 |
default:false. |
|
5012 |
answer isNil ifTrue:[AbortSignal raise]. |
|
5013 |
answer ifFalse:[ |
|
4721
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5014 |
skipSignal raise. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5015 |
]. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5016 |
]. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5017 |
|
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5018 |
image := Image fromFile:fileName. |
4922 | 5019 |
image notNil ifTrue:[ |
4721
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5020 |
writer := MIMETypes imageReaderForSuffix:outSuffix. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5021 |
(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
|
5022 |
writer save:image onFile:outFile. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5023 |
skipSignal raise. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5024 |
]. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5025 |
]. |
4922 | 5026 |
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
|
5027 |
|
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5028 |
chainOfConversions isNil ifTrue:[ skipSignal raise ]. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5029 |
conversionStream := chainOfConversions readStream. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5030 |
|
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5031 |
doneWithThisFile := false. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5032 |
|
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5033 |
tempFileTemplate := Filename newTemporary. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5034 |
|
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5035 |
inFile := fileName. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5036 |
eachConversionSuffixCommandPair := conversionStream next. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5037 |
eachConversionCommand := eachConversionSuffixCommandPair key. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5038 |
|
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5039 |
eachConversionCommand == #readToXPM ifTrue:[ |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5040 |
image := Image fromFile:(inFile pathName). |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5041 |
image isNil ifTrue:[ |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5042 |
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
|
5043 |
skipSignal raise. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5044 |
] ifFalse:[ |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5045 |
tempFileXPM := tempFileTemplate withSuffix:'xpm'. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5046 |
image saveOn:tempFileXPM using:XPMReader. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5047 |
inFile := tempFileXPM. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5048 |
]. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5049 |
eachConversionSuffixCommandPair := conversionStream next. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5050 |
]. |
4531 | 5051 |
|
4367 | 5052 |
[ |
5880 | 5053 |
|command errOutput errMsg| |
4721
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5054 |
|
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5055 |
[eachConversionSuffixCommandPair notNil] whileTrue:[ |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5056 |
eachConversionCommand := eachConversionSuffixCommandPair key. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5057 |
eachConversionSuffix := eachConversionSuffixCommandPair value. |
4531 | 5058 |
|
4722 | 5059 |
self notify:(resources string:'Converting: %1 to %2...' with:fileName baseName with:eachConversionSuffix). |
5060 |
||
4721
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5061 |
outFile := tempFileTemplate withSuffix:eachConversionSuffix. |
4722 | 5062 |
command := eachConversionCommand |
5063 |
bindWith:(inFile pathName) |
|
5064 |
with:(outFile pathName). |
|
5065 |
||
5755
5e8165d55605
replaced '' writeStream by String writeStream
Claus Gittinger <cg@exept.de>
parents:
5753
diff
changeset
|
5066 |
errOutput := String writeStream. |
4922 | 5067 |
|
4722 | 5068 |
(OperatingSystem executeCommand:command errorTo:errOutput) |
4367 | 5069 |
ifFalse:[ |
5880 | 5070 |
errMsg := resources |
4722 | 5071 |
stringWithCRs:'Conversion of %1 to %2 using %3 failed:\\%4.' |
5072 |
with:inFile baseName allBold |
|
5073 |
with:eachConversionSuffix |
|
5074 |
with:eachConversionCommand allBold |
|
5880 | 5075 |
with:errOutput contents. |
5076 |
filesToConvert size == 1 ifTrue:[ |
|
5077 |
Dialog warn:errMsg |
|
5078 |
] ifFalse:[ |
|
5079 |
(Dialog confirm:errMsg yesLabel:(resources string:'OK') noLabel:(resources string:'Cancel')) ifFalse:[ |
|
5080 |
^ self |
|
5081 |
] |
|
5082 |
]. |
|
4721
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5083 |
|
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5084 |
(inFile ~= fileName) ifTrue:[inFile delete]. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5085 |
outFile delete. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5086 |
skipSignal raise |
4367 | 5087 |
]. |
4721
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5088 |
(inFile ~= fileName) ifTrue:[inFile delete]. |
4531 | 5089 |
inFile := outFile. |
4721
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5090 |
eachConversionSuffixCommandPair := conversionStream next |
4367 | 5091 |
]. |
4721
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5092 |
] ifCurtailed:[ |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5093 |
(inFile ~= fileName) ifTrue:[inFile delete]. |
4531 | 5094 |
outFile delete. |
5095 |
]. |
|
5096 |
||
4721
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5097 |
outFile moveTo:(fileName withSuffix:(chainOfConversions last value)). |
4531 | 5098 |
self updateAndSelect:nil. |
4367 | 5099 |
] |
5100 |
] |
|
5101 |
]. |
|
6190 | 5102 |
self notify:nil. |
4367 | 5103 |
] |
4721
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5104 |
"/ ] fork. |
7560 | 5105 |
|
5106 |
"Modified: / 04-12-2006 / 13:14:29 / cg" |
|
4721
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5107 |
! |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5108 |
|
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5109 |
convertImageToXPM |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5110 |
self convertImageToSuffix:'xpm' |
4367 | 5111 |
! |
5112 |
||
3892 | 5113 |
createProjectAndOpenProjectBrowser |
5114 |
|nm f s directory| |
|
5115 |
||
5116 |
self currentFilesAreInSameDirectory ifFalse:[^ self]. |
|
5960 | 5117 |
directory := self currentDirectory. |
3892 | 5118 |
nm := directory baseName. |
5119 |
f := (directory construct:nm) withSuffix:'prj'. |
|
5120 |
f exists ifTrue:[ |
|
4414 | 5121 |
Dialog warn:'A file named ' , f baseName , ' already exists.'. |
5122 |
^ self. |
|
3892 | 5123 |
]. |
5124 |
s := f writeStream. |
|
5125 |
s nextPutAll:' |
|
5126 |
name ''' , nm , ''' |
|
5127 |
type #classLibrary |
|
5128 |
package #''private:' , nm , ''' |
|
5129 |
prerequisites nil |
|
5130 |
||
5131 |
classes #( ) |
|
5132 |
'. |
|
5133 |
s close. |
|
5134 |
ProjectBrowser openOnFile:f. |
|
5135 |
! |
|
5136 |
||
5880 | 5137 |
doExecuteCommand |
5138 |
"execute an OperatingSystem-command" |
|
5139 |
||
5140 |
| action fileName| |
|
5141 |
||
5142 |
fileName := self firstSelectedFile. |
|
5143 |
action := [:command | |
|
5144 |
self addToCommandHistory:command for:fileName. |
|
5145 |
self executeCommand:command. |
|
5146 |
]. |
|
5147 |
self askForCommandFor:fileName thenDo:action |
|
5148 |
! |
|
5149 |
||
5150 |
doExecuteScript |
|
5151 |
"execute a smalltalk script" |
|
5152 |
||
5153 |
|textHolder dialog template dummyClass dummyInstance| |
|
5154 |
||
5155 |
template := |
|
5156 |
'"/ Smalltalk script: |
|
5157 |
||
5158 |
"/ the following variables are accessable: |
|
5159 |
"/ directory (= ' , (self theSingleSelectedDirectoryOrNil ? Filename homeDirectory) pathName , ') |
|
5160 |
"/ selectedFiles (= ...) |
|
5161 |
"/ |
|
5162 |
"/ Beginner warning: Smalltalk know-how is useful here ;-). |
|
5163 |
"/ |
|
5164 |
"/ Useful operations are: |
|
5165 |
"/ directory directoryContentsDo:[:eachBaseNameString | ...] |
|
5166 |
"/ directory directoryContentsAsFilenamesDo:[:eachFilename | ...] |
|
5167 |
"/ directory directory |
|
5168 |
"/ |
|
5169 |
"/ example: move all files which match a aarticular pattern to |
|
5170 |
"/ a separate directory: |
|
5171 |
"/ |
|
5172 |
"/ |directory idx prefix rest newDir oldFile newFile| |
|
5173 |
"/ |
|
5174 |
"/ directory := ''/mnt/var/priv/image/tv/frank/frank2/2131_008.jpg'' asFilename. |
|
5175 |
"/ |
|
5176 |
"/ directory directoryContentsDo:[:eachBaseNameString | |
|
5177 |
"/ (eachBaseNameString includes:$_) ifTrue:[ |
|
5178 |
"/ idx := eachBaseNameString indexOf:$_. |
|
5179 |
"/ prefix := eachBaseNameString copyTo:(idx - 1). |
|
5180 |
"/ rest := eachBaseNameString copyFrom:(idx + 1). |
|
5181 |
"/ newDir := directory construct:prefix. |
|
5182 |
"/ newDir exists ifFalse:[ |
|
5183 |
"/ (Dialog confirm:''Create '' , newDir pathName) ifTrue:[ |
|
5184 |
"/ newDir makeDirectory. |
|
5185 |
"/ ]. |
|
5186 |
"/ ]. |
|
5187 |
"/ newDir exists ifTrue:[ |
|
5188 |
"/ oldFile := directory construct:eachBaseNameString. |
|
5189 |
"/ newFile := newDir construct:rest. |
|
5190 |
"/ oldFile moveTo:newFile |
|
5191 |
"/ ] |
|
5192 |
"/ ] |
|
5193 |
"/ ] |
|
5194 |
'. |
|
5195 |
||
5196 |
LastScriptBlockString isNil ifTrue:[ |
|
5197 |
LastScriptBlockString := template. |
|
5198 |
]. |
|
5199 |
||
5200 |
textHolder := ValueHolder new. |
|
5201 |
dialog := Dialog |
|
5202 |
forRequestText:(resources string:'Enter script') |
|
5203 |
editViewClass:CodeView |
|
5204 |
lines:25 |
|
5205 |
columns:70 |
|
5206 |
initialAnswer:LastScriptBlockString |
|
5207 |
model:textHolder. |
|
5208 |
dialog addButton:(Button label:'Template' action:[textHolder value:template. textHolder changed:#value.]). |
|
5209 |
dialog open. |
|
5210 |
dialog accepted ifFalse:[^ self]. |
|
5211 |
||
5212 |
LastScriptBlockString := textHolder value. |
|
5213 |
||
5214 |
Class classConventionViolationConfirmationQuerySignal |
|
5215 |
answer:true |
|
5216 |
do:[ |
|
5217 |
dummyClass := Object class |
|
5218 |
name:#Dummy |
|
5219 |
inEnvironment:nil |
|
5220 |
subclassOf:Object |
|
5221 |
instanceVariableNames:'directory selectedFiles' |
|
5222 |
variable:false |
|
5223 |
words:true |
|
5224 |
pointers:true |
|
5225 |
classVariableNames:'' |
|
5226 |
poolDictionaries:'' |
|
5227 |
category:#dummyCategory |
|
5228 |
comment:nil |
|
5229 |
changed:true. |
|
5230 |
]. |
|
5231 |
||
5232 |
dummyInstance := dummyClass basicNew. |
|
5233 |
dummyInstance instVarAt:1 put:(self theSingleSelectedDirectoryOrNil ? Filename homeDirectory). |
|
5234 |
dummyInstance instVarAt:2 put:(self currentSelectedFiles value). |
|
5235 |
||
5236 |
Compiler |
|
5237 |
evaluate:textHolder value |
|
5238 |
in:nil |
|
5239 |
receiver:dummyInstance |
|
5240 |
notifying:nil |
|
5241 |
logged:false |
|
5242 |
ifFail:[] |
|
5243 |
compile:true. |
|
5244 |
||
5245 |
"/ fileName := self firstSelectedFile. |
|
5246 |
"/ action := [:command | |
|
5247 |
"/ self addToCommandHistory:command for:fileName. |
|
5248 |
"/ self executeCommand:command. |
|
5249 |
"/ ]. |
|
5250 |
"/ self askForCommandFor:fileName thenDo:action |
|
5251 |
! |
|
5252 |
||
4230 | 5253 |
doMake |
7938 | 5254 |
|dir cmd| |
4230 | 5255 |
|
5256 |
cmd := 'make'. |
|
7938 | 5257 |
dir := self theSingleSelectedDirectoryOrNil. |
5258 |
||
5259 |
OperatingSystem isMSWINDOWSlike ifTrue:[ |
|
5260 |
dir notNil ifTrue:[ |
|
5261 |
(dir construct:'bmake.bat') exists ifTrue:[ |
|
5262 |
cmd := 'bmake.bat'. |
|
5263 |
] |
|
5264 |
] |
|
5265 |
]. |
|
4230 | 5266 |
self executeCommand:cmd. |
5267 |
! |
|
5268 |
||
8256 | 5269 |
doOpenCBrowser |
5270 |
|destDir| |
|
5271 |
||
5272 |
destDir := self currentDirectory. |
|
5273 |
CBrowser::Browser openIn:destDir pathName |
|
5274 |
! |
|
5275 |
||
7829 | 5276 |
doOpenExplorer |
8882 | 5277 |
OperatingSystem isMSWINDOWSlike ifFalse:[ |
5278 |
self warn:'sorry - this operation is only available under windows'. |
|
5279 |
]. |
|
7829 | 5280 |
|
5281 |
OperatingSystem |
|
8882 | 5282 |
openApplicationForDocument:(self currentDirectory) operation:#explore. |
7829 | 5283 |
|
5284 |
"Modified: / 23-07-2007 / 23:01:22 / cg" |
|
5285 |
! |
|
5286 |
||
4317
bf3f150809c2
settings is a new application now and will be inserted under tools in
penk
parents:
4294
diff
changeset
|
5287 |
doOpenSettings |
8168 | 5288 |
self openSettingsDialog |
4317
bf3f150809c2
settings is a new application now and will be inserted under tools in
penk
parents:
4294
diff
changeset
|
5289 |
! |
bf3f150809c2
settings is a new application now and will be inserted under tools in
penk
parents:
4294
diff
changeset
|
5290 |
|
7104 | 5291 |
editMode:aSymbol |
5292 |
self |
|
5293 |
applicationNamed:#FileApplicationNoteBook |
|
5294 |
ifPresentDo:[:appl | |
|
5295 |
|subApp| |
|
5296 |
||
5297 |
subApp := appl selectedApplication. |
|
5298 |
subApp notNil ifTrue:[ |
|
5299 |
^ subApp perform:aSymbol |
|
5300 |
] |
|
5301 |
]. |
|
5302 |
||
5303 |
"Created: / 11-09-2006 / 12:42:08 / cg" |
|
5304 |
! |
|
5305 |
||
5306 |
editModeInsert |
|
5307 |
self editMode:#editModeInsert |
|
5308 |
||
5309 |
"Created: / 11-09-2006 / 12:40:36 / cg" |
|
5310 |
! |
|
5311 |
||
5312 |
editModeInsertAndSelect |
|
5313 |
self editMode:#editModeInsertAndSelect |
|
5314 |
||
5315 |
"Created: / 11-09-2006 / 12:40:45 / cg" |
|
5316 |
! |
|
5317 |
||
5318 |
editModeOverwrite |
|
5319 |
self editMode:#editModeOverwrite |
|
5320 |
||
5321 |
"Modified: / 11-09-2006 / 12:42:26 / cg" |
|
5322 |
! |
|
5323 |
||
8454
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
5324 |
fileContentsAsByteArray |
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
5325 |
|file| |
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
5326 |
|
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
5327 |
file := self firstSelectedFile. |
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
5328 |
file isNil ifTrue:[^ self ]. |
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
5329 |
file asFilename fileSize > (1024*1024) ifTrue:[ |
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
5330 |
file asFilename fileSize > (128*1024*1024) ifTrue:[ |
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
5331 |
Dialog warn:'File is too big'. |
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
5332 |
^ self. |
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
5333 |
]. |
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
5334 |
(Dialog confirm:'File is big - proceed ?') ifFalse:[^ self]. |
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
5335 |
]. |
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
5336 |
file asFilename binaryContentsOfEntireFile inspect |
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
5337 |
! |
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
5338 |
|
3892 | 5339 |
fileFileIn |
5340 |
"fileIn the selected file(s)" |
|
5341 |
||
5342 |
self fileFileInLazy:false |
|
5343 |
! |
|
5344 |
||
7324 | 5345 |
fileFileIn:aFilename lazy:lazy |
5346 |
"fileIn a file" |
|
5347 |
||
5348 |
self withActivityIndicationDo:[ |
|
5349 |
self notify:('File in:', aFilename asFilename baseName). |
|
5350 |
self singleFileFileIn:aFilename lazy:lazy. |
|
5351 |
self notify:nil. |
|
5352 |
] |
|
5353 |
||
5354 |
"Created: / 20-09-2006 / 14:28:35 / cg" |
|
5355 |
! |
|
5356 |
||
3892 | 5357 |
fileFileInLazy |
5358 |
"fileIn the selected file(s). Do a quick load (no compilation)" |
|
5359 |
||
5360 |
self fileFileInLazy:true |
|
5361 |
! |
|
5362 |
||
5363 |
fileFileInLazy:lazy |
|
5364 |
"fileIn the selected file(s)" |
|
5365 |
||
7324 | 5366 |
self currentSelectedFiles do:[:fileName | |
5367 |
self fileIn:fileName lazy:lazy |
|
5368 |
]. |
|
5369 |
||
5370 |
"Modified: / 20-09-2006 / 14:29:24 / cg" |
|
3892 | 5371 |
! |
5372 |
||
5373 |
fileFileInToNameSpace |
|
5374 |
"fileIn the selected file(s)<into a nameSpace" |
|
5375 |
||
5376 |
|ns listOfKnownNameSpaces| |
|
5377 |
||
5378 |
listOfKnownNameSpaces := Set new. |
|
5379 |
NameSpace |
|
6672
478b83a3753a
max size to be shown without dialog
Claus Gittinger <cg@exept.de>
parents:
6671
diff
changeset
|
5380 |
allNameSpaces |
4414 | 5381 |
do:[:eachNameSpace | |
5382 |
listOfKnownNameSpaces add:eachNameSpace name |
|
5383 |
]. |
|
3892 | 5384 |
listOfKnownNameSpaces := listOfKnownNameSpaces asOrderedCollection sort. |
5385 |
||
5386 |
ns := Dialog |
|
4414 | 5387 |
request:'During fileIn, new classes are created in nameSpace:' |
5388 |
initialAnswer:(LastEnforcedNameSpace ? Class nameSpaceQuerySignal query name) |
|
5389 |
list:listOfKnownNameSpaces. |
|
3892 | 5390 |
ns isEmptyOrNil ifTrue:[^ self]. |
5391 |
||
5392 |
LastEnforcedNameSpace := ns. |
|
5393 |
ns := NameSpace name:ns. |
|
5394 |
||
5395 |
Class nameSpaceQuerySignal |
|
4414 | 5396 |
answer:ns |
5397 |
do:[ |
|
5398 |
self fileFileInLazy:false |
|
5399 |
] |
|
3892 | 5400 |
! |
5401 |
||
5402 |
fileFindAllDuplicates |
|
5403 |
"scan directory and all subdirs for duplicate files" |
|
5404 |
||
5405 |
|fileNames dir infoDir filesBySize |
|
5406 |
result info dirPrefix myName stream textBox maxLength directories| |
|
5407 |
||
5408 |
||
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
5409 |
self withActivityIndicationDo:[ |
4414 | 5410 |
result := Dictionary new. |
5411 |
myName := self class name asString. |
|
5412 |
directories := self currentSelectedDirectories. |
|
5413 |
directories isEmpty ifTrue:[^ self]. |
|
3892 | 5414 |
|
4414 | 5415 |
dir := directories first. |
3892 | 5416 |
"/ self label: myName, '- gathering file names ...'. |
4636
08b2b63e3107
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4629
diff
changeset
|
5417 |
[ |
08b2b63e3107
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4629
diff
changeset
|
5418 |
fileNames := dir recursiveDirectoryContents. |
08b2b63e3107
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4629
diff
changeset
|
5419 |
] on:FileStream openErrorSignal do:[:ex| |
6352 | 5420 |
self warn:(resources stringWithCRs:'Cannot access: %1\(%2)' |
5421 |
with:ex pathName |
|
5422 |
with:ex description). |
|
4636
08b2b63e3107
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4629
diff
changeset
|
5423 |
^ self |
08b2b63e3107
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4629
diff
changeset
|
5424 |
]. |
4765 | 5425 |
fileNames := fileNames |
5426 |
collect:[:fn | dir construct:fn] |
|
5427 |
thenSelect:[:fn | fn isDirectory not]. |
|
3892 | 5428 |
|
5429 |
"/ self label:myName , '- gathering sizes ...'. |
|
4414 | 5430 |
infoDir := Dictionary new. |
5431 |
fileNames do:[:fn | |
|
5432 |
infoDir at:fn put:(fn fileSize) |
|
5433 |
]. |
|
5434 |
||
5435 |
"/ for each, get the files size. |
|
5436 |
"/ in a first pass, look for files of the same size and |
|
5437 |
"/ compare them ... |
|
3892 | 5438 |
|
5439 |
"/ self label:myName , '- preselect possible duplicates ...'. |
|
4414 | 5440 |
filesBySize := Dictionary new. |
5441 |
infoDir keysAndValuesDo:[:fn :sz | |
|
5442 |
|entry| |
|
5443 |
||
5444 |
entry := filesBySize at:sz ifAbsentPut:[Set new]. |
|
5445 |
entry add:fn. |
|
5446 |
]. |
|
5447 |
||
5448 |
"/ any of same size ? |
|
3892 | 5449 |
|
5450 |
"/ self label:myName , '- checking for duplicates ...'. |
|
4414 | 5451 |
filesBySize do:[:entry | |
5452 |
|files| |
|
5453 |
||
5454 |
entry size > 1 ifTrue:[ |
|
5455 |
files := entry asArray. |
|
5456 |
1 to:files size-1 do:[:idx1 | |
|
5457 |
idx1+1 to:files size do:[:idx2 | |
|
5458 |
|fn1 fn2| |
|
5459 |
||
5460 |
fn1 := files at:idx1. |
|
5461 |
fn2 := files at:idx2. |
|
3892 | 5462 |
|
5463 |
"/ self label:myName , '- checking ' , fn1 baseName , ' vs. ' , fn2 baseName , ' ...'. |
|
4414 | 5464 |
(result at:fn2 ifAbsent:nil) ~= fn1 ifTrue:[ |
5465 |
"/ compare the files |
|
5466 |
(fn1 sameContentsAs:fn2) ifTrue:[ |
|
3892 | 5467 |
"/ Transcript show:'Same: '; show:fn1 baseName; show:' and '; showCR:fn2 baseName. |
4414 | 5468 |
result at:fn1 put:fn2. |
5469 |
] |
|
5470 |
] |
|
5471 |
] |
|
5472 |
] |
|
5473 |
] |
|
5474 |
]. |
|
3892 | 5475 |
|
5476 |
"/ self label:myName , '- sorting ...'. |
|
4414 | 5477 |
dirPrefix := dir pathName. |
5478 |
result := result associations. |
|
5479 |
result := result collect:[:assoc | |
|
5480 |
|f1 f2| |
|
5481 |
||
5482 |
f1 := assoc key name. |
|
5483 |
f2 := assoc value name. |
|
5484 |
(f1 startsWith:dirPrefix) ifTrue:[ |
|
5485 |
f1 := f1 copyFrom:dirPrefix size + 2. |
|
5486 |
]. |
|
5487 |
(f2 startsWith:dirPrefix) ifTrue:[ |
|
5488 |
f2 := f2 copyFrom:dirPrefix size + 2. |
|
5489 |
]. |
|
5490 |
f1 < f2 ifTrue:[ |
|
5491 |
f2 -> f1 |
|
5492 |
] ifFalse:[ |
|
5493 |
f1 -> f2 |
|
5494 |
] |
|
5495 |
]. |
|
5496 |
result sort:[:f1 :f2 | f2 value < f1 value]. |
|
5497 |
||
5498 |
info := OrderedCollection new. |
|
5499 |
result do:[:assoc | |
|
5500 |
info add:(assoc key , ' same as ' , assoc value) |
|
5501 |
]. |
|
5502 |
info isEmpty ifTrue:[ |
|
5543 | 5503 |
Dialog information:'No duplicate files found.'. |
5504 |
^ self. |
|
4414 | 5505 |
]. |
3892 | 5506 |
]. |
5507 |
||
5508 |
stream := WriteStream on:''. |
|
5509 |
info do:[:el| |
|
4535 | 5510 |
stream nextPutLine:el. |
3892 | 5511 |
]. |
5542 | 5512 |
|
3892 | 5513 |
textBox := TextBox new. |
5514 |
textBox initialText:(stream contents). |
|
5542 | 5515 |
stream close. |
4636
08b2b63e3107
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4629
diff
changeset
|
5516 |
textBox title:'File duplicates in directory: ', dir asString. |
3892 | 5517 |
textBox readOnly:true. |
5518 |
textBox noCancel. |
|
4636
08b2b63e3107
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4629
diff
changeset
|
5519 |
textBox label:'Duplicates in ', dir asString. |
3892 | 5520 |
maxLength := 10. |
5521 |
info do:[: el | |
|
4414 | 5522 |
maxLength := maxLength max:(el size). |
3892 | 5523 |
]. |
5524 |
textBox extent:((maxLength * 5)@(info size * 20)); sizeFixed:false. |
|
5542 | 5525 |
textBox maxExtent:Screen current extent. |
5526 |
textBox openModeless. |
|
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
5527 |
|
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
5528 |
"Modified: / 25-07-2006 / 09:07:22 / cg" |
3892 | 5529 |
! |
5530 |
||
5531 |
fileFindDuplicates |
|
5532 |
"scan directory for duplicate files" |
|
5533 |
||
8510 | 5534 |
|infoDir filesBySize result info stream textBox maxLength directories allFiles titleStream size| |
5535 |
||
5536 |
directories := self currentSelectedDirectories. |
|
3892 | 5537 |
|
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
5538 |
self withActivityIndicationDo:[ |
4355 | 5539 |
result := Dictionary new. |
5540 |
||
5541 |
directories := self currentSelectedDirectories. |
|
5542 |
directories isEmpty ifTrue:[^ self]. |
|
5543 |
||
8510 | 5544 |
allFiles := self allFilesInSelectedDirectoriesForWhich:[:f | true]. |
4355 | 5545 |
|
5546 |
infoDir := Dictionary new. |
|
5547 |
allFiles do:[:fn | |
|
5548 |
infoDir at:fn put:(fn info) |
|
5549 |
]. |
|
5550 |
||
5551 |
"/ for each, get the files size. |
|
5552 |
"/ in a first pass, look for files of the same size and |
|
5553 |
"/ compare them ... |
|
5554 |
||
5555 |
filesBySize := Dictionary new. |
|
5556 |
infoDir keysAndValuesDo:[:fn :info | |
|
5557 |
|sz entry| |
|
5558 |
||
5559 |
sz := info size. |
|
5560 |
entry := filesBySize at:sz ifAbsentPut:[Set new]. |
|
5561 |
entry add:fn. |
|
5562 |
]. |
|
5563 |
||
5564 |
"/ any of same size ? |
|
5565 |
||
5566 |
filesBySize do:[:entry | |
|
5567 |
|files| |
|
5568 |
||
5569 |
entry size > 1 ifTrue:[ |
|
5570 |
files := entry asArray. |
|
5571 |
1 to:files size-1 do:[:idx1 | |
|
5572 |
idx1+1 to:files size do:[:idx2 | |
|
5573 |
|fn1 fn2| |
|
5574 |
||
5575 |
fn1 := files at:idx1. |
|
5576 |
fn2 := files at:idx2. |
|
5577 |
||
5578 |
(result at:fn2 ifAbsent:nil) ~= fn1 ifTrue:[ |
|
5579 |
"/ compare the files |
|
5580 |
(fn1 sameContentsAs:fn2) ifTrue:[ |
|
3892 | 5581 |
"/ Transcript show:'Same: '; show:fn1 baseName; show:' and '; showCR:fn2 baseName. |
4355 | 5582 |
result at:fn1 put:fn2. |
5583 |
] |
|
5584 |
] |
|
5585 |
] |
|
5586 |
] |
|
5587 |
] |
|
5588 |
]. |
|
5589 |
||
5590 |
result := result associations. |
|
5591 |
result := result collect:[:assoc | |
|
5592 |
|f1 f2| |
|
5593 |
||
5594 |
f1 := assoc key asString. |
|
5595 |
f2 := assoc value asString. |
|
5596 |
f1 < f2 ifTrue:[ |
|
5597 |
f2 -> f1 |
|
5598 |
] ifFalse:[ |
|
5599 |
f1 -> f2 |
|
5600 |
] |
|
5601 |
]. |
|
5789 | 5602 |
"/ result sort:[:f1 :f2 | f1 key > f2 key "f2 value < f1 key value"]. |
5603 |
result sort:[:f1 :f2 | " f1 key > f2 key" f2 value < f1 key value]. |
|
4355 | 5604 |
|
5605 |
info := OrderedCollection new. |
|
5606 |
size := self getBestDirectory asString size. |
|
5607 |
result do:[:assoc | |
|
5608 |
|fn1 fn2| |
|
5609 |
||
5610 |
fn1 := assoc key. |
|
5611 |
fn2 := assoc value. |
|
5612 |
size > 1 ifTrue:[ |
|
5613 |
fn1 := ('..', (fn1 copyFrom:(size + 1))). |
|
5614 |
fn2 := ('..', (fn2 copyFrom:(size + 1))). |
|
5615 |
]. |
|
5616 |
(fn1 includes:Character space) ifTrue:[ |
|
5617 |
fn1 := '"' , fn1 , '"' |
|
5618 |
]. |
|
5619 |
(fn2 includes:Character space) ifTrue:[ |
|
5620 |
fn2 := '"' , fn2 , '"' |
|
5621 |
]. |
|
5622 |
info add:(fn1 , ' same as ' , fn2) |
|
5623 |
]. |
|
5624 |
info isEmpty ifTrue:[ |
|
5543 | 5625 |
Dialog information:'No duplicate files found.'. |
5626 |
^ self. |
|
4355 | 5627 |
]. |
3892 | 5628 |
]. |
5629 |
stream := WriteStream on:''. |
|
5630 |
info do:[:el| |
|
4535 | 5631 |
stream nextPutLine:el. |
3892 | 5632 |
]. |
5633 |
titleStream := WriteStream on:''. |
|
4636
08b2b63e3107
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4629
diff
changeset
|
5634 |
titleStream nextPutAll:'File duplicates in director'. |
3892 | 5635 |
directories size == 1 ifTrue:[ |
4355 | 5636 |
titleStream nextPutAll:'y: ', directories first asString. |
3892 | 5637 |
] ifFalse:[ |
4535 | 5638 |
titleStream nextPutLine:'ies: '. |
4355 | 5639 |
directories do:[:dir| |
5640 |
size > 1 ifTrue:[ |
|
5641 |
titleStream nextPutAll:'..'. |
|
4535 | 5642 |
titleStream nextPutLine:((dir asString) copyFrom:(size + 1)). |
4355 | 5643 |
] ifFalse:[ |
4535 | 5644 |
titleStream nextPutLine:(dir asString). |
4355 | 5645 |
]. |
5646 |
] |
|
3892 | 5647 |
]. |
5543 | 5648 |
|
3892 | 5649 |
textBox := TextBox new. |
5650 |
textBox initialText:(stream contents). |
|
5651 |
textBox title:(titleStream contents). |
|
5652 |
textBox readOnly:true. |
|
5653 |
textBox noCancel. |
|
4636
08b2b63e3107
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4629
diff
changeset
|
5654 |
stream := WriteStream on:'Duplicates in '. |
4170 | 5655 |
directories do:[ :aDirectory | |
4355 | 5656 |
stream nextPutAll:aDirectory baseName. |
5657 |
stream space. |
|
4050 | 5658 |
]. |
4170 | 5659 |
textBox label:stream contents. |
3892 | 5660 |
maxLength := 10. |
5661 |
info do:[: el | |
|
4355 | 5662 |
maxLength := maxLength max:(el size). |
3892 | 5663 |
]. |
5092 | 5664 |
textBox extent:((maxLength * 5)@((info size max:40)* 10)). |
5665 |
textBox maxExtent:Screen current extent. |
|
4355 | 5666 |
textBox openModeless. "/ showAtPointer. |
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
5667 |
|
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
5668 |
"Modified: / 25-07-2006 / 09:07:25 / cg" |
3892 | 5669 |
! |
5670 |
||
5671 |
fileFindFile |
|
5961 | 5672 |
|filename| |
5673 |
||
5674 |
filename := self firstSelectedFileName. |
|
5675 |
filename isNil ifTrue:[ |
|
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
5676 |
filename := Filename homeDirectory. |
3892 | 5677 |
]. |
4101 | 5678 |
FindFileApplication openOnFileName:filename for:self. |
3892 | 5679 |
! |
5680 |
||
8510 | 5681 |
fileFindSimilarImages |
5682 |
"scan directory for similar image files" |
|
5683 |
||
8512 | 5684 |
|result stream textBox directories imageFiles histogramsV histogramsH |
5685 |
similarV similarH similar alreadyPrinted| |
|
8510 | 5686 |
|
8524
cac6b19eae23
changed #fileFindSimilarImages
Claus Gittinger <cg@exept.de>
parents:
8512
diff
changeset
|
5687 |
self withWaitCursorDo:[ |
8510 | 5688 |
self withActivityIndicationDo:[ |
5689 |
result := Dictionary new. |
|
5690 |
||
5691 |
directories := self currentSelectedDirectories. |
|
5692 |
directories isEmpty ifTrue:[^ self]. |
|
5693 |
||
5694 |
imageFiles := self allFilesInSelectedDirectoriesForWhich:[:f | f mimeTypeFromName isImage]. |
|
8511 | 5695 |
"/ imageFiles := imageFiles select:[:f | f baseName startsWith:'foo']. |
5696 |
imageFiles sort:[:a :b | a pathName < b pathName]. |
|
5697 |
||
8510 | 5698 |
"/ for each, get the color histogram |
5699 |
histogramsV := Dictionary new. |
|
5700 |
histogramsH := Dictionary new. |
|
5701 |
imageFiles do:[:fn | |
|
5702 |
|hist image| |
|
5703 |
||
5704 |
image := Image fromFile:fn. |
|
5705 |
Transcript showCR:'generating histogram for ',fn baseName. |
|
5706 |
hist := ImageColorHistogram new forImage:image. |
|
5707 |
histogramsV at:fn put:(hist histogramVectorV). |
|
5708 |
histogramsH at:fn put:(hist histogramVectorH). |
|
5709 |
]. |
|
5710 |
||
5711 |
similarH := Dictionary new. |
|
5712 |
similarV := Dictionary new. |
|
5713 |
similar := Dictionary new. |
|
5714 |
||
8512 | 5715 |
(self firstSelectedFile notNil |
5716 |
ifTrue:[ Array with:self firstSelectedFile ] |
|
5717 |
ifFalse:[ imageFiles ]) |
|
5718 |
do:[:eachFile1 | |
|
8510 | 5719 |
|setOfSimilar distancesV distancesH| |
5720 |
||
5721 |
distancesV := OrderedCollection new. |
|
5722 |
distancesH := OrderedCollection new. |
|
5723 |
setOfSimilar := OrderedCollection new. |
|
5724 |
||
5725 |
imageFiles do:[:eachFile2 | |
|
5726 |
|v1 v2 dV dH| |
|
5727 |
||
5728 |
eachFile1 ~= eachFile2 ifTrue:[ |
|
5729 |
v1 := histogramsV at:eachFile1. |
|
5730 |
v2 := histogramsV at:eachFile2. |
|
5731 |
dV := ImageColorHistogram distanceFrom:v1 to:v2. |
|
5732 |
distancesV add:(eachFile2 -> dV). |
|
5733 |
v1 := histogramsH at:eachFile1. |
|
5734 |
v2 := histogramsH at:eachFile2. |
|
5735 |
dH := ImageColorHistogram distanceFrom:v1 to:v2. |
|
5736 |
distancesH add:(eachFile2 -> dH). |
|
5737 |
(dV < 10000 and:[dH < 10000]) ifTrue:[ |
|
8512 | 5738 |
setOfSimilar add:eachFile2->(dV + dH). |
8510 | 5739 |
]. |
5740 |
] |
|
5741 |
]. |
|
5742 |
distancesV sort:[:a1 :a2 | a1 value < a2 value]. |
|
5743 |
distancesH sort:[:a1 :a2 | a1 value < a2 value]. |
|
5744 |
similarV at:eachFile1 put:distancesV. |
|
5745 |
similarH at:eachFile1 put:distancesH. |
|
5746 |
setOfSimilar notEmpty ifTrue:[ similar at:eachFile1 put:setOfSimilar ]. |
|
5747 |
]. |
|
5748 |
||
5749 |
similar isEmpty ifTrue:[ |
|
5750 |
Dialog information:'No similarities found.'. |
|
5751 |
^ self. |
|
5752 |
]. |
|
5753 |
]. |
|
5754 |
||
5755 |
stream := WriteStream on:''. |
|
8512 | 5756 |
alreadyPrinted := Set new. |
5757 |
||
5758 |
imageFiles do:[:eachFile | |
|
5759 |
|eachSet| |
|
5760 |
||
5761 |
(alreadyPrinted includes:eachFile) ifFalse:[ |
|
5762 |
eachSet := similar at:eachFile ifAbsent:nil. |
|
5763 |
eachSet notNil ifTrue:[ |
|
5764 |
stream nextPutLine:eachFile pathName. |
|
5765 |
eachSet do:[:info | |
|
5766 |
|fn2 dist| |
|
5767 |
||
5768 |
fn2 := info key. |
|
5769 |
dist := info value. |
|
5770 |
stream nextPutAll:' '. |
|
5771 |
stream nextPutAll:fn2 pathName. |
|
5772 |
stream nextPutLine:' (',dist printString,')'. |
|
5773 |
alreadyPrinted add:fn2. |
|
5774 |
]. |
|
5775 |
stream cr. |
|
5776 |
]. |
|
8510 | 5777 |
]. |
5778 |
]. |
|
8524
cac6b19eae23
changed #fileFindSimilarImages
Claus Gittinger <cg@exept.de>
parents:
8512
diff
changeset
|
5779 |
]. |
8510 | 5780 |
|
5781 |
textBox := TextBox new. |
|
5782 |
textBox initialText:(stream contents). |
|
5783 |
textBox title:'File similarities:'. |
|
5784 |
textBox readOnly:true. |
|
5785 |
textBox noCancel. |
|
5786 |
||
5787 |
textBox label:'File similarities'. |
|
5788 |
textBox extent:(400@((similar size max:40)* 10)). |
|
5789 |
textBox maxExtent:Screen current extent. |
|
5790 |
textBox openModeless. "/ showAtPointer. |
|
5791 |
||
5792 |
"Modified: / 25-07-2006 / 09:07:25 / cg" |
|
5793 |
! |
|
5794 |
||
4618 | 5795 |
fileHexDump |
5796 |
||
5797 |
| file item| |
|
5798 |
||
5799 |
file := self firstSelectedFile. |
|
5800 |
file notNil ifTrue:[ |
|
5801 |
item := DirectoryContentsBrowser itemClass fileName:file. |
|
5009 | 5802 |
self |
5803 |
applicationNamed:#FileApplicationNoteBook |
|
5804 |
ifPresentDo:[:appl | appl openTextEditorWithHexPresentationOn:item]. |
|
4618 | 5805 |
]. |
5806 |
! |
|
5807 |
||
7324 | 5808 |
fileIn:aFilename |
5809 |
"fileIn a file" |
|
5810 |
||
5811 |
self fileIn:aFilename lazy:false |
|
5812 |
||
5813 |
"Created: / 20-09-2006 / 14:30:06 / cg" |
|
5814 |
! |
|
5815 |
||
5816 |
fileIn:aFilename lazy:lazy |
|
5817 |
"fileIn a file" |
|
5818 |
||
5819 |
self withActivityIndicationDo:[ |
|
5820 |
self notify:('File in:', aFilename asFilename baseName). |
|
5821 |
self singleFileFileIn:aFilename lazy:lazy. |
|
5822 |
self notify:nil. |
|
5823 |
] |
|
5824 |
||
5825 |
"Created: / 20-09-2006 / 14:29:21 / cg" |
|
5826 |
! |
|
5827 |
||
4930 | 5828 |
filterSelectedFiles:whichFilter |
5829 |
|selectedFiles numFiles msg filterBlock| |
|
5830 |
||
7560 | 5831 |
selectedFiles := self currentSelectedObjects. |
4930 | 5832 |
(numFiles := selectedFiles size) == 0 ifTrue:[^ self]. |
5833 |
||
5834 |
msg := 'Replace contents of file ''%2'' with output of %3-filter ?'. |
|
5835 |
numFiles > 1 ifTrue:[ |
|
5836 |
msg := 'Replace contents of %1 files with output of %3-filter ?'. |
|
5837 |
]. |
|
5838 |
||
5839 |
(Dialog |
|
6352 | 5840 |
confirm:(resources stringWithCRs:msg with:numFiles with:selectedFiles first baseName allBold with:whichFilter) |
4930 | 5841 |
initialAnswer:false |
5842 |
) ifFalse:[ |
|
5843 |
^ self |
|
5844 |
]. |
|
5845 |
||
5846 |
whichFilter == #rot13 ifTrue:[ |
|
5847 |
filterBlock := [:charIn | charIn rot13 ]. |
|
5848 |
]. |
|
5849 |
"/ add more here... |
|
5850 |
||
5851 |
filterBlock isNil ifTrue:[ |
|
5852 |
self information:'No such filter: ' , whichFilter. |
|
5853 |
^ self. |
|
5854 |
]. |
|
5855 |
||
5856 |
selectedFiles do:[:fileName | |
|
5857 |
|s| |
|
5858 |
||
5859 |
self notify:('Processing:', fileName baseName). |
|
5860 |
fileName isDirectory ifFalse:[ |
|
5861 |
[ |
|
5862 |
|inFile outFile in out| |
|
5863 |
||
5864 |
inFile := fileName asFilename. |
|
5865 |
outFile := (fileName pathName , '.filter') asFilename. |
|
5866 |
||
5867 |
[ |
|
5868 |
|charIn charOut| |
|
5869 |
||
5870 |
in := inFile readStream. |
|
5871 |
out := outFile writeStream. |
|
5872 |
[in atEnd] whileFalse:[ |
|
5873 |
charIn := in next. |
|
5874 |
charOut := filterBlock value:charIn. |
|
5875 |
out nextPut:charOut. |
|
5876 |
]. |
|
5877 |
outFile renameTo:inFile. |
|
5878 |
] ensure:[ |
|
5879 |
out notNil ifTrue:[ out close ]. |
|
5880 |
in notNil ifTrue:[ in close ]. |
|
5881 |
outFile delete. |
|
5882 |
] |
|
5883 |
] on:FileStream openErrorSignal do:[:ex| |
|
5884 |
self warn:('Cannot process "%1".' bindWith:fileName baseName allBold). |
|
5885 |
]. |
|
5886 |
] |
|
5887 |
]. |
|
6190 | 5888 |
self notify:nil. |
7560 | 5889 |
|
5890 |
"Modified: / 04-12-2006 / 13:14:48 / cg" |
|
4930 | 5891 |
! |
5892 |
||
8832 | 5893 |
forEachSelectedFileIgnoringDirectories:ignoreDirs do:aBlock |
5894 |
|numItems path files| |
|
5895 |
||
5896 |
files := self currentSelectedFiles. |
|
5897 |
||
5898 |
(numItems := files size) > 2 ifTrue:[ |
|
5899 |
(self |
|
5900 |
confirm:(resources string:'Open for each of the %1 items ?' |
|
5901 |
with:numItems)) ifFalse:[^ self]. |
|
5902 |
]. |
|
5903 |
||
5904 |
self withActivityIndicationDo:[ |
|
5905 |
files do:[:fileName | |
|
5906 |
(ignoreDirs not or:[fileName isDirectory not]) ifTrue:[ |
|
5907 |
fileName isAbsolute ifTrue:[ |
|
5908 |
path := fileName getName. |
|
5909 |
] ifFalse:[ |
|
5910 |
path := fileName pathName. |
|
5911 |
]. |
|
5912 |
aBlock value:path |
|
5913 |
] |
|
5914 |
]. |
|
5915 |
]. |
|
5916 |
! |
|
5917 |
||
8648
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
5918 |
generateDetachedSignaturesForSelectedFiles |
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
5919 |
"generate detached signature (pkcs7) files from the contents of the selected files. |
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
5920 |
For smalltalk text files, better use #generateSignaturesForSelectedFiles." |
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
5921 |
|
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
5922 |
self withActivityIndicationDo:[ |
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
5923 |
self currentSelectedFiles do:[:fn | |
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
5924 |
|data hash signature signatureFile| |
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
5925 |
|
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
5926 |
self notify:'Generating detached signature file for ', (fn baseName),'...'. |
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
5927 |
|
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
5928 |
data := fn contentsAsString. |
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
5929 |
hash := SHA1Stream hashValueOf:data. |
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
5930 |
|
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
5931 |
signature := Expecco::KeyFileGenerator new signExpeccoCode:hash. |
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
5932 |
|
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
5933 |
signatureFile := fn addSuffix:'sig'. |
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
5934 |
signatureFile contents:signature. |
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
5935 |
]. |
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
5936 |
self notify:nil. |
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
5937 |
] |
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
5938 |
! |
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
5939 |
|
8640
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
5940 |
generateSignaturesForSelectedFiles |
8645
00e4d07c6d6d
Generate signed expecco patch files
Stefan Vogel <sv@exept.de>
parents:
8641
diff
changeset
|
5941 |
"generate signed pkcs7 files from the contents of the selected files" |
8640
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
5942 |
|
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
5943 |
self withActivityIndicationDo:[ |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
5944 |
self currentSelectedFiles do:[:fn | |
8645
00e4d07c6d6d
Generate signed expecco patch files
Stefan Vogel <sv@exept.de>
parents:
8641
diff
changeset
|
5945 |
|pkcs7SignedData signatureFilename| |
00e4d07c6d6d
Generate signed expecco patch files
Stefan Vogel <sv@exept.de>
parents:
8641
diff
changeset
|
5946 |
|
8646 | 5947 |
self notify:'Generating signed file from: ', (fn baseName), '...'. |
8645
00e4d07c6d6d
Generate signed expecco patch files
Stefan Vogel <sv@exept.de>
parents:
8641
diff
changeset
|
5948 |
|
00e4d07c6d6d
Generate signed expecco patch files
Stefan Vogel <sv@exept.de>
parents:
8641
diff
changeset
|
5949 |
pkcs7SignedData := Expecco::KeyFileGenerator new signExpeccoCode:fn contentsOfEntireFile. |
8646 | 5950 |
signatureFilename := fn addSuffix:'signed'. |
8645
00e4d07c6d6d
Generate signed expecco patch files
Stefan Vogel <sv@exept.de>
parents:
8641
diff
changeset
|
5951 |
signatureFilename contents:pkcs7SignedData. |
8640
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
5952 |
]. |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
5953 |
self notify:nil. |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
5954 |
] |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
5955 |
! |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
5956 |
|
3892 | 5957 |
installAllAsAutoloaded |
5958 |
"install all classes found here as autoloaded classes" |
|
5959 |
||
4345 | 5960 |
[ |
5961 |
self withActivityIndicationDo:[ |
|
6725 | 5962 |
self currentSelectedDirectories do:[:dir| |
6523 | 5963 |
dir directoryContentsAsFilenamesDo:[:fn | |
6708 | 5964 |
(fn suffix = 'st') ifTrue:[ |
6523 | 5965 |
self notify:('Install as autoloaded:', fn baseName). |
5966 |
self installAsAutoloaded:fn. |
|
5967 |
] |
|
4343 | 5968 |
] |
5969 |
]. |
|
6190 | 5970 |
self notify:nil. |
4345 | 5971 |
] |
5972 |
] fork. |
|
3892 | 5973 |
! |
5974 |
||
6521 | 5975 |
installAllAsAutoloadedRecursive |
5976 |
"install all classes found here and in subdirectories as autoloaded classes" |
|
5977 |
||
5978 |
[ |
|
5979 |
self withActivityIndicationDo:[ |
|
6725 | 5980 |
self currentSelectedDirectories do:[:dir| |
6521 | 5981 |
dir recursiveDirectoryContentsDo:[:f | |
6708 | 5982 |
|fn| |
6521 | 5983 |
fn := dir construct:f. |
6708 | 5984 |
(fn suffix = 'st') ifTrue:[ |
6521 | 5985 |
self notify:('Install as autoloaded:', f). |
5986 |
self installAsAutoloaded:fn. |
|
5987 |
] |
|
5988 |
] |
|
5989 |
]. |
|
5990 |
self notify:nil. |
|
5991 |
] |
|
5992 |
] fork. |
|
5993 |
! |
|
5994 |
||
3892 | 5995 |
installAsAutoloaded:aFilename |
5996 |
"install aFilename as autoloaded class" |
|
5997 |
||
5971
af337e1a857f
Use #setFilename:forClass:package: to define an abbreviation
Stefan Vogel <sv@exept.de>
parents:
5967
diff
changeset
|
5998 |
|chunks s filename| |
af337e1a857f
Use #setFilename:forClass:package: to define an abbreviation
Stefan Vogel <sv@exept.de>
parents:
5967
diff
changeset
|
5999 |
|
af337e1a857f
Use #setFilename:forClass:package: to define an abbreviation
Stefan Vogel <sv@exept.de>
parents:
5967
diff
changeset
|
6000 |
filename := aFilename asFilename. |
af337e1a857f
Use #setFilename:forClass:package: to define an abbreviation
Stefan Vogel <sv@exept.de>
parents:
5967
diff
changeset
|
6001 |
|
af337e1a857f
Use #setFilename:forClass:package: to define an abbreviation
Stefan Vogel <sv@exept.de>
parents:
5967
diff
changeset
|
6002 |
chunks := ChangeSet fromStream:(s := filename readStream). s close. |
3892 | 6003 |
chunks |
4414 | 6004 |
select:[:eachChunk | eachChunk isClassDefinitionChange] |
5971
af337e1a857f
Use #setFilename:forClass:package: to define an abbreviation
Stefan Vogel <sv@exept.de>
parents:
5967
diff
changeset
|
6005 |
thenDo:[:eachClassChunk | |
8039
732cbc4ea214
keep absolute-pathname including suffix as classFilename
Claus Gittinger <cg@exept.de>
parents:
8013
diff
changeset
|
6006 |
eachClassChunk installAsAutoloadedClassIfPublicWithFilename:filename asAbsoluteFilename "withoutSuffix" name "baseName" |
5971
af337e1a857f
Use #setFilename:forClass:package: to define an abbreviation
Stefan Vogel <sv@exept.de>
parents:
5967
diff
changeset
|
6007 |
]. |
3892 | 6008 |
! |
6009 |
||
4558 | 6010 |
joinSelectedFiles |
6264 | 6011 |
|selectedFiles numFiles msg outFileName outFile outStream| |
4558 | 6012 |
|
7560 | 6013 |
selectedFiles := self currentSelectedObjects. |
4558 | 6014 |
(numFiles := selectedFiles size) <= 1 ifTrue:[^ self]. |
6015 |
||
6016 |
msg := 'Join each of the %1 files into single file named:\\Attention: order in which files were selected is relevant here !!'. |
|
6352 | 6017 |
outFileName := Dialog request:(resources stringWithCRs:msg with:numFiles with:selectedFiles first baseName). |
6264 | 6018 |
outFileName isEmptyOrNil ifTrue:[^ self]. |
6019 |
outFile := selectedFiles first directory construct:outFileName. |
|
4558 | 6020 |
|
6021 |
outStream := outFile writeStream. |
|
6022 |
||
6023 |
selectedFiles do:[:fileName | |
|
6024 |
|inStream| |
|
6025 |
||
6026 |
self notify:('Adding:', fileName baseName). |
|
6027 |
inStream := fileName readStream. |
|
6028 |
inStream copyToEndInto:outStream. |
|
6029 |
inStream close. |
|
6030 |
]. |
|
6031 |
outStream close. |
|
6190 | 6032 |
self notify:nil. |
7560 | 6033 |
|
6034 |
"Modified: / 04-12-2006 / 13:15:10 / cg" |
|
4558 | 6035 |
! |
6036 |
||
6292 | 6037 |
loadImageThenDo:aBlock |
3892 | 6038 |
|img path files| |
6039 |
||
3982 | 6040 |
files := self currentSelectedFiles. |
3892 | 6041 |
files isEmpty ifTrue:[ ^ self]. |
6042 |
files do:[:fileName | |
|
4414 | 6043 |
path := fileName. |
6044 |
path isDirectory ifFalse:[ |
|
6045 |
img := Image fromFile:(path pathName). |
|
6046 |
img notNil ifTrue:[ |
|
6292 | 6047 |
aBlock value:img |
4414 | 6048 |
] ifFalse:[ |
6292 | 6049 |
Dialog warn:'Unknown format: ' , fileName asString |
4414 | 6050 |
] |
6051 |
] |
|
3892 | 6052 |
]. |
6053 |
! |
|
6054 |
||
6055 |
openASN1Browser |
|
6056 |
||
6057 |
self openTool:OSI::ASN1Browser |
|
6058 |
! |
|
6059 |
||
6060 |
openAppletViewer |
|
6061 |
|numItems files| |
|
6062 |
||
3982 | 6063 |
files := self currentSelectedFiles. |
3892 | 6064 |
(numItems := files size) > 2 ifTrue:[ |
4414 | 6065 |
(self |
6066 |
confirm:(resources string:'open for each of the %1 items ?' |
|
6067 |
with:numItems)) ifFalse:[^ self]. |
|
3892 | 6068 |
]. |
6069 |
||
6070 |
Java startupJavaSystem. |
|
6071 |
"/ Java markAllClassesUninitialized. |
|
6072 |
"/ Java initAllStaticFields. |
|
6073 |
"/ Java initAllClasses. |
|
6074 |
||
6075 |
files do:[:fileName | |
|
4414 | 6076 |
|p path| |
6077 |
||
6078 |
path := fileName. |
|
6079 |
path isDirectory ifFalse:[ |
|
6080 |
p := Java |
|
6081 |
javaProcessForMainOf:(Java classForName:'sun.applet.AppletViewer') |
|
6082 |
argumentString:path pathName. |
|
6083 |
p resume. |
|
6084 |
] |
|
3892 | 6085 |
]. |
6086 |
! |
|
6087 |
||
6088 |
openCBrowser |
|
6031 | 6089 |
|dir files| |
5880 | 6090 |
|
6091 |
dir := self theSingleSelectedDirectoryOrNil. |
|
6092 |
dir isNil ifTrue:[ ^ self]. |
|
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
6093 |
self withActivityIndicationDo:[ |
7560 | 6094 |
files := self currentSelectedObjects. |
6031 | 6095 |
files notEmptyOrNil ifTrue:[ |
6096 |
CBrowser::Browser openOn:files first. |
|
6097 |
] ifFalse:[ |
|
6098 |
CBrowser::Browser openIn:dir. |
|
6099 |
] |
|
3892 | 6100 |
] |
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
6101 |
|
7560 | 6102 |
"Modified: / 04-12-2006 / 13:15:19 / cg" |
3892 | 6103 |
! |
6104 |
||
4230 | 6105 |
openChangeSetBrowser |
6106 |
self |
|
6107 |
openTool:ChangeSetBrowser |
|
6108 |
with:#openOnFile: |
|
6109 |
ignoreDirectories:true |
|
6110 |
! |
|
6111 |
||
3892 | 6112 |
openChangesBrowser |
6113 |
"open a change browser on the selected file(s)" |
|
6114 |
||
6115 |
self openTool:(UserPreferences current changesBrowserClass) |
|
6116 |
! |
|
6117 |
||
6118 |
openDiffView |
|
6119 |
"open a diff-view" |
|
6120 |
||
6388 | 6121 |
|name1 name2 text1 text2 d err nm l1 files title |
6460 | 6122 |
defaultName lastFile sameContents msg| |
6123 |
||
6124 |
files := self currentSelectedObjects. |
|
3892 | 6125 |
files isEmpty ifTrue:[ |
6460 | 6126 |
Dialog warn:(resources string:'You have to select a file first'). |
4414 | 6127 |
^ self. |
3892 | 6128 |
]. |
8287
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6129 |
|
3892 | 6130 |
(files size == 2) ifTrue:[ |
4414 | 6131 |
name1 := files last. |
6132 |
name2 := files first. |
|
3892 | 6133 |
] ifFalse:[ |
4414 | 6134 |
LastFileDiffFile notNil ifTrue:[ |
5960 | 6135 |
| directory | |
6136 |
directory := self currentDirectory. |
|
6137 |
directory notNil ifTrue:[ |
|
6138 |
lastFile := directory asFilename construct:(LastFileDiffFile baseName). |
|
4414 | 6139 |
(lastFile exists and:[lastFile isReadable]) ifTrue:[ |
6140 |
name1 := lastFile. |
|
6141 |
] |
|
6142 |
] |
|
6143 |
]. |
|
6144 |
name2 := files first. |
|
6460 | 6145 |
title := resources string:'Show differences between "%1" and:' with:name2 baseName. |
4414 | 6146 |
defaultName := name1 notNil ifTrue:[name1 baseName] ifFalse:[nil]. |
6147 |
name1 := DialogBox |
|
6148 |
requestFileName:title |
|
6149 |
default:defaultName |
|
6460 | 6150 |
ok:(resources string:'OK') |
6151 |
abort:(resources string:'Compare against File List') |
|
4414 | 6152 |
pattern:'*' |
6153 |
fromDirectory:(name2 asFilename directory). |
|
3892 | 6154 |
]. |
6155 |
||
8287
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6156 |
self withWaitCursorDo:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6157 |
(name1 isNil or:[name1 asString isEmpty]) ifTrue:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6158 |
text1 := self getAllFilesAsStrings asStringCollection withTabs. |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6159 |
text1 := text1 collect:[:l | l isNil ifTrue:[' '] ifFalse:[l]]. |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6160 |
name1 := nil. |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6161 |
l1 := 'browser contents' |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6162 |
] ifFalse:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6163 |
name1 := name1 asFilename. |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6164 |
LastFileDiffFile := name1. |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6165 |
name1 isReadable ifFalse:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6166 |
nm := name1. |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6167 |
name1 exists ifFalse:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6168 |
err := '"%1" does not exist.'. |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6169 |
] ifTrue:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6170 |
err := '"%1" is not readable.' |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6171 |
]. |
4414 | 6172 |
]. |
8287
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6173 |
l1 := name1 pathName |
4414 | 6174 |
]. |
8287
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6175 |
|
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6176 |
err isNil ifTrue:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6177 |
name2 isReadable ifFalse:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6178 |
nm := name2. |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6179 |
name2 exists ifFalse:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6180 |
err := '"%1" does not exist.'. |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6181 |
] ifTrue:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6182 |
err := '"%1" is not readable.' |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6183 |
]. |
4414 | 6184 |
]. |
6185 |
]. |
|
8287
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6186 |
err notNil ifTrue:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6187 |
Dialog warn:(resources string:err with:nm pathName allBold). |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6188 |
^ self |
6176 | 6189 |
]. |
6190 |
||
8287
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6191 |
self withActivityIndicationDo:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6192 |
((name1 notNil and:[name1 fileSize > (1024*1024*8)]) |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6193 |
or:[ name2 fileSize > (1024*1024*8) ]) ifTrue:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6194 |
name1 fileSize = name2 fileSize ifTrue:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6195 |
ProgressIndicator |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6196 |
displayBusyIndicator:'Comparing...' |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6197 |
at:(Screen default center) |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6198 |
during:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6199 |
sameContents := (name1 sameContentsAs:name2). |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6200 |
]. |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6201 |
sameContents ifTrue:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6202 |
self information:'Same contents.' |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6203 |
] ifFalse:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6204 |
self information:'Different contents (File(s) too big for more details).' |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6205 |
]. |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6206 |
] ifFalse:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6207 |
self information:'Different size (File(s) too big for more details).' |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6208 |
]. |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6209 |
^ self. |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6210 |
]. |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6211 |
|
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6212 |
name1 notNil ifTrue:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6213 |
name1 isDirectory ifTrue:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6214 |
text1 := name1 directoryContents asString. |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6215 |
] ifFalse:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6216 |
text1 := name1 contents. |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6217 |
] |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6218 |
]. |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6219 |
name2 isDirectory ifTrue:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6220 |
text2 := name2 directoryContents asString. |
6460 | 6221 |
] ifFalse:[ |
8287
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6222 |
text2 := name2 contents. |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6223 |
]. |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6224 |
text1 = text2 ifTrue:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6225 |
(name1 isDirectory or:[name2 isDirectory]) ifTrue:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6226 |
msg := 'Same filename lists.' |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6227 |
] ifFalse:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6228 |
msg := 'Same contents.' |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6229 |
]. |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6230 |
self information:(resources string:msg) |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6231 |
] ifFalse:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6232 |
d := DiffTextView |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6233 |
openOn:text1 label:l1 |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6234 |
and:text2 label:name2 pathName. |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6235 |
d topView label:(resources string:'File Differences'). |
6460 | 6236 |
] |
4414 | 6237 |
] |
3892 | 6238 |
] |
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
6239 |
|
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
6240 |
"Modified: / 25-07-2006 / 09:07:37 / cg" |
3892 | 6241 |
! |
6242 |
||
6243 |
openEditor |
|
6244 |
self openTool:EditTextView |
|
6245 |
! |
|
6246 |
||
4957 | 6247 |
openGV |
6248 |
self openOSCommandWithFiles:'gv' |
|
6249 |
! |
|
6250 |
||
3892 | 6251 |
openHTMLReader |
6252 |
||
6253 |
self openTool:HTMLDocumentView ignoreDirectories:false |
|
6254 |
! |
|
6255 |
||
6256 |
openImageEditor |
|
6292 | 6257 |
[ |
6258 |
self loadImageThenDo:[:img | img edit] |
|
6259 |
] fork |
|
3892 | 6260 |
! |
6261 |
||
6262 |
openImageInspector |
|
6292 | 6263 |
[ |
6264 |
self loadImageThenDo:[:img | img inspect] |
|
6265 |
] fork |
|
3892 | 6266 |
! |
6267 |
||
6268 |
openImagePreview |
|
5778 | 6269 |
[ |
6270 |
self |
|
6292 | 6271 |
loadImageThenDo: |
5778 | 6272 |
[:img | |
6273 |
|i top viewer| |
|
6274 |
||
6275 |
top := StandardSystemView new. |
|
6276 |
||
6277 |
viewer := ImageView origin:0.0@0.0 corner:1.0@1.0 in:top. |
|
6278 |
i := img. |
|
6279 |
top extent:200@200. |
|
6280 |
top label:(img fileName asFilename directory baseName , Filename separator , img fileName asFilename baseName). |
|
6281 |
top openAndWait. |
|
6282 |
||
6283 |
(i width > 200 or:[i height > 200]) ifTrue:[ |
|
6284 |
i := i magnifiedPreservingRatioTo:200@200. |
|
6285 |
]. |
|
6286 |
viewer image:i. |
|
6287 |
]. |
|
3892 | 6288 |
] fork |
6289 |
! |
|
6290 |
||
6291 |
openMP3Player |
|
6292 |
|file| |
|
6293 |
||
3982 | 6294 |
file := self currentSelectedFiles. |
3892 | 6295 |
(file isEmpty) ifTrue:[ |
4414 | 6296 |
^ self. |
3892 | 6297 |
]. |
6298 |
file := file first. |
|
6299 |
(MP3PlayerApplication ? SaugFix::MP3PlayerApplication) playSong:file. |
|
6300 |
! |
|
6301 |
||
4957 | 6302 |
openOSCommandWithFiles:command |
6303 |
|files fileNames| |
|
6304 |
||
6305 |
files := self currentSelectedFiles. |
|
6306 |
(files isEmpty) ifTrue:[ |
|
6307 |
^ self. |
|
6308 |
]. |
|
6309 |
||
6310 |
fileNames := files collect:[:each | |
|
6311 |
'"' , each asFilename pathName , '"' |
|
6312 |
]. |
|
6313 |
||
6314 |
[ |
|
6315 |
OperatingSystem |
|
4959 | 6316 |
executeCommand:command , ' ' , fileNames asStringCollection asString |
6317 |
inDirectory:(files first asFilename directory). |
|
4957 | 6318 |
] fork |
6319 |
! |
|
6320 |
||
4820 | 6321 |
openPDFViewer |
5836
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
6322 |
|files fileNames cmd arg| |
4820 | 6323 |
|
6324 |
files := self currentSelectedFiles. |
|
6325 |
(files isEmpty) ifTrue:[ |
|
6326 |
^ self. |
|
6327 |
]. |
|
5836
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
6328 |
cmd := MIMETypes defaultCommandForMimeType:'application/pdf'. |
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
6329 |
cmd isNil ifTrue:[ |
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
6330 |
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
|
6331 |
^ self. |
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
6332 |
]. |
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
6333 |
|
4820 | 6334 |
fileNames := |
6335 |
files |
|
6336 |
collect: |
|
6337 |
[:each | |
|
6338 |
'"' , each asFilename pathName , '"' |
|
6339 |
]. |
|
5836
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
6340 |
arg := fileNames asStringCollection asStringWith:' '. |
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
6341 |
|
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
6342 |
(cmd includesString:'"%1"') ifTrue:[ |
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
6343 |
cmd := cmd copyReplaceString:'"%1"' withString:'%1' |
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
6344 |
]. |
4820 | 6345 |
|
4950 | 6346 |
[ |
5836
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
6347 |
OperatingSystem executeCommand:(cmd bindWith:arg). |
4950 | 6348 |
] fork |
5836
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
6349 |
|
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
6350 |
"Modified: / 12-05-2004 / 12:31:20 / cg" |
4820 | 6351 |
! |
6352 |
||
4958 | 6353 |
openRP |
6354 |
self openOSCommandWithFiles:'realplay' |
|
6355 |
! |
|
6356 |
||
8426 | 6357 |
openResourceFileEditor |
6358 |
||
6359 |
self |
|
6360 |
openTool: Tools::InternationalLanguageTranslationEditor |
|
6361 |
with: #openOnFile: |
|
6362 |
! |
|
6363 |
||
3892 | 6364 |
openSlideShow |
5880 | 6365 |
|dir| |
6366 |
||
6367 |
dir := self theSingleSelectedDirectoryOrNil. |
|
6368 |
dir isNil ifTrue:[^ self]. |
|
6369 |
||
3892 | 6370 |
CodingExamples_GUI::SlideShow openIn:dir. |
6371 |
! |
|
6372 |
||
6373 |
openSnapshotImageBrowser |
|
4491 | 6374 |
"Sorry, for now, only the old browser can handle snapShotImages." |
6375 |
||
3892 | 6376 |
^ self openTool:SystemBrowser with:#openOnSnapShotImage: ignoreDirectories:true |
6377 |
! |
|
6378 |
||
6379 |
openTerminal |
|
5880 | 6380 |
|dir| |
6381 |
||
6382 |
dir := self theSingleSelectedDirectoryOrHomeDir. |
|
3892 | 6383 |
|
5300 | 6384 |
TerminalApplication notNil ifTrue:[ |
6385 |
TerminalApplication openIn:dir |
|
6386 |
] ifFalse:[ |
|
6387 |
VT100TerminalView openShellIn:dir. |
|
6388 |
]. |
|
3892 | 6389 |
! |
6390 |
||
6391 |
openTool:aToolClass |
|
6392 |
"open a tool on the selected file(s)" |
|
6393 |
||
6394 |
^ self openTool:aToolClass ignoreDirectories:true |
|
6395 |
! |
|
6396 |
||
6397 |
openTool:aToolClass ignoreDirectories:ignoreDirs |
|
6398 |
"open a tool on the selected file(s)" |
|
6399 |
||
6400 |
^ self |
|
4414 | 6401 |
openTool:aToolClass |
6402 |
with:#openOn: |
|
6403 |
ignoreDirectories:ignoreDirs |
|
3892 | 6404 |
! |
6405 |
||
8426 | 6406 |
openTool:aToolClass with:aSelector |
6407 |
"open a tool on the selected file(s)" |
|
6408 |
||
6409 |
^ self openTool:aToolClass with:aSelector ignoreDirectories:true |
|
6410 |
! |
|
6411 |
||
3892 | 6412 |
openTool:aToolClass with:aSelector ignoreDirectories:ignoreDirs |
6413 |
"open a tool on the selected file(s)" |
|
6414 |
||
8832 | 6415 |
|tool| |
3892 | 6416 |
|
6417 |
aToolClass isNil ifTrue:[ |
|
4414 | 6418 |
Dialog warn:'Sorry, that tool seems to be not available'. |
6419 |
^ nil. |
|
3892 | 6420 |
]. |
8832 | 6421 |
self forEachSelectedFileIgnoringDirectories:ignoreDirs do:[:path | |
6422 |
tool := aToolClass perform:aSelector with:path. |
|
3892 | 6423 |
]. |
6424 |
^ tool |
|
8832 | 6425 |
! |
6426 |
||
6427 |
openWebBrowser |
|
6428 |
self forEachSelectedFileIgnoringDirectories:true do:[:path | |
|
8882 | 6429 |
Error |
6430 |
handle:[:ex | |
|
6431 |
Dialog warn:'Shell execution failed: ',ex description |
|
6432 |
] do:[ |
|
6433 |
OperatingSystem openApplicationForDocument:path operation:#open. |
|
6434 |
^ self. |
|
6435 |
] |
|
8832 | 6436 |
]. |
3892 | 6437 |
! |
6438 |
||
6022 | 6439 |
openWorkspace |
6440 |
self |
|
6441 |
openTool:WorkspaceApplication |
|
6442 |
with:#openOnFile: |
|
6443 |
ignoreDirectories:true |
|
6444 |
! |
|
6445 |
||
4950 | 6446 |
openXV |
4957 | 6447 |
self openOSCommandWithFiles:'xv' |
4950 | 6448 |
! |
6449 |
||
3892 | 6450 |
openZipTool |
5880 | 6451 |
|zipTool| |
3892 | 6452 |
|
6453 |
(zipTool := self openTool:ZipTool) notNil ifTrue:[ |
|
5880 | 6454 |
zipTool initialExtractDirectory:(self theSingleSelectedDirectoryOrHomeDir). |
3892 | 6455 |
]. |
6456 |
! |
|
6457 |
||
7869 | 6458 |
parseXmlFile |
8617 | 6459 |
"Show an XML file - either in an XMLInspector or fall back to |
6460 |
a plain inspector on the XML tree" |
|
7869 | 6461 |
|
6462 |
self withActivityIndicationDo:[ |
|
6463 |
| selectedFiles xmlDocument | |
|
6464 |
||
6465 |
selectedFiles:= self currentSelectedFiles. |
|
6466 |
selectedFiles do:[:fileName | |
|
8617 | 6467 |
XML::XMLSignal handle:[:ex | |
8611
3d979ab577b7
xml-inspector always enabled.
Claus Gittinger <cg@exept.de>
parents:
8601
diff
changeset
|
6468 |
Dialog information:('Error while reading XML:\ %1' bindWith:ex description) withCRs. |
3d979ab577b7
xml-inspector always enabled.
Claus Gittinger <cg@exept.de>
parents:
8601
diff
changeset
|
6469 |
^ self. |
3d979ab577b7
xml-inspector always enabled.
Claus Gittinger <cg@exept.de>
parents:
8601
diff
changeset
|
6470 |
] do:[ |
9173 | 6471 |
|s d magic encoder document| |
6472 |
||
6473 |
s := fileName asFilename readStream. |
|
6474 |
s binary. |
|
6475 |
magic := (s next:2). |
|
6476 |
magic = #[254 255] ifTrue:[ |
|
6477 |
"/ UTF16BE |
|
6478 |
document := CharacterEncoder decodeString:(s upToEnd) from:#utf16be. |
|
6479 |
] ifFalse:[ |
|
6480 |
magic = #[255 254] ifTrue:[ |
|
6481 |
"/ UTF16LE |
|
6482 |
document := CharacterEncoder decodeString:(s upToEnd) from:#utf16le. |
|
6483 |
]. |
|
6484 |
]. |
|
6485 |
s close. |
|
6486 |
||
6487 |
document notNil ifTrue:[ |
|
6488 |
xmlDocument := XML::XMLParser |
|
6489 |
processDocumentString:document |
|
6490 |
beforeScanDo:[:parse| parse validate:false]. |
|
6491 |
] ifFalse:[ |
|
6492 |
xmlDocument := XML::XMLParser |
|
8617 | 6493 |
processDocumentInFilename:fileName |
6494 |
beforeScanDo:[:parse| parse validate:false]. |
|
9173 | 6495 |
] |
8611
3d979ab577b7
xml-inspector always enabled.
Claus Gittinger <cg@exept.de>
parents:
8601
diff
changeset
|
6496 |
]. |
8068
1cf9f1224bbc
changed #parseXmlFile - open XMLInspector (in exept:xml/inspector)
Stefan Vogel <sv@exept.de>
parents:
8042
diff
changeset
|
6497 |
XML::XMLInspector notNil ifTrue:[ |
1cf9f1224bbc
changed #parseXmlFile - open XMLInspector (in exept:xml/inspector)
Stefan Vogel <sv@exept.de>
parents:
8042
diff
changeset
|
6498 |
XML::XMLInspector openOn:xmlDocument. |
8617 | 6499 |
"/ XML::XMLInspector openWithoutDetailsOn:xmlDocument. |
8068
1cf9f1224bbc
changed #parseXmlFile - open XMLInspector (in exept:xml/inspector)
Stefan Vogel <sv@exept.de>
parents:
8042
diff
changeset
|
6500 |
] ifFalse:[ |
1cf9f1224bbc
changed #parseXmlFile - open XMLInspector (in exept:xml/inspector)
Stefan Vogel <sv@exept.de>
parents:
8042
diff
changeset
|
6501 |
"fall back..." |
1cf9f1224bbc
changed #parseXmlFile - open XMLInspector (in exept:xml/inspector)
Stefan Vogel <sv@exept.de>
parents:
8042
diff
changeset
|
6502 |
xmlDocument inspect. |
1cf9f1224bbc
changed #parseXmlFile - open XMLInspector (in exept:xml/inspector)
Stefan Vogel <sv@exept.de>
parents:
8042
diff
changeset
|
6503 |
] |
7869 | 6504 |
]. |
6505 |
] |
|
6506 |
! |
|
6507 |
||
3892 | 6508 |
readAbbrevFile |
6509 |
"read the abbrev file and install classes found there as autoloaded classes" |
|
6510 |
||
5880 | 6511 |
|directories| |
3892 | 6512 |
|
3982 | 6513 |
directories := self currentSelectedDirectories. |
3892 | 6514 |
directories isEmpty ifTrue:[^ self]. |
6515 |
||
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
6516 |
self withActivityIndicationDo:[ |
5880 | 6517 |
directories do:[:eachDir | |
6518 |
Smalltalk installAutoloadedClassesFrom:(eachDir construct:'abbrev.stc'). |
|
6519 |
] |
|
5828 | 6520 |
] |
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
6521 |
|
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
6522 |
"Modified: / 25-07-2006 / 09:07:43 / cg" |
3892 | 6523 |
! |
6524 |
||
6460 | 6525 |
readAndShowResources |
6526 |
self withActivityIndicationDo:[ |
|
6527 |
| selectedFiles| |
|
6528 |
||
6529 |
selectedFiles:= self currentSelectedFiles. |
|
6530 |
selectedFiles do:[:fileName | |
|
6531 |
resources := ResourcePack fromFile:fileName. |
|
6532 |
resources inspect. |
|
6533 |
]. |
|
6534 |
] |
|
6535 |
! |
|
6536 |
||
3892 | 6537 |
singleFileFileIn:fileName lazy:lazy |
6538 |
"fileIn the selected file(s)" |
|
6539 |
||
6281
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
6540 |
|aStream wasLazy notifyString dontAskSignals| |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
6541 |
|
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
6542 |
fileName isRegularFile ifFalse:[ |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
6543 |
^ self. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
6544 |
]. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
6545 |
|
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
6546 |
[ |
4345 | 6547 |
(ObjectFileLoader notNil |
5491 | 6548 |
and:[ObjectFileLoader hasValidBinaryExtension:fileName]) ifTrue:[ |
4345 | 6549 |
AbortOperationRequest catch:[ |
6550 |
|p| |
|
6551 |
||
6552 |
"/ |
|
6553 |
"/ look if already loaded ... then unload first |
|
6554 |
"/ |
|
6555 |
p := fileName pathName. |
|
6556 |
(ObjectFileLoader loadedObjectFiles includes:p) ifTrue:[ |
|
6557 |
(Dialog confirm:(resources |
|
6558 |
string:'%1 is already loaded; load anyway ?' |
|
6559 |
with:p)) ifFalse:[ |
|
6560 |
^ self |
|
6561 |
]. |
|
6562 |
notifyString := 'unloading old ' , p , ' ...'. |
|
6563 |
Transcript showCR:notifyString. |
|
4523 | 6564 |
self notify:notifyString. |
4345 | 6565 |
ObjectFileLoader unloadObjectFile:p. |
6566 |
]. |
|
6567 |
||
6568 |
notifyString := 'loading ' , p , ' ...'. |
|
6569 |
Transcript showCR:notifyString. |
|
4523 | 6570 |
self notify:notifyString. |
4345 | 6571 |
ObjectFileLoader loadObjectFile:p. |
6572 |
Class addInfoRecord:('fileIn ' , fileName asFilename pathName) |
|
6573 |
] |
|
6574 |
] ifFalse:[ ((fileName hasSuffix:'cls') |
|
6575 |
and:[((fileName mimeTypeOfContents ? '') startsWith:'application/x-smalltalk-source') not ]) ifTrue:[ |
|
6576 |
"/ loading a binary class file |
|
4636
08b2b63e3107
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4629
diff
changeset
|
6577 |
aStream := fileName readStreamOrNil. |
4345 | 6578 |
aStream notNil ifTrue:[ |
6579 |
aStream fileInBinary. |
|
6580 |
] |
|
6581 |
] ifFalse:[ |
|
6582 |
((fileName hasSuffix:'class') |
|
5491 | 6583 |
or:[(fileName hasSuffix:'cla')]) ifTrue:[ |
4345 | 6584 |
"/ loading a java class file |
6585 |
JavaClassReader notNil ifTrue:[ |
|
5491 | 6586 |
JavaClassReader loadFile:fileName |
4345 | 6587 |
] |
6588 |
] ifFalse:[ (fileName hasSuffix:'sif') ifTrue:[ |
|
6589 |
"/ loading a sif (smalltalk interchange format) file |
|
6590 |
SmalltalkInterchangeSTXFileInManager autoload. |
|
6591 |
SmalltalkInterchangeFileManager newForFileIn |
|
6592 |
fileName: fileName pathName; |
|
6593 |
fileIn. |
|
5756 | 6594 |
] ifFalse:[ (fileName hasSuffix:'js') ifTrue:[ |
6595 |
"/ loading a javaScript file |
|
6596 |
JavaScriptSourceReader new fileIn:fileName. |
|
4345 | 6597 |
] ifFalse:[ (fileName hasSuffix:'pcl') ifTrue:[ |
6598 |
Parcel isNil ifTrue:[ |
|
6599 |
Dialog warn:'Parcel support not loaded.' |
|
6600 |
] ifFalse:[ |
|
6601 |
Parcel loadParcelFrom: fileName pathName |
|
6602 |
] |
|
6603 |
] ifFalse:[ |
|
6604 |
"/ loading a regular (chunk) or xml source file |
|
6223
328a3fddfc5c
Allow opening of a debugger when an error on fileIn occurs.
Stefan Vogel <sv@exept.de>
parents:
6220
diff
changeset
|
6605 |
Error handle:[:ex | |
328a3fddfc5c
Allow opening of a debugger when an error on fileIn occurs.
Stefan Vogel <sv@exept.de>
parents:
6220
diff
changeset
|
6606 |
self errorNotify:'Error on file in: ', ex description. |
5491 | 6607 |
] do:[ |
6608 |
aStream := fileName readStream. |
|
6609 |
[ |
|
6610 |
Class withoutUpdatingChangesDo:[ |
|
6611 |
wasLazy := Compiler compileLazy:lazy. |
|
5948 | 6612 |
Smalltalk fileInStream:aStream. |
5491 | 6613 |
]. |
6614 |
Class addInfoRecord:('fileIn ' , fileName asString) |
|
6615 |
] ensure:[ |
|
6616 |
Compiler compileLazy:wasLazy. |
|
6617 |
aStream close |
|
4345 | 6618 |
] |
6619 |
] |
|
5756 | 6620 |
]]]] |
4345 | 6621 |
]] |
6281
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
6622 |
] on:Error, HaltInterrupt, Class packageRedefinitionNotification do:[:ex| |
8082
40a926dc460d
On class/method redefinition allow the user to select both #keep and #continue
Stefan Vogel <sv@exept.de>
parents:
8068
diff
changeset
|
6623 |
|sig msg label labels values action proceedValue isRedef redefKind| |
6281
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
6624 |
|
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
6625 |
isRedef := false. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
6626 |
sig := ex signal. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
6627 |
(sig == NoHandlerError and:[ex parameter rejected]) ifTrue:[ |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
6628 |
ex reject |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
6629 |
]. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
6630 |
sig == Class methodRedefinitionNotification ifTrue:[ |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
6631 |
msg := 'trying to overwrite method:\\ ' , ex oldMethod whoString , '\\in package ''' |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
6632 |
, ex oldPackage , ''' with method from package ''' , ex newPackage , ''''. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
6633 |
label := 'Method redefinition in fileIn'. |
8082
40a926dc460d
On class/method redefinition allow the user to select both #keep and #continue
Stefan Vogel <sv@exept.de>
parents:
8068
diff
changeset
|
6634 |
redefKind := 'method'. |
6281
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
6635 |
isRedef := true. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
6636 |
] ifFalse:[sig == Class classRedefinitionNotification ifTrue:[ |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
6637 |
msg := 'trying to redefine class: ' , ex oldClass name allBold , '\\in package ''' |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
6638 |
, ex oldPackage , ''' with new definition from package ''' , ex newPackage , ''''. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
6639 |
label := 'Class redefinition in fileIn'. |
8082
40a926dc460d
On class/method redefinition allow the user to select both #keep and #continue
Stefan Vogel <sv@exept.de>
parents:
8068
diff
changeset
|
6640 |
redefKind := 'class'. |
6281
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
6641 |
isRedef := true. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
6642 |
] ifFalse:[sig == HaltInterrupt ifTrue:[ |sender| |
6592
207318954865
oops - do not generate an exception in an ex-handler
Claus Gittinger <cg@exept.de>
parents:
6589
diff
changeset
|
6643 |
label := msg := 'Breakpoint/Halt in fileIn'. |
6281
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
6644 |
sender := ex suspendedContext. |
7533 | 6645 |
msg := msg , '\\in ' , sender receiver class name , '>>' , sender sender selector |
6281
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
6646 |
] ifFalse:[ |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
6647 |
label := 'Error in fileIn'. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
6648 |
msg := 'error in fileIn: %1' |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
6649 |
]]]. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
6650 |
|
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
6651 |
msg := msg bindWith:ex description. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
6652 |
|
8887
f9ab42af84ff
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
8882
diff
changeset
|
6653 |
labels := #('Cancel' 'Skip' 'Debug' 'Compare Sources'). |
f9ab42af84ff
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
8882
diff
changeset
|
6654 |
values := #(abort skip debug compareSources). |
f9ab42af84ff
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
8882
diff
changeset
|
6655 |
|
6281
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
6656 |
isRedef ifTrue:[ |
8082
40a926dc460d
On class/method redefinition allow the user to select both #keep and #continue
Stefan Vogel <sv@exept.de>
parents:
8068
diff
changeset
|
6657 |
msg := msg, ('%<cr>%<cr>Continue will install the change and assign the %1 to the new package. |
40a926dc460d
On class/method redefinition allow the user to select both #keep and #continue
Stefan Vogel <sv@exept.de>
parents:
8068
diff
changeset
|
6658 |
Keep Package will install the change, but keep the %1 in the old package.' bindWith:redefKind). |
40a926dc460d
On class/method redefinition allow the user to select both #keep and #continue
Stefan Vogel <sv@exept.de>
parents:
8068
diff
changeset
|
6659 |
|
8887
f9ab42af84ff
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
8882
diff
changeset
|
6660 |
labels := labels , #('Keep Package' ). |
f9ab42af84ff
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
8882
diff
changeset
|
6661 |
values := values , #(keep). |
6281
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
6662 |
]. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
6663 |
|
8887
f9ab42af84ff
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
8882
diff
changeset
|
6664 |
labels := labels , #( 'Continue' 'ContinueForAll'). |
f9ab42af84ff
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
8882
diff
changeset
|
6665 |
values := values , #( continue continueForAll). |
f9ab42af84ff
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
8882
diff
changeset
|
6666 |
|
6281
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
6667 |
AbortAllOperationRequest isHandled ifTrue:[ |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
6668 |
labels := #('Cancel All') , labels. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
6669 |
values := #(cancelAll) , values. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
6670 |
]. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
6671 |
|
8082
40a926dc460d
On class/method redefinition allow the user to select both #keep and #continue
Stefan Vogel <sv@exept.de>
parents:
8068
diff
changeset
|
6672 |
action := Dialog |
40a926dc460d
On class/method redefinition allow the user to select both #keep and #continue
Stefan Vogel <sv@exept.de>
parents:
8068
diff
changeset
|
6673 |
choose:(msg withCRs) |
6281
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
6674 |
label:label |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
6675 |
image:(WarningBox iconBitmap) |
8082
40a926dc460d
On class/method redefinition allow the user to select both #keep and #continue
Stefan Vogel <sv@exept.de>
parents:
8068
diff
changeset
|
6676 |
labels:labels |
6281
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
6677 |
values:values |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
6678 |
default:#continue |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
6679 |
onCancel:#abort. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
6680 |
|
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
6681 |
action == #continueForAll ifTrue:[ |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
6682 |
dontAskSignals isNil ifTrue:[ |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
6683 |
dontAskSignals := IdentityDictionary new. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
6684 |
]. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
6685 |
dontAskSignals at:sig put:#continue. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
6686 |
action := #continue. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
6687 |
]. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
6688 |
|
8887
f9ab42af84ff
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
8882
diff
changeset
|
6689 |
(action == #compareSources) ifTrue:[ |
f9ab42af84ff
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
8882
diff
changeset
|
6690 |
DiffCodeView |
f9ab42af84ff
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
8882
diff
changeset
|
6691 |
openOn:(ex oldMethod source) label:'Old Source' |
f9ab42af84ff
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
8882
diff
changeset
|
6692 |
and:(ex newMethod source) label:'New Source' |
f9ab42af84ff
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
8882
diff
changeset
|
6693 |
title:ex description. |
f9ab42af84ff
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
8882
diff
changeset
|
6694 |
ex resignalAs:ex |
f9ab42af84ff
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
8882
diff
changeset
|
6695 |
]. |
8082
40a926dc460d
On class/method redefinition allow the user to select both #keep and #continue
Stefan Vogel <sv@exept.de>
parents:
8068
diff
changeset
|
6696 |
(action == #continue or:[action == #keep]) ifTrue:[ |
40a926dc460d
On class/method redefinition allow the user to select both #keep and #continue
Stefan Vogel <sv@exept.de>
parents:
8068
diff
changeset
|
6697 |
ex proceedWith:action "(isRedef ifTrue:[#keep] ifFalse:[#continue])". |
6281
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
6698 |
]. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
6699 |
action == #abort ifTrue:[ |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
6700 |
AbortOperationRequest raise. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
6701 |
ex return |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
6702 |
]. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
6703 |
action == #cancelAll ifTrue:[ |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
6704 |
AbortAllOperationRequest raise. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
6705 |
ex return |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
6706 |
]. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
6707 |
action == #skip ifTrue:[ |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
6708 |
ex proceedWith:nil |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
6709 |
]. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
6710 |
action == #debug ifTrue:[ |
7330
fe62e489caae
When opening a debugger, make sure that the topmost context is returnable
Stefan Vogel <sv@exept.de>
parents:
7324
diff
changeset
|
6711 |
Debugger enter:ex returnableSuspendedContext |
6281
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
6712 |
withMessage:ex description |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
6713 |
mayProceed:true. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
6714 |
ex proceedWith:nil. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
6715 |
]. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
6716 |
ex reject |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
6717 |
] |
7040 | 6718 |
|
7533 | 6719 |
"Modified: / 21-11-2006 / 15:53:03 / cg" |
4531 | 6720 |
! |
6721 |
||
4558 | 6722 |
splitFile:infile intoPiecesOfSize:kiloBytes |
6723 |
|bytesPerSplit splitIndex bufferSize buffer n |
|
6724 |
inStream outFile outStream remaining remainingInThisOutfile| |
|
6725 |
||
6726 |
bufferSize := 32*1024. |
|
6727 |
||
6728 |
inStream := infile readStream. |
|
6729 |
||
6730 |
bytesPerSplit := kiloBytes * 1024. |
|
6731 |
||
6732 |
remaining := infile fileSize. |
|
6733 |
splitIndex := 1. |
|
6734 |
[remaining > 0] whileTrue:[ |
|
6735 |
outFile := infile pathName , '_' , (splitIndex printString leftPaddedTo:3 with:$0). |
|
6736 |
outStream := outFile asFilename writeStream. |
|
6737 |
remainingInThisOutfile := remaining min:bytesPerSplit. |
|
6738 |
[remainingInThisOutfile > 0] whileTrue:[ |
|
6739 |
buffer := ByteArray new:bufferSize. |
|
6740 |
n := inStream |
|
6741 |
nextBytes:(bufferSize min:remainingInThisOutfile) |
|
6742 |
into:buffer |
|
6743 |
startingAt:1. |
|
6744 |
outStream nextPutBytes:n from:buffer startingAt:1. |
|
6745 |
remainingInThisOutfile := remainingInThisOutfile - n. |
|
6746 |
remaining := remaining - n. |
|
6747 |
]. |
|
6748 |
outStream close. |
|
6749 |
splitIndex := splitIndex + 1. |
|
6750 |
]. |
|
6751 |
inStream close. |
|
6752 |
! |
|
6753 |
||
6754 |
splitSelectedFiles |
|
6264 | 6755 |
|selectedFiles numFiles msg sizeString kiloBytes| |
4558 | 6756 |
|
7560 | 6757 |
selectedFiles := self currentSelectedObjects. |
4558 | 6758 |
(numFiles := selectedFiles size) == 0 ifTrue:[^ self]. |
6759 |
||
6265 | 6760 |
msg := (numFiles > 1) |
6761 |
ifTrue:'Split each of the %1 files into pieces of size (in kB):' |
|
6762 |
ifFalse:'Split %2 into pieces of size (in kB):'. |
|
4558 | 6763 |
|
6352 | 6764 |
sizeString := Dialog request:(resources stringWithCRs:msg with:numFiles with:selectedFiles first baseName). |
6264 | 6765 |
sizeString isEmptyOrNil ifTrue:[^ self]. |
6766 |
kiloBytes := Integer readFrom:sizeString onError:nil. |
|
4558 | 6767 |
kiloBytes isNil ifTrue:[^ self]. |
6768 |
||
6769 |
selectedFiles do:[:fileName | |
|
6770 |
self notify:('Splitting:', fileName baseName). |
|
6771 |
fileName isDirectory ifFalse:[ |
|
6772 |
self splitFile:fileName intoPiecesOfSize:kiloBytes. |
|
6773 |
] |
|
6774 |
]. |
|
6190 | 6775 |
self notify:nil. |
6265 | 6776 |
|
7560 | 6777 |
"Modified: / 04-12-2006 / 13:15:26 / cg" |
4558 | 6778 |
! |
6779 |
||
4531 | 6780 |
truncateSelectedFilesToZeroSize |
4554 | 6781 |
|selectedFiles numFiles msg| |
4531 | 6782 |
|
7560 | 6783 |
selectedFiles := self currentSelectedObjects. |
4554 | 6784 |
(numFiles := selectedFiles size) == 0 ifTrue:[^ self]. |
6785 |
||
4930 | 6786 |
msg := 'Really truncate file ''%2'' to zero length ?\\WARNING: contents of file is lost !!\This cannot be undone.'. |
4554 | 6787 |
numFiles > 1 ifTrue:[ |
4930 | 6788 |
msg := 'Really truncate %1 files to zero length ?\\WARNING: contents of files is lost !!\This cannot be undone.'. |
4554 | 6789 |
]. |
4531 | 6790 |
|
6791 |
(Dialog |
|
6352 | 6792 |
confirm:(resources stringWithCRs:msg with:numFiles with:selectedFiles first baseName allBold) |
4531 | 6793 |
initialAnswer:false |
6794 |
) ifFalse:[ |
|
6795 |
^ self |
|
6796 |
]. |
|
6797 |
||
6798 |
selectedFiles do:[:fileName | |
|
6799 |
|s| |
|
6800 |
||
6801 |
self notify:('Truncating:', fileName baseName). |
|
6802 |
fileName isDirectory ifFalse:[ |
|
4636
08b2b63e3107
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4629
diff
changeset
|
6803 |
[ |
08b2b63e3107
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4629
diff
changeset
|
6804 |
s := fileName writeStream. |
08b2b63e3107
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4629
diff
changeset
|
6805 |
s close. |
08b2b63e3107
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4629
diff
changeset
|
6806 |
] on:FileStream openErrorSignal do:[:ex| |
4531 | 6807 |
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
|
6808 |
]. |
4531 | 6809 |
] |
6810 |
]. |
|
6190 | 6811 |
self notify:nil. |
7560 | 6812 |
|
6813 |
"Modified: / 04-12-2006 / 13:15:28 / cg" |
|
3892 | 6814 |
! ! |
6815 |
||
4849 | 6816 |
!AbstractFileBrowser methodsFor:'menu queries-cvs'! |
3892 | 6817 |
|
6818 |
canCvsAddAndCommit |
|
6819 |
||
3982 | 6820 |
|selectedFiles| |
6821 |
||
6822 |
selectedFiles := self currentSelectedFiles. |
|
6823 |
^ (selectedFiles notEmpty and:[self currentFilesAreInSameDirectory]). |
|
3892 | 6824 |
! |
6825 |
||
6826 |
canRemoveCVSContainer |
|
5356
d08261ab1567
care for nonexisting bookmarks file in open
Claus Gittinger <cg@exept.de>
parents:
5334
diff
changeset
|
6827 |
^ self currentSelectedFiles |
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
6828 |
contains:[:fileName| |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
6829 |
|dirOfFile cvsDir| |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
6830 |
|
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
6831 |
dirOfFile := self getDirWithoutFileName:fileName. |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
6832 |
cvsDir := dirOfFile construct:'CVS'. |
5318 | 6833 |
cvsDir isDirectory |
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
6834 |
]. |
3892 | 6835 |
! ! |
6836 |
||
4849 | 6837 |
!AbstractFileBrowser methodsFor:'menu queries-tools'! |
3892 | 6838 |
|
6521 | 6839 |
anySTFilesOrDirectoriesPresent |
6840 |
^ self anyDirectoriesOrFilesPresentWithSuffix:'st' |
|
6841 |
! |
|
6842 |
||
3892 | 6843 |
anySTFilesPresent |
6844 |
^ self anyFilesPresentWithSuffix:'st' |
|
6845 |
! |
|
6846 |
||
6847 |
canCreateNewProject |
|
6848 |
||
3982 | 6849 |
| selectedFiles | |
3892 | 6850 |
|
6851 |
self currentFilesAreInSameDirectory ifFalse:[^ false]. |
|
3982 | 6852 |
selectedFiles := self currentSelectedFiles. |
3892 | 6853 |
^ [ |
4414 | 6854 |
((selectedFiles detect:[:fileName| | suffix| |
6855 |
suffix := fileName suffix asLowercase. |
|
6856 |
(suffix = 'prj' or:[suffix = 'st']) |
|
6857 |
] ifNone:[nil]) notNil) |
|
3982 | 6858 |
] |
3892 | 6859 |
! |
6860 |
||
6861 |
canDoTerminal |
|
6862 |
||
6863 |
^ OperatingSystem isUNIXlike |
|
6864 |
or:[OperatingSystem isMSWINDOWSlike] |
|
6865 |
! |
|
6866 |
||
6867 |
canDoTerminalAndSystemIsDOS |
|
6868 |
||
6869 |
^ self canDoTerminal and:[OperatingSystem isMSWINDOWSlike] |
|
6870 |
! |
|
6871 |
||
6872 |
canDoTerminalAndSystemIsUnix |
|
6873 |
||
6874 |
^ self canDoTerminal and:[OperatingSystem isUNIXlike] |
|
6875 |
! |
|
6876 |
||
8640
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
6877 |
canGenerateSignatureFiles |
8645
00e4d07c6d6d
Generate signed expecco patch files
Stefan Vogel <sv@exept.de>
parents:
8641
diff
changeset
|
6878 |
"we need the both the KeyFileGenerator (for the secret expecco key) and the KeyFile" |
8640
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
6879 |
|
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
6880 |
Expecco::KeyFileGenerator isNil ifTrue:[ ^ false ]. |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
6881 |
Expecco::KeyFile isNil ifTrue:[ ^ false ]. |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
6882 |
|
8645
00e4d07c6d6d
Generate signed expecco patch files
Stefan Vogel <sv@exept.de>
parents:
8641
diff
changeset
|
6883 |
^ self currentSelectedFiles notEmptyOrNil |
8640
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
6884 |
! |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
6885 |
|
3892 | 6886 |
canReadAbbrevFile |
6887 |
||
5960 | 6888 |
|currentDirectory| |
3892 | 6889 |
|
6890 |
self currentFilesAreInSameDirectory ifFalse:[^ false]. |
|
5960 | 6891 |
currentDirectory := self currentDirectory. |
6892 |
^ currentDirectory notNil |
|
6893 |
and:[ (currentDirectory construct:'abbrev.stc') exists ] |
|
3892 | 6894 |
! |
6895 |
||
6896 |
canRemoveFromSourcePath |
|
6897 |
||
6898 |
^ false |
|
6899 |
! |
|
6900 |
||
6901 |
hasASN1 |
|
6902 |
^ [ OSI::ASN1Parser notNil |
|
4414 | 6903 |
and:[OSI::ASN1Parser isLoaded]] |
3892 | 6904 |
|
6905 |
! |
|
6906 |
||
6907 |
hasASN1AndSelection |
|
6908 |
^ [ self hasSelection value |
|
4414 | 6909 |
and:[self currentSelectedFiles size > 0 |
6910 |
and:[OSI::ASN1Parser notNil |
|
6911 |
and:[OSI::ASN1Parser isLoaded]]]] |
|
3892 | 6912 |
! |
6913 |
||
6914 |
hasCBrowser |
|
6915 |
^ [ CBrowser::Browser notNil ] |
|
6916 |
! |
|
6917 |
||
6918 |
hasJava |
|
6919 |
||
6920 |
^ [ JavaClassReader notNil |
|
4414 | 6921 |
and:[JavaClassReader isLoaded]] |
3892 | 6922 |
! |
6923 |
||
6924 |
hasJavaAndSelection |
|
6925 |
||
3982 | 6926 |
^ [ self currentSelectedFiles size > 0 |
4414 | 6927 |
and:[JavaClassReader notNil |
6928 |
and:[JavaClassReader isLoaded]]] |
|
3892 | 6929 |
! |
6930 |
||
6931 |
hasMP3Player |
|
6932 |
||
6933 |
^ [ MP3PlayerApplication notNil |
|
4414 | 6934 |
or:[SaugFix::MP3PlayerApplication notNil ]] |
3892 | 6935 |
! |
6936 |
||
6937 |
hasMP3PlayerAndSelection |
|
6938 |
||
3982 | 6939 |
^ [ self currentSelectedFiles size > 0 |
4414 | 6940 |
and:[ self hasMP3Player value]] |
3892 | 6941 |
! |
6942 |
||
8426 | 6943 |
hasResourceFileSelected |
6944 |
||
6945 |
^ [ |
|
6946 |
|sel| |
|
6947 |
||
6948 |
sel := self currentSelectedFiles. |
|
6949 |
sel notEmptyOrNil ifTrue:[ |
|
6950 |
sel conform:[:fn | fn suffix asLowercase = 'rs']. |
|
6951 |
] ifFalse:[ |
|
6952 |
false |
|
6953 |
] |
|
6954 |
] |
|
6955 |
! |
|
6956 |
||
3892 | 6957 |
hasSlideShow |
6958 |
||
6959 |
^ [CodingExamples_GUI::SlideShow notNil] |
|
6960 |
! |
|
6961 |
||
6962 |
hasSnapshotSelection |
|
6963 |
||
6964 |
^ [ |
|
4414 | 6965 |
| files | |
8426 | 6966 |
|
4414 | 6967 |
files := self currentSelectedFiles. |
6968 |
((files size == 1) |
|
6969 |
and:[ files first hasSuffix:'img' ]) |
|
3892 | 6970 |
] |
6971 |
! |
|
6972 |
||
7869 | 6973 |
hasXml |
9206 | 6974 |
^ [ XML::XMLParser notNil ] |
7869 | 6975 |
! |
6976 |
||
6977 |
hasXmlFileSelected |
|
8611
3d979ab577b7
xml-inspector always enabled.
Claus Gittinger <cg@exept.de>
parents:
8601
diff
changeset
|
6978 |
"/ cg - no longer use this to enable XML-inspector (always enabled). |
3d979ab577b7
xml-inspector always enabled.
Claus Gittinger <cg@exept.de>
parents:
8601
diff
changeset
|
6979 |
"/ then handle the error when it ever fails during xml-parsing. |
7869 | 6980 |
|
8426 | 6981 |
^ [ |
6982 |
|sel fileName| |
|
7869 | 6983 |
|
6984 |
sel := self currentSelectedFiles. |
|
6985 |
sel size == 1 ifTrue:[ |
|
6986 |
fileName := sel first. |
|
6987 |
fileName notNil ifTrue:[ |
|
8611
3d979ab577b7
xml-inspector always enabled.
Claus Gittinger <cg@exept.de>
parents:
8601
diff
changeset
|
6988 |
#('xml' 'vdx') includes:fileName suffix asLowercase |
7869 | 6989 |
] ifFalse:[ |
6990 |
false |
|
6991 |
] |
|
6992 |
] ifFalse:[ |
|
6993 |
false |
|
6994 |
] |
|
6995 |
] |
|
6996 |
! |
|
6997 |
||
3892 | 6998 |
hasZipFileSelected |
6999 |
||
3982 | 7000 |
^ [|sel fileName fn suff| |
7001 |
||
4414 | 7002 |
sel := self currentSelectedFiles. |
7003 |
sel size == 1 ifTrue:[ |
|
7004 |
fileName := sel first. |
|
7005 |
fileName notNil ifTrue:[ |
|
7006 |
suff := fileName suffix asLowercase. |
|
7007 |
suff = 'zip' or:[suff = 'jar'] |
|
7008 |
] ifFalse:[ |
|
7009 |
false |
|
7010 |
] |
|
7011 |
] ifFalse:[ |
|
7012 |
false |
|
7013 |
] |
|
3892 | 7014 |
] |
7015 |
! |
|
7016 |
||
7017 |
javaSupportLoaded |
|
7018 |
||
7019 |
^ false |
|
7020 |
! ! |
|
7021 |
||
3906 | 7022 |
!AbstractFileBrowser methodsFor:'presentation'! |
7023 |
||
7024 |
getModeString:modeBits |
|
7025 |
"convert file-mode bits into a more user-friendly string. |
|
7026 |
This is wrong here - should be moved into OperatingSystem." |
|
7027 |
||
7028 |
^ self getModeString:modeBits |
|
4414 | 7029 |
with:#( 'owner:' $r $w $x |
7030 |
' group:' $r $w $x |
|
7031 |
' others:' $r $w $x ) |
|
3906 | 7032 |
! |
7033 |
||
7034 |
getModeString:modeBits with:texts |
|
7035 |
"convert file-mode bits into a more user-friendly string. |
|
7036 |
This is wrong here - should be moved into OperatingSystem." |
|
7037 |
||
7038 |
|bits modeString| |
|
7039 |
||
7040 |
bits := modeBits bitAnd:8r777. |
|
7041 |
modeString := ''. |
|
7042 |
||
7043 |
#( nil 8r400 8r200 8r100 nil 8r040 8r020 8r010 nil 8r004 8r002 8r001 ) |
|
7044 |
with: texts do:[:bitMask :access | |
|
4414 | 7045 |
|ch| |
7046 |
||
7047 |
bitMask isNil ifTrue:[ |
|
7048 |
modeString := modeString , access |
|
7049 |
] ifFalse:[ |
|
7050 |
(bits bitAnd:bitMask) == 0 ifTrue:[ |
|
7051 |
ch := $- |
|
7052 |
] ifFalse:[ |
|
7053 |
ch := access |
|
7054 |
]. |
|
7055 |
modeString := modeString copyWith:ch |
|
7056 |
] |
|
3906 | 7057 |
]. |
7058 |
^ modeString |
|
7059 |
! ! |
|
7060 |
||
5880 | 7061 |
!AbstractFileBrowser methodsFor:'private'! |
7062 |
||
7063 |
theSingleSelectedDirectoryOrHomeDir |
|
7064 |
|dir| |
|
7065 |
||
5888 | 7066 |
dir := self theSingleSelectedDirectoryOrNil. |
5880 | 7067 |
dir isNil ifTrue:[ dir := Filename homeDirectory]. |
7068 |
^ dir. |
|
7069 |
! |
|
7070 |
||
7071 |
theSingleSelectedDirectoryOrNil |
|
7072 |
|dirs| |
|
7073 |
||
7074 |
dirs := self currentSelectedDirectories. |
|
7075 |
dirs size ~= 1 ifTrue:[ ^ nil]. |
|
7076 |
^ dirs anElement. |
|
7077 |
! ! |
|
7078 |
||
3892 | 7079 |
!AbstractFileBrowser methodsFor:'queries'! |
7080 |
||
8256 | 7081 |
cBrowserLoaded |
7082 |
^ CBrowser::Browser notNil |
|
7083 |
! |
|
7084 |
||
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
7085 |
getAllFilesAsStrings |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
7086 |
"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
|
7087 |
|
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
7088 |
^ self subclassResponsibility |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
7089 |
! |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
7090 |
|
3906 | 7091 |
getFileInfoStringForFirstSelectedFile:longInfo |
7092 |
"get stat info on selected file - return a string which can be |
|
7093 |
shown in a box" |
|
7094 |
||
5973
0baf6c6b685f
#linkInfo now returns the info also for files that are not a symlink
Stefan Vogel <sv@exept.de>
parents:
5971
diff
changeset
|
7095 |
|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
|
7096 |
sizeString fileSize tAccess tModification buffer| |
3906 | 7097 |
|
7560 | 7098 |
selFiles := self currentSelectedObjects. |
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
7099 |
selFiles size ~~ 1 ifTrue:[ ^ nil]. |
3906 | 7100 |
filename := selFiles first. |
7101 |
||
8364 | 7102 |
info := filename linkInfo. |
9111
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
7103 |
info isNil ifTrue:[ |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
7104 |
^ 'Cannot get fileInfo'. |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
7105 |
^ nil |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
7106 |
]. |
8364 | 7107 |
|
5755
5e8165d55605
replaced '' writeStream by String writeStream
Claus Gittinger <cg@exept.de>
parents:
5753
diff
changeset
|
7108 |
buffer := Text writeStream. |
4765 | 7109 |
|
7110 |
buffer |
|
7111 |
nextPutAll:'filename: '; |
|
7112 |
nextPutLine:filename asString. |
|
7113 |
||
8364 | 7114 |
OperatingSystem isMSDOSlike ifTrue: [ |
7115 |
(info alternativeName notNil |
|
7116 |
and:[ info alternativeName ~= info fullName ]) ifTrue:[ |
|
7117 |
buffer nextPutAll:'shortname: '. |
|
7118 |
buffer nextPutLine:info alternativeName. |
|
7119 |
] |
|
7120 |
]. |
|
7121 |
||
5360
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
7122 |
buffer nextPutAll:'type: '. |
5973
0baf6c6b685f
#linkInfo now returns the info also for files that are not a symlink
Stefan Vogel <sv@exept.de>
parents:
5971
diff
changeset
|
7123 |
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
|
7124 |
filename exists ifFalse:[ |
5360
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
7125 |
buffer nextPutAll:'broken '. |
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
7126 |
]. |
4765 | 7127 |
buffer |
7128 |
nextPutAll:'symbolic link to: '; |
|
7633
0a85c590f98f
ignore nil-return from get link name (for broken links)
Claus Gittinger <cg@exept.de>
parents:
7585
diff
changeset
|
7129 |
nextPutLine:(info path ? '???'). |
3906 | 7130 |
] 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
|
7131 |
(longInfo and:[info isRegular]) ifTrue:[ |
5360
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
7132 |
fileOutput := filename fileType. |
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
7133 |
]. |
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
7134 |
|
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
7135 |
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
|
7136 |
s := info type asString |
5360
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
7137 |
] ifFalse:[ |
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
7138 |
s := 'regular (' , fileOutput , ')' |
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
7139 |
]. |
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
7140 |
buffer nextPutLine:s. |
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
7141 |
]. |
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
7142 |
|
4707
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
7143 |
fileSize := info fileSize. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
7144 |
sizeString := 'size: ', fileSize printString. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
7145 |
longInfo ifTrue:[ |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
7146 |
fileSize > 1024 ifTrue:[ |
8172 | 7147 |
sizeString := sizeString,' (',(UnitConverter fileSizeStringFor:fileSize),')'. |
4707
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
7148 |
]. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
7149 |
]. |
4765 | 7150 |
buffer nextPutLine:sizeString. |
3906 | 7151 |
|
7152 |
modeBits := info mode. |
|
7153 |
modeString := self getModeString:modeBits. |
|
4765 | 7154 |
|
7155 |
buffer nextPutAll:'access: '; nextPutAll:modeString. |
|
3906 | 7156 |
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
|
7157 |
buffer nextPutAll:' ('; nextPutAll:(modeBits printStringRadix:8); nextPut:$). |
3906 | 7158 |
]. |
4765 | 7159 |
buffer |
7160 |
cr; |
|
7161 |
nextPutAll:'owner: '; |
|
7162 |
nextPutLine:(OperatingSystem getUserNameFromID:(info uid)). |
|
7163 |
||
3906 | 7164 |
longInfo ifTrue:[ |
4765 | 7165 |
buffer |
7166 |
nextPutAll:'group: '; |
|
7167 |
nextPutLine:(OperatingSystem getGroupNameFromID:(info gid)). |
|
7168 |
||
7169 |
tAccess := info accessTime. |
|
7170 |
buffer |
|
7171 |
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
|
7172 |
nextPutAll:tAccess asDate printString; |
4765 | 7173 |
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
|
7174 |
nextPutLine:tAccess asTime printString. |
4765 | 7175 |
|
7176 |
tModification := info modificationTime. |
|
7177 |
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
|
7178 |
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
|
7179 |
nextPutAll:tModification asDate printString; |
4765 | 7180 |
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
|
7181 |
nextPutLine:tModification asTime printString. |
3906 | 7182 |
]. |
4765 | 7183 |
^ buffer contents |
7560 | 7184 |
|
7633
0a85c590f98f
ignore nil-return from get link name (for broken links)
Claus Gittinger <cg@exept.de>
parents:
7585
diff
changeset
|
7185 |
"Modified: / 07-02-2007 / 10:38:14 / cg" |
3906 | 7186 |
! |
7187 |
||
8510 | 7188 |
hasImageColorHistogram |
7189 |
^ ImageColorHistogram notNil |
|
7190 |
! |
|
7191 |
||
3892 | 7192 |
initialCommandFor:fileName into:aBox |
7193 |
"set a useful initial command for execute box." |
|
7194 |
||
4496
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
7195 |
self class initialCommandFor:fileName in:Filename currentDirectory intoBox:aBox |
3892 | 7196 |
! |
7197 |
||
7198 |
isAbstractFileBrowser |
|
7199 |
||
7200 |
^ true |
|
7201 |
! |
|
7202 |
||
7203 |
systemIsDOS |
|
7204 |
||
7205 |
^ OperatingSystem isMSDOSlike |
|
7206 |
! |
|
7207 |
||
7208 |
systemIsUnix |
|
7209 |
^ OperatingSystem isUNIXlike |
|
7210 |
! ! |
|
7211 |
||
7212 |
!AbstractFileBrowser methodsFor:'queries-file'! |
|
7213 |
||
7214 |
allItemsOfCurrentDirectory |
|
5009 | 7215 |
self |
4774 | 7216 |
applicationNamed:#DirectoryContentsBrowser |
5009 | 7217 |
ifPresentDo:[:app | ^ app allItemsOfCurrentDirectory]. |
7218 |
||
7219 |
^ nil |
|
3892 | 7220 |
! |
7221 |
||
7222 |
anyFilesPresentWithSuffix:suffix |
|
6725 | 7223 |
self currentSelectedDirectories do:[:dir| |
4636
08b2b63e3107
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4629
diff
changeset
|
7224 |
[ |
5810
4661bf4c3bbf
openErrorSignal arg: always a string
Claus Gittinger <cg@exept.de>
parents:
5789
diff
changeset
|
7225 |
(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
|
7226 |
] on:FileStream openErrorSignal do:[:ex|]. |
3892 | 7227 |
]. |
7228 |
^ false. |
|
7229 |
! |
|
7230 |
||
4771
9290fdb65a5d
#getCommonForCurrentFiles renamed to #commonPrefixOfSelectedFiles
Claus Gittinger <cg@exept.de>
parents:
4769
diff
changeset
|
7231 |
commonPrefixOfSelectedFiles |
4773 | 7232 |
|selFiles stringCol firstPre| |
4771
9290fdb65a5d
#getCommonForCurrentFiles renamed to #commonPrefixOfSelectedFiles
Claus Gittinger <cg@exept.de>
parents:
4769
diff
changeset
|
7233 |
|
7560 | 7234 |
selFiles := self currentSelectedObjects. |
4771
9290fdb65a5d
#getCommonForCurrentFiles renamed to #commonPrefixOfSelectedFiles
Claus Gittinger <cg@exept.de>
parents:
4769
diff
changeset
|
7235 |
selFiles isEmpty ifTrue:[^ nil]. |
9290fdb65a5d
#getCommonForCurrentFiles renamed to #commonPrefixOfSelectedFiles
Claus Gittinger <cg@exept.de>
parents:
4769
diff
changeset
|
7236 |
|
4772 | 7237 |
stringCol := selFiles collect:[:file | file asString]. |
4773 | 7238 |
firstPre := stringCol at:1. |
4771
9290fdb65a5d
#getCommonForCurrentFiles renamed to #commonPrefixOfSelectedFiles
Claus Gittinger <cg@exept.de>
parents:
4769
diff
changeset
|
7239 |
stringCol from:2 do:[:el| |
4773 | 7240 |
firstPre := firstPre commonPrefixWith:el. |
4771
9290fdb65a5d
#getCommonForCurrentFiles renamed to #commonPrefixOfSelectedFiles
Claus Gittinger <cg@exept.de>
parents:
4769
diff
changeset
|
7241 |
]. |
4773 | 7242 |
^ firstPre asFilename |
7560 | 7243 |
|
7244 |
"Modified: / 04-12-2006 / 13:14:25 / cg" |
|
4771
9290fdb65a5d
#getCommonForCurrentFiles renamed to #commonPrefixOfSelectedFiles
Claus Gittinger <cg@exept.de>
parents:
4769
diff
changeset
|
7245 |
! |
9290fdb65a5d
#getCommonForCurrentFiles renamed to #commonPrefixOfSelectedFiles
Claus Gittinger <cg@exept.de>
parents:
4769
diff
changeset
|
7246 |
|
3892 | 7247 |
currentFilesAreInSameDirectory |
7248 |
||
4881
e6fc72aac6e6
multiple select allowed in DirectoryTreeBrowser some changes in DirectoryContentsBrowser
penk
parents:
4880
diff
changeset
|
7249 |
^ self parentDirectoriesOfCurrentFiles size < 2 |
3892 | 7250 |
! |
7251 |
||
7252 |
currentFilesHasDirectories |
|
7253 |
||
6725 | 7254 |
^ self currentSelectedDirectories notEmpty. |
3892 | 7255 |
! |
7256 |
||
3982 | 7257 |
directoriesForFiles:aFileCol |
7258 |
||
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
7259 |
^ (aFileCol collect:[:file| self getDirWithoutFileName:file]) asSet. |
3982 | 7260 |
! |
7261 |
||
3892 | 7262 |
fileListIsEmpty |
5009 | 7263 |
self |
7264 |
applicationNamed:#DirectoryContentsBrowser |
|
7265 |
ifPresentDo:[:appl | ^ appl fileListIsEmpty]. |
|
7266 |
||
7267 |
^ nil. |
|
3892 | 7268 |
! |
7269 |
||
7270 |
fileListIsNotEmpty |
|
7271 |
||
7272 |
^ self fileListIsEmpty not. |
|
7273 |
! |
|
7274 |
||
7275 |
fileName:aFilename1 startsWith:aFilename2 |
|
6284 | 7276 |
" check if aFilename2 is a prefix of aFilename1" |
3892 | 7277 |
|
7278 |
| file1 file2 | |
|
7279 |
||
6284 | 7280 |
(aFilename2 isNil or:[aFilename1 isNil]) ifTrue:[ ^ false]. |
3892 | 7281 |
file1 := aFilename1 asFilename. |
7282 |
file2 := aFilename2 asFilename. |
|
6284 | 7283 |
|
3892 | 7284 |
file2 isRootDirectory ifTrue:[ ^ true]. |
6284 | 7285 |
|
3892 | 7286 |
((file1 isDirectory) |
7287 |
and:[(file2 isDirectory) |
|
7288 |
and:[file1 directory = file2 directory]]) ifTrue:[ |
|
4414 | 7289 |
^ file1 baseName = file2 baseName |
3892 | 7290 |
]. |
3982 | 7291 |
^ (file1 pathName) startsWith:(file2 pathName) |
3892 | 7292 |
! |
7293 |
||
7294 |
getAllFilesAsStringCollection |
|
5009 | 7295 |
self |
7296 |
applicationNamed:#DirectoryContentsBrowser |
|
7297 |
ifPresentDo:[:appl | ^ appl getAllFilesAsStringCollection]. |
|
7298 |
||
7299 |
^ nil |
|
3892 | 7300 |
! |
7301 |
||
7302 |
getBestDirectory |
|
7303 |
||
7304 |
|selFiles stringCol firstPre| |
|
7305 |
||
6725 | 7306 |
selFiles := self currentSelectedDirectories. |
3892 | 7307 |
selFiles isEmpty ifTrue:[^ nil]. |
7308 |
selFiles size == 1 ifTrue:[^ selFiles first]. |
|
4486 | 7309 |
stringCol := (selFiles collect:[:file| file asString]) asOrderedCollection. |
3892 | 7310 |
firstPre := stringCol at:1. |
7311 |
stringCol from:2 do:[:el| |
|
4414 | 7312 |
firstPre := firstPre commonPrefixWith:el. |
3892 | 7313 |
]. |
7314 |
(firstPre endsWith:(OperatingSystem fileSeparator)) ifTrue:[ |
|
4414 | 7315 |
firstPre removeLast. |
3892 | 7316 |
]. |
7317 |
^ firstPre asFilename |
|
7318 |
! |
|
7319 |
||
7320 |
getDirWithoutFileName:aFileName |
|
7321 |
||
7322 |
| dir | |
|
7323 |
aFileName isNil ifTrue:[ |
|
4414 | 7324 |
^ aFileName. |
3892 | 7325 |
]. |
7326 |
dir := aFileName asFilename. |
|
7327 |
dir isDirectory ifFalse:[ |
|
4414 | 7328 |
dir := dir directory. |
3892 | 7329 |
]. |
7330 |
^ dir. |
|
7331 |
! |
|
7332 |
||
7333 |
getInfoItem |
|
7334 |
"get filename of a description-file (.dir.info, README etc.); |
|
7335 |
This file is automatically shown when a directory is enterred. |
|
7336 |
You can add more names below if you like." |
|
7337 |
||
5880 | 7338 |
|dir| |
7339 |
||
7340 |
dir := self theSingleSelectedDirectoryOrNil. |
|
7341 |
dir isNil ifTrue:[ ^ nil]. |
|
3892 | 7342 |
|
7343 |
#( |
|
7344 |
'.dir.info' |
|
7345 |
'README' |
|
7346 |
'ReadMe' |
|
7347 |
'Readme' |
|
7348 |
'readme' |
|
7349 |
'read.me' |
|
7350 |
'Read.me' |
|
7351 |
'READ.ME' |
|
7352 |
'README.TXT' |
|
7353 |
'readme.txt' |
|
7354 |
'Readme.txt' |
|
7355 |
'Info.txt' |
|
7356 |
'info.txt' |
|
7357 |
'INFO.TXT' |
|
7358 |
) do:[:f | |
|
5883 | 7359 |
|n| |
4414 | 7360 |
|
5880 | 7361 |
n := dir construct:f. |
4414 | 7362 |
(n isReadable and:[n isDirectory not]) ifTrue:[ |
7363 |
^ DirectoryContentsBrowser itemClass fileName:n |
|
7364 |
] |
|
3892 | 7365 |
]. |
7366 |
^ nil |
|
4881
e6fc72aac6e6
multiple select allowed in DirectoryTreeBrowser some changes in DirectoryContentsBrowser
penk
parents:
4880
diff
changeset
|
7367 |
! |
e6fc72aac6e6
multiple select allowed in DirectoryTreeBrowser some changes in DirectoryContentsBrowser
penk
parents:
4880
diff
changeset
|
7368 |
|
e6fc72aac6e6
multiple select allowed in DirectoryTreeBrowser some changes in DirectoryContentsBrowser
penk
parents:
4880
diff
changeset
|
7369 |
parentDirectoriesOfCurrentFiles |
e6fc72aac6e6
multiple select allowed in DirectoryTreeBrowser some changes in DirectoryContentsBrowser
penk
parents:
4880
diff
changeset
|
7370 |
|
8251
9fd0533be7d9
changed #parentDirectoriesOfCurrentFiles
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
7371 |
^ (self currentSelectedObjects |
8253 | 7372 |
collect:[:file | file directory]) asSet |
7560 | 7373 |
|
7374 |
"Modified: / 04-12-2006 / 13:15:21 / cg" |
|
6521 | 7375 |
! |
7376 |
||
7377 |
recursiveAnyFilesPresentWithSuffix:suffix |
|
6652 | 7378 |
^ true. "/ the code below is too slow for a menu enabling operation |
7379 |
||
7380 |
"/ |directories| |
|
7381 |
"/ |
|
7382 |
"/ directories := self currentDirectories value. |
|
7383 |
"/ directories do:[:dir| |
|
7384 |
"/ [ |
|
7385 |
"/ dir recursiveDirectoryContentsDo:[:f | |
|
7386 |
"/ (f asFilename suffix = suffix) ifTrue:[ ^ true] |
|
7387 |
"/ ] |
|
7388 |
"/ ] on:FileStream openErrorSignal do:[:ex|]. |
|
7389 |
"/ ]. |
|
7390 |
"/ ^ false. |
|
6586 | 7391 |
! |
7392 |
||
7393 |
recursiveAnySTFilesPresent |
|
7394 |
^ self recursiveAnyFilesPresentWithSuffix:'st' |
|
3982 | 7395 |
! ! |
7396 |
||
7397 |
!AbstractFileBrowser methodsFor:'selection'! |
|
7398 |
||
7399 |
currentSelectedDirectories |
|
6725 | 7400 |
^ self currentDirectoriesValue. |
3982 | 7401 |
! |
7402 |
||
7403 |
currentSelectedFiles |
|
7560 | 7404 |
^ self currentSelectedObjects select:[:file | file isDirectory not]. |
7405 |
||
7406 |
"Modified: / 04-12-2006 / 13:14:39 / cg" |
|
3982 | 7407 |
! |
7408 |
||
6460 | 7409 |
currentSelectedObjects |
7410 |
^ self currentFileNameHolder value |
|
7411 |
! |
|
7412 |
||
3982 | 7413 |
firstSelectedFile |
7560 | 7414 |
^ self currentSelectedObjects |
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
7415 |
detect:[:file | file asFilename isDirectory not] |
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
7416 |
ifNone:[]. |
7560 | 7417 |
|
7418 |
"Modified: / 04-12-2006 / 13:14:50 / cg" |
|
4414 | 7419 |
! |
7420 |
||
7421 |
hasOnlyFilesSelected |
|
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
7422 |
|
7560 | 7423 |
^ self currentSelectedObjects conform:[:file | file isDirectory not]. |
7424 |
||
7425 |
"Modified: / 04-12-2006 / 13:15:01 / cg" |
|
4414 | 7426 |
! |
7427 |
||
7428 |
hasTwoFilesSelected |
|
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
7429 |
|
7560 | 7430 |
^ self currentSelectedObjects size == 2 |
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
7431 |
and:[self hasOnlyFilesSelected] |
7560 | 7432 |
|
7433 |
"Modified: / 04-12-2006 / 13:15:04 / cg" |
|
3892 | 7434 |
! ! |
7435 |
||
3964 | 7436 |
!AbstractFileBrowser methodsFor:'sorting'! |
7437 |
||
3989 | 7438 |
currentSortOrder |
4027 | 7439 |
^ self aspectFor:#currentSortOrder ifAbsent:[ Dictionary new asValue ]. |
3989 | 7440 |
! |
7441 |
||
7442 |
sortBlockHolder |
|
7443 |
^ self aspectFor:#sortBlockHolder ifAbsent:[ |
|
5383 | 7444 |
(FileSorter directoriesBeforeFiles:(self sortDirectoriesBeforeFiles value and:[self viewDirsInContentsBrowser value]) |
7445 |
selector:#fileName |
|
7446 |
sortCaseless:self sortCaseless value |
|
7447 |
sortReverse:false) asValue. |
|
3989 | 7448 |
]. |
7449 |
! |
|
7450 |
||
7451 |
sortBlockProperty |
|
6785
cac8107d889c
clear reverseSort flag, when sort-order is changed via menu.
Claus Gittinger <cg@exept.de>
parents:
6767
diff
changeset
|
7452 |
|v| |
4027 | 7453 |
|
6785
cac8107d889c
clear reverseSort flag, when sort-order is changed via menu.
Claus Gittinger <cg@exept.de>
parents:
6767
diff
changeset
|
7454 |
v := self aspectFor:#sortBlockProperty ifAbsent:[ #baseName asValue ]. |
cac8107d889c
clear reverseSort flag, when sort-order is changed via menu.
Claus Gittinger <cg@exept.de>
parents:
6767
diff
changeset
|
7455 |
v addDependent:self. |
cac8107d889c
clear reverseSort flag, when sort-order is changed via menu.
Claus Gittinger <cg@exept.de>
parents:
6767
diff
changeset
|
7456 |
^ v. |
3989 | 7457 |
! |
7458 |
||
7459 |
sortCaseless |
|
4201 | 7460 |
" aspect for sort caseless " |
3989 | 7461 |
|
7462 |
^ self aspectFor:#sortCaseless ifAbsent:[ |
|
4201 | 7463 |
| holder | |
7464 |
holder := (Filename isCaseSensitive not) asValue. |
|
7465 |
holder |
|
3989 | 7466 |
] |
7467 |
! |
|
7468 |
||
4074 | 7469 |
sortDirectoriesBeforeFiles |
7470 |
||
4201 | 7471 |
" aspect for sort directories always before files" |
4074 | 7472 |
^ self aspectFor:#sortDirectoriesBeforeFiles ifAbsent:[ true asValue ]. |
7473 |
! |
|
7474 |
||
3989 | 7475 |
sortFileListsBy:instanceName |
7476 |
||
7477 |
self sortFileListsBy:instanceName withReverse:true |
|
7478 |
! |
|
7479 |
||
7480 |
sortFileListsBy:instanceName withReverse:aBoolean |
|
8994
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
7481 |
| aSymbol sortCaselessLocal currentSortOrder sorter isReverse| |
3964 | 7482 |
|
7483 |
aSymbol := instanceName asSymbol. |
|
4027 | 7484 |
self sortBlockProperty setValue:instanceName asSymbol. |
4151 | 7485 |
sortCaselessLocal := self sortCaseless value. |
4027 | 7486 |
currentSortOrder := self currentSortOrder value. |
7841
ea9a45f1cd5e
oops - repair bad currentSorter
Claus Gittinger <cg@exept.de>
parents:
7829
diff
changeset
|
7487 |
currentSortOrder isEmptyOrNil ifTrue:[ |
ea9a45f1cd5e
oops - repair bad currentSorter
Claus Gittinger <cg@exept.de>
parents:
7829
diff
changeset
|
7488 |
self currentSortOrder value:(currentSortOrder := Dictionary new). |
4343 | 7489 |
currentSortOrder at:#column put:aSymbol. |
7490 |
currentSortOrder at:#reverse put:false. |
|
7491 |
currentSortOrder at:#sortCaseless put:sortCaselessLocal. |
|
3964 | 7492 |
] ifFalse:[ |
4343 | 7493 |
(currentSortOrder at:#sortCaseless) ~= sortCaselessLocal ifTrue:[ |
7494 |
"/ sort caseless changed |
|
7495 |
currentSortOrder at:#sortCaseless put:sortCaselessLocal. |
|
7496 |
] ifFalse:[ |
|
7497 |
(currentSortOrder at:#column) = aSymbol ifTrue:[ |
|
7498 |
"/ same column like before - change sort order ifReverse is true |
|
7499 |
aBoolean ifTrue:[ |
|
7500 |
isReverse := currentSortOrder at:#reverse. |
|
7501 |
currentSortOrder at:#reverse put:(isReverse not). |
|
7502 |
]. |
|
7503 |
] ifFalse:[ |
|
7504 |
"/ another column - remark column |
|
7505 |
currentSortOrder at:#column put:aSymbol. |
|
7506 |
] |
|
7507 |
] |
|
3964 | 7508 |
]. |
4027 | 7509 |
self currentSortOrder changed. |
9111
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
7510 |
|
5383 | 7511 |
sorter := FileSorter directoriesBeforeFiles:(self sortDirectoriesBeforeFiles value and:[self viewDirsInContentsBrowser value]) |
7512 |
selector:instanceName |
|
7513 |
sortCaseless:sortCaselessLocal |
|
7514 |
sortReverse:(currentSortOrder at:#reverse). |
|
7515 |
self sortBlockHolder value:sorter. |
|
7841
ea9a45f1cd5e
oops - repair bad currentSorter
Claus Gittinger <cg@exept.de>
parents:
7829
diff
changeset
|
7516 |
|
ea9a45f1cd5e
oops - repair bad currentSorter
Claus Gittinger <cg@exept.de>
parents:
7829
diff
changeset
|
7517 |
"Modified: / 18-09-2007 / 09:42:47 / cg" |
3964 | 7518 |
! ! |
7519 |
||
3892 | 7520 |
!AbstractFileBrowser methodsFor:'startup & release'! |
7521 |
||
7522 |
makeDependent |
|
4074 | 7523 |
self filterModel addDependent:self. |
4004 | 7524 |
self currentFileNameHolder addDependent:self. |
4074 | 7525 |
self sortDirectoriesBeforeFiles addDependent:self. |
4004 | 7526 |
self sortCaseless addDependent:self. |
4011 | 7527 |
self showHiddenFiles addDependent:self. |
4368
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
7528 |
self rootHolder addDependent:self. |
3892 | 7529 |
! |
7530 |
||
7531 |
masterApplication:anApplication |
|
7532 |
||
7533 |
masterApplication isNil ifTrue:[ |
|
4414 | 7534 |
(anApplication notNil and:[anApplication askFor:#isAbstractFileBrowser]) ifTrue:[ |
7535 |
aspects := anApplication aspects |
|
7536 |
] ifFalse:[ |
|
7537 |
aspects isNil ifTrue:[ |
|
7538 |
aspects := IdentityDictionary new. |
|
7539 |
aspects at:#applications put:(IdentityDictionary new). |
|
7540 |
] |
|
7541 |
]. |
|
7542 |
self applications at:(self className) put:self. |
|
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
7543 |
"/ self makeDependent. |
3892 | 7544 |
]. |
3952 | 7545 |
^ super masterApplication:anApplication. |
3892 | 7546 |
! |
7547 |
||
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
7548 |
postBuildWith:aBuilder |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
7549 |
self makeDependent. |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
7550 |
super postBuildWith:aBuilder. |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
7551 |
! |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
7552 |
|
3892 | 7553 |
postOpenWith:aBuilder |
7554 |
||
7555 |
super postOpenWith:aBuilder. |
|
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
7556 |
self windowGroup showWaitCursorWhenBusyForMillis:100. |
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
7557 |
|
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
7558 |
"Modified: / 25-07-2006 / 09:12:45 / cg" |
3892 | 7559 |
! ! |
7560 |
||
7561 |
!AbstractFileBrowser::Clipboard methodsFor:'accessing'! |
|
7562 |
||
7563 |
files |
|
7564 |
"return the value of the instance variable 'files' (automatically generated)" |
|
7565 |
||
7566 |
^ files |
|
7567 |
! |
|
7568 |
||
7569 |
files:something |
|
7570 |
"set the value of the instance variable 'files' (automatically generated)" |
|
7571 |
||
7572 |
files := something. |
|
7573 |
! |
|
7574 |
||
7575 |
method |
|
7576 |
"return the value of the instance variable 'method' (automatically generated)" |
|
7577 |
||
7578 |
^ method |
|
7579 |
! |
|
7580 |
||
7581 |
method:something |
|
7582 |
"set the value of the instance variable 'method' (automatically generated)" |
|
7583 |
||
7584 |
method := something. |
|
7585 |
! ! |
|
7586 |
||
7587 |
!AbstractFileBrowser::CodeExecutionLock methodsFor:'accessing'! |
|
7588 |
||
7589 |
locked |
|
7590 |
"return the value of the instance variable 'locked' (automatically generated)" |
|
7591 |
||
7592 |
locked isNil ifTrue:[ |
|
4414 | 7593 |
locked := false. |
3892 | 7594 |
]. |
7595 |
^ locked |
|
7596 |
! ! |
|
7597 |
||
7598 |
!AbstractFileBrowser::CodeExecutionLock methodsFor:'actions'! |
|
7599 |
||
7600 |
doIfUnLocked:aBlock |
|
7601 |
||
7602 |
self locked ifFalse:[ |
|
4414 | 7603 |
aBlock value. |
3892 | 7604 |
]. |
7605 |
! |
|
7606 |
||
7607 |
doLocked:aBlock |
|
7608 |
||
7609 |
locked := true. |
|
4004 | 7610 |
aBlock ensure:[ |
4414 | 7611 |
locked := false. |
4004 | 7612 |
] |
3892 | 7613 |
! ! |
7614 |
||
3952 | 7615 |
!AbstractFileBrowser::DirectoryHistory class methodsFor:'defaults'! |
7616 |
||
6369 | 7617 |
defaultHistorySize |
7618 |
^ 50 |
|
3892 | 7619 |
! ! |
7620 |
||
6371 | 7621 |
!AbstractFileBrowser::DirectoryHistory class methodsFor:'instance creation'! |
4032 | 7622 |
|
7623 |
new |
|
6371 | 7624 |
^ (super new) initializeHistory. |
6369 | 7625 |
! ! |
7626 |
||
7627 |
!AbstractFileBrowser::DirectoryHistory methodsFor:'accessing'! |
|
7628 |
||
7629 |
historySize |
|
7630 |
historySize isNil ifTrue:[^ self class defaultHistorySize]. |
|
7631 |
^ historySize |
|
7632 |
! |
|
7633 |
||
7634 |
historySize:aNumber |
|
7635 |
historySize := aNumber |
|
4032 | 7636 |
! ! |
7637 |
||
3892 | 7638 |
!AbstractFileBrowser::DirectoryHistory methodsFor:'actions'! |
7639 |
||
3952 | 7640 |
addToHistory:aPath |
7566
3e92cf7a6706
ignore trailing file-separator in history.
Claus Gittinger <cg@exept.de>
parents:
7565
diff
changeset
|
7641 |
| item pathToAdd | |
3e92cf7a6706
ignore trailing file-separator in history.
Claus Gittinger <cg@exept.de>
parents:
7565
diff
changeset
|
7642 |
|
3e92cf7a6706
ignore trailing file-separator in history.
Claus Gittinger <cg@exept.de>
parents:
7565
diff
changeset
|
7643 |
pathToAdd := aPath. |
3e92cf7a6706
ignore trailing file-separator in history.
Claus Gittinger <cg@exept.de>
parents:
7565
diff
changeset
|
7644 |
(pathToAdd endsWith:(Filename separator)) ifTrue:[ |
3e92cf7a6706
ignore trailing file-separator in history.
Claus Gittinger <cg@exept.de>
parents:
7565
diff
changeset
|
7645 |
pathToAdd asFilename isRootDirectory ifFalse:[ |
3e92cf7a6706
ignore trailing file-separator in history.
Claus Gittinger <cg@exept.de>
parents:
7565
diff
changeset
|
7646 |
pathToAdd := pathToAdd copyWithoutLast:(Filename separator asString size). |
3e92cf7a6706
ignore trailing file-separator in history.
Claus Gittinger <cg@exept.de>
parents:
7565
diff
changeset
|
7647 |
] |
3e92cf7a6706
ignore trailing file-separator in history.
Claus Gittinger <cg@exept.de>
parents:
7565
diff
changeset
|
7648 |
]. |
3e92cf7a6706
ignore trailing file-separator in history.
Claus Gittinger <cg@exept.de>
parents:
7565
diff
changeset
|
7649 |
|
3e92cf7a6706
ignore trailing file-separator in history.
Claus Gittinger <cg@exept.de>
parents:
7565
diff
changeset
|
7650 |
item := self getItemFor:pathToAdd. |
3e92cf7a6706
ignore trailing file-separator in history.
Claus Gittinger <cg@exept.de>
parents:
7565
diff
changeset
|
7651 |
self backForwardListAdd:pathToAdd. |
3952 | 7652 |
item isNil ifTrue:[ |
4347 | 7653 |
" not already in history" |
6369 | 7654 |
self size >= self historySize ifTrue:[ |
4347 | 7655 |
self removeLast. |
7656 |
]. |
|
7566
3e92cf7a6706
ignore trailing file-separator in history.
Claus Gittinger <cg@exept.de>
parents:
7565
diff
changeset
|
7657 |
item := DirectoryHistoryItem path:pathToAdd. |
4347 | 7658 |
self addFirst:item |
3952 | 7659 |
] ifFalse:[ |
4347 | 7660 |
"already been there before; move the entry to |
7661 |
the beginning, so it will fall out later." |
|
7662 |
self remove:item. |
|
7663 |
self addFirst:item |
|
3892 | 7664 |
]. |
7566
3e92cf7a6706
ignore trailing file-separator in history.
Claus Gittinger <cg@exept.de>
parents:
7565
diff
changeset
|
7665 |
|
3e92cf7a6706
ignore trailing file-separator in history.
Claus Gittinger <cg@exept.de>
parents:
7565
diff
changeset
|
7666 |
"Modified: / 06-12-2006 / 11:59:50 / cg" |
3952 | 7667 |
! |
7668 |
||
4347 | 7669 |
backForwardListAdd:aPath |
7670 |
|pathIndex| |
|
7671 |
||
7672 |
pathIndex := backForwardList indexOf:aPath. |
|
7673 |
pathIndex == 0 ifTrue:[ |
|
7674 |
" a new path comes in remove forward paths " |
|
7675 |
(backForwardList size) > backForwardIndex ifTrue:[ |
|
7676 |
backForwardList removeFromIndex:(backForwardIndex + 1) toIndex:(backForwardList size). |
|
7677 |
]. |
|
7678 |
] ifFalse:[ |
|
7679 |
backForwardList remove:aPath. |
|
7680 |
pathIndex <= backForwardIndex ifTrue:[ |
|
7681 |
backForwardIndex := backForwardIndex - 1. |
|
7682 |
] |
|
4022 | 7683 |
]. |
4347 | 7684 |
backForwardList add:aPath afterIndex:backForwardIndex. |
7685 |
backForwardIndex := backForwardIndex + 1. |
|
6369 | 7686 |
backForwardIndex > self historySize ifTrue:[ |
4347 | 7687 |
backForwardList removeFirst. |
7688 |
backForwardIndex := backForwardIndex - 1. |
|
3892 | 7689 |
]. |
4347 | 7690 |
! |
7691 |
||
7692 |
goBackward |
|
4288 | 7693 |
"return the first path of the backward list; |
7694 |
remove it from the back list and add it ti the forward list." |
|
4022 | 7695 |
|
4347 | 7696 |
|retPath| |
7697 |
||
7698 |
self canBackward ifTrue:[ |
|
7699 |
retPath := backForwardList at:(backForwardIndex - 1). |
|
7700 |
backForwardIndex := backForwardIndex - 1. |
|
4288 | 7701 |
]. |
4022 | 7702 |
^ retPath. |
7703 |
! |
|
7704 |
||
7705 |
goForward |
|
4288 | 7706 |
"return the first path of the forward list; |
7707 |
remove it from the list." |
|
4022 | 7708 |
|
4347 | 7709 |
|retPath| |
7710 |
||
7711 |
self canForward ifTrue:[ |
|
7712 |
retPath := backForwardList at:backForwardIndex + 1. |
|
7713 |
backForwardIndex := backForwardIndex + 1. |
|
4288 | 7714 |
]. |
4022 | 7715 |
^ retPath. |
7716 |
! |
|
7717 |
||
7718 |
resetForwardBackward |
|
7719 |
||
4347 | 7720 |
self initialize |
4022 | 7721 |
! |
7722 |
||
7723 |
setPosition:aPosition for:aPath |
|
7724 |
||
7725 |
self do:[:item| |
|
4414 | 7726 |
item path = aPath ifTrue:[ |
7727 |
item position:aPosition. |
|
7728 |
] |
|
4022 | 7729 |
]. |
3892 | 7730 |
! ! |
7731 |
||
4870 | 7732 |
!AbstractFileBrowser::DirectoryHistory methodsFor:'initialization'! |
4032 | 7733 |
|
6371 | 7734 |
initializeHistory |
4032 | 7735 |
|
4347 | 7736 |
backForwardList := OrderedCollection new. |
7737 |
self reverseDo:[:el| |
|
7738 |
backForwardList add:el path. |
|
7739 |
]. |
|
7740 |
backForwardIndex := backForwardList size. |
|
4032 | 7741 |
! ! |
7742 |
||
3892 | 7743 |
!AbstractFileBrowser::DirectoryHistory methodsFor:'queries'! |
7744 |
||
4288 | 7745 |
canBackward |
4347 | 7746 |
|
7747 |
^ backForwardIndex > 1 |
|
4288 | 7748 |
! |
7749 |
||
3892 | 7750 |
canForward |
4347 | 7751 |
|
7752 |
^ (backForwardList size >= (backForwardIndex + 1)) |
|
7753 |
! |
|
7754 |
||
7755 |
getBackCollection |
|
7756 |
||
7757 |
| backCol | |
|
7758 |
||
7759 |
backCol := OrderedCollection new. |
|
7760 |
self canBackward ifTrue:[ |
|
7761 |
| tmpCol | |
|
7762 |
tmpCol := backForwardList copyTo:backForwardIndex - 1. |
|
7763 |
tmpCol reverseDo:[ :el| |
|
7764 |
backCol add:el. |
|
7765 |
] |
|
7766 |
]. |
|
7767 |
^ backCol |
|
3952 | 7768 |
! |
7769 |
||
7770 |
getForwardCollection |
|
7771 |
||
4347 | 7772 |
| forwCol | |
7773 |
||
7774 |
forwCol := OrderedCollection new. |
|
7775 |
self canForward ifTrue:[ |
|
7776 |
forwCol := backForwardList copyFrom:(backForwardIndex + 1) |
|
7777 |
]. |
|
7778 |
^ forwCol |
|
3952 | 7779 |
! |
7780 |
||
7781 |
getItemFor:aPath |
|
6627 | 7782 |
^ self detect:[:item| item path = aPath] ifNone:nil. |
7783 |
"/ self do:[:item| item path = aPath ifTrue:[^ item]]. |
|
7784 |
"/ ^ nil. |
|
3952 | 7785 |
! |
7786 |
||
7787 |
getPositionFor:aPath |
|
7788 |
||
7789 |
|item| |
|
7790 |
||
7791 |
item := self getItemFor:aPath. |
|
7792 |
||
7793 |
item notNil ifTrue:[ |
|
4414 | 7794 |
^ item position. |
3952 | 7795 |
]. |
7796 |
^ nil |
|
7797 |
! |
|
7798 |
||
7799 |
includesPath:aPath |
|
6627 | 7800 |
^ self contains:[:item | item path = aPath]. |
7801 |
||
7802 |
"/ self do:[:item| item path = aPath ifTrue:[^ true]]. |
|
7803 |
"/ ^ false. |
|
4347 | 7804 |
! |
7805 |
||
7806 |
nextBackwardItem |
|
7807 |
"return the first path of the backward list" |
|
7808 |
||
7809 |
|retPath| |
|
7810 |
||
7811 |
self canBackward ifTrue:[ |
|
7812 |
retPath := backForwardList at:backForwardIndex. |
|
7813 |
]. |
|
7814 |
^ retPath. |
|
7815 |
! |
|
7816 |
||
7817 |
nextForwardItem |
|
7818 |
"return the first path of the forward list" |
|
7819 |
||
7820 |
|retPath| |
|
7821 |
||
7822 |
self canForward ifTrue:[ |
|
7823 |
retPath := backForwardList at:backForwardIndex + 1. |
|
7824 |
]. |
|
7825 |
^ retPath. |
|
3952 | 7826 |
! ! |
7827 |
||
7828 |
!AbstractFileBrowser::DirectoryHistory::DirectoryHistoryItem class methodsFor:'instance creation'! |
|
7829 |
||
7830 |
path:aPath |
|
7831 |
||
7832 |
^ self new path:aPath |
|
7833 |
! ! |
|
7834 |
||
7835 |
!AbstractFileBrowser::DirectoryHistory::DirectoryHistoryItem methodsFor:'accessing'! |
|
7836 |
||
6433 | 7837 |
asFilename |
7838 |
^ path asFilename |
|
7839 |
! |
|
7840 |
||
3952 | 7841 |
path |
7842 |
"return the value of the instance variable 'path' (automatically generated)" |
|
7843 |
||
7844 |
^ path |
|
7845 |
! |
|
7846 |
||
7847 |
path:something |
|
7848 |
"set the value of the instance variable 'path' (automatically generated)" |
|
7849 |
||
7850 |
path := something. |
|
7851 |
! |
|
7852 |
||
7853 |
position |
|
7854 |
"return the value of the instance variable 'position' (automatically generated)" |
|
7855 |
||
7856 |
^ position |
|
7857 |
! |
|
7858 |
||
7859 |
position:something |
|
7860 |
"set the value of the instance variable 'position' (automatically generated)" |
|
7861 |
||
7862 |
position := something. |
|
7863 |
! |
|
7864 |
||
7865 |
printString |
|
7866 |
||
7867 |
^ self path asString |
|
3892 | 7868 |
! ! |
7869 |
||
4915 | 7870 |
!AbstractFileBrowser::FilenameHistory class methodsFor:'accessing-attributes'! |
3892 | 7871 |
|
4337
f2eed806e854
change first letter uppercase methods on class side to lowercase ones
penk
parents:
4317
diff
changeset
|
7872 |
filenameHistorySize |
3892 | 7873 |
|
7874 |
^ 20 |
|
7875 |
! ! |
|
7876 |
||
7877 |
!AbstractFileBrowser::FilenameHistory methodsFor:'adding & removing'! |
|
7878 |
||
5242
04616d3a672c
history fixed (only kept the oldest items, instead of the newest ones)
Claus Gittinger <cg@exept.de>
parents:
5162
diff
changeset
|
7879 |
add:aFileItem |
04616d3a672c
history fixed (only kept the oldest items, instead of the newest ones)
Claus Gittinger <cg@exept.de>
parents:
5162
diff
changeset
|
7880 |
(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
|
7881 |
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
|
7882 |
]. |
04616d3a672c
history fixed (only kept the oldest items, instead of the newest ones)
Claus Gittinger <cg@exept.de>
parents:
5162
diff
changeset
|
7883 |
self addFirst:aFileItem. |
3892 | 7884 |
! ! |
7885 |
||
7886 |
!AbstractFileBrowser::SaveAspectItem class methodsFor:'instance creation'! |
|
7887 |
||
7888 |
withValue:aValue isHolder:aBoolean |
|
7889 |
||
7890 |
| instance | |
|
7891 |
||
7892 |
instance := self basicNew. |
|
7893 |
instance value:aValue. |
|
7894 |
instance isHolder:aBoolean. |
|
7895 |
^ instance |
|
7896 |
! ! |
|
7897 |
||
7898 |
!AbstractFileBrowser::SaveAspectItem methodsFor:'accessing'! |
|
7899 |
||
7900 |
isHolder |
|
7901 |
"return the value of the instance variable 'isHolder' (automatically generated)" |
|
7902 |
||
7903 |
^ isHolder |
|
7904 |
! |
|
7905 |
||
7906 |
isHolder:something |
|
7907 |
"set the value of the instance variable 'isHolder' (automatically generated)" |
|
7908 |
||
7909 |
isHolder := something. |
|
7910 |
! |
|
7911 |
||
7912 |
value |
|
7913 |
"return the value of the instance variable 'value' (automatically generated)" |
|
7914 |
||
7915 |
^ value |
|
7916 |
! |
|
7917 |
||
7918 |
value:something |
|
7919 |
"set the value of the instance variable 'value' (automatically generated)" |
|
7920 |
||
7921 |
value := something. |
|
7922 |
! ! |
|
7923 |
||
7924 |
!AbstractFileBrowser class methodsFor:'documentation'! |
|
7925 |
||
7926 |
version |
|
9206 | 7927 |
^ '$Header: /cvs/stx/stx/libtool/AbstractFileBrowser.st,v 1.426 2009-11-06 11:15:29 cg Exp $' |
8832 | 7928 |
! |
7929 |
||
7930 |
version_CVS |
|
9206 | 7931 |
^ '$Header: /cvs/stx/stx/libtool/AbstractFileBrowser.st,v 1.426 2009-11-06 11:15:29 cg Exp $' |
3892 | 7932 |
! ! |