author | Claus Gittinger <cg@exept.de> |
Sat, 27 Nov 2010 15:43:11 +0100 | |
changeset 9649 | ad956ada348e |
parent 9607 | 63f0d2689895 |
child 9674 | 3c3c1ef9974b |
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 |
|
9607 | 254 |
requestFileNameForSave:(self resources string:'Save Bookmarks') |
4679 | 255 |
default:(self defaultBookMarksFilename) |
256 |
fromDirectory:(self defaultBookMarksFileDirectory). |
|
257 |
fn isEmptyOrNil ifTrue:[^ self]. |
|
258 |
||
259 |
self saveBookmarksIn:fn |
|
9607 | 260 |
|
261 |
"Modified: / 27-10-2010 / 11:27:09 / cg" |
|
4679 | 262 |
! |
263 |
||
8013 | 264 |
saveBookmarks: bookmarks in:aFileNameOrString |
6114
36fb19194510
Rename Base64Coder>>#decodingOf: to #decode:
Stefan Vogel <sv@exept.de>
parents:
6113
diff
changeset
|
265 |
"save the bokmarks in aFileNameOrString. |
36fb19194510
Rename Base64Coder>>#decodingOf: to #decode:
Stefan Vogel <sv@exept.de>
parents:
6113
diff
changeset
|
266 |
Use Base64 coding" |
36fb19194510
Rename Base64Coder>>#decodingOf: to #decode:
Stefan Vogel <sv@exept.de>
parents:
6113
diff
changeset
|
267 |
|
8013 | 268 |
| bookmarkStream fileName coder| |
4679 | 269 |
|
270 |
fileName := aFileNameOrString asFilename. |
|
271 |
fileName exists ifTrue:[ |
|
272 |
fileName renameTo:(fileName withSuffix:'sav'). |
|
273 |
]. |
|
6114
36fb19194510
Rename Base64Coder>>#decodingOf: to #decode:
Stefan Vogel <sv@exept.de>
parents:
6113
diff
changeset
|
274 |
bookmarkStream := fileName writeStream. |
36fb19194510
Rename Base64Coder>>#decodingOf: to #decode:
Stefan Vogel <sv@exept.de>
parents:
6113
diff
changeset
|
275 |
|
36fb19194510
Rename Base64Coder>>#decodingOf: to #decode:
Stefan Vogel <sv@exept.de>
parents:
6113
diff
changeset
|
276 |
"save each bookmark in one line" |
36fb19194510
Rename Base64Coder>>#decodingOf: to #decode:
Stefan Vogel <sv@exept.de>
parents:
6113
diff
changeset
|
277 |
coder := (Base64Coder on:bookmarkStream) lineLimit:nil. |
4679 | 278 |
bookmarks do:[:eachPath | |
6114
36fb19194510
Rename Base64Coder>>#decodingOf: to #decode:
Stefan Vogel <sv@exept.de>
parents:
6113
diff
changeset
|
279 |
eachPath asFilename pathName acceptVisitor:coder. |
36fb19194510
Rename Base64Coder>>#decodingOf: to #decode:
Stefan Vogel <sv@exept.de>
parents:
6113
diff
changeset
|
280 |
coder flush. |
36fb19194510
Rename Base64Coder>>#decodingOf: to #decode:
Stefan Vogel <sv@exept.de>
parents:
6113
diff
changeset
|
281 |
bookmarkStream cr. |
36fb19194510
Rename Base64Coder>>#decodingOf: to #decode:
Stefan Vogel <sv@exept.de>
parents:
6113
diff
changeset
|
282 |
]. |
36fb19194510
Rename Base64Coder>>#decodingOf: to #decode:
Stefan Vogel <sv@exept.de>
parents:
6113
diff
changeset
|
283 |
bookmarkStream close. |
5960 | 284 |
! |
285 |
||
8013 | 286 |
saveBookmarksIn:aFileNameOrString |
287 |
"save the bokmarks in aFileNameOrString. |
|
288 |
Use Base64 coding" |
|
289 |
||
290 |
| bookmarks | |
|
291 |
||
292 |
bookmarks := self directoryBookmarks. |
|
293 |
self saveBookmarks: bookmarks in:aFileNameOrString |
|
294 |
! |
|
295 |
||
5960 | 296 |
saveBookmarksInDefaultBookmarksFile |
297 |
self saveBookmarksIn:(self defaultBookMarksFileDirectory construct:self defaultBookMarksFilename) |
|
4672
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
298 |
! ! |
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
299 |
|
4915 | 300 |
!AbstractFileBrowser class methodsFor:'accessing-classes'! |
4672
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 |
directoryHistoryClass |
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 |
^ AbstractFileBrowser::DirectoryHistory |
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
305 |
! |
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 |
filenameHistoryClass |
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 |
^ FilenameHistory |
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
310 |
! ! |
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
311 |
|
3892 | 312 |
!AbstractFileBrowser class methodsFor:'defaults'! |
313 |
||
314 |
commandHistory |
|
315 |
||
316 |
CommandHistory isNil ifTrue:[ |
|
4414 | 317 |
CommandHistory := OrderedCollection new. |
3892 | 318 |
]. |
319 |
^ CommandHistory |
|
320 |
! |
|
321 |
||
322 |
commandHistorySize |
|
4190 | 323 |
"max no of entries in the HistoryList " |
6369 | 324 |
|
3892 | 325 |
CommandHistorySize isNil ifTrue:[ |
6369 | 326 |
CommandHistorySize := 150 |
3892 | 327 |
]. |
328 |
^ CommandHistorySize |
|
329 |
! |
|
330 |
||
331 |
defaultFilterList |
|
332 |
||
333 |
DefaultFilters isNil ifTrue:[ |
|
4414 | 334 |
DefaultFilters := #( '*' |
335 |
'*.st' |
|
336 |
'*.htm*' |
|
337 |
'*.txt' |
|
338 |
'*.gif' |
|
339 |
'*.xpm' |
|
340 |
'*.jpg' |
|
341 |
'*.[h,c]*' |
|
342 |
) |
|
3892 | 343 |
]. |
344 |
^ DefaultFilters. |
|
345 |
! |
|
346 |
||
4496
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
347 |
initialCommandFor:fileName in:aDirectory intoBox:aBox |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
348 |
"set a useful initial command in an execute box." |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
349 |
|
4523 | 350 |
|mime cmd select path suffix baseName pathName| |
4496
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
351 |
|
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
352 |
path := aDirectory filenameFor:fileName. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
353 |
baseName := path baseName. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
354 |
suffix := path suffix. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
355 |
|
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
356 |
mime := MIMETypes mimeTypeForSuffix:suffix. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
357 |
"/ mime notNil ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
358 |
"/ cmd := self initialCommandForMIME:mime file:path |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
359 |
"/ ]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
360 |
|
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
361 |
"/ 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
|
362 |
"/ XXX or from resources. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
363 |
|
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
364 |
(path type == #regular) ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
365 |
path isExecutableProgram ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
366 |
aBox initialText:(path pathName , ' <arguments>'). |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
367 |
^ self |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
368 |
]. |
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 |
select := true. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
371 |
|
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
372 |
"some heuristics - my personal preferences ... |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
373 |
(actually this should come from a configfile)" |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
374 |
|
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
375 |
(baseName endsWith:'akefile') ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
376 |
aBox initialText:'make target' selectFrom:6 to:11. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
377 |
^ self |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
378 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
379 |
|
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
380 |
cmd := MIMETypes defaultCommandPerMIME at:mime ifAbsent:nil. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
381 |
cmd notNil ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
382 |
select := false |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
383 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
384 |
|
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
385 |
cmd isNil ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
386 |
suffix := path suffix. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
387 |
(suffix = 'C') ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
388 |
cmd := 'g++ -c %1'. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
389 |
select := 6. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
390 |
] ifFalse:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
391 |
suffix := suffix asLowercase. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
392 |
|
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
393 |
(suffix = 'taz') ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
394 |
aBox initialText:'zcat %1 | tar tvf -'. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
395 |
select := false. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
396 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
397 |
(suffix = 'tar') ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
398 |
cmd := 'tar tvf %1'. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
399 |
select := 7. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
400 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
401 |
(suffix = 'zoo') ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
402 |
cmd := 'zoo -list %1'. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
403 |
select := 9. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
404 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
405 |
(suffix = 'zip') ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
406 |
cmd := 'unzip -l %1'. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
407 |
select := 8. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
408 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
409 |
(suffix = 'jar') ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
410 |
cmd := 'unzip -l %1'. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
411 |
select := 8. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
412 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
413 |
(suffix = 'z') ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
414 |
(baseName asLowercase endsWith:'tar.z') ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
415 |
cmd := 'zcat %1 | tar tvf -'. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
416 |
select := false. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
417 |
] ifFalse:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
418 |
cmd := 'uncompress %1' |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
419 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
420 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
421 |
(suffix = 'gz') ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
422 |
(baseName asLowercase endsWith:'tar.gz') ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
423 |
cmd := ('gunzip < %1 | tar tvf -' ). |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
424 |
select := false. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
425 |
] ifFalse:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
426 |
cmd := 'gunzip %1'. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
427 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
428 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
429 |
(suffix = 'html') ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
430 |
cmd := 'netscape %1' |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
431 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
432 |
(suffix = 'htm') ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
433 |
cmd := 'netscape %1' |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
434 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
435 |
(suffix = 'uue') ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
436 |
cmd := 'uudecode %1' |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
437 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
438 |
(suffix = 'c') ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
439 |
cmd := 'cc -c %1'. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
440 |
select := 5. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
441 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
442 |
(suffix = 'cc') ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
443 |
cmd := 'g++ -c %1'. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
444 |
select := 6. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
445 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
446 |
(suffix = 'xbm') ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
447 |
cmd := 'bitmap %1' |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
448 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
449 |
(suffix = 'ps') ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
450 |
cmd := 'ghostview %1' |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
451 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
452 |
((suffix = '1') or:[suffix = 'man']) ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
453 |
cmd := 'nroff -man %1'. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
454 |
select := 10. |
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 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
458 |
|
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
459 |
cmd isNil ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
460 |
DefaultCommandPerSuffix isNil ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
461 |
cmd := '<cmd>' |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
462 |
] ifFalse:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
463 |
cmd := DefaultCommandPerSuffix |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
464 |
at:suffix |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
465 |
ifAbsent:'<cmd>'. |
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 |
cmd := cmd , ' %1'. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
468 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
469 |
|
4523 | 470 |
pathName := path pathName. |
471 |
OperatingSystem isUNIXlike ifTrue:[ |
|
472 |
pathName includesSeparator ifTrue:[ |
|
473 |
pathName := '"' , pathName , '"' |
|
474 |
] |
|
475 |
]. |
|
476 |
||
477 |
cmd := cmd bindWith:pathName. |
|
4496
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
478 |
select == false ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
479 |
aBox initialText:cmd |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
480 |
] ifFalse:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
481 |
select class == Interval ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
482 |
aBox initialText:cmd selectFrom:select start to:select stop |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
483 |
] ifFalse:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
484 |
select isInteger ifFalse:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
485 |
select := (cmd indexOf:Character space ifAbsent:[cmd size + 1]) - 1. |
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 |
aBox initialText:cmd selectFrom:1 to:select |
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 |
] |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
491 |
|
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
492 |
"Modified: / 24.9.1997 / 16:34:52 / stefan" |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
493 |
"Modified: / 9.4.1998 / 17:15:57 / cg" |
3892 | 494 |
! |
495 |
||
5941 | 496 |
listOfRuntimeValuesToRemember |
497 |
" list of all aspects that will be remembered after closing a FileBrowserV2" |
|
498 |
||
499 |
^ #( |
|
500 |
"/ #filterModel |
|
501 |
#enableFileHistory |
|
502 |
#fileHistory |
|
503 |
#currentSortOrder |
|
504 |
#sortBlockProperty |
|
505 |
) |
|
3892 | 506 |
! |
507 |
||
508 |
resetAspects |
|
509 |
||
510 |
RuntimeAspects := nil. |
|
511 |
||
5941 | 512 |
" |
513 |
self resetAspects |
|
514 |
" |
|
3892 | 515 |
! |
516 |
||
517 |
runtimeAspects |
|
518 |
||
519 |
RuntimeAspects isNil ifTrue:[ |
|
4414 | 520 |
RuntimeAspects := Dictionary new. |
3892 | 521 |
]. |
522 |
^ RuntimeAspects |
|
523 |
! |
|
524 |
||
4201 | 525 |
userPreferencesAspectList |
526 |
" list of all aspects that will be saved with save settings |
|
527 |
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
|
528 |
dont forget to add a access methos in UserPreferences if you add a aspect here |
4201 | 529 |
" |
530 |
||
7078
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
531 |
^ Dictionary |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
532 |
withKeysAndValues:#( |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
533 |
viewDirsInContentsBrowser true |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
534 |
showDirectoryTree true |
9119
77cc26a119cf
changed: #userPreferencesAspectList
Claus Gittinger <cg@exept.de>
parents:
9118
diff
changeset
|
535 |
showHiddenFiles false |
7078
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
536 |
viewDescription false |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
537 |
viewDetails true |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
538 |
viewDirectoryDescription false |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
539 |
viewFilesInDirectoryTree false |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
540 |
viewGroup false |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
541 |
viewOwner false |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
542 |
viewPermissions false |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
543 |
viewPreview false |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
544 |
viewSize true |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
545 |
viewSizeInKiloBytes false |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
546 |
viewSizeInBytes false |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
547 |
viewTime true |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
548 |
viewType false |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
549 |
openMultipleApplicationsForType false |
7788 | 550 |
filenameEntryFieldVisibleHolder true |
551 |
toolBarVisibleHolder true |
|
7078
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
552 |
sortDirectoriesBeforeFiles true |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
553 |
openAlwaysInTextEditor false |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
554 |
sortCaseless false |
4201 | 555 |
) |
7078
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
556 |
|
7788 | 557 |
"Modified: / 03-04-2007 / 08:47:45 / cg" |
3892 | 558 |
! ! |
559 |
||
5398 | 560 |
!AbstractFileBrowser class methodsFor:'help specs'! |
561 |
||
8261 | 562 |
basicFlyByHelpSpec |
6099 | 563 |
<resource: #help> |
564 |
||
8261 | 565 |
^ super flyByHelpSpec addPairsFrom:#( |
6099 | 566 |
|
6100 | 567 |
#closeTabButton |
568 |
'Close this Tab' |
|
569 |
||
6099 | 570 |
#addTerminal |
571 |
'Shell Terminal' |
|
572 |
||
573 |
#make |
|
574 |
'Make' |
|
575 |
||
576 |
#searchFile |
|
577 |
'Search a File' |
|
578 |
||
579 |
#directoryUp |
|
580 |
'Directory Up' |
|
581 |
||
582 |
#directoryBack |
|
583 |
'Directory Back' |
|
584 |
||
585 |
#directoryForward |
|
586 |
'Directory Forward' |
|
587 |
||
588 |
#directoryHistory |
|
589 |
'Directory' |
|
590 |
||
591 |
#copyFile |
|
6146 | 592 |
'Copy the Selected File(s)' |
6099 | 593 |
|
594 |
#cutFile |
|
6146 | 595 |
'Cut the Selected File(s)' |
6099 | 596 |
|
597 |
#editFile |
|
6146 | 598 |
'Edit the Selected File' |
6099 | 599 |
|
600 |
#fileHome |
|
601 |
'Goto Home Directory' |
|
602 |
||
8093 | 603 |
#fileDesktop |
604 |
'Goto Desktop Directory' |
|
605 |
||
6099 | 606 |
#fileGotoDefault |
607 |
'Goto Default Directory (ST/X Start Directory)' |
|
608 |
||
6454 | 609 |
#fileGotoSmalltalkDirectory |
610 |
'Goto Smalltalk Directory (ST/X Application)' |
|
611 |
||
6456 | 612 |
#fileGotoDefaultDirectory |
613 |
'Goto Current Directory' |
|
614 |
||
6099 | 615 |
#pasteFile |
616 |
'Paste File(s)' |
|
617 |
||
618 |
#deleteFile |
|
6146 | 619 |
'Delete the Selected File(s)' |
6099 | 620 |
|
621 |
#fileIn |
|
622 |
'File In' |
|
623 |
||
624 |
#fileHistory |
|
625 |
'File History' |
|
626 |
||
627 |
#fileGotoBookmark |
|
628 |
'Goto Bookmarked Directory' |
|
629 |
||
630 |
#hideToolBar |
|
631 |
'Hide Toolbar' |
|
632 |
||
633 |
#hideFilenameEntryField |
|
6307 | 634 |
'Hide Filename & Filter Fields' |
6099 | 635 |
|
636 |
#openChangeBrowser |
|
637 |
'Open a ChangeBrowser on File' |
|
638 |
||
639 |
#showFileDetails |
|
640 |
'Show File Details' |
|
641 |
||
642 |
#hideFileDetails |
|
643 |
'Hide File Details' |
|
644 |
||
645 |
#toggleDetails |
|
646 |
'Show/Hide File Details' |
|
647 |
||
648 |
#viewDetails |
|
649 |
'Show/Hide File Details' |
|
650 |
||
651 |
#selectDetails |
|
652 |
'Select File Details to be Shown' |
|
653 |
||
8088 | 654 |
#showDifferences |
655 |
'Show Differences between File and Editor Versions' |
|
656 |
||
657 |
#toggleHexDisplay |
|
658 |
'Toggle between Hexadecimal and Textual Representation' |
|
659 |
||
660 |
#findInBrowser |
|
661 |
'Navigate the Browsers File List to the Edited File' |
|
662 |
||
663 |
#saveFile |
|
664 |
'Save the Editor''s Contents into the File' |
|
665 |
||
666 |
#reloadFile |
|
667 |
'Reload from the File' |
|
668 |
||
669 |
||
670 |
'Send to the Printer' |
|
671 |
||
6099 | 672 |
). |
673 |
||
8261 | 674 |
" |
675 |
self flyByHelpSpec |
|
676 |
" |
|
677 |
||
678 |
"Modified: / 03-11-2007 / 12:05:01 / cg" |
|
679 |
! |
|
680 |
||
681 |
flyByHelpSpec |
|
682 |
<resource: #programHelp> |
|
683 |
||
684 |
|spec hist resources| |
|
685 |
||
686 |
spec := self basicFlyByHelpSpec. |
|
687 |
||
688 |
"/ add help items for the history |
|
6099 | 689 |
hist := self directoryHistory. |
690 |
hist notNil ifTrue:[ |
|
691 |
resources := self classResources. |
|
692 |
hist canForward ifTrue:[ |
|
7879
9c64dea1b14a
block as a flyByHelpText item.
Claus Gittinger <cg@exept.de>
parents:
7869
diff
changeset
|
693 |
spec at:#directoryForward put:[ resources string:'Forward to: %1' with:hist nextForwardItem ]. |
6099 | 694 |
]. |
695 |
hist canBackward ifTrue:[ |
|
7879
9c64dea1b14a
block as a flyByHelpText item.
Claus Gittinger <cg@exept.de>
parents:
7869
diff
changeset
|
696 |
spec at:#directoryBack put:[ resources string:'Back to: %1' with:hist nextBackwardItem ]. |
6099 | 697 |
]. |
698 |
]. |
|
699 |
^ spec. |
|
700 |
||
701 |
" |
|
702 |
self flyByHelpSpec |
|
703 |
" |
|
704 |
||
7879
9c64dea1b14a
block as a flyByHelpText item.
Claus Gittinger <cg@exept.de>
parents:
7869
diff
changeset
|
705 |
"Modified: / 03-11-2007 / 12:05:01 / cg" |
6099 | 706 |
! |
707 |
||
5398 | 708 |
helpSpec |
709 |
"This resource specification was automatically generated |
|
710 |
by the UIHelpTool of ST/X." |
|
711 |
||
712 |
"Do not manually edit this!! If it is corrupted, |
|
713 |
the UIHelpTool may not be able to read the specification." |
|
714 |
||
715 |
" |
|
716 |
UIHelpTool openOnClass:AbstractFileBrowser |
|
717 |
" |
|
718 |
||
719 |
<resource: #help> |
|
720 |
||
721 |
^ super helpSpec addPairsFrom:#( |
|
722 |
||
5737 | 723 |
#lockFileEncoding |
724 |
'Do not guess the encoding from the files contents.' |
|
725 |
||
5398 | 726 |
) |
727 |
! ! |
|
728 |
||
8994
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
729 |
!AbstractFileBrowser class methodsFor:'image specs'! |
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
730 |
|
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
731 |
clearHistoryIcon |
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
732 |
<resource: #programImage> |
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 |
^ Icon deleteIcon |
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
735 |
! |
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
736 |
|
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
737 |
copyIcon |
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
738 |
<resource: #programImage> |
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 |
^ ToolbarIconLibrary copyIcon |
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
741 |
! |
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
742 |
|
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
743 |
cutIcon |
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
744 |
<resource: #programImage> |
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 |
^ ToolbarIconLibrary cut20x20Icon2 "cut28x28Icon" |
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
747 |
! |
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
748 |
|
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
749 |
deleteIcon |
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
750 |
<resource: #programImage> |
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 |
^ ToolbarIconLibrary erase20x20Icon "/ delete28x28Icon |
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
753 |
! |
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
754 |
|
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
755 |
directoryUpIcon |
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
756 |
<resource: #programImage> |
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
757 |
|
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
758 |
^ ToolbarIconLibrary directoryUpIcon |
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
759 |
! |
3892 | 760 |
|
6337 | 761 |
disabledCursorIcon |
762 |
"This resource specification was automatically generated |
|
763 |
by the ImageEditor of ST/X." |
|
764 |
||
765 |
"Do not manually edit this!! If it is corrupted, |
|
766 |
the ImageEditor may not be able to read the specification." |
|
767 |
||
768 |
" |
|
769 |
self disabledCursorImage inspect |
|
770 |
ImageEditor openOnClass:self andSelector:#disabledCursorImage |
|
771 |
Icon flushCachedIcons |
|
772 |
" |
|
773 |
||
774 |
<resource: #image> |
|
775 |
||
776 |
^Icon |
|
8473 | 777 |
constantNamed:#'AbstractFileBrowser class disabledCursorIcon' |
6337 | 778 |
ifAbsentPut:[(Depth1Image new) width: 32; height: 32; photometric:(#palette); bitsPerSample:(#[1]); samplesPerPixel:(1); bits:(ByteArray fromPackedString:' |
779 |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@_ @@@XF@@@H@P@@DOB@@BLLP@AA@"@@RHD @H1AD@BRHI@@$QBP@IBH$@BPQI@@"BLP@D QH@ADBB@@H0Q@@AC |
|
780 |
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:' |
|
781 |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@_ @@@_>@@@O?0@@G?>@@C<O0@A?@>@@_8G @O?A<@C38O@@<_C0@OC8<@C0_O@@>C?0@G _8@A<C>@@O0_@@A? |
|
782 |
? @@O?0@@A?8@@@G8@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@b') ; yourself); yourself] |
|
783 |
! |
|
784 |
||
4337
f2eed806e854
change first letter uppercase methods on class side to lowercase ones
penk
parents:
4317
diff
changeset
|
785 |
disabledCursorImage |
6337 | 786 |
"/ DisabledCursorImage isNil ifTrue:[ |
787 |
"/ DisabledCursorImage := self disabledCursorIcon. "/ Image fromFile:'xpmBitmaps/cursors/no_entry.xpm' |
|
788 |
"/ ]. |
|
3892 | 789 |
^ DisabledCursorImage |
790 |
! |
|
791 |
||
6337 | 792 |
enabledCursorIcon |
793 |
"This resource specification was automatically generated |
|
794 |
by the ImageEditor of ST/X." |
|
795 |
||
796 |
"Do not manually edit this!! If it is corrupted, |
|
797 |
the ImageEditor may not be able to read the specification." |
|
798 |
||
799 |
" |
|
800 |
self enabledCursorImage inspect |
|
801 |
ImageEditor openOnClass:self andSelector:#enabledCursorImage |
|
802 |
Icon flushCachedIcons |
|
803 |
" |
|
804 |
||
805 |
<resource: #image> |
|
806 |
||
807 |
^Icon |
|
8473 | 808 |
constantNamed:#'AbstractFileBrowser class enabledCursorIcon' |
6337 | 809 |
ifAbsentPut:[(Depth1Image new) width: 32; height: 32; photometric:(#palette); bitsPerSample:(#[1]); samplesPerPixel:(1); bits:(ByteArray fromPackedString:' |
810 |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@E@@@@AP@@@@T@@@@E@@@@AP@@@@T@@@@E@@@@AP@@@@@@@@?0_0@@@@@@C?A?@@@@@@@@AP@@@@T@@@@E@@@@A |
|
811 |
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:' |
|
812 |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@G@@@@A0@@@@\@@@@G@@@@A0@@@@\@@@@G@@@@A0@@@@\@@@?8?0@O>O<@C?#?@@@G@@@@A0@@@@\@@@@G@@@@A |
|
813 |
0@@@@\@@@@G@@@@A0@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@b') ; yourself); yourself] |
|
814 |
! |
|
815 |
||
4337
f2eed806e854
change first letter uppercase methods on class side to lowercase ones
penk
parents:
4317
diff
changeset
|
816 |
enabledCursorImage |
6337 | 817 |
"/ EnabledCursorImage isNil ifTrue:[ |
818 |
"/ EnabledCursorImage := self enabledCursorIcon. "/ Image fromFile:'xpmBitmaps/cursors/double_crossHair.xpm' |
|
819 |
"/ ]. |
|
3892 | 820 |
^ EnabledCursorImage |
6083 | 821 |
! |
822 |
||
3892 | 823 |
fileInIcon |
824 |
<resource: #programImage> |
|
825 |
||
6116 | 826 |
^ ToolbarIconLibrary fileInIcon |
3892 | 827 |
! |
828 |
||
6079 | 829 |
historyBackIcon |
830 |
<resource: #programImage> |
|
831 |
||
832 |
^ ToolbarIconLibrary historyBackIcon |
|
833 |
! |
|
834 |
||
835 |
historyForwardIcon |
|
836 |
<resource: #programImage> |
|
837 |
||
838 |
^ ToolbarIconLibrary historyForwardIcon |
|
839 |
! |
|
840 |
||
3892 | 841 |
homeIcon |
842 |
<resource: #programImage> |
|
843 |
||
6079 | 844 |
^ ToolbarIconLibrary homeIcon |
3892 | 845 |
! |
846 |
||
6074 | 847 |
homeIcon2 |
6079 | 848 |
<resource: #programImage> |
849 |
||
850 |
^ ToolbarIconLibrary homeIcon2 |
|
6074 | 851 |
! |
852 |
||
853 |
htmlReloadIcon |
|
854 |
<resource: #programImage> |
|
855 |
||
856 |
^ ToolbarIconLibrary reload22x22Icon |
|
857 |
! |
|
858 |
||
3892 | 859 |
leftDownIcon |
860 |
"This resource specification was automatically generated |
|
861 |
by the ImageEditor of ST/X." |
|
862 |
||
863 |
"Do not manually edit this!! If it is corrupted, |
|
864 |
the ImageEditor may not be able to read the specification." |
|
865 |
||
866 |
" |
|
867 |
self leftDownIcon inspect |
|
868 |
ImageEditor openOnClass:self andSelector:#leftDownIcon |
|
869 |
" |
|
870 |
||
871 |
<resource: #image> |
|
872 |
||
873 |
^Icon |
|
4414 | 874 |
constantNamed:#'AbstractFileBrowser class leftDownIcon' |
875 |
ifAbsentPut:[(Depth2Image new) width: 28; height: 28; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:' |
|
3892 | 876 |
UUUUUUUUUUUPAUUUUUUUP@UUUUUUUPB!!UUUUUU@B*AUUUUU@B*(UUUUUPB** UUUUPB***AUUUTB***(EUUUB****%UUUR*****UUUUU@*%UUUUUUPJ)UUUU |
877 |
UUTB*UUUUUUU@*%UUUUUUPJ)UUUUUUTB*UUUUUUU@*%UUUUUUPJ)UUUUUUTB*UUUUUUU@*$@@@@AUPJ*****)UTB******UU@******%UPJ*****)UTAUUUU |
|
878 |
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:' |
|
879 |
@@@@@@@@@@@@ @@@@\@@@@O @@@G<@@@C? @@A?<@@@?? @@_?<@@G?? @@C<@@@@?@@@@O0@@@C<@@@@?@@@@O0@@@C<@@@@?@@@@O0@@@C??? @???8@O? |
|
880 |
?>@C??? @???8@O??>@@@@@@@@@@@@@a') ; yourself); yourself] |
|
881 |
! |
|
882 |
||
883 |
menuHistoryList9x20Icon |
|
884 |
"This resource specification was automatically generated |
|
885 |
by the ImageEditor of ST/X." |
|
886 |
||
887 |
"Do not manually edit this!! If it is corrupted, |
|
888 |
the ImageEditor may not be able to read the specification." |
|
889 |
||
890 |
" |
|
891 |
self menuHistoryList9x20Icon inspect |
|
892 |
ImageEditor openOnClass:self andSelector:#menuHistoryList9x20Icon |
|
893 |
Icon flushCachedIcons |
|
894 |
" |
|
895 |
||
896 |
<resource: #image> |
|
897 |
||
898 |
^Icon |
|
4414 | 899 |
constantNamed:#'AbstractFileBrowser class menuHistoryList9x20Icon' |
900 |
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 | 901 |
! |
902 |
||
903 |
menuHistoryListIcon |
|
904 |
"This resource specification was automatically generated |
|
905 |
by the ImageEditor of ST/X." |
|
906 |
||
907 |
"Do not manually edit this!! If it is corrupted, |
|
908 |
the ImageEditor may not be able to read the specification." |
|
909 |
||
910 |
" |
|
911 |
self menuHistoryListIcon inspect |
|
912 |
ImageEditor openOnClass:self andSelector:#menuHistoryListIcon |
|
913 |
" |
|
914 |
||
915 |
<resource: #image> |
|
916 |
||
917 |
^Icon |
|
4414 | 918 |
constantNamed:#'AbstractFileBrowser class menuHistoryListIcon' |
919 |
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 | 920 |
! |
921 |
||
6087 | 922 |
newDirectoryIcon |
6074 | 923 |
<resource: #programImage> |
924 |
||
6087 | 925 |
^ ToolbarIconLibrary newDirectoryIcon |
3923 | 926 |
! |
927 |
||
6091 | 928 |
removeTabIcon |
929 |
<resource: #programImage> |
|
930 |
||
931 |
^ ToolbarIconLibrary removeTabIcon |
|
932 |
! |
|
933 |
||
3892 | 934 |
vt100Terminal |
935 |
<resource: #programImage> |
|
936 |
||
937 |
^ ToolbarIconLibrary shell20x20Icon |
|
938 |
! ! |
|
939 |
||
5528 | 940 |
!AbstractFileBrowser class methodsFor:'interface specs'! |
941 |
||
942 |
encodingDialogSpec |
|
943 |
"This resource specification was automatically generated |
|
944 |
by the UIPainter of ST/X." |
|
945 |
||
946 |
"Do not manually edit this!! If it is corrupted, |
|
947 |
the UIPainter may not be able to read the specification." |
|
948 |
||
949 |
" |
|
950 |
UIPainter new openOnClass:AbstractFileBrowser andSelector:#encodingDialogSpec |
|
951 |
AbstractFileBrowser new openInterface:#encodingDialogSpec |
|
952 |
" |
|
953 |
||
954 |
<resource: #canvas> |
|
955 |
||
956 |
^ |
|
957 |
#(FullSpec |
|
958 |
name: encodingDialogSpec |
|
959 |
window: |
|
960 |
(WindowSpec |
|
961 |
label: 'File Encoding' |
|
962 |
name: 'File Encoding' |
|
963 |
min: (Point 10 10) |
|
5626 | 964 |
bounds: (Rectangle 0 0 379 590) |
5528 | 965 |
) |
966 |
component: |
|
967 |
(SpecCollection |
|
968 |
collection: ( |
|
969 |
(LabelSpec |
|
6339 | 970 |
label: 'Select the External (File-) Encoding' |
6236 | 971 |
name: 'Label1' |
5528 | 972 |
layout: (LayoutFrame 0 0 0 0 0 1 30 0) |
973 |
translateLabel: true |
|
974 |
adjust: left |
|
975 |
) |
|
976 |
(DataSetSpec |
|
977 |
name: 'Table1' |
|
5737 | 978 |
layout: (LayoutFrame 0 0 30 0 0 1 -60 1) |
5528 | 979 |
model: selectedEncoding |
980 |
hasHorizontalScrollBar: true |
|
981 |
hasVerticalScrollBar: true |
|
982 |
dataList: encodingList |
|
983 |
has3Dsepartors: true |
|
984 |
has3Dseparators: true |
|
985 |
columns: |
|
986 |
(OrderedCollection |
|
987 |
||
988 |
(DataSetColumnSpec |
|
989 |
label: 'Encoding' |
|
990 |
translateLabel: true |
|
991 |
labelButtonType: Button |
|
992 |
model: at: |
|
993 |
canSelect: false |
|
994 |
isResizeable: false |
|
995 |
showRowSeparator: false |
|
996 |
showColSeparator: false |
|
997 |
) |
|
998 |
(DataSetColumnSpec |
|
999 |
label: 'Description' |
|
1000 |
translateLabel: true |
|
1001 |
labelButtonType: Button |
|
1002 |
model: at: |
|
1003 |
canSelect: false |
|
1004 |
isResizeable: false |
|
1005 |
showRowSeparator: false |
|
1006 |
showColSeparator: false |
|
1007 |
) |
|
1008 |
) |
|
5626 | 1009 |
doubleClickChannel: accept |
5528 | 1010 |
) |
1011 |
(HorizontalPanelViewSpec |
|
5737 | 1012 |
name: 'ButtonPanel' |
5528 | 1013 |
layout: (LayoutFrame 0 0 -30 1 0 1 0 1) |
1014 |
horizontalLayout: fitSpace |
|
1015 |
verticalLayout: center |
|
1016 |
horizontalSpace: 3 |
|
1017 |
verticalSpace: 3 |
|
1018 |
reverseOrderIfOKAtLeft: true |
|
1019 |
component: |
|
1020 |
(SpecCollection |
|
1021 |
collection: ( |
|
1022 |
(ActionButtonSpec |
|
1023 |
label: 'Cancel' |
|
1024 |
name: 'Button2' |
|
1025 |
translateLabel: true |
|
1026 |
model: cancel |
|
5737 | 1027 |
extent: (Point 185 22) |
5528 | 1028 |
) |
1029 |
(ActionButtonSpec |
|
1030 |
label: 'OK' |
|
1031 |
name: 'Button1' |
|
1032 |
translateLabel: true |
|
1033 |
model: accept |
|
1034 |
isDefault: true |
|
5737 | 1035 |
extent: (Point 185 22) |
5528 | 1036 |
) |
1037 |
) |
|
1038 |
||
1039 |
) |
|
1040 |
) |
|
5737 | 1041 |
(CheckBoxSpec |
1042 |
label: 'Lock Encoding' |
|
1043 |
name: 'LockEncodingCheckBox' |
|
1044 |
layout: (LayoutFrame 3 0 -60 1 217 0 -30 1) |
|
1045 |
activeHelpKey: lockFileEncoding |
|
1046 |
model: lockFileEncoding |
|
1047 |
translateLabel: true |
|
1048 |
) |
|
5528 | 1049 |
) |
1050 |
||
1051 |
) |
|
1052 |
) |
|
1053 |
! ! |
|
1054 |
||
3892 | 1055 |
!AbstractFileBrowser class methodsFor:'menu specs'! |
1056 |
||
1057 |
baseBookmarksMenuSpec |
|
1058 |
"This resource specification was automatically generated |
|
1059 |
by the MenuEditor of ST/X." |
|
1060 |
||
1061 |
"Do not manually edit this!! If it is corrupted, |
|
1062 |
the MenuEditor may not be able to read the specification." |
|
1063 |
||
1064 |
" |
|
1065 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#baseBookmarksMenuSpec |
|
1066 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser baseBookmarksMenuSpec)) startUp |
|
1067 |
" |
|
1068 |
||
1069 |
<resource: #menu> |
|
1070 |
||
1071 |
^ |
|
6551 | 1072 |
#(Menu |
1073 |
( |
|
1074 |
(MenuItem |
|
1075 |
enabled: currentFilesHasDirectories |
|
1076 |
label: 'Add Bookmark' |
|
1077 |
itemValue: addBookmark |
|
1078 |
translateLabel: true |
|
4414 | 1079 |
) |
6551 | 1080 |
(MenuItem |
1081 |
enabled: hasBookmarksToRemove |
|
1082 |
label: 'Remove Bookmark' |
|
1083 |
itemValue: removeBookmark |
|
1084 |
translateLabel: true |
|
4414 | 1085 |
) |
6551 | 1086 |
(MenuItem |
1087 |
label: 'Save Bookmarks In...' |
|
1088 |
itemValue: saveBookmarks |
|
1089 |
translateLabel: true |
|
4679 | 1090 |
) |
4414 | 1091 |
) |
1092 |
nil |
|
1093 |
nil |
|
3892 | 1094 |
) |
1095 |
! |
|
1096 |
||
6102 | 1097 |
baseBookmarksMenuSpec2 |
1098 |
"This resource specification was automatically generated |
|
1099 |
by the MenuEditor of ST/X." |
|
1100 |
||
1101 |
"Do not manually edit this!! If it is corrupted, |
|
1102 |
the MenuEditor may not be able to read the specification." |
|
1103 |
||
1104 |
" |
|
8013 | 1105 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#baseBookmarksMenuSpec2 |
1106 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser baseBookmarksMenuSpec2)) startUp |
|
6102 | 1107 |
" |
1108 |
||
1109 |
<resource: #menu> |
|
1110 |
||
1111 |
^ |
|
8013 | 1112 |
#(Menu |
1113 |
( |
|
1114 |
(MenuItem |
|
1115 |
label: 'Edit Bookmarks' |
|
1116 |
itemValue: editBookmarks |
|
1117 |
translateLabel: true |
|
1118 |
) |
|
1119 |
(MenuItem |
|
1120 |
label: '-' |
|
1121 |
) |
|
1122 |
(MenuItem |
|
1123 |
enabled: currentFilesHasDirectories |
|
1124 |
label: 'Add Bookmark' |
|
1125 |
itemValue: addBookmark |
|
1126 |
translateLabel: true |
|
6102 | 1127 |
) |
1128 |
) |
|
1129 |
nil |
|
1130 |
nil |
|
1131 |
) |
|
1132 |
! |
|
1133 |
||
4110 | 1134 |
browserMenu |
1135 |
"This resource specification was automatically generated |
|
1136 |
by the MenuEditor of ST/X." |
|
1137 |
||
1138 |
"Do not manually edit this!! If it is corrupted, |
|
1139 |
the MenuEditor may not be able to read the specification." |
|
1140 |
||
1141 |
" |
|
1142 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#browserMenu |
|
1143 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser browserMenu)) startUp |
|
1144 |
" |
|
1145 |
||
1146 |
<resource: #menu> |
|
1147 |
||
1148 |
^ |
|
5273 | 1149 |
#(Menu |
1150 |
( |
|
1151 |
(MenuItem |
|
7315 | 1152 |
label: 'Spawn Filebrowser' |
5273 | 1153 |
itemValue: doSpawn |
1154 |
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
|
1155 |
shortcutKey: Ctrln |
4201 | 1156 |
) |
5273 | 1157 |
(MenuItem |
7829 | 1158 |
label: 'Windows Explorer' |
1159 |
itemValue: doOpenExplorer |
|
1160 |
translateLabel: true |
|
8256 | 1161 |
isVisible: systemIsDOS |
7829 | 1162 |
shortcutKey: Ctrle |
8256 | 1163 |
) |
1164 |
(MenuItem |
|
1165 |
label: 'C Browser' |
|
1166 |
itemValue: doOpenCBrowser |
|
1167 |
translateLabel: true |
|
1168 |
isVisible: cBrowserLoaded |
|
7829 | 1169 |
) |
1170 |
(MenuItem |
|
5273 | 1171 |
label: '-' |
4201 | 1172 |
) |
5273 | 1173 |
(MenuItem |
6335 | 1174 |
label: 'Add Text Editor Page' |
5273 | 1175 |
itemValue: newTextEditor |
1176 |
translateLabel: true |
|
5963
57ae5e061db8
Accelerator Ctrl-t for new text editor
Stefan Vogel <sv@exept.de>
parents:
5962
diff
changeset
|
1177 |
shortcutKey: Ctrlt |
4392 | 1178 |
) |
5273 | 1179 |
(MenuItem |
6335 | 1180 |
label: 'Add Shell Terminal Page' |
5273 | 1181 |
itemValue: doAddTerminal |
1182 |
translateLabel: true |
|
4201 | 1183 |
) |
5273 | 1184 |
(MenuItem |
6335 | 1185 |
label: 'Add Search Page' |
5273 | 1186 |
itemValue: doOpenSearchFile |
1187 |
translateLabel: true |
|
4201 | 1188 |
) |
5273 | 1189 |
(MenuItem |
1190 |
label: '-' |
|
4201 | 1191 |
) |
5273 | 1192 |
(MenuItem |
1193 |
label: 'Settings...' |
|
1194 |
itemValue: doOpenSettings |
|
1195 |
translateLabel: true |
|
5104 | 1196 |
) |
5273 | 1197 |
(MenuItem |
5528 | 1198 |
label: 'Encoding...' |
1199 |
itemValue: fileEncodingDialog |
|
1200 |
translateLabel: true |
|
1201 |
) |
|
1202 |
(MenuItem |
|
5273 | 1203 |
label: '-' |
5104 | 1204 |
) |
5273 | 1205 |
(MenuItem |
1206 |
label: 'Exit' |
|
1207 |
itemValue: closeRequest |
|
1208 |
translateLabel: true |
|
4201 | 1209 |
) |
1210 |
) |
|
1211 |
nil |
|
1212 |
nil |
|
4110 | 1213 |
) |
1214 |
! |
|
1215 |
||
4107 | 1216 |
cvsMenu |
1217 |
"This resource specification was automatically generated |
|
1218 |
by the MenuEditor of ST/X." |
|
1219 |
||
1220 |
"Do not manually edit this!! If it is corrupted, |
|
1221 |
the MenuEditor may not be able to read the specification." |
|
1222 |
||
1223 |
" |
|
1224 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#cvsMenu |
|
1225 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser cvsMenu)) startUp |
|
1226 |
" |
|
1227 |
||
1228 |
<resource: #menu> |
|
1229 |
||
1230 |
^ |
|
1231 |
#(#Menu |
|
4414 | 1232 |
#( |
1233 |
#(#MenuItem |
|
1234 |
#label: 'Commit...' |
|
1235 |
#itemValue: #cvsCommit |
|
1236 |
#translateLabel: true |
|
1237 |
) |
|
1238 |
#(#MenuItem |
|
1239 |
#enabled: #canCvsAddAndCommit |
|
1240 |
#label: 'Add && Commit...' |
|
1241 |
#itemValue: #cvsAddAndCommit |
|
1242 |
#translateLabel: true |
|
1243 |
) |
|
1244 |
#(#MenuItem |
|
4849 | 1245 |
#enabled: #canCvsAddAndCommit |
1246 |
#label: 'Add as Binary && Commit...' |
|
1247 |
#itemValue: #cvsAddBinaryAndCommit |
|
1248 |
#translateLabel: true |
|
1249 |
) |
|
1250 |
#(#MenuItem |
|
4414 | 1251 |
#label: '-' |
1252 |
) |
|
1253 |
#(#MenuItem |
|
6316 | 1254 |
#enabled: #hasSelection |
8562 | 1255 |
#label: 'Tag...' |
1256 |
#itemValue: #cvsTagSelection |
|
1257 |
#translateLabel: true |
|
1258 |
) |
|
1259 |
#(#MenuItem |
|
9338 | 1260 |
#enabled: #hasSelection |
1261 |
#label: 'Revision Log' |
|
1262 |
#itemValue: #cvsRevisionLog |
|
1263 |
#translateLabel: true |
|
1264 |
) |
|
1265 |
#(#MenuItem |
|
9407
cf114ba82b6d
added: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
9405
diff
changeset
|
1266 |
#enabled: #hasSelection |
cf114ba82b6d
added: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
9405
diff
changeset
|
1267 |
#label: 'Compare with newest in Repository' |
cf114ba82b6d
added: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
9405
diff
changeset
|
1268 |
#itemValue: #cvsCompareWithNewest |
cf114ba82b6d
added: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
9405
diff
changeset
|
1269 |
#translateLabel: true |
cf114ba82b6d
added: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
9405
diff
changeset
|
1270 |
) |
cf114ba82b6d
added: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
9405
diff
changeset
|
1271 |
#(#MenuItem |
8562 | 1272 |
#label: '-' |
1273 |
) |
|
1274 |
#(#MenuItem |
|
1275 |
#enabled: #hasSelection |
|
6316 | 1276 |
#label: 'Update selected Files/Directories' |
1277 |
#itemValue: #cvsUpdateSelection |
|
1278 |
#translateLabel: true |
|
1279 |
) |
|
1280 |
#(#MenuItem |
|
1281 |
#label: 'Update Directory Local' |
|
1282 |
#itemValue: #cvsUpdateAll |
|
1283 |
#translateLabel: true |
|
1284 |
) |
|
1285 |
#(#MenuItem |
|
1286 |
#label: 'Update Directory Recursive' |
|
1287 |
#itemValue: #cvsUpdateAllRecursive |
|
1288 |
#translateLabel: true |
|
1289 |
) |
|
1290 |
#(#MenuItem |
|
1291 |
#label: '-' |
|
1292 |
) |
|
1293 |
#(#MenuItem |
|
4414 | 1294 |
#enabled: #canRemoveCVSContainer |
1295 |
#label: 'Remove File && CVS Container...' |
|
1296 |
#itemValue: #cvsRemoveFileAndCVSContainer |
|
1297 |
#translateLabel: true |
|
1298 |
) |
|
1299 |
) |
|
1300 |
nil |
|
1301 |
nil |
|
4107 | 1302 |
) |
1303 |
! |
|
1304 |
||
3892 | 1305 |
directoryMenu |
1306 |
"This resource specification was automatically generated |
|
1307 |
by the MenuEditor of ST/X." |
|
1308 |
||
1309 |
"Do not manually edit this!! If it is corrupted, |
|
1310 |
the MenuEditor may not be able to read the specification." |
|
1311 |
||
1312 |
" |
|
1313 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#directoryMenu |
|
1314 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser directoryMenu)) startUp |
|
1315 |
" |
|
1316 |
||
1317 |
<resource: #menu> |
|
1318 |
||
1319 |
^ |
|
6220 | 1320 |
#(Menu |
1321 |
( |
|
1322 |
(MenuItem |
|
1323 |
label: 'Up' |
|
1324 |
itemValue: doGoDirectoryUp |
|
1325 |
translateLabel: true |
|
4414 | 1326 |
) |
6220 | 1327 |
(MenuItem |
1328 |
label: '-' |
|
4414 | 1329 |
) |
6220 | 1330 |
(MenuItem |
1331 |
activeHelpKey: directoryBack |
|
1332 |
enabled: enableBack |
|
1333 |
label: 'Back' |
|
1334 |
itemValue: doBack |
|
1335 |
translateLabel: true |
|
4414 | 1336 |
) |
6220 | 1337 |
(MenuItem |
1338 |
activeHelpKey: directoryBack |
|
1339 |
enabled: enableForward |
|
1340 |
label: 'Forward' |
|
1341 |
itemValue: doForward |
|
1342 |
translateLabel: true |
|
4414 | 1343 |
) |
6220 | 1344 |
(MenuItem |
1345 |
label: '-' |
|
4414 | 1346 |
) |
6220 | 1347 |
(MenuItem |
9596 | 1348 |
enabled: enableHome |
6434 | 1349 |
label: 'Home Directory' |
1350 |
itemValue: doGotoHomeDirectory |
|
1351 |
translateLabel: true |
|
1352 |
) |
|
1353 |
(MenuItem |
|
9596 | 1354 |
enabled: enableGotoDesktopDirectory |
9572 | 1355 |
label: 'Desktop' |
1356 |
itemValue: doGotoDesktopDirectory |
|
1357 |
translateLabel: true |
|
1358 |
isVisible: gotoDesktopDirectoryIsVisible |
|
1359 |
) |
|
1360 |
(MenuItem |
|
9596 | 1361 |
enabled: enableGotoDefaultDirectory |
6434 | 1362 |
label: 'Default (Current) Directory' |
6220 | 1363 |
itemValue: doGotoDefaultDirectory |
9596 | 1364 |
translateLabel: true |
6456 | 1365 |
isVisible: gotoDefaultDirectoryIsVisible |
9596 | 1366 |
) |
1367 |
(MenuItem |
|
1368 |
enabled: enableGotoSmalltalkDirectory |
|
1369 |
label: 'Smalltalk (Application) Directory' |
|
1370 |
itemValue: doGotoSmalltalkDirectory |
|
6220 | 1371 |
translateLabel: true |
4414 | 1372 |
) |
6220 | 1373 |
(MenuItem |
9596 | 1374 |
label: '-' |
1375 |
) |
|
1376 |
(MenuItem |
|
1377 |
enabled: enableMakeCurrentDirectory |
|
1378 |
label: 'Make this the Default (Current) Directory' |
|
1379 |
itemValue: doMakeCurrentDirectory |
|
6220 | 1380 |
translateLabel: true |
4414 | 1381 |
) |
6220 | 1382 |
(MenuItem |
9596 | 1383 |
label: '-' |
1384 |
) |
|
1385 |
(MenuItem |
|
6220 | 1386 |
label: 'Bookmarks' |
1387 |
translateLabel: true |
|
9111
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1388 |
submenuChannel: bookmarksMenu |
4414 | 1389 |
) |
6220 | 1390 |
(MenuItem |
1391 |
label: 'Visited Directories' |
|
1392 |
translateLabel: true |
|
1393 |
submenuChannel: visitedDirectoriesMenu |
|
4414 | 1394 |
) |
1395 |
) |
|
1396 |
nil |
|
1397 |
nil |
|
3892 | 1398 |
) |
9572 | 1399 |
|
9596 | 1400 |
"Modified: / 26-10-2010 / 17:20:23 / cg" |
3892 | 1401 |
! |
1402 |
||
1403 |
editMenu |
|
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:#editMenu |
|
1412 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser editMenu)) startUp |
|
1413 |
" |
|
1414 |
||
1415 |
<resource: #menu> |
|
1416 |
||
1417 |
^ |
|
5888 | 1418 |
#(Menu |
1419 |
( |
|
1420 |
(MenuItem |
|
1421 |
enabled: hasFileSelection |
|
1422 |
label: 'Copy Selected Filenames to Clipboard' |
|
1423 |
itemValue: copySelectedFilenames |
|
1424 |
translateLabel: true |
|
4414 | 1425 |
) |
5888 | 1426 |
(MenuItem |
1427 |
enabled: fileListIsNotEmpty |
|
1428 |
label: 'Copy All Filenames to Clipboard' |
|
1429 |
itemValue: copyFileList |
|
1430 |
translateLabel: true |
|
4940
4964068c4718
allow settings dialog to be opened from browser
Claus Gittinger <cg@exept.de>
parents:
4930
diff
changeset
|
1431 |
) |
4414 | 1432 |
) |
1433 |
nil |
|
1434 |
nil |
|
3892 | 1435 |
) |
1436 |
! |
|
1437 |
||
6099 | 1438 |
emptyMenuSpec |
1439 |
"This resource specification was automatically generated |
|
1440 |
by the MenuEditor of ST/X." |
|
1441 |
||
1442 |
"Do not manually edit this!! If it is corrupted, |
|
1443 |
the MenuEditor may not be able to read the specification." |
|
1444 |
||
1445 |
" |
|
1446 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#emptyMenuSpec |
|
1447 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser emptyMenuSpec)) startUp |
|
1448 |
" |
|
1449 |
||
1450 |
<resource: #menu> |
|
1451 |
||
1452 |
^ |
|
1453 |
#(#Menu |
|
1454 |
#( |
|
1455 |
) |
|
1456 |
nil |
|
1457 |
nil |
|
1458 |
) |
|
1459 |
! |
|
1460 |
||
3892 | 1461 |
fileMenu |
1462 |
"This resource specification was automatically generated |
|
1463 |
by the MenuEditor of ST/X." |
|
1464 |
||
1465 |
"Do not manually edit this!! If it is corrupted, |
|
1466 |
the MenuEditor may not be able to read the specification." |
|
1467 |
||
1468 |
" |
|
1469 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#fileMenu |
|
1470 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser fileMenu)) startUp |
|
1471 |
" |
|
1472 |
||
1473 |
<resource: #menu> |
|
1474 |
||
1475 |
^ |
|
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1476 |
#(Menu |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1477 |
( |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1478 |
(MenuItem |
6593 | 1479 |
label: 'Open' |
1480 |
itemValue: doShowFileContents |
|
1481 |
translateLabel: true |
|
1482 |
) |
|
1483 |
(MenuItem |
|
9343
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
1484 |
label: '-' |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
1485 |
) |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
1486 |
(MenuItem |
6593 | 1487 |
enabled: hasFileSelection |
1488 |
label: 'FileIn' |
|
1489 |
itemValue: fileFileIn |
|
1490 |
translateLabel: true |
|
1491 |
) |
|
1492 |
(MenuItem |
|
1493 |
enabled: hasFileSelection |
|
1494 |
label: 'FileIn to Namespace...' |
|
1495 |
itemValue: fileFileInToNameSpace |
|
1496 |
translateLabel: true |
|
1497 |
) |
|
1498 |
(MenuItem |
|
1499 |
label: '-' |
|
1500 |
) |
|
1501 |
(MenuItem |
|
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1502 |
label: 'New' |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1503 |
translateLabel: true |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1504 |
submenuChannel: newMenu |
5425 | 1505 |
keepLinkedMenu: true |
4414 | 1506 |
) |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1507 |
(MenuItem |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1508 |
label: '-' |
4534 | 1509 |
) |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1510 |
(MenuItem |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1511 |
enabled: hasSelection |
5945 | 1512 |
label: 'Cut' |
1513 |
itemValue: cutFiles |
|
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1514 |
translateLabel: true |
4789
238d5e783f5c
editMenu was really a file menu
Claus Gittinger <cg@exept.de>
parents:
4785
diff
changeset
|
1515 |
) |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1516 |
(MenuItem |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1517 |
enabled: hasSelection |
5945 | 1518 |
label: 'Copy' |
1519 |
itemValue: copyFiles |
|
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1520 |
translateLabel: true |
4789
238d5e783f5c
editMenu was really a file menu
Claus Gittinger <cg@exept.de>
parents:
4785
diff
changeset
|
1521 |
) |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1522 |
(MenuItem |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1523 |
enabled: canPaste |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1524 |
label: 'Paste' |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1525 |
itemValue: pasteFiles |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1526 |
translateLabel: true |
4789
238d5e783f5c
editMenu was really a file menu
Claus Gittinger <cg@exept.de>
parents:
4785
diff
changeset
|
1527 |
) |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1528 |
(MenuItem |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1529 |
enabled: hasSelection |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1530 |
label: 'Delete' |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1531 |
itemValue: deleteFiles |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1532 |
translateLabel: true |
4789
238d5e783f5c
editMenu was really a file menu
Claus Gittinger <cg@exept.de>
parents:
4785
diff
changeset
|
1533 |
) |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1534 |
(MenuItem |
6169 | 1535 |
enabled: hasSelection |
1536 |
label: 'Erase' |
|
1537 |
itemValue: eraseFiles |
|
1538 |
translateLabel: true |
|
1539 |
) |
|
1540 |
(MenuItem |
|
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1541 |
label: '-' |
4789
238d5e783f5c
editMenu was really a file menu
Claus Gittinger <cg@exept.de>
parents:
4785
diff
changeset
|
1542 |
) |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1543 |
(MenuItem |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1544 |
enabled: hasSelection |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1545 |
label: 'Rename...' |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1546 |
itemValue: renameSelection |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1547 |
translateLabel: true |
8716 | 1548 |
shortcutKey: Rename |
4414 | 1549 |
) |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1550 |
(MenuItem |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1551 |
enabled: hasSelection |
5634 | 1552 |
label: 'Move To...' |
6107 | 1553 |
itemValue: moveSelectionTo |
1554 |
translateLabel: true |
|
1555 |
) |
|
1556 |
(MenuItem |
|
1557 |
enabled: hasSelection |
|
1558 |
label: 'Copy To...' |
|
1559 |
itemValue: copySelectionTo |
|
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1560 |
translateLabel: true |
4414 | 1561 |
) |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1562 |
(MenuItem |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1563 |
enabled: hasSelection |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1564 |
label: 'Properties...' |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1565 |
itemValue: doShowProperties |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1566 |
translateLabel: true |
4554 | 1567 |
) |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1568 |
(MenuItem |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1569 |
label: '-' |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1570 |
isVisible: javaSupportLoaded |
4414 | 1571 |
) |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1572 |
(MenuItem |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1573 |
enabled: canAddToClassPath |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1574 |
label: 'Add to Java Class Path' |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1575 |
translateLabel: true |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1576 |
isVisible: javaSupportLoaded |
4414 | 1577 |
) |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1578 |
(MenuItem |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1579 |
enabled: canRemoveFromClassPath |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1580 |
label: 'Remove from Java Class Path' |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1581 |
translateLabel: true |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1582 |
isVisible: javaSupportLoaded |
4414 | 1583 |
) |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1584 |
(MenuItem |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1585 |
enabled: canAddToSourcePath |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1586 |
label: 'Add to Java Source Path' |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1587 |
translateLabel: true |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1588 |
isVisible: javaSupportLoaded |
4414 | 1589 |
) |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1590 |
(MenuItem |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1591 |
enabled: canRemoveFromSourcePath |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1592 |
label: 'Remove from Java Source Path' |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1593 |
translateLabel: true |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1594 |
isVisible: javaSupportLoaded |
4414 | 1595 |
) |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1596 |
(MenuItem |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1597 |
label: '-' |
5242
04616d3a672c
history fixed (only kept the oldest items, instead of the newest ones)
Claus Gittinger <cg@exept.de>
parents:
5162
diff
changeset
|
1598 |
) |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1599 |
(MenuItem |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1600 |
enabled: enableFileHistory |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1601 |
label: 'File History' |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1602 |
translateLabel: true |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1603 |
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
|
1604 |
) |
4414 | 1605 |
) |
1606 |
nil |
|
1607 |
nil |
|
3892 | 1608 |
) |
7635 | 1609 |
|
1610 |
"Modified: / 07-02-2007 / 18:44:54 / cg" |
|
3892 | 1611 |
! |
1612 |
||
4930 | 1613 |
fileOpMenu |
1614 |
"This resource specification was automatically generated |
|
1615 |
by the MenuEditor of ST/X." |
|
1616 |
||
1617 |
"Do not manually edit this!! If it is corrupted, |
|
1618 |
the MenuEditor may not be able to read the specification." |
|
1619 |
||
1620 |
" |
|
1621 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#fileOpMenu |
|
1622 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser fileOpMenu)) startUp |
|
1623 |
" |
|
1624 |
||
1625 |
<resource: #menu> |
|
1626 |
||
1627 |
^ |
|
8640
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1628 |
#(Menu |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1629 |
( |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1630 |
(MenuItem |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1631 |
label: 'Split...' |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1632 |
itemValue: splitSelectedFiles |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1633 |
translateLabel: true |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1634 |
) |
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: 'Join...' |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1637 |
itemValue: joinSelectedFiles |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1638 |
translateLabel: true |
4930 | 1639 |
) |
7635 | 1640 |
(MenuItem |
1641 |
label: 'Copy Corrupted File To...' |
|
1642 |
itemValue: copySelectionToRepairingCorruptedFiles |
|
1643 |
translateLabel: true |
|
1644 |
) |
|
8640
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1645 |
(MenuItem |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1646 |
label: '-' |
4930 | 1647 |
) |
8640
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1648 |
(MenuItem |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1649 |
label: 'Rot13...' |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1650 |
itemValue: filterSelectedFiles: |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1651 |
translateLabel: true |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1652 |
argument: rot13 |
4930 | 1653 |
) |
8640
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1654 |
(MenuItem |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1655 |
label: '-' |
4930 | 1656 |
) |
8640
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1657 |
(MenuItem |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1658 |
label: 'Truncate...' |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1659 |
itemValue: truncateSelectedFilesToZeroSize |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1660 |
translateLabel: true |
4930 | 1661 |
) |
9490 | 1662 |
(MenuItem |
1663 |
label: '-' |
|
1664 |
) |
|
1665 |
(MenuItem |
|
1666 |
label: 'Generate Signed Files' |
|
1667 |
itemValue: generateSignaturesForSelectedFiles |
|
1668 |
translateLabel: true |
|
1669 |
enabled: canGenerateSignatureFiles |
|
1670 |
) |
|
1671 |
(MenuItem |
|
1672 |
label: 'Generate Detached Signature Files (use for dll)' |
|
1673 |
itemValue: generateDetachedSignaturesForSelectedFiles |
|
1674 |
translateLabel: true |
|
1675 |
enabled: canGenerateSignatureFiles |
|
1676 |
) |
|
9596 | 1677 |
(MenuItem |
1678 |
label: '-' |
|
1679 |
) |
|
1680 |
(MenuItem |
|
1681 |
enabled: hasSelection |
|
1682 |
label: 'File Differences' |
|
1683 |
itemValue: openDiffView |
|
1684 |
translateLabel: true |
|
1685 |
isVisible: hasTwoFilesSelectedHolder |
|
1686 |
) |
|
1687 |
(MenuItem |
|
1688 |
enabled: hasSelection |
|
1689 |
label: 'File Differences...' |
|
1690 |
itemValue: openDiffView |
|
1691 |
translateLabel: true |
|
1692 |
isVisible: hasNotTwoFilesSelectedHolder |
|
1693 |
) |
|
1694 |
(MenuItem |
|
1695 |
enabled: hasSelection |
|
1696 |
label: 'Directory Differences' |
|
1697 |
itemValue: openDirectoryDiffView |
|
1698 |
translateLabel: true |
|
1699 |
isVisible: hasTwoDirectoriesSelectedHolder |
|
1700 |
) |
|
1701 |
(MenuItem |
|
1702 |
enabled: hasSelection |
|
1703 |
label: 'Directory Differences...' |
|
1704 |
itemValue: openDirectoryDiffView |
|
1705 |
translateLabel: true |
|
1706 |
isVisible: hasNotTwoDirectoriesSelectedHolder |
|
1707 |
) |
|
4930 | 1708 |
) |
1709 |
nil |
|
1710 |
nil |
|
1711 |
) |
|
9490 | 1712 |
|
9596 | 1713 |
"Modified: / 26-10-2010 / 17:16:05 / cg" |
4930 | 1714 |
! |
1715 |
||
3892 | 1716 |
newMenu |
1717 |
"This resource specification was automatically generated |
|
1718 |
by the MenuEditor of ST/X." |
|
1719 |
||
1720 |
"Do not manually edit this!! If it is corrupted, |
|
1721 |
the MenuEditor may not be able to read the specification." |
|
1722 |
||
1723 |
" |
|
1724 |
MenuEditor new openOnClass:DirectoryTreeBrowser andSelector:#newMenu |
|
1725 |
(Menu new fromLiteralArrayEncoding:(DirectoryTreeBrowser newMenu)) startUp |
|
1726 |
" |
|
1727 |
||
1728 |
<resource: #menu> |
|
1729 |
||
1730 |
^ |
|
1731 |
#(#Menu |
|
4414 | 1732 |
#( |
1733 |
#(#MenuItem |
|
1734 |
#label: 'Directory...' |
|
1735 |
#translateLabel: true |
|
1736 |
#value: #newDirectory |
|
1737 |
) |
|
1738 |
#(#MenuItem |
|
1739 |
#label: 'File...' |
|
1740 |
#translateLabel: true |
|
1741 |
#value: #newFile |
|
1742 |
) |
|
1743 |
#(#MenuItem |
|
1744 |
#label: 'Hard Link...' |
|
1745 |
#translateLabel: true |
|
1746 |
#isVisible: #systemIsUnix |
|
1747 |
#value: #newHardLink |
|
1748 |
) |
|
1749 |
#(#MenuItem |
|
1750 |
#label: 'Symbolic Link...' |
|
1751 |
#translateLabel: true |
|
1752 |
#isVisible: #systemIsUnix |
|
1753 |
#value: #newSoftLink |
|
1754 |
) |
|
1755 |
) |
|
1756 |
nil |
|
1757 |
nil |
|
3892 | 1758 |
) |
3906 | 1759 |
! |
1760 |
||
4201 | 1761 |
showMenuSpec |
1762 |
"This resource specification was automatically generated |
|
1763 |
by the MenuEditor of ST/X." |
|
1764 |
||
1765 |
"Do not manually edit this!! If it is corrupted, |
|
1766 |
the MenuEditor may not be able to read the specification." |
|
1767 |
||
1768 |
" |
|
1769 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#showMenuSpec |
|
1770 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser showMenuSpec)) startUp |
|
1771 |
" |
|
1772 |
||
1773 |
<resource: #menu> |
|
1774 |
||
1775 |
^ |
|
9111
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1776 |
#(Menu |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1777 |
( |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1778 |
(MenuItem |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1779 |
label: 'Hidden Files' |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1780 |
translateLabel: true |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1781 |
hideMenuOnActivated: false |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1782 |
indication: showHiddenFiles |
4201 | 1783 |
) |
9111
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1784 |
(MenuItem |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1785 |
label: '-' |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1786 |
) |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1787 |
(MenuItem |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1788 |
label: 'Directory Tree' |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1789 |
translateLabel: true |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1790 |
hideMenuOnActivated: false |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1791 |
indication: showDirectoryTree |
4201 | 1792 |
) |
9111
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1793 |
(MenuItem |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1794 |
label: 'Regular Files in TreeView (Left)' |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1795 |
translateLabel: true |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1796 |
hideMenuOnActivated: false |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1797 |
indication: viewFilesInDirectoryTree |
4201 | 1798 |
) |
9111
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1799 |
(MenuItem |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1800 |
label: 'Directories in ContentsView (Right)' |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1801 |
translateLabel: true |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1802 |
hideMenuOnActivated: false |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1803 |
indication: viewDirsInContentsBrowser |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1804 |
) |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1805 |
(MenuItem |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1806 |
enabled: enableViewNoteBookApplication |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1807 |
label: 'File Applications' |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1808 |
translateLabel: true |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1809 |
hideMenuOnActivated: false |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1810 |
indication: viewNoteBookApplicationHolder |
4201 | 1811 |
) |
9111
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1812 |
(MenuItem |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1813 |
label: '-' |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1814 |
) |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1815 |
(MenuItem |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1816 |
label: 'DiskUsage' |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1817 |
translateLabel: true |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1818 |
hideMenuOnActivated: false |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1819 |
indication: showDiskUsageHolder |
4201 | 1820 |
) |
9111
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1821 |
) |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1822 |
nil |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1823 |
nil |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1824 |
) |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1825 |
! |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1826 |
|
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1827 |
showMenuSpecForDialog |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1828 |
"This resource specification was automatically generated |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1829 |
by the MenuEditor of ST/X." |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1830 |
|
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1831 |
"Do not manually edit this!! If it is corrupted, |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1832 |
the MenuEditor may not be able to read the specification." |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1833 |
|
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1834 |
" |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1835 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#showMenuSpecForDialog |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1836 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser showMenuSpecForDialog)) startUp |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1837 |
" |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1838 |
|
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1839 |
<resource: #menu> |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1840 |
|
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1841 |
^ |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1842 |
#(Menu |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1843 |
( |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1844 |
(MenuItem |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1845 |
label: 'Hidden Files' |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1846 |
translateLabel: true |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1847 |
hideMenuOnActivated: false |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1848 |
indication: showHiddenFiles |
4554 | 1849 |
) |
4201 | 1850 |
) |
1851 |
nil |
|
1852 |
nil |
|
1853 |
) |
|
1854 |
! |
|
1855 |
||
3906 | 1856 |
sortMenu |
1857 |
"This resource specification was automatically generated |
|
1858 |
by the MenuEditor of ST/X." |
|
1859 |
||
1860 |
"Do not manually edit this!! If it is corrupted, |
|
1861 |
the MenuEditor may not be able to read the specification." |
|
1862 |
||
1863 |
" |
|
3907 | 1864 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#sortMenu |
1865 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser sortMenu)) startUp |
|
3906 | 1866 |
" |
1867 |
||
1868 |
<resource: #menu> |
|
1869 |
||
1870 |
^ |
|
1871 |
#(#Menu |
|
4414 | 1872 |
#( |
1873 |
#(#MenuItem |
|
1874 |
#label: 'By Filename' |
|
1875 |
#translateLabel: true |
|
1876 |
#hideMenuOnActivated: false |
|
1877 |
#choice: #sortBlockProperty |
|
1878 |
#choiceValue: #baseName |
|
1879 |
) |
|
1880 |
#(#MenuItem |
|
5122 | 1881 |
#label: 'By Extension' |
4414 | 1882 |
#translateLabel: true |
1883 |
#hideMenuOnActivated: false |
|
1884 |
#choice: #sortBlockProperty |
|
1885 |
#choiceValue: #suffix |
|
1886 |
) |
|
1887 |
#(#MenuItem |
|
1888 |
#label: 'By Permissions' |
|
1889 |
#translateLabel: true |
|
1890 |
#hideMenuOnActivated: false |
|
1891 |
#choice: #sortBlockProperty |
|
1892 |
#choiceValue: #permissions |
|
1893 |
) |
|
1894 |
#(#MenuItem |
|
1895 |
#label: 'By Owner' |
|
1896 |
#translateLabel: true |
|
1897 |
#isVisible: #viewOwner |
|
1898 |
#hideMenuOnActivated: false |
|
1899 |
#choice: #sortBlockProperty |
|
1900 |
#choiceValue: #owner |
|
1901 |
) |
|
1902 |
#(#MenuItem |
|
1903 |
#label: 'By Group' |
|
1904 |
#translateLabel: true |
|
1905 |
#isVisible: #viewOwner |
|
1906 |
#hideMenuOnActivated: false |
|
1907 |
#choice: #sortBlockProperty |
|
1908 |
#choiceValue: #group |
|
1909 |
) |
|
1910 |
#(#MenuItem |
|
1911 |
#label: 'By Size' |
|
1912 |
#translateLabel: true |
|
1913 |
#hideMenuOnActivated: false |
|
1914 |
#choice: #sortBlockProperty |
|
1915 |
#choiceValue: #fileSize |
|
1916 |
) |
|
1917 |
#(#MenuItem |
|
1918 |
#label: 'By Date && Time' |
|
1919 |
#translateLabel: true |
|
1920 |
#hideMenuOnActivated: false |
|
1921 |
#choice: #sortBlockProperty |
|
1922 |
#choiceValue: #modificationTime |
|
1923 |
) |
|
1924 |
#(#MenuItem |
|
1925 |
#label: '-' |
|
1926 |
) |
|
1927 |
#(#MenuItem |
|
1928 |
#label: 'Ignore Case in Sort' |
|
1929 |
#translateLabel: true |
|
1930 |
#hideMenuOnActivated: false |
|
1931 |
#indication: #sortCaseless |
|
1932 |
) |
|
1933 |
#(#MenuItem |
|
1934 |
#label: 'Directories before Files' |
|
1935 |
#translateLabel: true |
|
1936 |
#hideMenuOnActivated: false |
|
1937 |
#indication: #sortDirectoriesBeforeFiles |
|
1938 |
) |
|
1939 |
) |
|
1940 |
nil |
|
1941 |
nil |
|
3906 | 1942 |
) |
4018 | 1943 |
! |
1944 |
||
4164
81154143d447
move toolsMenuSpec from FileBrowserV2 to AbstractFileBrowser
penk
parents:
4163
diff
changeset
|
1945 |
toolsMenuSpec |
81154143d447
move toolsMenuSpec from FileBrowserV2 to AbstractFileBrowser
penk
parents:
4163
diff
changeset
|
1946 |
"This resource specification was automatically generated |
81154143d447
move toolsMenuSpec from FileBrowserV2 to AbstractFileBrowser
penk
parents:
4163
diff
changeset
|
1947 |
by the MenuEditor of ST/X." |
81154143d447
move toolsMenuSpec from FileBrowserV2 to AbstractFileBrowser
penk
parents:
4163
diff
changeset
|
1948 |
|
81154143d447
move toolsMenuSpec from FileBrowserV2 to AbstractFileBrowser
penk
parents:
4163
diff
changeset
|
1949 |
"Do not manually edit this!! If it is corrupted, |
81154143d447
move toolsMenuSpec from FileBrowserV2 to AbstractFileBrowser
penk
parents:
4163
diff
changeset
|
1950 |
the MenuEditor may not be able to read the specification." |
81154143d447
move toolsMenuSpec from FileBrowserV2 to AbstractFileBrowser
penk
parents:
4163
diff
changeset
|
1951 |
|
81154143d447
move toolsMenuSpec from FileBrowserV2 to AbstractFileBrowser
penk
parents:
4163
diff
changeset
|
1952 |
" |
4367 | 1953 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#toolsMenuSpec |
1954 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser toolsMenuSpec)) startUp |
|
4164
81154143d447
move toolsMenuSpec from FileBrowserV2 to AbstractFileBrowser
penk
parents:
4163
diff
changeset
|
1955 |
" |
81154143d447
move toolsMenuSpec from FileBrowserV2 to AbstractFileBrowser
penk
parents:
4163
diff
changeset
|
1956 |
|
81154143d447
move toolsMenuSpec from FileBrowserV2 to AbstractFileBrowser
penk
parents:
4163
diff
changeset
|
1957 |
<resource: #menu> |
81154143d447
move toolsMenuSpec from FileBrowserV2 to AbstractFileBrowser
penk
parents:
4163
diff
changeset
|
1958 |
|
81154143d447
move toolsMenuSpec from FileBrowserV2 to AbstractFileBrowser
penk
parents:
4163
diff
changeset
|
1959 |
^ |
5830 | 1960 |
#(Menu |
1961 |
( |
|
1962 |
(MenuItem |
|
9343
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
1963 |
label: 'Open (Win32-Shell)' |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
1964 |
itemValue: doOpenWithShellCommand |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
1965 |
translateLabel: true |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
1966 |
isVisible: systemIsDOS |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
1967 |
) |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
1968 |
(MenuItem |
6528 | 1969 |
label: 'Execute UNIX Command...' |
5830 | 1970 |
itemValue: doExecuteCommand |
1971 |
translateLabel: true |
|
6528 | 1972 |
isVisible: systemIsUnix |
1973 |
) |
|
1974 |
(MenuItem |
|
1975 |
label: 'Execute DOS Command...' |
|
1976 |
itemValue: doExecuteCommand |
|
1977 |
translateLabel: true |
|
1978 |
isVisible: systemIsDOS |
|
4230 | 1979 |
) |
5830 | 1980 |
(MenuItem |
5880 | 1981 |
label: 'Execute Script...' |
1982 |
itemValue: doExecuteScript |
|
1983 |
translateLabel: true |
|
1984 |
) |
|
1985 |
(MenuItem |
|
5830 | 1986 |
enabled: canDoTerminal |
1987 |
label: 'Shell Terminal' |
|
1988 |
itemValue: openTerminal |
|
1989 |
translateLabel: true |
|
1990 |
isVisible: canDoTerminalAndSystemIsUnix |
|
4230 | 1991 |
) |
5830 | 1992 |
(MenuItem |
1993 |
enabled: canDoTerminal |
|
1994 |
label: 'DOS Terminal' |
|
1995 |
itemValue: openTerminal |
|
1996 |
translateLabel: true |
|
1997 |
isVisible: canDoTerminalAndSystemIsDOS |
|
4230 | 1998 |
) |
5830 | 1999 |
(MenuItem |
2000 |
label: '-' |
|
4230 | 2001 |
) |
5830 | 2002 |
(MenuItem |
2003 |
enabled: hasFileSelection |
|
2004 |
label: 'Changes Browser' |
|
2005 |
itemValue: openChangesBrowser |
|
2006 |
translateLabel: true |
|
4230 | 2007 |
) |
5830 | 2008 |
(MenuItem |
2009 |
enabled: hasFileSelection |
|
2010 |
label: 'ChangeSet Browser' |
|
2011 |
itemValue: openChangeSetBrowser |
|
2012 |
translateLabel: true |
|
6602 | 2013 |
isVisible: changeSetBrowserItemVisible |
4230 | 2014 |
) |
5830 | 2015 |
(MenuItem |
6022 | 2016 |
enabled: hasFileSelection |
2017 |
label: 'Workspace' |
|
2018 |
itemValue: openWorkspace |
|
2019 |
translateLabel: true |
|
2020 |
) |
|
2021 |
(MenuItem |
|
2022 |
label: '-' |
|
2023 |
) |
|
2024 |
(MenuItem |
|
5830 | 2025 |
enabled: canReadAbbrevFile |
2026 |
label: 'Install Autoloaded' |
|
2027 |
itemValue: readAbbrevFile |
|
2028 |
translateLabel: true |
|
4230 | 2029 |
) |
5830 | 2030 |
(MenuItem |
2031 |
enabled: anySTFilesPresent |
|
6521 | 2032 |
label: 'Install All ST-Files as Autoloaded' |
5830 | 2033 |
itemValue: installAllAsAutoloaded |
2034 |
translateLabel: true |
|
4230 | 2035 |
) |
5830 | 2036 |
(MenuItem |
6586 | 2037 |
enabled: recursiveAnySTFilesPresent |
6521 | 2038 |
label: 'Recursive Install All ST-Files as Autoloaded' |
2039 |
itemValue: installAllAsAutoloadedRecursive |
|
2040 |
translateLabel: true |
|
2041 |
) |
|
2042 |
(MenuItem |
|
5830 | 2043 |
label: '-' |
4230 | 2044 |
) |
5830 | 2045 |
(MenuItem |
6593 | 2046 |
label: 'File Operations' |
2047 |
translateLabel: true |
|
2048 |
submenuChannel: fileOpMenu |
|
2049 |
) |
|
2050 |
(MenuItem |
|
5830 | 2051 |
label: 'File Utilities' |
2052 |
translateLabel: true |
|
2053 |
submenu: |
|
2054 |
(Menu |
|
2055 |
( |
|
2056 |
(MenuItem |
|
2057 |
enabled: hasFileSelection |
|
2058 |
label: 'Editor' |
|
2059 |
itemValue: openEditor |
|
2060 |
translateLabel: true |
|
4820 | 2061 |
) |
5830 | 2062 |
(MenuItem |
2063 |
enabled: hasFileSelection |
|
2064 |
label: 'HTML Reader' |
|
2065 |
itemValue: openHTMLReader |
|
2066 |
translateLabel: true |
|
4820 | 2067 |
) |
5830 | 2068 |
(MenuItem |
8832 | 2069 |
enabled: hasFileSelection |
2070 |
label: 'Web Browser' |
|
2071 |
itemValue: openWebBrowser |
|
2072 |
translateLabel: true |
|
2073 |
) |
|
2074 |
(MenuItem |
|
8611
3d979ab577b7
xml-inspector always enabled.
Claus Gittinger <cg@exept.de>
parents:
8601
diff
changeset
|
2075 |
"/ enabled: hasXmlFileSelected |
7869 | 2076 |
label: 'XML Inspector' |
2077 |
itemValue: parseXmlFile |
|
2078 |
translateLabel: true |
|
2079 |
isVisible: hasXml |
|
7897
598301fad7b4
Missing aspect #hasXmlFileSelection
Stefan Vogel <sv@exept.de>
parents:
7879
diff
changeset
|
2080 |
showBusyCursorWhilePerforming: true |
7869 | 2081 |
) |
2082 |
(MenuItem |
|
5830 | 2083 |
enabled: hasFileSelection |
2084 |
label: 'Acroread (PDF Viewer)' |
|
2085 |
itemValue: openPDFViewer |
|
2086 |
translateLabel: true |
|
4820 | 2087 |
) |
5830 | 2088 |
(MenuItem |
2089 |
enabled: hasASN1AndSelection |
|
2090 |
label: 'ASN1 Browser' |
|
2091 |
itemValue: openASN1Browser |
|
2092 |
translateLabel: true |
|
2093 |
isVisible: hasASN1 |
|
4820 | 2094 |
) |
5830 | 2095 |
(MenuItem |
2096 |
enabled: hasCBrowser |
|
2097 |
label: 'C Browser' |
|
2098 |
itemValue: openCBrowser |
|
2099 |
translateLabel: true |
|
2100 |
isVisible: hasCBrowser |
|
4820 | 2101 |
) |
5830 | 2102 |
(MenuItem |
2103 |
enabled: hasJavaAndSelection |
|
2104 |
label: 'Applet Viewer' |
|
2105 |
itemValue: openAppletViewer |
|
2106 |
translateLabel: true |
|
2107 |
isVisible: hasJava |
|
4820 | 2108 |
) |
5830 | 2109 |
(MenuItem |
2110 |
enabled: hasMP3PlayerAndSelection |
|
2111 |
label: 'MP3 Player' |
|
2112 |
itemValue: openMP3Player |
|
2113 |
translateLabel: true |
|
2114 |
isVisible: hasMP3Player |
|
4820 | 2115 |
) |
5830 | 2116 |
(MenuItem |
2117 |
enabled: hasFileSelection |
|
2118 |
label: 'xv (Image Viewer)' |
|
2119 |
itemValue: openXV |
|
2120 |
translateLabel: true |
|
6460 | 2121 |
isVisible: systemIsUnix |
4950 | 2122 |
) |
5830 | 2123 |
(MenuItem |
2124 |
enabled: currentFilesAreInSameDirectory |
|
2125 |
label: 'Slide Show' |
|
2126 |
itemValue: openSlideShow |
|
2127 |
translateLabel: true |
|
2128 |
isVisible: hasSlideShow |
|
4820 | 2129 |
) |
5830 | 2130 |
(MenuItem |
2131 |
enabled: hasFileSelection |
|
2132 |
label: 'gv (Postscript Viewer)' |
|
2133 |
itemValue: openGV |
|
2134 |
translateLabel: true |
|
6460 | 2135 |
isVisible: systemIsUnix |
2136 |
) |
|
2137 |
(MenuItem |
|
2138 |
enabled: hasMP3PlayerAndSelection |
|
2139 |
label: 'MP3 Player' |
|
2140 |
itemValue: openMP3Player |
|
2141 |
translateLabel: true |
|
2142 |
isVisible: hasMP3Player |
|
4957 | 2143 |
) |
5830 | 2144 |
(MenuItem |
2145 |
enabled: hasFileSelection |
|
9509 | 2146 |
label: 'Realplay (avi viewer)' |
5830 | 2147 |
itemValue: openRP |
2148 |
translateLabel: true |
|
6460 | 2149 |
isVisible: systemIsUnix |
2150 |
) |
|
2151 |
(MenuItem |
|
2152 |
label: '-' |
|
2153 |
) |
|
2154 |
(MenuItem |
|
2155 |
label: 'Smalltalk' |
|
2156 |
translateLabel: true |
|
2157 |
submenu: |
|
2158 |
(Menu |
|
2159 |
( |
|
2160 |
(MenuItem |
|
2161 |
enabled: hasSnapshotSelection |
|
2162 |
label: 'Snapshot Image Browser' |
|
2163 |
itemValue: openSnapshotImageBrowser |
|
2164 |
translateLabel: true |
|
2165 |
) |
|
2166 |
(MenuItem |
|
2167 |
enabled: canCreateNewProject |
|
2168 |
label: 'Create Smalltalk Project' |
|
2169 |
itemValue: createProjectAndOpenProjectBrowser |
|
2170 |
translateLabel: true |
|
2171 |
) |
|
2172 |
(MenuItem |
|
2173 |
label: '-' |
|
2174 |
) |
|
2175 |
(MenuItem |
|
8426 | 2176 |
enabled: hasResourceFileSelected |
6460 | 2177 |
label: 'Show Contents of Resourcefile' |
2178 |
itemValue: readAndShowResources |
|
2179 |
translateLabel: true |
|
2180 |
) |
|
8426 | 2181 |
(MenuItem |
2182 |
enabled: hasResourceFileSelected |
|
2183 |
label: 'Resource File Editor' |
|
2184 |
itemValue: openResourceFileEditor |
|
2185 |
translateLabel: true |
|
2186 |
showBusyCursorWhilePerforming: true |
|
2187 |
) |
|
8454
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
2188 |
(MenuItem |
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
2189 |
label: '-' |
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
2190 |
) |
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
2191 |
(MenuItem |
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
2192 |
enabled: hasFileSelection |
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
2193 |
label: 'Contents as ByteArray' |
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
2194 |
itemValue: fileContentsAsByteArray |
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
2195 |
translateLabel: true |
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
2196 |
) |
6460 | 2197 |
) |
2198 |
nil |
|
2199 |
nil |
|
2200 |
) |
|
2201 |
) |
|
2202 |
(MenuItem |
|
2203 |
label: 'Image' |
|
2204 |
translateLabel: true |
|
2205 |
submenu: |
|
2206 |
(Menu |
|
2207 |
( |
|
2208 |
(MenuItem |
|
2209 |
enabled: hasFileSelection |
|
2210 |
label: 'Image Editor' |
|
2211 |
itemValue: openImageEditor |
|
2212 |
translateLabel: true |
|
2213 |
) |
|
2214 |
(MenuItem |
|
2215 |
enabled: hasFileSelection |
|
2216 |
label: 'Image Preview' |
|
2217 |
itemValue: openImagePreview |
|
2218 |
translateLabel: true |
|
2219 |
) |
|
2220 |
(MenuItem |
|
2221 |
enabled: hasFileSelection |
|
2222 |
label: 'Image Inspector' |
|
2223 |
itemValue: openImageInspector |
|
2224 |
translateLabel: true |
|
2225 |
) |
|
2226 |
(MenuItem |
|
2227 |
label: '-' |
|
2228 |
) |
|
2229 |
(MenuItem |
|
2230 |
enabled: hasFileSelection |
|
2231 |
label: 'Convert to GIF' |
|
2232 |
itemValue: convertImageToGIF |
|
2233 |
translateLabel: true |
|
2234 |
) |
|
2235 |
(MenuItem |
|
2236 |
enabled: hasFileSelection |
|
2237 |
label: 'Convert to PNG' |
|
2238 |
itemValue: convertImageToPNG |
|
2239 |
translateLabel: true |
|
2240 |
) |
|
2241 |
(MenuItem |
|
2242 |
enabled: hasFileSelection |
|
2243 |
label: 'Convert to XPM' |
|
2244 |
itemValue: convertImageToXPM |
|
2245 |
translateLabel: true |
|
2246 |
) |
|
2247 |
(MenuItem |
|
2248 |
enabled: hasFileSelection |
|
2249 |
label: 'Convert to JPG' |
|
2250 |
itemValue: convertImageToJPG |
|
2251 |
translateLabel: true |
|
2252 |
) |
|
2253 |
) |
|
2254 |
nil |
|
2255 |
nil |
|
2256 |
) |
|
2257 |
) |
|
2258 |
(MenuItem |
|
2259 |
enabled: hasZipFileSelected |
|
2260 |
label: 'ZipFile Tool' |
|
2261 |
itemValue: openZipTool |
|
2262 |
translateLabel: true |
|
2263 |
) |
|
2264 |
(MenuItem |
|
2265 |
enabled: hasFileSelection |
|
2266 |
label: 'Hex Dump' |
|
2267 |
itemValue: fileHexDump |
|
2268 |
translateLabel: true |
|
4958 | 2269 |
) |
9509 | 2270 |
"/ something I would like to have... |
2271 |
"/ (MenuItem |
|
2272 |
"/ enabled: hasFileSelection |
|
2273 |
"/ label: 'Hex Dump of First n Bytes...' |
|
2274 |
"/ itemValue: fileHexDumpOfFirstNBytes |
|
2275 |
"/ translateLabel: true |
|
2276 |
"/ ) |
|
2277 |
"/ (MenuItem |
|
2278 |
"/ enabled: hasFileSelection |
|
2279 |
"/ label: 'Hex Dump of Last n Bytes...' |
|
2280 |
"/ itemValue: fileHexDumpOfLastNBytes |
|
2281 |
"/ translateLabel: true |
|
2282 |
"/ ) |
|
4820 | 2283 |
) |
2284 |
nil |
|
2285 |
nil |
|
2286 |
) |
|
4230 | 2287 |
) |
5830 | 2288 |
(MenuItem |
2289 |
label: 'Find' |
|
2290 |
translateLabel: true |
|
2291 |
submenu: |
|
2292 |
(Menu |
|
2293 |
( |
|
2294 |
(MenuItem |
|
2295 |
label: 'File...' |
|
2296 |
itemValue: fileFindFile |
|
2297 |
translateLabel: true |
|
4367 | 2298 |
) |
5830 | 2299 |
(MenuItem |
2300 |
label: 'Duplicate Files' |
|
2301 |
itemValue: fileFindDuplicates |
|
2302 |
translateLabel: true |
|
5082 | 2303 |
) |
5830 | 2304 |
(MenuItem |
2305 |
enabled: hasSelection |
|
2306 |
label: 'All Duplicate Files (Recursive)' |
|
2307 |
itemValue: fileFindAllDuplicates |
|
2308 |
translateLabel: true |
|
4367 | 2309 |
) |
8510 | 2310 |
(MenuItem |
2311 |
label: 'Similar Image Files' |
|
2312 |
itemValue: fileFindSimilarImages |
|
2313 |
translateLabel: true |
|
2314 |
isVisible: hasImageColorHistogram |
|
2315 |
) |
|
4367 | 2316 |
) |
2317 |
nil |
|
2318 |
nil |
|
2319 |
) |
|
4230 | 2320 |
) |
2321 |
) |
|
2322 |
nil |
|
2323 |
nil |
|
4164
81154143d447
move toolsMenuSpec from FileBrowserV2 to AbstractFileBrowser
penk
parents:
4163
diff
changeset
|
2324 |
) |
9490 | 2325 |
|
9596 | 2326 |
"Modified: / 26-10-2010 / 17:15:52 / cg" |
4164
81154143d447
move toolsMenuSpec from FileBrowserV2 to AbstractFileBrowser
penk
parents:
4163
diff
changeset
|
2327 |
! |
81154143d447
move toolsMenuSpec from FileBrowserV2 to AbstractFileBrowser
penk
parents:
4163
diff
changeset
|
2328 |
|
4018 | 2329 |
viewDetailsMenuSpec |
2330 |
"This resource specification was automatically generated |
|
2331 |
by the MenuEditor of ST/X." |
|
2332 |
||
2333 |
"Do not manually edit this!! If it is corrupted, |
|
2334 |
the MenuEditor may not be able to read the specification." |
|
2335 |
||
2336 |
" |
|
4648 | 2337 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#viewDetailsMenuSpec |
2338 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser viewDetailsMenuSpec)) startUp |
|
4018 | 2339 |
" |
2340 |
||
2341 |
<resource: #menu> |
|
2342 |
||
2343 |
^ |
|
2344 |
#(#Menu |
|
4414 | 2345 |
#( |
2346 |
#(#MenuItem |
|
2347 |
#label: '-' |
|
2348 |
) |
|
2349 |
#(#MenuItem |
|
2350 |
#label: 'Hidden Files' |
|
2351 |
#translateLabel: true |
|
2352 |
#indication: #showHiddenFiles |
|
2353 |
) |
|
2354 |
) |
|
2355 |
nil |
|
2356 |
nil |
|
4018 | 2357 |
) |
3892 | 2358 |
! ! |
2359 |
||
2360 |
!AbstractFileBrowser class methodsFor:'misc'! |
|
2361 |
||
2362 |
newLock |
|
2363 |
^ CodeExecutionLock new |
|
2364 |
! ! |
|
2365 |
||
5644
e24749db1f5f
share resources with FileBrowser
Claus Gittinger <cg@exept.de>
parents:
5634
diff
changeset
|
2366 |
!AbstractFileBrowser class methodsFor:'resources'! |
e24749db1f5f
share resources with FileBrowser
Claus Gittinger <cg@exept.de>
parents:
5634
diff
changeset
|
2367 |
|
e24749db1f5f
share resources with FileBrowser
Claus Gittinger <cg@exept.de>
parents:
5634
diff
changeset
|
2368 |
classResources |
e24749db1f5f
share resources with FileBrowser
Claus Gittinger <cg@exept.de>
parents:
5634
diff
changeset
|
2369 |
^ FileBrowser classResources |
e24749db1f5f
share resources with FileBrowser
Claus Gittinger <cg@exept.de>
parents:
5634
diff
changeset
|
2370 |
! ! |
e24749db1f5f
share resources with FileBrowser
Claus Gittinger <cg@exept.de>
parents:
5634
diff
changeset
|
2371 |
|
4610 | 2372 |
!AbstractFileBrowser class methodsFor:'utilities'! |
2373 |
||
2374 |
contentsOfFileAsHexDump:f |
|
8472 | 2375 |
^ self contentsOfFileAsHexDump:f withLimit:nil lastPart:nil |
2376 |
! |
|
2377 |
||
2378 |
contentsOfFileAsHexDump:f withLimit:limitOrNil lastPart:showLastPartOrNil |
|
4610 | 2379 |
|resources fileName stream data offs |
8472 | 2380 |
addrDigits col line lineStream asciiLineStream lines answer sizeLimit showLastPart| |
4610 | 2381 |
|
2382 |
resources := self classResources. |
|
2383 |
||
2384 |
fileName := f baseName. |
|
2385 |
f isDirectory ifTrue:[ |
|
2386 |
Dialog warn:(resources string:'%1 is a directory.' with:fileName). |
|
2387 |
^ nil |
|
2388 |
]. |
|
2389 |
f exists ifFalse:[ |
|
2390 |
Dialog warn:(resources string:'oops, ''%1'' is gone or unreadable.' with:fileName). |
|
2391 |
^ nil |
|
2392 |
]. |
|
2393 |
f isReadable ifFalse:[ |
|
2394 |
Dialog warn:(resources string:'''%1'' is unreadable.' with:fileName). |
|
2395 |
^ nil |
|
2396 |
]. |
|
6672
478b83a3753a
max size to be shown without dialog
Claus Gittinger <cg@exept.de>
parents:
6671
diff
changeset
|
2397 |
f fileSize > (1024*1024) ifTrue:[ |
8472 | 2398 |
limitOrNil notNil ifTrue:[ |
2399 |
sizeLimit := limitOrNil. |
|
2400 |
showLastPart := showLastPartOrNil |
|
2401 |
] ifFalse:[ |
|
2402 |
answer := Dialog |
|
2403 |
confirmWithCancel:(resources |
|
2404 |
stringWithCRs:'"%1" is very large (%2).\\Show all or only the first 4 Mb ?' |
|
2405 |
with:(fileName contractTo:40) allBold |
|
2406 |
with:(UnitConverter fileSizeStringFor:f fileSize)) |
|
2407 |
labels:#('Cancel' 'Show All' 'Show First Part' ). |
|
2408 |
||
2409 |
answer isNil ifTrue:[^ nil]. |
|
2410 |
answer ifTrue:[ |
|
2411 |
sizeLimit := 4 * 1024 * 1024 |
|
2412 |
]. |
|
8436 | 2413 |
]. |
4610 | 2414 |
]. |
2415 |
||
2416 |
stream := f readStream binary. |
|
8436 | 2417 |
sizeLimit notNil ifTrue:[ |
8472 | 2418 |
showLastPart == true ifTrue:[ |
2419 |
stream position:(f fileSize - sizeLimit). |
|
2420 |
]. |
|
8436 | 2421 |
data := stream nextBytes:sizeLimit. |
2422 |
] ifFalse:[ |
|
2423 |
data := stream contents. |
|
2424 |
]. |
|
4610 | 2425 |
stream close. |
2426 |
||
2427 |
col := 1. |
|
2428 |
offs := 0. |
|
2429 |
lines := StringCollection new. |
|
2430 |
||
2431 |
addrDigits := ((f fileSize + 1) log:16) truncated + 1. |
|
2432 |
||
5755
5e8165d55605
replaced '' writeStream by String writeStream
Claus Gittinger <cg@exept.de>
parents:
5753
diff
changeset
|
2433 |
lineStream := String writeStream. |
5e8165d55605
replaced '' writeStream by String writeStream
Claus Gittinger <cg@exept.de>
parents:
5753
diff
changeset
|
2434 |
asciiLineStream := String writeStream. |
4610 | 2435 |
|
2436 |
lineStream nextPutAll:(offs hexPrintString:addrDigits). |
|
2437 |
lineStream nextPutAll:': '. |
|
2438 |
||
2439 |
data do:[:byte | |
|
2440 |
lineStream nextPutAll:(byte hexPrintString:2). |
|
2441 |
(byte between:32 and:127) ifTrue:[ |
|
2442 |
asciiLineStream nextPut:(Character value:byte) |
|
2443 |
] ifFalse:[ |
|
2444 |
asciiLineStream nextPut:$. |
|
2445 |
]. |
|
2446 |
||
2447 |
offs := offs + 1. |
|
2448 |
col := col + 1. |
|
2449 |
col > 16 ifTrue:[ |
|
2450 |
lineStream nextPutAll:' '. |
|
2451 |
lineStream nextPutAll:asciiLineStream contents. |
|
2452 |
lines add:(lineStream contents). |
|
2453 |
(offs bitAnd:16rFF) == 0 ifTrue:[ |
|
2454 |
lines add:nil |
|
2455 |
]. |
|
2456 |
lineStream reset. |
|
2457 |
asciiLineStream reset. |
|
2458 |
||
2459 |
lineStream nextPutAll:(offs hexPrintString:addrDigits). |
|
2460 |
lineStream nextPutAll:': '. |
|
2461 |
col := 1. |
|
2462 |
] ifFalse:[ |
|
2463 |
lineStream space |
|
2464 |
] |
|
2465 |
]. |
|
2466 |
line := lineStream contents paddedTo:(3*16 + addrDigits + 1). |
|
2467 |
lines add:(line , ' ' , asciiLineStream contents). |
|
2468 |
^ lines |
|
2469 |
! ! |
|
2470 |
||
3892 | 2471 |
!AbstractFileBrowser methodsFor:'actions'! |
2472 |
||
2473 |
askForCommandFor:fileName thenDo:aBlock |
|
6284 | 2474 |
"setup and launch a querybox to ask for a unix command. |
3892 | 2475 |
Then evaluate aBlock passing the command-string as argument." |
2476 |
||
4523 | 2477 |
|box osName commandString| |
3892 | 2478 |
|
2479 |
osName := OperatingSystem platformName. |
|
2480 |
||
2481 |
box := FilenameEnterBox |
|
4414 | 2482 |
title:(resources string:'Execute %1 command:' with:osName) |
2483 |
okText:(resources string:'Execute') |
|
4523 | 2484 |
action:[:cmd | commandString := cmd]. |
3892 | 2485 |
|
2486 |
fileName notNil ifTrue:[ |
|
4414 | 2487 |
self initialCommandFor:fileName into:box. |
3892 | 2488 |
]. |
2489 |
box directory:(self getDirWithoutFileName:fileName). |
|
5003
a14ce263ada5
boxes no longer show at pointer
Claus Gittinger <cg@exept.de>
parents:
4982
diff
changeset
|
2490 |
box show. |
3892 | 2491 |
box destroy. |
2492 |
||
4523 | 2493 |
commandString notNil ifTrue:[ |
2494 |
aBlock value:commandString |
|
2495 |
]. |
|
2496 |
||
3892 | 2497 |
"Modified: / 7.9.1995 / 10:31:54 / claus" |
2498 |
"Modified: / 16.9.1997 / 15:35:10 / stefan" |
|
2499 |
"Modified: / 14.8.1998 / 14:12:52 / cg" |
|
2500 |
! |
|
2501 |
||
2502 |
changeFileBrowserTitleTo:aString |
|
4774 | 2503 |
self |
2504 |
applicationNamed:#FileBrowserV2 |
|
5009 | 2505 |
ifPresentDo:[:app | app changeFileBrowserTitleTo:aString] |
3892 | 2506 |
! |
2507 |
||
2508 |
copyFileList |
|
4774 | 2509 |
"copy the fileList to the clipBoard" |
2510 |
||
4973
e4b72eec43d3
refactoring the browserItemList access in directoryContentsBrowser
penk
parents:
4963
diff
changeset
|
2511 |
|fileList| |
e4b72eec43d3
refactoring the browserItemList access in directoryContentsBrowser
penk
parents:
4963
diff
changeset
|
2512 |
|
e4b72eec43d3
refactoring the browserItemList access in directoryContentsBrowser
penk
parents:
4963
diff
changeset
|
2513 |
fileList := self |
4774 | 2514 |
applicationNamed:#DirectoryContentsBrowser |
5009 | 2515 |
ifPresentDo:[:app | app browserFileList]. |
2516 |
||
2517 |
fileList notNil ifTrue:[ |
|
2518 |
self copyFileListToClipBoard:fileList. |
|
2519 |
] |
|
4973
e4b72eec43d3
refactoring the browserItemList access in directoryContentsBrowser
penk
parents:
4963
diff
changeset
|
2520 |
! |
e4b72eec43d3
refactoring the browserItemList access in directoryContentsBrowser
penk
parents:
4963
diff
changeset
|
2521 |
|
e4b72eec43d3
refactoring the browserItemList access in directoryContentsBrowser
penk
parents:
4963
diff
changeset
|
2522 |
copyFileListToClipBoard:fileList |
4774 | 2523 |
"copy the itemList to the clipBoard" |
2524 |
||
2525 |
|stream| |
|
2526 |
||
4973
e4b72eec43d3
refactoring the browserItemList access in directoryContentsBrowser
penk
parents:
4963
diff
changeset
|
2527 |
fileList isEmpty ifTrue:[^ self]. |
4774 | 2528 |
|
5772
603abfa8cf99
copy name(s) to clipboard - on lineFeed if only one file is selected
Claus Gittinger <cg@exept.de>
parents:
5756
diff
changeset
|
2529 |
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
|
2530 |
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
|
2531 |
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
|
2532 |
] ifFalse:[ |
603abfa8cf99
copy name(s) to clipboard - on lineFeed if only one file is selected
Claus Gittinger <cg@exept.de>
parents:
5756
diff
changeset
|
2533 |
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
|
2534 |
(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
|
2535 |
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
|
2536 |
] |
603abfa8cf99
copy name(s) to clipboard - on lineFeed if only one file is selected
Claus Gittinger <cg@exept.de>
parents:
5756
diff
changeset
|
2537 |
]. |
3892 | 2538 |
]. |
6034 | 2539 |
self window setClipboardText:stream contents. |
3892 | 2540 |
! |
2541 |
||
2542 |
copySelectedFilenames |
|
4774 | 2543 |
"copy the selected fileNames to the clipBoard" |
2544 |
||
4973
e4b72eec43d3
refactoring the browserItemList access in directoryContentsBrowser
penk
parents:
4963
diff
changeset
|
2545 |
|fileList| |
e4b72eec43d3
refactoring the browserItemList access in directoryContentsBrowser
penk
parents:
4963
diff
changeset
|
2546 |
|
e4b72eec43d3
refactoring the browserItemList access in directoryContentsBrowser
penk
parents:
4963
diff
changeset
|
2547 |
fileList := self |
4774 | 2548 |
applicationNamed:#DirectoryContentsBrowser |
5009 | 2549 |
ifPresentDo:[:appl | appl selectedFileNames]. |
2550 |
fileList notNil ifTrue:[ |
|
2551 |
self copyFileListToClipBoard:fileList. |
|
2552 |
]. |
|
3892 | 2553 |
! |
2554 |
||
2555 |
doAddTerminal |
|
5960 | 2556 |
|dir| |
2557 |
||
2558 |
dir := self currentDirectory. |
|
3892 | 2559 |
|
5960 | 2560 |
dir isNil ifTrue:[ |
4414 | 2561 |
dir := Filename homeDirectory |
3892 | 2562 |
]. |
4774 | 2563 |
|
5009 | 2564 |
self |
2565 |
applicationNamed:#FileApplicationNoteBook |
|
2566 |
ifPresentDo:[:appl | appl addTerminalIn:dir]. |
|
3892 | 2567 |
! |
2568 |
||
2569 |
doOpenSearchFile |
|
5961 | 2570 |
|item file| |
2571 |
||
2572 |
file := self firstSelectedFileName. |
|
2573 |
file isNil ifTrue:[ |
|
2574 |
file := Filename homeDirectory asAbsoluteFilename. |
|
2575 |
]. |
|
2576 |
item := DirectoryContentsBrowser itemClass fileName:file. |
|
3892 | 2577 |
self openSearchFileOn:item. |
2578 |
! |
|
2579 |
||
2580 |
doShowFileContents |
|
5009 | 2581 |
self |
2582 |
applicationNamed:#DirectoryContentsBrowser |
|
2583 |
ifPresentDo:[:appl | ^ appl doShowFileContents]. |
|
2584 |
||
2585 |
^ nil |
|
3892 | 2586 |
! |
2587 |
||
2588 |
doShowProperties |
|
2589 |
"show long stat (file)-info" |
|
2590 |
||
2591 |
self fileGetInfo:true |
|
2592 |
! |
|
2593 |
||
5528 | 2594 |
fileEncodingDialog |
2595 |
"open a dialog to allow change of the files character encoding. |
|
2596 |
Files are converted to internal encoding when read, and converted back |
|
2597 |
to this encoding when saved. |
|
2598 |
Notice: currently, not too many encodings are supported by the system." |
|
2599 |
||
2600 |
|bindings encodings encodingDescr idx selectedEncoding| |
|
2601 |
||
2602 |
encodingDescr := CharacterEncoder supportedExternalEncodings. |
|
2603 |
encodings := encodingDescr collect:[:d | d isNil ifTrue:[nil] ifFalse:[d first]]. |
|
2604 |
||
2605 |
bindings := IdentityDictionary new. |
|
2606 |
bindings at:#encodingList put:encodingDescr. |
|
2607 |
bindings at:#selectedEncoding put:(encodings indexOf:self fileEncoding ifAbsent:1) asValue. |
|
5737 | 2608 |
bindings at:#lockFileEncoding put:(self lockFileEncodingHolder value asValue). |
2609 |
||
5528 | 2610 |
(self openDialogInterface:#encodingDialogSpec withBindings:bindings) |
2611 |
ifTrue:[ |
|
2612 |
idx := (bindings at:#selectedEncoding) value. |
|
2613 |
selectedEncoding := encodings at:idx. |
|
2614 |
selectedEncoding notNil ifTrue:[ |
|
5704 | 2615 |
self fileEncoding:selectedEncoding asSymbol. |
5528 | 2616 |
]. |
5737 | 2617 |
self lockFileEncoding:(bindings at:#lockFileEncoding) value. |
5528 | 2618 |
]. |
2619 |
||
2620 |
"Modified: 30.6.1997 / 14:41:12 / cg" |
|
2621 |
! |
|
2622 |
||
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
2623 |
gotoFile:aFilename |
5380
2f738f3a34b1
fixed bug introduced by stefans beautification ;-)
Claus Gittinger <cg@exept.de>
parents:
5374
diff
changeset
|
2624 |
"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
|
2625 |
|
5959 | 2626 |
|currentFileNameHolder currentSel| |
2627 |
||
2628 |
currentFileNameHolder := self currentFileNameHolder. |
|
2629 |
||
2630 |
currentSel := currentFileNameHolder value. |
|
5380
2f738f3a34b1
fixed bug introduced by stefans beautification ;-)
Claus Gittinger <cg@exept.de>
parents:
5374
diff
changeset
|
2631 |
(currentSel includes:aFilename) ifFalse:[ |
5959 | 2632 |
currentFileNameHolder value:(OrderedCollection with:(aFilename asAbsoluteFilename)). |
3964 | 2633 |
]. |
3892 | 2634 |
! |
2635 |
||
4392 | 2636 |
newTextEditor |
5009 | 2637 |
self |
2638 |
applicationNamed:#FileApplicationNoteBook |
|
2639 |
ifPresentDo:[:appl | ^ appl newTextEditor]. |
|
2640 |
||
2641 |
^ nil. |
|
2642 |
! |
|
2643 |
||
2644 |
openApplByFileItem:anItem |
|
8490 | 2645 |
"/ q: is the following always wanted ? |
9267 | 2646 |
self window sensor shiftDown ifFalse:[ |
2647 |
anItem fileName isExecutableProgram ifTrue:[ |
|
2648 |
self executeCommand:anItem fileName pathName. |
|
2649 |
^ self. |
|
2650 |
]. |
|
2651 |
||
8490 | 2652 |
"/ OperatingSystem isMSWINDOWSlike ifTrue:[ |
2653 |
"/ Error handle:[:ex | |
|
2654 |
"/ ] do:[ |
|
2655 |
"/ OperatingSystem |
|
2656 |
"/ shellExecute:nil |
|
2657 |
"/ lpOperation:'open' |
|
2658 |
"/ lpFile:(anItem fileName pathName) |
|
2659 |
"/ lpParameters:nil |
|
2660 |
"/ lpDirectory:(self directory pathName) |
|
2661 |
"/ nShowCmd:#SW_SHOWNORMAL. |
|
2662 |
"/ ^ self. |
|
2663 |
"/ ] |
|
2664 |
"/ ] |
|
9267 | 2665 |
]. |
5306 | 2666 |
^ self |
5009 | 2667 |
applicationNamed:#FileApplicationNoteBook |
5306 | 2668 |
ifPresentDo:[:appl | appl openApplByFileItem:anItem]. |
3892 | 2669 |
! |
2670 |
||
4392 | 2671 |
openApplForFile:aFilename |
5306 | 2672 |
^ self openApplByFileItem:(DirectoryContentsBrowser itemClass fileName:aFilename). |
4392 | 2673 |
! |
2674 |
||
3892 | 2675 |
openCommandResultApplication |
2676 |
||
5009 | 2677 |
self |
2678 |
applicationNamed:#FileApplicationNoteBook |
|
2679 |
ifPresentDo:[:appl | ^ appl openCommandResultApplication]. |
|
2680 |
||
2681 |
^ nil |
|
3892 | 2682 |
! |
2683 |
||
5010 | 2684 |
openNewTextEditorOn:anItem |
5009 | 2685 |
self |
2686 |
applicationNamed:#FileApplicationNoteBook |
|
5010 | 2687 |
ifPresentDo:[:appl | ^ appl openNewTextEditorOn:anItem ]. |
5009 | 2688 |
|
2689 |
^ nil |
|
4880
87f511659680
edit file in context menu of DirectoryContentsBroser opens a new tab
penk
parents:
4878
diff
changeset
|
2690 |
! |
87f511659680
edit file in context menu of DirectoryContentsBroser opens a new tab
penk
parents:
4878
diff
changeset
|
2691 |
|
5010 | 2692 |
openSearchFileOn:anItem |
5009 | 2693 |
self |
2694 |
applicationNamed:#FileApplicationNoteBook |
|
5010 | 2695 |
ifPresentDo:[:appl | ^ appl openSearchFileOn:anItem]. |
5009 | 2696 |
|
2697 |
^ nil. |
|
3892 | 2698 |
! |
2699 |
||
5162 | 2700 |
openTextEditorForFile:aFilename |
2701 |
^ self openTextEditorOn:(DirectoryContentsBrowser itemClass fileName:aFilename). |
|
2702 |
! |
|
2703 |
||
5010 | 2704 |
openTextEditorOn:anItem |
5009 | 2705 |
self |
2706 |
applicationNamed:#FileApplicationNoteBook |
|
5010 | 2707 |
ifPresentDo:[:appl | ^ appl openTextEditorOn:anItem ]. |
5009 | 2708 |
|
2709 |
^ nil. |
|
3892 | 2710 |
! |
2711 |
||
5010 | 2712 |
openTextEditorOn:anItem type:aDirDescrOrFile |
5009 | 2713 |
self |
2714 |
applicationNamed:#FileApplicationNoteBook |
|
5010 | 2715 |
ifPresentDo:[:appl | ^ appl openTextEditorOn:anItem type:aDirDescrOrFile]. |
5009 | 2716 |
|
2717 |
^ nil. |
|
4618 | 2718 |
! |
2719 |
||
5959 | 2720 |
setCurrentFileName:aFilename |
2721 |
self setCurrentFileNames:(OrderedCollection with:aFilename). |
|
2722 |
! |
|
2723 |
||
2724 |
setCurrentFileNames:aCollectionOfFilenames |
|
2725 |
self currentFileNameHolder value:aCollectionOfFilenames. |
|
2726 |
! |
|
2727 |
||
3892 | 2728 |
updateAndSelect:aColOfFiles |
4785
5a3f7a0c3ff1
symbolic link creation code fixed
Claus Gittinger <cg@exept.de>
parents:
4782
diff
changeset
|
2729 |
self updateCurrentDirectory. |
4707
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
2730 |
aColOfFiles notNil ifTrue:[ |
5959 | 2731 |
self setCurrentFileNames:aColOfFiles |
4707
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
2732 |
]. |
3892 | 2733 |
! |
2734 |
||
2735 |
updateCurrentDirectory |
|
5739 | 2736 |
self updateCurrentDirectory:false |
2737 |
! |
|
2738 |
||
2739 |
updateCurrentDirectory:withReread |
|
4785
5a3f7a0c3ff1
symbolic link creation code fixed
Claus Gittinger <cg@exept.de>
parents:
4782
diff
changeset
|
2740 |
DirectoryContents flushCachedDirectoryFor:(self getBestDirectory). |
5a3f7a0c3ff1
symbolic link creation code fixed
Claus Gittinger <cg@exept.de>
parents:
4782
diff
changeset
|
2741 |
|
5009 | 2742 |
self |
2743 |
applicationNamed:#DirectoryContentsBrowser |
|
5739 | 2744 |
ifPresentDo:[:appl | withReread ifTrue:[appl doUpdate] ifFalse:[appl doUpdateDirectoryContents]]. |
5009 | 2745 |
self |
2746 |
applicationNamed:#DirectoryTreeBrowser |
|
2747 |
ifPresentDo:[:appl | appl doUpdate]. |
|
4345 | 2748 |
! |
2749 |
||
5739 | 2750 |
updateCurrentDirectoryWithReread |
2751 |
self updateCurrentDirectory:true |
|
2752 |
! |
|
2753 |
||
4345 | 2754 |
withActivityIndicationDo:aBlock |
2755 |
||
2756 |
self activityVisibilityChannel value:true. |
|
2757 |
[ |
|
9361 | 2758 |
self withWaitCursorDo:[ |
2759 |
aBlock value. |
|
2760 |
] |
|
4345 | 2761 |
] ensure:[ |
2762 |
self activityVisibilityChannel value:false. |
|
2763 |
] |
|
3892 | 2764 |
! ! |
2765 |
||
2766 |
!AbstractFileBrowser methodsFor:'actions bookmarks'! |
|
2767 |
||
2768 |
addBookmark |
|
2769 |
self currentFilesAreInSameDirectory ifFalse:[^ self]. |
|
6725 | 2770 |
self addBookmarks:(self currentSelectedDirectories). |
5960 | 2771 |
self class saveBookmarksInDefaultBookmarksFile |
4679 | 2772 |
! |
2773 |
||
2774 |
addBookmarks:aColOfDirectories |
|
4672
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
2775 |
aColOfDirectories do:[ :path | |
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
2776 |
self class addBookmark:path |
3892 | 2777 |
]. |
2778 |
! |
|
2779 |
||
8013 | 2780 |
editBookmarks |
2781 |
||
2782 |
| default selectedDirectories | |
|
2783 |
||
2784 |
selectedDirectories := self currentSelectedDirectories. |
|
2785 |
selectedDirectories notEmpty ifTrue:[default := selectedDirectories first]. |
|
2786 |
self class editBookmarksWithDefault: default. |
|
2787 |
! |
|
2788 |
||
3892 | 2789 |
hasBookmarks |
4672
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
2790 |
^ self class hasBookmarks |
3892 | 2791 |
! |
2792 |
||
2793 |
hasBookmarksToRemove |
|
2794 |
|bookmarks directories| |
|
2795 |
||
3982 | 2796 |
directories := self currentSelectedDirectories. |
3892 | 2797 |
bookmarks := self class directoryBookmarks. |
2798 |
^ (bookmarks size > 0 and:[directories notEmpty]) |
|
2799 |
! |
|
2800 |
||
2801 |
removeBookmark |
|
4672
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
2802 |
self currentSelectedDirectories do:[:dir| |
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
2803 |
self class removeBookmark:dir |
3892 | 2804 |
]. |
4679 | 2805 |
! |
2806 |
||
2807 |
saveBookmarks |
|
2808 |
self class saveBookmarks |
|
3892 | 2809 |
! ! |
2810 |
||
2811 |
!AbstractFileBrowser methodsFor:'actions history'! |
|
2812 |
||
2813 |
addToCommandHistory:aCommandString for:aFilename |
|
6369 | 2814 |
|cmd suffix cmdHist historySize| |
3892 | 2815 |
|
2816 |
cmdHist := self class commandHistory. |
|
6482
00207f456339
isEmptyOrNil / notEmptyOrNil refactoring
Claus Gittinger <cg@exept.de>
parents:
6479
diff
changeset
|
2817 |
(aCommandString notEmptyOrNil) ifTrue:[ |
4414 | 2818 |
cmdHist notNil ifTrue:[ |
2819 |
cmdHist addFirst:aCommandString. |
|
6369 | 2820 |
historySize := self class commandHistorySize. |
2821 |
(historySize notNil and:[cmdHist size > historySize]) ifTrue:[ |
|
4414 | 2822 |
cmdHist removeLast |
2823 |
] |
|
2824 |
]. |
|
2825 |
aFilename notNil ifTrue:[ |
|
2826 |
cmd := aCommandString copyTo:(aCommandString indexOf:Character space ifAbsent:[aCommandString size + 1])-1. |
|
2827 |
DefaultCommandPerSuffix isNil ifTrue:[ |
|
2828 |
DefaultCommandPerSuffix := Dictionary new. |
|
2829 |
]. |
|
2830 |
suffix := aFilename asFilename suffix. |
|
2831 |
suffix notNil ifTrue:[ |
|
2832 |
DefaultCommandPerSuffix at:suffix put:cmd. |
|
2833 |
] |
|
2834 |
] |
|
3892 | 2835 |
] |
2836 |
! |
|
2837 |
||
2838 |
doBack |
|
6286 | 2839 |
"go backward in the history" |
3892 | 2840 |
|
4022 | 2841 |
| fileName| |
2842 |
||
6369 | 2843 |
fileName := self directoryHistory goBackward. |
3892 | 2844 |
fileName notNil ifTrue:[ |
4347 | 2845 |
self gotoFile:(fileName asFilename). |
3892 | 2846 |
] |
2847 |
! |
|
2848 |
||
2849 |
doForward |
|
6286 | 2850 |
"go forward in the history" |
3892 | 2851 |
|
3964 | 2852 |
| fileName| |
2853 |
||
6369 | 2854 |
fileName := self directoryHistory goForward. |
3892 | 2855 |
fileName notNil ifTrue:[ |
4414 | 2856 |
self gotoFile:(fileName asFilename). |
4022 | 2857 |
] ifFalse:[ |
4414 | 2858 |
self enableForward value:false. |
4022 | 2859 |
|
2860 |
]. |
|
3892 | 2861 |
! ! |
2862 |
||
2863 |
!AbstractFileBrowser methodsFor:'applications'! |
|
2864 |
||
5009 | 2865 |
applicationNamed:anApplicationName ifPresentDo:aBlock |
2866 |
|appl| |
|
2867 |
||
2868 |
appl := self applications at:anApplicationName ifAbsent:nil. |
|
2869 |
appl notNil ifTrue:[ |
|
2870 |
^ aBlock value:appl |
|
2871 |
]. |
|
2872 |
^ nil. |
|
2873 |
! |
|
2874 |
||
4004 | 2875 |
directoryContentsBrowser |
2876 |
^ self applications at:#DirectoryContentsBrowser ifAbsent:nil. |
|
3892 | 2877 |
! ! |
2878 |
||
2879 |
!AbstractFileBrowser methodsFor:'aspects'! |
|
2880 |
||
2881 |
applications |
|
2882 |
^ aspects at:#applications |
|
2883 |
! |
|
2884 |
||
2885 |
backgroundProcesses |
|
2886 |
||
2887 |
^ self aspectFor:#backgroundProcesses ifAbsent:[List new] |
|
2888 |
! |
|
2889 |
||
4230 | 2890 |
canMake |
6095 | 2891 |
^ self aspectFor:#canMake ifAbsent:[ false asValue ]. |
4230 | 2892 |
! |
2893 |
||
3892 | 2894 |
currentDirectories |
6725 | 2895 |
" returns a holder on a Collection of all currently selected directories |
2896 |
if only a file is selected, currentDirectories holds the directory of the file |
|
3892 | 2897 |
" |
2898 |
||
2899 |
^ self aspectFor:#currentDirectories ifAbsent:[ (OrderedCollection new) asValue ]. |
|
2900 |
! |
|
2901 |
||
6725 | 2902 |
currentDirectoriesValue |
2903 |
" returns a Collection of all currently selected directories |
|
2904 |
if only a file is selected, currentDirectories holds the directory of the file |
|
2905 |
" |
|
2906 |
||
2907 |
^ self currentDirectories value |
|
2908 |
! |
|
2909 |
||
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
2910 |
currentDirectory |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
2911 |
"return the single current directory or nil" |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
2912 |
|
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
2913 |
|directories| |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
2914 |
|
6725 | 2915 |
directories := self currentSelectedDirectories. |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
2916 |
(directories size ~= 1) ifTrue:[ |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
2917 |
^ nil |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
2918 |
]. |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
2919 |
^ directories first. |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
2920 |
! |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
2921 |
|
3892 | 2922 |
currentFileNameHolder |
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
2923 |
"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
|
2924 |
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
|
2925 |
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
|
2926 |
|
6589 | 2927 |
^ self aspectFor:#currentFileNameHolder |
2928 |
ifAbsent:[ |
|
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
2929 |
|currentSel| |
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
2930 |
|
4692 | 2931 |
currentSel := self class currentSelection. |
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
2932 |
currentSel isEmpty ifTrue:[ |
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
2933 |
currentSel := OrderedCollection with:(Filename currentDirectory asAbsoluteFilename) |
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
2934 |
]. |
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
2935 |
currentSel asValue |
6589 | 2936 |
] |
2937 |
notPresentDo:[:holder| |
|
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
2938 |
|filenames newFilenames| |
4213
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
2939 |
filenames := holder value. |
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
2940 |
newFilenames := Set new. |
6589 | 2941 |
filenames do:[:eachFilename| |
2942 |
|existingFilename| |
|
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
2943 |
existingFilename := eachFilename. |
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
2944 |
existingFilename notNil ifTrue:[ |
9649
ad956ada348e
changed: #currentFileNameHolder
Claus Gittinger <cg@exept.de>
parents:
9607
diff
changeset
|
2945 |
[existingFilename isRootDirectory or:[existingFilename exists]] whileFalse:[ |
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
2946 |
existingFilename := existingFilename directory. |
4955
378481247391
if no item is selected directory up action do nothing now
penk
parents:
4950
diff
changeset
|
2947 |
]. |
9649
ad956ada348e
changed: #currentFileNameHolder
Claus Gittinger <cg@exept.de>
parents:
9607
diff
changeset
|
2948 |
existingFilename exists ifTrue:[ |
ad956ada348e
changed: #currentFileNameHolder
Claus Gittinger <cg@exept.de>
parents:
9607
diff
changeset
|
2949 |
newFilenames add:existingFilename. |
ad956ada348e
changed: #currentFileNameHolder
Claus Gittinger <cg@exept.de>
parents:
9607
diff
changeset
|
2950 |
]. |
4955
378481247391
if no item is selected directory up action do nothing now
penk
parents:
4950
diff
changeset
|
2951 |
] |
4213
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
2952 |
]. |
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
2953 |
newFilenames asOrderedCollection. |
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
2954 |
] |
9649
ad956ada348e
changed: #currentFileNameHolder
Claus Gittinger <cg@exept.de>
parents:
9607
diff
changeset
|
2955 |
|
ad956ada348e
changed: #currentFileNameHolder
Claus Gittinger <cg@exept.de>
parents:
9607
diff
changeset
|
2956 |
"Modified: / 27-11-2010 / 15:42:45 / cg" |
3892 | 2957 |
! |
2958 |
||
5528 | 2959 |
defaultFileEncoding |
2960 |
^ #'iso8859-1' "/ #'utf-8' |
|
2961 |
! |
|
2962 |
||
3892 | 2963 |
enableDirectoryUp |
2964 |
||
2965 |
^ self aspectFor:#enableDirectoryUp ifAbsent:[false asValue] |
|
2966 |
! |
|
2967 |
||
6456 | 2968 |
enableGotoDefaultDirectory |
2969 |
^ self aspectFor:#enableGotoDefaultDirectory ifAbsent:[ true asValue ]. |
|
4593 | 2970 |
! |
2971 |
||
8168 | 2972 |
enableGotoDesktop |
2973 |
^ self aspectFor:#enableGotoDesktop ifAbsent:[ true asValue ]. |
|
2974 |
! |
|
2975 |
||
9572 | 2976 |
enableGotoDesktopDirectory |
2977 |
^ self aspectFor:#enableGotoDesktopDirectory ifAbsent:[ true asValue ]. |
|
2978 |
||
2979 |
"Created: / 01-10-2010 / 16:19:17 / cg" |
|
2980 |
! |
|
2981 |
||
6434 | 2982 |
enableGotoSmalltalkDirectory |
6456 | 2983 |
^ self aspectFor:#enableGotoSmalltalkDirectory ifAbsent:[ true asValue ]. |
6434 | 2984 |
! |
2985 |
||
3892 | 2986 |
enableHome |
2987 |
||
2988 |
^ self aspectFor:#enableHome ifAbsent:[ true asValue ]. |
|
2989 |
! |
|
2990 |
||
9596 | 2991 |
enableMakeCurrentDirectory |
2992 |
^ self aspectFor:#enableMakeCurrentDirectory ifAbsent:[ true asValue ]. |
|
2993 |
||
2994 |
"Created: / 26-10-2010 / 17:17:58 / cg" |
|
2995 |
! |
|
2996 |
||
3892 | 2997 |
enableViewNoteBookApplication |
2998 |
||
2999 |
^ self aspectFor:#enableViewNoteBookApplication ifAbsent:[false asValue] |
|
3000 |
! |
|
3001 |
||
5528 | 3002 |
fileEncoding |
3003 |
^ self fileEncodingHolder value |
|
3004 |
! |
|
3005 |
||
3006 |
fileEncoding:newEncoding |
|
5533 | 3007 |
self fileEncodingHolder value:newEncoding. |
3008 |
||
3009 |
self |
|
3010 |
applicationNamed:#FileApplicationNoteBook |
|
3011 |
ifPresentDo:[:nb | |
|
3012 |
|appl| |
|
3013 |
||
3014 |
appl := nb selectedApplication. |
|
5535 | 3015 |
(appl notNil and:[appl isTextEditor]) ifTrue:[ |
5533 | 3016 |
appl fileEncoding:newEncoding |
3017 |
] |
|
3018 |
]. |
|
5528 | 3019 |
! |
3020 |
||
5737 | 3021 |
fileEncodingHolder |
3022 |
^ self |
|
3023 |
aspectFor:#fileEncodingHolder |
|
3024 |
ifAbsent:[ |
|
3025 |
self |
|
3026 |
applicationNamed:#FileApplicationNoteBook |
|
3027 |
ifPresentDo:[:appl | appl fileEncodingHolder]. |
|
3028 |
] |
|
3029 |
! |
|
3030 |
||
5961 | 3031 |
firstSelectedFileName |
3032 |
|files| |
|
3033 |
||
7560 | 3034 |
files := self currentSelectedObjects. |
5961 | 3035 |
files notEmpty ifTrue:[ |
3036 |
^ files first |
|
3037 |
]. |
|
3038 |
^ nil |
|
7560 | 3039 |
|
3040 |
"Modified: / 04-12-2006 / 13:14:53 / cg" |
|
5961 | 3041 |
! |
3042 |
||
6456 | 3043 |
gotoDefaultDirectoryIsVisible |
9596 | 3044 |
^ true. |
3045 |
"/ ^ (Filename defaultDirectory asAbsoluteFilename) ~= (self smalltalkDirectory asAbsoluteFilename). |
|
3046 |
||
3047 |
"Modified: / 26-10-2010 / 17:23:51 / cg" |
|
6456 | 3048 |
! |
3049 |
||
9572 | 3050 |
gotoDesktopDirectoryIsVisible |
3051 |
Filename desktopDirectory = Filename homeDirectory ifTrue:[^ false]. |
|
3052 |
||
3053 |
^ (Filename desktopDirectory asAbsoluteFilename) ~= (self smalltalkDirectory asAbsoluteFilename). |
|
3054 |
||
3055 |
"Created: / 01-10-2010 / 16:26:27 / cg" |
|
3056 |
! |
|
3057 |
||
4618 | 3058 |
hasFileSelection |
3059 |
^ self aspectFor:#hasFileSelection ifAbsent:[ false asValue ]. |
|
3060 |
! |
|
3061 |
||
9490 | 3062 |
hasNotTwoDirectoriesSelectedHolder |
3063 |
^ self |
|
3064 |
aspectFor:#hasNotTwoDirectoriesSelectedHolder |
|
3065 |
ifAbsent:[ |
|
3066 |
BlockValue |
|
3067 |
with:[:m | self hasTwoDirectoriesSelected not] |
|
3068 |
argument:self currentFileNameHolder |
|
3069 |
]. |
|
3070 |
||
3071 |
"Created: / 20-05-2010 / 10:45:50 / cg" |
|
3072 |
! |
|
3073 |
||
5830 | 3074 |
hasNotTwoFilesSelectedHolder |
9490 | 3075 |
^ self |
3076 |
aspectFor:#hasNotTwoFilesSelectedHolder |
|
5830 | 3077 |
ifAbsent:[ |
3078 |
BlockValue |
|
3079 |
with:[:m | self hasTwoFilesSelected not] |
|
3080 |
argument:self currentFileNameHolder |
|
3081 |
]. |
|
9490 | 3082 |
|
3083 |
"Modified: / 20-05-2010 / 10:46:01 / cg" |
|
5830 | 3084 |
! |
3085 |
||
3892 | 3086 |
hasSelection |
3087 |
||
3088 |
^ self aspectFor:#hasSelection ifAbsent:[ false asValue ]. |
|
3089 |
! |
|
3090 |
||
9490 | 3091 |
hasTwoDirectoriesSelectedHolder |
3092 |
^ self |
|
3093 |
aspectFor:#hasTwoDirectoriesSelectedHolder |
|
3094 |
ifAbsent:[ |
|
3095 |
BlockValue |
|
3096 |
with:[:m | self hasTwoDirectoriesSelected] |
|
3097 |
argument:self currentFileNameHolder |
|
3098 |
]. |
|
3099 |
||
3100 |
"Created: / 20-05-2010 / 10:45:41 / cg" |
|
3101 |
! |
|
3102 |
||
4414 | 3103 |
hasTwoFilesSelectedHolder |
9490 | 3104 |
^ self |
3105 |
aspectFor:#hasTwoFilesSelectedHolder |
|
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
3106 |
ifAbsent:[ |
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
3107 |
BlockValue |
5830 | 3108 |
with:[:m | self hasTwoFilesSelected] |
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
3109 |
argument:self currentFileNameHolder |
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
3110 |
]. |
9490 | 3111 |
|
3112 |
"Modified: / 20-05-2010 / 10:46:08 / cg" |
|
4414 | 3113 |
! |
3114 |
||
5737 | 3115 |
lockFileEncoding:aBoolean |
3116 |
self lockFileEncodingHolder value:aBoolean. |
|
3117 |
||
3118 |
self |
|
3119 |
applicationNamed:#FileApplicationNoteBook |
|
3120 |
ifPresentDo:[:nb | |
|
3121 |
|appl| |
|
3122 |
||
3123 |
appl := nb selectedApplication. |
|
3124 |
(appl notNil and:[appl isTextEditor]) ifTrue:[ |
|
3125 |
appl lockFileEncoding:aBoolean |
|
3126 |
] |
|
3127 |
]. |
|
3128 |
! |
|
3129 |
||
3130 |
lockFileEncodingHolder |
|
3131 |
^ self |
|
3132 |
aspectFor:#lockFileEncodingHolder |
|
3133 |
ifAbsent:[ |
|
3134 |
self |
|
3135 |
applicationNamed:#FileApplicationNoteBook |
|
3136 |
ifPresentDo:[:appl | appl lockFileEncodingHolder]. |
|
3137 |
] |
|
3138 |
! |
|
3139 |
||
4523 | 3140 |
notify:aString |
3141 |
self notifyChannel value:aString |
|
3142 |
! |
|
3143 |
||
3892 | 3144 |
notifyChannel |
3145 |
||
3146 |
^ self aspectFor:#notifyChannel ifAbsent:['' asValue] |
|
4071 | 3147 |
! |
3148 |
||
9575
548adf8e9d98
added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents:
9572
diff
changeset
|
3149 |
progressPercentageHolder |
548adf8e9d98
added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents:
9572
diff
changeset
|
3150 |
^ self aspectFor:#progressPercentageHolder ifAbsent:[ nil asValue ]. |
548adf8e9d98
added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents:
9572
diff
changeset
|
3151 |
|
548adf8e9d98
added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents:
9572
diff
changeset
|
3152 |
"Created: / 11-10-2010 / 12:54:46 / cg" |
548adf8e9d98
added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents:
9572
diff
changeset
|
3153 |
! |
548adf8e9d98
added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents:
9572
diff
changeset
|
3154 |
|
4071 | 3155 |
rootHolder |
3156 |
"holder, which keeps the rootHolder of the treeView |
|
3157 |
" |
|
3158 |
||
4368
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
3159 |
^ self aspectFor:#rootHolder ifAbsent:[ |
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
3160 |
self class rootHolder asValue. |
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
3161 |
]. |
8192
26660fb61e7a
Make FileDialog usable as SubCanvas
Stefan Vogel <sv@exept.de>
parents:
8185
diff
changeset
|
3162 |
! |
26660fb61e7a
Make FileDialog usable as SubCanvas
Stefan Vogel <sv@exept.de>
parents:
8185
diff
changeset
|
3163 |
|
26660fb61e7a
Make FileDialog usable as SubCanvas
Stefan Vogel <sv@exept.de>
parents:
8185
diff
changeset
|
3164 |
rootHolder:aHolder |
26660fb61e7a
Make FileDialog usable as SubCanvas
Stefan Vogel <sv@exept.de>
parents:
8185
diff
changeset
|
3165 |
|
26660fb61e7a
Make FileDialog usable as SubCanvas
Stefan Vogel <sv@exept.de>
parents:
8185
diff
changeset
|
3166 |
self aspectFor:#rootHolder put:aHolder |
3892 | 3167 |
! ! |
3168 |
||
3169 |
!AbstractFileBrowser methodsFor:'aspects handling'! |
|
3170 |
||
3171 |
aspectFor:something ifAbsent:aBlock |
|
6284 | 3172 |
"returns the model for an aspect; these are stored in a common dictionary" |
3173 |
||
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3174 |
^ self aspectFor:something ifAbsent:aBlock notPresentDo:nil |
3892 | 3175 |
! |
3176 |
||
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3177 |
aspectFor:aKey ifAbsent:aBlock notPresentDo:notPresentBlock |
6284 | 3178 |
"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
|
3179 |
|
4213
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
3180 |
|holder saveAspectItem aspect| |
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
3181 |
|
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3182 |
holder := aspects at:aKey ifAbsent:[ |
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3183 |
masterApplication notNil ifTrue:[ |
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3184 |
holder := masterApplication aspectOrNil:aKey forSubApplication:self. |
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3185 |
]. |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3186 |
holder isNil ifTrue:[ |
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3187 |
saveAspectItem := self runtimeAspectValueFor:aKey. |
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3188 |
saveAspectItem notNil ifTrue:[ |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3189 |
saveAspectItem isHolder ifTrue:[ |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3190 |
holder := ValueHolder with:saveAspectItem value |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3191 |
] ifFalse:[ |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3192 |
holder := saveAspectItem value |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3193 |
]. |
4213
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
3194 |
] ifFalse:[ |
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3195 |
aspect := self userPreferencesAspectValueFor:aKey. |
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3196 |
aspect notNil ifTrue:[ |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3197 |
holder := aspect asValue |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3198 |
] ifFalse:[ |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3199 |
holder := aBlock value. |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3200 |
] |
4213
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
3201 |
]. |
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
3202 |
]. |
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
3203 |
holder notNil ifTrue:[ |
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3204 |
notPresentBlock notNil ifTrue:[ |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3205 |
holder value:(notPresentBlock value:holder). |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3206 |
]. |
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3207 |
aspects at:aKey put:holder |
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3208 |
]. |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3209 |
holder |
4213
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
3210 |
]. |
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
3211 |
^ holder |
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
3212 |
! |
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
3213 |
|
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3214 |
aspectFor:something put:aValueHolder |
6284 | 3215 |
"stores the model for an aspect; these are stored in a common dictionary" |
3216 |
||
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3217 |
aspects at:something put:aValueHolder |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3218 |
! |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3219 |
|
3892 | 3220 |
aspects |
6284 | 3221 |
"returns the common aspect dictionary" |
3222 |
||
3892 | 3223 |
^ aspects |
3224 |
! |
|
3225 |
||
3226 |
runtimeAspectValueFor:something |
|
3227 |
"returns the default aspect item from the class variable RuntimeAspects |
|
3228 |
" |
|
3229 |
^ self class runtimeAspects at:something ifAbsent:nil. |
|
3230 |
! |
|
3231 |
||
4201 | 3232 |
saveAspectValues |
3233 |
|saveAspects aspectValue| |
|
3234 |
||
3235 |
||
7078
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
3236 |
saveAspects := self class userPreferencesAspectList keys. |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
3237 |
saveAspects do:[ :aspectKey | |
4201 | 3238 |
aspectValue := (self perform:aspectKey) value. |
7078
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
3239 |
UserPreferences current |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
3240 |
at: ('fileBrowser_',aspectKey asString) asSymbol |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
3241 |
put: aspectValue. |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
3242 |
]. |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
3243 |
|
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
3244 |
"Modified: / 04-09-2006 / 10:02:41 / cg" |
4201 | 3245 |
! |
3246 |
||
3892 | 3247 |
saveRuntimeAspectValues |
3248 |
|savedAspects dictionary value isHolder aspect| |
|
3249 |
||
5941 | 3250 |
savedAspects := self class listOfRuntimeValuesToRemember. |
3892 | 3251 |
dictionary := Dictionary new. |
5941 | 3252 |
savedAspects do:[:aspectKey | |
4414 | 3253 |
aspect := self perform:aspectKey. |
3254 |
isHolder := aspect isValueModel. |
|
5941 | 3255 |
isHolder ifTrue:[ |
3256 |
value := aspect value |
|
3257 |
] ifFalse:[ |
|
3258 |
value := aspect |
|
3259 |
]. |
|
3260 |
dictionary at:aspectKey |
|
3261 |
put:(SaveAspectItem withValue:value isHolder:isHolder) |
|
3262 |
]. |
|
3263 |
RuntimeAspects := dictionary. |
|
3892 | 3264 |
! |
3265 |
||
4201 | 3266 |
userPreferencesAspectValueFor:something |
3267 |
"returns the default aspect from the Userpreferences |
|
3892 | 3268 |
" |
4201 | 3269 |
|
7078
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
3270 |
(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
|
3271 |
^ UserPreferences current |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
3272 |
at:('fileBrowser_',something) asSymbol |
9579
7107f49e4583
changed: #userPreferencesAspectValueFor:
Claus Gittinger <cg@exept.de>
parents:
9575
diff
changeset
|
3273 |
ifAbsent:nil "(self class userPreferencesAspectList at:something)". |
7107f49e4583
changed: #userPreferencesAspectValueFor:
Claus Gittinger <cg@exept.de>
parents:
9575
diff
changeset
|
3274 |
|
7107f49e4583
changed: #userPreferencesAspectValueFor:
Claus Gittinger <cg@exept.de>
parents:
9575
diff
changeset
|
3275 |
"Modified: / 14-10-2010 / 19:16:38 / cg" |
3892 | 3276 |
! ! |
3277 |
||
4011 | 3278 |
!AbstractFileBrowser methodsFor:'aspects-filter'! |
3279 |
||
9015 | 3280 |
filter:aString |
3281 |
self filterModel value:aString |
|
3282 |
! |
|
3283 |
||
4018 | 3284 |
filterBackgroundColor |
3285 |
||
3286 |
^ self aspectFor:#filterBackgroundColor ifAbsent:[Color white asValue] |
|
3287 |
! |
|
3288 |
||
4011 | 3289 |
filterBlockHolder |
3290 |
||
5658
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
3291 |
^ self aspectFor:#filterBlockHolder ifAbsent:[self makeFilterBlock asValue] |
4011 | 3292 |
! |
3293 |
||
3294 |
filterListModel |
|
3295 |
||
3296 |
^ self aspectFor:#filterListModel ifAbsent:[self class defaultFilterList] |
|
3297 |
! |
|
3298 |
||
3299 |
filterModel |
|
5941 | 3300 |
|m| |
3301 |
||
3302 |
m := self aspectFor:#filterModel ifAbsent:[(self filterListModel at:1) asValue]. |
|
3303 |
^ m |
|
4011 | 3304 |
! |
3305 |
||
8185
8b6f11fd7fbf
Make #filterModel reusable as SubCanvas
Stefan Vogel <sv@exept.de>
parents:
8172
diff
changeset
|
3306 |
filterModel:aHolder |
8b6f11fd7fbf
Make #filterModel reusable as SubCanvas
Stefan Vogel <sv@exept.de>
parents:
8172
diff
changeset
|
3307 |
self aspectFor:#filterModel put:aHolder. |
8b6f11fd7fbf
Make #filterModel reusable as SubCanvas
Stefan Vogel <sv@exept.de>
parents:
8172
diff
changeset
|
3308 |
! |
8b6f11fd7fbf
Make #filterModel reusable as SubCanvas
Stefan Vogel <sv@exept.de>
parents:
8172
diff
changeset
|
3309 |
|
4018 | 3310 |
filterValueBox |
3311 |
||
3312 |
^ self aspectFor:#filterValueBox ifAbsent:[ValueHolder new] |
|
3313 |
! |
|
3314 |
||
5658
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
3315 |
makeFilterBlock |
9102 | 3316 |
"return a two-arg filterblock on the files path- and base-name. This block should return true for files |
3317 |
to be shown" |
|
3318 |
||
7565
521264d23941
ignoreCase if Filename is not case sensitive in #makeFilterBlock
fm
parents:
7560
diff
changeset
|
3319 |
| filterString filterStrings filters showHidden yesOrNo filterBlock ignoreCase| |
5658
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
3320 |
|
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
3321 |
filterString := self filterModel value. |
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
3322 |
filterString = '' ifTrue:[filterString := '*']. |
7565
521264d23941
ignoreCase if Filename is not case sensitive in #makeFilterBlock
fm
parents:
7560
diff
changeset
|
3323 |
ignoreCase := "ignoreCaseInPattern ? "(Filename isCaseSensitive not). |
5658
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
3324 |
|
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
3325 |
filterStrings := filterString asCollectionOfSubstringsSeparatedBy:$;. |
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
3326 |
filters := filterStrings |
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
3327 |
collect:[:eachPattern | |
9296 | 3328 |
|pattern| |
3329 |
||
3330 |
pattern := eachPattern withoutSeparators. |
|
3331 |
yesOrNo := true. |
|
3332 |
(pattern startsWith:'~') ifTrue:[ |
|
3333 |
yesOrNo := false. |
|
3334 |
pattern := pattern copyFrom:2. |
|
5658
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
3335 |
]. |
9296 | 3336 |
yesOrNo ifTrue:[ |
3337 |
[:name :baseName | pattern match:baseName ignoreCase:ignoreCase] |
|
3338 |
] ifFalse:[ |
|
3339 |
[:name :baseName | (pattern match:baseName ignoreCase:ignoreCase) not] |
|
3340 |
]. |
|
3341 |
]. |
|
5658
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
3342 |
|
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
3343 |
filters size == 1 ifTrue:[ |
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
3344 |
filterBlock := filters first |
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
3345 |
] ifFalse:[ |
9102 | 3346 |
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
|
3347 |
]. |
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
3348 |
|
4011 | 3349 |
showHidden := self showHiddenFiles value. |
3350 |
showHidden ifTrue:[ |
|
5658
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
3351 |
^ filterBlock. |
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
3352 |
]. |
9296 | 3353 |
^ [:name :baseName | |
3354 |
name isHidden not and:[filterBlock value:name value:baseName]]. |
|
4018 | 3355 |
! |
3356 |
||
3357 |
shownFiles |
|
3358 |
||
3359 |
^ self aspectFor:#shownFiles ifAbsent:['-/-' asValue] |
|
4011 | 3360 |
! ! |
3361 |
||
3892 | 3362 |
!AbstractFileBrowser methodsFor:'aspects-history'! |
3363 |
||
3364 |
dirHistory |
|
6369 | 3365 |
"obsolete" |
3366 |
^ self directoryHistory |
|
3367 |
! |
|
3368 |
||
3369 |
directoryHistory |
|
3952 | 3370 |
^ self class directoryHistory |
3892 | 3371 |
! |
3372 |
||
3373 |
enableBack |
|
3374 |
||
3375 |
^ self aspectFor:#enableBack ifAbsent:[false asValue] |
|
3376 |
! |
|
3377 |
||
3378 |
enableFileHistory |
|
3379 |
||
3380 |
^ self aspectFor:#enableFileHistory ifAbsent:[false asValue] |
|
3381 |
! |
|
3382 |
||
3383 |
enableForward |
|
3384 |
||
3385 |
^ self aspectFor:#enableForward ifAbsent:[false asValue] |
|
3386 |
! |
|
3387 |
||
3388 |
fileHistory |
|
3389 |
||
3390 |
^ self aspectFor:#fileHistory ifAbsent:[FilenameHistory new] |
|
3391 |
! ! |
|
3392 |
||
3393 |
!AbstractFileBrowser methodsFor:'aspects-visibility'! |
|
3394 |
||
4345 | 3395 |
activityVisibilityChannel |
6284 | 3396 |
" activityVisibilityChannel switches the activity indicator on/off" |
4345 | 3397 |
|
3398 |
^ self aspectFor:#activityVisibilityChannel ifAbsent:[ false asValue ]. |
|
3399 |
! |
|
3400 |
||
6602 | 3401 |
changeSetBrowserItemVisible |
3402 |
^ Screen current ctrlDown. |
|
3403 |
! |
|
3404 |
||
4110 | 3405 |
openAlwaysInTextEditor |
4201 | 3406 |
" aspect for open every file in TextEditor dont use e.g. HtmlEditor for *.html'" |
4110 | 3407 |
|
3408 |
^ self aspectFor:#openAlwaysInTextEditor ifAbsent:[ false asValue ]. |
|
3409 |
! |
|
3410 |
||
3892 | 3411 |
openMultipleApplicationsForType |
3412 |
||
4201 | 3413 |
" aspect for open more applications for e.g. TextEditor and not change the contents of already |
3414 |
open TextEditor " |
|
3415 |
||
3892 | 3416 |
^ self aspectFor:#openMultipleApplicationsForType ifAbsent:[ false asValue ]. |
3417 |
! |
|
3418 |
||
4201 | 3419 |
showDirectoryTree |
3420 |
||
3421 |
^ self aspectFor:#showDirectoryTree ifAbsent:[ true asValue ] |
|
3892 | 3422 |
! |
3423 |
||
4554 | 3424 |
showDiskUsageHolder |
3425 |
|holder| |
|
3426 |
||
4560
0d3db5e27bc0
default for disk usage is false
Claus Gittinger <cg@exept.de>
parents:
4558
diff
changeset
|
3427 |
holder := self aspectFor:#showDiskUsageHolder ifAbsent:[ false asValue]. |
4781 | 3428 |
holder addDependent:self. |
4554 | 3429 |
^ holder |
3430 |
! |
|
3431 |
||
3892 | 3432 |
showHiddenFiles |
3433 |
||
9582 | 3434 |
^ self aspectFor:#showHiddenFiles ifAbsent:[ true asValue ]. |
3435 |
||
3436 |
"Modified: / 15-10-2010 / 10:28:17 / cg" |
|
3892 | 3437 |
! |
3438 |
||
9108 | 3439 |
showHiddenFiles:aHolder |
3440 |
self aspectFor:#showHiddenFiles put:aHolder. |
|
3441 |
! |
|
3442 |
||
3443 |
shownFiles:aHolder |
|
3444 |
self aspectFor:#shownFiles put:aHolder. |
|
3445 |
! |
|
3446 |
||
4648 | 3447 |
userContextAvailable |
3448 |
||
3449 |
" aspect for show group and user columns in contents view |
|
3450 |
windows provides no user context" |
|
3451 |
||
3452 |
^ OperatingSystem isMSWINDOWSlike not |
|
3453 |
! |
|
3454 |
||
3892 | 3455 |
viewDescription |
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3456 |
"aspect for show file description in DirectoryContentsBrowser" |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3457 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3458 |
^ self directoryContentsBrowser viewDescription |
3892 | 3459 |
! |
3460 |
||
3461 |
viewDetails |
|
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3462 |
"aspect for show more file properties in DirectoryContentsBrowser |
4201 | 3463 |
" |
3892 | 3464 |
|
6121 | 3465 |
|directoryContentsBrowser| |
3466 |
||
3467 |
directoryContentsBrowser := self directoryContentsBrowser. |
|
3468 |
directoryContentsBrowser isNil ifTrue:[^ nil]. |
|
3469 |
^ directoryContentsBrowser viewDetails |
|
3892 | 3470 |
! |
3471 |
||
3472 |
viewDirectoryDescription |
|
3473 |
||
4201 | 3474 |
" aspect for auto open a TextView for Readme and other see getInfoItem Method files |
3475 |
on change directory " |
|
3476 |
||
3892 | 3477 |
^ self aspectFor:#viewDirectoryDescription ifAbsent:[ true asValue ]. |
3478 |
! |
|
3479 |
||
4201 | 3480 |
viewDirsInContentsBrowser |
3481 |
||
3482 |
^ self aspectFor:#viewDirsInContentsBrowser ifAbsent:[ false asValue ]. |
|
9319
23ae966d9dbf
comment/format in: #viewDirsInContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
9299
diff
changeset
|
3483 |
|
23ae966d9dbf
comment/format in: #viewDirsInContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
9299
diff
changeset
|
3484 |
" |
23ae966d9dbf
comment/format in: #viewDirsInContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
9299
diff
changeset
|
3485 |
UserPreferences current viewDirsInContentsBrowser |
23ae966d9dbf
comment/format in: #viewDirsInContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
9299
diff
changeset
|
3486 |
" |
4201 | 3487 |
! |
3488 |
||
5870 | 3489 |
viewFilesInContentsBrowser |
3490 |
||
3491 |
^ self aspectFor:#viewFilesInContentsBrowser ifAbsent:[ true asValue ]. |
|
3492 |
! |
|
3493 |
||
3892 | 3494 |
viewFilesInDirectoryTree |
3495 |
||
4201 | 3496 |
" aspect for view files in tree view (not only directories) " |
3497 |
||
3892 | 3498 |
^ self aspectFor:#viewFilesInDirectoryTree ifAbsent:[ false asValue ]. |
3499 |
! |
|
3500 |
||
3501 |
viewGroup |
|
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3502 |
" aspect for show group information in DirectoryContentsBrowser " |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3503 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3504 |
^ self directoryContentsBrowser viewGroup |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3505 |
! |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3506 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3507 |
viewIcon |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3508 |
" aspect for show file-type icon in DirectoryContentsBrowser " |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3509 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3510 |
^ self directoryContentsBrowser viewIcon |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3511 |
! |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3512 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3513 |
viewInodeNumber |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3514 |
" aspect for show inode numbers in DirectoryContentsBrowser " |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3515 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3516 |
^ self directoryContentsBrowser viewInodeNumber |
3892 | 3517 |
! |
3518 |
||
3519 |
viewNoteBookApplicationHolder |
|
3520 |
||
3521 |
^ self aspectFor:#viewNoteBookApplicationHolder ifAbsent:[ false asValue]. |
|
3522 |
! |
|
3523 |
||
3524 |
viewOwner |
|
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3525 |
" aspect for show owner information in DirectoryContentsBrowser " |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3526 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3527 |
^ self directoryContentsBrowser viewOwner |
3892 | 3528 |
! |
3529 |
||
3530 |
viewPermissions |
|
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3531 |
" aspect for show permission information in DirectoryContentsBrowser " |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3532 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3533 |
^ self directoryContentsBrowser viewPermissions |
3892 | 3534 |
! |
3535 |
||
3536 |
viewPreview |
|
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3537 |
" aspect for show image previev in DirectoryContentsBrowser " |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3538 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3539 |
^ self directoryContentsBrowser viewPreview |
3892 | 3540 |
! |
3541 |
||
3542 |
viewSize |
|
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3543 |
" aspect for show size information in DirectoryContentsBrowser " |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3544 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3545 |
^ self directoryContentsBrowser viewSize |
3892 | 3546 |
! |
3547 |
||
4974 | 3548 |
viewSizeInBytes |
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3549 |
" aspect for show size-in-bytes information in DirectoryContentsBrowser " |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3550 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3551 |
^ self directoryContentsBrowser viewSizeInBytes |
4974 | 3552 |
! |
3553 |
||
5312 | 3554 |
viewSizeInKiloBytes |
3555 |
" aspect for show size-in-kilobytes information in DirectoryContentsBrowser " |
|
3556 |
||
3557 |
^ self directoryContentsBrowser viewSizeInKiloBytes |
|
3558 |
! |
|
3559 |
||
3892 | 3560 |
viewTime |
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3561 |
" aspect for show time information in DirectoryContentsBrowser" |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3562 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3563 |
^ self directoryContentsBrowser viewTime |
3892 | 3564 |
! |
3565 |
||
3566 |
viewType |
|
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3567 |
" aspect for show suffix (type) information in DirectoryContentsBrowser" |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3568 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3569 |
^ self directoryContentsBrowser viewType |
3892 | 3570 |
! ! |
3571 |
||
3572 |
!AbstractFileBrowser methodsFor:'background processing'! |
|
3573 |
||
3574 |
executeCommand:cmd |
|
3575 |
||
3576 |
self executeCommand:cmd inDirectory:nil |
|
3577 |
! |
|
3578 |
||
5880 | 3579 |
executeCommand:cmd inDirectory:aDirectoryOrNil |
3892 | 3580 |
| nameString executionBlock| |
3581 |
||
5880 | 3582 |
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
|
3583 |
nameString := 'Execute: ', cmd. |
3892 | 3584 |
self makeExecutionResultProcessFor:executionBlock withName:nameString. |
3585 |
! |
|
3586 |
||
3587 |
getExecutionBlockForCommand:cmd |
|
3588 |
||
3589 |
^ self getExecutionBlockForCommand:cmd inDirectory:nil |
|
3590 |
! |
|
3591 |
||
5880 | 3592 |
getExecutionBlockForCommand:cmd inDirectory:directoryOrNil |
3593 |
| dir| |
|
3594 |
||
3595 |
dir := directoryOrNil. |
|
3596 |
directoryOrNil isNil ifTrue:[ |
|
3597 |
dir := self theSingleSelectedDirectoryOrNil. |
|
6671 | 3598 |
dir isNil ifTrue:[ |
3599 |
Dialog warn:'Please select a single directory.'. |
|
3600 |
AbortSignal raise. |
|
3601 |
^ nil |
|
3602 |
]. |
|
3892 | 3603 |
]. |
4523 | 3604 |
|
3605 |
^ [:stream| |
|
3606 |
stream notNil ifTrue:[ |
|
4414 | 3607 |
OperatingSystem |
3608 |
executeCommand:cmd |
|
3609 |
inputFrom:nil |
|
3610 |
outputTo:stream |
|
3611 |
errorTo:stream |
|
3612 |
inDirectory:dir |
|
3613 |
onError:[:status| false]. |
|
3614 |
] |
|
4523 | 3615 |
]. |
3892 | 3616 |
! |
3617 |
||
3618 |
killAllRunningBackgroundProcesses |
|
3619 |
||
3620 |
self backgroundProcesses do:[ : process | |
|
4523 | 3621 |
self notify:'kill ', process name. |
4414 | 3622 |
process terminate. |
3892 | 3623 |
]. |
3624 |
! |
|
3625 |
||
3626 |
makeExecutionResultProcessFor:aBlock withName:aString |
|
3627 |
| stream process appl nameString| |
|
3628 |
||
3629 |
appl := self openCommandResultApplication. |
|
3630 |
stream := appl resultStream. |
|
3631 |
nameString := aString ? 'Execution Result'. |
|
3632 |
appl changeTabTo:nameString. |
|
4523 | 3633 |
|
8355 | 3634 |
process := [ |
3635 |
[aBlock value:stream] |
|
4891
5422df926e2d
Stream streamErrorSignal -> StreamError
Stefan Vogel <sv@exept.de>
parents:
4881
diff
changeset
|
3636 |
ensure:[ |
4516
dc3b7a89598a
close command view if no output was generated
Claus Gittinger <cg@exept.de>
parents:
4496
diff
changeset
|
3637 |
self backgroundProcesses remove:process ifAbsent:[]. |
dc3b7a89598a
close command view if no output was generated
Claus Gittinger <cg@exept.de>
parents:
4496
diff
changeset
|
3638 |
appl process value:nil. |
dc3b7a89598a
close command view if no output was generated
Claus Gittinger <cg@exept.de>
parents:
4496
diff
changeset
|
3639 |
|
dc3b7a89598a
close command view if no output was generated
Claus Gittinger <cg@exept.de>
parents:
4496
diff
changeset
|
3640 |
"/ close automatically, if there was no output. |
4571 | 3641 |
"/ appl resultStream contents isEmpty ifTrue:[ |
3642 |
"/ appl doClose. |
|
3643 |
"/ ] |
|
8355 | 3644 |
stream nextPutLine:'Done.' |
4516
dc3b7a89598a
close command view if no output was generated
Claus Gittinger <cg@exept.de>
parents:
4496
diff
changeset
|
3645 |
] |
dc3b7a89598a
close command view if no output was generated
Claus Gittinger <cg@exept.de>
parents:
4496
diff
changeset
|
3646 |
] newProcess. |
3892 | 3647 |
process priority:(Processor userBackgroundPriority). |
3648 |
process name:nameString. |
|
3649 |
self backgroundProcesses add:process. |
|
3650 |
appl process value:process. |
|
3651 |
process resume. |
|
3652 |
! ! |
|
3653 |
||
3654 |
!AbstractFileBrowser methodsFor:'change & update'! |
|
3655 |
||
4915 | 3656 |
currentFileNameHolderChanged |
3657 |
"/ self currentFileNameHolderChangedForCommon |
|
3658 |
! |
|
3659 |
||
4577 | 3660 |
currentFileNameHolderChangedForCommon |
5476 | 3661 |
|newDirectories oldDirectories size rootInTreeView selection selectionNotEmpty| |
4368
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
3662 |
|
7560 | 3663 |
selection := self currentSelectedObjects. |
4368
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
3664 |
self class currentSelection:selection. |
4734 | 3665 |
|
5476 | 3666 |
selectionNotEmpty := selection notEmpty. |
3667 |
self hasSelection value:selectionNotEmpty. |
|
3668 |
self hasFileSelection value:(selectionNotEmpty and:[self firstSelectedFile notNil]). |
|
4734 | 3669 |
|
4368
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
3670 |
newDirectories := self directoriesForFiles:selection. |
6725 | 3671 |
oldDirectories := self currentSelectedDirectories. |
4011 | 3672 |
oldDirectories ~= newDirectories ifTrue:[ |
4347 | 3673 |
self currentDirectories value:newDirectories. |
3674 |
size := newDirectories size. |
|
4774 | 3675 |
rootInTreeView := self |
3676 |
applicationNamed:#DirectoryTreeBrowser |
|
5009 | 3677 |
ifPresentDo:[:appl | appl rootHolder]. |
3678 |
rootInTreeView := rootInTreeView value. |
|
5437
3556b0348494
directory up not allowed for drive root under windows
penk
parents:
5432
diff
changeset
|
3679 |
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
|
3680 |
|
4347 | 3681 |
newDirectories notEmpty ifTrue:[ |
6369 | 3682 |
self directoryHistory addToHistory:(newDirectories first asString). |
4347 | 3683 |
]. |
5074 | 3684 |
self enableHome value:((newDirectories includes:(Filename homeDirectory asAbsoluteFilename))not). |
8168 | 3685 |
self enableGotoDesktop value:((newDirectories includes:(Filename desktopDirectory asAbsoluteFilename))not). |
6456 | 3686 |
self enableGotoDefaultDirectory value:((newDirectories includes:(Filename defaultDirectory asAbsoluteFilename))not). |
3687 |
self enableGotoSmalltalkDirectory value:((newDirectories includes:(self smalltalkDirectory asAbsoluteFilename))not). |
|
9572 | 3688 |
self enableGotoDesktopDirectory value:((newDirectories includes:(Filename desktopDirectory asAbsoluteFilename))not). |
4011 | 3689 |
]. |
9599
6ffff091db22
changed: #currentFileNameHolderChangedForCommon
Claus Gittinger <cg@exept.de>
parents:
9596
diff
changeset
|
3690 |
self enableGotoDefaultDirectory value:(self currentDirectory isNil or:[self currentDirectory pathName ~= OperatingSystem getCurrentDirectory]). |
9596 | 3691 |
self enableMakeCurrentDirectory value:(newDirectories size == 1 |
3692 |
and:[ newDirectories first asFilename pathName ~= OperatingSystem getCurrentDirectory ]). |
|
4022 | 3693 |
self enableForward value:self canForward. |
4734 | 3694 |
self enableBack value:self canBackward. |
6095 | 3695 |
|
3696 |
self updateCanMake. |
|
7560 | 3697 |
|
9599
6ffff091db22
changed: #currentFileNameHolderChangedForCommon
Claus Gittinger <cg@exept.de>
parents:
9596
diff
changeset
|
3698 |
"Modified: / 26-10-2010 / 19:30:40 / cg" |
4011 | 3699 |
! |
3700 |
||
3701 |
filterModelChanged |
|
3702 |
||
5658
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
3703 |
self filterBlockHolder value:(self makeFilterBlock). |
4011 | 3704 |
! |
3705 |
||
3892 | 3706 |
update:something with:aParameter from:changedObject |
3707 |
||
3708 |
" do here all the things that have to be done for every part of the FileBrowserV2 |
|
3709 |
and the things that have to be done if it runs standalone " |
|
3710 |
||
3711 |
changedObject == self currentFileNameHolder ifTrue:[ |
|
4577 | 3712 |
self currentFileNameHolderChangedForCommon. |
4368
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
3713 |
^ self |
3892 | 3714 |
]. |
3989 | 3715 |
changedObject == self sortCaseless ifTrue:[ |
4368
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
3716 |
self sortFileListsBy:#baseName withReverse:false. |
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
3717 |
^ self |
3989 | 3718 |
]. |
6785
cac8107d889c
clear reverseSort flag, when sort-order is changed via menu.
Claus Gittinger <cg@exept.de>
parents:
6767
diff
changeset
|
3719 |
changedObject == self sortBlockProperty ifTrue:[ |
cac8107d889c
clear reverseSort flag, when sort-order is changed via menu.
Claus Gittinger <cg@exept.de>
parents:
6767
diff
changeset
|
3720 |
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
|
3721 |
^ self |
cac8107d889c
clear reverseSort flag, when sort-order is changed via menu.
Claus Gittinger <cg@exept.de>
parents:
6767
diff
changeset
|
3722 |
]. |
4011 | 3723 |
(changedObject == self filterModel or:[changedObject == self showHiddenFiles]) ifTrue:[ |
4368
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
3724 |
self filterModelChanged. |
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
3725 |
^ self |
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
3726 |
]. |
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
3727 |
changedObject == self rootHolder ifTrue:[ |
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
3728 |
self class rootHolder:(self rootHolder value). |
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
3729 |
^ self |
4004 | 3730 |
]. |
4781 | 3731 |
changedObject == self showDiskUsageHolder ifTrue:[ |
6190 | 3732 |
self notify:nil. |
4781 | 3733 |
^ self |
3734 |
]. |
|
3989 | 3735 |
|
3892 | 3736 |
super update:something with:aParameter from:changedObject |
5543 | 3737 |
! |
3738 |
||
6095 | 3739 |
updateCanMake |
3740 |
|dir can| |
|
3741 |
||
3742 |
can := false. |
|
3743 |
dir := self currentDirectory. |
|
3744 |
dir notNil ifTrue:[ |
|
3745 |
can := (dir asFilename construct:'Makefile') exists. |
|
3746 |
OperatingSystem isMSWINDOWSlike ifTrue:[ |
|
3747 |
can ifFalse:[ |
|
3748 |
can := (self currentDirectory asFilename construct:'nt.mak') exists. |
|
3749 |
] |
|
3750 |
]. |
|
3751 |
]. |
|
3752 |
self canMake value:can. |
|
3753 |
! |
|
3754 |
||
5543 | 3755 |
updateListAfterDelete:colOfFiles |
3756 |
self updateCurrentDirectory |
|
3892 | 3757 |
! ! |
3758 |
||
3759 |
!AbstractFileBrowser methodsFor:'clipboard'! |
|
3760 |
||
3761 |
canPaste |
|
3762 |
||
3763 |
^ self aspectFor:#canPaste ifAbsent:[ false asValue ]. |
|
3764 |
! |
|
3765 |
||
3766 |
clipboard |
|
3767 |
||
3768 |
^ self aspectFor:#clipboard ifAbsent:[Clipboard new] |
|
3769 |
! |
|
3770 |
||
3771 |
copyFilesToClipBoard:colOfFiles |
|
3772 |
self putInClipBoard:colOfFiles as:#copy. |
|
3773 |
! |
|
3774 |
||
3775 |
cutFilesToClipBoard:colOfFiles |
|
3776 |
"defete current selected files/directories |
|
3777 |
" |
|
3778 |
self putInClipBoard:colOfFiles as:#cut. |
|
3779 |
! |
|
3780 |
||
3781 |
emptyClipBoard |
|
3782 |
||
3783 |
self clipboard files:nil. |
|
3784 |
self canPaste value:false. |
|
3785 |
! |
|
3786 |
||
3787 |
putInClipBoard:colOfFiles as:aSymbol |
|
3788 |
| stream clp| |
|
3789 |
||
3790 |
colOfFiles isEmpty ifTrue:[ ^ self]. |
|
3791 |
clp := self clipboard. |
|
3792 |
clp files:nil. |
|
3793 |
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
|
3794 |
|
603abfa8cf99
copy name(s) to clipboard - on lineFeed if only one file is selected
Claus Gittinger <cg@exept.de>
parents:
5756
diff
changeset
|
3795 |
stream := String writeStream. |
3892 | 3796 |
stream nextPutAll:aSymbol asString. |
3797 |
stream nextPutAll:' <'. |
|
3798 |
stream nextPutAll:colOfFiles first asString. |
|
3799 |
colOfFiles size > 1 ifTrue:[ |
|
4414 | 3800 |
stream nextPutAll:' ...'. |
3892 | 3801 |
]. |
3802 |
stream nextPutAll:'> to clipboard'. |
|
3803 |
||
4523 | 3804 |
self notify:stream contents. |
3892 | 3805 |
stream close. |
3806 |
clp files:colOfFiles. |
|
3807 |
self canPaste value:true. |
|
3808 |
! ! |
|
3809 |
||
3810 |
!AbstractFileBrowser methodsFor:'drag & drop'! |
|
3811 |
||
3812 |
canDropFiles:dropedObjects for:filename |
|
6284 | 3813 |
|filenameDirString filenameDir| |
3892 | 3814 |
|
3815 |
dropedObjects isEmpty ifTrue:[^ false]. |
|
6284 | 3816 |
|
3892 | 3817 |
filenameDir := self getDirWithoutFileName:filename. |
7491 | 3818 |
filenameDir isNil ifTrue:[^ false ]. |
6250
5b0673ccff1c
refactored intention revealing code:
Claus Gittinger <cg@exept.de>
parents:
6236
diff
changeset
|
3819 |
filenameDir isWritable ifFalse:[^ false]. |
6284 | 3820 |
|
3892 | 3821 |
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
|
3822 |
|
7ce6eae41e33
do not check if dropFile exists, if its an archive file
Claus Gittinger <cg@exept.de>
parents:
4959
diff
changeset
|
3823 |
dropedObjects do:[:aDropObject | |
6284 | 3824 |
(self canDropObject:aDropObject into:filenameDir) ifFalse:[^ false]. |
3825 |
"/ |dropFileName dropFileNameString physicalPathName| |
|
3826 |
"/ |
|
3827 |
"/ dropFileName := aDropObject theObject. |
|
3828 |
"/ dropFileNameString := dropFileName asString. |
|
3829 |
"/ dropFileName isDirectory ifTrue:[ |
|
3830 |
"/ (self fileName:filenameDirString startsWith:dropFileNameString) ifTrue:[ |
|
3831 |
"/ self notify:'Cannot drop a directory into one of its parent directories'. |
|
3832 |
"/ ^ false |
|
3833 |
"/ ] |
|
3834 |
"/ ] ifFalse:[ |
|
3835 |
"/ physicalPathName := dropFileName physicalPathName. |
|
3836 |
"/ (filenameDirString = dropFileName directory asString |
|
3837 |
"/ or:[ aDropObject isFileInArchive not and:[physicalPathName notNil |
|
3838 |
"/ and:[ filenameDirString = physicalPathName asFilename directory asString]]]) ifTrue:[ |
|
3839 |
"/ self notify:'Cannot drop a file into same directory'. |
|
3840 |
"/ ^ false |
|
3841 |
"/ ] |
|
3842 |
"/ ] |
|
3843 |
]. |
|
3844 |
self notify:nil. |
|
3845 |
^ true |
|
3846 |
! |
|
3847 |
||
3848 |
canDropObject:aDropObject into:aDirectory |
|
3849 |
|filenameDirString dropFileName dropFileNameString physicalPathName| |
|
3850 |
||
3851 |
dropFileName := aDropObject theObject. |
|
3852 |
dropFileNameString := dropFileName asString. |
|
3853 |
dropFileName isDirectory ifTrue:[ |
|
3854 |
filenameDirString := aDirectory asString. |
|
3855 |
(self fileName:filenameDirString startsWith:dropFileNameString) ifTrue:[ |
|
3856 |
self notify:'Cannot drop a directory into one of its parent directories'. |
|
3857 |
^ false |
|
4414 | 3858 |
] |
6284 | 3859 |
] ifFalse:[ |
3860 |
physicalPathName := dropFileName physicalPathName. |
|
3861 |
(aDirectory = dropFileName directory |
|
3862 |
or:[ aDropObject isFileInArchive not |
|
3863 |
and:[physicalPathName notNil |
|
3864 |
and:[ aDirectory = physicalPathName asFilename directory]]]) ifTrue:[ |
|
3865 |
self notify:'Cannot drop a file into same directory'. |
|
3866 |
^ false |
|
3867 |
] |
|
3868 |
]. |
|
3869 |
^ true. |
|
3892 | 3870 |
! |
3871 |
||
7406 | 3872 |
canDropObjects:aCollectionOfDropObjects in:aWidget |
3873 |
^ aCollectionOfDropObjects contains:[:dropObject | dropObject isFileObject] |
|
3874 |
||
3875 |
"Created: / 13-10-2006 / 15:52:49 / cg" |
|
3876 |
! |
|
3877 |
||
3892 | 3878 |
doStartDrag:aDropSource in:aView |
7829 | 3879 |
"set the cursors before starting the drag & drop operation" |
3880 |
||
3892 | 3881 |
|hdl| |
3882 |
||
3883 |
hdl := DragAndDropManager new. |
|
3884 |
||
4337
f2eed806e854
change first letter uppercase methods on class side to lowercase ones
penk
parents:
4317
diff
changeset
|
3885 |
hdl disabledCursor:self class disabledCursorImage. |
f2eed806e854
change first letter uppercase methods on class side to lowercase ones
penk
parents:
4317
diff
changeset
|
3886 |
hdl enabledCursor:self class enabledCursorImage. |
3892 | 3887 |
hdl alienCursor:nil. |
3888 |
||
4745 | 3889 |
hdl startDragFrom:aView dropSource:aDropSource offset:#topLeft. |
3890 |
||
7829 | 3891 |
"Modified: / 23-07-2007 / 23:00:38 / cg" |
6479 | 3892 |
! |
3893 |
||
7408 | 3894 |
dropObjects:aCollectionOfDropObjects in:aWidget at:position |
7990 | 3895 |
|fileEntryFieldHolder destDir dropObject fn d| |
3896 |
||
3897 |
fileEntryFieldHolder := self masterApplication notNil |
|
3898 |
ifTrue:[ self masterApplication fileEntryFieldHolder ] |
|
3899 |
ifFalse:[ self fileEntryFieldHolder ]. |
|
3900 |
||
3901 |
aWidget model == fileEntryFieldHolder ifTrue:[ |
|
7900
52ad708471ad
drop into fileName-path-field: goto that directory
Claus Gittinger <cg@exept.de>
parents:
7897
diff
changeset
|
3902 |
dropObject := aCollectionOfDropObjects first. |
52ad708471ad
drop into fileName-path-field: goto that directory
Claus Gittinger <cg@exept.de>
parents:
7897
diff
changeset
|
3903 |
dropObject isFileObject ifTrue:[ |
52ad708471ad
drop into fileName-path-field: goto that directory
Claus Gittinger <cg@exept.de>
parents:
7897
diff
changeset
|
3904 |
fn := dropObject theObject asFilename. |
52ad708471ad
drop into fileName-path-field: goto that directory
Claus Gittinger <cg@exept.de>
parents:
7897
diff
changeset
|
3905 |
dropObject isDirectory ifTrue:[ |
52ad708471ad
drop into fileName-path-field: goto that directory
Claus Gittinger <cg@exept.de>
parents:
7897
diff
changeset
|
3906 |
d := fn. |
52ad708471ad
drop into fileName-path-field: goto that directory
Claus Gittinger <cg@exept.de>
parents:
7897
diff
changeset
|
3907 |
] ifFalse:[ |
52ad708471ad
drop into fileName-path-field: goto that directory
Claus Gittinger <cg@exept.de>
parents:
7897
diff
changeset
|
3908 |
d := fn directory. |
52ad708471ad
drop into fileName-path-field: goto that directory
Claus Gittinger <cg@exept.de>
parents:
7897
diff
changeset
|
3909 |
]. |
7990 | 3910 |
fileEntryFieldHolder value:d pathName. |
7900
52ad708471ad
drop into fileName-path-field: goto that directory
Claus Gittinger <cg@exept.de>
parents:
7897
diff
changeset
|
3911 |
]. |
52ad708471ad
drop into fileName-path-field: goto that directory
Claus Gittinger <cg@exept.de>
parents:
7897
diff
changeset
|
3912 |
^ self. |
52ad708471ad
drop into fileName-path-field: goto that directory
Claus Gittinger <cg@exept.de>
parents:
7897
diff
changeset
|
3913 |
]. |
6479 | 3914 |
|
3915 |
destDir := self currentDirectory. |
|
3916 |
destDir isNil ifTrue:[^ self]. |
|
3917 |
||
8601 | 3918 |
self withWaitCursorDo:[ |
3919 |
aCollectionOfDropObjects do:[:dropObject | |
|
3920 |
|fn| |
|
3921 |
||
3922 |
dropObject isFileObject ifTrue:[ |
|
3923 |
fn := dropObject theObject asFilename. |
|
3924 |
dropObject isDirectory ifTrue:[ |
|
8808
cb6476c0cd3a
oops - drop of directories was broken
Claus Gittinger <cg@exept.de>
parents:
8716
diff
changeset
|
3925 |
fn recursiveCopyTo:destDir |
8601 | 3926 |
] ifFalse:[ |
8950
48c69259d82d
changed: #dropObjects:in:at:
Claus Gittinger <cg@exept.de>
parents:
8887
diff
changeset
|
3927 |
fn copyTo:(destDir / fn baseName ) |
8601 | 3928 |
] |
6479 | 3929 |
] |
8601 | 3930 |
]. |
3931 |
]. |
|
9268
fbeb680106c9
changed: #dropObjects:in:at:
Claus Gittinger <cg@exept.de>
parents:
9267
diff
changeset
|
3932 |
self directoryContentsBrowser notNil ifTrue:[ |
fbeb680106c9
changed: #dropObjects:in:at:
Claus Gittinger <cg@exept.de>
parents:
9267
diff
changeset
|
3933 |
self directoryContentsBrowser |
fbeb680106c9
changed: #dropObjects:in:at:
Claus Gittinger <cg@exept.de>
parents:
9267
diff
changeset
|
3934 |
directoryContentsChangeFlag:true; |
fbeb680106c9
changed: #dropObjects:in:at:
Claus Gittinger <cg@exept.de>
parents:
9267
diff
changeset
|
3935 |
wakeUp |
fbeb680106c9
changed: #dropObjects:in:at:
Claus Gittinger <cg@exept.de>
parents:
9267
diff
changeset
|
3936 |
]. |
7408 | 3937 |
|
3938 |
"Created: / 13-10-2006 / 18:26:41 / cg" |
|
3892 | 3939 |
! ! |
3940 |
||
3941 |
!AbstractFileBrowser methodsFor:'file operations'! |
|
3942 |
||
3943 |
copyFile:aSourceFile to:aDestFile |
|
6190 | 3944 |
"copy to" |
3945 |
||
7635 | 3946 |
^ self copyFile:aSourceFile to:aDestFile repairCorruptedFiles:false |
3947 |
||
3948 |
"Modified: / 07-02-2007 / 18:46:44 / cg" |
|
3949 |
! |
|
3950 |
||
3951 |
copyFile:aSourceFile to:aDestFile repairCorruptedFiles:repairCorruptedFiles |
|
3952 |
"copy to" |
|
3953 |
||
3954 |
|copyOperation msg| |
|
3955 |
||
3956 |
repairCorruptedFiles ifTrue:[ |
|
3957 |
copyOperation := FileOperation copyCorruptedFile:aSourceFile to:aDestFile |
|
3958 |
] ifFalse:[ |
|
3959 |
copyOperation := FileOperation copyFile:aSourceFile to:aDestFile withOverWriteWarning:true copyFileIfSame:true. |
|
3960 |
]. |
|
3961 |
copyOperation result ifTrue:[ |
|
6190 | 3962 |
msg := ('copy ', aSourceFile baseName, ' to:,', aDestFile baseName). |
3892 | 3963 |
] ifFalse:[ |
7635 | 3964 |
msg := copyOperation errorString. |
6190 | 3965 |
]. |
3966 |
self notify:msg. |
|
7635 | 3967 |
^ copyOperation result |
3968 |
||
3969 |
"Created: / 07-02-2007 / 18:46:34 / cg" |
|
3892 | 3970 |
! |
3971 |
||
3972 |
copyFiles:aColOfSourceFiles to:aDirectory |
|
6374 | 3973 |
|copy result| |
3892 | 3974 |
|
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
3975 |
self withActivityIndicationDo:[ |
5961 | 3976 |
copy := FileOperation copyFiles:aColOfSourceFiles to:aDirectory. |
6374 | 3977 |
copy result ifTrue:[ |
3978 |
result := Dictionary withKeys:(copy collectionOfCopiedFiles) andValues:(copy collectionOfNewFiles). |
|
3979 |
] ifFalse:[ |
|
4629
e8739857466c
show busyCursor while moving/copying files.
Claus Gittinger <cg@exept.de>
parents:
4624
diff
changeset
|
3980 |
self notify:copy errorString. |
e8739857466c
show busyCursor while moving/copying files.
Claus Gittinger <cg@exept.de>
parents:
4624
diff
changeset
|
3981 |
]. |
e8739857466c
show busyCursor while moving/copying files.
Claus Gittinger <cg@exept.de>
parents:
4624
diff
changeset
|
3982 |
self updateCurrentDirectory. |
3892 | 3983 |
]. |
6374 | 3984 |
^ result |
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
3985 |
|
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
3986 |
"Modified: / 25-07-2006 / 09:07:04 / cg" |
3892 | 3987 |
! |
3988 |
||
4707
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
3989 |
copyOrMoveDialog:aCollectionOfFiles for:aDestinationDirectory |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
3990 |
|size stream msg answer file| |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
3991 |
|
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
3992 |
size := aCollectionOfFiles size. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
3993 |
|
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
3994 |
"/ stream := WriteStream on:'' asText. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
3995 |
"/ 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
|
3996 |
"/ size == 1 ifFalse:[ |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
3997 |
"/ stream nextPutAll:'s'. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
3998 |
"/ ]. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
3999 |
"/ stream nextPutAll:': '. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4000 |
"/ 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
|
4001 |
"/ size == 1 ifFalse:[ |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4002 |
"/ stream nextPutAll:' ... '. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4003 |
"/ 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
|
4004 |
"/ ]. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4005 |
"/ stream cr; nextPutAll:'to: '. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4006 |
"/ 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
|
4007 |
"/ msg := stream contents |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4008 |
size == 1 ifTrue:[ |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4009 |
file := aCollectionOfFiles first. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4010 |
msg := resources |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4011 |
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
|
4012 |
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
|
4013 |
with:(file baseName allBold) |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4014 |
with:(aDestinationDirectory asFilename pathName allBold). |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4015 |
] ifFalse:[ |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4016 |
msg := resources |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4017 |
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
|
4018 |
with:size |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4019 |
with:(aDestinationDirectory asFilename pathName allBold). |
3892 | 4020 |
]. |
4707
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4021 |
|
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4022 |
answer := OptionBox |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4023 |
request:msg |
8127 | 4024 |
label:(resources string:'Copy or Move') |
5898
f6214812e1d2
dont send obsolete message to OptionBox
Claus Gittinger <cg@exept.de>
parents:
5888
diff
changeset
|
4025 |
image:(WarningBox iconBitmap) |
8127 | 4026 |
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
|
4027 |
values:#(#cancel #move #copy #copyAs) |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
4028 |
default:#copy. |
4707
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4029 |
answer isNil ifTrue:[answer := #cancel]. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4030 |
^ answer. |
3892 | 4031 |
! |
4032 |
||
4354
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
4033 |
copyOrMoveFiles:aColOfSourceFiles to:aDestinationDirectory |
4745 | 4034 |
"copy or move aColOfSourceFiles to aDirectory. |
4035 |
Asks the used if a move or a copy is wanted. |
|
4036 |
Returns true if the copyOrMove happened, false if user aborted the operation." |
|
4037 |
||
4707
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4038 |
|answer lastOld lastNew| |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4039 |
|
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4040 |
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
|
4041 |
answer == #copyAs ifTrue:[ |
4354
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
4042 |
aColOfSourceFiles do:[:eachSourceFile | |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
4043 |
|initial destFile srcBase dstBase| |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
4044 |
|
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
4045 |
srcBase := eachSourceFile asFilename baseName. |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
4046 |
lastOld isNil ifTrue:[ |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
4047 |
initial := srcBase |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
4048 |
] ifFalse:[ |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
4049 |
initial := DoWhatIMeanSupport |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
4050 |
goodRenameDefaultForFile:srcBase lastOld:lastOld lastNew:lastNew. |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
4051 |
]. |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
4052 |
dstBase := Dialog request:('Copy %1 as:' bindWith:srcBase) initialAnswer:initial. |
4745 | 4053 |
dstBase isNil ifTrue:[^ false]. |
4354
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
4054 |
self copyFile:eachSourceFile to:(aDestinationDirectory construct:dstBase). |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
4055 |
lastOld := srcBase. |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
4056 |
lastNew := dstBase. |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
4057 |
]. |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
4058 |
|
4745 | 4059 |
^ true. |
4354
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
4060 |
]. |
4707
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4061 |
answer == #copy ifTrue:[ |
4354
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
4062 |
self copyFiles:aColOfSourceFiles to:aDestinationDirectory. |
4745 | 4063 |
^ true. |
3892 | 4064 |
]. |
4707
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4065 |
answer == #move ifTrue:[ |
4354
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
4066 |
self moveFiles:aColOfSourceFiles to:aDestinationDirectory. |
4745 | 4067 |
^ true. |
3892 | 4068 |
]. |
4745 | 4069 |
^ false. |
3892 | 4070 |
! |
4071 |
||
6107 | 4072 |
copySelectionTo |
4073 |
"copy the selected file(s) to another directory" |
|
4074 |
||
7635 | 4075 |
self copySelectionToRepairingCorruptedFiles:false |
4076 |
||
4077 |
"Modified: / 07-02-2007 / 18:42:48 / cg" |
|
4078 |
! |
|
4079 |
||
4080 |
copySelectionToRepairingCorruptedFiles |
|
4081 |
"copy the selected file(s) to another directory" |
|
4082 |
||
4083 |
self copySelectionToRepairingCorruptedFiles:true |
|
4084 |
||
4085 |
"Created: / 07-02-2007 / 18:42:59 / cg" |
|
4086 |
! |
|
4087 |
||
4088 |
copySelectionToRepairingCorruptedFiles:repairingCorruptedFiles |
|
4089 |
"copy the selected file(s) to another directory" |
|
4090 |
||
6299 | 4091 |
|selectedFiles msg destination directory| |
4092 |
||
7560 | 4093 |
selectedFiles := self currentSelectedObjects copy. |
6299 | 4094 |
selectedFiles isEmptyOrNil ifTrue:[^ self]. |
4095 |
||
4096 |
msg := (selectedFiles size > 1) |
|
4097 |
ifTrue:[ 'Copy Selected Items To Directory:' ] |
|
4098 |
ifFalse:[ 'Copy "%1" To Directory:' ]. |
|
4099 |
||
4100 |
destination := Dialog |
|
7635 | 4101 |
requestDirectoryName:(resources stringWithCRs:msg with:selectedFiles first pathName) |
4102 |
default:(LastMoveDestination ? self currentDirectory) |
|
4103 |
ok:(resources string:'Copy') |
|
4104 |
abort:nil. |
|
4105 |
||
6299 | 4106 |
destination isEmptyOrNil ifTrue:[^ self]. |
4107 |
destination := destination asFilename. |
|
4108 |
||
4109 |
destination isDirectory ifFalse:[ |
|
4110 |
selectedFiles size == 1 ifTrue:[ |
|
4111 |
directory := destination directory. |
|
4112 |
directory isDirectory ifTrue:[ |
|
4113 |
LastMoveDestination := directory. |
|
7635 | 4114 |
self copyFile:selectedFiles first to:destination repairCorruptedFiles:repairingCorruptedFiles. |
6299 | 4115 |
^ self. |
4116 |
] |
|
4117 |
] |
|
4118 |
]. |
|
4119 |
||
4120 |
LastMoveDestination := destination. |
|
7635 | 4121 |
repairingCorruptedFiles ifTrue:[ |
4122 |
selectedFiles do:[:eachFile | |
|
4123 |
self copyFile:eachFile to:destination repairCorruptedFiles:repairingCorruptedFiles. |
|
4124 |
]. |
|
4125 |
^ self. |
|
4126 |
] ifFalse:[ |
|
4127 |
self copyFiles:selectedFiles to:destination |
|
4128 |
] |
|
4129 |
||
4130 |
"Created: / 07-02-2007 / 18:42:35 / cg" |
|
6107 | 4131 |
! |
4132 |
||
3892 | 4133 |
deleteFile:aFile |
6373 | 4134 |
"delete the selected files/directories" |
3892 | 4135 |
|
4136 |
^ self deleteFiles:(OrderedCollection with:aFile). |
|
4137 |
! |
|
4138 |
||
4139 |
deleteFiles:colOfFiles |
|
6373 | 4140 |
"delete some files/directories" |
4141 |
||
5081 | 4142 |
^ self deleteFiles:colOfFiles confirm:true. |
4143 |
! |
|
4144 |
||
4145 |
deleteFiles:colOfFiles confirm:confirm |
|
6373 | 4146 |
"delete some files/directories" |
4147 |
||
5673 | 4148 |
|delete result| |
3892 | 4149 |
|
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
4150 |
self withActivityIndicationDo:[ |
9575
548adf8e9d98
added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents:
9572
diff
changeset
|
4151 |
ProgressNotification handle:[:info | |
548adf8e9d98
added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents:
9572
diff
changeset
|
4152 |
self progressPercentageHolder value:info progressValue. |
548adf8e9d98
added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents:
9572
diff
changeset
|
4153 |
info proceed |
548adf8e9d98
added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents:
9572
diff
changeset
|
4154 |
] do:[ |
548adf8e9d98
added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents:
9572
diff
changeset
|
4155 |
delete := FileOperation deleteFiles:colOfFiles confirm:confirm. |
548adf8e9d98
added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents:
9572
diff
changeset
|
4156 |
result := delete result. |
548adf8e9d98
added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents:
9572
diff
changeset
|
4157 |
]. |
5673 | 4158 |
result notNil ifTrue:[ |
4159 |
result ifFalse:[ |
|
4160 |
self notify:delete errorString. |
|
5753 | 4161 |
] ifTrue:[ |
4162 |
self updateListAfterDelete:colOfFiles. |
|
4163 |
] |
|
4394 | 4164 |
]. |
5673 | 4165 |
]. |
4166 |
^ result. |
|
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
4167 |
|
9575
548adf8e9d98
added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents:
9572
diff
changeset
|
4168 |
"Modified: / 11-10-2010 / 13:08:24 / cg" |
3892 | 4169 |
! |
4170 |
||
6169 | 4171 |
eraseFiles:colOfFiles |
6373 | 4172 |
"erase (clear and delete) some files/directories" |
4173 |
||
6169 | 4174 |
^ self eraseFiles:colOfFiles confirm:true. |
4175 |
! |
|
4176 |
||
4177 |
eraseFiles:colOfFiles confirm:confirm |
|
6373 | 4178 |
"erase (clear and delete) some files/directories" |
4179 |
||
8462
a5d12742a900
changed #eraseFiles:confirm:
Claus Gittinger <cg@exept.de>
parents:
8454
diff
changeset
|
4180 |
|deleteOperation result fileSize| |
6169 | 4181 |
|
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
4182 |
self withActivityIndicationDo:[ |
8462
a5d12742a900
changed #eraseFiles:confirm:
Claus Gittinger <cg@exept.de>
parents:
8454
diff
changeset
|
4183 |
fileSize := colOfFiles first asFilename fileSize. |
8294 | 4184 |
deleteOperation := FileOperation eraseFiles:colOfFiles confirm:confirm. |
8462
a5d12742a900
changed #eraseFiles:confirm:
Claus Gittinger <cg@exept.de>
parents:
8454
diff
changeset
|
4185 |
(colOfFiles size == 1 and:[ fileSize < (10*1024*1024) ]) |
8294 | 4186 |
ifTrue:[ |
4187 |
result := deleteOperation result. |
|
4188 |
] ifFalse:[ |
|
4189 |
ProgressIndicator |
|
4190 |
displayProgressNotifications:'Erasing' |
|
4191 |
abortable:true |
|
4192 |
at:nil |
|
4193 |
during:[ |
|
4194 |
result := deleteOperation result. |
|
4195 |
]. |
|
4196 |
]. |
|
4197 |
||
6169 | 4198 |
result notNil ifTrue:[ |
4199 |
result ifFalse:[ |
|
8294 | 4200 |
self notify:deleteOperation errorString. |
6169 | 4201 |
] ifTrue:[ |
4202 |
self updateListAfterDelete:colOfFiles. |
|
4203 |
] |
|
4204 |
]. |
|
4205 |
]. |
|
4206 |
^ result. |
|
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
4207 |
|
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
4208 |
"Modified: / 25-07-2006 / 09:07:16 / cg" |
6169 | 4209 |
! |
4210 |
||
3892 | 4211 |
moveFile:aSourceFile to:aDestFile |
6373 | 4212 |
"move a file/directory" |
3892 | 4213 |
|
4214 |
|move| |
|
4215 |
||
5961 | 4216 |
move := FileOperation moveFile:aSourceFile to:aDestFile. |
3892 | 4217 |
move result ifTrue:[ |
4523 | 4218 |
self notify:('move ', aSourceFile asString, ' to ', aDestFile asString). |
3892 | 4219 |
] ifFalse:[ |
4523 | 4220 |
self notify:move errorString. |
3892 | 4221 |
]. |
4222 |
self updateCurrentDirectory. |
|
4223 |
^ move result |
|
4224 |
! |
|
4225 |
||
4226 |
moveFiles:aColOfSourceFiles to:aDirectory |
|
6373 | 4227 |
"move some files to aDirectory" |
4228 |
||
3892 | 4229 |
|move| |
4230 |
||
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
4231 |
self withActivityIndicationDo:[ |
5961 | 4232 |
move := FileOperation moveFiles:aColOfSourceFiles to:aDirectory. |
4629
e8739857466c
show busyCursor while moving/copying files.
Claus Gittinger <cg@exept.de>
parents:
4624
diff
changeset
|
4233 |
move result ifFalse:[ |
e8739857466c
show busyCursor while moving/copying files.
Claus Gittinger <cg@exept.de>
parents:
4624
diff
changeset
|
4234 |
self notify:move errorString. |
e8739857466c
show busyCursor while moving/copying files.
Claus Gittinger <cg@exept.de>
parents:
4624
diff
changeset
|
4235 |
]. |
e8739857466c
show busyCursor while moving/copying files.
Claus Gittinger <cg@exept.de>
parents:
4624
diff
changeset
|
4236 |
self updateCurrentDirectory. |
3892 | 4237 |
]. |
6373 | 4238 |
^ move collectionOfMovedFiles |
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
4239 |
|
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
4240 |
"Modified: / 25-07-2006 / 09:07:32 / cg" |
3892 | 4241 |
! |
4242 |
||
6107 | 4243 |
moveSelectionTo |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4244 |
"move the selected file(s) to another directory" |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4245 |
|
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4246 |
|destinationDirectory| |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4247 |
|
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4248 |
destinationDirectory := Dialog |
6352 | 4249 |
requestDirectoryName:(resources stringWithCRs:'Move Selected Items To:') |
5789 | 4250 |
default:(LastMoveDestination ? self currentDirectory) |
6952 | 4251 |
ok:(resources string:'Move') |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4252 |
abort:nil. |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4253 |
destinationDirectory isEmptyOrNil ifTrue:[^ self]. |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4254 |
|
5789 | 4255 |
LastMoveDestination := destinationDirectory. |
7560 | 4256 |
self moveFiles:(self currentSelectedObjects copy) to:destinationDirectory asFilename |
4257 |
||
4258 |
"Modified: / 04-12-2006 / 13:15:12 / cg" |
|
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4259 |
! |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4260 |
|
3892 | 4261 |
newDirectory |
4262 |
"ask for and create a new directory" |
|
4263 |
||
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4264 |
|selectedFiles singleSelectedFile defaultAnswer directory createOp newFile mime| |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4265 |
|
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4266 |
directory := self currentDirectory. |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4267 |
directory isNil ifTrue:[ |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4268 |
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
|
4269 |
^ self |
366465d1a8a5
warn on create new file or directory if nothing selected or more than one directory
penk
parents:
4976
diff
changeset
|
4270 |
]. |
4521 | 4271 |
|
4272 |
"/ 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
|
4273 |
selectedFiles := self currentSelectedFiles. |
4521 | 4274 |
selectedFiles size == 1 ifTrue:[ |
4275 |
singleSelectedFile := selectedFiles first. |
|
4276 |
||
4277 |
mime := MIMETypes mimeTypeForFilename:singleSelectedFile. |
|
4278 |
(mime notNil and:[mime isArchive]) ifTrue:[ |
|
4279 |
defaultAnswer := singleSelectedFile asFilename withoutSuffix baseName. |
|
4280 |
||
4281 |
mime := MIMETypes mimeTypeForFilename:defaultAnswer. |
|
4982
c38742d99bfd
care for nil mime in newDirectory
Claus Gittinger <cg@exept.de>
parents:
4979
diff
changeset
|
4282 |
(mime notNil and:[mime isArchive]) ifTrue:[ |
4521 | 4283 |
defaultAnswer := defaultAnswer asFilename withoutSuffix baseName |
4284 |
]. |
|
4285 |
]. |
|
4286 |
]. |
|
4287 |
||
5961 | 4288 |
|
4521 | 4289 |
defaultAnswer notNil ifTrue:[ |
5961 | 4290 |
createOp := FileOperation createDirectoryIn:directory initialAnswer:defaultAnswer. |
4521 | 4291 |
] ifFalse:[ |
5961 | 4292 |
createOp := FileOperation createDirectoryIn:directory. |
4521 | 4293 |
]. |
4294 |
createOp result ifFalse:[ ^ self]. |
|
4295 |
newFile := createOp createdFile. |
|
3892 | 4296 |
newFile notNil ifTrue:[ |
4414 | 4297 |
self updateCurrentDirectory. |
3892 | 4298 |
] |
4299 |
! |
|
4300 |
||
4301 |
newFile |
|
4302 |
"ask for and create a new file" |
|
4303 |
||
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4304 |
| curFile directory create file| |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4305 |
|
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4306 |
directory := self currentDirectory. |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4307 |
directory isNil ifTrue:[ |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4308 |
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
|
4309 |
^ self. |
366465d1a8a5
warn on create new file or directory if nothing selected or more than one directory
penk
parents:
4976
diff
changeset
|
4310 |
]. |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4311 |
|
3982 | 4312 |
curFile := self firstSelectedFile. |
3892 | 4313 |
curFile notNil ifTrue:[ |
4414 | 4314 |
file := curFile. |
3892 | 4315 |
] ifFalse:[ |
4414 | 4316 |
file := directory. |
3892 | 4317 |
]. |
5961 | 4318 |
create := FileOperation createFileIn:file. |
3892 | 4319 |
create result ifFalse:[ ^ self]. |
4320 |
self updateAndSelect:(OrderedCollection with:(create createdFile)). |
|
4321 |
! |
|
4322 |
||
4323 |
newHardLink |
|
4324 |
"ask for and create a hard link (unix only)" |
|
4325 |
||
6151 | 4326 |
self newLink:#hard. |
4327 |
! |
|
4328 |
||
4329 |
newLink:typeOfLink |
|
3892 | 4330 |
"ask for and create a symbolic if symbolic is true otherwise a hard link (unix only)" |
4331 |
||
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4332 |
| sel dir create createdFile| |
3892 | 4333 |
|
7560 | 4334 |
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
|
4335 |
(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
|
4336 |
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
|
4337 |
^ self |
366465d1a8a5
warn on create new file or directory if nothing selected or more than one directory
penk
parents:
4976
diff
changeset
|
4338 |
]. |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4339 |
dir := sel first. |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4340 |
|
6151 | 4341 |
create := FileOperation createLinkIn:dir soft:(typeOfLink == #soft). |
3892 | 4342 |
create result ifFalse:[ ^ self]. |
4343 |
createdFile := create createdFile. |
|
4344 |
createdFile notNil ifTrue:[ |
|
6151 | 4345 |
typeOfLink == #soft ifTrue:[ |
4785
5a3f7a0c3ff1
symbolic link creation code fixed
Claus Gittinger <cg@exept.de>
parents:
4782
diff
changeset
|
4346 |
self updateCurrentDirectory. |
5a3f7a0c3ff1
symbolic link creation code fixed
Claus Gittinger <cg@exept.de>
parents:
4782
diff
changeset
|
4347 |
] ifFalse:[ |
5a3f7a0c3ff1
symbolic link creation code fixed
Claus Gittinger <cg@exept.de>
parents:
4782
diff
changeset
|
4348 |
self updateAndSelect:(OrderedCollection with:createdFile). |
5a3f7a0c3ff1
symbolic link creation code fixed
Claus Gittinger <cg@exept.de>
parents:
4782
diff
changeset
|
4349 |
] |
3892 | 4350 |
]. |
7560 | 4351 |
|
4352 |
"Modified: / 04-12-2006 / 13:15:15 / cg" |
|
3892 | 4353 |
! |
4354 |
||
4355 |
newSoftLink |
|
4356 |
"ask for and create a soft link (unix only)" |
|
4357 |
||
6151 | 4358 |
self newLink:#soft. |
3892 | 4359 |
! |
4360 |
||
4361 |
pasteFiles |
|
6373 | 4362 |
"paste from clipBoard" |
4363 |
||
4364 |
|buffer destination files directories copiedFiles thisIsAFileMoveOperation| |
|
3892 | 4365 |
|
4366 |
files := self clipboard files. |
|
6482
00207f456339
isEmptyOrNil / notEmptyOrNil refactoring
Claus Gittinger <cg@exept.de>
parents:
6479
diff
changeset
|
4367 |
files isEmptyOrNil ifTrue:[ ^ self ]. |
6373 | 4368 |
|
4369 |
thisIsAFileMoveOperation := self clipboard method == #cut. |
|
4370 |
||
3892 | 4371 |
buffer := self clipboard copy. |
3982 | 4372 |
directories := self currentSelectedDirectories. |
5880 | 4373 |
directories size ~~ 1 ifTrue:[ |
4414 | 4374 |
|box dirStringCol| |
5880 | 4375 |
|
4414 | 4376 |
dirStringCol := directories collect:[:aDir| aDir asString]. |
4377 |
box := ListSelectionBox new. |
|
6373 | 4378 |
box title:'Paste into which directory ?'. |
4414 | 4379 |
box list:dirStringCol. |
4380 |
box okAction:[:sel | destination := sel asFilename]. |
|
5003
a14ce263ada5
boxes no longer show at pointer
Claus Gittinger <cg@exept.de>
parents:
4982
diff
changeset
|
4381 |
box show. |
a14ce263ada5
boxes no longer show at pointer
Claus Gittinger <cg@exept.de>
parents:
4982
diff
changeset
|
4382 |
box destroy. |
3892 | 4383 |
] ifFalse:[ |
5880 | 4384 |
destination := directories anElement. |
3892 | 4385 |
]. |
6373 | 4386 |
|
4387 |
thisIsAFileMoveOperation ifTrue:[ |
|
5081 | 4388 |
buffer files copy do:[:aFile| |
4389 |
aFile directory = destination ifTrue:[ |
|
4390 |
buffer files remove:aFile. |
|
4391 |
]. |
|
4392 |
]. |
|
4393 |
]. |
|
4394 |
copiedFiles := self copyFiles:(buffer files) to:destination. |
|
6374 | 4395 |
copiedFiles notEmptyOrNil ifTrue:[ |
4396 |
thisIsAFileMoveOperation ifTrue:[ |
|
4397 |
self deleteFiles:(copiedFiles keys) confirm:false. |
|
4398 |
]. |
|
4399 |
||
4400 |
"/ select those pasted files. |
|
4401 |
self updateCurrentDirectory:true. |
|
4402 |
self currentFileNameHolder value:copiedFiles values. |
|
4403 |
] |
|
3892 | 4404 |
! |
4405 |
||
4406 |
renameFile:aFile |
|
4407 |
"rename the selected file(s)" |
|
4408 |
||
4409 |
^ self renameFiles:(OrderedCollection with:aFile). |
|
4410 |
! |
|
4411 |
||
4230 | 4412 |
renameFile:filename to:newFileString update:aBoolean |
3892 | 4413 |
"rename filename to newFileString" |
4414 |
||
4415 |
|rename| |
|
4416 |
||
5961 | 4417 |
rename := FileOperation renameFile:filename to:newFileString. |
3892 | 4418 |
rename result ifTrue:[ |
4230 | 4419 |
aBoolean ifTrue:[ |
4420 |
self updateAndSelect:(rename renamedFiles). |
|
4421 |
]. |
|
3892 | 4422 |
] ifFalse:[ |
4523 | 4423 |
self notify:rename errorString. |
3892 | 4424 |
]. |
4425 |
^ rename result |
|
4426 |
! |
|
4427 |
||
4428 |
renameFiles:aColOfFiles |
|
6373 | 4429 |
"rename some file(s)" |
3892 | 4430 |
|
4431 |
|rename| |
|
4432 |
||
5961 | 4433 |
rename := FileOperation renameFiles:aColOfFiles. |
3892 | 4434 |
rename result ifFalse:[ |
4523 | 4435 |
self notify:rename errorString |
3892 | 4436 |
] ifTrue:[ |
4707
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4437 |
self updateAndSelect:nil. "/ (rename renamedFiles) |
3892 | 4438 |
]. |
4439 |
^ rename result |
|
4440 |
! |
|
4441 |
||
4442 |
renameSelection |
|
4443 |
"rename the selected file(s)" |
|
4444 |
||
7560 | 4445 |
self renameFiles:(self currentSelectedObjects copy) |
4446 |
||
4447 |
"Modified: / 04-12-2006 / 13:15:24 / cg" |
|
3892 | 4448 |
! ! |
4449 |
||
4080 | 4450 |
!AbstractFileBrowser methodsFor:'menu accessing'! |
3892 | 4451 |
|
9111
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
4452 |
bookmarksMenu |
3952 | 4453 |
<resource: #programMenu> |
4454 |
||
4672
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
4455 |
|menu bookmarks| |
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
4456 |
|
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
4457 |
menu := self class baseBookmarksMenuSpec decodeAsLiteralArray. |
7763 | 4458 |
|
4459 |
"/ add the bookmark items ... |
|
4460 |
bookmarks := self class directoryBookmarks. |
|
4461 |
bookmarks notEmptyOrNil ifTrue:[ |
|
4462 |
menu addItem:(MenuItem labeled:'-'). |
|
4463 |
bookmarks do:[:dirName | |
|
4464 |
menu addItem:((MenuItem label:dirName asString value:[ |
|
4465 |
(self currentSelectedDirectories includes:dirName) ifFalse:[ |
|
4466 |
self setCurrentFileName:dirName. |
|
4467 |
]. |
|
4468 |
])). |
|
4469 |
]. |
|
4470 |
]. |
|
4080 | 4471 |
menu findGuiResourcesIn:self. |
7763 | 4472 |
^ menu |
4473 |
||
4474 |
"Modified: / 27-03-2007 / 10:55:08 / cg" |
|
4475 |
! |
|
4476 |
||
4477 |
canBackward |
|
4478 |
^ self directoryHistory canBackward. |
|
4479 |
||
4480 |
"Modified: / 27-03-2007 / 10:54:55 / cg" |
|
4481 |
! |
|
4482 |
||
4483 |
canForward |
|
4484 |
^ self directoryHistory canForward. |
|
4485 |
||
4486 |
"Modified: / 27-03-2007 / 10:54:57 / cg" |
|
4487 |
! |
|
4488 |
||
9111
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
4489 |
gotoBookmarksMenu |
7763 | 4490 |
<resource: #programMenu> |
4491 |
||
4492 |
|menu bookmarks| |
|
4493 |
||
4494 |
menu := self class baseBookmarksMenuSpec2 decodeAsLiteralArray. |
|
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
4495 |
|
4672
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
4496 |
"/ add the bookmark items ... |
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
4497 |
bookmarks := self class directoryBookmarks. |
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
4498 |
bookmarks notEmptyOrNil ifTrue:[ |
4414 | 4499 |
menu addItem:(MenuItem labeled:'-'). |
4500 |
bookmarks do:[:dirName | |
|
4501 |
menu addItem:((MenuItem label:dirName asString value:[ |
|
6725 | 4502 |
(self currentSelectedDirectories includes:dirName) ifFalse:[ |
5959 | 4503 |
self setCurrentFileName:dirName. |
4414 | 4504 |
]. |
4505 |
])). |
|
4506 |
]. |
|
3952 | 4507 |
]. |
7763 | 4508 |
menu findGuiResourcesIn:self. |
3952 | 4509 |
^ menu |
4510 |
||
7763 | 4511 |
"Modified: / 27-03-2007 / 10:54:50 / cg" |
6099 | 4512 |
! |
4513 |
||
3892 | 4514 |
menuDirHistory:backOrForward |
7763 | 4515 |
"initialize the history menu" |
4516 |
||
3892 | 4517 |
<resource: #programMenu > |
4518 |
||
7763 | 4519 |
|hist menu pathList currentSel currentPath| |
4520 |
||
4521 |
hist := self directoryHistory. |
|
4522 |
hist isEmpty ifTrue:[^ nil]. |
|
4523 |
||
3892 | 4524 |
backOrForward == #back ifTrue:[ |
6725 | 4525 |
currentSel := self currentSelectedDirectories. |
4347 | 4526 |
currentSel size == 1 ifTrue:[ |
4527 |
currentPath := currentSel first asString. |
|
4528 |
] ifFalse:[ |
|
4529 |
currentPath := nil. |
|
4530 |
]. |
|
7763 | 4531 |
pathList := hist getBackCollection. |
3892 | 4532 |
] ifFalse:[ |
7763 | 4533 |
pathList := hist getForwardCollection. |
3892 | 4534 |
]. |
4022 | 4535 |
pathList isEmpty ifTrue:[ ^ nil]. |
7763 | 4536 |
|
6370 | 4537 |
pathList size > 30 ifTrue:[ |
4538 |
pathList := pathList copyTo:30 |
|
4539 |
]. |
|
7763 | 4540 |
|
4541 |
menu := Menu new. |
|
4542 |
||
3964 | 4543 |
pathList do:[:aPath| |
4347 | 4544 |
| menuItem | |
4545 |
menuItem := MenuItem new. |
|
4546 |
menuItem label:aPath. |
|
4547 |
menuItem value:[ |
|
5959 | 4548 |
self setCurrentFileName:(aPath asFilename). |
4347 | 4549 |
]. |
4550 |
menu addItem:menuItem. |
|
3952 | 4551 |
]. |
7763 | 4552 |
menu findGuiResourcesIn:self. |
3892 | 4553 |
^ menu |
7763 | 4554 |
|
4555 |
"Modified: / 27-03-2007 / 10:54:29 / cg" |
|
3892 | 4556 |
! |
4557 |
||
4558 |
menuDirHistoryBack |
|
4559 |
"initialize the directory menu |
|
4560 |
" |
|
4561 |
<resource: #programMenu > |
|
4562 |
||
4563 |
^ self menuDirHistory:#back. |
|
4564 |
! |
|
4565 |
||
4566 |
menuDirHistoryForward |
|
4567 |
"initialize the directory menu |
|
4568 |
" |
|
4569 |
<resource: #programMenu > |
|
4570 |
||
4571 |
^ self menuDirHistory:#forward. |
|
3906 | 4572 |
! |
4573 |
||
4574 |
menuFileHistory |
|
4575 |
"initialize the file history menu |
|
4576 |
" |
|
4577 |
<resource: #programMenu > |
|
4578 |
||
7763 | 4579 |
|menu hist text removeItem| |
3906 | 4580 |
|
4581 |
hist := self fileHistory. |
|
4582 |
hist isEmpty ifTrue:[^ nil]. |
|
4391
05ad03de6f3c
no icon in clearHistory menuItem
Claus Gittinger <cg@exept.de>
parents:
4368
diff
changeset
|
4583 |
|
7763 | 4584 |
menu := Menu new. |
4585 |
||
4586 |
hist copy do:[:aFileItem| |
|
4391
05ad03de6f3c
no icon in clearHistory menuItem
Claus Gittinger <cg@exept.de>
parents:
4368
diff
changeset
|
4587 |
aFileItem fileName exists ifTrue:[ |
05ad03de6f3c
no icon in clearHistory menuItem
Claus Gittinger <cg@exept.de>
parents:
4368
diff
changeset
|
4588 |
menu addItem:(MenuItem label: aFileItem fileName asString value:[ |
5959 | 4589 |
self setCurrentFileName:(aFileItem fileName). |
4391
05ad03de6f3c
no icon in clearHistory menuItem
Claus Gittinger <cg@exept.de>
parents:
4368
diff
changeset
|
4590 |
self openApplByFileItem:aFileItem |
05ad03de6f3c
no icon in clearHistory menuItem
Claus Gittinger <cg@exept.de>
parents:
4368
diff
changeset
|
4591 |
]). |
05ad03de6f3c
no icon in clearHistory menuItem
Claus Gittinger <cg@exept.de>
parents:
4368
diff
changeset
|
4592 |
] ifFalse:[ |
7763 | 4593 |
"/ remove all not existing history entries |
4594 |
hist remove:aFileItem. |
|
4391
05ad03de6f3c
no icon in clearHistory menuItem
Claus Gittinger <cg@exept.de>
parents:
4368
diff
changeset
|
4595 |
] |
3906 | 4596 |
]. |
7763 | 4597 |
menu addSeparator. |
4598 |
||
4080 | 4599 |
removeItem := MenuItem new. |
4600 |
removeItem translateLabel:true. |
|
4391
05ad03de6f3c
no icon in clearHistory menuItem
Claus Gittinger <cg@exept.de>
parents:
4368
diff
changeset
|
4601 |
text := resources string:'Clear History'. |
05ad03de6f3c
no icon in clearHistory menuItem
Claus Gittinger <cg@exept.de>
parents:
4368
diff
changeset
|
4602 |
"/ text := LabelAndIcon icon:(self class clearHistoryIcon) string:text. |
4080 | 4603 |
removeItem label:text. |
4604 |
removeItem value:[ |
|
4391
05ad03de6f3c
no icon in clearHistory menuItem
Claus Gittinger <cg@exept.de>
parents:
4368
diff
changeset
|
4605 |
self fileHistory removeAll. |
05ad03de6f3c
no icon in clearHistory menuItem
Claus Gittinger <cg@exept.de>
parents:
4368
diff
changeset
|
4606 |
self enableFileHistory value:false. |
3906 | 4607 |
]. |
4608 |
menu addItem:removeItem. |
|
7763 | 4609 |
menu findGuiResourcesIn:self. |
3906 | 4610 |
^ menu |
7763 | 4611 |
|
4612 |
"Modified: / 27-03-2007 / 10:52:40 / cg" |
|
3952 | 4613 |
! |
4614 |
||
4080 | 4615 |
sortMenu |
4616 |
<resource: #programMenu > |
|
4617 |
||
4618 |
|menu| |
|
4619 |
||
7763 | 4620 |
menu := Menu decodeFromLiteralArray:self class sortMenu. |
4080 | 4621 |
menu findGuiResourcesIn:self. |
4622 |
^ menu |
|
7763 | 4623 |
|
4624 |
"Modified: / 27-03-2007 / 10:47:42 / cg" |
|
4080 | 4625 |
! |
4626 |
||
4627 |
viewDetailsMenuSpec |
|
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4628 |
|specContentsBrowser itemsContentsBrowser specHere itemsHere spec| |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4629 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4630 |
specHere := self class viewDetailsMenuSpec. |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4631 |
itemsHere := specHere at:2. |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4632 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4633 |
specContentsBrowser := self directoryContentsBrowser class viewBrowserMenuSpec. |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4634 |
itemsContentsBrowser := (specContentsBrowser at:2). |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4635 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4636 |
spec := specHere copy. |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4637 |
spec at:2 put:(itemsContentsBrowser , itemsHere). |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4638 |
^ spec |
4080 | 4639 |
! |
4640 |
||
4641 |
viewInContentsBrowserMenu |
|
5009 | 4642 |
self |
4643 |
applicationNamed:#DirectoryContentsBrowser |
|
4644 |
ifPresentDo:[:appl | ^ appl viewBrowserMenu]. |
|
4645 |
||
4646 |
^ nil. |
|
4080 | 4647 |
! |
4648 |
||
3952 | 4649 |
visitedDirectoriesMenu |
4650 |
<resource: #programMenu > |
|
4651 |
||
4652 |
|menu histCopy text removeItem| |
|
4653 |
||
7763 | 4654 |
histCopy := self directoryHistory. |
4655 |
histCopy isEmpty ifTrue:[^ nil]. |
|
4656 |
||
3952 | 4657 |
menu := Menu new. |
7763 | 4658 |
|
4659 |
histCopy do:[:aFile| |
|
4660 |
menu addItem:(MenuItem label:aFile asString value:[ |
|
4661 |
self setCurrentFileName:(aFile path asFilename). |
|
4662 |
]). |
|
4663 |
]. |
|
4664 |
menu addSeparator. |
|
4665 |
||
4672
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
4666 |
"/ 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
|
4667 |
text := (resources string:'Clear History'). |
3952 | 4668 |
removeItem := MenuItem new. |
4040 | 4669 |
removeItem translateLabel:true. |
3952 | 4670 |
removeItem label:text. |
4671 |
removeItem value:[ |
|
6369 | 4672 |
self directoryHistory removeAll. |
4347 | 4673 |
self enableForward value:self canForward. |
4674 |
self enableBack value:self canBackward. |
|
3952 | 4675 |
]. |
7763 | 4676 |
|
3952 | 4677 |
menu addItem:removeItem. |
7763 | 4678 |
menu findGuiResourcesIn:self. |
3952 | 4679 |
^ menu |
7763 | 4680 |
|
4681 |
"Modified: / 27-03-2007 / 10:50:39 / cg" |
|
3892 | 4682 |
! ! |
4683 |
||
5880 | 4684 |
!AbstractFileBrowser methodsFor:'menu actions'! |
4685 |
||
4686 |
doCompareTwoFiles |
|
4687 |
self openDiffView. |
|
4688 |
! |
|
4689 |
||
4690 |
doGoDirectoryUp |
|
5960 | 4691 |
| upDir directory rootInTreeView| |
5880 | 4692 |
|
4693 |
self enableDirectoryUp value ifFalse:[ ^ self]. |
|
4694 |
self currentFilesAreInSameDirectory ifTrue:[ |
|
5960 | 4695 |
directory := self currentDirectory. |
4696 |
directory isNil ifTrue:[ ^ self]. |
|
5880 | 4697 |
] ifFalse:[ |
4698 |
rootInTreeView := self |
|
4699 |
applicationNamed:#DirectoryTreeBrowser |
|
4700 |
ifPresentDo:[:appl | appl rootHolder]. |
|
5960 | 4701 |
directory := rootInTreeView value asFilename. |
4702 |
]. |
|
4703 |
upDir := directory directory. |
|
5959 | 4704 |
self setCurrentFileName:upDir. |
5880 | 4705 |
! |
4706 |
||
4707 |
doGotoDefaultDirectory |
|
4708 |
self gotoFile:(Filename defaultDirectory). |
|
4709 |
! |
|
4710 |
||
8091 | 4711 |
doGotoDesktopDirectory |
4712 |
self gotoFile:(Filename desktopDirectory). |
|
4713 |
! |
|
4714 |
||
5880 | 4715 |
doGotoHomeDirectory |
8091 | 4716 |
self gotoFile:(Filename homeDirectory). |
5880 | 4717 |
! |
4718 |
||
6434 | 4719 |
doGotoSmalltalkDirectory |
4720 |
self gotoFile:(self smalltalkDirectory). |
|
4721 |
! |
|
4722 |
||
9596 | 4723 |
doMakeCurrentDirectory |
4724 |
OperatingSystem setCurrentDirectory:(self currentDirectory pathName). |
|
4725 |
self currentFileNameHolderChangedForCommon. |
|
4726 |
||
4727 |
"Created: / 26-10-2010 / 17:21:19 / cg" |
|
4728 |
! |
|
4729 |
||
5880 | 4730 |
fileGetInfo:longInfo |
4731 |
"get info on selected file - show it in a box" |
|
4732 |
||
4733 |
|string box updater| |
|
4734 |
||
4735 |
string := self getFileInfoStringForFirstSelectedFile:longInfo. |
|
4736 |
string notNil ifTrue:[ |
|
4737 |
box := InfoBox title:string. |
|
4738 |
updater := [ |
|
4739 |
[true] whileTrue:[ |
|
4740 |
Delay waitForSeconds:2. |
|
4741 |
string := self getFileInfoStringForFirstSelectedFile:longInfo. |
|
4742 |
string isNil ifTrue:[ ^ self]. |
|
4743 |
box title:string |
|
4744 |
] |
|
4745 |
] fork. |
|
4746 |
box show. |
|
4747 |
updater terminate. |
|
4748 |
box destroy |
|
4749 |
] |
|
6434 | 4750 |
! |
4751 |
||
4752 |
smalltalkDirectory |
|
8590 | 4753 |
|stxPath| |
6434 | 4754 |
|
4755 |
stxPath := OperatingSystem pathOfSTXExecutable. |
|
8590 | 4756 |
stxPath isNil ifTrue:[ |
4757 |
^ Filename currentDirectory |
|
4758 |
]. |
|
4759 |
^ stxPath asFilename directory. |
|
5880 | 4760 |
! ! |
4761 |
||
4849 | 4762 |
!AbstractFileBrowser methodsFor:'menu actions-cvs'! |
3892 | 4763 |
|
4764 |
cvsAddAndCommit |
|
4849 | 4765 |
self cvsAddAndCommitAsBinary:false |
4766 |
! |
|
4767 |
||
4768 |
cvsAddAndCommitAsBinary:asBinary |
|
8588 | 4769 |
|sel log logArg binArg cmd dir executionBlock nameString| |
3892 | 4770 |
|
4771 |
log := Dialog |
|
4849 | 4772 |
requestText:(resources string:'Enter initial log message') |
4414 | 4773 |
lines:10 |
4774 |
columns:70 |
|
4775 |
initialAnswer:nil. |
|
8322
cf10f08b6164
care for cancel in #cvsAddAndCommitAsBinary:
Claus Gittinger <cg@exept.de>
parents:
8294
diff
changeset
|
4776 |
log isNil ifTrue:[^ self]. |
3892 | 4777 |
|
6205
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
4778 |
OperatingSystem isMSWINDOWSlike ifTrue:[ |
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
4779 |
logArg := '-m "' , log , '"'. |
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
4780 |
] ifFalse:[ |
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
4781 |
logArg := '-m ''' , log , ''''. |
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
4782 |
]. |
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
4783 |
|
8588 | 4784 |
binArg := ''. |
4785 |
asBinary ifTrue:[ |
|
4786 |
binArg := '-kb '. |
|
4787 |
]. |
|
3982 | 4788 |
sel := self currentSelectedFiles. |
3892 | 4789 |
executionBlock := [ : stream | |
4414 | 4790 |
log notNil ifTrue:[ |
4791 |
sel size > 0 ifTrue:[ |
|
4792 |
sel do:[:fn | |
|
8567
bcbadc9d40c3
allow checkin of files with a space
Claus Gittinger <cg@exept.de>
parents:
8563
diff
changeset
|
4793 |
|nameArg| |
bcbadc9d40c3
allow checkin of files with a space
Claus Gittinger <cg@exept.de>
parents:
8563
diff
changeset
|
4794 |
|
bcbadc9d40c3
allow checkin of files with a space
Claus Gittinger <cg@exept.de>
parents:
8563
diff
changeset
|
4795 |
nameArg := '"',fn baseName,'"'. |
bcbadc9d40c3
allow checkin of files with a space
Claus Gittinger <cg@exept.de>
parents:
8563
diff
changeset
|
4796 |
|
4414 | 4797 |
dir := self getDirWithoutFileName:fn. |
8588 | 4798 |
cmd := 'cvs add ',logArg,' ',binArg,nameArg. |
6204 | 4799 |
(self getExecutionBlockForCommand:cmd inDirectory:dir) value:stream. |
4849 | 4800 |
|
8567
bcbadc9d40c3
allow checkin of files with a space
Claus Gittinger <cg@exept.de>
parents:
8563
diff
changeset
|
4801 |
cmd := ('cvs commit -l ',logArg,' ',nameArg). |
6204 | 4802 |
(self getExecutionBlockForCommand:cmd inDirectory:dir) value:stream. |
8588 | 4803 |
"/ mhmh - it seems that only old CVS implementations (at least turqoise) |
4804 |
"/ support and need the 'admin -kb' command. |
|
4805 |
"/ 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
|
4806 |
asBinary ifTrue:[ |
8567
bcbadc9d40c3
allow checkin of files with a space
Claus Gittinger <cg@exept.de>
parents:
8563
diff
changeset
|
4807 |
cmd := ('cvs admin -kb ' , nameArg). |
6205
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
4808 |
(self getExecutionBlockForCommand:cmd inDirectory:dir) value:stream. |
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
4809 |
|
8567
bcbadc9d40c3
allow checkin of files with a space
Claus Gittinger <cg@exept.de>
parents:
8563
diff
changeset
|
4810 |
cmd := ('cvs upd ' , nameArg). |
6205
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
4811 |
(self getExecutionBlockForCommand:cmd inDirectory:dir) value:stream. |
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
4812 |
]. |
4414 | 4813 |
] |
4814 |
] |
|
4815 |
] |
|
3892 | 4816 |
]. |
4107 | 4817 |
nameString := 'Command> cvs add and commit'. |
3892 | 4818 |
self makeExecutionResultProcessFor:executionBlock withName:nameString. |
4819 |
! |
|
4820 |
||
4849 | 4821 |
cvsAddBinaryAndCommit |
4822 |
self cvsAddAndCommitAsBinary:true |
|
4823 |
! |
|
4824 |
||
3892 | 4825 |
cvsCommit |
6205
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
4826 |
|nSel log logArg msg cmd selectedFiles sel executionBlock nameString| |
3892 | 4827 |
|
3982 | 4828 |
selectedFiles:= self currentSelectedFiles. |
3892 | 4829 |
nSel := selectedFiles size. |
4830 |
||
4831 |
nSel == 1 ifTrue:[ |
|
8440 | 4832 |
msg := resources string:'Enter log message for checkIn of "%1"' with:(selectedFiles first baseName) |
3892 | 4833 |
] ifFalse:[ |
4414 | 4834 |
nSel > 1 ifTrue:[ |
6627 | 4835 |
msg := resources string:'Enter log message for %1 files to checkIn' with:nSel printString |
4414 | 4836 |
] ifFalse:[ |
6627 | 4837 |
msg := resources string:'Enter log message for checkIn' |
4414 | 4838 |
] |
3892 | 4839 |
]. |
4840 |
||
4841 |
log := Dialog |
|
4414 | 4842 |
requestText:msg |
4843 |
lines:10 |
|
4844 |
columns:70 |
|
4845 |
initialAnswer:nil. |
|
3892 | 4846 |
|
4663 | 4847 |
log isNil ifTrue:[^ self]. |
6205
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
4848 |
|
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
4849 |
OperatingSystem isMSWINDOWSlike ifTrue:[ |
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
4850 |
logArg := '-m "' , log , '"'. |
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
4851 |
] ifFalse:[ |
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
4852 |
logArg := '-m ''' , log , ''''. |
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
4853 |
]. |
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
4854 |
|
7560 | 4855 |
sel := self currentSelectedObjects. |
4663 | 4856 |
sel isEmpty ifTrue:[ ^ self ]. |
7560 | 4857 |
|
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
4858 |
executionBlock := [:stream | |
4663 | 4859 |
log notNil ifTrue:[ |
4860 |
sel size > 0 ifTrue:[ |
|
4861 |
sel do:[:fn | |
|
8568
fe221c53eead
allow checkin of files with a space
Claus Gittinger <cg@exept.de>
parents:
8567
diff
changeset
|
4862 |
| dir nameArg | |
fe221c53eead
allow checkin of files with a space
Claus Gittinger <cg@exept.de>
parents:
8567
diff
changeset
|
4863 |
|
fe221c53eead
allow checkin of files with a space
Claus Gittinger <cg@exept.de>
parents:
8567
diff
changeset
|
4864 |
nameArg := '"',fn baseName,'"'. |
4663 | 4865 |
dir := fn directory. |
8568
fe221c53eead
allow checkin of files with a space
Claus Gittinger <cg@exept.de>
parents:
8567
diff
changeset
|
4866 |
cmd := 'cvs commit ',logArg,' ' , nameArg. |
6204 | 4867 |
(self getExecutionBlockForCommand:cmd inDirectory:dir) value:stream. |
4663 | 4868 |
] |
4869 |
] |
|
4870 |
] |
|
4107 | 4871 |
]. |
4872 |
nameString := 'Command> cvs commit'. |
|
4873 |
self makeExecutionResultProcessFor:executionBlock withName:nameString. |
|
7560 | 4874 |
|
4875 |
"Modified: / 04-12-2006 / 13:16:39 / cg" |
|
3892 | 4876 |
! |
4877 |
||
9407
cf114ba82b6d
added: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
9405
diff
changeset
|
4878 |
cvsCompareWithNewest |
cf114ba82b6d
added: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
9405
diff
changeset
|
4879 |
|selectedFiles| |
cf114ba82b6d
added: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
9405
diff
changeset
|
4880 |
|
cf114ba82b6d
added: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
9405
diff
changeset
|
4881 |
selectedFiles:= self currentSelectedFiles. |
cf114ba82b6d
added: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
9405
diff
changeset
|
4882 |
selectedFiles do:[:each | |
cf114ba82b6d
added: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
9405
diff
changeset
|
4883 |
self halt. |
cf114ba82b6d
added: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
9405
diff
changeset
|
4884 |
]. |
cf114ba82b6d
added: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
9405
diff
changeset
|
4885 |
! |
cf114ba82b6d
added: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
9405
diff
changeset
|
4886 |
|
3892 | 4887 |
cvsRemoveAndRemoveFromCVS:filesToRemove |
4888 |
"remove the selected file(s) and their CVS containers - no questions asked" |
|
4889 |
||
6205
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
4890 |
|toRemove updateRunning executionBlock nameString| |
3892 | 4891 |
|
4892 |
updateRunning := self backgroundProcesses value notEmpty. |
|
4893 |
self killAllRunningBackgroundProcesses. |
|
4894 |
toRemove := OrderedCollection new. |
|
4895 |
||
4896 |
executionBlock := [ : stream | |
|
6205
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
4897 |
|cmd logArg| |
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
4898 |
|
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
4899 |
OperatingSystem isMSWINDOWSlike ifTrue:[ |
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
4900 |
logArg := '-m "' , 'removed via FileBrowser' , '"'. |
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
4901 |
] ifFalse:[ |
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
4902 |
logArg := '-m ''' , 'removed via FileBrowser' , ''''. |
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
4903 |
]. |
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
4904 |
|
4414 | 4905 |
filesToRemove do:[:fileName | |
4906 |
OperatingSystem accessDeniedErrorSignal handle:[:ex| |
|
4907 |
"was not able to remove it" |
|
6205
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
4908 |
| lastError msg | |
4414 | 4909 |
lastError := OperatingSystem lastErrorString. |
4910 |
msg := (resources string:'cannot remove ''%1'' !!' with:fileName). |
|
4911 |
lastError isNil ifFalse:[ |
|
4912 |
msg := msg , '\\(' , lastError , ')' |
|
4913 |
]. |
|
4914 |
Dialog warn:msg withCRs |
|
4915 |
] do:[ |
|
6250
5b0673ccff1c
refactored intention revealing code:
Claus Gittinger <cg@exept.de>
parents:
6236
diff
changeset
|
4916 |
(fileName isSymbolicLink) ifFalse:[ |
4414 | 4917 |
fileName remove. |
8568
fe221c53eead
allow checkin of files with a space
Claus Gittinger <cg@exept.de>
parents:
8567
diff
changeset
|
4918 |
cmd := ('cvs remove -f "',fileName baseName,'"'). |
6204 | 4919 |
(self getExecutionBlockForCommand:cmd) value:stream. |
4414 | 4920 |
] |
4921 |
]. |
|
4922 |
]. |
|
6205
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
4923 |
cmd := 'cvs commit -l ',logArg. |
6204 | 4924 |
(self getExecutionBlockForCommand:cmd) value:stream. |
3892 | 4925 |
]. |
4107 | 4926 |
nameString := 'Command> cvs remove and commit ', filesToRemove first baseName. |
3892 | 4927 |
filesToRemove size > 1 ifTrue:[ |
4414 | 4928 |
nameString := nameString, ' ...'. |
3892 | 4929 |
]. |
4930 |
self makeExecutionResultProcessFor:executionBlock withName:nameString. |
|
4931 |
! |
|
4932 |
||
4933 |
cvsRemoveFileAndCVSContainer |
|
4934 |
|sel question aswer| |
|
4935 |
||
4294 | 4936 |
sel := self currentSelectedFiles copy. |
3892 | 4937 |
sel size > 0 ifTrue:[ |
4294 | 4938 |
sel size > 1 ifTrue:[ |
4939 |
question := resources string:'Remove %1 selected files and their CVS containers ?' with:(sel size) |
|
4940 |
] ifFalse:[ |
|
4941 |
question := resources string:'Remove ''%1'' and its CVS container ?' with:(sel first baseName allBold) |
|
4942 |
]. |
|
4943 |
||
4944 |
aswer := Dialog |
|
4945 |
confirm:question withCRs |
|
6627 | 4946 |
yesLabel:(resources string:'Remove') |
4947 |
noLabel:(resources string:'Cancel'). |
|
4294 | 4948 |
aswer ifTrue:[ |
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
4949 |
self withActivityIndicationDo:[ |
4294 | 4950 |
self cvsRemoveAndRemoveFromCVS:sel |
4951 |
] |
|
4952 |
] |
|
3892 | 4953 |
] |
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
4954 |
|
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
4955 |
"Modified: / 25-07-2006 / 09:07:09 / cg" |
3892 | 4956 |
! |
4957 |
||
9338 | 4958 |
cvsRevisionLog |
4959 |
| cmd sel executionBlock nameString| |
|
4960 |
||
4961 |
sel := self currentSelectedObjects. |
|
4962 |
sel isEmpty ifTrue:[ ^ self ]. |
|
4963 |
||
4964 |
executionBlock := [:stream | |
|
4965 |
sel do:[:fn | |
|
4966 |
| dir nameArg | |
|
4967 |
||
4968 |
nameArg := '"',fn baseName,'"'. |
|
4969 |
dir := fn directory. |
|
4970 |
cmd := 'cvs log ' , nameArg. |
|
4971 |
(self getExecutionBlockForCommand:cmd inDirectory:dir) value:stream. |
|
4972 |
] |
|
4973 |
]. |
|
4974 |
nameString := 'Command> cvs log'. |
|
4975 |
self makeExecutionResultProcessFor:executionBlock withName:nameString. |
|
4976 |
! |
|
4977 |
||
8562 | 4978 |
cvsTagSelection |
4979 |
|tag stream cmd| |
|
4980 |
||
4981 |
tag := Dialog request:(resources string:'Tag:'). |
|
4982 |
||
4983 |
CVSSourceCodeManager notNil ifTrue:[ |
|
4984 |
cmd := CVSSourceCodeManager cvsExecutable. |
|
4985 |
] ifFalse:[ |
|
4986 |
cmd := 'cvs'. |
|
4987 |
]. |
|
4988 |
||
4989 |
stream := WriteStream on:''. |
|
4990 |
stream |
|
4991 |
nextPutAll:cmd; |
|
4992 |
nextPutAll:' tag -F '; |
|
4993 |
nextPutAll:'"'; |
|
4994 |
nextPutAll:tag; |
|
8563 | 4995 |
nextPutAll:'" '; |
4996 |
nextPutAll:(self makeFileNameArgumentString). |
|
4997 |
||
8562 | 4998 |
self executeCommand:stream contents. |
4999 |
! |
|
5000 |
||
3892 | 5001 |
cvsUpdateAll |
5002 |
| cmd | |
|
5003 |
||
8042
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
5004 |
CVSSourceCodeManager notNil ifTrue:[ |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
5005 |
cmd := CVSSourceCodeManager cvsExecutable. |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
5006 |
] ifFalse:[ |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
5007 |
cmd := 'cvs'. |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
5008 |
]. |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
5009 |
|
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
5010 |
self executeCommand:(cmd, ' upd -l'). |
3892 | 5011 |
! |
5012 |
||
5013 |
cvsUpdateAllRecursive |
|
5014 |
| cmd | |
|
5015 |
||
8042
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
5016 |
CVSSourceCodeManager notNil ifTrue:[ |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
5017 |
cmd := CVSSourceCodeManager cvsExecutable. |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
5018 |
] ifFalse:[ |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
5019 |
cmd := 'cvs'. |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
5020 |
]. |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
5021 |
self executeCommand:(cmd, ' upd -d'). |
3892 | 5022 |
! |
5023 |
||
5024 |
cvsUpdateSelection |
|
8042
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
5025 |
|stream cmd| |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
5026 |
|
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
5027 |
CVSSourceCodeManager notNil ifTrue:[ |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
5028 |
cmd := CVSSourceCodeManager cvsExecutable. |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
5029 |
] ifFalse:[ |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
5030 |
cmd := 'cvs'. |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
5031 |
]. |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
5032 |
|
3892 | 5033 |
stream := WriteStream on:''. |
8563 | 5034 |
stream |
5035 |
nextPutAll:cmd; |
|
5036 |
nextPutAll:' upd '; |
|
5037 |
nextPutAll:(self makeFileNameArgumentString). |
|
5038 |
||
5039 |
self executeCommand:stream contents. |
|
5040 |
! |
|
5041 |
||
5042 |
makeFileNameArgumentString |
|
5043 |
|stream| |
|
5044 |
||
5045 |
stream := WriteStream on:''. |
|
8042
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
5046 |
self currentSelectedFiles do:[: file | |
8563 | 5047 |
stream nextPut:$". |
4414 | 5048 |
stream nextPutAll:file baseName. |
8563 | 5049 |
stream nextPutAll:'" '. |
5050 |
]. |
|
5051 |
^ stream contents. |
|
3892 | 5052 |
! ! |
5053 |
||
6169 | 5054 |
!AbstractFileBrowser methodsFor:'menu actions-file'! |
3892 | 5055 |
|
4453
00e639bf2723
cut and copy files in toolbarmenu goes not to contentsbrowser only
penk
parents:
4432
diff
changeset
|
5056 |
copyFiles |
6169 | 5057 |
self |
5058 |
withSelectedFilesOrDirectoriesDo:[:filesOrDirs | self copyFilesToClipBoard:filesOrDirs] |
|
4453
00e639bf2723
cut and copy files in toolbarmenu goes not to contentsbrowser only
penk
parents:
4432
diff
changeset
|
5059 |
! |
00e639bf2723
cut and copy files in toolbarmenu goes not to contentsbrowser only
penk
parents:
4432
diff
changeset
|
5060 |
|
00e639bf2723
cut and copy files in toolbarmenu goes not to contentsbrowser only
penk
parents:
4432
diff
changeset
|
5061 |
cutFiles |
6169 | 5062 |
self |
5063 |
withSelectedFilesOrDirectoriesDo:[:filesOrDirs | self cutFilesToClipBoard:filesOrDirs] |
|
4453
00e639bf2723
cut and copy files in toolbarmenu goes not to contentsbrowser only
penk
parents:
4432
diff
changeset
|
5064 |
! |
00e639bf2723
cut and copy files in toolbarmenu goes not to contentsbrowser only
penk
parents:
4432
diff
changeset
|
5065 |
|
00e639bf2723
cut and copy files in toolbarmenu goes not to contentsbrowser only
penk
parents:
4432
diff
changeset
|
5066 |
deleteFiles |
6169 | 5067 |
self |
5068 |
withSelectedFilesOrDirectoriesDo:[:filesOrDirs | self deleteFiles:filesOrDirs] |
|
5069 |
! |
|
5070 |
||
5071 |
eraseFiles |
|
5072 |
self |
|
5073 |
withSelectedFilesOrDirectoriesDo:[:filesOrDirs | self eraseFiles:filesOrDirs] |
|
4940
4964068c4718
allow settings dialog to be opened from browser
Claus Gittinger <cg@exept.de>
parents:
4930
diff
changeset
|
5074 |
! |
4964068c4718
allow settings dialog to be opened from browser
Claus Gittinger <cg@exept.de>
parents:
4930
diff
changeset
|
5075 |
|
4964068c4718
allow settings dialog to be opened from browser
Claus Gittinger <cg@exept.de>
parents:
4930
diff
changeset
|
5076 |
openSettingsDialog |
4964068c4718
allow settings dialog to be opened from browser
Claus Gittinger <cg@exept.de>
parents:
4930
diff
changeset
|
5077 |
|dialog| |
4964068c4718
allow settings dialog to be opened from browser
Claus Gittinger <cg@exept.de>
parents:
4930
diff
changeset
|
5078 |
|
4964068c4718
allow settings dialog to be opened from browser
Claus Gittinger <cg@exept.de>
parents:
4930
diff
changeset
|
5079 |
dialog := FileBrowserV2SettingsDialog new. |
5034 | 5080 |
dialog settingsDialog:self. |
4940
4964068c4718
allow settings dialog to be opened from browser
Claus Gittinger <cg@exept.de>
parents:
4930
diff
changeset
|
5081 |
dialog allButOpen. |
4964068c4718
allow settings dialog to be opened from browser
Claus Gittinger <cg@exept.de>
parents:
4930
diff
changeset
|
5082 |
dialog doReload. |
4964068c4718
allow settings dialog to be opened from browser
Claus Gittinger <cg@exept.de>
parents:
4930
diff
changeset
|
5083 |
dialog openWindow |
6169 | 5084 |
! |
5085 |
||
5086 |
withSelectedFilesOrDirectoriesDo:aBlock |
|
5087 |
|files dirs| |
|
5088 |
||
5089 |
files := self currentSelectedFiles. |
|
5090 |
files notEmpty ifTrue:[ |
|
5091 |
aBlock value:files. |
|
5092 |
] ifFalse:[ |
|
5093 |
dirs := self currentSelectedDirectories. |
|
5094 |
dirs notEmpty ifTrue:[ |
|
5095 |
aBlock value:dirs. |
|
5096 |
]. |
|
5097 |
]. |
|
3892 | 5098 |
! ! |
5099 |
||
4849 | 5100 |
!AbstractFileBrowser methodsFor:'menu actions-help'! |
5101 |
||
5102 |
openAboutThisApplication |
|
5103 |
"opens an about box for this application." |
|
5104 |
||
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
5105 |
Dialog aboutClass:self class. |
4849 | 5106 |
! |
5107 |
||
5108 |
openHTMLDocument:relativeDocPath |
|
5109 |
HTMLDocumentView openFullOnDocumentationFile:relativeDocPath |
|
5110 |
! ! |
|
5111 |
||
5112 |
!AbstractFileBrowser methodsFor:'menu actions-tools'! |
|
3892 | 5113 |
|
8510 | 5114 |
allFilesInSelectedDirectoriesForWhich:aBlock |
5115 |
|directories allFiles| |
|
5116 |
||
5117 |
directories := self currentSelectedDirectories. |
|
5118 |
directories isEmpty ifTrue:[^ self]. |
|
5119 |
||
5120 |
allFiles := OrderedCollection new. |
|
5121 |
directories do:[:dir| |
|
5122 |
[ |
|
5123 |
|fileNames| |
|
5124 |
||
5125 |
fileNames := dir directoryContents. |
|
5126 |
fileNames notNil ifTrue:[ |
|
5127 |
fileNames := fileNames |
|
5128 |
collect:[:fn | dir construct:fn] |
|
5129 |
thenSelect:[:fn | fn isDirectory not and:[aBlock value:fn]]. |
|
5130 |
allFiles addAll:fileNames. |
|
5131 |
] |
|
5132 |
] on:FileStream openErrorSignal do:[:ex| |
|
5133 |
self warn:(resources stringWithCRs:'Cannot access: %1\(%2)' |
|
5134 |
with:ex pathName |
|
5135 |
with:ex description). |
|
5136 |
ex proceedWith:nil. |
|
5137 |
]. |
|
5138 |
]. |
|
5139 |
||
5140 |
^ allFiles |
|
5141 |
! |
|
5142 |
||
4721
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5143 |
conversionChainFrom:inSuffix to:outSuffix |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5144 |
|conv| |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5145 |
|
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5146 |
inSuffix = outSuffix ifTrue:[ |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5147 |
^ nil |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5148 |
]. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5149 |
|
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5150 |
"/ 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
|
5151 |
"/ 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
|
5152 |
|
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5153 |
conv := OrderedCollection new. |
4722 | 5154 |
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
|
5155 |
|
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5156 |
outSuffix = 'png' ifTrue:[ |
4722 | 5157 |
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
|
5158 |
^ conv. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5159 |
]. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5160 |
outSuffix = 'gif' ifTrue:[ |
4722 | 5161 |
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
|
5162 |
^ conv. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5163 |
]. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5164 |
outSuffix = 'xpm' ifTrue:[ |
4722 | 5165 |
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
|
5166 |
^ conv. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5167 |
]. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5168 |
outSuffix = 'jpg' ifTrue:[ |
4722 | 5169 |
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
|
5170 |
^ conv. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5171 |
]. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5172 |
self error:'unimplemented conversion'. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5173 |
! |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5174 |
|
9493
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5175 |
convertImageFrom:fileName to:outFile onError:exceptionBlock |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5176 |
|writer image outSuffix| |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5177 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5178 |
outSuffix := outFile suffix. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5179 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5180 |
((writer := MIMETypes imageReaderForSuffix:outSuffix) notNil |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5181 |
and:[ (image := Image fromFile:fileName) notNil |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5182 |
and:[ writer canRepresent:image ]]) ifTrue:[ |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5183 |
"/ can do it with Smalltalk tools |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5184 |
writer save:image onFile:outFile. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5185 |
^ self |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5186 |
] ifFalse:[ |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5187 |
"/ use external tools (pbm-package, if available) |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5188 |
self |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5189 |
convertImageUsingExternalFileToolsFrom:fileName |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5190 |
toSuffix:outSuffix |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5191 |
onError:exceptionBlock. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5192 |
]. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5193 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5194 |
"Created: / 20-05-2010 / 11:12:36 / cg" |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5195 |
! |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5196 |
|
4367 | 5197 |
convertImageToGIF |
4721
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5198 |
self convertImageToSuffix:'gif' |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5199 |
! |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5200 |
|
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5201 |
convertImageToJPG |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5202 |
self convertImageToSuffix:'jpg' |
4531 | 5203 |
! |
5204 |
||
5205 |
convertImageToPNG |
|
4721
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5206 |
self convertImageToSuffix:'png' |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5207 |
! |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5208 |
|
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5209 |
convertImageToSuffix:outSuffix |
9493
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5210 |
|outFile filesToConvert| |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5211 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5212 |
self withActivityIndicationDo:[ |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5213 |
filesToConvert := self currentSelectedObjects copy. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5214 |
filesToConvert do:[:fileName | |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5215 |
self notify:(resources string:'Converting: %1...' with:fileName baseName). |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5216 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5217 |
fileName isDirectory ifFalse:[ |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5218 |
|skip| |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5219 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5220 |
skip := false. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5221 |
outFile := fileName withSuffix:outSuffix. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5222 |
outFile exists ifTrue:[ |
4722 | 5223 |
|answer| |
5224 |
||
9493
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5225 |
answer := Dialog |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5226 |
confirmWithCancel:(resources string:'Overwrite existing %1 ?' with:outFile baseName allBold) |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5227 |
default:false. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5228 |
answer isNil ifTrue:[AbortSignal raise]. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5229 |
answer ifFalse:[ skip := true ]. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5230 |
]. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5231 |
skip ifFalse:[ |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5232 |
self |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5233 |
convertImageFrom:fileName |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5234 |
to:outFile |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5235 |
onError:[:errMsg | |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5236 |
filesToConvert size == 1 ifTrue:[ |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5237 |
Dialog warn:errMsg |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5238 |
] ifFalse:[ |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5239 |
(Dialog confirm:errMsg yesLabel:(resources string:'OK') noLabel:(resources string:'Cancel')) ifFalse:[ |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5240 |
^ self |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5241 |
] |
4721
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5242 |
]. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5243 |
]. |
9493
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5244 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5245 |
self updateAndSelect:nil. |
4367 | 5246 |
] |
9493
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5247 |
] |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5248 |
]. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5249 |
self notify:nil. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5250 |
] |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5251 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5252 |
"Modified: / 20-05-2010 / 11:15:35 / cg" |
4721
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5253 |
! |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5254 |
|
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5255 |
convertImageToXPM |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5256 |
self convertImageToSuffix:'xpm' |
4367 | 5257 |
! |
5258 |
||
9493
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5259 |
convertImageUsingExternalFileToolsFrom:fileName toSuffix:outSuffix onError:exceptionBlock |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5260 |
|inFile outFile chainOfConversions conversionStream tempFileTemplate |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5261 |
eachConversionSuffixCommandPair eachConversionCommand eachConversionSuffix| |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5262 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5263 |
chainOfConversions := self conversionChainFrom:(fileName suffix) to:outSuffix. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5264 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5265 |
chainOfConversions isNil ifTrue:[ |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5266 |
self warn:('Don''t know how to convert from %1 to %2' bindWith:fileName suffix with:outSuffix). |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5267 |
^ false |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5268 |
]. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5269 |
conversionStream := chainOfConversions readStream. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5270 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5271 |
tempFileTemplate := Filename newTemporary. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5272 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5273 |
inFile := fileName. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5274 |
eachConversionSuffixCommandPair := conversionStream next. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5275 |
eachConversionCommand := eachConversionSuffixCommandPair key. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5276 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5277 |
eachConversionCommand == #readToXPM ifTrue:[ |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5278 |
|image tempFileXPM| |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5279 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5280 |
image := Image fromFile:(inFile pathName). |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5281 |
image isNil ifTrue:[ |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5282 |
self warn:'Unknown format/not an image: ' , inFile baseName. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5283 |
^ false. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5284 |
]. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5285 |
tempFileXPM := tempFileTemplate withSuffix:'xpm'. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5286 |
image saveOn:tempFileXPM using:XPMReader. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5287 |
inFile := tempFileXPM. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5288 |
eachConversionSuffixCommandPair := conversionStream next. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5289 |
]. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5290 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5291 |
[ |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5292 |
|command errOutput errMsg| |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5293 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5294 |
[eachConversionSuffixCommandPair notNil] whileTrue:[ |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5295 |
eachConversionCommand := eachConversionSuffixCommandPair key. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5296 |
eachConversionSuffix := eachConversionSuffixCommandPair value. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5297 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5298 |
self notify:(resources string:'Converting: %1 to %2...' with:fileName baseName with:eachConversionSuffix). |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5299 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5300 |
outFile := tempFileTemplate withSuffix:eachConversionSuffix. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5301 |
command := eachConversionCommand |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5302 |
bindWith:(inFile pathName) |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5303 |
with:(outFile pathName). |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5304 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5305 |
errOutput := String writeStream. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5306 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5307 |
(OperatingSystem executeCommand:command errorTo:errOutput) ifFalse:[ |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5308 |
errMsg := resources |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5309 |
stringWithCRs:'Conversion of %1 to %2 using %3 failed:\\%4.' |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5310 |
with:inFile baseName allBold |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5311 |
with:eachConversionSuffix |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5312 |
with:eachConversionCommand allBold |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5313 |
with:errOutput contents. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5314 |
exceptionBlock value:errMsg. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5315 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5316 |
(inFile ~= fileName) ifTrue:[inFile delete]. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5317 |
outFile delete. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5318 |
^ false |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5319 |
]. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5320 |
(inFile ~= fileName) ifTrue:[inFile delete]. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5321 |
inFile := outFile. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5322 |
eachConversionSuffixCommandPair := conversionStream next |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5323 |
]. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5324 |
outFile moveTo:(fileName withSuffix:(chainOfConversions last value)). |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5325 |
] ifCurtailed:[ |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5326 |
(inFile ~= fileName) ifTrue:[inFile delete]. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5327 |
outFile delete. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5328 |
]. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5329 |
^ true. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5330 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5331 |
"Created: / 20-05-2010 / 11:05:50 / cg" |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5332 |
! |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5333 |
|
3892 | 5334 |
createProjectAndOpenProjectBrowser |
5335 |
|nm f s directory| |
|
5336 |
||
5337 |
self currentFilesAreInSameDirectory ifFalse:[^ self]. |
|
5960 | 5338 |
directory := self currentDirectory. |
3892 | 5339 |
nm := directory baseName. |
5340 |
f := (directory construct:nm) withSuffix:'prj'. |
|
5341 |
f exists ifTrue:[ |
|
4414 | 5342 |
Dialog warn:'A file named ' , f baseName , ' already exists.'. |
5343 |
^ self. |
|
3892 | 5344 |
]. |
5345 |
s := f writeStream. |
|
5346 |
s nextPutAll:' |
|
5347 |
name ''' , nm , ''' |
|
5348 |
type #classLibrary |
|
5349 |
package #''private:' , nm , ''' |
|
5350 |
prerequisites nil |
|
5351 |
||
5352 |
classes #( ) |
|
5353 |
'. |
|
5354 |
s close. |
|
5355 |
ProjectBrowser openOnFile:f. |
|
5356 |
! |
|
5357 |
||
5880 | 5358 |
doExecuteCommand |
5359 |
"execute an OperatingSystem-command" |
|
5360 |
||
5361 |
| action fileName| |
|
5362 |
||
5363 |
fileName := self firstSelectedFile. |
|
5364 |
action := [:command | |
|
5365 |
self addToCommandHistory:command for:fileName. |
|
5366 |
self executeCommand:command. |
|
5367 |
]. |
|
5368 |
self askForCommandFor:fileName thenDo:action |
|
5369 |
! |
|
5370 |
||
5371 |
doExecuteScript |
|
5372 |
"execute a smalltalk script" |
|
5373 |
||
5374 |
|textHolder dialog template dummyClass dummyInstance| |
|
5375 |
||
5376 |
template := |
|
5377 |
'"/ Smalltalk script: |
|
5378 |
||
5379 |
"/ the following variables are accessable: |
|
5380 |
"/ directory (= ' , (self theSingleSelectedDirectoryOrNil ? Filename homeDirectory) pathName , ') |
|
5381 |
"/ selectedFiles (= ...) |
|
5382 |
"/ |
|
5383 |
"/ Beginner warning: Smalltalk know-how is useful here ;-). |
|
5384 |
"/ |
|
5385 |
"/ Useful operations are: |
|
5386 |
"/ directory directoryContentsDo:[:eachBaseNameString | ...] |
|
5387 |
"/ directory directoryContentsAsFilenamesDo:[:eachFilename | ...] |
|
5388 |
"/ directory directory |
|
5389 |
"/ |
|
5390 |
"/ example: move all files which match a aarticular pattern to |
|
5391 |
"/ a separate directory: |
|
5392 |
"/ |
|
5393 |
"/ |directory idx prefix rest newDir oldFile newFile| |
|
5394 |
"/ |
|
5395 |
"/ directory := ''/mnt/var/priv/image/tv/frank/frank2/2131_008.jpg'' asFilename. |
|
5396 |
"/ |
|
5397 |
"/ directory directoryContentsDo:[:eachBaseNameString | |
|
5398 |
"/ (eachBaseNameString includes:$_) ifTrue:[ |
|
5399 |
"/ idx := eachBaseNameString indexOf:$_. |
|
5400 |
"/ prefix := eachBaseNameString copyTo:(idx - 1). |
|
5401 |
"/ rest := eachBaseNameString copyFrom:(idx + 1). |
|
5402 |
"/ newDir := directory construct:prefix. |
|
5403 |
"/ newDir exists ifFalse:[ |
|
5404 |
"/ (Dialog confirm:''Create '' , newDir pathName) ifTrue:[ |
|
5405 |
"/ newDir makeDirectory. |
|
5406 |
"/ ]. |
|
5407 |
"/ ]. |
|
5408 |
"/ newDir exists ifTrue:[ |
|
5409 |
"/ oldFile := directory construct:eachBaseNameString. |
|
5410 |
"/ newFile := newDir construct:rest. |
|
5411 |
"/ oldFile moveTo:newFile |
|
5412 |
"/ ] |
|
5413 |
"/ ] |
|
5414 |
"/ ] |
|
5415 |
'. |
|
5416 |
||
5417 |
LastScriptBlockString isNil ifTrue:[ |
|
5418 |
LastScriptBlockString := template. |
|
5419 |
]. |
|
5420 |
||
5421 |
textHolder := ValueHolder new. |
|
5422 |
dialog := Dialog |
|
5423 |
forRequestText:(resources string:'Enter script') |
|
5424 |
editViewClass:CodeView |
|
5425 |
lines:25 |
|
5426 |
columns:70 |
|
5427 |
initialAnswer:LastScriptBlockString |
|
5428 |
model:textHolder. |
|
5429 |
dialog addButton:(Button label:'Template' action:[textHolder value:template. textHolder changed:#value.]). |
|
5430 |
dialog open. |
|
5431 |
dialog accepted ifFalse:[^ self]. |
|
5432 |
||
5433 |
LastScriptBlockString := textHolder value. |
|
5434 |
||
5435 |
Class classConventionViolationConfirmationQuerySignal |
|
5436 |
answer:true |
|
5437 |
do:[ |
|
5438 |
dummyClass := Object class |
|
5439 |
name:#Dummy |
|
5440 |
inEnvironment:nil |
|
5441 |
subclassOf:Object |
|
5442 |
instanceVariableNames:'directory selectedFiles' |
|
5443 |
variable:false |
|
5444 |
words:true |
|
5445 |
pointers:true |
|
5446 |
classVariableNames:'' |
|
5447 |
poolDictionaries:'' |
|
5448 |
category:#dummyCategory |
|
5449 |
comment:nil |
|
5450 |
changed:true. |
|
5451 |
]. |
|
5452 |
||
5453 |
dummyInstance := dummyClass basicNew. |
|
5454 |
dummyInstance instVarAt:1 put:(self theSingleSelectedDirectoryOrNil ? Filename homeDirectory). |
|
5455 |
dummyInstance instVarAt:2 put:(self currentSelectedFiles value). |
|
5456 |
||
5457 |
Compiler |
|
5458 |
evaluate:textHolder value |
|
5459 |
in:nil |
|
5460 |
receiver:dummyInstance |
|
5461 |
notifying:nil |
|
5462 |
logged:false |
|
5463 |
ifFail:[] |
|
5464 |
compile:true. |
|
5465 |
||
5466 |
"/ fileName := self firstSelectedFile. |
|
5467 |
"/ action := [:command | |
|
5468 |
"/ self addToCommandHistory:command for:fileName. |
|
5469 |
"/ self executeCommand:command. |
|
5470 |
"/ ]. |
|
5471 |
"/ self askForCommandFor:fileName thenDo:action |
|
5472 |
! |
|
5473 |
||
4230 | 5474 |
doMake |
7938 | 5475 |
|dir cmd| |
4230 | 5476 |
|
5477 |
cmd := 'make'. |
|
7938 | 5478 |
dir := self theSingleSelectedDirectoryOrNil. |
5479 |
||
5480 |
OperatingSystem isMSWINDOWSlike ifTrue:[ |
|
5481 |
dir notNil ifTrue:[ |
|
5482 |
(dir construct:'bmake.bat') exists ifTrue:[ |
|
5483 |
cmd := 'bmake.bat'. |
|
5484 |
] |
|
5485 |
] |
|
5486 |
]. |
|
4230 | 5487 |
self executeCommand:cmd. |
5488 |
! |
|
5489 |
||
8256 | 5490 |
doOpenCBrowser |
5491 |
|destDir| |
|
5492 |
||
5493 |
destDir := self currentDirectory. |
|
5494 |
CBrowser::Browser openIn:destDir pathName |
|
5495 |
! |
|
5496 |
||
7829 | 5497 |
doOpenExplorer |
8882 | 5498 |
OperatingSystem isMSWINDOWSlike ifFalse:[ |
5499 |
self warn:'sorry - this operation is only available under windows'. |
|
5500 |
]. |
|
7829 | 5501 |
|
5502 |
OperatingSystem |
|
9343
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
5503 |
openApplicationForDocument:(self currentDirectory) |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
5504 |
operation:#explore. |
7829 | 5505 |
|
5506 |
"Modified: / 23-07-2007 / 23:01:22 / cg" |
|
5507 |
! |
|
5508 |
||
4317
bf3f150809c2
settings is a new application now and will be inserted under tools in
penk
parents:
4294
diff
changeset
|
5509 |
doOpenSettings |
8168 | 5510 |
self openSettingsDialog |
4317
bf3f150809c2
settings is a new application now and will be inserted under tools in
penk
parents:
4294
diff
changeset
|
5511 |
! |
bf3f150809c2
settings is a new application now and will be inserted under tools in
penk
parents:
4294
diff
changeset
|
5512 |
|
9343
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
5513 |
doOpenWithShellCommand |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
5514 |
"open using win32-shell" |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
5515 |
|
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
5516 |
|fileName| |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
5517 |
|
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
5518 |
fileName := self firstSelectedFile. |
9405
5b598565288a
changed: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9393
diff
changeset
|
5519 |
fileName notNil ifTrue:[ |
5b598565288a
changed: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9393
diff
changeset
|
5520 |
Win32OperatingSystem |
5b598565288a
changed: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9393
diff
changeset
|
5521 |
openApplicationForDocument:fileName pathName |
5b598565288a
changed: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9393
diff
changeset
|
5522 |
operation:#open |
5b598565288a
changed: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9393
diff
changeset
|
5523 |
] |
9343
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
5524 |
! |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
5525 |
|
7104 | 5526 |
editMode:aSymbol |
5527 |
self |
|
5528 |
applicationNamed:#FileApplicationNoteBook |
|
5529 |
ifPresentDo:[:appl | |
|
5530 |
|subApp| |
|
5531 |
||
5532 |
subApp := appl selectedApplication. |
|
5533 |
subApp notNil ifTrue:[ |
|
5534 |
^ subApp perform:aSymbol |
|
5535 |
] |
|
5536 |
]. |
|
5537 |
||
5538 |
"Created: / 11-09-2006 / 12:42:08 / cg" |
|
5539 |
! |
|
5540 |
||
5541 |
editModeInsert |
|
5542 |
self editMode:#editModeInsert |
|
5543 |
||
5544 |
"Created: / 11-09-2006 / 12:40:36 / cg" |
|
5545 |
! |
|
5546 |
||
5547 |
editModeInsertAndSelect |
|
5548 |
self editMode:#editModeInsertAndSelect |
|
5549 |
||
5550 |
"Created: / 11-09-2006 / 12:40:45 / cg" |
|
5551 |
! |
|
5552 |
||
5553 |
editModeOverwrite |
|
5554 |
self editMode:#editModeOverwrite |
|
5555 |
||
5556 |
"Modified: / 11-09-2006 / 12:42:26 / cg" |
|
5557 |
! |
|
5558 |
||
8454
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
5559 |
fileContentsAsByteArray |
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
5560 |
|file| |
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
5561 |
|
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
5562 |
file := self firstSelectedFile. |
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
5563 |
file isNil ifTrue:[^ self ]. |
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
5564 |
file asFilename fileSize > (1024*1024) ifTrue:[ |
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
5565 |
file asFilename fileSize > (128*1024*1024) ifTrue:[ |
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
5566 |
Dialog warn:'File is too big'. |
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
5567 |
^ self. |
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
5568 |
]. |
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
5569 |
(Dialog confirm:'File is big - proceed ?') ifFalse:[^ self]. |
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
5570 |
]. |
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
5571 |
file asFilename binaryContentsOfEntireFile inspect |
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
5572 |
! |
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
5573 |
|
3892 | 5574 |
fileFileIn |
5575 |
"fileIn the selected file(s)" |
|
5576 |
||
5577 |
self fileFileInLazy:false |
|
5578 |
! |
|
5579 |
||
7324 | 5580 |
fileFileIn:aFilename lazy:lazy |
5581 |
"fileIn a file" |
|
5582 |
||
5583 |
self withActivityIndicationDo:[ |
|
5584 |
self notify:('File in:', aFilename asFilename baseName). |
|
5585 |
self singleFileFileIn:aFilename lazy:lazy. |
|
5586 |
self notify:nil. |
|
5587 |
] |
|
5588 |
||
5589 |
"Created: / 20-09-2006 / 14:28:35 / cg" |
|
5590 |
! |
|
5591 |
||
3892 | 5592 |
fileFileInLazy |
5593 |
"fileIn the selected file(s). Do a quick load (no compilation)" |
|
5594 |
||
5595 |
self fileFileInLazy:true |
|
5596 |
! |
|
5597 |
||
5598 |
fileFileInLazy:lazy |
|
5599 |
"fileIn the selected file(s)" |
|
5600 |
||
7324 | 5601 |
self currentSelectedFiles do:[:fileName | |
5602 |
self fileIn:fileName lazy:lazy |
|
5603 |
]. |
|
5604 |
||
5605 |
"Modified: / 20-09-2006 / 14:29:24 / cg" |
|
3892 | 5606 |
! |
5607 |
||
5608 |
fileFileInToNameSpace |
|
5609 |
"fileIn the selected file(s)<into a nameSpace" |
|
5610 |
||
5611 |
|ns listOfKnownNameSpaces| |
|
5612 |
||
5613 |
listOfKnownNameSpaces := Set new. |
|
5614 |
NameSpace |
|
6672
478b83a3753a
max size to be shown without dialog
Claus Gittinger <cg@exept.de>
parents:
6671
diff
changeset
|
5615 |
allNameSpaces |
4414 | 5616 |
do:[:eachNameSpace | |
5617 |
listOfKnownNameSpaces add:eachNameSpace name |
|
5618 |
]. |
|
3892 | 5619 |
listOfKnownNameSpaces := listOfKnownNameSpaces asOrderedCollection sort. |
5620 |
||
5621 |
ns := Dialog |
|
4414 | 5622 |
request:'During fileIn, new classes are created in nameSpace:' |
5623 |
initialAnswer:(LastEnforcedNameSpace ? Class nameSpaceQuerySignal query name) |
|
5624 |
list:listOfKnownNameSpaces. |
|
3892 | 5625 |
ns isEmptyOrNil ifTrue:[^ self]. |
5626 |
||
5627 |
LastEnforcedNameSpace := ns. |
|
5628 |
ns := NameSpace name:ns. |
|
5629 |
||
5630 |
Class nameSpaceQuerySignal |
|
4414 | 5631 |
answer:ns |
5632 |
do:[ |
|
5633 |
self fileFileInLazy:false |
|
5634 |
] |
|
3892 | 5635 |
! |
5636 |
||
5637 |
fileFindAllDuplicates |
|
5638 |
"scan directory and all subdirs for duplicate files" |
|
5639 |
||
5640 |
|fileNames dir infoDir filesBySize |
|
5641 |
result info dirPrefix myName stream textBox maxLength directories| |
|
5642 |
||
5643 |
||
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
5644 |
self withActivityIndicationDo:[ |
4414 | 5645 |
result := Dictionary new. |
5646 |
myName := self class name asString. |
|
5647 |
directories := self currentSelectedDirectories. |
|
5648 |
directories isEmpty ifTrue:[^ self]. |
|
3892 | 5649 |
|
4414 | 5650 |
dir := directories first. |
3892 | 5651 |
"/ self label: myName, '- gathering file names ...'. |
4636
08b2b63e3107
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4629
diff
changeset
|
5652 |
[ |
08b2b63e3107
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4629
diff
changeset
|
5653 |
fileNames := dir recursiveDirectoryContents. |
08b2b63e3107
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4629
diff
changeset
|
5654 |
] on:FileStream openErrorSignal do:[:ex| |
6352 | 5655 |
self warn:(resources stringWithCRs:'Cannot access: %1\(%2)' |
5656 |
with:ex pathName |
|
5657 |
with:ex description). |
|
4636
08b2b63e3107
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4629
diff
changeset
|
5658 |
^ self |
08b2b63e3107
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4629
diff
changeset
|
5659 |
]. |
4765 | 5660 |
fileNames := fileNames |
5661 |
collect:[:fn | dir construct:fn] |
|
5662 |
thenSelect:[:fn | fn isDirectory not]. |
|
3892 | 5663 |
|
5664 |
"/ self label:myName , '- gathering sizes ...'. |
|
4414 | 5665 |
infoDir := Dictionary new. |
5666 |
fileNames do:[:fn | |
|
5667 |
infoDir at:fn put:(fn fileSize) |
|
5668 |
]. |
|
5669 |
||
5670 |
"/ for each, get the files size. |
|
5671 |
"/ in a first pass, look for files of the same size and |
|
5672 |
"/ compare them ... |
|
3892 | 5673 |
|
5674 |
"/ self label:myName , '- preselect possible duplicates ...'. |
|
4414 | 5675 |
filesBySize := Dictionary new. |
5676 |
infoDir keysAndValuesDo:[:fn :sz | |
|
5677 |
|entry| |
|
5678 |
||
5679 |
entry := filesBySize at:sz ifAbsentPut:[Set new]. |
|
5680 |
entry add:fn. |
|
5681 |
]. |
|
5682 |
||
5683 |
"/ any of same size ? |
|
3892 | 5684 |
|
5685 |
"/ self label:myName , '- checking for duplicates ...'. |
|
4414 | 5686 |
filesBySize do:[:entry | |
5687 |
|files| |
|
5688 |
||
5689 |
entry size > 1 ifTrue:[ |
|
5690 |
files := entry asArray. |
|
5691 |
1 to:files size-1 do:[:idx1 | |
|
5692 |
idx1+1 to:files size do:[:idx2 | |
|
5693 |
|fn1 fn2| |
|
5694 |
||
5695 |
fn1 := files at:idx1. |
|
5696 |
fn2 := files at:idx2. |
|
3892 | 5697 |
|
5698 |
"/ self label:myName , '- checking ' , fn1 baseName , ' vs. ' , fn2 baseName , ' ...'. |
|
4414 | 5699 |
(result at:fn2 ifAbsent:nil) ~= fn1 ifTrue:[ |
5700 |
"/ compare the files |
|
5701 |
(fn1 sameContentsAs:fn2) ifTrue:[ |
|
3892 | 5702 |
"/ Transcript show:'Same: '; show:fn1 baseName; show:' and '; showCR:fn2 baseName. |
4414 | 5703 |
result at:fn1 put:fn2. |
5704 |
] |
|
5705 |
] |
|
5706 |
] |
|
5707 |
] |
|
5708 |
] |
|
5709 |
]. |
|
3892 | 5710 |
|
5711 |
"/ self label:myName , '- sorting ...'. |
|
4414 | 5712 |
dirPrefix := dir pathName. |
5713 |
result := result associations. |
|
5714 |
result := result collect:[:assoc | |
|
5715 |
|f1 f2| |
|
5716 |
||
5717 |
f1 := assoc key name. |
|
5718 |
f2 := assoc value name. |
|
5719 |
(f1 startsWith:dirPrefix) ifTrue:[ |
|
5720 |
f1 := f1 copyFrom:dirPrefix size + 2. |
|
5721 |
]. |
|
5722 |
(f2 startsWith:dirPrefix) ifTrue:[ |
|
5723 |
f2 := f2 copyFrom:dirPrefix size + 2. |
|
5724 |
]. |
|
5725 |
f1 < f2 ifTrue:[ |
|
5726 |
f2 -> f1 |
|
5727 |
] ifFalse:[ |
|
5728 |
f1 -> f2 |
|
5729 |
] |
|
5730 |
]. |
|
5731 |
result sort:[:f1 :f2 | f2 value < f1 value]. |
|
5732 |
||
5733 |
info := OrderedCollection new. |
|
5734 |
result do:[:assoc | |
|
5735 |
info add:(assoc key , ' same as ' , assoc value) |
|
5736 |
]. |
|
5737 |
info isEmpty ifTrue:[ |
|
5543 | 5738 |
Dialog information:'No duplicate files found.'. |
5739 |
^ self. |
|
4414 | 5740 |
]. |
3892 | 5741 |
]. |
5742 |
||
5743 |
stream := WriteStream on:''. |
|
5744 |
info do:[:el| |
|
4535 | 5745 |
stream nextPutLine:el. |
3892 | 5746 |
]. |
5542 | 5747 |
|
3892 | 5748 |
textBox := TextBox new. |
5749 |
textBox initialText:(stream contents). |
|
5542 | 5750 |
stream close. |
4636
08b2b63e3107
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4629
diff
changeset
|
5751 |
textBox title:'File duplicates in directory: ', dir asString. |
3892 | 5752 |
textBox readOnly:true. |
5753 |
textBox noCancel. |
|
4636
08b2b63e3107
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4629
diff
changeset
|
5754 |
textBox label:'Duplicates in ', dir asString. |
3892 | 5755 |
maxLength := 10. |
5756 |
info do:[: el | |
|
4414 | 5757 |
maxLength := maxLength max:(el size). |
3892 | 5758 |
]. |
5759 |
textBox extent:((maxLength * 5)@(info size * 20)); sizeFixed:false. |
|
5542 | 5760 |
textBox maxExtent:Screen current extent. |
5761 |
textBox openModeless. |
|
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
5762 |
|
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
5763 |
"Modified: / 25-07-2006 / 09:07:22 / cg" |
3892 | 5764 |
! |
5765 |
||
5766 |
fileFindDuplicates |
|
5767 |
"scan directory for duplicate files" |
|
5768 |
||
8510 | 5769 |
|infoDir filesBySize result info stream textBox maxLength directories allFiles titleStream size| |
5770 |
||
5771 |
directories := self currentSelectedDirectories. |
|
3892 | 5772 |
|
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
5773 |
self withActivityIndicationDo:[ |
4355 | 5774 |
result := Dictionary new. |
5775 |
||
5776 |
directories := self currentSelectedDirectories. |
|
5777 |
directories isEmpty ifTrue:[^ self]. |
|
5778 |
||
8510 | 5779 |
allFiles := self allFilesInSelectedDirectoriesForWhich:[:f | true]. |
4355 | 5780 |
|
5781 |
infoDir := Dictionary new. |
|
5782 |
allFiles do:[:fn | |
|
5783 |
infoDir at:fn put:(fn info) |
|
5784 |
]. |
|
5785 |
||
5786 |
"/ for each, get the files size. |
|
5787 |
"/ in a first pass, look for files of the same size and |
|
5788 |
"/ compare them ... |
|
5789 |
||
5790 |
filesBySize := Dictionary new. |
|
5791 |
infoDir keysAndValuesDo:[:fn :info | |
|
5792 |
|sz entry| |
|
5793 |
||
5794 |
sz := info size. |
|
5795 |
entry := filesBySize at:sz ifAbsentPut:[Set new]. |
|
5796 |
entry add:fn. |
|
5797 |
]. |
|
5798 |
||
5799 |
"/ any of same size ? |
|
5800 |
||
5801 |
filesBySize do:[:entry | |
|
5802 |
|files| |
|
5803 |
||
5804 |
entry size > 1 ifTrue:[ |
|
5805 |
files := entry asArray. |
|
5806 |
1 to:files size-1 do:[:idx1 | |
|
5807 |
idx1+1 to:files size do:[:idx2 | |
|
5808 |
|fn1 fn2| |
|
5809 |
||
5810 |
fn1 := files at:idx1. |
|
5811 |
fn2 := files at:idx2. |
|
5812 |
||
5813 |
(result at:fn2 ifAbsent:nil) ~= fn1 ifTrue:[ |
|
5814 |
"/ compare the files |
|
5815 |
(fn1 sameContentsAs:fn2) ifTrue:[ |
|
3892 | 5816 |
"/ Transcript show:'Same: '; show:fn1 baseName; show:' and '; showCR:fn2 baseName. |
4355 | 5817 |
result at:fn1 put:fn2. |
5818 |
] |
|
5819 |
] |
|
5820 |
] |
|
5821 |
] |
|
5822 |
] |
|
5823 |
]. |
|
5824 |
||
5825 |
result := result associations. |
|
5826 |
result := result collect:[:assoc | |
|
5827 |
|f1 f2| |
|
5828 |
||
5829 |
f1 := assoc key asString. |
|
5830 |
f2 := assoc value asString. |
|
5831 |
f1 < f2 ifTrue:[ |
|
5832 |
f2 -> f1 |
|
5833 |
] ifFalse:[ |
|
5834 |
f1 -> f2 |
|
5835 |
] |
|
5836 |
]. |
|
5789 | 5837 |
"/ result sort:[:f1 :f2 | f1 key > f2 key "f2 value < f1 key value"]. |
5838 |
result sort:[:f1 :f2 | " f1 key > f2 key" f2 value < f1 key value]. |
|
4355 | 5839 |
|
5840 |
info := OrderedCollection new. |
|
5841 |
size := self getBestDirectory asString size. |
|
5842 |
result do:[:assoc | |
|
5843 |
|fn1 fn2| |
|
5844 |
||
5845 |
fn1 := assoc key. |
|
5846 |
fn2 := assoc value. |
|
5847 |
size > 1 ifTrue:[ |
|
5848 |
fn1 := ('..', (fn1 copyFrom:(size + 1))). |
|
5849 |
fn2 := ('..', (fn2 copyFrom:(size + 1))). |
|
5850 |
]. |
|
5851 |
(fn1 includes:Character space) ifTrue:[ |
|
5852 |
fn1 := '"' , fn1 , '"' |
|
5853 |
]. |
|
5854 |
(fn2 includes:Character space) ifTrue:[ |
|
5855 |
fn2 := '"' , fn2 , '"' |
|
5856 |
]. |
|
5857 |
info add:(fn1 , ' same as ' , fn2) |
|
5858 |
]. |
|
5859 |
info isEmpty ifTrue:[ |
|
5543 | 5860 |
Dialog information:'No duplicate files found.'. |
5861 |
^ self. |
|
4355 | 5862 |
]. |
3892 | 5863 |
]. |
5864 |
stream := WriteStream on:''. |
|
5865 |
info do:[:el| |
|
4535 | 5866 |
stream nextPutLine:el. |
3892 | 5867 |
]. |
5868 |
titleStream := WriteStream on:''. |
|
4636
08b2b63e3107
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4629
diff
changeset
|
5869 |
titleStream nextPutAll:'File duplicates in director'. |
3892 | 5870 |
directories size == 1 ifTrue:[ |
4355 | 5871 |
titleStream nextPutAll:'y: ', directories first asString. |
3892 | 5872 |
] ifFalse:[ |
4535 | 5873 |
titleStream nextPutLine:'ies: '. |
4355 | 5874 |
directories do:[:dir| |
5875 |
size > 1 ifTrue:[ |
|
5876 |
titleStream nextPutAll:'..'. |
|
4535 | 5877 |
titleStream nextPutLine:((dir asString) copyFrom:(size + 1)). |
4355 | 5878 |
] ifFalse:[ |
4535 | 5879 |
titleStream nextPutLine:(dir asString). |
4355 | 5880 |
]. |
5881 |
] |
|
3892 | 5882 |
]. |
5543 | 5883 |
|
3892 | 5884 |
textBox := TextBox new. |
5885 |
textBox initialText:(stream contents). |
|
5886 |
textBox title:(titleStream contents). |
|
5887 |
textBox readOnly:true. |
|
5888 |
textBox noCancel. |
|
4636
08b2b63e3107
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4629
diff
changeset
|
5889 |
stream := WriteStream on:'Duplicates in '. |
4170 | 5890 |
directories do:[ :aDirectory | |
4355 | 5891 |
stream nextPutAll:aDirectory baseName. |
5892 |
stream space. |
|
4050 | 5893 |
]. |
4170 | 5894 |
textBox label:stream contents. |
3892 | 5895 |
maxLength := 10. |
5896 |
info do:[: el | |
|
4355 | 5897 |
maxLength := maxLength max:(el size). |
3892 | 5898 |
]. |
5092 | 5899 |
textBox extent:((maxLength * 5)@((info size max:40)* 10)). |
5900 |
textBox maxExtent:Screen current extent. |
|
4355 | 5901 |
textBox openModeless. "/ showAtPointer. |
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
5902 |
|
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
5903 |
"Modified: / 25-07-2006 / 09:07:25 / cg" |
3892 | 5904 |
! |
5905 |
||
5906 |
fileFindFile |
|
5961 | 5907 |
|filename| |
5908 |
||
5909 |
filename := self firstSelectedFileName. |
|
5910 |
filename isNil ifTrue:[ |
|
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
5911 |
filename := Filename homeDirectory. |
3892 | 5912 |
]. |
4101 | 5913 |
FindFileApplication openOnFileName:filename for:self. |
3892 | 5914 |
! |
5915 |
||
8510 | 5916 |
fileFindSimilarImages |
5917 |
"scan directory for similar image files" |
|
5918 |
||
8512 | 5919 |
|result stream textBox directories imageFiles histogramsV histogramsH |
5920 |
similarV similarH similar alreadyPrinted| |
|
8510 | 5921 |
|
8524
cac6b19eae23
changed #fileFindSimilarImages
Claus Gittinger <cg@exept.de>
parents:
8512
diff
changeset
|
5922 |
self withWaitCursorDo:[ |
8510 | 5923 |
self withActivityIndicationDo:[ |
5924 |
result := Dictionary new. |
|
5925 |
||
5926 |
directories := self currentSelectedDirectories. |
|
5927 |
directories isEmpty ifTrue:[^ self]. |
|
5928 |
||
5929 |
imageFiles := self allFilesInSelectedDirectoriesForWhich:[:f | f mimeTypeFromName isImage]. |
|
8511 | 5930 |
"/ imageFiles := imageFiles select:[:f | f baseName startsWith:'foo']. |
5931 |
imageFiles sort:[:a :b | a pathName < b pathName]. |
|
5932 |
||
8510 | 5933 |
"/ for each, get the color histogram |
5934 |
histogramsV := Dictionary new. |
|
5935 |
histogramsH := Dictionary new. |
|
5936 |
imageFiles do:[:fn | |
|
5937 |
|hist image| |
|
5938 |
||
5939 |
image := Image fromFile:fn. |
|
5940 |
Transcript showCR:'generating histogram for ',fn baseName. |
|
5941 |
hist := ImageColorHistogram new forImage:image. |
|
5942 |
histogramsV at:fn put:(hist histogramVectorV). |
|
5943 |
histogramsH at:fn put:(hist histogramVectorH). |
|
5944 |
]. |
|
5945 |
||
5946 |
similarH := Dictionary new. |
|
5947 |
similarV := Dictionary new. |
|
5948 |
similar := Dictionary new. |
|
5949 |
||
8512 | 5950 |
(self firstSelectedFile notNil |
5951 |
ifTrue:[ Array with:self firstSelectedFile ] |
|
5952 |
ifFalse:[ imageFiles ]) |
|
5953 |
do:[:eachFile1 | |
|
8510 | 5954 |
|setOfSimilar distancesV distancesH| |
5955 |
||
5956 |
distancesV := OrderedCollection new. |
|
5957 |
distancesH := OrderedCollection new. |
|
5958 |
setOfSimilar := OrderedCollection new. |
|
5959 |
||
5960 |
imageFiles do:[:eachFile2 | |
|
5961 |
|v1 v2 dV dH| |
|
5962 |
||
5963 |
eachFile1 ~= eachFile2 ifTrue:[ |
|
5964 |
v1 := histogramsV at:eachFile1. |
|
5965 |
v2 := histogramsV at:eachFile2. |
|
5966 |
dV := ImageColorHistogram distanceFrom:v1 to:v2. |
|
5967 |
distancesV add:(eachFile2 -> dV). |
|
5968 |
v1 := histogramsH at:eachFile1. |
|
5969 |
v2 := histogramsH at:eachFile2. |
|
5970 |
dH := ImageColorHistogram distanceFrom:v1 to:v2. |
|
5971 |
distancesH add:(eachFile2 -> dH). |
|
5972 |
(dV < 10000 and:[dH < 10000]) ifTrue:[ |
|
8512 | 5973 |
setOfSimilar add:eachFile2->(dV + dH). |
8510 | 5974 |
]. |
5975 |
] |
|
5976 |
]. |
|
5977 |
distancesV sort:[:a1 :a2 | a1 value < a2 value]. |
|
5978 |
distancesH sort:[:a1 :a2 | a1 value < a2 value]. |
|
5979 |
similarV at:eachFile1 put:distancesV. |
|
5980 |
similarH at:eachFile1 put:distancesH. |
|
5981 |
setOfSimilar notEmpty ifTrue:[ similar at:eachFile1 put:setOfSimilar ]. |
|
5982 |
]. |
|
5983 |
||
5984 |
similar isEmpty ifTrue:[ |
|
5985 |
Dialog information:'No similarities found.'. |
|
5986 |
^ self. |
|
5987 |
]. |
|
5988 |
]. |
|
5989 |
||
5990 |
stream := WriteStream on:''. |
|
8512 | 5991 |
alreadyPrinted := Set new. |
5992 |
||
5993 |
imageFiles do:[:eachFile | |
|
5994 |
|eachSet| |
|
5995 |
||
5996 |
(alreadyPrinted includes:eachFile) ifFalse:[ |
|
5997 |
eachSet := similar at:eachFile ifAbsent:nil. |
|
5998 |
eachSet notNil ifTrue:[ |
|
5999 |
stream nextPutLine:eachFile pathName. |
|
6000 |
eachSet do:[:info | |
|
6001 |
|fn2 dist| |
|
6002 |
||
6003 |
fn2 := info key. |
|
6004 |
dist := info value. |
|
6005 |
stream nextPutAll:' '. |
|
6006 |
stream nextPutAll:fn2 pathName. |
|
6007 |
stream nextPutLine:' (',dist printString,')'. |
|
6008 |
alreadyPrinted add:fn2. |
|
6009 |
]. |
|
6010 |
stream cr. |
|
6011 |
]. |
|
8510 | 6012 |
]. |
6013 |
]. |
|
8524
cac6b19eae23
changed #fileFindSimilarImages
Claus Gittinger <cg@exept.de>
parents:
8512
diff
changeset
|
6014 |
]. |
8510 | 6015 |
|
6016 |
textBox := TextBox new. |
|
6017 |
textBox initialText:(stream contents). |
|
6018 |
textBox title:'File similarities:'. |
|
6019 |
textBox readOnly:true. |
|
6020 |
textBox noCancel. |
|
6021 |
||
6022 |
textBox label:'File similarities'. |
|
6023 |
textBox extent:(400@((similar size max:40)* 10)). |
|
6024 |
textBox maxExtent:Screen current extent. |
|
6025 |
textBox openModeless. "/ showAtPointer. |
|
6026 |
||
6027 |
"Modified: / 25-07-2006 / 09:07:25 / cg" |
|
6028 |
! |
|
6029 |
||
4618 | 6030 |
fileHexDump |
6031 |
||
6032 |
| file item| |
|
6033 |
||
6034 |
file := self firstSelectedFile. |
|
6035 |
file notNil ifTrue:[ |
|
6036 |
item := DirectoryContentsBrowser itemClass fileName:file. |
|
5009 | 6037 |
self |
6038 |
applicationNamed:#FileApplicationNoteBook |
|
6039 |
ifPresentDo:[:appl | appl openTextEditorWithHexPresentationOn:item]. |
|
4618 | 6040 |
]. |
6041 |
! |
|
6042 |
||
7324 | 6043 |
fileIn:aFilename |
6044 |
"fileIn a file" |
|
6045 |
||
6046 |
self fileIn:aFilename lazy:false |
|
6047 |
||
6048 |
"Created: / 20-09-2006 / 14:30:06 / cg" |
|
6049 |
! |
|
6050 |
||
6051 |
fileIn:aFilename lazy:lazy |
|
6052 |
"fileIn a file" |
|
6053 |
||
6054 |
self withActivityIndicationDo:[ |
|
6055 |
self notify:('File in:', aFilename asFilename baseName). |
|
6056 |
self singleFileFileIn:aFilename lazy:lazy. |
|
6057 |
self notify:nil. |
|
6058 |
] |
|
6059 |
||
6060 |
"Created: / 20-09-2006 / 14:29:21 / cg" |
|
6061 |
! |
|
6062 |
||
4930 | 6063 |
filterSelectedFiles:whichFilter |
6064 |
|selectedFiles numFiles msg filterBlock| |
|
6065 |
||
7560 | 6066 |
selectedFiles := self currentSelectedObjects. |
4930 | 6067 |
(numFiles := selectedFiles size) == 0 ifTrue:[^ self]. |
6068 |
||
6069 |
msg := 'Replace contents of file ''%2'' with output of %3-filter ?'. |
|
6070 |
numFiles > 1 ifTrue:[ |
|
6071 |
msg := 'Replace contents of %1 files with output of %3-filter ?'. |
|
6072 |
]. |
|
6073 |
||
6074 |
(Dialog |
|
6352 | 6075 |
confirm:(resources stringWithCRs:msg with:numFiles with:selectedFiles first baseName allBold with:whichFilter) |
4930 | 6076 |
initialAnswer:false |
6077 |
) ifFalse:[ |
|
6078 |
^ self |
|
6079 |
]. |
|
6080 |
||
6081 |
whichFilter == #rot13 ifTrue:[ |
|
6082 |
filterBlock := [:charIn | charIn rot13 ]. |
|
6083 |
]. |
|
6084 |
"/ add more here... |
|
6085 |
||
6086 |
filterBlock isNil ifTrue:[ |
|
6087 |
self information:'No such filter: ' , whichFilter. |
|
6088 |
^ self. |
|
6089 |
]. |
|
6090 |
||
6091 |
selectedFiles do:[:fileName | |
|
6092 |
|s| |
|
6093 |
||
6094 |
self notify:('Processing:', fileName baseName). |
|
6095 |
fileName isDirectory ifFalse:[ |
|
6096 |
[ |
|
6097 |
|inFile outFile in out| |
|
6098 |
||
6099 |
inFile := fileName asFilename. |
|
6100 |
outFile := (fileName pathName , '.filter') asFilename. |
|
6101 |
||
6102 |
[ |
|
6103 |
|charIn charOut| |
|
6104 |
||
6105 |
in := inFile readStream. |
|
6106 |
out := outFile writeStream. |
|
6107 |
[in atEnd] whileFalse:[ |
|
6108 |
charIn := in next. |
|
6109 |
charOut := filterBlock value:charIn. |
|
6110 |
out nextPut:charOut. |
|
6111 |
]. |
|
6112 |
outFile renameTo:inFile. |
|
6113 |
] ensure:[ |
|
6114 |
out notNil ifTrue:[ out close ]. |
|
6115 |
in notNil ifTrue:[ in close ]. |
|
6116 |
outFile delete. |
|
6117 |
] |
|
6118 |
] on:FileStream openErrorSignal do:[:ex| |
|
6119 |
self warn:('Cannot process "%1".' bindWith:fileName baseName allBold). |
|
6120 |
]. |
|
6121 |
] |
|
6122 |
]. |
|
6190 | 6123 |
self notify:nil. |
7560 | 6124 |
|
6125 |
"Modified: / 04-12-2006 / 13:14:48 / cg" |
|
4930 | 6126 |
! |
6127 |
||
8832 | 6128 |
forEachSelectedFileIgnoringDirectories:ignoreDirs do:aBlock |
6129 |
|numItems path files| |
|
6130 |
||
6131 |
files := self currentSelectedFiles. |
|
6132 |
||
6133 |
(numItems := files size) > 2 ifTrue:[ |
|
6134 |
(self |
|
6135 |
confirm:(resources string:'Open for each of the %1 items ?' |
|
6136 |
with:numItems)) ifFalse:[^ self]. |
|
6137 |
]. |
|
6138 |
||
6139 |
self withActivityIndicationDo:[ |
|
6140 |
files do:[:fileName | |
|
6141 |
(ignoreDirs not or:[fileName isDirectory not]) ifTrue:[ |
|
6142 |
fileName isAbsolute ifTrue:[ |
|
6143 |
path := fileName getName. |
|
6144 |
] ifFalse:[ |
|
6145 |
path := fileName pathName. |
|
6146 |
]. |
|
6147 |
aBlock value:path |
|
6148 |
] |
|
6149 |
]. |
|
6150 |
]. |
|
6151 |
! |
|
6152 |
||
8648
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
6153 |
generateDetachedSignaturesForSelectedFiles |
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
6154 |
"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
|
6155 |
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
|
6156 |
|
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
6157 |
self withActivityIndicationDo:[ |
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
6158 |
self currentSelectedFiles do:[:fn | |
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
6159 |
|data hash signature signatureFile| |
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
6160 |
|
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
6161 |
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
|
6162 |
|
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
6163 |
data := fn contentsAsString. |
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
6164 |
hash := SHA1Stream hashValueOf:data. |
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
6165 |
|
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
6166 |
signature := Expecco::KeyFileGenerator new signExpeccoCode:hash. |
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
6167 |
|
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
6168 |
signatureFile := fn addSuffix:'sig'. |
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
6169 |
signatureFile contents:signature. |
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
6170 |
]. |
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
6171 |
self notify:nil. |
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
6172 |
] |
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
6173 |
! |
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
6174 |
|
8640
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
6175 |
generateSignaturesForSelectedFiles |
8645
00e4d07c6d6d
Generate signed expecco patch files
Stefan Vogel <sv@exept.de>
parents:
8641
diff
changeset
|
6176 |
"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
|
6177 |
|
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
6178 |
self withActivityIndicationDo:[ |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
6179 |
self currentSelectedFiles do:[:fn | |
8645
00e4d07c6d6d
Generate signed expecco patch files
Stefan Vogel <sv@exept.de>
parents:
8641
diff
changeset
|
6180 |
|pkcs7SignedData signatureFilename| |
00e4d07c6d6d
Generate signed expecco patch files
Stefan Vogel <sv@exept.de>
parents:
8641
diff
changeset
|
6181 |
|
8646 | 6182 |
self notify:'Generating signed file from: ', (fn baseName), '...'. |
8645
00e4d07c6d6d
Generate signed expecco patch files
Stefan Vogel <sv@exept.de>
parents:
8641
diff
changeset
|
6183 |
|
00e4d07c6d6d
Generate signed expecco patch files
Stefan Vogel <sv@exept.de>
parents:
8641
diff
changeset
|
6184 |
pkcs7SignedData := Expecco::KeyFileGenerator new signExpeccoCode:fn contentsOfEntireFile. |
8646 | 6185 |
signatureFilename := fn addSuffix:'signed'. |
8645
00e4d07c6d6d
Generate signed expecco patch files
Stefan Vogel <sv@exept.de>
parents:
8641
diff
changeset
|
6186 |
signatureFilename contents:pkcs7SignedData. |
8640
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
6187 |
]. |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
6188 |
self notify:nil. |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
6189 |
] |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
6190 |
! |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
6191 |
|
3892 | 6192 |
installAllAsAutoloaded |
6193 |
"install all classes found here as autoloaded classes" |
|
6194 |
||
4345 | 6195 |
[ |
6196 |
self withActivityIndicationDo:[ |
|
6725 | 6197 |
self currentSelectedDirectories do:[:dir| |
6523 | 6198 |
dir directoryContentsAsFilenamesDo:[:fn | |
6708 | 6199 |
(fn suffix = 'st') ifTrue:[ |
6523 | 6200 |
self notify:('Install as autoloaded:', fn baseName). |
6201 |
self installAsAutoloaded:fn. |
|
6202 |
] |
|
4343 | 6203 |
] |
6204 |
]. |
|
6190 | 6205 |
self notify:nil. |
4345 | 6206 |
] |
6207 |
] fork. |
|
3892 | 6208 |
! |
6209 |
||
6521 | 6210 |
installAllAsAutoloadedRecursive |
6211 |
"install all classes found here and in subdirectories as autoloaded classes" |
|
6212 |
||
6213 |
[ |
|
6214 |
self withActivityIndicationDo:[ |
|
6725 | 6215 |
self currentSelectedDirectories do:[:dir| |
6521 | 6216 |
dir recursiveDirectoryContentsDo:[:f | |
6708 | 6217 |
|fn| |
6521 | 6218 |
fn := dir construct:f. |
6708 | 6219 |
(fn suffix = 'st') ifTrue:[ |
6521 | 6220 |
self notify:('Install as autoloaded:', f). |
6221 |
self installAsAutoloaded:fn. |
|
6222 |
] |
|
6223 |
] |
|
6224 |
]. |
|
6225 |
self notify:nil. |
|
6226 |
] |
|
6227 |
] fork. |
|
6228 |
! |
|
6229 |
||
3892 | 6230 |
installAsAutoloaded:aFilename |
6231 |
"install aFilename as autoloaded class" |
|
6232 |
||
9455 | 6233 |
|chunks filename| |
5971
af337e1a857f
Use #setFilename:forClass:package: to define an abbreviation
Stefan Vogel <sv@exept.de>
parents:
5967
diff
changeset
|
6234 |
|
af337e1a857f
Use #setFilename:forClass:package: to define an abbreviation
Stefan Vogel <sv@exept.de>
parents:
5967
diff
changeset
|
6235 |
filename := aFilename asFilename. |
af337e1a857f
Use #setFilename:forClass:package: to define an abbreviation
Stefan Vogel <sv@exept.de>
parents:
5967
diff
changeset
|
6236 |
|
9455 | 6237 |
filename readingFileDo:[:s| |
6238 |
chunks := ChangeSet fromStream:s. |
|
6239 |
]. |
|
3892 | 6240 |
chunks |
4414 | 6241 |
select:[:eachChunk | eachChunk isClassDefinitionChange] |
5971
af337e1a857f
Use #setFilename:forClass:package: to define an abbreviation
Stefan Vogel <sv@exept.de>
parents:
5967
diff
changeset
|
6242 |
thenDo:[:eachClassChunk | |
8039
732cbc4ea214
keep absolute-pathname including suffix as classFilename
Claus Gittinger <cg@exept.de>
parents:
8013
diff
changeset
|
6243 |
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
|
6244 |
]. |
3892 | 6245 |
! |
6246 |
||
4558 | 6247 |
joinSelectedFiles |
6264 | 6248 |
|selectedFiles numFiles msg outFileName outFile outStream| |
4558 | 6249 |
|
7560 | 6250 |
selectedFiles := self currentSelectedObjects. |
4558 | 6251 |
(numFiles := selectedFiles size) <= 1 ifTrue:[^ self]. |
6252 |
||
6253 |
msg := 'Join each of the %1 files into single file named:\\Attention: order in which files were selected is relevant here !!'. |
|
6352 | 6254 |
outFileName := Dialog request:(resources stringWithCRs:msg with:numFiles with:selectedFiles first baseName). |
6264 | 6255 |
outFileName isEmptyOrNil ifTrue:[^ self]. |
6256 |
outFile := selectedFiles first directory construct:outFileName. |
|
4558 | 6257 |
|
6258 |
outStream := outFile writeStream. |
|
6259 |
||
6260 |
selectedFiles do:[:fileName | |
|
6261 |
|inStream| |
|
6262 |
||
6263 |
self notify:('Adding:', fileName baseName). |
|
6264 |
inStream := fileName readStream. |
|
6265 |
inStream copyToEndInto:outStream. |
|
6266 |
inStream close. |
|
6267 |
]. |
|
6268 |
outStream close. |
|
6190 | 6269 |
self notify:nil. |
7560 | 6270 |
|
6271 |
"Modified: / 04-12-2006 / 13:15:10 / cg" |
|
4558 | 6272 |
! |
6273 |
||
6292 | 6274 |
loadImageThenDo:aBlock |
3892 | 6275 |
|img path files| |
6276 |
||
3982 | 6277 |
files := self currentSelectedFiles. |
3892 | 6278 |
files isEmpty ifTrue:[ ^ self]. |
6279 |
files do:[:fileName | |
|
4414 | 6280 |
path := fileName. |
6281 |
path isDirectory ifFalse:[ |
|
6282 |
img := Image fromFile:(path pathName). |
|
6283 |
img notNil ifTrue:[ |
|
6292 | 6284 |
aBlock value:img |
4414 | 6285 |
] ifFalse:[ |
6292 | 6286 |
Dialog warn:'Unknown format: ' , fileName asString |
4414 | 6287 |
] |
6288 |
] |
|
3892 | 6289 |
]. |
6290 |
! |
|
6291 |
||
6292 |
openASN1Browser |
|
6293 |
||
6294 |
self openTool:OSI::ASN1Browser |
|
6295 |
! |
|
6296 |
||
6297 |
openAppletViewer |
|
6298 |
|numItems files| |
|
6299 |
||
3982 | 6300 |
files := self currentSelectedFiles. |
3892 | 6301 |
(numItems := files size) > 2 ifTrue:[ |
4414 | 6302 |
(self |
6303 |
confirm:(resources string:'open for each of the %1 items ?' |
|
6304 |
with:numItems)) ifFalse:[^ self]. |
|
3892 | 6305 |
]. |
6306 |
||
6307 |
Java startupJavaSystem. |
|
6308 |
"/ Java markAllClassesUninitialized. |
|
6309 |
"/ Java initAllStaticFields. |
|
6310 |
"/ Java initAllClasses. |
|
6311 |
||
6312 |
files do:[:fileName | |
|
4414 | 6313 |
|p path| |
6314 |
||
6315 |
path := fileName. |
|
6316 |
path isDirectory ifFalse:[ |
|
6317 |
p := Java |
|
6318 |
javaProcessForMainOf:(Java classForName:'sun.applet.AppletViewer') |
|
6319 |
argumentString:path pathName. |
|
6320 |
p resume. |
|
6321 |
] |
|
3892 | 6322 |
]. |
6323 |
! |
|
6324 |
||
6325 |
openCBrowser |
|
6031 | 6326 |
|dir files| |
5880 | 6327 |
|
6328 |
dir := self theSingleSelectedDirectoryOrNil. |
|
6329 |
dir isNil ifTrue:[ ^ self]. |
|
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
6330 |
self withActivityIndicationDo:[ |
7560 | 6331 |
files := self currentSelectedObjects. |
6031 | 6332 |
files notEmptyOrNil ifTrue:[ |
6333 |
CBrowser::Browser openOn:files first. |
|
6334 |
] ifFalse:[ |
|
6335 |
CBrowser::Browser openIn:dir. |
|
6336 |
] |
|
3892 | 6337 |
] |
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
6338 |
|
7560 | 6339 |
"Modified: / 04-12-2006 / 13:15:19 / cg" |
3892 | 6340 |
! |
6341 |
||
4230 | 6342 |
openChangeSetBrowser |
6343 |
self |
|
6344 |
openTool:ChangeSetBrowser |
|
6345 |
with:#openOnFile: |
|
6346 |
ignoreDirectories:true |
|
6347 |
! |
|
6348 |
||
3892 | 6349 |
openChangesBrowser |
6350 |
"open a change browser on the selected file(s)" |
|
6351 |
||
6352 |
self openTool:(UserPreferences current changesBrowserClass) |
|
6353 |
! |
|
6354 |
||
6355 |
openDiffView |
|
6356 |
"open a diff-view" |
|
6357 |
||
6388 | 6358 |
|name1 name2 text1 text2 d err nm l1 files title |
6460 | 6359 |
defaultName lastFile sameContents msg| |
6360 |
||
6361 |
files := self currentSelectedObjects. |
|
3892 | 6362 |
files isEmpty ifTrue:[ |
6460 | 6363 |
Dialog warn:(resources string:'You have to select a file first'). |
4414 | 6364 |
^ self. |
3892 | 6365 |
]. |
8287
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6366 |
|
3892 | 6367 |
(files size == 2) ifTrue:[ |
4414 | 6368 |
name1 := files last. |
6369 |
name2 := files first. |
|
3892 | 6370 |
] ifFalse:[ |
4414 | 6371 |
LastFileDiffFile notNil ifTrue:[ |
5960 | 6372 |
| directory | |
6373 |
directory := self currentDirectory. |
|
6374 |
directory notNil ifTrue:[ |
|
6375 |
lastFile := directory asFilename construct:(LastFileDiffFile baseName). |
|
4414 | 6376 |
(lastFile exists and:[lastFile isReadable]) ifTrue:[ |
6377 |
name1 := lastFile. |
|
6378 |
] |
|
6379 |
] |
|
6380 |
]. |
|
6381 |
name2 := files first. |
|
6460 | 6382 |
title := resources string:'Show differences between "%1" and:' with:name2 baseName. |
4414 | 6383 |
defaultName := name1 notNil ifTrue:[name1 baseName] ifFalse:[nil]. |
6384 |
name1 := DialogBox |
|
6385 |
requestFileName:title |
|
6386 |
default:defaultName |
|
6460 | 6387 |
ok:(resources string:'OK') |
6388 |
abort:(resources string:'Compare against File List') |
|
4414 | 6389 |
pattern:'*' |
6390 |
fromDirectory:(name2 asFilename directory). |
|
3892 | 6391 |
]. |
6392 |
||
8287
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6393 |
self withWaitCursorDo:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6394 |
(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
|
6395 |
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
|
6396 |
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
|
6397 |
name1 := nil. |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6398 |
l1 := 'browser contents' |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6399 |
] ifFalse:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6400 |
name1 := name1 asFilename. |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6401 |
LastFileDiffFile := name1. |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6402 |
name1 isReadable ifFalse:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6403 |
nm := name1. |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6404 |
name1 exists ifFalse:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6405 |
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
|
6406 |
] ifTrue:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6407 |
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
|
6408 |
]. |
4414 | 6409 |
]. |
8287
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6410 |
l1 := name1 pathName |
4414 | 6411 |
]. |
8287
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6412 |
|
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6413 |
err isNil ifTrue:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6414 |
name2 isReadable ifFalse:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6415 |
nm := name2. |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6416 |
name2 exists ifFalse:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6417 |
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
|
6418 |
] ifTrue:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6419 |
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
|
6420 |
]. |
4414 | 6421 |
]. |
6422 |
]. |
|
8287
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6423 |
err notNil ifTrue:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6424 |
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
|
6425 |
^ self |
6176 | 6426 |
]. |
6427 |
||
8287
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6428 |
self withActivityIndicationDo:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6429 |
((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
|
6430 |
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
|
6431 |
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
|
6432 |
ProgressIndicator |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6433 |
displayBusyIndicator:'Comparing...' |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6434 |
at:(Screen default center) |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6435 |
during:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6436 |
sameContents := (name1 sameContentsAs:name2). |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6437 |
]. |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6438 |
sameContents ifTrue:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6439 |
self information:'Same contents.' |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6440 |
] ifFalse:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6441 |
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
|
6442 |
]. |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6443 |
] ifFalse:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6444 |
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
|
6445 |
]. |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6446 |
^ self. |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6447 |
]. |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6448 |
|
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6449 |
name1 notNil ifTrue:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6450 |
name1 isDirectory ifTrue:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6451 |
text1 := name1 directoryContents asString. |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6452 |
] ifFalse:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6453 |
text1 := name1 contents. |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6454 |
] |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6455 |
]. |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6456 |
name2 isDirectory ifTrue:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6457 |
text2 := name2 directoryContents asString. |
6460 | 6458 |
] ifFalse:[ |
8287
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6459 |
text2 := name2 contents. |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6460 |
]. |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6461 |
text1 = text2 ifTrue:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6462 |
(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
|
6463 |
msg := 'Same filename lists.' |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6464 |
] ifFalse:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6465 |
msg := 'Same contents.' |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6466 |
]. |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6467 |
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
|
6468 |
] ifFalse:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6469 |
d := DiffTextView |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6470 |
openOn:text1 label:l1 |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6471 |
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
|
6472 |
d topView label:(resources string:'File Differences'). |
6460 | 6473 |
] |
4414 | 6474 |
] |
3892 | 6475 |
] |
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
6476 |
|
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
6477 |
"Modified: / 25-07-2006 / 09:07:37 / cg" |
3892 | 6478 |
! |
6479 |
||
9496
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
6480 |
openDirectoryDiffView |
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
6481 |
"open a directory diff-view" |
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
6482 |
|
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
6483 |
|name1 name2 files| |
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
6484 |
|
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
6485 |
files := self currentSelectedObjects. |
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
6486 |
(files size == 2) ifFalse:[ |
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
6487 |
Dialog warn:(resources string:'You have to select exactly 2 directories'). |
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
6488 |
^ self. |
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
6489 |
]. |
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
6490 |
name1 := files last. |
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
6491 |
name2 := files first. |
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
6492 |
self information:'Sorry - not yet implemented'. |
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
6493 |
|
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
6494 |
"/ self withWaitCursorDo:[ |
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
6495 |
"/ (name1 isNil or:[name1 asString isEmpty]) ifTrue:[ |
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
6496 |
"/ text1 := self getAllFilesAsStrings asStringCollection withTabs. |
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
6497 |
"/ text1 := text1 collect:[:l | l isNil ifTrue:[' '] ifFalse:[l]]. |
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
6498 |
"/ name1 := nil. |
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
6499 |
"/ l1 := 'browser contents' |
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
6500 |
"/ ] ifFalse:[ |
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
6501 |
"/ name1 := name1 asFilename. |
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
6502 |
"/ LastFileDiffFile := name1. |
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
6503 |
"/ name1 isReadable ifFalse:[ |
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
6504 |
"/ nm := name1. |
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
6505 |
"/ name1 exists ifFalse:[ |
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
6506 |
"/ err := '"%1" does not exist.'. |
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
6507 |
"/ ] ifTrue:[ |
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
6508 |
"/ err := '"%1" is not readable.' |
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
6509 |
"/ ]. |
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
6510 |
"/ ]. |
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
6511 |
"/ l1 := name1 pathName |
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
6512 |
"/ ]. |
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
6513 |
"/ |
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
6514 |
"/ err isNil ifTrue:[ |
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
6515 |
"/ name2 isReadable ifFalse:[ |
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
6516 |
"/ nm := name2. |
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
6517 |
"/ name2 exists ifFalse:[ |
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
6518 |
"/ err := '"%1" does not exist.'. |
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
6519 |
"/ ] ifTrue:[ |
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
6520 |
"/ err := '"%1" is not readable.' |
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
6521 |
"/ ]. |
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
6522 |
"/ ]. |
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
6523 |
"/ ]. |
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
6524 |
"/ err notNil ifTrue:[ |
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
6525 |
"/ Dialog warn:(resources string:err with:nm pathName allBold). |
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
6526 |
"/ ^ self |
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
6527 |
"/ ]. |
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
6528 |
"/ |
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
6529 |
"/ self withActivityIndicationDo:[ |
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
6530 |
"/ ((name1 notNil and:[name1 fileSize > (1024*1024*8)]) |
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
6531 |
"/ or:[ name2 fileSize > (1024*1024*8) ]) ifTrue:[ |
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
6532 |
"/ name1 fileSize = name2 fileSize ifTrue:[ |
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
6533 |
"/ ProgressIndicator |
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
6534 |
"/ displayBusyIndicator:'Comparing...' |
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
6535 |
"/ at:(Screen default center) |
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
6536 |
"/ during:[ |
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
6537 |
"/ sameContents := (name1 sameContentsAs:name2). |
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
6538 |
"/ ]. |
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
6539 |
"/ sameContents ifTrue:[ |
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
6540 |
"/ self information:'Same contents.' |
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
6541 |
"/ ] ifFalse:[ |
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
6542 |
"/ self information:'Different contents (File(s) too big for more details).' |
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
6543 |
"/ ]. |
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
6544 |
"/ ] ifFalse:[ |
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
6545 |
"/ self information:'Different size (File(s) too big for more details).' |
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
6546 |
"/ ]. |
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
6547 |
"/ ^ self. |
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
6548 |
"/ ]. |
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
6549 |
"/ |
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
6550 |
"/ name1 notNil ifTrue:[ |
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
6551 |
"/ name1 isDirectory ifTrue:[ |
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
6552 |
"/ text1 := name1 directoryContents asString. |
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
6553 |
"/ ] ifFalse:[ |
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
6554 |
"/ text1 := name1 contents. |
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
6555 |
"/ ] |
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
6556 |
"/ ]. |
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
6557 |
"/ name2 isDirectory ifTrue:[ |
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
6558 |
"/ text2 := name2 directoryContents asString. |
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
6559 |
"/ ] ifFalse:[ |
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
6560 |
"/ text2 := name2 contents. |
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
6561 |
"/ ]. |
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
6562 |
"/ text1 = text2 ifTrue:[ |
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
6563 |
"/ (name1 isDirectory or:[name2 isDirectory]) ifTrue:[ |
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
6564 |
"/ msg := 'Same filename lists.' |
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
6565 |
"/ ] ifFalse:[ |
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
6566 |
"/ msg := 'Same contents.' |
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
6567 |
"/ ]. |
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
6568 |
"/ self information:(resources string:msg) |
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
6569 |
"/ ] ifFalse:[ |
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
6570 |
"/ d := DiffTextView |
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
6571 |
"/ openOn:text1 label:l1 |
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
6572 |
"/ and:text2 label:name2 pathName. |
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
6573 |
"/ d topView label:(resources string:'File Differences'). |
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
6574 |
"/ ] |
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
6575 |
"/ ] |
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
6576 |
"/ ] |
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
6577 |
"/ |
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
6578 |
"/ |
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
6579 |
|
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
6580 |
"Created: / 20-05-2010 / 15:01:17 / cg" |
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
6581 |
! |
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
6582 |
|
3892 | 6583 |
openEditor |
6584 |
self openTool:EditTextView |
|
6585 |
! |
|
6586 |
||
4957 | 6587 |
openGV |
6588 |
self openOSCommandWithFiles:'gv' |
|
6589 |
! |
|
6590 |
||
3892 | 6591 |
openHTMLReader |
6592 |
||
6593 |
self openTool:HTMLDocumentView ignoreDirectories:false |
|
6594 |
! |
|
6595 |
||
6596 |
openImageEditor |
|
6292 | 6597 |
[ |
6598 |
self loadImageThenDo:[:img | img edit] |
|
6599 |
] fork |
|
3892 | 6600 |
! |
6601 |
||
6602 |
openImageInspector |
|
6292 | 6603 |
[ |
6604 |
self loadImageThenDo:[:img | img inspect] |
|
6605 |
] fork |
|
3892 | 6606 |
! |
6607 |
||
6608 |
openImagePreview |
|
5778 | 6609 |
[ |
6610 |
self |
|
6292 | 6611 |
loadImageThenDo: |
5778 | 6612 |
[:img | |
6613 |
|i top viewer| |
|
6614 |
||
6615 |
top := StandardSystemView new. |
|
6616 |
||
6617 |
viewer := ImageView origin:0.0@0.0 corner:1.0@1.0 in:top. |
|
6618 |
i := img. |
|
6619 |
top extent:200@200. |
|
6620 |
top label:(img fileName asFilename directory baseName , Filename separator , img fileName asFilename baseName). |
|
6621 |
top openAndWait. |
|
6622 |
||
6623 |
(i width > 200 or:[i height > 200]) ifTrue:[ |
|
6624 |
i := i magnifiedPreservingRatioTo:200@200. |
|
6625 |
]. |
|
6626 |
viewer image:i. |
|
6627 |
]. |
|
3892 | 6628 |
] fork |
6629 |
! |
|
6630 |
||
6631 |
openMP3Player |
|
6632 |
|file| |
|
6633 |
||
3982 | 6634 |
file := self currentSelectedFiles. |
3892 | 6635 |
(file isEmpty) ifTrue:[ |
4414 | 6636 |
^ self. |
3892 | 6637 |
]. |
6638 |
file := file first. |
|
6639 |
(MP3PlayerApplication ? SaugFix::MP3PlayerApplication) playSong:file. |
|
6640 |
! |
|
6641 |
||
4957 | 6642 |
openOSCommandWithFiles:command |
6643 |
|files fileNames| |
|
6644 |
||
6645 |
files := self currentSelectedFiles. |
|
6646 |
(files isEmpty) ifTrue:[ |
|
6647 |
^ self. |
|
6648 |
]. |
|
6649 |
||
6650 |
fileNames := files collect:[:each | |
|
6651 |
'"' , each asFilename pathName , '"' |
|
6652 |
]. |
|
6653 |
||
6654 |
[ |
|
6655 |
OperatingSystem |
|
4959 | 6656 |
executeCommand:command , ' ' , fileNames asStringCollection asString |
6657 |
inDirectory:(files first asFilename directory). |
|
4957 | 6658 |
] fork |
6659 |
! |
|
6660 |
||
4820 | 6661 |
openPDFViewer |
5836
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
6662 |
|files fileNames cmd arg| |
4820 | 6663 |
|
6664 |
files := self currentSelectedFiles. |
|
6665 |
(files isEmpty) ifTrue:[ |
|
6666 |
^ self. |
|
6667 |
]. |
|
5836
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
6668 |
cmd := MIMETypes defaultCommandForMimeType:'application/pdf'. |
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
6669 |
cmd isNil ifTrue:[ |
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
6670 |
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
|
6671 |
^ self. |
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
6672 |
]. |
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
6673 |
|
4820 | 6674 |
fileNames := |
6675 |
files |
|
6676 |
collect: |
|
6677 |
[:each | |
|
6678 |
'"' , each asFilename pathName , '"' |
|
6679 |
]. |
|
5836
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
6680 |
arg := fileNames asStringCollection asStringWith:' '. |
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
6681 |
|
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
6682 |
(cmd includesString:'"%1"') ifTrue:[ |
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
6683 |
cmd := cmd copyReplaceString:'"%1"' withString:'%1' |
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
6684 |
]. |
4820 | 6685 |
|
4950 | 6686 |
[ |
5836
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
6687 |
OperatingSystem executeCommand:(cmd bindWith:arg). |
4950 | 6688 |
] fork |
5836
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
6689 |
|
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
6690 |
"Modified: / 12-05-2004 / 12:31:20 / cg" |
4820 | 6691 |
! |
6692 |
||
4958 | 6693 |
openRP |
6694 |
self openOSCommandWithFiles:'realplay' |
|
6695 |
! |
|
6696 |
||
8426 | 6697 |
openResourceFileEditor |
6698 |
||
6699 |
self |
|
6700 |
openTool: Tools::InternationalLanguageTranslationEditor |
|
6701 |
with: #openOnFile: |
|
6702 |
! |
|
6703 |
||
3892 | 6704 |
openSlideShow |
5880 | 6705 |
|dir| |
6706 |
||
6707 |
dir := self theSingleSelectedDirectoryOrNil. |
|
6708 |
dir isNil ifTrue:[^ self]. |
|
6709 |
||
3892 | 6710 |
CodingExamples_GUI::SlideShow openIn:dir. |
6711 |
! |
|
6712 |
||
6713 |
openSnapshotImageBrowser |
|
4491 | 6714 |
"Sorry, for now, only the old browser can handle snapShotImages." |
6715 |
||
3892 | 6716 |
^ self openTool:SystemBrowser with:#openOnSnapShotImage: ignoreDirectories:true |
6717 |
! |
|
6718 |
||
6719 |
openTerminal |
|
5880 | 6720 |
|dir| |
6721 |
||
6722 |
dir := self theSingleSelectedDirectoryOrHomeDir. |
|
3892 | 6723 |
|
5300 | 6724 |
TerminalApplication notNil ifTrue:[ |
6725 |
TerminalApplication openIn:dir |
|
6726 |
] ifFalse:[ |
|
6727 |
VT100TerminalView openShellIn:dir. |
|
6728 |
]. |
|
3892 | 6729 |
! |
6730 |
||
6731 |
openTool:aToolClass |
|
6732 |
"open a tool on the selected file(s)" |
|
6733 |
||
6734 |
^ self openTool:aToolClass ignoreDirectories:true |
|
6735 |
! |
|
6736 |
||
6737 |
openTool:aToolClass ignoreDirectories:ignoreDirs |
|
6738 |
"open a tool on the selected file(s)" |
|
6739 |
||
6740 |
^ self |
|
4414 | 6741 |
openTool:aToolClass |
6742 |
with:#openOn: |
|
6743 |
ignoreDirectories:ignoreDirs |
|
3892 | 6744 |
! |
6745 |
||
8426 | 6746 |
openTool:aToolClass with:aSelector |
6747 |
"open a tool on the selected file(s)" |
|
6748 |
||
6749 |
^ self openTool:aToolClass with:aSelector ignoreDirectories:true |
|
6750 |
! |
|
6751 |
||
3892 | 6752 |
openTool:aToolClass with:aSelector ignoreDirectories:ignoreDirs |
6753 |
"open a tool on the selected file(s)" |
|
6754 |
||
8832 | 6755 |
|tool| |
3892 | 6756 |
|
6757 |
aToolClass isNil ifTrue:[ |
|
4414 | 6758 |
Dialog warn:'Sorry, that tool seems to be not available'. |
6759 |
^ nil. |
|
3892 | 6760 |
]. |
8832 | 6761 |
self forEachSelectedFileIgnoringDirectories:ignoreDirs do:[:path | |
6762 |
tool := aToolClass perform:aSelector with:path. |
|
3892 | 6763 |
]. |
6764 |
^ tool |
|
8832 | 6765 |
! |
6766 |
||
6767 |
openWebBrowser |
|
9343
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
6768 |
self |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
6769 |
forEachSelectedFileIgnoringDirectories:true |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
6770 |
do:[:path | |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
6771 |
Error |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
6772 |
handle:[:ex | |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
6773 |
Dialog warn:'Shell execution failed: ',ex description |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
6774 |
] do:[ |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
6775 |
OperatingSystem openApplicationForDocument:path operation:#open. |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
6776 |
^ self. |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
6777 |
] |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
6778 |
]. |
3892 | 6779 |
! |
6780 |
||
6022 | 6781 |
openWorkspace |
6782 |
self |
|
6783 |
openTool:WorkspaceApplication |
|
6784 |
with:#openOnFile: |
|
6785 |
ignoreDirectories:true |
|
6786 |
! |
|
6787 |
||
4950 | 6788 |
openXV |
4957 | 6789 |
self openOSCommandWithFiles:'xv' |
4950 | 6790 |
! |
6791 |
||
3892 | 6792 |
openZipTool |
5880 | 6793 |
|zipTool| |
3892 | 6794 |
|
6795 |
(zipTool := self openTool:ZipTool) notNil ifTrue:[ |
|
5880 | 6796 |
zipTool initialExtractDirectory:(self theSingleSelectedDirectoryOrHomeDir). |
3892 | 6797 |
]. |
6798 |
! |
|
6799 |
||
7869 | 6800 |
parseXmlFile |
8617 | 6801 |
"Show an XML file - either in an XMLInspector or fall back to |
6802 |
a plain inspector on the XML tree" |
|
7869 | 6803 |
|
6804 |
self withActivityIndicationDo:[ |
|
6805 |
| selectedFiles xmlDocument | |
|
6806 |
||
6807 |
selectedFiles:= self currentSelectedFiles. |
|
6808 |
selectedFiles do:[:fileName | |
|
8617 | 6809 |
XML::XMLSignal handle:[:ex | |
8611
3d979ab577b7
xml-inspector always enabled.
Claus Gittinger <cg@exept.de>
parents:
8601
diff
changeset
|
6810 |
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
|
6811 |
^ self. |
3d979ab577b7
xml-inspector always enabled.
Claus Gittinger <cg@exept.de>
parents:
8601
diff
changeset
|
6812 |
] do:[ |
9173 | 6813 |
|s d magic encoder document| |
6814 |
||
6815 |
s := fileName asFilename readStream. |
|
6816 |
s binary. |
|
6817 |
magic := (s next:2). |
|
6818 |
magic = #[254 255] ifTrue:[ |
|
6819 |
"/ UTF16BE |
|
6820 |
document := CharacterEncoder decodeString:(s upToEnd) from:#utf16be. |
|
6821 |
] ifFalse:[ |
|
6822 |
magic = #[255 254] ifTrue:[ |
|
6823 |
"/ UTF16LE |
|
6824 |
document := CharacterEncoder decodeString:(s upToEnd) from:#utf16le. |
|
6825 |
]. |
|
6826 |
]. |
|
6827 |
s close. |
|
6828 |
||
6829 |
document notNil ifTrue:[ |
|
6830 |
xmlDocument := XML::XMLParser |
|
6831 |
processDocumentString:document |
|
6832 |
beforeScanDo:[:parse| parse validate:false]. |
|
6833 |
] ifFalse:[ |
|
6834 |
xmlDocument := XML::XMLParser |
|
8617 | 6835 |
processDocumentInFilename:fileName |
6836 |
beforeScanDo:[:parse| parse validate:false]. |
|
9173 | 6837 |
] |
8611
3d979ab577b7
xml-inspector always enabled.
Claus Gittinger <cg@exept.de>
parents:
8601
diff
changeset
|
6838 |
]. |
8068
1cf9f1224bbc
changed #parseXmlFile - open XMLInspector (in exept:xml/inspector)
Stefan Vogel <sv@exept.de>
parents:
8042
diff
changeset
|
6839 |
XML::XMLInspector notNil ifTrue:[ |
1cf9f1224bbc
changed #parseXmlFile - open XMLInspector (in exept:xml/inspector)
Stefan Vogel <sv@exept.de>
parents:
8042
diff
changeset
|
6840 |
XML::XMLInspector openOn:xmlDocument. |
8617 | 6841 |
"/ XML::XMLInspector openWithoutDetailsOn:xmlDocument. |
8068
1cf9f1224bbc
changed #parseXmlFile - open XMLInspector (in exept:xml/inspector)
Stefan Vogel <sv@exept.de>
parents:
8042
diff
changeset
|
6842 |
] ifFalse:[ |
1cf9f1224bbc
changed #parseXmlFile - open XMLInspector (in exept:xml/inspector)
Stefan Vogel <sv@exept.de>
parents:
8042
diff
changeset
|
6843 |
"fall back..." |
1cf9f1224bbc
changed #parseXmlFile - open XMLInspector (in exept:xml/inspector)
Stefan Vogel <sv@exept.de>
parents:
8042
diff
changeset
|
6844 |
xmlDocument inspect. |
1cf9f1224bbc
changed #parseXmlFile - open XMLInspector (in exept:xml/inspector)
Stefan Vogel <sv@exept.de>
parents:
8042
diff
changeset
|
6845 |
] |
7869 | 6846 |
]. |
6847 |
] |
|
6848 |
! |
|
6849 |
||
3892 | 6850 |
readAbbrevFile |
6851 |
"read the abbrev file and install classes found there as autoloaded classes" |
|
6852 |
||
5880 | 6853 |
|directories| |
3892 | 6854 |
|
3982 | 6855 |
directories := self currentSelectedDirectories. |
3892 | 6856 |
directories isEmpty ifTrue:[^ self]. |
6857 |
||
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
6858 |
self withActivityIndicationDo:[ |
5880 | 6859 |
directories do:[:eachDir | |
6860 |
Smalltalk installAutoloadedClassesFrom:(eachDir construct:'abbrev.stc'). |
|
6861 |
] |
|
5828 | 6862 |
] |
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
6863 |
|
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
6864 |
"Modified: / 25-07-2006 / 09:07:43 / cg" |
3892 | 6865 |
! |
6866 |
||
6460 | 6867 |
readAndShowResources |
6868 |
self withActivityIndicationDo:[ |
|
6869 |
| selectedFiles| |
|
6870 |
||
6871 |
selectedFiles:= self currentSelectedFiles. |
|
6872 |
selectedFiles do:[:fileName | |
|
6873 |
resources := ResourcePack fromFile:fileName. |
|
6874 |
resources inspect. |
|
6875 |
]. |
|
6876 |
] |
|
6877 |
! |
|
6878 |
||
3892 | 6879 |
singleFileFileIn:fileName lazy:lazy |
6880 |
"fileIn the selected file(s)" |
|
6881 |
||
9299
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
6882 |
|aStream wasLazy notifyString dontAskSignals lang| |
6281
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
6883 |
|
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
6884 |
fileName isRegularFile ifFalse:[ |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
6885 |
^ self. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
6886 |
]. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
6887 |
|
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
6888 |
[ |
4345 | 6889 |
(ObjectFileLoader notNil |
5491 | 6890 |
and:[ObjectFileLoader hasValidBinaryExtension:fileName]) ifTrue:[ |
4345 | 6891 |
AbortOperationRequest catch:[ |
6892 |
|p| |
|
6893 |
||
6894 |
"/ |
|
6895 |
"/ look if already loaded ... then unload first |
|
6896 |
"/ |
|
6897 |
p := fileName pathName. |
|
6898 |
(ObjectFileLoader loadedObjectFiles includes:p) ifTrue:[ |
|
6899 |
(Dialog confirm:(resources |
|
6900 |
string:'%1 is already loaded; load anyway ?' |
|
6901 |
with:p)) ifFalse:[ |
|
6902 |
^ self |
|
6903 |
]. |
|
6904 |
notifyString := 'unloading old ' , p , ' ...'. |
|
6905 |
Transcript showCR:notifyString. |
|
4523 | 6906 |
self notify:notifyString. |
4345 | 6907 |
ObjectFileLoader unloadObjectFile:p. |
6908 |
]. |
|
6909 |
||
6910 |
notifyString := 'loading ' , p , ' ...'. |
|
6911 |
Transcript showCR:notifyString. |
|
4523 | 6912 |
self notify:notifyString. |
4345 | 6913 |
ObjectFileLoader loadObjectFile:p. |
6914 |
Class addInfoRecord:('fileIn ' , fileName asFilename pathName) |
|
6915 |
] |
|
6916 |
] ifFalse:[ ((fileName hasSuffix:'cls') |
|
6917 |
and:[((fileName mimeTypeOfContents ? '') startsWith:'application/x-smalltalk-source') not ]) ifTrue:[ |
|
6918 |
"/ loading a binary class file |
|
4636
08b2b63e3107
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4629
diff
changeset
|
6919 |
aStream := fileName readStreamOrNil. |
4345 | 6920 |
aStream notNil ifTrue:[ |
6921 |
aStream fileInBinary. |
|
6922 |
] |
|
6923 |
] ifFalse:[ |
|
9299
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
6924 |
((fileName hasSuffix:'class') or:[(fileName hasSuffix:'cla')]) ifTrue:[ |
4345 | 6925 |
"/ loading a java class file |
6926 |
JavaClassReader notNil ifTrue:[ |
|
5491 | 6927 |
JavaClassReader loadFile:fileName |
4345 | 6928 |
] |
6929 |
] ifFalse:[ (fileName hasSuffix:'sif') ifTrue:[ |
|
6930 |
"/ loading a sif (smalltalk interchange format) file |
|
6931 |
SmalltalkInterchangeSTXFileInManager autoload. |
|
6932 |
SmalltalkInterchangeFileManager newForFileIn |
|
6933 |
fileName: fileName pathName; |
|
6934 |
fileIn. |
|
6935 |
] ifFalse:[ (fileName hasSuffix:'pcl') ifTrue:[ |
|
6936 |
Parcel isNil ifTrue:[ |
|
6937 |
Dialog warn:'Parcel support not loaded.' |
|
6938 |
] ifFalse:[ |
|
6939 |
Parcel loadParcelFrom: fileName pathName |
|
6940 |
] |
|
6941 |
] ifFalse:[ |
|
9299
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
6942 |
"/ ask programming languages... |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
6943 |
lang := ProgrammingLanguage allDetect:[:l | l canReadSourceFile:fileName] ifNone:nil. |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
6944 |
(lang notNil and:[lang ~= SmalltalkLanguage]) ifTrue:[ |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
6945 |
lang fileIn:fileName. |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
6946 |
] ifFalse:[ |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
6947 |
"/ loading a regular (chunk) or xml source file |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
6948 |
Error handle:[:ex | |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
6949 |
self errorNotify:'Error on file in: ', ex description. |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
6950 |
] do:[ |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
6951 |
aStream := fileName readStream. |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
6952 |
[ |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
6953 |
Class withoutUpdatingChangesDo:[ |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
6954 |
wasLazy := Compiler compileLazy:lazy. |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
6955 |
Smalltalk fileInStream:aStream. |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
6956 |
]. |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
6957 |
Class addInfoRecord:('fileIn ' , fileName asString) |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
6958 |
] ensure:[ |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
6959 |
Compiler compileLazy:wasLazy. |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
6960 |
aStream close |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
6961 |
] |
4345 | 6962 |
] |
6963 |
] |
|
9299
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
6964 |
]]] |
4345 | 6965 |
]] |
6281
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
6966 |
] 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
|
6967 |
|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
|
6968 |
|
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
6969 |
isRedef := false. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
6970 |
sig := ex signal. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
6971 |
(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
|
6972 |
ex reject |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
6973 |
]. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
6974 |
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
|
6975 |
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
|
6976 |
, 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
|
6977 |
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
|
6978 |
redefKind := 'method'. |
6281
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
6979 |
isRedef := true. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
6980 |
] 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
|
6981 |
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
|
6982 |
, 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
|
6983 |
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
|
6984 |
redefKind := 'class'. |
6281
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
6985 |
isRedef := true. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
6986 |
] 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
|
6987 |
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
|
6988 |
sender := ex suspendedContext. |
7533 | 6989 |
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
|
6990 |
] ifFalse:[ |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
6991 |
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
|
6992 |
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
|
6993 |
]]]. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
6994 |
|
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
6995 |
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
|
6996 |
|
8887
f9ab42af84ff
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
8882
diff
changeset
|
6997 |
labels := #('Cancel' 'Skip' 'Debug' 'Compare Sources'). |
f9ab42af84ff
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
8882
diff
changeset
|
6998 |
values := #(abort skip debug compareSources). |
f9ab42af84ff
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
8882
diff
changeset
|
6999 |
|
6281
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
7000 |
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
|
7001 |
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
|
7002 |
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
|
7003 |
|
8887
f9ab42af84ff
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
8882
diff
changeset
|
7004 |
labels := labels , #('Keep Package' ). |
f9ab42af84ff
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
8882
diff
changeset
|
7005 |
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
|
7006 |
]. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
7007 |
|
8887
f9ab42af84ff
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
8882
diff
changeset
|
7008 |
labels := labels , #( 'Continue' 'ContinueForAll'). |
f9ab42af84ff
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
8882
diff
changeset
|
7009 |
values := values , #( continue continueForAll). |
f9ab42af84ff
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
8882
diff
changeset
|
7010 |
|
6281
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
7011 |
AbortAllOperationRequest isHandled ifTrue:[ |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
7012 |
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
|
7013 |
values := #(cancelAll) , values. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
7014 |
]. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
7015 |
|
8082
40a926dc460d
On class/method redefinition allow the user to select both #keep and #continue
Stefan Vogel <sv@exept.de>
parents:
8068
diff
changeset
|
7016 |
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
|
7017 |
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
|
7018 |
label:label |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
7019 |
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
|
7020 |
labels:labels |
6281
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
7021 |
values:values |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
7022 |
default:#continue |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
7023 |
onCancel:#abort. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
7024 |
|
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
7025 |
action == #continueForAll ifTrue:[ |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
7026 |
dontAskSignals isNil ifTrue:[ |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
7027 |
dontAskSignals := IdentityDictionary new. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
7028 |
]. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
7029 |
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
|
7030 |
action := #continue. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
7031 |
]. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
7032 |
|
8887
f9ab42af84ff
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
8882
diff
changeset
|
7033 |
(action == #compareSources) ifTrue:[ |
f9ab42af84ff
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
8882
diff
changeset
|
7034 |
DiffCodeView |
f9ab42af84ff
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
8882
diff
changeset
|
7035 |
openOn:(ex oldMethod source) label:'Old Source' |
f9ab42af84ff
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
8882
diff
changeset
|
7036 |
and:(ex newMethod source) label:'New Source' |
f9ab42af84ff
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
8882
diff
changeset
|
7037 |
title:ex description. |
f9ab42af84ff
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
8882
diff
changeset
|
7038 |
ex resignalAs:ex |
f9ab42af84ff
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
8882
diff
changeset
|
7039 |
]. |
8082
40a926dc460d
On class/method redefinition allow the user to select both #keep and #continue
Stefan Vogel <sv@exept.de>
parents:
8068
diff
changeset
|
7040 |
(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
|
7041 |
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
|
7042 |
]. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
7043 |
action == #abort ifTrue:[ |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
7044 |
AbortOperationRequest raise. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
7045 |
ex return |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
7046 |
]. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
7047 |
action == #cancelAll ifTrue:[ |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
7048 |
AbortAllOperationRequest raise. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
7049 |
ex return |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
7050 |
]. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
7051 |
action == #skip ifTrue:[ |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
7052 |
ex proceedWith:nil |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
7053 |
]. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
7054 |
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
|
7055 |
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
|
7056 |
withMessage:ex description |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
7057 |
mayProceed:true. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
7058 |
ex proceedWith:nil. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
7059 |
]. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
7060 |
ex reject |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
7061 |
] |
7040 | 7062 |
|
7533 | 7063 |
"Modified: / 21-11-2006 / 15:53:03 / cg" |
4531 | 7064 |
! |
7065 |
||
4558 | 7066 |
splitFile:infile intoPiecesOfSize:kiloBytes |
7067 |
|bytesPerSplit splitIndex bufferSize buffer n |
|
7068 |
inStream outFile outStream remaining remainingInThisOutfile| |
|
7069 |
||
7070 |
bufferSize := 32*1024. |
|
7071 |
||
7072 |
inStream := infile readStream. |
|
7073 |
||
7074 |
bytesPerSplit := kiloBytes * 1024. |
|
7075 |
||
7076 |
remaining := infile fileSize. |
|
7077 |
splitIndex := 1. |
|
7078 |
[remaining > 0] whileTrue:[ |
|
7079 |
outFile := infile pathName , '_' , (splitIndex printString leftPaddedTo:3 with:$0). |
|
7080 |
outStream := outFile asFilename writeStream. |
|
7081 |
remainingInThisOutfile := remaining min:bytesPerSplit. |
|
7082 |
[remainingInThisOutfile > 0] whileTrue:[ |
|
7083 |
buffer := ByteArray new:bufferSize. |
|
7084 |
n := inStream |
|
7085 |
nextBytes:(bufferSize min:remainingInThisOutfile) |
|
7086 |
into:buffer |
|
7087 |
startingAt:1. |
|
7088 |
outStream nextPutBytes:n from:buffer startingAt:1. |
|
7089 |
remainingInThisOutfile := remainingInThisOutfile - n. |
|
7090 |
remaining := remaining - n. |
|
7091 |
]. |
|
7092 |
outStream close. |
|
7093 |
splitIndex := splitIndex + 1. |
|
7094 |
]. |
|
7095 |
inStream close. |
|
7096 |
! |
|
7097 |
||
7098 |
splitSelectedFiles |
|
6264 | 7099 |
|selectedFiles numFiles msg sizeString kiloBytes| |
4558 | 7100 |
|
7560 | 7101 |
selectedFiles := self currentSelectedObjects. |
4558 | 7102 |
(numFiles := selectedFiles size) == 0 ifTrue:[^ self]. |
7103 |
||
6265 | 7104 |
msg := (numFiles > 1) |
7105 |
ifTrue:'Split each of the %1 files into pieces of size (in kB):' |
|
7106 |
ifFalse:'Split %2 into pieces of size (in kB):'. |
|
4558 | 7107 |
|
6352 | 7108 |
sizeString := Dialog request:(resources stringWithCRs:msg with:numFiles with:selectedFiles first baseName). |
6264 | 7109 |
sizeString isEmptyOrNil ifTrue:[^ self]. |
7110 |
kiloBytes := Integer readFrom:sizeString onError:nil. |
|
4558 | 7111 |
kiloBytes isNil ifTrue:[^ self]. |
7112 |
||
7113 |
selectedFiles do:[:fileName | |
|
7114 |
self notify:('Splitting:', fileName baseName). |
|
7115 |
fileName isDirectory ifFalse:[ |
|
7116 |
self splitFile:fileName intoPiecesOfSize:kiloBytes. |
|
7117 |
] |
|
7118 |
]. |
|
6190 | 7119 |
self notify:nil. |
6265 | 7120 |
|
7560 | 7121 |
"Modified: / 04-12-2006 / 13:15:26 / cg" |
4558 | 7122 |
! |
7123 |
||
4531 | 7124 |
truncateSelectedFilesToZeroSize |
4554 | 7125 |
|selectedFiles numFiles msg| |
4531 | 7126 |
|
7560 | 7127 |
selectedFiles := self currentSelectedObjects. |
4554 | 7128 |
(numFiles := selectedFiles size) == 0 ifTrue:[^ self]. |
7129 |
||
4930 | 7130 |
msg := 'Really truncate file ''%2'' to zero length ?\\WARNING: contents of file is lost !!\This cannot be undone.'. |
4554 | 7131 |
numFiles > 1 ifTrue:[ |
4930 | 7132 |
msg := 'Really truncate %1 files to zero length ?\\WARNING: contents of files is lost !!\This cannot be undone.'. |
4554 | 7133 |
]. |
4531 | 7134 |
|
7135 |
(Dialog |
|
6352 | 7136 |
confirm:(resources stringWithCRs:msg with:numFiles with:selectedFiles first baseName allBold) |
4531 | 7137 |
initialAnswer:false |
7138 |
) ifFalse:[ |
|
7139 |
^ self |
|
7140 |
]. |
|
7141 |
||
7142 |
selectedFiles do:[:fileName | |
|
7143 |
|s| |
|
7144 |
||
7145 |
self notify:('Truncating:', fileName baseName). |
|
7146 |
fileName isDirectory ifFalse:[ |
|
4636
08b2b63e3107
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4629
diff
changeset
|
7147 |
[ |
08b2b63e3107
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4629
diff
changeset
|
7148 |
s := fileName writeStream. |
08b2b63e3107
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4629
diff
changeset
|
7149 |
s close. |
08b2b63e3107
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4629
diff
changeset
|
7150 |
] on:FileStream openErrorSignal do:[:ex| |
4531 | 7151 |
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
|
7152 |
]. |
4531 | 7153 |
] |
7154 |
]. |
|
6190 | 7155 |
self notify:nil. |
7560 | 7156 |
|
7157 |
"Modified: / 04-12-2006 / 13:15:28 / cg" |
|
3892 | 7158 |
! ! |
7159 |
||
4849 | 7160 |
!AbstractFileBrowser methodsFor:'menu queries-cvs'! |
3892 | 7161 |
|
7162 |
canCvsAddAndCommit |
|
7163 |
||
3982 | 7164 |
|selectedFiles| |
7165 |
||
7166 |
selectedFiles := self currentSelectedFiles. |
|
7167 |
^ (selectedFiles notEmpty and:[self currentFilesAreInSameDirectory]). |
|
3892 | 7168 |
! |
7169 |
||
7170 |
canRemoveCVSContainer |
|
5356
d08261ab1567
care for nonexisting bookmarks file in open
Claus Gittinger <cg@exept.de>
parents:
5334
diff
changeset
|
7171 |
^ self currentSelectedFiles |
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
7172 |
contains:[:fileName| |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
7173 |
|dirOfFile cvsDir| |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
7174 |
|
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
7175 |
dirOfFile := self getDirWithoutFileName:fileName. |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
7176 |
cvsDir := dirOfFile construct:'CVS'. |
5318 | 7177 |
cvsDir isDirectory |
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
7178 |
]. |
3892 | 7179 |
! ! |
7180 |
||
4849 | 7181 |
!AbstractFileBrowser methodsFor:'menu queries-tools'! |
3892 | 7182 |
|
6521 | 7183 |
anySTFilesOrDirectoriesPresent |
7184 |
^ self anyDirectoriesOrFilesPresentWithSuffix:'st' |
|
7185 |
! |
|
7186 |
||
3892 | 7187 |
anySTFilesPresent |
7188 |
^ self anyFilesPresentWithSuffix:'st' |
|
7189 |
! |
|
7190 |
||
7191 |
canCreateNewProject |
|
7192 |
||
3982 | 7193 |
| selectedFiles | |
3892 | 7194 |
|
7195 |
self currentFilesAreInSameDirectory ifFalse:[^ false]. |
|
3982 | 7196 |
selectedFiles := self currentSelectedFiles. |
3892 | 7197 |
^ [ |
4414 | 7198 |
((selectedFiles detect:[:fileName| | suffix| |
7199 |
suffix := fileName suffix asLowercase. |
|
7200 |
(suffix = 'prj' or:[suffix = 'st']) |
|
7201 |
] ifNone:[nil]) notNil) |
|
3982 | 7202 |
] |
3892 | 7203 |
! |
7204 |
||
7205 |
canDoTerminal |
|
7206 |
||
7207 |
^ OperatingSystem isUNIXlike |
|
7208 |
or:[OperatingSystem isMSWINDOWSlike] |
|
7209 |
! |
|
7210 |
||
7211 |
canDoTerminalAndSystemIsDOS |
|
7212 |
||
7213 |
^ self canDoTerminal and:[OperatingSystem isMSWINDOWSlike] |
|
7214 |
! |
|
7215 |
||
7216 |
canDoTerminalAndSystemIsUnix |
|
7217 |
||
7218 |
^ self canDoTerminal and:[OperatingSystem isUNIXlike] |
|
7219 |
! |
|
7220 |
||
8640
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
7221 |
canGenerateSignatureFiles |
8645
00e4d07c6d6d
Generate signed expecco patch files
Stefan Vogel <sv@exept.de>
parents:
8641
diff
changeset
|
7222 |
"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
|
7223 |
|
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
7224 |
Expecco::KeyFileGenerator isNil ifTrue:[ ^ false ]. |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
7225 |
Expecco::KeyFile isNil ifTrue:[ ^ false ]. |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
7226 |
|
8645
00e4d07c6d6d
Generate signed expecco patch files
Stefan Vogel <sv@exept.de>
parents:
8641
diff
changeset
|
7227 |
^ self currentSelectedFiles notEmptyOrNil |
8640
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
7228 |
! |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
7229 |
|
3892 | 7230 |
canReadAbbrevFile |
7231 |
||
5960 | 7232 |
|currentDirectory| |
3892 | 7233 |
|
7234 |
self currentFilesAreInSameDirectory ifFalse:[^ false]. |
|
5960 | 7235 |
currentDirectory := self currentDirectory. |
7236 |
^ currentDirectory notNil |
|
7237 |
and:[ (currentDirectory construct:'abbrev.stc') exists ] |
|
3892 | 7238 |
! |
7239 |
||
7240 |
canRemoveFromSourcePath |
|
7241 |
||
7242 |
^ false |
|
7243 |
! |
|
7244 |
||
7245 |
hasASN1 |
|
7246 |
^ [ OSI::ASN1Parser notNil |
|
4414 | 7247 |
and:[OSI::ASN1Parser isLoaded]] |
3892 | 7248 |
|
7249 |
! |
|
7250 |
||
7251 |
hasASN1AndSelection |
|
7252 |
^ [ self hasSelection value |
|
4414 | 7253 |
and:[self currentSelectedFiles size > 0 |
7254 |
and:[OSI::ASN1Parser notNil |
|
7255 |
and:[OSI::ASN1Parser isLoaded]]]] |
|
3892 | 7256 |
! |
7257 |
||
7258 |
hasCBrowser |
|
7259 |
^ [ CBrowser::Browser notNil ] |
|
7260 |
! |
|
7261 |
||
7262 |
hasJava |
|
7263 |
||
7264 |
^ [ JavaClassReader notNil |
|
4414 | 7265 |
and:[JavaClassReader isLoaded]] |
3892 | 7266 |
! |
7267 |
||
7268 |
hasJavaAndSelection |
|
7269 |
||
3982 | 7270 |
^ [ self currentSelectedFiles size > 0 |
4414 | 7271 |
and:[JavaClassReader notNil |
7272 |
and:[JavaClassReader isLoaded]]] |
|
3892 | 7273 |
! |
7274 |
||
7275 |
hasMP3Player |
|
7276 |
||
7277 |
^ [ MP3PlayerApplication notNil |
|
4414 | 7278 |
or:[SaugFix::MP3PlayerApplication notNil ]] |
3892 | 7279 |
! |
7280 |
||
7281 |
hasMP3PlayerAndSelection |
|
7282 |
||
3982 | 7283 |
^ [ self currentSelectedFiles size > 0 |
4414 | 7284 |
and:[ self hasMP3Player value]] |
3892 | 7285 |
! |
7286 |
||
8426 | 7287 |
hasResourceFileSelected |
7288 |
||
7289 |
^ [ |
|
7290 |
|sel| |
|
7291 |
||
7292 |
sel := self currentSelectedFiles. |
|
7293 |
sel notEmptyOrNil ifTrue:[ |
|
7294 |
sel conform:[:fn | fn suffix asLowercase = 'rs']. |
|
7295 |
] ifFalse:[ |
|
7296 |
false |
|
7297 |
] |
|
7298 |
] |
|
7299 |
! |
|
7300 |
||
3892 | 7301 |
hasSlideShow |
7302 |
||
7303 |
^ [CodingExamples_GUI::SlideShow notNil] |
|
7304 |
! |
|
7305 |
||
7306 |
hasSnapshotSelection |
|
7307 |
||
7308 |
^ [ |
|
4414 | 7309 |
| files | |
8426 | 7310 |
|
4414 | 7311 |
files := self currentSelectedFiles. |
7312 |
((files size == 1) |
|
7313 |
and:[ files first hasSuffix:'img' ]) |
|
3892 | 7314 |
] |
7315 |
! |
|
7316 |
||
7869 | 7317 |
hasXml |
9206 | 7318 |
^ [ XML::XMLParser notNil ] |
7869 | 7319 |
! |
7320 |
||
7321 |
hasXmlFileSelected |
|
8611
3d979ab577b7
xml-inspector always enabled.
Claus Gittinger <cg@exept.de>
parents:
8601
diff
changeset
|
7322 |
"/ 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
|
7323 |
"/ then handle the error when it ever fails during xml-parsing. |
7869 | 7324 |
|
8426 | 7325 |
^ [ |
7326 |
|sel fileName| |
|
7869 | 7327 |
|
7328 |
sel := self currentSelectedFiles. |
|
7329 |
sel size == 1 ifTrue:[ |
|
7330 |
fileName := sel first. |
|
7331 |
fileName notNil ifTrue:[ |
|
8611
3d979ab577b7
xml-inspector always enabled.
Claus Gittinger <cg@exept.de>
parents:
8601
diff
changeset
|
7332 |
#('xml' 'vdx') includes:fileName suffix asLowercase |
7869 | 7333 |
] ifFalse:[ |
7334 |
false |
|
7335 |
] |
|
7336 |
] ifFalse:[ |
|
7337 |
false |
|
7338 |
] |
|
7339 |
] |
|
7340 |
! |
|
7341 |
||
3892 | 7342 |
hasZipFileSelected |
7343 |
||
3982 | 7344 |
^ [|sel fileName fn suff| |
7345 |
||
4414 | 7346 |
sel := self currentSelectedFiles. |
7347 |
sel size == 1 ifTrue:[ |
|
7348 |
fileName := sel first. |
|
7349 |
fileName notNil ifTrue:[ |
|
7350 |
suff := fileName suffix asLowercase. |
|
7351 |
suff = 'zip' or:[suff = 'jar'] |
|
7352 |
] ifFalse:[ |
|
7353 |
false |
|
7354 |
] |
|
7355 |
] ifFalse:[ |
|
7356 |
false |
|
7357 |
] |
|
3892 | 7358 |
] |
7359 |
! |
|
7360 |
||
7361 |
javaSupportLoaded |
|
7362 |
||
7363 |
^ false |
|
7364 |
! ! |
|
7365 |
||
3906 | 7366 |
!AbstractFileBrowser methodsFor:'presentation'! |
7367 |
||
7368 |
getModeString:modeBits |
|
7369 |
"convert file-mode bits into a more user-friendly string. |
|
7370 |
This is wrong here - should be moved into OperatingSystem." |
|
7371 |
||
7372 |
^ self getModeString:modeBits |
|
4414 | 7373 |
with:#( 'owner:' $r $w $x |
7374 |
' group:' $r $w $x |
|
7375 |
' others:' $r $w $x ) |
|
3906 | 7376 |
! |
7377 |
||
7378 |
getModeString:modeBits with:texts |
|
7379 |
"convert file-mode bits into a more user-friendly string. |
|
7380 |
This is wrong here - should be moved into OperatingSystem." |
|
7381 |
||
7382 |
|bits modeString| |
|
7383 |
||
7384 |
bits := modeBits bitAnd:8r777. |
|
7385 |
modeString := ''. |
|
7386 |
||
7387 |
#( nil 8r400 8r200 8r100 nil 8r040 8r020 8r010 nil 8r004 8r002 8r001 ) |
|
7388 |
with: texts do:[:bitMask :access | |
|
4414 | 7389 |
|ch| |
7390 |
||
7391 |
bitMask isNil ifTrue:[ |
|
7392 |
modeString := modeString , access |
|
7393 |
] ifFalse:[ |
|
7394 |
(bits bitAnd:bitMask) == 0 ifTrue:[ |
|
7395 |
ch := $- |
|
7396 |
] ifFalse:[ |
|
7397 |
ch := access |
|
7398 |
]. |
|
7399 |
modeString := modeString copyWith:ch |
|
7400 |
] |
|
3906 | 7401 |
]. |
7402 |
^ modeString |
|
7403 |
! ! |
|
7404 |
||
5880 | 7405 |
!AbstractFileBrowser methodsFor:'private'! |
7406 |
||
7407 |
theSingleSelectedDirectoryOrHomeDir |
|
7408 |
|dir| |
|
7409 |
||
5888 | 7410 |
dir := self theSingleSelectedDirectoryOrNil. |
5880 | 7411 |
dir isNil ifTrue:[ dir := Filename homeDirectory]. |
7412 |
^ dir. |
|
7413 |
! |
|
7414 |
||
7415 |
theSingleSelectedDirectoryOrNil |
|
7416 |
|dirs| |
|
7417 |
||
7418 |
dirs := self currentSelectedDirectories. |
|
7419 |
dirs size ~= 1 ifTrue:[ ^ nil]. |
|
7420 |
^ dirs anElement. |
|
7421 |
! ! |
|
7422 |
||
3892 | 7423 |
!AbstractFileBrowser methodsFor:'queries'! |
7424 |
||
8256 | 7425 |
cBrowserLoaded |
7426 |
^ CBrowser::Browser notNil |
|
7427 |
! |
|
7428 |
||
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
7429 |
getAllFilesAsStrings |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
7430 |
"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
|
7431 |
|
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
7432 |
^ self subclassResponsibility |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
7433 |
! |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
7434 |
|
3906 | 7435 |
getFileInfoStringForFirstSelectedFile:longInfo |
7436 |
"get stat info on selected file - return a string which can be |
|
7437 |
shown in a box" |
|
7438 |
||
5973
0baf6c6b685f
#linkInfo now returns the info also for files that are not a symlink
Stefan Vogel <sv@exept.de>
parents:
5971
diff
changeset
|
7439 |
|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
|
7440 |
sizeString fileSize tAccess tModification buffer| |
3906 | 7441 |
|
7560 | 7442 |
selFiles := self currentSelectedObjects. |
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
7443 |
selFiles size ~~ 1 ifTrue:[ ^ nil]. |
3906 | 7444 |
filename := selFiles first. |
7445 |
||
8364 | 7446 |
info := filename linkInfo. |
9111
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
7447 |
info isNil ifTrue:[ |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
7448 |
^ 'Cannot get fileInfo'. |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
7449 |
^ nil |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
7450 |
]. |
8364 | 7451 |
|
5755
5e8165d55605
replaced '' writeStream by String writeStream
Claus Gittinger <cg@exept.de>
parents:
5753
diff
changeset
|
7452 |
buffer := Text writeStream. |
4765 | 7453 |
|
7454 |
buffer |
|
7455 |
nextPutAll:'filename: '; |
|
7456 |
nextPutLine:filename asString. |
|
7457 |
||
8364 | 7458 |
OperatingSystem isMSDOSlike ifTrue: [ |
7459 |
(info alternativeName notNil |
|
7460 |
and:[ info alternativeName ~= info fullName ]) ifTrue:[ |
|
7461 |
buffer nextPutAll:'shortname: '. |
|
7462 |
buffer nextPutLine:info alternativeName. |
|
7463 |
] |
|
7464 |
]. |
|
7465 |
||
5360
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
7466 |
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
|
7467 |
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
|
7468 |
filename exists ifFalse:[ |
5360
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
7469 |
buffer nextPutAll:'broken '. |
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
7470 |
]. |
4765 | 7471 |
buffer |
7472 |
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
|
7473 |
nextPutLine:(info path ? '???'). |
3906 | 7474 |
] 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
|
7475 |
(longInfo and:[info isRegular]) ifTrue:[ |
5360
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
7476 |
fileOutput := filename fileType. |
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
7477 |
]. |
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
7478 |
|
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
7479 |
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
|
7480 |
s := info type asString |
5360
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
7481 |
] ifFalse:[ |
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
7482 |
s := 'regular (' , fileOutput , ')' |
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
7483 |
]. |
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
7484 |
buffer nextPutLine:s. |
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
7485 |
]. |
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
7486 |
|
4707
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
7487 |
fileSize := info fileSize. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
7488 |
sizeString := 'size: ', fileSize printString. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
7489 |
longInfo ifTrue:[ |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
7490 |
fileSize > 1024 ifTrue:[ |
8172 | 7491 |
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
|
7492 |
]. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
7493 |
]. |
4765 | 7494 |
buffer nextPutLine:sizeString. |
3906 | 7495 |
|
7496 |
modeBits := info mode. |
|
7497 |
modeString := self getModeString:modeBits. |
|
4765 | 7498 |
|
7499 |
buffer nextPutAll:'access: '; nextPutAll:modeString. |
|
3906 | 7500 |
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
|
7501 |
buffer nextPutAll:' ('; nextPutAll:(modeBits printStringRadix:8); nextPut:$). |
3906 | 7502 |
]. |
4765 | 7503 |
buffer |
7504 |
cr; |
|
7505 |
nextPutAll:'owner: '; |
|
7506 |
nextPutLine:(OperatingSystem getUserNameFromID:(info uid)). |
|
7507 |
||
3906 | 7508 |
longInfo ifTrue:[ |
4765 | 7509 |
buffer |
7510 |
nextPutAll:'group: '; |
|
7511 |
nextPutLine:(OperatingSystem getGroupNameFromID:(info gid)). |
|
7512 |
||
7513 |
tAccess := info accessTime. |
|
7514 |
buffer |
|
7515 |
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
|
7516 |
nextPutAll:tAccess asDate printString; |
4765 | 7517 |
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
|
7518 |
nextPutLine:tAccess asTime printString. |
4765 | 7519 |
|
7520 |
tModification := info modificationTime. |
|
7521 |
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
|
7522 |
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
|
7523 |
nextPutAll:tModification asDate printString; |
4765 | 7524 |
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
|
7525 |
nextPutLine:tModification asTime printString. |
3906 | 7526 |
]. |
4765 | 7527 |
^ buffer contents |
7560 | 7528 |
|
7633
0a85c590f98f
ignore nil-return from get link name (for broken links)
Claus Gittinger <cg@exept.de>
parents:
7585
diff
changeset
|
7529 |
"Modified: / 07-02-2007 / 10:38:14 / cg" |
3906 | 7530 |
! |
7531 |
||
8510 | 7532 |
hasImageColorHistogram |
7533 |
^ ImageColorHistogram notNil |
|
7534 |
! |
|
7535 |
||
3892 | 7536 |
initialCommandFor:fileName into:aBox |
7537 |
"set a useful initial command for execute box." |
|
7538 |
||
4496
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
7539 |
self class initialCommandFor:fileName in:Filename currentDirectory intoBox:aBox |
3892 | 7540 |
! |
7541 |
||
7542 |
isAbstractFileBrowser |
|
7543 |
||
7544 |
^ true |
|
7545 |
! |
|
7546 |
||
7547 |
systemIsDOS |
|
7548 |
||
7549 |
^ OperatingSystem isMSDOSlike |
|
7550 |
! |
|
7551 |
||
7552 |
systemIsUnix |
|
7553 |
^ OperatingSystem isUNIXlike |
|
7554 |
! ! |
|
7555 |
||
7556 |
!AbstractFileBrowser methodsFor:'queries-file'! |
|
7557 |
||
7558 |
allItemsOfCurrentDirectory |
|
5009 | 7559 |
self |
4774 | 7560 |
applicationNamed:#DirectoryContentsBrowser |
5009 | 7561 |
ifPresentDo:[:app | ^ app allItemsOfCurrentDirectory]. |
7562 |
||
7563 |
^ nil |
|
3892 | 7564 |
! |
7565 |
||
7566 |
anyFilesPresentWithSuffix:suffix |
|
6725 | 7567 |
self currentSelectedDirectories do:[:dir| |
4636
08b2b63e3107
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4629
diff
changeset
|
7568 |
[ |
5810
4661bf4c3bbf
openErrorSignal arg: always a string
Claus Gittinger <cg@exept.de>
parents:
5789
diff
changeset
|
7569 |
(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
|
7570 |
] on:FileStream openErrorSignal do:[:ex|]. |
3892 | 7571 |
]. |
7572 |
^ false. |
|
7573 |
! |
|
7574 |
||
4771
9290fdb65a5d
#getCommonForCurrentFiles renamed to #commonPrefixOfSelectedFiles
Claus Gittinger <cg@exept.de>
parents:
4769
diff
changeset
|
7575 |
commonPrefixOfSelectedFiles |
4773 | 7576 |
|selFiles stringCol firstPre| |
4771
9290fdb65a5d
#getCommonForCurrentFiles renamed to #commonPrefixOfSelectedFiles
Claus Gittinger <cg@exept.de>
parents:
4769
diff
changeset
|
7577 |
|
7560 | 7578 |
selFiles := self currentSelectedObjects. |
4771
9290fdb65a5d
#getCommonForCurrentFiles renamed to #commonPrefixOfSelectedFiles
Claus Gittinger <cg@exept.de>
parents:
4769
diff
changeset
|
7579 |
selFiles isEmpty ifTrue:[^ nil]. |
9290fdb65a5d
#getCommonForCurrentFiles renamed to #commonPrefixOfSelectedFiles
Claus Gittinger <cg@exept.de>
parents:
4769
diff
changeset
|
7580 |
|
4772 | 7581 |
stringCol := selFiles collect:[:file | file asString]. |
4773 | 7582 |
firstPre := stringCol at:1. |
4771
9290fdb65a5d
#getCommonForCurrentFiles renamed to #commonPrefixOfSelectedFiles
Claus Gittinger <cg@exept.de>
parents:
4769
diff
changeset
|
7583 |
stringCol from:2 do:[:el| |
4773 | 7584 |
firstPre := firstPre commonPrefixWith:el. |
4771
9290fdb65a5d
#getCommonForCurrentFiles renamed to #commonPrefixOfSelectedFiles
Claus Gittinger <cg@exept.de>
parents:
4769
diff
changeset
|
7585 |
]. |
4773 | 7586 |
^ firstPre asFilename |
7560 | 7587 |
|
7588 |
"Modified: / 04-12-2006 / 13:14:25 / cg" |
|
4771
9290fdb65a5d
#getCommonForCurrentFiles renamed to #commonPrefixOfSelectedFiles
Claus Gittinger <cg@exept.de>
parents:
4769
diff
changeset
|
7589 |
! |
9290fdb65a5d
#getCommonForCurrentFiles renamed to #commonPrefixOfSelectedFiles
Claus Gittinger <cg@exept.de>
parents:
4769
diff
changeset
|
7590 |
|
3892 | 7591 |
currentFilesAreInSameDirectory |
7592 |
||
4881
e6fc72aac6e6
multiple select allowed in DirectoryTreeBrowser some changes in DirectoryContentsBrowser
penk
parents:
4880
diff
changeset
|
7593 |
^ self parentDirectoriesOfCurrentFiles size < 2 |
3892 | 7594 |
! |
7595 |
||
7596 |
currentFilesHasDirectories |
|
7597 |
||
6725 | 7598 |
^ self currentSelectedDirectories notEmpty. |
3892 | 7599 |
! |
7600 |
||
3982 | 7601 |
directoriesForFiles:aFileCol |
7602 |
||
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
7603 |
^ (aFileCol collect:[:file| self getDirWithoutFileName:file]) asSet. |
3982 | 7604 |
! |
7605 |
||
3892 | 7606 |
fileListIsEmpty |
5009 | 7607 |
self |
7608 |
applicationNamed:#DirectoryContentsBrowser |
|
7609 |
ifPresentDo:[:appl | ^ appl fileListIsEmpty]. |
|
7610 |
||
7611 |
^ nil. |
|
3892 | 7612 |
! |
7613 |
||
7614 |
fileListIsNotEmpty |
|
7615 |
||
7616 |
^ self fileListIsEmpty not. |
|
7617 |
! |
|
7618 |
||
7619 |
fileName:aFilename1 startsWith:aFilename2 |
|
6284 | 7620 |
" check if aFilename2 is a prefix of aFilename1" |
3892 | 7621 |
|
7622 |
| file1 file2 | |
|
7623 |
||
6284 | 7624 |
(aFilename2 isNil or:[aFilename1 isNil]) ifTrue:[ ^ false]. |
3892 | 7625 |
file1 := aFilename1 asFilename. |
7626 |
file2 := aFilename2 asFilename. |
|
6284 | 7627 |
|
3892 | 7628 |
file2 isRootDirectory ifTrue:[ ^ true]. |
6284 | 7629 |
|
3892 | 7630 |
((file1 isDirectory) |
7631 |
and:[(file2 isDirectory) |
|
7632 |
and:[file1 directory = file2 directory]]) ifTrue:[ |
|
4414 | 7633 |
^ file1 baseName = file2 baseName |
3892 | 7634 |
]. |
3982 | 7635 |
^ (file1 pathName) startsWith:(file2 pathName) |
3892 | 7636 |
! |
7637 |
||
7638 |
getAllFilesAsStringCollection |
|
5009 | 7639 |
self |
7640 |
applicationNamed:#DirectoryContentsBrowser |
|
7641 |
ifPresentDo:[:appl | ^ appl getAllFilesAsStringCollection]. |
|
7642 |
||
7643 |
^ nil |
|
3892 | 7644 |
! |
7645 |
||
7646 |
getBestDirectory |
|
7647 |
||
7648 |
|selFiles stringCol firstPre| |
|
7649 |
||
6725 | 7650 |
selFiles := self currentSelectedDirectories. |
3892 | 7651 |
selFiles isEmpty ifTrue:[^ nil]. |
7652 |
selFiles size == 1 ifTrue:[^ selFiles first]. |
|
4486 | 7653 |
stringCol := (selFiles collect:[:file| file asString]) asOrderedCollection. |
3892 | 7654 |
firstPre := stringCol at:1. |
7655 |
stringCol from:2 do:[:el| |
|
4414 | 7656 |
firstPre := firstPre commonPrefixWith:el. |
3892 | 7657 |
]. |
7658 |
(firstPre endsWith:(OperatingSystem fileSeparator)) ifTrue:[ |
|
4414 | 7659 |
firstPre removeLast. |
3892 | 7660 |
]. |
7661 |
^ firstPre asFilename |
|
7662 |
! |
|
7663 |
||
7664 |
getDirWithoutFileName:aFileName |
|
7665 |
||
7666 |
| dir | |
|
7667 |
aFileName isNil ifTrue:[ |
|
4414 | 7668 |
^ aFileName. |
3892 | 7669 |
]. |
7670 |
dir := aFileName asFilename. |
|
7671 |
dir isDirectory ifFalse:[ |
|
4414 | 7672 |
dir := dir directory. |
3892 | 7673 |
]. |
7674 |
^ dir. |
|
7675 |
! |
|
7676 |
||
7677 |
getInfoItem |
|
7678 |
"get filename of a description-file (.dir.info, README etc.); |
|
7679 |
This file is automatically shown when a directory is enterred. |
|
7680 |
You can add more names below if you like." |
|
7681 |
||
5880 | 7682 |
|dir| |
7683 |
||
7684 |
dir := self theSingleSelectedDirectoryOrNil. |
|
7685 |
dir isNil ifTrue:[ ^ nil]. |
|
3892 | 7686 |
|
7687 |
#( |
|
7688 |
'.dir.info' |
|
7689 |
'README' |
|
7690 |
'ReadMe' |
|
7691 |
'Readme' |
|
7692 |
'readme' |
|
7693 |
'read.me' |
|
7694 |
'Read.me' |
|
7695 |
'READ.ME' |
|
7696 |
'README.TXT' |
|
7697 |
'readme.txt' |
|
7698 |
'Readme.txt' |
|
7699 |
'Info.txt' |
|
7700 |
'info.txt' |
|
7701 |
'INFO.TXT' |
|
7702 |
) do:[:f | |
|
5883 | 7703 |
|n| |
4414 | 7704 |
|
5880 | 7705 |
n := dir construct:f. |
4414 | 7706 |
(n isReadable and:[n isDirectory not]) ifTrue:[ |
7707 |
^ DirectoryContentsBrowser itemClass fileName:n |
|
7708 |
] |
|
3892 | 7709 |
]. |
7710 |
^ nil |
|
4881
e6fc72aac6e6
multiple select allowed in DirectoryTreeBrowser some changes in DirectoryContentsBrowser
penk
parents:
4880
diff
changeset
|
7711 |
! |
e6fc72aac6e6
multiple select allowed in DirectoryTreeBrowser some changes in DirectoryContentsBrowser
penk
parents:
4880
diff
changeset
|
7712 |
|
e6fc72aac6e6
multiple select allowed in DirectoryTreeBrowser some changes in DirectoryContentsBrowser
penk
parents:
4880
diff
changeset
|
7713 |
parentDirectoriesOfCurrentFiles |
e6fc72aac6e6
multiple select allowed in DirectoryTreeBrowser some changes in DirectoryContentsBrowser
penk
parents:
4880
diff
changeset
|
7714 |
|
8251
9fd0533be7d9
changed #parentDirectoriesOfCurrentFiles
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
7715 |
^ (self currentSelectedObjects |
8253 | 7716 |
collect:[:file | file directory]) asSet |
7560 | 7717 |
|
7718 |
"Modified: / 04-12-2006 / 13:15:21 / cg" |
|
6521 | 7719 |
! |
7720 |
||
7721 |
recursiveAnyFilesPresentWithSuffix:suffix |
|
6652 | 7722 |
^ true. "/ the code below is too slow for a menu enabling operation |
7723 |
||
7724 |
"/ |directories| |
|
7725 |
"/ |
|
7726 |
"/ directories := self currentDirectories value. |
|
7727 |
"/ directories do:[:dir| |
|
7728 |
"/ [ |
|
7729 |
"/ dir recursiveDirectoryContentsDo:[:f | |
|
7730 |
"/ (f asFilename suffix = suffix) ifTrue:[ ^ true] |
|
7731 |
"/ ] |
|
7732 |
"/ ] on:FileStream openErrorSignal do:[:ex|]. |
|
7733 |
"/ ]. |
|
7734 |
"/ ^ false. |
|
6586 | 7735 |
! |
7736 |
||
7737 |
recursiveAnySTFilesPresent |
|
7738 |
^ self recursiveAnyFilesPresentWithSuffix:'st' |
|
3982 | 7739 |
! ! |
7740 |
||
7741 |
!AbstractFileBrowser methodsFor:'selection'! |
|
7742 |
||
7743 |
currentSelectedDirectories |
|
6725 | 7744 |
^ self currentDirectoriesValue. |
3982 | 7745 |
! |
7746 |
||
7747 |
currentSelectedFiles |
|
7560 | 7748 |
^ self currentSelectedObjects select:[:file | file isDirectory not]. |
7749 |
||
7750 |
"Modified: / 04-12-2006 / 13:14:39 / cg" |
|
3982 | 7751 |
! |
7752 |
||
6460 | 7753 |
currentSelectedObjects |
7754 |
^ self currentFileNameHolder value |
|
7755 |
! |
|
7756 |
||
3982 | 7757 |
firstSelectedFile |
7560 | 7758 |
^ self currentSelectedObjects |
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
7759 |
detect:[:file | file asFilename isDirectory not] |
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
7760 |
ifNone:[]. |
7560 | 7761 |
|
7762 |
"Modified: / 04-12-2006 / 13:14:50 / cg" |
|
4414 | 7763 |
! |
7764 |
||
9490 | 7765 |
hasOnlyDirectoriesSelected |
7766 |
^ self currentSelectedObjects conform:[:file | file isDirectory]. |
|
7767 |
||
7768 |
"Created: / 20-05-2010 / 10:45:03 / cg" |
|
7769 |
! |
|
7770 |
||
4414 | 7771 |
hasOnlyFilesSelected |
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
7772 |
|
7560 | 7773 |
^ self currentSelectedObjects conform:[:file | file isDirectory not]. |
7774 |
||
7775 |
"Modified: / 04-12-2006 / 13:15:01 / cg" |
|
4414 | 7776 |
! |
7777 |
||
9490 | 7778 |
hasTwoDirectoriesSelected |
7779 |
||
7780 |
^ self currentSelectedObjects size == 2 |
|
7781 |
and:[self hasOnlyDirectoriesSelected] |
|
7782 |
||
7783 |
"Created: / 20-05-2010 / 10:45:18 / cg" |
|
7784 |
! |
|
7785 |
||
4414 | 7786 |
hasTwoFilesSelected |
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
7787 |
|
7560 | 7788 |
^ self currentSelectedObjects size == 2 |
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
7789 |
and:[self hasOnlyFilesSelected] |
7560 | 7790 |
|
7791 |
"Modified: / 04-12-2006 / 13:15:04 / cg" |
|
3892 | 7792 |
! ! |
7793 |
||
3964 | 7794 |
!AbstractFileBrowser methodsFor:'sorting'! |
7795 |
||
3989 | 7796 |
currentSortOrder |
4027 | 7797 |
^ self aspectFor:#currentSortOrder ifAbsent:[ Dictionary new asValue ]. |
3989 | 7798 |
! |
7799 |
||
7800 |
sortBlockHolder |
|
7801 |
^ self aspectFor:#sortBlockHolder ifAbsent:[ |
|
5383 | 7802 |
(FileSorter directoriesBeforeFiles:(self sortDirectoriesBeforeFiles value and:[self viewDirsInContentsBrowser value]) |
7803 |
selector:#fileName |
|
7804 |
sortCaseless:self sortCaseless value |
|
7805 |
sortReverse:false) asValue. |
|
3989 | 7806 |
]. |
7807 |
! |
|
7808 |
||
7809 |
sortBlockProperty |
|
6785
cac8107d889c
clear reverseSort flag, when sort-order is changed via menu.
Claus Gittinger <cg@exept.de>
parents:
6767
diff
changeset
|
7810 |
|v| |
4027 | 7811 |
|
6785
cac8107d889c
clear reverseSort flag, when sort-order is changed via menu.
Claus Gittinger <cg@exept.de>
parents:
6767
diff
changeset
|
7812 |
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
|
7813 |
v addDependent:self. |
cac8107d889c
clear reverseSort flag, when sort-order is changed via menu.
Claus Gittinger <cg@exept.de>
parents:
6767
diff
changeset
|
7814 |
^ v. |
3989 | 7815 |
! |
7816 |
||
7817 |
sortCaseless |
|
4201 | 7818 |
" aspect for sort caseless " |
3989 | 7819 |
|
7820 |
^ self aspectFor:#sortCaseless ifAbsent:[ |
|
9393 | 7821 |
(Filename isCaseSensitive not) asValue. |
7822 |
] |
|
3989 | 7823 |
! |
7824 |
||
4074 | 7825 |
sortDirectoriesBeforeFiles |
7826 |
||
4201 | 7827 |
" aspect for sort directories always before files" |
4074 | 7828 |
^ self aspectFor:#sortDirectoriesBeforeFiles ifAbsent:[ true asValue ]. |
7829 |
! |
|
7830 |
||
3989 | 7831 |
sortFileListsBy:instanceName |
7832 |
||
7833 |
self sortFileListsBy:instanceName withReverse:true |
|
7834 |
! |
|
7835 |
||
7836 |
sortFileListsBy:instanceName withReverse:aBoolean |
|
8994
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
7837 |
| aSymbol sortCaselessLocal currentSortOrder sorter isReverse| |
3964 | 7838 |
|
7839 |
aSymbol := instanceName asSymbol. |
|
4027 | 7840 |
self sortBlockProperty setValue:instanceName asSymbol. |
4151 | 7841 |
sortCaselessLocal := self sortCaseless value. |
4027 | 7842 |
currentSortOrder := self currentSortOrder value. |
7841
ea9a45f1cd5e
oops - repair bad currentSorter
Claus Gittinger <cg@exept.de>
parents:
7829
diff
changeset
|
7843 |
currentSortOrder isEmptyOrNil ifTrue:[ |
ea9a45f1cd5e
oops - repair bad currentSorter
Claus Gittinger <cg@exept.de>
parents:
7829
diff
changeset
|
7844 |
self currentSortOrder value:(currentSortOrder := Dictionary new). |
4343 | 7845 |
currentSortOrder at:#column put:aSymbol. |
7846 |
currentSortOrder at:#reverse put:false. |
|
7847 |
currentSortOrder at:#sortCaseless put:sortCaselessLocal. |
|
3964 | 7848 |
] ifFalse:[ |
4343 | 7849 |
(currentSortOrder at:#sortCaseless) ~= sortCaselessLocal ifTrue:[ |
7850 |
"/ sort caseless changed |
|
7851 |
currentSortOrder at:#sortCaseless put:sortCaselessLocal. |
|
7852 |
] ifFalse:[ |
|
7853 |
(currentSortOrder at:#column) = aSymbol ifTrue:[ |
|
7854 |
"/ same column like before - change sort order ifReverse is true |
|
7855 |
aBoolean ifTrue:[ |
|
7856 |
isReverse := currentSortOrder at:#reverse. |
|
7857 |
currentSortOrder at:#reverse put:(isReverse not). |
|
7858 |
]. |
|
7859 |
] ifFalse:[ |
|
7860 |
"/ another column - remark column |
|
7861 |
currentSortOrder at:#column put:aSymbol. |
|
7862 |
] |
|
7863 |
] |
|
3964 | 7864 |
]. |
4027 | 7865 |
self currentSortOrder changed. |
9111
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
7866 |
|
5383 | 7867 |
sorter := FileSorter directoriesBeforeFiles:(self sortDirectoriesBeforeFiles value and:[self viewDirsInContentsBrowser value]) |
7868 |
selector:instanceName |
|
7869 |
sortCaseless:sortCaselessLocal |
|
7870 |
sortReverse:(currentSortOrder at:#reverse). |
|
7871 |
self sortBlockHolder value:sorter. |
|
7841
ea9a45f1cd5e
oops - repair bad currentSorter
Claus Gittinger <cg@exept.de>
parents:
7829
diff
changeset
|
7872 |
|
ea9a45f1cd5e
oops - repair bad currentSorter
Claus Gittinger <cg@exept.de>
parents:
7829
diff
changeset
|
7873 |
"Modified: / 18-09-2007 / 09:42:47 / cg" |
3964 | 7874 |
! ! |
7875 |
||
3892 | 7876 |
!AbstractFileBrowser methodsFor:'startup & release'! |
7877 |
||
7878 |
makeDependent |
|
4074 | 7879 |
self filterModel addDependent:self. |
4004 | 7880 |
self currentFileNameHolder addDependent:self. |
4074 | 7881 |
self sortDirectoriesBeforeFiles addDependent:self. |
4004 | 7882 |
self sortCaseless addDependent:self. |
4011 | 7883 |
self showHiddenFiles addDependent:self. |
4368
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
7884 |
self rootHolder addDependent:self. |
3892 | 7885 |
! |
7886 |
||
7887 |
masterApplication:anApplication |
|
7888 |
||
7889 |
masterApplication isNil ifTrue:[ |
|
4414 | 7890 |
(anApplication notNil and:[anApplication askFor:#isAbstractFileBrowser]) ifTrue:[ |
7891 |
aspects := anApplication aspects |
|
7892 |
] ifFalse:[ |
|
7893 |
aspects isNil ifTrue:[ |
|
7894 |
aspects := IdentityDictionary new. |
|
7895 |
aspects at:#applications put:(IdentityDictionary new). |
|
7896 |
] |
|
7897 |
]. |
|
7898 |
self applications at:(self className) put:self. |
|
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
7899 |
"/ self makeDependent. |
3892 | 7900 |
]. |
3952 | 7901 |
^ super masterApplication:anApplication. |
3892 | 7902 |
! |
7903 |
||
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
7904 |
postBuildWith:aBuilder |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
7905 |
self makeDependent. |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
7906 |
super postBuildWith:aBuilder. |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
7907 |
! |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
7908 |
|
3892 | 7909 |
postOpenWith:aBuilder |
7910 |
||
7911 |
super postOpenWith:aBuilder. |
|
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
7912 |
self windowGroup showWaitCursorWhenBusyForMillis:100. |
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
7913 |
|
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
7914 |
"Modified: / 25-07-2006 / 09:12:45 / cg" |
3892 | 7915 |
! ! |
7916 |
||
7917 |
!AbstractFileBrowser::Clipboard methodsFor:'accessing'! |
|
7918 |
||
7919 |
files |
|
7920 |
"return the value of the instance variable 'files' (automatically generated)" |
|
7921 |
||
7922 |
^ files |
|
7923 |
! |
|
7924 |
||
7925 |
files:something |
|
7926 |
"set the value of the instance variable 'files' (automatically generated)" |
|
7927 |
||
7928 |
files := something. |
|
7929 |
! |
|
7930 |
||
7931 |
method |
|
7932 |
"return the value of the instance variable 'method' (automatically generated)" |
|
7933 |
||
7934 |
^ method |
|
7935 |
! |
|
7936 |
||
7937 |
method:something |
|
7938 |
"set the value of the instance variable 'method' (automatically generated)" |
|
7939 |
||
7940 |
method := something. |
|
7941 |
! ! |
|
7942 |
||
7943 |
!AbstractFileBrowser::CodeExecutionLock methodsFor:'accessing'! |
|
7944 |
||
7945 |
locked |
|
7946 |
"return the value of the instance variable 'locked' (automatically generated)" |
|
7947 |
||
7948 |
locked isNil ifTrue:[ |
|
4414 | 7949 |
locked := false. |
3892 | 7950 |
]. |
7951 |
^ locked |
|
7952 |
! ! |
|
7953 |
||
7954 |
!AbstractFileBrowser::CodeExecutionLock methodsFor:'actions'! |
|
7955 |
||
7956 |
doIfUnLocked:aBlock |
|
7957 |
||
7958 |
self locked ifFalse:[ |
|
4414 | 7959 |
aBlock value. |
3892 | 7960 |
]. |
7961 |
! |
|
7962 |
||
7963 |
doLocked:aBlock |
|
7964 |
||
7965 |
locked := true. |
|
4004 | 7966 |
aBlock ensure:[ |
4414 | 7967 |
locked := false. |
4004 | 7968 |
] |
3892 | 7969 |
! ! |
7970 |
||
3952 | 7971 |
!AbstractFileBrowser::DirectoryHistory class methodsFor:'defaults'! |
7972 |
||
6369 | 7973 |
defaultHistorySize |
7974 |
^ 50 |
|
3892 | 7975 |
! ! |
7976 |
||
6371 | 7977 |
!AbstractFileBrowser::DirectoryHistory class methodsFor:'instance creation'! |
4032 | 7978 |
|
7979 |
new |
|
6371 | 7980 |
^ (super new) initializeHistory. |
6369 | 7981 |
! ! |
7982 |
||
7983 |
!AbstractFileBrowser::DirectoryHistory methodsFor:'accessing'! |
|
7984 |
||
7985 |
historySize |
|
7986 |
historySize isNil ifTrue:[^ self class defaultHistorySize]. |
|
7987 |
^ historySize |
|
7988 |
! |
|
7989 |
||
7990 |
historySize:aNumber |
|
7991 |
historySize := aNumber |
|
4032 | 7992 |
! ! |
7993 |
||
3892 | 7994 |
!AbstractFileBrowser::DirectoryHistory methodsFor:'actions'! |
7995 |
||
3952 | 7996 |
addToHistory:aPath |
7566
3e92cf7a6706
ignore trailing file-separator in history.
Claus Gittinger <cg@exept.de>
parents:
7565
diff
changeset
|
7997 |
| item pathToAdd | |
3e92cf7a6706
ignore trailing file-separator in history.
Claus Gittinger <cg@exept.de>
parents:
7565
diff
changeset
|
7998 |
|
3e92cf7a6706
ignore trailing file-separator in history.
Claus Gittinger <cg@exept.de>
parents:
7565
diff
changeset
|
7999 |
pathToAdd := aPath. |
3e92cf7a6706
ignore trailing file-separator in history.
Claus Gittinger <cg@exept.de>
parents:
7565
diff
changeset
|
8000 |
(pathToAdd endsWith:(Filename separator)) ifTrue:[ |
3e92cf7a6706
ignore trailing file-separator in history.
Claus Gittinger <cg@exept.de>
parents:
7565
diff
changeset
|
8001 |
pathToAdd asFilename isRootDirectory ifFalse:[ |
3e92cf7a6706
ignore trailing file-separator in history.
Claus Gittinger <cg@exept.de>
parents:
7565
diff
changeset
|
8002 |
pathToAdd := pathToAdd copyWithoutLast:(Filename separator asString size). |
3e92cf7a6706
ignore trailing file-separator in history.
Claus Gittinger <cg@exept.de>
parents:
7565
diff
changeset
|
8003 |
] |
3e92cf7a6706
ignore trailing file-separator in history.
Claus Gittinger <cg@exept.de>
parents:
7565
diff
changeset
|
8004 |
]. |
3e92cf7a6706
ignore trailing file-separator in history.
Claus Gittinger <cg@exept.de>
parents:
7565
diff
changeset
|
8005 |
|
3e92cf7a6706
ignore trailing file-separator in history.
Claus Gittinger <cg@exept.de>
parents:
7565
diff
changeset
|
8006 |
item := self getItemFor:pathToAdd. |
3e92cf7a6706
ignore trailing file-separator in history.
Claus Gittinger <cg@exept.de>
parents:
7565
diff
changeset
|
8007 |
self backForwardListAdd:pathToAdd. |
3952 | 8008 |
item isNil ifTrue:[ |
4347 | 8009 |
" not already in history" |
6369 | 8010 |
self size >= self historySize ifTrue:[ |
4347 | 8011 |
self removeLast. |
8012 |
]. |
|
7566
3e92cf7a6706
ignore trailing file-separator in history.
Claus Gittinger <cg@exept.de>
parents:
7565
diff
changeset
|
8013 |
item := DirectoryHistoryItem path:pathToAdd. |
4347 | 8014 |
self addFirst:item |
3952 | 8015 |
] ifFalse:[ |
4347 | 8016 |
"already been there before; move the entry to |
8017 |
the beginning, so it will fall out later." |
|
8018 |
self remove:item. |
|
8019 |
self addFirst:item |
|
3892 | 8020 |
]. |
7566
3e92cf7a6706
ignore trailing file-separator in history.
Claus Gittinger <cg@exept.de>
parents:
7565
diff
changeset
|
8021 |
|
3e92cf7a6706
ignore trailing file-separator in history.
Claus Gittinger <cg@exept.de>
parents:
7565
diff
changeset
|
8022 |
"Modified: / 06-12-2006 / 11:59:50 / cg" |
3952 | 8023 |
! |
8024 |
||
4347 | 8025 |
backForwardListAdd:aPath |
8026 |
|pathIndex| |
|
8027 |
||
8028 |
pathIndex := backForwardList indexOf:aPath. |
|
8029 |
pathIndex == 0 ifTrue:[ |
|
8030 |
" a new path comes in remove forward paths " |
|
8031 |
(backForwardList size) > backForwardIndex ifTrue:[ |
|
8032 |
backForwardList removeFromIndex:(backForwardIndex + 1) toIndex:(backForwardList size). |
|
8033 |
]. |
|
8034 |
] ifFalse:[ |
|
8035 |
backForwardList remove:aPath. |
|
8036 |
pathIndex <= backForwardIndex ifTrue:[ |
|
8037 |
backForwardIndex := backForwardIndex - 1. |
|
8038 |
] |
|
4022 | 8039 |
]. |
4347 | 8040 |
backForwardList add:aPath afterIndex:backForwardIndex. |
8041 |
backForwardIndex := backForwardIndex + 1. |
|
6369 | 8042 |
backForwardIndex > self historySize ifTrue:[ |
4347 | 8043 |
backForwardList removeFirst. |
8044 |
backForwardIndex := backForwardIndex - 1. |
|
3892 | 8045 |
]. |
4347 | 8046 |
! |
8047 |
||
8048 |
goBackward |
|
4288 | 8049 |
"return the first path of the backward list; |
8050 |
remove it from the back list and add it ti the forward list." |
|
4022 | 8051 |
|
4347 | 8052 |
|retPath| |
8053 |
||
8054 |
self canBackward ifTrue:[ |
|
8055 |
retPath := backForwardList at:(backForwardIndex - 1). |
|
8056 |
backForwardIndex := backForwardIndex - 1. |
|
4288 | 8057 |
]. |
4022 | 8058 |
^ retPath. |
8059 |
! |
|
8060 |
||
8061 |
goForward |
|
4288 | 8062 |
"return the first path of the forward list; |
8063 |
remove it from the list." |
|
4022 | 8064 |
|
4347 | 8065 |
|retPath| |
8066 |
||
8067 |
self canForward ifTrue:[ |
|
8068 |
retPath := backForwardList at:backForwardIndex + 1. |
|
8069 |
backForwardIndex := backForwardIndex + 1. |
|
4288 | 8070 |
]. |
4022 | 8071 |
^ retPath. |
8072 |
! |
|
8073 |
||
8074 |
resetForwardBackward |
|
8075 |
||
4347 | 8076 |
self initialize |
4022 | 8077 |
! |
8078 |
||
8079 |
setPosition:aPosition for:aPath |
|
8080 |
||
8081 |
self do:[:item| |
|
4414 | 8082 |
item path = aPath ifTrue:[ |
8083 |
item position:aPosition. |
|
8084 |
] |
|
4022 | 8085 |
]. |
3892 | 8086 |
! ! |
8087 |
||
4870 | 8088 |
!AbstractFileBrowser::DirectoryHistory methodsFor:'initialization'! |
4032 | 8089 |
|
6371 | 8090 |
initializeHistory |
4032 | 8091 |
|
4347 | 8092 |
backForwardList := OrderedCollection new. |
8093 |
self reverseDo:[:el| |
|
8094 |
backForwardList add:el path. |
|
8095 |
]. |
|
8096 |
backForwardIndex := backForwardList size. |
|
4032 | 8097 |
! ! |
8098 |
||
3892 | 8099 |
!AbstractFileBrowser::DirectoryHistory methodsFor:'queries'! |
8100 |
||
4288 | 8101 |
canBackward |
4347 | 8102 |
|
8103 |
^ backForwardIndex > 1 |
|
4288 | 8104 |
! |
8105 |
||
3892 | 8106 |
canForward |
4347 | 8107 |
|
8108 |
^ (backForwardList size >= (backForwardIndex + 1)) |
|
8109 |
! |
|
8110 |
||
8111 |
getBackCollection |
|
8112 |
||
8113 |
| backCol | |
|
8114 |
||
8115 |
backCol := OrderedCollection new. |
|
8116 |
self canBackward ifTrue:[ |
|
8117 |
| tmpCol | |
|
8118 |
tmpCol := backForwardList copyTo:backForwardIndex - 1. |
|
8119 |
tmpCol reverseDo:[ :el| |
|
8120 |
backCol add:el. |
|
8121 |
] |
|
8122 |
]. |
|
8123 |
^ backCol |
|
3952 | 8124 |
! |
8125 |
||
8126 |
getForwardCollection |
|
8127 |
||
4347 | 8128 |
| forwCol | |
8129 |
||
8130 |
forwCol := OrderedCollection new. |
|
8131 |
self canForward ifTrue:[ |
|
8132 |
forwCol := backForwardList copyFrom:(backForwardIndex + 1) |
|
8133 |
]. |
|
8134 |
^ forwCol |
|
3952 | 8135 |
! |
8136 |
||
8137 |
getItemFor:aPath |
|
6627 | 8138 |
^ self detect:[:item| item path = aPath] ifNone:nil. |
8139 |
"/ self do:[:item| item path = aPath ifTrue:[^ item]]. |
|
8140 |
"/ ^ nil. |
|
3952 | 8141 |
! |
8142 |
||
8143 |
getPositionFor:aPath |
|
8144 |
||
8145 |
|item| |
|
8146 |
||
8147 |
item := self getItemFor:aPath. |
|
8148 |
||
8149 |
item notNil ifTrue:[ |
|
4414 | 8150 |
^ item position. |
3952 | 8151 |
]. |
8152 |
^ nil |
|
8153 |
! |
|
8154 |
||
8155 |
includesPath:aPath |
|
6627 | 8156 |
^ self contains:[:item | item path = aPath]. |
8157 |
||
8158 |
"/ self do:[:item| item path = aPath ifTrue:[^ true]]. |
|
8159 |
"/ ^ false. |
|
4347 | 8160 |
! |
8161 |
||
8162 |
nextBackwardItem |
|
8163 |
"return the first path of the backward list" |
|
8164 |
||
8165 |
|retPath| |
|
8166 |
||
8167 |
self canBackward ifTrue:[ |
|
8168 |
retPath := backForwardList at:backForwardIndex. |
|
8169 |
]. |
|
8170 |
^ retPath. |
|
8171 |
! |
|
8172 |
||
8173 |
nextForwardItem |
|
8174 |
"return the first path of the forward list" |
|
8175 |
||
8176 |
|retPath| |
|
8177 |
||
8178 |
self canForward ifTrue:[ |
|
8179 |
retPath := backForwardList at:backForwardIndex + 1. |
|
8180 |
]. |
|
8181 |
^ retPath. |
|
3952 | 8182 |
! ! |
8183 |
||
8184 |
!AbstractFileBrowser::DirectoryHistory::DirectoryHistoryItem class methodsFor:'instance creation'! |
|
8185 |
||
8186 |
path:aPath |
|
8187 |
||
8188 |
^ self new path:aPath |
|
8189 |
! ! |
|
8190 |
||
8191 |
!AbstractFileBrowser::DirectoryHistory::DirectoryHistoryItem methodsFor:'accessing'! |
|
8192 |
||
6433 | 8193 |
asFilename |
8194 |
^ path asFilename |
|
8195 |
! |
|
8196 |
||
3952 | 8197 |
path |
8198 |
"return the value of the instance variable 'path' (automatically generated)" |
|
8199 |
||
8200 |
^ path |
|
8201 |
! |
|
8202 |
||
8203 |
path:something |
|
8204 |
"set the value of the instance variable 'path' (automatically generated)" |
|
8205 |
||
8206 |
path := something. |
|
8207 |
! |
|
8208 |
||
8209 |
position |
|
8210 |
"return the value of the instance variable 'position' (automatically generated)" |
|
8211 |
||
8212 |
^ position |
|
8213 |
! |
|
8214 |
||
8215 |
position:something |
|
8216 |
"set the value of the instance variable 'position' (automatically generated)" |
|
8217 |
||
8218 |
position := something. |
|
8219 |
! |
|
8220 |
||
8221 |
printString |
|
8222 |
||
8223 |
^ self path asString |
|
3892 | 8224 |
! ! |
8225 |
||
4915 | 8226 |
!AbstractFileBrowser::FilenameHistory class methodsFor:'accessing-attributes'! |
3892 | 8227 |
|
4337
f2eed806e854
change first letter uppercase methods on class side to lowercase ones
penk
parents:
4317
diff
changeset
|
8228 |
filenameHistorySize |
3892 | 8229 |
|
8230 |
^ 20 |
|
8231 |
! ! |
|
8232 |
||
8233 |
!AbstractFileBrowser::FilenameHistory methodsFor:'adding & removing'! |
|
8234 |
||
5242
04616d3a672c
history fixed (only kept the oldest items, instead of the newest ones)
Claus Gittinger <cg@exept.de>
parents:
5162
diff
changeset
|
8235 |
add:aFileItem |
04616d3a672c
history fixed (only kept the oldest items, instead of the newest ones)
Claus Gittinger <cg@exept.de>
parents:
5162
diff
changeset
|
8236 |
(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
|
8237 |
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
|
8238 |
]. |
04616d3a672c
history fixed (only kept the oldest items, instead of the newest ones)
Claus Gittinger <cg@exept.de>
parents:
5162
diff
changeset
|
8239 |
self addFirst:aFileItem. |
3892 | 8240 |
! ! |
8241 |
||
8242 |
!AbstractFileBrowser::SaveAspectItem class methodsFor:'instance creation'! |
|
8243 |
||
8244 |
withValue:aValue isHolder:aBoolean |
|
8245 |
||
8246 |
| instance | |
|
8247 |
||
8248 |
instance := self basicNew. |
|
8249 |
instance value:aValue. |
|
8250 |
instance isHolder:aBoolean. |
|
8251 |
^ instance |
|
8252 |
! ! |
|
8253 |
||
8254 |
!AbstractFileBrowser::SaveAspectItem methodsFor:'accessing'! |
|
8255 |
||
8256 |
isHolder |
|
8257 |
"return the value of the instance variable 'isHolder' (automatically generated)" |
|
8258 |
||
8259 |
^ isHolder |
|
8260 |
! |
|
8261 |
||
8262 |
isHolder:something |
|
8263 |
"set the value of the instance variable 'isHolder' (automatically generated)" |
|
8264 |
||
8265 |
isHolder := something. |
|
8266 |
! |
|
8267 |
||
8268 |
value |
|
8269 |
"return the value of the instance variable 'value' (automatically generated)" |
|
8270 |
||
8271 |
^ value |
|
8272 |
! |
|
8273 |
||
8274 |
value:something |
|
8275 |
"set the value of the instance variable 'value' (automatically generated)" |
|
8276 |
||
8277 |
value := something. |
|
8278 |
! ! |
|
8279 |
||
8280 |
!AbstractFileBrowser class methodsFor:'documentation'! |
|
8281 |
||
8282 |
version |
|
9649
ad956ada348e
changed: #currentFileNameHolder
Claus Gittinger <cg@exept.de>
parents:
9607
diff
changeset
|
8283 |
^ '$Header: /cvs/stx/stx/libtool/AbstractFileBrowser.st,v 1.450 2010-11-27 14:43:11 cg Exp $' |
8832 | 8284 |
! |
8285 |
||
8286 |
version_CVS |
|
9649
ad956ada348e
changed: #currentFileNameHolder
Claus Gittinger <cg@exept.de>
parents:
9607
diff
changeset
|
8287 |
^ '$Header: /cvs/stx/stx/libtool/AbstractFileBrowser.st,v 1.450 2010-11-27 14:43:11 cg Exp $' |
3892 | 8288 |
! ! |