author | Claus Gittinger <cg@exept.de> |
Thu, 12 Jan 2012 03:03:59 +0100 | |
changeset 11108 | f13e428f8d06 |
parent 11057 | a035d065549c |
child 11135 | 59e1d94df37f |
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 |
|
10306 | 19 |
LastFileSelection LastMoveDestination LastScriptBlockString |
11108 | 20 |
LastMustMatchPattern LastFileDiffDirectory' |
4959 | 21 |
poolDictionaries:'' |
22 |
category:'Interface-Tools-File' |
|
3892 | 23 |
! |
24 |
||
25 |
AbstractFileBrowser class instanceVariableNames:'DisabledCursorImage EnabledCursorImage' |
|
26 |
||
27 |
" |
|
28 |
The following class instance variables are inherited by this class: |
|
29 |
||
4959 | 30 |
ApplicationModel - ClassResources |
31 |
Model - |
|
32 |
Object - |
|
3892 | 33 |
" |
34 |
! |
|
35 |
||
36 |
Object subclass:#Clipboard |
|
4959 | 37 |
instanceVariableNames:'method files' |
38 |
classVariableNames:'' |
|
39 |
poolDictionaries:'' |
|
40 |
privateIn:AbstractFileBrowser |
|
3892 | 41 |
! |
42 |
||
43 |
Object subclass:#CodeExecutionLock |
|
4959 | 44 |
instanceVariableNames:'locked' |
45 |
classVariableNames:'' |
|
46 |
poolDictionaries:'' |
|
47 |
privateIn:AbstractFileBrowser |
|
3892 | 48 |
! |
49 |
||
4366 | 50 |
List subclass:#DirectoryHistory |
4959 | 51 |
instanceVariableNames:'forwardList backList lastWasForwardPath lastBackPath lastAddPath |
6369 | 52 |
backForwardList backForwardIndex historySize' |
4959 | 53 |
classVariableNames:'HistorySize' |
54 |
poolDictionaries:'' |
|
55 |
privateIn:AbstractFileBrowser |
|
3952 | 56 |
! |
57 |
||
58 |
Object subclass:#DirectoryHistoryItem |
|
4959 | 59 |
instanceVariableNames:'path position' |
60 |
classVariableNames:'' |
|
61 |
poolDictionaries:'' |
|
62 |
privateIn:AbstractFileBrowser::DirectoryHistory |
|
3892 | 63 |
! |
64 |
||
65 |
Object subclass:#SaveAspectItem |
|
4959 | 66 |
instanceVariableNames:'value isHolder' |
67 |
classVariableNames:'' |
|
68 |
poolDictionaries:'' |
|
69 |
privateIn:AbstractFileBrowser |
|
3892 | 70 |
! |
71 |
||
5140 | 72 |
!AbstractFileBrowser class methodsFor:'documentation'! |
73 |
||
74 |
copyright |
|
75 |
" |
|
76 |
COPYRIGHT (c) 2002 by eXept Software AG |
|
77 |
All Rights Reserved |
|
78 |
||
79 |
This software is furnished under a license and may be used |
|
80 |
only in accordance with the terms of that license and with the |
|
81 |
inclusion of the above copyright notice. This software may not |
|
82 |
be provided or otherwise made available to, or used by, any |
|
83 |
other person. No title to or ownership of the software is |
|
84 |
hereby transferred. |
|
85 |
" |
|
5967 | 86 |
! |
87 |
||
88 |
documentation |
|
89 |
" |
|
90 |
[Author:] |
|
91 |
Christian Penk |
|
9111
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
92 |
|
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
93 |
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
|
94 |
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
|
95 |
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
|
96 |
and as a container is almost incomprehensable... |
5967 | 97 |
" |
5140 | 98 |
! ! |
3892 | 99 |
|
4672
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
100 |
!AbstractFileBrowser class methodsFor:'accessing'! |
3952 | 101 |
|
4368
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
102 |
currentSelection |
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
103 |
|
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
104 |
LastFileSelection isNil ifTrue:[ |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
105 |
LastFileSelection := #(). |
4368
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
106 |
]. |
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
107 |
^ LastFileSelection |
4368
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
108 |
! |
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
109 |
|
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
110 |
currentSelection:aFilenameCol |
6589 | 111 |
aFilenameCol notEmptyOrNil ifTrue:[ |
112 |
LastFileSelection := aFilenameCol collect:[:file | file asFilename] |
|
113 |
] |
|
4368
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
114 |
! |
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
115 |
|
3952 | 116 |
directoryHistory |
117 |
||
118 |
DirectoryHistory isNil ifTrue:[ |
|
4414 | 119 |
DirectoryHistory := self directoryHistoryClass new. |
3964 | 120 |
"/ DirectoryHistory inspect. |
3952 | 121 |
]. |
122 |
^ DirectoryHistory |
|
123 |
! |
|
124 |
||
125 |
resetClassVars |
|
126 |
DirectoryHistory := nil. |
|
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
127 |
LastFileSelection := nil. |
5936 | 128 |
|
129 |
" |
|
130 |
AbstractFileBrowser resetClassVars |
|
131 |
" |
|
4368
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
132 |
! |
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
133 |
|
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
134 |
rootHolder |
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
135 |
|
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
136 |
^ RootHolder |
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
137 |
! |
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
138 |
|
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
139 |
rootHolder:aRoot |
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
140 |
|
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
141 |
RootHolder := aRoot |
3952 | 142 |
! ! |
143 |
||
4915 | 144 |
!AbstractFileBrowser class methodsFor:'accessing-bookmarks'! |
4672
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
145 |
|
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
146 |
addBookmark:aDirectoryPath |
6114
36fb19194510
Rename Base64Coder>>#decodingOf: to #decode:
Stefan Vogel <sv@exept.de>
parents:
6113
diff
changeset
|
147 |
"add aDirectoryPath to the list of our known bookmarks. |
36fb19194510
Rename Base64Coder>>#decodingOf: to #decode:
Stefan Vogel <sv@exept.de>
parents:
6113
diff
changeset
|
148 |
Do not add duplicates." |
36fb19194510
Rename Base64Coder>>#decodingOf: to #decode:
Stefan Vogel <sv@exept.de>
parents:
6113
diff
changeset
|
149 |
|
36fb19194510
Rename Base64Coder>>#decodingOf: to #decode:
Stefan Vogel <sv@exept.de>
parents:
6113
diff
changeset
|
150 |
|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 |
bookmarks := self directoryBookmarks. |
6114
36fb19194510
Rename Base64Coder>>#decodingOf: to #decode:
Stefan Vogel <sv@exept.de>
parents:
6113
diff
changeset
|
153 |
(bookmarks includes:aDirectoryPath) ifFalse:[ |
36fb19194510
Rename Base64Coder>>#decodingOf: to #decode:
Stefan Vogel <sv@exept.de>
parents:
6113
diff
changeset
|
154 |
bookmarks add:aDirectoryPath asFilename. |
4672
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
155 |
]. |
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
156 |
! |
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
157 |
|
8013 | 158 |
bookmarksFrom:aFileNameOrString |
159 |
|bookmarks s fileName| |
|
160 |
||
161 |
fileName := aFileNameOrString asFilename. |
|
162 |
[ |
|
163 |
s := fileName readStream. |
|
164 |
] on:OpenError do:[:ex| |
|
165 |
^ nil. |
|
166 |
]. |
|
167 |
||
168 |
bookmarks := OrderedCollection new. |
|
169 |
[s atEnd] whileFalse:[ |
|
170 |
bookmarks add:(Base64Coder decode:s nextLine) asString. |
|
171 |
]. |
|
172 |
s close. |
|
173 |
||
174 |
^ bookmarks |
|
175 |
! |
|
176 |
||
4679 | 177 |
defaultBookMarksFileDirectory |
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
178 |
^ Filename homeDirectory |
4679 | 179 |
! |
180 |
||
181 |
defaultBookMarksFilename |
|
182 |
^ '.fileBrowserBookmarks' |
|
183 |
! |
|
184 |
||
185 |
directoryBookmarks |
|
186 |
DirectoryBookmarks isNil ifTrue:[ |
|
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
187 |
self loadBookmarksFrom:(self defaultBookMarksFileDirectory construct:self defaultBookMarksFilename). |
4679 | 188 |
|
189 |
DirectoryBookmarks isEmptyOrNil ifTrue:[ |
|
190 |
DirectoryBookmarks := OrderedCollection new. |
|
191 |
DirectoryBookmarks add:Filename homeDirectory asAbsoluteFilename. |
|
192 |
DirectoryBookmarks add:Filename currentDirectory asAbsoluteFilename. |
|
193 |
] |
|
194 |
]. |
|
195 |
^ DirectoryBookmarks |
|
196 |
||
197 |
" |
|
5438
fa19d526d85d
directoryBookmarks must be stored without lineLimit (see base64 encoder)
Claus Gittinger <cg@exept.de>
parents:
5437
diff
changeset
|
198 |
DirectoryBookmarks := nil. |
fa19d526d85d
directoryBookmarks must be stored without lineLimit (see base64 encoder)
Claus Gittinger <cg@exept.de>
parents:
5437
diff
changeset
|
199 |
self directoryBookmarks. |
4679 | 200 |
" |
201 |
! |
|
202 |
||
8013 | 203 |
directoryBookmarks: collectionOfFilenames |
204 |
||
205 |
DirectoryBookmarks := collectionOfFilenames. |
|
206 |
self saveBookmarksInDefaultBookmarksFile. |
|
207 |
! |
|
208 |
||
209 |
editBookmarksWithDefault: aFilenameOrNil |
|
210 |
| oldBookmarks newBookmarks | |
|
211 |
||
212 |
oldBookmarks := self directoryBookmarks copy. |
|
213 |
newBookmarks := BookmarksEditDialog openWith: oldBookmarks defaultBookmark: aFilenameOrNil. |
|
214 |
newBookmarks isNil ifTrue:[^ self]. |
|
215 |
self directoryBookmarks: newBookmarks. |
|
9681
00195b8c6cf6
comment/format in: #editBookmarksWithDefault:
Claus Gittinger <cg@exept.de>
parents:
9677
diff
changeset
|
216 |
|
00195b8c6cf6
comment/format in: #editBookmarksWithDefault:
Claus Gittinger <cg@exept.de>
parents:
9677
diff
changeset
|
217 |
"Modified: / 13-01-2011 / 12:52:28 / cg" |
8013 | 218 |
! |
219 |
||
4672
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
220 |
hasBookmarks |
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
221 |
^ self directoryBookmarks notEmptyOrNil |
4672
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
222 |
! |
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
223 |
|
4679 | 224 |
loadBookmarksFrom:aFileNameOrString |
8013 | 225 |
|bookmarks| |
226 |
||
227 |
bookmarks := self bookmarksFrom: aFileNameOrString. |
|
228 |
bookmarks isNil ifTrue:[^ self]. |
|
4679 | 229 |
|
230 |
DirectoryBookmarks := OrderedCollection new. |
|
231 |
bookmarks do:[:eachPath | |
|
232 |
self addBookmark:eachPath asFilename |
|
233 |
]. |
|
234 |
! |
|
235 |
||
4672
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
236 |
removeBookmark:aDirectoryPath |
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
237 |
|bookmarks| |
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
238 |
|
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
239 |
bookmarks := self directoryBookmarks. |
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
240 |
bookmarks isEmptyOrNil ifTrue:[ ^ self]. |
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
241 |
|
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
242 |
bookmarks remove:aDirectoryPath ifAbsent:[]. |
4679 | 243 |
! |
244 |
||
245 |
saveBookmarks |
|
246 |
|fn| |
|
247 |
||
248 |
fn := Dialog |
|
9607 | 249 |
requestFileNameForSave:(self resources string:'Save Bookmarks') |
4679 | 250 |
default:(self defaultBookMarksFilename) |
251 |
fromDirectory:(self defaultBookMarksFileDirectory). |
|
252 |
fn isEmptyOrNil ifTrue:[^ self]. |
|
253 |
||
254 |
self saveBookmarksIn:fn |
|
9607 | 255 |
|
256 |
"Modified: / 27-10-2010 / 11:27:09 / cg" |
|
4679 | 257 |
! |
258 |
||
8013 | 259 |
saveBookmarks: bookmarks in:aFileNameOrString |
6114
36fb19194510
Rename Base64Coder>>#decodingOf: to #decode:
Stefan Vogel <sv@exept.de>
parents:
6113
diff
changeset
|
260 |
"save the bokmarks in aFileNameOrString. |
36fb19194510
Rename Base64Coder>>#decodingOf: to #decode:
Stefan Vogel <sv@exept.de>
parents:
6113
diff
changeset
|
261 |
Use Base64 coding" |
36fb19194510
Rename Base64Coder>>#decodingOf: to #decode:
Stefan Vogel <sv@exept.de>
parents:
6113
diff
changeset
|
262 |
|
8013 | 263 |
| bookmarkStream fileName coder| |
4679 | 264 |
|
265 |
fileName := aFileNameOrString asFilename. |
|
266 |
fileName exists ifTrue:[ |
|
267 |
fileName renameTo:(fileName withSuffix:'sav'). |
|
268 |
]. |
|
6114
36fb19194510
Rename Base64Coder>>#decodingOf: to #decode:
Stefan Vogel <sv@exept.de>
parents:
6113
diff
changeset
|
269 |
bookmarkStream := fileName writeStream. |
36fb19194510
Rename Base64Coder>>#decodingOf: to #decode:
Stefan Vogel <sv@exept.de>
parents:
6113
diff
changeset
|
270 |
|
36fb19194510
Rename Base64Coder>>#decodingOf: to #decode:
Stefan Vogel <sv@exept.de>
parents:
6113
diff
changeset
|
271 |
"save each bookmark in one line" |
36fb19194510
Rename Base64Coder>>#decodingOf: to #decode:
Stefan Vogel <sv@exept.de>
parents:
6113
diff
changeset
|
272 |
coder := (Base64Coder on:bookmarkStream) lineLimit:nil. |
4679 | 273 |
bookmarks do:[:eachPath | |
6114
36fb19194510
Rename Base64Coder>>#decodingOf: to #decode:
Stefan Vogel <sv@exept.de>
parents:
6113
diff
changeset
|
274 |
eachPath asFilename pathName acceptVisitor:coder. |
36fb19194510
Rename Base64Coder>>#decodingOf: to #decode:
Stefan Vogel <sv@exept.de>
parents:
6113
diff
changeset
|
275 |
coder flush. |
36fb19194510
Rename Base64Coder>>#decodingOf: to #decode:
Stefan Vogel <sv@exept.de>
parents:
6113
diff
changeset
|
276 |
bookmarkStream cr. |
36fb19194510
Rename Base64Coder>>#decodingOf: to #decode:
Stefan Vogel <sv@exept.de>
parents:
6113
diff
changeset
|
277 |
]. |
36fb19194510
Rename Base64Coder>>#decodingOf: to #decode:
Stefan Vogel <sv@exept.de>
parents:
6113
diff
changeset
|
278 |
bookmarkStream close. |
5960 | 279 |
! |
280 |
||
8013 | 281 |
saveBookmarksIn:aFileNameOrString |
282 |
"save the bokmarks in aFileNameOrString. |
|
283 |
Use Base64 coding" |
|
284 |
||
285 |
| bookmarks | |
|
286 |
||
287 |
bookmarks := self directoryBookmarks. |
|
288 |
self saveBookmarks: bookmarks in:aFileNameOrString |
|
289 |
! |
|
290 |
||
5960 | 291 |
saveBookmarksInDefaultBookmarksFile |
292 |
self saveBookmarksIn:(self defaultBookMarksFileDirectory construct:self defaultBookMarksFilename) |
|
4672
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
293 |
! ! |
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
294 |
|
4915 | 295 |
!AbstractFileBrowser class methodsFor:'accessing-classes'! |
4672
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
296 |
|
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
297 |
directoryHistoryClass |
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 |
^ AbstractFileBrowser::DirectoryHistory |
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
300 |
! ! |
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
301 |
|
3892 | 302 |
!AbstractFileBrowser class methodsFor:'defaults'! |
303 |
||
304 |
commandHistory |
|
305 |
||
306 |
CommandHistory isNil ifTrue:[ |
|
4414 | 307 |
CommandHistory := OrderedCollection new. |
3892 | 308 |
]. |
309 |
^ CommandHistory |
|
310 |
! |
|
311 |
||
312 |
commandHistorySize |
|
4190 | 313 |
"max no of entries in the HistoryList " |
6369 | 314 |
|
3892 | 315 |
CommandHistorySize isNil ifTrue:[ |
6369 | 316 |
CommandHistorySize := 150 |
3892 | 317 |
]. |
318 |
^ CommandHistorySize |
|
319 |
! |
|
320 |
||
321 |
defaultFilterList |
|
322 |
||
323 |
DefaultFilters isNil ifTrue:[ |
|
4414 | 324 |
DefaultFilters := #( '*' |
325 |
'*.st' |
|
326 |
'*.htm*' |
|
327 |
'*.txt' |
|
328 |
'*.gif' |
|
329 |
'*.xpm' |
|
330 |
'*.jpg' |
|
331 |
'*.[h,c]*' |
|
332 |
) |
|
3892 | 333 |
]. |
334 |
^ DefaultFilters. |
|
335 |
! |
|
336 |
||
4496
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
337 |
initialCommandFor:fileName in:aDirectory intoBox:aBox |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
338 |
"set a useful initial command in an execute box." |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
339 |
|
4523 | 340 |
|mime cmd select path suffix baseName pathName| |
4496
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
341 |
|
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
342 |
path := aDirectory filenameFor:fileName. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
343 |
baseName := path baseName. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
344 |
suffix := path suffix. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
345 |
|
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
346 |
mime := MIMETypes mimeTypeForSuffix:suffix. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
347 |
"/ mime notNil ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
348 |
"/ cmd := self initialCommandForMIME:mime file:path |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
349 |
"/ ]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
350 |
|
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
351 |
"/ 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
|
352 |
"/ XXX or from resources. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
353 |
|
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
354 |
(path type == #regular) ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
355 |
path isExecutableProgram ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
356 |
aBox initialText:(path pathName , ' <arguments>'). |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
357 |
^ self |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
358 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
359 |
|
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
360 |
select := true. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
361 |
|
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
362 |
"some heuristics - my personal preferences ... |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
363 |
(actually this should come from a configfile)" |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
364 |
|
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
365 |
(baseName endsWith:'akefile') ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
366 |
aBox initialText:'make target' selectFrom:6 to:11. |
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 |
cmd := MIMETypes defaultCommandPerMIME at:mime ifAbsent:nil. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
371 |
cmd notNil ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
372 |
select := false |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
373 |
]. |
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 |
cmd isNil ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
376 |
suffix := path suffix. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
377 |
(suffix = 'C') ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
378 |
cmd := 'g++ -c %1'. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
379 |
select := 6. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
380 |
] ifFalse:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
381 |
suffix := suffix asLowercase. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
382 |
|
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
383 |
(suffix = 'taz') ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
384 |
aBox initialText:'zcat %1 | tar tvf -'. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
385 |
select := false. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
386 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
387 |
(suffix = 'tar') ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
388 |
cmd := 'tar tvf %1'. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
389 |
select := 7. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
390 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
391 |
(suffix = 'zoo') ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
392 |
cmd := 'zoo -list %1'. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
393 |
select := 9. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
394 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
395 |
(suffix = 'zip') ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
396 |
cmd := 'unzip -l %1'. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
397 |
select := 8. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
398 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
399 |
(suffix = 'jar') ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
400 |
cmd := 'unzip -l %1'. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
401 |
select := 8. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
402 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
403 |
(suffix = 'z') ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
404 |
(baseName asLowercase endsWith:'tar.z') ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
405 |
cmd := 'zcat %1 | tar tvf -'. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
406 |
select := false. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
407 |
] ifFalse:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
408 |
cmd := 'uncompress %1' |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
409 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
410 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
411 |
(suffix = 'gz') ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
412 |
(baseName asLowercase endsWith:'tar.gz') ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
413 |
cmd := ('gunzip < %1 | tar tvf -' ). |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
414 |
select := false. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
415 |
] ifFalse:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
416 |
cmd := 'gunzip %1'. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
417 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
418 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
419 |
(suffix = 'html') ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
420 |
cmd := 'netscape %1' |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
421 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
422 |
(suffix = 'htm') ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
423 |
cmd := 'netscape %1' |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
424 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
425 |
(suffix = 'uue') ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
426 |
cmd := 'uudecode %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 |
(suffix = 'c') ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
429 |
cmd := 'cc -c %1'. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
430 |
select := 5. |
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 = 'cc') ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
433 |
cmd := 'g++ -c %1'. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
434 |
select := 6. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
435 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
436 |
(suffix = 'xbm') ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
437 |
cmd := 'bitmap %1' |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
438 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
439 |
(suffix = 'ps') ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
440 |
cmd := 'ghostview %1' |
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 = '1') or:[suffix = 'man']) ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
443 |
cmd := 'nroff -man %1'. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
444 |
select := 10. |
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 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
447 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
448 |
|
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
449 |
cmd isNil ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
450 |
DefaultCommandPerSuffix isNil ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
451 |
cmd := '<cmd>' |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
452 |
] ifFalse:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
453 |
cmd := DefaultCommandPerSuffix |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
454 |
at:suffix |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
455 |
ifAbsent:'<cmd>'. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
456 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
457 |
cmd := cmd , ' %1'. |
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 |
|
4523 | 460 |
pathName := path pathName. |
461 |
OperatingSystem isUNIXlike ifTrue:[ |
|
462 |
pathName includesSeparator ifTrue:[ |
|
463 |
pathName := '"' , pathName , '"' |
|
464 |
] |
|
465 |
]. |
|
466 |
||
467 |
cmd := cmd bindWith:pathName. |
|
4496
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
468 |
select == false ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
469 |
aBox initialText:cmd |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
470 |
] ifFalse:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
471 |
select class == Interval ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
472 |
aBox initialText:cmd selectFrom:select start to:select stop |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
473 |
] ifFalse:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
474 |
select isInteger ifFalse:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
475 |
select := (cmd indexOf:Character space ifAbsent:[cmd size + 1]) - 1. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
476 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
477 |
aBox initialText:cmd selectFrom:1 to:select |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
478 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
479 |
] |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
480 |
] |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
481 |
|
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
482 |
"Modified: / 24.9.1997 / 16:34:52 / stefan" |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
483 |
"Modified: / 9.4.1998 / 17:15:57 / cg" |
3892 | 484 |
! |
485 |
||
5941 | 486 |
listOfRuntimeValuesToRemember |
487 |
" list of all aspects that will be remembered after closing a FileBrowserV2" |
|
488 |
||
489 |
^ #( |
|
490 |
"/ #filterModel |
|
491 |
#enableFileHistory |
|
492 |
#fileHistory |
|
493 |
#currentSortOrder |
|
494 |
#sortBlockProperty |
|
495 |
) |
|
3892 | 496 |
! |
497 |
||
498 |
resetAspects |
|
499 |
||
500 |
RuntimeAspects := nil. |
|
501 |
||
5941 | 502 |
" |
503 |
self resetAspects |
|
504 |
" |
|
3892 | 505 |
! |
506 |
||
507 |
runtimeAspects |
|
508 |
||
509 |
RuntimeAspects isNil ifTrue:[ |
|
4414 | 510 |
RuntimeAspects := Dictionary new. |
3892 | 511 |
]. |
512 |
^ RuntimeAspects |
|
513 |
! |
|
514 |
||
4201 | 515 |
userPreferencesAspectList |
516 |
" list of all aspects that will be saved with save settings |
|
517 |
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
|
518 |
dont forget to add a access methos in UserPreferences if you add a aspect here |
4201 | 519 |
" |
520 |
||
7078
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
521 |
^ Dictionary |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
522 |
withKeysAndValues:#( |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
523 |
viewDirsInContentsBrowser true |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
524 |
showDirectoryTree true |
9119
77cc26a119cf
changed: #userPreferencesAspectList
Claus Gittinger <cg@exept.de>
parents:
9118
diff
changeset
|
525 |
showHiddenFiles false |
7078
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
526 |
viewDescription false |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
527 |
viewDetails true |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
528 |
viewDirectoryDescription false |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
529 |
viewFilesInDirectoryTree false |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
530 |
viewGroup false |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
531 |
viewOwner false |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
532 |
viewPermissions false |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
533 |
viewPreview false |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
534 |
viewSize true |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
535 |
viewSizeInKiloBytes false |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
536 |
viewSizeInBytes false |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
537 |
viewTime true |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
538 |
viewType false |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
539 |
openMultipleApplicationsForType false |
7788 | 540 |
filenameEntryFieldVisibleHolder true |
541 |
toolBarVisibleHolder true |
|
7078
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
542 |
sortDirectoriesBeforeFiles true |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
543 |
openAlwaysInTextEditor false |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
544 |
sortCaseless false |
10757
5bbe8b995a5f
added: #useCodeView2InTools
Claus Gittinger <cg@exept.de>
parents:
10747
diff
changeset
|
545 |
useCodeView2InTools true |
4201 | 546 |
) |
7078
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
547 |
|
10757
5bbe8b995a5f
added: #useCodeView2InTools
Claus Gittinger <cg@exept.de>
parents:
10747
diff
changeset
|
548 |
"Modified: / 06-10-2011 / 11:30:09 / cg" |
3892 | 549 |
! ! |
550 |
||
5398 | 551 |
!AbstractFileBrowser class methodsFor:'help specs'! |
552 |
||
8261 | 553 |
basicFlyByHelpSpec |
6099 | 554 |
<resource: #help> |
555 |
||
8261 | 556 |
^ super flyByHelpSpec addPairsFrom:#( |
6099 | 557 |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
558 |
#lockFileEncoding |
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
559 |
'Do not guess the encoding from the file''s contents.' |
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
560 |
|
6100 | 561 |
#closeTabButton |
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
562 |
'Close this tab' |
6100 | 563 |
|
6099 | 564 |
#addTerminal |
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
565 |
'Add a Shell terminal view' |
6099 | 566 |
|
567 |
#make |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
568 |
'Call the make command' |
6099 | 569 |
|
570 |
#searchFile |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
571 |
'Search a file' |
6099 | 572 |
|
573 |
#directoryUp |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
574 |
'Directory up' |
6099 | 575 |
|
576 |
#directoryBack |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
577 |
'Directory back' |
6099 | 578 |
|
579 |
#directoryForward |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
580 |
'Directory forward' |
6099 | 581 |
|
582 |
#directoryHistory |
|
583 |
'Directory' |
|
584 |
||
585 |
#copyFile |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
586 |
'Copy the selected file(s)' |
6099 | 587 |
|
588 |
#cutFile |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
589 |
'Cut the selected file(s)' |
6099 | 590 |
|
591 |
#editFile |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
592 |
'Edit the selected file' |
6099 | 593 |
|
594 |
#fileHome |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
595 |
'Goto home directory' |
6099 | 596 |
|
8093 | 597 |
#fileDesktop |
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
598 |
'Goto desktop directory' |
8093 | 599 |
|
6099 | 600 |
#fileGotoDefault |
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
601 |
'Goto default directory (ST/X start directory)' |
6099 | 602 |
|
6454 | 603 |
#fileGotoSmalltalkDirectory |
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
604 |
'Goto Smalltalk directory (ST/X application)' |
6454 | 605 |
|
6456 | 606 |
#fileGotoDefaultDirectory |
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
607 |
'Goto current directory' |
6456 | 608 |
|
6099 | 609 |
#pasteFile |
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
610 |
'Paste file(s)' |
6099 | 611 |
|
612 |
#deleteFile |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
613 |
'Delete the selected file(s)' |
6099 | 614 |
|
615 |
#fileIn |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
616 |
'File in' |
6099 | 617 |
|
618 |
#fileHistory |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
619 |
'File history' |
6099 | 620 |
|
621 |
#fileGotoBookmark |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
622 |
'Goto bookmarked directory' |
6099 | 623 |
|
624 |
#hideToolBar |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
625 |
'Hide toolbar' |
6099 | 626 |
|
627 |
#hideFilenameEntryField |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
628 |
'Hide filename & filter fields' |
6099 | 629 |
|
630 |
#openChangeBrowser |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
631 |
'Open a Changebrowser on file' |
6099 | 632 |
|
633 |
#showFileDetails |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
634 |
'Show file details' |
6099 | 635 |
|
636 |
#hideFileDetails |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
637 |
'Hide file details' |
6099 | 638 |
|
639 |
#toggleDetails |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
640 |
'Show/hide file details' |
6099 | 641 |
|
642 |
#viewDetails |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
643 |
'Show/hide file details' |
6099 | 644 |
|
645 |
#selectDetails |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
646 |
'Select file details to be shown' |
6099 | 647 |
|
8088 | 648 |
#showDifferences |
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
649 |
'Show differences between file and editor versions' |
8088 | 650 |
|
651 |
#toggleHexDisplay |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
652 |
'Toggle between hexadecimal and textual representation' |
8088 | 653 |
|
654 |
#findInBrowser |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
655 |
'Navigate the browser''s file list to the edited file' |
8088 | 656 |
|
657 |
#saveFile |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
658 |
'Save the editor''s contents into the file' |
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
659 |
|
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
660 |
#saveFileAs |
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
661 |
'Save the editor''s contents into another file' |
8088 | 662 |
|
663 |
#reloadFile |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
664 |
'Reload from the file' |
8088 | 665 |
|
666 |
||
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
667 |
'Send to the printer' |
8088 | 668 |
|
6099 | 669 |
). |
670 |
||
8261 | 671 |
" |
672 |
self flyByHelpSpec |
|
673 |
" |
|
674 |
||
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
675 |
"Modified: / 06-10-2011 / 14:55:27 / cg" |
8261 | 676 |
! |
677 |
||
678 |
flyByHelpSpec |
|
679 |
<resource: #programHelp> |
|
680 |
||
681 |
|spec hist resources| |
|
682 |
||
683 |
spec := self basicFlyByHelpSpec. |
|
684 |
||
685 |
"/ add help items for the history |
|
6099 | 686 |
hist := self directoryHistory. |
687 |
hist notNil ifTrue:[ |
|
688 |
resources := self classResources. |
|
689 |
hist canForward ifTrue:[ |
|
7879
9c64dea1b14a
block as a flyByHelpText item.
Claus Gittinger <cg@exept.de>
parents:
7869
diff
changeset
|
690 |
spec at:#directoryForward put:[ resources string:'Forward to: %1' with:hist nextForwardItem ]. |
6099 | 691 |
]. |
692 |
hist canBackward ifTrue:[ |
|
7879
9c64dea1b14a
block as a flyByHelpText item.
Claus Gittinger <cg@exept.de>
parents:
7869
diff
changeset
|
693 |
spec at:#directoryBack put:[ resources string:'Back to: %1' with:hist nextBackwardItem ]. |
6099 | 694 |
]. |
695 |
]. |
|
696 |
^ spec. |
|
697 |
||
698 |
" |
|
699 |
self flyByHelpSpec |
|
700 |
" |
|
701 |
||
7879
9c64dea1b14a
block as a flyByHelpText item.
Claus Gittinger <cg@exept.de>
parents:
7869
diff
changeset
|
702 |
"Modified: / 03-11-2007 / 12:05:01 / cg" |
5398 | 703 |
! ! |
704 |
||
8994
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
705 |
!AbstractFileBrowser class methodsFor:'image specs'! |
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
706 |
|
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
707 |
clearHistoryIcon |
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
708 |
<resource: #programImage> |
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
709 |
|
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
710 |
^ Icon deleteIcon |
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
711 |
! |
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
712 |
|
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
713 |
copyIcon |
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
714 |
<resource: #programImage> |
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
715 |
|
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
716 |
^ ToolbarIconLibrary copyIcon |
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
717 |
! |
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
718 |
|
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
719 |
cutIcon |
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
720 |
<resource: #programImage> |
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
721 |
|
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
722 |
^ ToolbarIconLibrary cut20x20Icon2 "cut28x28Icon" |
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
723 |
! |
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
724 |
|
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
725 |
deleteIcon |
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
726 |
<resource: #programImage> |
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
727 |
|
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
728 |
^ ToolbarIconLibrary erase20x20Icon "/ delete28x28Icon |
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
729 |
! |
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 |
directoryUpIcon |
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 |
^ ToolbarIconLibrary directoryUpIcon |
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
735 |
! |
3892 | 736 |
|
6337 | 737 |
disabledCursorIcon |
738 |
"This resource specification was automatically generated |
|
739 |
by the ImageEditor of ST/X." |
|
740 |
||
741 |
"Do not manually edit this!! If it is corrupted, |
|
742 |
the ImageEditor may not be able to read the specification." |
|
743 |
||
744 |
" |
|
745 |
self disabledCursorImage inspect |
|
746 |
ImageEditor openOnClass:self andSelector:#disabledCursorImage |
|
747 |
Icon flushCachedIcons |
|
748 |
" |
|
749 |
||
750 |
<resource: #image> |
|
751 |
||
752 |
^Icon |
|
8473 | 753 |
constantNamed:#'AbstractFileBrowser class disabledCursorIcon' |
6337 | 754 |
ifAbsentPut:[(Depth1Image new) width: 32; height: 32; photometric:(#palette); bitsPerSample:(#[1]); samplesPerPixel:(1); bits:(ByteArray fromPackedString:' |
755 |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@_ @@@XF@@@H@P@@DOB@@BLLP@AA@"@@RHD @H1AD@BRHI@@$QBP@IBH$@BPQI@@"BLP@D QH@ADBB@@H0Q@@AC |
|
756 |
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:' |
|
757 |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@_ @@@_>@@@O?0@@G?>@@C<O0@A?@>@@_8G @O?A<@C38O@@<_C0@OC8<@C0_O@@>C?0@G _8@A<C>@@O0_@@A? |
|
758 |
? @@O?0@@A?8@@@G8@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@b') ; yourself); yourself] |
|
759 |
! |
|
760 |
||
4337
f2eed806e854
change first letter uppercase methods on class side to lowercase ones
penk
parents:
4317
diff
changeset
|
761 |
disabledCursorImage |
6337 | 762 |
"/ DisabledCursorImage isNil ifTrue:[ |
763 |
"/ DisabledCursorImage := self disabledCursorIcon. "/ Image fromFile:'xpmBitmaps/cursors/no_entry.xpm' |
|
764 |
"/ ]. |
|
3892 | 765 |
^ DisabledCursorImage |
766 |
! |
|
767 |
||
6337 | 768 |
enabledCursorIcon |
769 |
"This resource specification was automatically generated |
|
770 |
by the ImageEditor of ST/X." |
|
771 |
||
772 |
"Do not manually edit this!! If it is corrupted, |
|
773 |
the ImageEditor may not be able to read the specification." |
|
774 |
||
775 |
" |
|
776 |
self enabledCursorImage inspect |
|
777 |
ImageEditor openOnClass:self andSelector:#enabledCursorImage |
|
778 |
Icon flushCachedIcons |
|
779 |
" |
|
780 |
||
781 |
<resource: #image> |
|
782 |
||
783 |
^Icon |
|
8473 | 784 |
constantNamed:#'AbstractFileBrowser class enabledCursorIcon' |
6337 | 785 |
ifAbsentPut:[(Depth1Image new) width: 32; height: 32; photometric:(#palette); bitsPerSample:(#[1]); samplesPerPixel:(1); bits:(ByteArray fromPackedString:' |
786 |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@E@@@@AP@@@@T@@@@E@@@@AP@@@@T@@@@E@@@@AP@@@@@@@@?0_0@@@@@@C?A?@@@@@@@@AP@@@@T@@@@E@@@@A |
|
787 |
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:' |
|
788 |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@G@@@@A0@@@@\@@@@G@@@@A0@@@@\@@@@G@@@@A0@@@@\@@@?8?0@O>O<@C?#?@@@G@@@@A0@@@@\@@@@G@@@@A |
|
789 |
0@@@@\@@@@G@@@@A0@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@b') ; yourself); yourself] |
|
790 |
! |
|
791 |
||
4337
f2eed806e854
change first letter uppercase methods on class side to lowercase ones
penk
parents:
4317
diff
changeset
|
792 |
enabledCursorImage |
6337 | 793 |
"/ EnabledCursorImage isNil ifTrue:[ |
794 |
"/ EnabledCursorImage := self enabledCursorIcon. "/ Image fromFile:'xpmBitmaps/cursors/double_crossHair.xpm' |
|
795 |
"/ ]. |
|
3892 | 796 |
^ EnabledCursorImage |
6083 | 797 |
! |
798 |
||
3892 | 799 |
fileInIcon |
800 |
<resource: #programImage> |
|
801 |
||
6116 | 802 |
^ ToolbarIconLibrary fileInIcon |
3892 | 803 |
! |
804 |
||
6079 | 805 |
historyBackIcon |
806 |
<resource: #programImage> |
|
807 |
||
808 |
^ ToolbarIconLibrary historyBackIcon |
|
809 |
! |
|
810 |
||
811 |
historyForwardIcon |
|
812 |
<resource: #programImage> |
|
813 |
||
814 |
^ ToolbarIconLibrary historyForwardIcon |
|
815 |
! |
|
816 |
||
3892 | 817 |
homeIcon |
818 |
<resource: #programImage> |
|
819 |
||
6079 | 820 |
^ ToolbarIconLibrary homeIcon |
3892 | 821 |
! |
822 |
||
6074 | 823 |
homeIcon2 |
6079 | 824 |
<resource: #programImage> |
825 |
||
826 |
^ ToolbarIconLibrary homeIcon2 |
|
6074 | 827 |
! |
828 |
||
829 |
htmlReloadIcon |
|
830 |
<resource: #programImage> |
|
831 |
||
832 |
^ ToolbarIconLibrary reload22x22Icon |
|
833 |
! |
|
834 |
||
3892 | 835 |
leftDownIcon |
836 |
"This resource specification was automatically generated |
|
837 |
by the ImageEditor of ST/X." |
|
838 |
||
839 |
"Do not manually edit this!! If it is corrupted, |
|
840 |
the ImageEditor may not be able to read the specification." |
|
841 |
||
842 |
" |
|
843 |
self leftDownIcon inspect |
|
844 |
ImageEditor openOnClass:self andSelector:#leftDownIcon |
|
845 |
" |
|
846 |
||
847 |
<resource: #image> |
|
848 |
||
849 |
^Icon |
|
4414 | 850 |
constantNamed:#'AbstractFileBrowser class leftDownIcon' |
851 |
ifAbsentPut:[(Depth2Image new) width: 28; height: 28; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:' |
|
3892 | 852 |
UUUUUUUUUUUPAUUUUUUUP@UUUUUUUPB!!UUUUUU@B*AUUUUU@B*(UUUUUPB** UUUUPB***AUUUTB***(EUUUB****%UUUR*****UUUUU@*%UUUUUUPJ)UUUU |
853 |
UUTB*UUUUUUU@*%UUUUUUPJ)UUUUUUTB*UUUUUUU@*%UUUUUUPJ)UUUUUUTB*UUUUUUU@*$@@@@AUPJ*****)UTB******UU@******%UPJ*****)UTAUUUU |
|
854 |
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:' |
|
855 |
@@@@@@@@@@@@ @@@@\@@@@O @@@G<@@@C? @@A?<@@@?? @@_?<@@G?? @@C<@@@@?@@@@O0@@@C<@@@@?@@@@O0@@@C<@@@@?@@@@O0@@@C??? @???8@O? |
|
856 |
?>@C??? @???8@O??>@@@@@@@@@@@@@a') ; yourself); yourself] |
|
857 |
! |
|
858 |
||
859 |
menuHistoryList9x20Icon |
|
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 menuHistoryList9x20Icon inspect |
|
868 |
ImageEditor openOnClass:self andSelector:#menuHistoryList9x20Icon |
|
869 |
Icon flushCachedIcons |
|
870 |
" |
|
871 |
||
872 |
<resource: #image> |
|
873 |
||
874 |
^Icon |
|
4414 | 875 |
constantNamed:#'AbstractFileBrowser class menuHistoryList9x20Icon' |
876 |
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 | 877 |
! |
878 |
||
879 |
menuHistoryListIcon |
|
880 |
"This resource specification was automatically generated |
|
881 |
by the ImageEditor of ST/X." |
|
882 |
||
883 |
"Do not manually edit this!! If it is corrupted, |
|
884 |
the ImageEditor may not be able to read the specification." |
|
885 |
||
886 |
" |
|
887 |
self menuHistoryListIcon inspect |
|
888 |
ImageEditor openOnClass:self andSelector:#menuHistoryListIcon |
|
889 |
" |
|
890 |
||
891 |
<resource: #image> |
|
892 |
||
893 |
^Icon |
|
4414 | 894 |
constantNamed:#'AbstractFileBrowser class menuHistoryListIcon' |
895 |
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 | 896 |
! |
897 |
||
6087 | 898 |
newDirectoryIcon |
6074 | 899 |
<resource: #programImage> |
900 |
||
6087 | 901 |
^ ToolbarIconLibrary newDirectoryIcon |
3923 | 902 |
! |
903 |
||
6091 | 904 |
removeTabIcon |
905 |
<resource: #programImage> |
|
906 |
||
907 |
^ ToolbarIconLibrary removeTabIcon |
|
908 |
! |
|
909 |
||
3892 | 910 |
vt100Terminal |
911 |
<resource: #programImage> |
|
912 |
||
913 |
^ ToolbarIconLibrary shell20x20Icon |
|
914 |
! ! |
|
915 |
||
5528 | 916 |
!AbstractFileBrowser class methodsFor:'interface specs'! |
917 |
||
918 |
encodingDialogSpec |
|
919 |
"This resource specification was automatically generated |
|
920 |
by the UIPainter of ST/X." |
|
921 |
||
922 |
"Do not manually edit this!! If it is corrupted, |
|
923 |
the UIPainter may not be able to read the specification." |
|
924 |
||
925 |
" |
|
926 |
UIPainter new openOnClass:AbstractFileBrowser andSelector:#encodingDialogSpec |
|
927 |
AbstractFileBrowser new openInterface:#encodingDialogSpec |
|
928 |
" |
|
929 |
||
930 |
<resource: #canvas> |
|
931 |
||
932 |
^ |
|
933 |
#(FullSpec |
|
934 |
name: encodingDialogSpec |
|
935 |
window: |
|
936 |
(WindowSpec |
|
937 |
label: 'File Encoding' |
|
938 |
name: 'File Encoding' |
|
939 |
min: (Point 10 10) |
|
5626 | 940 |
bounds: (Rectangle 0 0 379 590) |
5528 | 941 |
) |
942 |
component: |
|
943 |
(SpecCollection |
|
944 |
collection: ( |
|
945 |
(LabelSpec |
|
11053 | 946 |
label: 'Select the External (File-) Encoding:' |
6236 | 947 |
name: 'Label1' |
5528 | 948 |
layout: (LayoutFrame 0 0 0 0 0 1 30 0) |
949 |
translateLabel: true |
|
950 |
adjust: left |
|
951 |
) |
|
952 |
(DataSetSpec |
|
953 |
name: 'Table1' |
|
5737 | 954 |
layout: (LayoutFrame 0 0 30 0 0 1 -60 1) |
5528 | 955 |
model: selectedEncoding |
956 |
hasHorizontalScrollBar: true |
|
957 |
hasVerticalScrollBar: true |
|
958 |
dataList: encodingList |
|
959 |
has3Dseparators: true |
|
960 |
columns: |
|
11053 | 961 |
(Array |
5528 | 962 |
|
963 |
(DataSetColumnSpec |
|
964 |
label: 'Encoding' |
|
965 |
labelButtonType: Button |
|
966 |
model: at: |
|
967 |
canSelect: false |
|
968 |
isResizeable: false |
|
969 |
showRowSeparator: false |
|
970 |
showColSeparator: false |
|
971 |
) |
|
972 |
(DataSetColumnSpec |
|
973 |
label: 'Description' |
|
974 |
labelButtonType: Button |
|
975 |
model: at: |
|
976 |
canSelect: false |
|
977 |
isResizeable: false |
|
978 |
showRowSeparator: false |
|
979 |
showColSeparator: false |
|
980 |
) |
|
981 |
) |
|
5626 | 982 |
doubleClickChannel: accept |
5528 | 983 |
) |
984 |
(HorizontalPanelViewSpec |
|
5737 | 985 |
name: 'ButtonPanel' |
5528 | 986 |
layout: (LayoutFrame 0 0 -30 1 0 1 0 1) |
987 |
horizontalLayout: fitSpace |
|
988 |
verticalLayout: center |
|
989 |
horizontalSpace: 3 |
|
990 |
verticalSpace: 3 |
|
991 |
reverseOrderIfOKAtLeft: true |
|
992 |
component: |
|
993 |
(SpecCollection |
|
994 |
collection: ( |
|
995 |
(ActionButtonSpec |
|
996 |
label: 'Cancel' |
|
997 |
name: 'Button2' |
|
998 |
translateLabel: true |
|
999 |
model: cancel |
|
5737 | 1000 |
extent: (Point 185 22) |
5528 | 1001 |
) |
1002 |
(ActionButtonSpec |
|
1003 |
label: 'OK' |
|
1004 |
name: 'Button1' |
|
1005 |
translateLabel: true |
|
1006 |
model: accept |
|
1007 |
isDefault: true |
|
5737 | 1008 |
extent: (Point 185 22) |
5528 | 1009 |
) |
1010 |
) |
|
1011 |
||
1012 |
) |
|
1013 |
) |
|
5737 | 1014 |
(CheckBoxSpec |
1015 |
label: 'Lock Encoding' |
|
1016 |
name: 'LockEncodingCheckBox' |
|
1017 |
layout: (LayoutFrame 3 0 -60 1 217 0 -30 1) |
|
1018 |
activeHelpKey: lockFileEncoding |
|
1019 |
model: lockFileEncoding |
|
1020 |
translateLabel: true |
|
1021 |
) |
|
5528 | 1022 |
) |
1023 |
||
1024 |
) |
|
1025 |
) |
|
11053 | 1026 |
|
1027 |
"Modified: / 06-01-2012 / 15:40:54 / cg" |
|
1028 |
! |
|
1029 |
||
1030 |
lineEndConventionDialogSpec |
|
1031 |
"This resource specification was automatically generated |
|
1032 |
by the UIPainter of ST/X." |
|
1033 |
||
1034 |
"Do not manually edit this!! If it is corrupted, |
|
1035 |
the UIPainter may not be able to read the specification." |
|
1036 |
||
1037 |
" |
|
1038 |
UIPainter new openOnClass:AbstractFileBrowser andSelector:#lineEndConventionDialogSpec |
|
1039 |
AbstractFileBrowser new openInterface:#lineEndConventionDialogSpec |
|
1040 |
" |
|
1041 |
||
1042 |
<resource: #canvas> |
|
1043 |
||
1044 |
^ |
|
1045 |
#(FullSpec |
|
1046 |
name: lineEndConventionDialogSpec |
|
1047 |
window: |
|
1048 |
(WindowSpec |
|
1049 |
label: 'Line-End Convention' |
|
1050 |
name: 'Line-End Convention' |
|
1051 |
min: (Point 10 10) |
|
1052 |
bounds: (Rectangle 0 0 379 239) |
|
1053 |
) |
|
1054 |
component: |
|
1055 |
(SpecCollection |
|
1056 |
collection: ( |
|
1057 |
(LabelSpec |
|
1058 |
label: 'Select the Line-End Convention:' |
|
1059 |
name: 'Label1' |
|
1060 |
layout: (LayoutFrame 0 0 0 0 0 1 30 0) |
|
1061 |
translateLabel: true |
|
1062 |
adjust: left |
|
1063 |
) |
|
1064 |
(VerticalPanelViewSpec |
|
1065 |
name: 'VerticalPanel1' |
|
1066 |
layout: (LayoutFrame 0 0 30 0 0 1 -30 1) |
|
1067 |
horizontalLayout: center |
|
1068 |
verticalLayout: center |
|
1069 |
horizontalSpace: 3 |
|
1070 |
verticalSpace: 3 |
|
1071 |
component: |
|
1072 |
(SpecCollection |
|
1073 |
collection: ( |
|
1074 |
(RadioButtonSpec |
|
1075 |
label: 'NL (Unix)' |
|
1076 |
name: 'RadioButton1' |
|
1077 |
translateLabel: true |
|
1078 |
model: lineEndConvention |
|
1079 |
isTriggerOnDown: true |
|
1080 |
select: nl |
|
1081 |
extent: (Point 136 22) |
|
1082 |
) |
|
1083 |
(RadioButtonSpec |
|
1084 |
label: 'CR-NL (MSDOS)' |
|
1085 |
name: 'RadioButton4' |
|
1086 |
translateLabel: true |
|
1087 |
model: lineEndConvention |
|
1088 |
isTriggerOnDown: true |
|
1089 |
select: crnl |
|
1090 |
extent: (Point 136 22) |
|
1091 |
) |
|
1092 |
(RadioButtonSpec |
|
1093 |
label: 'CR (Mac)' |
|
1094 |
name: 'RadioButton5' |
|
1095 |
translateLabel: true |
|
1096 |
model: lineEndConvention |
|
1097 |
isTriggerOnDown: true |
|
1098 |
select: cr |
|
1099 |
extent: (Point 136 22) |
|
1100 |
) |
|
1101 |
(RadioButtonSpec |
|
1102 |
label: 'EOL' |
|
1103 |
name: 'RadioButton6' |
|
1104 |
translateLabel: true |
|
1105 |
model: lineEndConvention |
|
1106 |
isTriggerOnDown: true |
|
1107 |
select: eol |
|
1108 |
extent: (Point 136 22) |
|
1109 |
) |
|
1110 |
(RadioButtonSpec |
|
1111 |
label: 'EOT' |
|
1112 |
name: 'RadioButton7' |
|
1113 |
translateLabel: true |
|
1114 |
model: lineEndConvention |
|
1115 |
isTriggerOnDown: true |
|
1116 |
select: eot |
|
1117 |
extent: (Point 136 22) |
|
1118 |
) |
|
1119 |
) |
|
1120 |
||
1121 |
) |
|
1122 |
) |
|
1123 |
(HorizontalPanelViewSpec |
|
1124 |
name: 'ButtonPanel' |
|
1125 |
layout: (LayoutFrame 0 0 -30 1 0 1 0 1) |
|
1126 |
horizontalLayout: fitSpace |
|
1127 |
verticalLayout: center |
|
1128 |
horizontalSpace: 3 |
|
1129 |
verticalSpace: 3 |
|
1130 |
reverseOrderIfOKAtLeft: true |
|
1131 |
component: |
|
1132 |
(SpecCollection |
|
1133 |
collection: ( |
|
1134 |
(ActionButtonSpec |
|
1135 |
label: 'Cancel' |
|
1136 |
name: 'Button2' |
|
1137 |
translateLabel: true |
|
1138 |
model: cancel |
|
1139 |
extent: (Point 185 22) |
|
1140 |
) |
|
1141 |
(ActionButtonSpec |
|
1142 |
label: 'OK' |
|
1143 |
name: 'Button1' |
|
1144 |
translateLabel: true |
|
1145 |
model: accept |
|
1146 |
isDefault: true |
|
1147 |
extent: (Point 185 22) |
|
1148 |
) |
|
1149 |
) |
|
1150 |
||
1151 |
) |
|
1152 |
) |
|
1153 |
) |
|
1154 |
||
1155 |
) |
|
1156 |
) |
|
1157 |
! |
|
1158 |
||
1159 |
tabStopConversionDialogSpec |
|
1160 |
"This resource specification was automatically generated |
|
1161 |
by the UIPainter of ST/X." |
|
1162 |
||
1163 |
"Do not manually edit this!! If it is corrupted, |
|
1164 |
the UIPainter may not be able to read the specification." |
|
1165 |
||
1166 |
" |
|
1167 |
UIPainter new openOnClass:AbstractFileBrowser andSelector:#tabStopConversionDialogSpec |
|
1168 |
AbstractFileBrowser new openInterface:#tabStopConversionDialogSpec |
|
1169 |
" |
|
1170 |
||
1171 |
<resource: #canvas> |
|
1172 |
||
1173 |
^ |
|
1174 |
#(FullSpec |
|
1175 |
name: 'tabStopConversionDialogSpec' |
|
1176 |
window: |
|
1177 |
(WindowSpec |
|
1178 |
label: 'Tab-Stop Conversion' |
|
1179 |
name: 'Tab-Stop Conversion' |
|
1180 |
min: (Point 10 10) |
|
1181 |
bounds: (Rectangle 0 0 379 239) |
|
1182 |
) |
|
1183 |
component: |
|
1184 |
(SpecCollection |
|
1185 |
collection: ( |
|
1186 |
(LabelSpec |
|
1187 |
label: 'Select the Tab-Stop Conversion:' |
|
1188 |
name: 'Label1' |
|
1189 |
layout: (LayoutFrame 0 0 0 0 0 1 30 0) |
|
1190 |
translateLabel: true |
|
1191 |
adjust: left |
|
1192 |
) |
|
1193 |
(VerticalPanelViewSpec |
|
1194 |
name: 'VerticalPanel1' |
|
1195 |
layout: (LayoutFrame 0 0 30 0 0 1 -30 1) |
|
1196 |
horizontalLayout: center |
|
1197 |
verticalLayout: center |
|
1198 |
horizontalSpace: 3 |
|
1199 |
verticalSpace: 3 |
|
1200 |
component: |
|
1201 |
(SpecCollection |
|
1202 |
collection: ( |
|
1203 |
(RadioButtonSpec |
|
1204 |
label: '4' |
|
1205 |
name: 'RadioButton1' |
|
1206 |
translateLabel: true |
|
1207 |
model: tabStops |
|
1208 |
isTriggerOnDown: true |
|
1209 |
select: 4 |
|
1210 |
extent: (Point 136 22) |
|
1211 |
) |
|
1212 |
(RadioButtonSpec |
|
1213 |
label: '8' |
|
1214 |
name: 'RadioButton4' |
|
1215 |
translateLabel: true |
|
1216 |
model: tabStops |
|
1217 |
isTriggerOnDown: true |
|
1218 |
select: 8 |
|
1219 |
extent: (Point 136 22) |
|
1220 |
) |
|
1221 |
) |
|
1222 |
||
1223 |
) |
|
1224 |
) |
|
1225 |
(HorizontalPanelViewSpec |
|
1226 |
name: 'ButtonPanel' |
|
1227 |
layout: (LayoutFrame 0 0 -30 1 0 1 0 1) |
|
1228 |
horizontalLayout: fitSpace |
|
1229 |
verticalLayout: center |
|
1230 |
horizontalSpace: 3 |
|
1231 |
verticalSpace: 3 |
|
1232 |
reverseOrderIfOKAtLeft: true |
|
1233 |
component: |
|
1234 |
(SpecCollection |
|
1235 |
collection: ( |
|
1236 |
(ActionButtonSpec |
|
1237 |
label: 'Cancel' |
|
1238 |
name: 'Button2' |
|
1239 |
translateLabel: true |
|
1240 |
model: cancel |
|
1241 |
extent: (Point 185 22) |
|
1242 |
) |
|
1243 |
(ActionButtonSpec |
|
1244 |
label: 'OK' |
|
1245 |
name: 'Button1' |
|
1246 |
translateLabel: true |
|
1247 |
model: accept |
|
1248 |
isDefault: true |
|
1249 |
extent: (Point 185 22) |
|
1250 |
) |
|
1251 |
) |
|
1252 |
||
1253 |
) |
|
1254 |
) |
|
1255 |
) |
|
1256 |
||
1257 |
) |
|
1258 |
) |
|
5528 | 1259 |
! ! |
1260 |
||
3892 | 1261 |
!AbstractFileBrowser class methodsFor:'menu specs'! |
1262 |
||
1263 |
baseBookmarksMenuSpec |
|
1264 |
"This resource specification was automatically generated |
|
1265 |
by the MenuEditor of ST/X." |
|
1266 |
||
1267 |
"Do not manually edit this!! If it is corrupted, |
|
1268 |
the MenuEditor may not be able to read the specification." |
|
1269 |
||
1270 |
" |
|
1271 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#baseBookmarksMenuSpec |
|
1272 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser baseBookmarksMenuSpec)) startUp |
|
1273 |
" |
|
1274 |
||
1275 |
<resource: #menu> |
|
1276 |
||
1277 |
^ |
|
6551 | 1278 |
#(Menu |
1279 |
( |
|
1280 |
(MenuItem |
|
1281 |
enabled: currentFilesHasDirectories |
|
1282 |
label: 'Add Bookmark' |
|
1283 |
itemValue: addBookmark |
|
1284 |
translateLabel: true |
|
4414 | 1285 |
) |
6551 | 1286 |
(MenuItem |
1287 |
enabled: hasBookmarksToRemove |
|
1288 |
label: 'Remove Bookmark' |
|
1289 |
itemValue: removeBookmark |
|
1290 |
translateLabel: true |
|
4414 | 1291 |
) |
6551 | 1292 |
(MenuItem |
1293 |
label: 'Save Bookmarks In...' |
|
1294 |
itemValue: saveBookmarks |
|
1295 |
translateLabel: true |
|
4679 | 1296 |
) |
4414 | 1297 |
) |
1298 |
nil |
|
1299 |
nil |
|
3892 | 1300 |
) |
1301 |
! |
|
1302 |
||
6102 | 1303 |
baseBookmarksMenuSpec2 |
1304 |
"This resource specification was automatically generated |
|
1305 |
by the MenuEditor of ST/X." |
|
1306 |
||
1307 |
"Do not manually edit this!! If it is corrupted, |
|
1308 |
the MenuEditor may not be able to read the specification." |
|
1309 |
||
1310 |
" |
|
8013 | 1311 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#baseBookmarksMenuSpec2 |
1312 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser baseBookmarksMenuSpec2)) startUp |
|
6102 | 1313 |
" |
1314 |
||
1315 |
<resource: #menu> |
|
1316 |
||
1317 |
^ |
|
8013 | 1318 |
#(Menu |
1319 |
( |
|
1320 |
(MenuItem |
|
1321 |
label: 'Edit Bookmarks' |
|
1322 |
itemValue: editBookmarks |
|
1323 |
translateLabel: true |
|
1324 |
) |
|
1325 |
(MenuItem |
|
1326 |
label: '-' |
|
1327 |
) |
|
1328 |
(MenuItem |
|
1329 |
enabled: currentFilesHasDirectories |
|
1330 |
label: 'Add Bookmark' |
|
1331 |
itemValue: addBookmark |
|
1332 |
translateLabel: true |
|
6102 | 1333 |
) |
1334 |
) |
|
1335 |
nil |
|
1336 |
nil |
|
1337 |
) |
|
1338 |
! |
|
1339 |
||
4110 | 1340 |
browserMenu |
1341 |
"This resource specification was automatically generated |
|
1342 |
by the MenuEditor of ST/X." |
|
1343 |
||
1344 |
"Do not manually edit this!! If it is corrupted, |
|
1345 |
the MenuEditor may not be able to read the specification." |
|
1346 |
||
10923 | 1347 |
|
4110 | 1348 |
" |
1349 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#browserMenu |
|
1350 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser browserMenu)) startUp |
|
1351 |
" |
|
1352 |
||
1353 |
<resource: #menu> |
|
1354 |
||
1355 |
^ |
|
5273 | 1356 |
#(Menu |
1357 |
( |
|
1358 |
(MenuItem |
|
7315 | 1359 |
label: 'Spawn Filebrowser' |
5273 | 1360 |
itemValue: doSpawn |
1361 |
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
|
1362 |
shortcutKey: Ctrln |
4201 | 1363 |
) |
5273 | 1364 |
(MenuItem |
7829 | 1365 |
label: 'Windows Explorer' |
1366 |
itemValue: doOpenExplorer |
|
1367 |
translateLabel: true |
|
8256 | 1368 |
isVisible: systemIsDOS |
1369 |
) |
|
1370 |
(MenuItem |
|
1371 |
label: 'C Browser' |
|
1372 |
itemValue: doOpenCBrowser |
|
1373 |
translateLabel: true |
|
10747
aa57b76e8318
added: #cBrowserMenuItemVisible
Claus Gittinger <cg@exept.de>
parents:
10678
diff
changeset
|
1374 |
isVisible: cBrowserMenuItemVisible |
7829 | 1375 |
) |
1376 |
(MenuItem |
|
5273 | 1377 |
label: '-' |
4201 | 1378 |
) |
5273 | 1379 |
(MenuItem |
6335 | 1380 |
label: 'Add Text Editor Page' |
5273 | 1381 |
itemValue: newTextEditor |
1382 |
translateLabel: true |
|
5963
57ae5e061db8
Accelerator Ctrl-t for new text editor
Stefan Vogel <sv@exept.de>
parents:
5962
diff
changeset
|
1383 |
shortcutKey: Ctrlt |
4392 | 1384 |
) |
5273 | 1385 |
(MenuItem |
6335 | 1386 |
label: 'Add Shell Terminal Page' |
5273 | 1387 |
itemValue: doAddTerminal |
1388 |
translateLabel: true |
|
4201 | 1389 |
) |
5273 | 1390 |
(MenuItem |
10923 | 1391 |
label: 'Add Archiver Page' |
1392 |
itemValue: doAddArchiver |
|
1393 |
translateLabel: true |
|
1394 |
) |
|
1395 |
(MenuItem |
|
6335 | 1396 |
label: 'Add Search Page' |
5273 | 1397 |
itemValue: doOpenSearchFile |
1398 |
translateLabel: true |
|
4201 | 1399 |
) |
5273 | 1400 |
(MenuItem |
1401 |
label: '-' |
|
11053 | 1402 |
isVisible: false |
4201 | 1403 |
) |
5273 | 1404 |
(MenuItem |
1405 |
label: 'Settings...' |
|
1406 |
itemValue: doOpenSettings |
|
1407 |
translateLabel: true |
|
11053 | 1408 |
isVisible: false |
5104 | 1409 |
) |
5273 | 1410 |
(MenuItem |
5528 | 1411 |
label: 'Encoding...' |
1412 |
itemValue: fileEncodingDialog |
|
1413 |
translateLabel: true |
|
11053 | 1414 |
isVisible: false |
1415 |
) |
|
1416 |
(MenuItem |
|
1417 |
label: 'Line End Convention...' |
|
1418 |
itemValue: lineEndConventionDialog |
|
1419 |
translateLabel: true |
|
1420 |
isVisible: false |
|
1421 |
) |
|
1422 |
(MenuItem |
|
1423 |
label: 'Tab Stop Conversion...' |
|
1424 |
itemValue: tabStopConversionDialog |
|
1425 |
translateLabel: true |
|
1426 |
isVisible: false |
|
5528 | 1427 |
) |
1428 |
(MenuItem |
|
5273 | 1429 |
label: '-' |
5104 | 1430 |
) |
5273 | 1431 |
(MenuItem |
1432 |
label: 'Exit' |
|
1433 |
itemValue: closeRequest |
|
1434 |
translateLabel: true |
|
4201 | 1435 |
) |
1436 |
) |
|
1437 |
nil |
|
1438 |
nil |
|
4110 | 1439 |
) |
11057 | 1440 |
|
1441 |
"Modified: / 07-01-2012 / 12:51:20 / cg" |
|
4110 | 1442 |
! |
1443 |
||
4107 | 1444 |
cvsMenu |
1445 |
"This resource specification was automatically generated |
|
1446 |
by the MenuEditor of ST/X." |
|
1447 |
||
1448 |
"Do not manually edit this!! If it is corrupted, |
|
1449 |
the MenuEditor may not be able to read the specification." |
|
1450 |
||
1451 |
" |
|
1452 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#cvsMenu |
|
1453 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser cvsMenu)) startUp |
|
1454 |
" |
|
1455 |
||
1456 |
<resource: #menu> |
|
1457 |
||
1458 |
^ |
|
1459 |
#(#Menu |
|
4414 | 1460 |
#( |
1461 |
#(#MenuItem |
|
10554 | 1462 |
#label: 'Commit (CVS)...' |
4414 | 1463 |
#itemValue: #cvsCommit |
1464 |
#translateLabel: true |
|
1465 |
) |
|
1466 |
#(#MenuItem |
|
1467 |
#enabled: #canCvsAddAndCommit |
|
1468 |
#label: 'Add && Commit...' |
|
1469 |
#itemValue: #cvsAddAndCommit |
|
1470 |
#translateLabel: true |
|
1471 |
) |
|
1472 |
#(#MenuItem |
|
4849 | 1473 |
#enabled: #canCvsAddAndCommit |
1474 |
#label: 'Add as Binary && Commit...' |
|
1475 |
#itemValue: #cvsAddBinaryAndCommit |
|
1476 |
#translateLabel: true |
|
1477 |
) |
|
1478 |
#(#MenuItem |
|
4414 | 1479 |
#label: '-' |
1480 |
) |
|
1481 |
#(#MenuItem |
|
6316 | 1482 |
#enabled: #hasSelection |
8562 | 1483 |
#label: 'Tag...' |
1484 |
#itemValue: #cvsTagSelection |
|
1485 |
#translateLabel: true |
|
1486 |
) |
|
1487 |
#(#MenuItem |
|
9338 | 1488 |
#enabled: #hasSelection |
1489 |
#label: 'Revision Log' |
|
1490 |
#itemValue: #cvsRevisionLog |
|
1491 |
#translateLabel: true |
|
1492 |
) |
|
1493 |
#(#MenuItem |
|
9407
cf114ba82b6d
added: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
9405
diff
changeset
|
1494 |
#enabled: #hasSelection |
cf114ba82b6d
added: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
9405
diff
changeset
|
1495 |
#label: 'Compare with newest in Repository' |
cf114ba82b6d
added: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
9405
diff
changeset
|
1496 |
#itemValue: #cvsCompareWithNewest |
cf114ba82b6d
added: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
9405
diff
changeset
|
1497 |
#translateLabel: true |
cf114ba82b6d
added: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
9405
diff
changeset
|
1498 |
) |
cf114ba82b6d
added: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
9405
diff
changeset
|
1499 |
#(#MenuItem |
8562 | 1500 |
#label: '-' |
1501 |
) |
|
1502 |
#(#MenuItem |
|
1503 |
#enabled: #hasSelection |
|
6316 | 1504 |
#label: 'Update selected Files/Directories' |
1505 |
#itemValue: #cvsUpdateSelection |
|
1506 |
#translateLabel: true |
|
1507 |
) |
|
1508 |
#(#MenuItem |
|
1509 |
#label: 'Update Directory Local' |
|
1510 |
#itemValue: #cvsUpdateAll |
|
1511 |
#translateLabel: true |
|
1512 |
) |
|
1513 |
#(#MenuItem |
|
1514 |
#label: 'Update Directory Recursive' |
|
1515 |
#itemValue: #cvsUpdateAllRecursive |
|
1516 |
#translateLabel: true |
|
1517 |
) |
|
1518 |
#(#MenuItem |
|
1519 |
#label: '-' |
|
1520 |
) |
|
1521 |
#(#MenuItem |
|
4414 | 1522 |
#enabled: #canRemoveCVSContainer |
1523 |
#label: 'Remove File && CVS Container...' |
|
1524 |
#itemValue: #cvsRemoveFileAndCVSContainer |
|
1525 |
#translateLabel: true |
|
1526 |
) |
|
1527 |
) |
|
1528 |
nil |
|
1529 |
nil |
|
4107 | 1530 |
) |
10554 | 1531 |
|
1532 |
"Modified: / 08-08-2011 / 19:30:45 / cg" |
|
4107 | 1533 |
! |
1534 |
||
3892 | 1535 |
directoryMenu |
1536 |
"This resource specification was automatically generated |
|
1537 |
by the MenuEditor of ST/X." |
|
1538 |
||
1539 |
"Do not manually edit this!! If it is corrupted, |
|
1540 |
the MenuEditor may not be able to read the specification." |
|
1541 |
||
1542 |
" |
|
1543 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#directoryMenu |
|
1544 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser directoryMenu)) startUp |
|
1545 |
" |
|
1546 |
||
1547 |
<resource: #menu> |
|
1548 |
||
1549 |
^ |
|
6220 | 1550 |
#(Menu |
1551 |
( |
|
1552 |
(MenuItem |
|
1553 |
label: 'Up' |
|
1554 |
itemValue: doGoDirectoryUp |
|
1555 |
translateLabel: true |
|
4414 | 1556 |
) |
6220 | 1557 |
(MenuItem |
1558 |
label: '-' |
|
4414 | 1559 |
) |
6220 | 1560 |
(MenuItem |
1561 |
activeHelpKey: directoryBack |
|
1562 |
enabled: enableBack |
|
1563 |
label: 'Back' |
|
1564 |
itemValue: doBack |
|
1565 |
translateLabel: true |
|
4414 | 1566 |
) |
6220 | 1567 |
(MenuItem |
1568 |
activeHelpKey: directoryBack |
|
1569 |
enabled: enableForward |
|
1570 |
label: 'Forward' |
|
1571 |
itemValue: doForward |
|
1572 |
translateLabel: true |
|
4414 | 1573 |
) |
6220 | 1574 |
(MenuItem |
1575 |
label: '-' |
|
4414 | 1576 |
) |
6220 | 1577 |
(MenuItem |
9596 | 1578 |
enabled: enableHome |
6434 | 1579 |
label: 'Home Directory' |
1580 |
itemValue: doGotoHomeDirectory |
|
1581 |
translateLabel: true |
|
1582 |
) |
|
1583 |
(MenuItem |
|
9596 | 1584 |
enabled: enableGotoDesktopDirectory |
9572 | 1585 |
label: 'Desktop' |
1586 |
itemValue: doGotoDesktopDirectory |
|
1587 |
translateLabel: true |
|
1588 |
isVisible: gotoDesktopDirectoryIsVisible |
|
1589 |
) |
|
1590 |
(MenuItem |
|
9596 | 1591 |
enabled: enableGotoDefaultDirectory |
6434 | 1592 |
label: 'Default (Current) Directory' |
6220 | 1593 |
itemValue: doGotoDefaultDirectory |
9596 | 1594 |
translateLabel: true |
6456 | 1595 |
isVisible: gotoDefaultDirectoryIsVisible |
9596 | 1596 |
) |
1597 |
(MenuItem |
|
1598 |
enabled: enableGotoSmalltalkDirectory |
|
1599 |
label: 'Smalltalk (Application) Directory' |
|
1600 |
itemValue: doGotoSmalltalkDirectory |
|
6220 | 1601 |
translateLabel: true |
4414 | 1602 |
) |
6220 | 1603 |
(MenuItem |
9677 | 1604 |
enabled: enableGotoTempDirectory |
1605 |
label: 'Temp Directory' |
|
1606 |
itemValue: doGotoTempDirectory |
|
1607 |
translateLabel: true |
|
1608 |
) |
|
1609 |
(MenuItem |
|
9596 | 1610 |
label: '-' |
1611 |
) |
|
1612 |
(MenuItem |
|
1613 |
enabled: enableMakeCurrentDirectory |
|
1614 |
label: 'Make this the Default (Current) Directory' |
|
1615 |
itemValue: doMakeCurrentDirectory |
|
6220 | 1616 |
translateLabel: true |
4414 | 1617 |
) |
6220 | 1618 |
(MenuItem |
9596 | 1619 |
label: '-' |
1620 |
) |
|
1621 |
(MenuItem |
|
6220 | 1622 |
label: 'Bookmarks' |
1623 |
translateLabel: true |
|
9111
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1624 |
submenuChannel: bookmarksMenu |
4414 | 1625 |
) |
6220 | 1626 |
(MenuItem |
1627 |
label: 'Visited Directories' |
|
1628 |
translateLabel: true |
|
1629 |
submenuChannel: visitedDirectoriesMenu |
|
4414 | 1630 |
) |
1631 |
) |
|
1632 |
nil |
|
1633 |
nil |
|
3892 | 1634 |
) |
9572 | 1635 |
|
9677 | 1636 |
"Modified: / 29-12-2010 / 11:00:58 / cg" |
3892 | 1637 |
! |
1638 |
||
1639 |
editMenu |
|
1640 |
"This resource specification was automatically generated |
|
1641 |
by the MenuEditor of ST/X." |
|
1642 |
||
1643 |
"Do not manually edit this!! If it is corrupted, |
|
1644 |
the MenuEditor may not be able to read the specification." |
|
1645 |
||
1646 |
" |
|
1647 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#editMenu |
|
1648 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser editMenu)) startUp |
|
1649 |
" |
|
1650 |
||
1651 |
<resource: #menu> |
|
1652 |
||
1653 |
^ |
|
5888 | 1654 |
#(Menu |
1655 |
( |
|
1656 |
(MenuItem |
|
1657 |
enabled: hasFileSelection |
|
1658 |
label: 'Copy Selected Filenames to Clipboard' |
|
1659 |
itemValue: copySelectedFilenames |
|
1660 |
translateLabel: true |
|
4414 | 1661 |
) |
5888 | 1662 |
(MenuItem |
1663 |
enabled: fileListIsNotEmpty |
|
1664 |
label: 'Copy All Filenames to Clipboard' |
|
1665 |
itemValue: copyFileList |
|
1666 |
translateLabel: true |
|
4940
4964068c4718
allow settings dialog to be opened from browser
Claus Gittinger <cg@exept.de>
parents:
4930
diff
changeset
|
1667 |
) |
4414 | 1668 |
) |
1669 |
nil |
|
1670 |
nil |
|
3892 | 1671 |
) |
1672 |
! |
|
1673 |
||
6099 | 1674 |
emptyMenuSpec |
1675 |
"This resource specification was automatically generated |
|
1676 |
by the MenuEditor of ST/X." |
|
1677 |
||
1678 |
"Do not manually edit this!! If it is corrupted, |
|
1679 |
the MenuEditor may not be able to read the specification." |
|
1680 |
||
1681 |
" |
|
1682 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#emptyMenuSpec |
|
1683 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser emptyMenuSpec)) startUp |
|
1684 |
" |
|
1685 |
||
1686 |
<resource: #menu> |
|
1687 |
||
1688 |
^ |
|
1689 |
#(#Menu |
|
1690 |
#( |
|
1691 |
) |
|
1692 |
nil |
|
1693 |
nil |
|
1694 |
) |
|
1695 |
! |
|
1696 |
||
11053 | 1697 |
extraMenu |
1698 |
"This resource specification was automatically generated |
|
1699 |
by the MenuEditor of ST/X." |
|
1700 |
||
1701 |
"Do not manually edit this!! If it is corrupted, |
|
1702 |
the MenuEditor may not be able to read the specification." |
|
1703 |
||
1704 |
||
1705 |
" |
|
1706 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#extraMenu |
|
1707 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser extraMenu)) startUp |
|
1708 |
" |
|
1709 |
||
1710 |
<resource: #menu> |
|
1711 |
||
1712 |
^ |
|
1713 |
#(Menu |
|
1714 |
( |
|
1715 |
(MenuItem |
|
1716 |
label: 'Encoding...' |
|
1717 |
itemValue: fileEncodingDialog |
|
1718 |
translateLabel: true |
|
1719 |
) |
|
1720 |
(MenuItem |
|
1721 |
label: 'Line End Convention...' |
|
1722 |
itemValue: lineEndConventionDialog |
|
1723 |
translateLabel: true |
|
1724 |
) |
|
1725 |
(MenuItem |
|
1726 |
label: 'Tab Stop Conversion...' |
|
1727 |
itemValue: tabStopConversionDialog |
|
1728 |
translateLabel: true |
|
1729 |
) |
|
1730 |
(MenuItem |
|
1731 |
label: '-' |
|
1732 |
) |
|
1733 |
(MenuItem |
|
1734 |
label: 'Settings...' |
|
1735 |
itemValue: doOpenSettings |
|
1736 |
translateLabel: true |
|
1737 |
) |
|
1738 |
) |
|
1739 |
nil |
|
1740 |
nil |
|
1741 |
) |
|
1742 |
! |
|
1743 |
||
3892 | 1744 |
fileMenu |
1745 |
"This resource specification was automatically generated |
|
1746 |
by the MenuEditor of ST/X." |
|
1747 |
||
1748 |
"Do not manually edit this!! If it is corrupted, |
|
1749 |
the MenuEditor may not be able to read the specification." |
|
1750 |
||
1751 |
" |
|
1752 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#fileMenu |
|
1753 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser fileMenu)) startUp |
|
1754 |
" |
|
1755 |
||
1756 |
<resource: #menu> |
|
1757 |
||
1758 |
^ |
|
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1759 |
#(Menu |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1760 |
( |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1761 |
(MenuItem |
6593 | 1762 |
label: 'Open' |
1763 |
itemValue: doShowFileContents |
|
1764 |
translateLabel: true |
|
1765 |
) |
|
1766 |
(MenuItem |
|
9343
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
1767 |
label: '-' |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
1768 |
) |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
1769 |
(MenuItem |
6593 | 1770 |
enabled: hasFileSelection |
1771 |
label: 'FileIn' |
|
1772 |
itemValue: fileFileIn |
|
1773 |
translateLabel: true |
|
1774 |
) |
|
1775 |
(MenuItem |
|
1776 |
enabled: hasFileSelection |
|
1777 |
label: 'FileIn to Namespace...' |
|
1778 |
itemValue: fileFileInToNameSpace |
|
1779 |
translateLabel: true |
|
1780 |
) |
|
1781 |
(MenuItem |
|
1782 |
label: '-' |
|
1783 |
) |
|
1784 |
(MenuItem |
|
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1785 |
label: 'New' |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1786 |
translateLabel: true |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1787 |
submenuChannel: newMenu |
5425 | 1788 |
keepLinkedMenu: true |
4414 | 1789 |
) |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1790 |
(MenuItem |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1791 |
label: '-' |
4534 | 1792 |
) |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1793 |
(MenuItem |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1794 |
enabled: hasSelection |
5945 | 1795 |
label: 'Cut' |
1796 |
itemValue: cutFiles |
|
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1797 |
translateLabel: true |
4789
238d5e783f5c
editMenu was really a file menu
Claus Gittinger <cg@exept.de>
parents:
4785
diff
changeset
|
1798 |
) |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1799 |
(MenuItem |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1800 |
enabled: hasSelection |
5945 | 1801 |
label: 'Copy' |
1802 |
itemValue: copyFiles |
|
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1803 |
translateLabel: true |
4789
238d5e783f5c
editMenu was really a file menu
Claus Gittinger <cg@exept.de>
parents:
4785
diff
changeset
|
1804 |
) |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1805 |
(MenuItem |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1806 |
enabled: canPaste |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1807 |
label: 'Paste' |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1808 |
itemValue: pasteFiles |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1809 |
translateLabel: true |
4789
238d5e783f5c
editMenu was really a file menu
Claus Gittinger <cg@exept.de>
parents:
4785
diff
changeset
|
1810 |
) |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1811 |
(MenuItem |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1812 |
enabled: hasSelection |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1813 |
label: 'Delete' |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1814 |
itemValue: deleteFiles |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1815 |
translateLabel: true |
4789
238d5e783f5c
editMenu was really a file menu
Claus Gittinger <cg@exept.de>
parents:
4785
diff
changeset
|
1816 |
) |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1817 |
(MenuItem |
6169 | 1818 |
enabled: hasSelection |
1819 |
label: 'Erase' |
|
1820 |
itemValue: eraseFiles |
|
1821 |
translateLabel: true |
|
1822 |
) |
|
1823 |
(MenuItem |
|
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1824 |
label: '-' |
4789
238d5e783f5c
editMenu was really a file menu
Claus Gittinger <cg@exept.de>
parents:
4785
diff
changeset
|
1825 |
) |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1826 |
(MenuItem |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1827 |
enabled: hasSelection |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1828 |
label: 'Rename...' |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1829 |
itemValue: renameSelection |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1830 |
translateLabel: true |
8716 | 1831 |
shortcutKey: Rename |
4414 | 1832 |
) |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1833 |
(MenuItem |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1834 |
enabled: hasSelection |
5634 | 1835 |
label: 'Move To...' |
6107 | 1836 |
itemValue: moveSelectionTo |
1837 |
translateLabel: true |
|
1838 |
) |
|
1839 |
(MenuItem |
|
1840 |
enabled: hasSelection |
|
1841 |
label: 'Copy To...' |
|
1842 |
itemValue: copySelectionTo |
|
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1843 |
translateLabel: true |
4414 | 1844 |
) |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1845 |
(MenuItem |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1846 |
enabled: hasSelection |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1847 |
label: 'Properties...' |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1848 |
itemValue: doShowProperties |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1849 |
translateLabel: true |
4554 | 1850 |
) |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1851 |
(MenuItem |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1852 |
label: '-' |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1853 |
isVisible: javaSupportLoaded |
4414 | 1854 |
) |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1855 |
(MenuItem |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1856 |
enabled: canAddToClassPath |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1857 |
label: 'Add to Java Class Path' |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1858 |
translateLabel: true |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1859 |
isVisible: javaSupportLoaded |
4414 | 1860 |
) |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1861 |
(MenuItem |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1862 |
enabled: canRemoveFromClassPath |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1863 |
label: 'Remove from Java Class Path' |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1864 |
translateLabel: true |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1865 |
isVisible: javaSupportLoaded |
4414 | 1866 |
) |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1867 |
(MenuItem |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1868 |
enabled: canAddToSourcePath |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1869 |
label: 'Add to Java Source Path' |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1870 |
translateLabel: true |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1871 |
isVisible: javaSupportLoaded |
4414 | 1872 |
) |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1873 |
(MenuItem |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1874 |
enabled: canRemoveFromSourcePath |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1875 |
label: 'Remove from Java Source Path' |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1876 |
translateLabel: true |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1877 |
isVisible: javaSupportLoaded |
4414 | 1878 |
) |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1879 |
(MenuItem |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1880 |
label: '-' |
5242
04616d3a672c
history fixed (only kept the oldest items, instead of the newest ones)
Claus Gittinger <cg@exept.de>
parents:
5162
diff
changeset
|
1881 |
) |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1882 |
(MenuItem |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1883 |
enabled: enableFileHistory |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1884 |
label: 'File History' |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1885 |
translateLabel: true |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1886 |
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
|
1887 |
) |
4414 | 1888 |
) |
1889 |
nil |
|
1890 |
nil |
|
3892 | 1891 |
) |
7635 | 1892 |
|
1893 |
"Modified: / 07-02-2007 / 18:44:54 / cg" |
|
3892 | 1894 |
! |
1895 |
||
4930 | 1896 |
fileOpMenu |
1897 |
"This resource specification was automatically generated |
|
1898 |
by the MenuEditor of ST/X." |
|
1899 |
||
1900 |
"Do not manually edit this!! If it is corrupted, |
|
1901 |
the MenuEditor may not be able to read the specification." |
|
1902 |
||
1903 |
" |
|
1904 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#fileOpMenu |
|
1905 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser fileOpMenu)) startUp |
|
1906 |
" |
|
1907 |
||
1908 |
<resource: #menu> |
|
1909 |
||
1910 |
^ |
|
8640
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1911 |
#(Menu |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1912 |
( |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1913 |
(MenuItem |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1914 |
label: 'Split...' |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1915 |
itemValue: splitSelectedFiles |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1916 |
translateLabel: true |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1917 |
) |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1918 |
(MenuItem |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1919 |
label: 'Join...' |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1920 |
itemValue: joinSelectedFiles |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1921 |
translateLabel: true |
4930 | 1922 |
) |
7635 | 1923 |
(MenuItem |
1924 |
label: 'Copy Corrupted File To...' |
|
1925 |
itemValue: copySelectionToRepairingCorruptedFiles |
|
1926 |
translateLabel: true |
|
1927 |
) |
|
8640
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1928 |
(MenuItem |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1929 |
label: '-' |
4930 | 1930 |
) |
8640
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1931 |
(MenuItem |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1932 |
label: 'Rot13...' |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1933 |
itemValue: filterSelectedFiles: |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1934 |
translateLabel: true |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1935 |
argument: rot13 |
4930 | 1936 |
) |
8640
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1937 |
(MenuItem |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1938 |
label: '-' |
4930 | 1939 |
) |
8640
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1940 |
(MenuItem |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1941 |
label: 'Truncate...' |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1942 |
itemValue: truncateSelectedFilesToZeroSize |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1943 |
translateLabel: true |
4930 | 1944 |
) |
9490 | 1945 |
(MenuItem |
1946 |
label: '-' |
|
1947 |
) |
|
1948 |
(MenuItem |
|
1949 |
label: 'Generate Signed Files' |
|
1950 |
itemValue: generateSignaturesForSelectedFiles |
|
1951 |
translateLabel: true |
|
1952 |
enabled: canGenerateSignatureFiles |
|
1953 |
) |
|
1954 |
(MenuItem |
|
1955 |
label: 'Generate Detached Signature Files (use for dll)' |
|
1956 |
itemValue: generateDetachedSignaturesForSelectedFiles |
|
1957 |
translateLabel: true |
|
1958 |
enabled: canGenerateSignatureFiles |
|
1959 |
) |
|
9596 | 1960 |
(MenuItem |
1961 |
label: '-' |
|
1962 |
) |
|
1963 |
(MenuItem |
|
1964 |
enabled: hasSelection |
|
1965 |
label: 'File Differences' |
|
1966 |
itemValue: openDiffView |
|
1967 |
translateLabel: true |
|
1968 |
isVisible: hasTwoFilesSelectedHolder |
|
1969 |
) |
|
1970 |
(MenuItem |
|
1971 |
enabled: hasSelection |
|
1972 |
label: 'File Differences...' |
|
1973 |
itemValue: openDiffView |
|
1974 |
translateLabel: true |
|
1975 |
isVisible: hasNotTwoFilesSelectedHolder |
|
1976 |
) |
|
1977 |
(MenuItem |
|
1978 |
enabled: hasSelection |
|
1979 |
label: 'Directory Differences' |
|
1980 |
itemValue: openDirectoryDiffView |
|
1981 |
translateLabel: true |
|
1982 |
isVisible: hasTwoDirectoriesSelectedHolder |
|
1983 |
) |
|
1984 |
(MenuItem |
|
1985 |
enabled: hasSelection |
|
1986 |
label: 'Directory Differences...' |
|
1987 |
itemValue: openDirectoryDiffView |
|
1988 |
translateLabel: true |
|
1989 |
isVisible: hasNotTwoDirectoriesSelectedHolder |
|
1990 |
) |
|
4930 | 1991 |
) |
1992 |
nil |
|
1993 |
nil |
|
1994 |
) |
|
9490 | 1995 |
|
9596 | 1996 |
"Modified: / 26-10-2010 / 17:16:05 / cg" |
4930 | 1997 |
! |
1998 |
||
3892 | 1999 |
newMenu |
2000 |
"This resource specification was automatically generated |
|
2001 |
by the MenuEditor of ST/X." |
|
2002 |
||
2003 |
"Do not manually edit this!! If it is corrupted, |
|
2004 |
the MenuEditor may not be able to read the specification." |
|
2005 |
||
2006 |
" |
|
2007 |
MenuEditor new openOnClass:DirectoryTreeBrowser andSelector:#newMenu |
|
2008 |
(Menu new fromLiteralArrayEncoding:(DirectoryTreeBrowser newMenu)) startUp |
|
2009 |
" |
|
2010 |
||
2011 |
<resource: #menu> |
|
2012 |
||
2013 |
^ |
|
2014 |
#(#Menu |
|
4414 | 2015 |
#( |
2016 |
#(#MenuItem |
|
2017 |
#label: 'Directory...' |
|
2018 |
#translateLabel: true |
|
2019 |
#value: #newDirectory |
|
2020 |
) |
|
2021 |
#(#MenuItem |
|
2022 |
#label: 'File...' |
|
2023 |
#translateLabel: true |
|
2024 |
#value: #newFile |
|
2025 |
) |
|
2026 |
#(#MenuItem |
|
2027 |
#label: 'Hard Link...' |
|
2028 |
#translateLabel: true |
|
2029 |
#isVisible: #systemIsUnix |
|
2030 |
#value: #newHardLink |
|
2031 |
) |
|
2032 |
#(#MenuItem |
|
2033 |
#label: 'Symbolic Link...' |
|
2034 |
#translateLabel: true |
|
2035 |
#isVisible: #systemIsUnix |
|
2036 |
#value: #newSoftLink |
|
2037 |
) |
|
2038 |
) |
|
2039 |
nil |
|
2040 |
nil |
|
3892 | 2041 |
) |
3906 | 2042 |
! |
2043 |
||
4201 | 2044 |
showMenuSpec |
2045 |
"This resource specification was automatically generated |
|
2046 |
by the MenuEditor of ST/X." |
|
2047 |
||
2048 |
"Do not manually edit this!! If it is corrupted, |
|
2049 |
the MenuEditor may not be able to read the specification." |
|
2050 |
||
2051 |
" |
|
2052 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#showMenuSpec |
|
2053 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser showMenuSpec)) startUp |
|
2054 |
" |
|
2055 |
||
2056 |
<resource: #menu> |
|
2057 |
||
2058 |
^ |
|
9111
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2059 |
#(Menu |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2060 |
( |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2061 |
(MenuItem |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2062 |
label: 'Hidden Files' |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2063 |
translateLabel: true |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2064 |
hideMenuOnActivated: false |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2065 |
indication: showHiddenFiles |
4201 | 2066 |
) |
9111
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2067 |
(MenuItem |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2068 |
label: '-' |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2069 |
) |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2070 |
(MenuItem |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2071 |
label: 'Directory Tree' |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2072 |
translateLabel: true |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2073 |
hideMenuOnActivated: false |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2074 |
indication: showDirectoryTree |
4201 | 2075 |
) |
9111
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2076 |
(MenuItem |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2077 |
label: 'Regular Files in TreeView (Left)' |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2078 |
translateLabel: true |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2079 |
hideMenuOnActivated: false |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2080 |
indication: viewFilesInDirectoryTree |
4201 | 2081 |
) |
9111
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2082 |
(MenuItem |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2083 |
label: 'Directories in ContentsView (Right)' |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2084 |
translateLabel: true |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2085 |
hideMenuOnActivated: false |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2086 |
indication: viewDirsInContentsBrowser |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2087 |
) |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2088 |
(MenuItem |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2089 |
enabled: enableViewNoteBookApplication |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2090 |
label: 'File Applications' |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2091 |
translateLabel: true |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2092 |
hideMenuOnActivated: false |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2093 |
indication: viewNoteBookApplicationHolder |
4201 | 2094 |
) |
9111
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2095 |
(MenuItem |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2096 |
label: '-' |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2097 |
) |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2098 |
(MenuItem |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2099 |
label: 'DiskUsage' |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2100 |
translateLabel: true |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2101 |
hideMenuOnActivated: false |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2102 |
indication: showDiskUsageHolder |
4201 | 2103 |
) |
9111
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2104 |
) |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2105 |
nil |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2106 |
nil |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2107 |
) |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2108 |
! |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2109 |
|
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2110 |
showMenuSpecForDialog |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2111 |
"This resource specification was automatically generated |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2112 |
by the MenuEditor of ST/X." |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2113 |
|
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2114 |
"Do not manually edit this!! If it is corrupted, |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2115 |
the MenuEditor may not be able to read the specification." |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2116 |
|
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2117 |
" |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2118 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#showMenuSpecForDialog |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2119 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser showMenuSpecForDialog)) startUp |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2120 |
" |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2121 |
|
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2122 |
<resource: #menu> |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2123 |
|
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2124 |
^ |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2125 |
#(Menu |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2126 |
( |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2127 |
(MenuItem |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2128 |
label: 'Hidden Files' |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2129 |
translateLabel: true |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2130 |
hideMenuOnActivated: false |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2131 |
indication: showHiddenFiles |
4554 | 2132 |
) |
4201 | 2133 |
) |
2134 |
nil |
|
2135 |
nil |
|
2136 |
) |
|
2137 |
! |
|
2138 |
||
3906 | 2139 |
sortMenu |
2140 |
"This resource specification was automatically generated |
|
2141 |
by the MenuEditor of ST/X." |
|
2142 |
||
2143 |
"Do not manually edit this!! If it is corrupted, |
|
2144 |
the MenuEditor may not be able to read the specification." |
|
2145 |
||
2146 |
" |
|
3907 | 2147 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#sortMenu |
2148 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser sortMenu)) startUp |
|
3906 | 2149 |
" |
2150 |
||
2151 |
<resource: #menu> |
|
2152 |
||
2153 |
^ |
|
2154 |
#(#Menu |
|
4414 | 2155 |
#( |
2156 |
#(#MenuItem |
|
2157 |
#label: 'By Filename' |
|
2158 |
#translateLabel: true |
|
2159 |
#hideMenuOnActivated: false |
|
2160 |
#choice: #sortBlockProperty |
|
2161 |
#choiceValue: #baseName |
|
2162 |
) |
|
2163 |
#(#MenuItem |
|
5122 | 2164 |
#label: 'By Extension' |
4414 | 2165 |
#translateLabel: true |
2166 |
#hideMenuOnActivated: false |
|
2167 |
#choice: #sortBlockProperty |
|
2168 |
#choiceValue: #suffix |
|
2169 |
) |
|
2170 |
#(#MenuItem |
|
2171 |
#label: 'By Permissions' |
|
2172 |
#translateLabel: true |
|
2173 |
#hideMenuOnActivated: false |
|
2174 |
#choice: #sortBlockProperty |
|
2175 |
#choiceValue: #permissions |
|
2176 |
) |
|
2177 |
#(#MenuItem |
|
2178 |
#label: 'By Owner' |
|
2179 |
#translateLabel: true |
|
2180 |
#isVisible: #viewOwner |
|
2181 |
#hideMenuOnActivated: false |
|
2182 |
#choice: #sortBlockProperty |
|
2183 |
#choiceValue: #owner |
|
2184 |
) |
|
2185 |
#(#MenuItem |
|
2186 |
#label: 'By Group' |
|
2187 |
#translateLabel: true |
|
2188 |
#isVisible: #viewOwner |
|
2189 |
#hideMenuOnActivated: false |
|
2190 |
#choice: #sortBlockProperty |
|
2191 |
#choiceValue: #group |
|
2192 |
) |
|
2193 |
#(#MenuItem |
|
2194 |
#label: 'By Size' |
|
2195 |
#translateLabel: true |
|
2196 |
#hideMenuOnActivated: false |
|
2197 |
#choice: #sortBlockProperty |
|
2198 |
#choiceValue: #fileSize |
|
2199 |
) |
|
2200 |
#(#MenuItem |
|
2201 |
#label: 'By Date && Time' |
|
2202 |
#translateLabel: true |
|
2203 |
#hideMenuOnActivated: false |
|
2204 |
#choice: #sortBlockProperty |
|
2205 |
#choiceValue: #modificationTime |
|
2206 |
) |
|
2207 |
#(#MenuItem |
|
2208 |
#label: '-' |
|
2209 |
) |
|
2210 |
#(#MenuItem |
|
2211 |
#label: 'Ignore Case in Sort' |
|
2212 |
#translateLabel: true |
|
2213 |
#hideMenuOnActivated: false |
|
2214 |
#indication: #sortCaseless |
|
2215 |
) |
|
2216 |
#(#MenuItem |
|
2217 |
#label: 'Directories before Files' |
|
2218 |
#translateLabel: true |
|
2219 |
#hideMenuOnActivated: false |
|
2220 |
#indication: #sortDirectoriesBeforeFiles |
|
2221 |
) |
|
2222 |
) |
|
2223 |
nil |
|
2224 |
nil |
|
3906 | 2225 |
) |
4018 | 2226 |
! |
2227 |
||
4164
81154143d447
move toolsMenuSpec from FileBrowserV2 to AbstractFileBrowser
penk
parents:
4163
diff
changeset
|
2228 |
toolsMenuSpec |
81154143d447
move toolsMenuSpec from FileBrowserV2 to AbstractFileBrowser
penk
parents:
4163
diff
changeset
|
2229 |
"This resource specification was automatically generated |
81154143d447
move toolsMenuSpec from FileBrowserV2 to AbstractFileBrowser
penk
parents:
4163
diff
changeset
|
2230 |
by the MenuEditor of ST/X." |
81154143d447
move toolsMenuSpec from FileBrowserV2 to AbstractFileBrowser
penk
parents:
4163
diff
changeset
|
2231 |
|
81154143d447
move toolsMenuSpec from FileBrowserV2 to AbstractFileBrowser
penk
parents:
4163
diff
changeset
|
2232 |
"Do not manually edit this!! If it is corrupted, |
81154143d447
move toolsMenuSpec from FileBrowserV2 to AbstractFileBrowser
penk
parents:
4163
diff
changeset
|
2233 |
the MenuEditor may not be able to read the specification." |
81154143d447
move toolsMenuSpec from FileBrowserV2 to AbstractFileBrowser
penk
parents:
4163
diff
changeset
|
2234 |
|
81154143d447
move toolsMenuSpec from FileBrowserV2 to AbstractFileBrowser
penk
parents:
4163
diff
changeset
|
2235 |
" |
4367 | 2236 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#toolsMenuSpec |
2237 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser toolsMenuSpec)) startUp |
|
4164
81154143d447
move toolsMenuSpec from FileBrowserV2 to AbstractFileBrowser
penk
parents:
4163
diff
changeset
|
2238 |
" |
81154143d447
move toolsMenuSpec from FileBrowserV2 to AbstractFileBrowser
penk
parents:
4163
diff
changeset
|
2239 |
|
81154143d447
move toolsMenuSpec from FileBrowserV2 to AbstractFileBrowser
penk
parents:
4163
diff
changeset
|
2240 |
<resource: #menu> |
81154143d447
move toolsMenuSpec from FileBrowserV2 to AbstractFileBrowser
penk
parents:
4163
diff
changeset
|
2241 |
|
81154143d447
move toolsMenuSpec from FileBrowserV2 to AbstractFileBrowser
penk
parents:
4163
diff
changeset
|
2242 |
^ |
5830 | 2243 |
#(Menu |
2244 |
( |
|
2245 |
(MenuItem |
|
9343
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
2246 |
label: 'Open (Win32-Shell)' |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
2247 |
itemValue: doOpenWithShellCommand |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
2248 |
translateLabel: true |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
2249 |
isVisible: systemIsDOS |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
2250 |
) |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
2251 |
(MenuItem |
6528 | 2252 |
label: 'Execute UNIX Command...' |
5830 | 2253 |
itemValue: doExecuteCommand |
2254 |
translateLabel: true |
|
6528 | 2255 |
isVisible: systemIsUnix |
2256 |
) |
|
2257 |
(MenuItem |
|
2258 |
label: 'Execute DOS Command...' |
|
2259 |
itemValue: doExecuteCommand |
|
2260 |
translateLabel: true |
|
2261 |
isVisible: systemIsDOS |
|
4230 | 2262 |
) |
5830 | 2263 |
(MenuItem |
5880 | 2264 |
label: 'Execute Script...' |
2265 |
itemValue: doExecuteScript |
|
2266 |
translateLabel: true |
|
2267 |
) |
|
2268 |
(MenuItem |
|
5830 | 2269 |
enabled: canDoTerminal |
2270 |
label: 'Shell Terminal' |
|
2271 |
itemValue: openTerminal |
|
2272 |
translateLabel: true |
|
2273 |
isVisible: canDoTerminalAndSystemIsUnix |
|
4230 | 2274 |
) |
5830 | 2275 |
(MenuItem |
2276 |
enabled: canDoTerminal |
|
2277 |
label: 'DOS Terminal' |
|
2278 |
itemValue: openTerminal |
|
2279 |
translateLabel: true |
|
2280 |
isVisible: canDoTerminalAndSystemIsDOS |
|
4230 | 2281 |
) |
5830 | 2282 |
(MenuItem |
2283 |
label: '-' |
|
4230 | 2284 |
) |
5830 | 2285 |
(MenuItem |
2286 |
enabled: hasFileSelection |
|
2287 |
label: 'Changes Browser' |
|
2288 |
itemValue: openChangesBrowser |
|
2289 |
translateLabel: true |
|
4230 | 2290 |
) |
5830 | 2291 |
(MenuItem |
2292 |
enabled: hasFileSelection |
|
2293 |
label: 'ChangeSet Browser' |
|
2294 |
itemValue: openChangeSetBrowser |
|
2295 |
translateLabel: true |
|
6602 | 2296 |
isVisible: changeSetBrowserItemVisible |
4230 | 2297 |
) |
5830 | 2298 |
(MenuItem |
6022 | 2299 |
enabled: hasFileSelection |
2300 |
label: 'Workspace' |
|
2301 |
itemValue: openWorkspace |
|
2302 |
translateLabel: true |
|
2303 |
) |
|
2304 |
(MenuItem |
|
2305 |
label: '-' |
|
2306 |
) |
|
2307 |
(MenuItem |
|
5830 | 2308 |
enabled: canReadAbbrevFile |
2309 |
label: 'Install Autoloaded' |
|
2310 |
itemValue: readAbbrevFile |
|
2311 |
translateLabel: true |
|
4230 | 2312 |
) |
5830 | 2313 |
(MenuItem |
2314 |
enabled: anySTFilesPresent |
|
6521 | 2315 |
label: 'Install All ST-Files as Autoloaded' |
5830 | 2316 |
itemValue: installAllAsAutoloaded |
2317 |
translateLabel: true |
|
4230 | 2318 |
) |
5830 | 2319 |
(MenuItem |
6586 | 2320 |
enabled: recursiveAnySTFilesPresent |
6521 | 2321 |
label: 'Recursive Install All ST-Files as Autoloaded' |
2322 |
itemValue: installAllAsAutoloadedRecursive |
|
2323 |
translateLabel: true |
|
2324 |
) |
|
2325 |
(MenuItem |
|
5830 | 2326 |
label: '-' |
4230 | 2327 |
) |
5830 | 2328 |
(MenuItem |
6593 | 2329 |
label: 'File Operations' |
2330 |
translateLabel: true |
|
2331 |
submenuChannel: fileOpMenu |
|
2332 |
) |
|
2333 |
(MenuItem |
|
5830 | 2334 |
label: 'File Utilities' |
2335 |
translateLabel: true |
|
2336 |
submenu: |
|
2337 |
(Menu |
|
2338 |
( |
|
2339 |
(MenuItem |
|
2340 |
enabled: hasFileSelection |
|
2341 |
label: 'Editor' |
|
2342 |
itemValue: openEditor |
|
2343 |
translateLabel: true |
|
4820 | 2344 |
) |
5830 | 2345 |
(MenuItem |
2346 |
enabled: hasFileSelection |
|
2347 |
label: 'HTML Reader' |
|
2348 |
itemValue: openHTMLReader |
|
2349 |
translateLabel: true |
|
4820 | 2350 |
) |
5830 | 2351 |
(MenuItem |
8832 | 2352 |
enabled: hasFileSelection |
2353 |
label: 'Web Browser' |
|
2354 |
itemValue: openWebBrowser |
|
2355 |
translateLabel: true |
|
2356 |
) |
|
2357 |
(MenuItem |
|
7869 | 2358 |
label: 'XML Inspector' |
9784 | 2359 |
itemValue: inspectXmlFile |
7869 | 2360 |
translateLabel: true |
2361 |
isVisible: hasXml |
|
7897
598301fad7b4
Missing aspect #hasXmlFileSelection
Stefan Vogel <sv@exept.de>
parents:
7879
diff
changeset
|
2362 |
showBusyCursorWhilePerforming: true |
7869 | 2363 |
) |
2364 |
(MenuItem |
|
5830 | 2365 |
enabled: hasFileSelection |
2366 |
label: 'Acroread (PDF Viewer)' |
|
2367 |
itemValue: openPDFViewer |
|
2368 |
translateLabel: true |
|
4820 | 2369 |
) |
5830 | 2370 |
(MenuItem |
2371 |
enabled: hasASN1AndSelection |
|
2372 |
label: 'ASN1 Browser' |
|
2373 |
itemValue: openASN1Browser |
|
2374 |
translateLabel: true |
|
2375 |
isVisible: hasASN1 |
|
4820 | 2376 |
) |
5830 | 2377 |
(MenuItem |
2378 |
enabled: hasCBrowser |
|
2379 |
label: 'C Browser' |
|
2380 |
itemValue: openCBrowser |
|
2381 |
translateLabel: true |
|
2382 |
isVisible: hasCBrowser |
|
4820 | 2383 |
) |
5830 | 2384 |
(MenuItem |
2385 |
enabled: hasJavaAndSelection |
|
2386 |
label: 'Applet Viewer' |
|
2387 |
itemValue: openAppletViewer |
|
2388 |
translateLabel: true |
|
2389 |
isVisible: hasJava |
|
4820 | 2390 |
) |
5830 | 2391 |
(MenuItem |
2392 |
enabled: hasMP3PlayerAndSelection |
|
2393 |
label: 'MP3 Player' |
|
2394 |
itemValue: openMP3Player |
|
2395 |
translateLabel: true |
|
2396 |
isVisible: hasMP3Player |
|
4820 | 2397 |
) |
5830 | 2398 |
(MenuItem |
2399 |
enabled: hasFileSelection |
|
2400 |
label: 'xv (Image Viewer)' |
|
2401 |
itemValue: openXV |
|
2402 |
translateLabel: true |
|
6460 | 2403 |
isVisible: systemIsUnix |
4950 | 2404 |
) |
5830 | 2405 |
(MenuItem |
2406 |
enabled: currentFilesAreInSameDirectory |
|
2407 |
label: 'Slide Show' |
|
2408 |
itemValue: openSlideShow |
|
2409 |
translateLabel: true |
|
2410 |
isVisible: hasSlideShow |
|
4820 | 2411 |
) |
5830 | 2412 |
(MenuItem |
2413 |
enabled: hasFileSelection |
|
2414 |
label: 'gv (Postscript Viewer)' |
|
2415 |
itemValue: openGV |
|
2416 |
translateLabel: true |
|
6460 | 2417 |
isVisible: systemIsUnix |
2418 |
) |
|
2419 |
(MenuItem |
|
2420 |
enabled: hasMP3PlayerAndSelection |
|
2421 |
label: 'MP3 Player' |
|
2422 |
itemValue: openMP3Player |
|
2423 |
translateLabel: true |
|
2424 |
isVisible: hasMP3Player |
|
4957 | 2425 |
) |
5830 | 2426 |
(MenuItem |
2427 |
enabled: hasFileSelection |
|
9509 | 2428 |
label: 'Realplay (avi viewer)' |
5830 | 2429 |
itemValue: openRP |
2430 |
translateLabel: true |
|
6460 | 2431 |
isVisible: systemIsUnix |
2432 |
) |
|
2433 |
(MenuItem |
|
2434 |
label: '-' |
|
2435 |
) |
|
2436 |
(MenuItem |
|
2437 |
label: 'Smalltalk' |
|
2438 |
translateLabel: true |
|
2439 |
submenu: |
|
2440 |
(Menu |
|
2441 |
( |
|
2442 |
(MenuItem |
|
2443 |
enabled: hasSnapshotSelection |
|
2444 |
label: 'Snapshot Image Browser' |
|
2445 |
itemValue: openSnapshotImageBrowser |
|
2446 |
translateLabel: true |
|
2447 |
) |
|
2448 |
(MenuItem |
|
2449 |
enabled: canCreateNewProject |
|
2450 |
label: 'Create Smalltalk Project' |
|
2451 |
itemValue: createProjectAndOpenProjectBrowser |
|
2452 |
translateLabel: true |
|
2453 |
) |
|
2454 |
(MenuItem |
|
2455 |
label: '-' |
|
2456 |
) |
|
2457 |
(MenuItem |
|
8426 | 2458 |
enabled: hasResourceFileSelected |
6460 | 2459 |
label: 'Show Contents of Resourcefile' |
2460 |
itemValue: readAndShowResources |
|
2461 |
translateLabel: true |
|
2462 |
) |
|
8426 | 2463 |
(MenuItem |
2464 |
enabled: hasResourceFileSelected |
|
2465 |
label: 'Resource File Editor' |
|
2466 |
itemValue: openResourceFileEditor |
|
2467 |
translateLabel: true |
|
2468 |
showBusyCursorWhilePerforming: true |
|
2469 |
) |
|
8454
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
2470 |
(MenuItem |
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
2471 |
label: '-' |
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
2472 |
) |
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
2473 |
(MenuItem |
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
2474 |
enabled: hasFileSelection |
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
2475 |
label: 'Contents as ByteArray' |
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
2476 |
itemValue: fileContentsAsByteArray |
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
2477 |
translateLabel: true |
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
2478 |
) |
6460 | 2479 |
) |
2480 |
nil |
|
2481 |
nil |
|
2482 |
) |
|
2483 |
) |
|
2484 |
(MenuItem |
|
2485 |
label: 'Image' |
|
2486 |
translateLabel: true |
|
2487 |
submenu: |
|
2488 |
(Menu |
|
2489 |
( |
|
2490 |
(MenuItem |
|
2491 |
enabled: hasFileSelection |
|
2492 |
label: 'Image Editor' |
|
2493 |
itemValue: openImageEditor |
|
2494 |
translateLabel: true |
|
2495 |
) |
|
2496 |
(MenuItem |
|
2497 |
enabled: hasFileSelection |
|
2498 |
label: 'Image Preview' |
|
2499 |
itemValue: openImagePreview |
|
2500 |
translateLabel: true |
|
2501 |
) |
|
2502 |
(MenuItem |
|
2503 |
enabled: hasFileSelection |
|
2504 |
label: 'Image Inspector' |
|
2505 |
itemValue: openImageInspector |
|
2506 |
translateLabel: true |
|
2507 |
) |
|
2508 |
(MenuItem |
|
2509 |
label: '-' |
|
2510 |
) |
|
2511 |
(MenuItem |
|
2512 |
enabled: hasFileSelection |
|
2513 |
label: 'Convert to GIF' |
|
2514 |
itemValue: convertImageToGIF |
|
2515 |
translateLabel: true |
|
2516 |
) |
|
2517 |
(MenuItem |
|
2518 |
enabled: hasFileSelection |
|
2519 |
label: 'Convert to PNG' |
|
2520 |
itemValue: convertImageToPNG |
|
2521 |
translateLabel: true |
|
2522 |
) |
|
2523 |
(MenuItem |
|
2524 |
enabled: hasFileSelection |
|
2525 |
label: 'Convert to XPM' |
|
2526 |
itemValue: convertImageToXPM |
|
2527 |
translateLabel: true |
|
2528 |
) |
|
2529 |
(MenuItem |
|
2530 |
enabled: hasFileSelection |
|
2531 |
label: 'Convert to JPG' |
|
2532 |
itemValue: convertImageToJPG |
|
2533 |
translateLabel: true |
|
2534 |
) |
|
2535 |
) |
|
2536 |
nil |
|
2537 |
nil |
|
2538 |
) |
|
2539 |
) |
|
2540 |
(MenuItem |
|
9764
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
2541 |
enabled: hasZipFileSelectedHolder |
6460 | 2542 |
label: 'ZipFile Tool' |
2543 |
itemValue: openZipTool |
|
2544 |
translateLabel: true |
|
2545 |
) |
|
2546 |
(MenuItem |
|
2547 |
enabled: hasFileSelection |
|
2548 |
label: 'Hex Dump' |
|
2549 |
itemValue: fileHexDump |
|
2550 |
translateLabel: true |
|
4958 | 2551 |
) |
4820 | 2552 |
) |
2553 |
nil |
|
2554 |
nil |
|
2555 |
) |
|
4230 | 2556 |
) |
5830 | 2557 |
(MenuItem |
2558 |
label: 'Find' |
|
2559 |
translateLabel: true |
|
2560 |
submenu: |
|
2561 |
(Menu |
|
2562 |
( |
|
2563 |
(MenuItem |
|
2564 |
label: 'File...' |
|
2565 |
itemValue: fileFindFile |
|
2566 |
translateLabel: true |
|
4367 | 2567 |
) |
5830 | 2568 |
(MenuItem |
10306 | 2569 |
label: 'Same Contents as Selected...' |
10304
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
2570 |
itemValue: fileFindDuplicateFile |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
2571 |
translateLabel: true |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
2572 |
) |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
2573 |
(MenuItem |
5830 | 2574 |
label: 'Duplicate Files' |
2575 |
itemValue: fileFindDuplicates |
|
2576 |
translateLabel: true |
|
5082 | 2577 |
) |
5830 | 2578 |
(MenuItem |
2579 |
enabled: hasSelection |
|
2580 |
label: 'All Duplicate Files (Recursive)' |
|
2581 |
itemValue: fileFindAllDuplicates |
|
2582 |
translateLabel: true |
|
4367 | 2583 |
) |
8510 | 2584 |
(MenuItem |
2585 |
label: 'Similar Image Files' |
|
2586 |
itemValue: fileFindSimilarImages |
|
2587 |
translateLabel: true |
|
2588 |
isVisible: hasImageColorHistogram |
|
2589 |
) |
|
4367 | 2590 |
) |
2591 |
nil |
|
2592 |
nil |
|
2593 |
) |
|
4230 | 2594 |
) |
2595 |
) |
|
2596 |
nil |
|
2597 |
nil |
|
4164
81154143d447
move toolsMenuSpec from FileBrowserV2 to AbstractFileBrowser
penk
parents:
4163
diff
changeset
|
2598 |
) |
10306 | 2599 |
|
2600 |
"Modified: / 11-07-2011 / 14:28:09 / cg" |
|
4164
81154143d447
move toolsMenuSpec from FileBrowserV2 to AbstractFileBrowser
penk
parents:
4163
diff
changeset
|
2601 |
! |
81154143d447
move toolsMenuSpec from FileBrowserV2 to AbstractFileBrowser
penk
parents:
4163
diff
changeset
|
2602 |
|
4018 | 2603 |
viewDetailsMenuSpec |
2604 |
"This resource specification was automatically generated |
|
2605 |
by the MenuEditor of ST/X." |
|
2606 |
||
2607 |
"Do not manually edit this!! If it is corrupted, |
|
2608 |
the MenuEditor may not be able to read the specification." |
|
2609 |
||
2610 |
" |
|
4648 | 2611 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#viewDetailsMenuSpec |
2612 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser viewDetailsMenuSpec)) startUp |
|
4018 | 2613 |
" |
2614 |
||
2615 |
<resource: #menu> |
|
2616 |
||
2617 |
^ |
|
2618 |
#(#Menu |
|
4414 | 2619 |
#( |
2620 |
#(#MenuItem |
|
2621 |
#label: '-' |
|
2622 |
) |
|
2623 |
#(#MenuItem |
|
2624 |
#label: 'Hidden Files' |
|
2625 |
#translateLabel: true |
|
2626 |
#indication: #showHiddenFiles |
|
2627 |
) |
|
2628 |
) |
|
2629 |
nil |
|
2630 |
nil |
|
4018 | 2631 |
) |
3892 | 2632 |
! ! |
2633 |
||
2634 |
!AbstractFileBrowser class methodsFor:'misc'! |
|
2635 |
||
2636 |
newLock |
|
2637 |
^ CodeExecutionLock new |
|
2638 |
! ! |
|
2639 |
||
5644
e24749db1f5f
share resources with FileBrowser
Claus Gittinger <cg@exept.de>
parents:
5634
diff
changeset
|
2640 |
!AbstractFileBrowser class methodsFor:'resources'! |
e24749db1f5f
share resources with FileBrowser
Claus Gittinger <cg@exept.de>
parents:
5634
diff
changeset
|
2641 |
|
e24749db1f5f
share resources with FileBrowser
Claus Gittinger <cg@exept.de>
parents:
5634
diff
changeset
|
2642 |
classResources |
e24749db1f5f
share resources with FileBrowser
Claus Gittinger <cg@exept.de>
parents:
5634
diff
changeset
|
2643 |
^ FileBrowser classResources |
e24749db1f5f
share resources with FileBrowser
Claus Gittinger <cg@exept.de>
parents:
5634
diff
changeset
|
2644 |
! ! |
e24749db1f5f
share resources with FileBrowser
Claus Gittinger <cg@exept.de>
parents:
5634
diff
changeset
|
2645 |
|
4610 | 2646 |
!AbstractFileBrowser class methodsFor:'utilities'! |
2647 |
||
2648 |
contentsOfFileAsHexDump:f |
|
8472 | 2649 |
^ self contentsOfFileAsHexDump:f withLimit:nil lastPart:nil |
2650 |
! |
|
2651 |
||
2652 |
contentsOfFileAsHexDump:f withLimit:limitOrNil lastPart:showLastPartOrNil |
|
4610 | 2653 |
|resources fileName stream data offs |
8472 | 2654 |
addrDigits col line lineStream asciiLineStream lines answer sizeLimit showLastPart| |
4610 | 2655 |
|
2656 |
resources := self classResources. |
|
2657 |
||
2658 |
fileName := f baseName. |
|
2659 |
f isDirectory ifTrue:[ |
|
2660 |
Dialog warn:(resources string:'%1 is a directory.' with:fileName). |
|
2661 |
^ nil |
|
2662 |
]. |
|
2663 |
f exists ifFalse:[ |
|
2664 |
Dialog warn:(resources string:'oops, ''%1'' is gone or unreadable.' with:fileName). |
|
2665 |
^ nil |
|
2666 |
]. |
|
2667 |
f isReadable ifFalse:[ |
|
2668 |
Dialog warn:(resources string:'''%1'' is unreadable.' with:fileName). |
|
2669 |
^ nil |
|
2670 |
]. |
|
6672
478b83a3753a
max size to be shown without dialog
Claus Gittinger <cg@exept.de>
parents:
6671
diff
changeset
|
2671 |
f fileSize > (1024*1024) ifTrue:[ |
8472 | 2672 |
limitOrNil notNil ifTrue:[ |
2673 |
sizeLimit := limitOrNil. |
|
2674 |
showLastPart := showLastPartOrNil |
|
2675 |
] ifFalse:[ |
|
2676 |
answer := Dialog |
|
2677 |
confirmWithCancel:(resources |
|
2678 |
stringWithCRs:'"%1" is very large (%2).\\Show all or only the first 4 Mb ?' |
|
2679 |
with:(fileName contractTo:40) allBold |
|
2680 |
with:(UnitConverter fileSizeStringFor:f fileSize)) |
|
2681 |
labels:#('Cancel' 'Show All' 'Show First Part' ). |
|
2682 |
||
2683 |
answer isNil ifTrue:[^ nil]. |
|
2684 |
answer ifTrue:[ |
|
2685 |
sizeLimit := 4 * 1024 * 1024 |
|
2686 |
]. |
|
8436 | 2687 |
]. |
4610 | 2688 |
]. |
2689 |
||
2690 |
stream := f readStream binary. |
|
8436 | 2691 |
sizeLimit notNil ifTrue:[ |
8472 | 2692 |
showLastPart == true ifTrue:[ |
2693 |
stream position:(f fileSize - sizeLimit). |
|
2694 |
]. |
|
8436 | 2695 |
data := stream nextBytes:sizeLimit. |
2696 |
] ifFalse:[ |
|
2697 |
data := stream contents. |
|
2698 |
]. |
|
4610 | 2699 |
stream close. |
2700 |
||
2701 |
col := 1. |
|
2702 |
offs := 0. |
|
2703 |
lines := StringCollection new. |
|
2704 |
||
2705 |
addrDigits := ((f fileSize + 1) log:16) truncated + 1. |
|
2706 |
||
5755
5e8165d55605
replaced '' writeStream by String writeStream
Claus Gittinger <cg@exept.de>
parents:
5753
diff
changeset
|
2707 |
lineStream := String writeStream. |
5e8165d55605
replaced '' writeStream by String writeStream
Claus Gittinger <cg@exept.de>
parents:
5753
diff
changeset
|
2708 |
asciiLineStream := String writeStream. |
4610 | 2709 |
|
2710 |
lineStream nextPutAll:(offs hexPrintString:addrDigits). |
|
2711 |
lineStream nextPutAll:': '. |
|
2712 |
||
2713 |
data do:[:byte | |
|
2714 |
lineStream nextPutAll:(byte hexPrintString:2). |
|
2715 |
(byte between:32 and:127) ifTrue:[ |
|
2716 |
asciiLineStream nextPut:(Character value:byte) |
|
2717 |
] ifFalse:[ |
|
2718 |
asciiLineStream nextPut:$. |
|
2719 |
]. |
|
2720 |
||
2721 |
offs := offs + 1. |
|
2722 |
col := col + 1. |
|
2723 |
col > 16 ifTrue:[ |
|
2724 |
lineStream nextPutAll:' '. |
|
2725 |
lineStream nextPutAll:asciiLineStream contents. |
|
2726 |
lines add:(lineStream contents). |
|
2727 |
(offs bitAnd:16rFF) == 0 ifTrue:[ |
|
2728 |
lines add:nil |
|
2729 |
]. |
|
2730 |
lineStream reset. |
|
2731 |
asciiLineStream reset. |
|
2732 |
||
2733 |
lineStream nextPutAll:(offs hexPrintString:addrDigits). |
|
2734 |
lineStream nextPutAll:': '. |
|
2735 |
col := 1. |
|
2736 |
] ifFalse:[ |
|
2737 |
lineStream space |
|
2738 |
] |
|
2739 |
]. |
|
2740 |
line := lineStream contents paddedTo:(3*16 + addrDigits + 1). |
|
2741 |
lines add:(line , ' ' , asciiLineStream contents). |
|
2742 |
^ lines |
|
2743 |
! ! |
|
2744 |
||
3892 | 2745 |
!AbstractFileBrowser methodsFor:'actions'! |
2746 |
||
2747 |
askForCommandFor:fileName thenDo:aBlock |
|
6284 | 2748 |
"setup and launch a querybox to ask for a unix command. |
3892 | 2749 |
Then evaluate aBlock passing the command-string as argument." |
2750 |
||
4523 | 2751 |
|box osName commandString| |
3892 | 2752 |
|
2753 |
osName := OperatingSystem platformName. |
|
2754 |
||
2755 |
box := FilenameEnterBox |
|
4414 | 2756 |
title:(resources string:'Execute %1 command:' with:osName) |
2757 |
okText:(resources string:'Execute') |
|
4523 | 2758 |
action:[:cmd | commandString := cmd]. |
3892 | 2759 |
|
2760 |
fileName notNil ifTrue:[ |
|
4414 | 2761 |
self initialCommandFor:fileName into:box. |
3892 | 2762 |
]. |
2763 |
box directory:(self getDirWithoutFileName:fileName). |
|
5003
a14ce263ada5
boxes no longer show at pointer
Claus Gittinger <cg@exept.de>
parents:
4982
diff
changeset
|
2764 |
box show. |
3892 | 2765 |
box destroy. |
2766 |
||
4523 | 2767 |
commandString notNil ifTrue:[ |
2768 |
aBlock value:commandString |
|
2769 |
]. |
|
2770 |
||
3892 | 2771 |
"Modified: / 7.9.1995 / 10:31:54 / claus" |
2772 |
"Modified: / 16.9.1997 / 15:35:10 / stefan" |
|
2773 |
"Modified: / 14.8.1998 / 14:12:52 / cg" |
|
2774 |
! |
|
2775 |
||
2776 |
changeFileBrowserTitleTo:aString |
|
4774 | 2777 |
self |
2778 |
applicationNamed:#FileBrowserV2 |
|
5009 | 2779 |
ifPresentDo:[:app | app changeFileBrowserTitleTo:aString] |
3892 | 2780 |
! |
2781 |
||
2782 |
copyFileList |
|
4774 | 2783 |
"copy the fileList to the clipBoard" |
2784 |
||
4973
e4b72eec43d3
refactoring the browserItemList access in directoryContentsBrowser
penk
parents:
4963
diff
changeset
|
2785 |
|fileList| |
e4b72eec43d3
refactoring the browserItemList access in directoryContentsBrowser
penk
parents:
4963
diff
changeset
|
2786 |
|
e4b72eec43d3
refactoring the browserItemList access in directoryContentsBrowser
penk
parents:
4963
diff
changeset
|
2787 |
fileList := self |
4774 | 2788 |
applicationNamed:#DirectoryContentsBrowser |
5009 | 2789 |
ifPresentDo:[:app | app browserFileList]. |
2790 |
||
2791 |
fileList notNil ifTrue:[ |
|
2792 |
self copyFileListToClipBoard:fileList. |
|
2793 |
] |
|
4973
e4b72eec43d3
refactoring the browserItemList access in directoryContentsBrowser
penk
parents:
4963
diff
changeset
|
2794 |
! |
e4b72eec43d3
refactoring the browserItemList access in directoryContentsBrowser
penk
parents:
4963
diff
changeset
|
2795 |
|
e4b72eec43d3
refactoring the browserItemList access in directoryContentsBrowser
penk
parents:
4963
diff
changeset
|
2796 |
copyFileListToClipBoard:fileList |
4774 | 2797 |
"copy the itemList to the clipBoard" |
2798 |
||
2799 |
|stream| |
|
2800 |
||
4973
e4b72eec43d3
refactoring the browserItemList access in directoryContentsBrowser
penk
parents:
4963
diff
changeset
|
2801 |
fileList isEmpty ifTrue:[^ self]. |
4774 | 2802 |
|
5772
603abfa8cf99
copy name(s) to clipboard - on lineFeed if only one file is selected
Claus Gittinger <cg@exept.de>
parents:
5756
diff
changeset
|
2803 |
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
|
2804 |
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
|
2805 |
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
|
2806 |
] ifFalse:[ |
603abfa8cf99
copy name(s) to clipboard - on lineFeed if only one file is selected
Claus Gittinger <cg@exept.de>
parents:
5756
diff
changeset
|
2807 |
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
|
2808 |
(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
|
2809 |
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
|
2810 |
] |
603abfa8cf99
copy name(s) to clipboard - on lineFeed if only one file is selected
Claus Gittinger <cg@exept.de>
parents:
5756
diff
changeset
|
2811 |
]. |
3892 | 2812 |
]. |
6034 | 2813 |
self window setClipboardText:stream contents. |
3892 | 2814 |
! |
2815 |
||
2816 |
copySelectedFilenames |
|
4774 | 2817 |
"copy the selected fileNames to the clipBoard" |
2818 |
||
4973
e4b72eec43d3
refactoring the browserItemList access in directoryContentsBrowser
penk
parents:
4963
diff
changeset
|
2819 |
|fileList| |
e4b72eec43d3
refactoring the browserItemList access in directoryContentsBrowser
penk
parents:
4963
diff
changeset
|
2820 |
|
e4b72eec43d3
refactoring the browserItemList access in directoryContentsBrowser
penk
parents:
4963
diff
changeset
|
2821 |
fileList := self |
4774 | 2822 |
applicationNamed:#DirectoryContentsBrowser |
5009 | 2823 |
ifPresentDo:[:appl | appl selectedFileNames]. |
2824 |
fileList notNil ifTrue:[ |
|
2825 |
self copyFileListToClipBoard:fileList. |
|
2826 |
]. |
|
3892 | 2827 |
! |
2828 |
||
10923 | 2829 |
doAddArchiver |
2830 |
|files| |
|
2831 |
||
2832 |
files := self currentSelectedFiles. |
|
2833 |
files size == 1 ifFalse:[ |
|
2834 |
Dialog information:'Select exactly one archive.'. |
|
2835 |
^ self |
|
2836 |
]. |
|
2837 |
||
2838 |
self |
|
2839 |
applicationNamed:#FileApplicationNoteBook |
|
2840 |
ifPresentDo:[:appl | appl doAddArchiverOn:files first]. |
|
2841 |
||
2842 |
"Created: / 29-11-2011 / 19:01:31 / cg" |
|
2843 |
! |
|
2844 |
||
3892 | 2845 |
doAddTerminal |
5960 | 2846 |
|dir| |
2847 |
||
2848 |
dir := self currentDirectory. |
|
3892 | 2849 |
|
5960 | 2850 |
dir isNil ifTrue:[ |
4414 | 2851 |
dir := Filename homeDirectory |
3892 | 2852 |
]. |
4774 | 2853 |
|
5009 | 2854 |
self |
2855 |
applicationNamed:#FileApplicationNoteBook |
|
2856 |
ifPresentDo:[:appl | appl addTerminalIn:dir]. |
|
3892 | 2857 |
! |
2858 |
||
2859 |
doOpenSearchFile |
|
5961 | 2860 |
|item file| |
2861 |
||
2862 |
file := self firstSelectedFileName. |
|
2863 |
file isNil ifTrue:[ |
|
2864 |
file := Filename homeDirectory asAbsoluteFilename. |
|
2865 |
]. |
|
2866 |
item := DirectoryContentsBrowser itemClass fileName:file. |
|
3892 | 2867 |
self openSearchFileOn:item. |
2868 |
! |
|
2869 |
||
2870 |
doShowFileContents |
|
5009 | 2871 |
self |
2872 |
applicationNamed:#DirectoryContentsBrowser |
|
2873 |
ifPresentDo:[:appl | ^ appl doShowFileContents]. |
|
2874 |
||
2875 |
^ nil |
|
3892 | 2876 |
! |
2877 |
||
2878 |
doShowProperties |
|
2879 |
"show long stat (file)-info" |
|
2880 |
||
2881 |
self fileGetInfo:true |
|
2882 |
! |
|
2883 |
||
5528 | 2884 |
fileEncodingDialog |
2885 |
"open a dialog to allow change of the files character encoding. |
|
2886 |
Files are converted to internal encoding when read, and converted back |
|
2887 |
to this encoding when saved. |
|
2888 |
Notice: currently, not too many encodings are supported by the system." |
|
2889 |
||
2890 |
|bindings encodings encodingDescr idx selectedEncoding| |
|
2891 |
||
2892 |
encodingDescr := CharacterEncoder supportedExternalEncodings. |
|
2893 |
encodings := encodingDescr collect:[:d | d isNil ifTrue:[nil] ifFalse:[d first]]. |
|
2894 |
||
2895 |
bindings := IdentityDictionary new. |
|
2896 |
bindings at:#encodingList put:encodingDescr. |
|
2897 |
bindings at:#selectedEncoding put:(encodings indexOf:self fileEncoding ifAbsent:1) asValue. |
|
5737 | 2898 |
bindings at:#lockFileEncoding put:(self lockFileEncodingHolder value asValue). |
2899 |
||
5528 | 2900 |
(self openDialogInterface:#encodingDialogSpec withBindings:bindings) |
2901 |
ifTrue:[ |
|
2902 |
idx := (bindings at:#selectedEncoding) value. |
|
2903 |
selectedEncoding := encodings at:idx. |
|
2904 |
selectedEncoding notNil ifTrue:[ |
|
5704 | 2905 |
self fileEncoding:selectedEncoding asSymbol. |
5528 | 2906 |
]. |
5737 | 2907 |
self lockFileEncoding:(bindings at:#lockFileEncoding) value. |
5528 | 2908 |
]. |
2909 |
||
2910 |
"Modified: 30.6.1997 / 14:41:12 / cg" |
|
2911 |
! |
|
2912 |
||
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
2913 |
gotoFile:aFilename |
5380
2f738f3a34b1
fixed bug introduced by stefans beautification ;-)
Claus Gittinger <cg@exept.de>
parents:
5374
diff
changeset
|
2914 |
"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
|
2915 |
|
5959 | 2916 |
|currentFileNameHolder currentSel| |
2917 |
||
2918 |
currentFileNameHolder := self currentFileNameHolder. |
|
2919 |
||
2920 |
currentSel := currentFileNameHolder value. |
|
5380
2f738f3a34b1
fixed bug introduced by stefans beautification ;-)
Claus Gittinger <cg@exept.de>
parents:
5374
diff
changeset
|
2921 |
(currentSel includes:aFilename) ifFalse:[ |
9677 | 2922 |
self withWaitCursorDo:[ |
2923 |
currentFileNameHolder value:(OrderedCollection with:(aFilename asAbsoluteFilename)). |
|
2924 |
] |
|
2925 |
]. |
|
2926 |
||
2927 |
"Modified: / 29-12-2010 / 11:04:29 / cg" |
|
3892 | 2928 |
! |
2929 |
||
11053 | 2930 |
lineEndConventionDialog |
2931 |
"open a dialog to allow change of the line end conventions |
|
2932 |
(when writing files)" |
|
2933 |
||
2934 |
|bindings| |
|
2935 |
||
2936 |
bindings := IdentityDictionary new. |
|
2937 |
bindings at:#lineEndConvention put:(self lineEndConvention asValue). |
|
2938 |
||
2939 |
(self openDialogInterface:#lineEndConventionDialogSpec withBindings:bindings) |
|
2940 |
ifTrue:[ |
|
2941 |
self lineEndConventionHolder value:(bindings at:#lineEndConvention) value |
|
2942 |
]. |
|
2943 |
||
2944 |
"Created: / 06-01-2012 / 15:34:51 / cg" |
|
2945 |
! |
|
2946 |
||
4392 | 2947 |
newTextEditor |
5009 | 2948 |
self |
2949 |
applicationNamed:#FileApplicationNoteBook |
|
2950 |
ifPresentDo:[:appl | ^ appl newTextEditor]. |
|
2951 |
||
2952 |
^ nil. |
|
2953 |
! |
|
2954 |
||
2955 |
openApplByFileItem:anItem |
|
8490 | 2956 |
"/ q: is the following always wanted ? |
9267 | 2957 |
self window sensor shiftDown ifFalse:[ |
10669
079d85556631
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
10556
diff
changeset
|
2958 |
"/ cg: no - batch and shell scripts are to be |
079d85556631
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
10556
diff
changeset
|
2959 |
"/ anItem fileName isExecutableProgram ifTrue:[ |
079d85556631
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
10556
diff
changeset
|
2960 |
"/ self executeCommand:anItem fileName pathName. |
079d85556631
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
10556
diff
changeset
|
2961 |
"/ ^ self. |
079d85556631
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
10556
diff
changeset
|
2962 |
"/ ]. |
9267 | 2963 |
|
8490 | 2964 |
"/ OperatingSystem isMSWINDOWSlike ifTrue:[ |
2965 |
"/ Error handle:[:ex | |
|
2966 |
"/ ] do:[ |
|
2967 |
"/ OperatingSystem |
|
2968 |
"/ shellExecute:nil |
|
2969 |
"/ lpOperation:'open' |
|
2970 |
"/ lpFile:(anItem fileName pathName) |
|
2971 |
"/ lpParameters:nil |
|
2972 |
"/ lpDirectory:(self directory pathName) |
|
2973 |
"/ nShowCmd:#SW_SHOWNORMAL. |
|
2974 |
"/ ^ self. |
|
2975 |
"/ ] |
|
2976 |
"/ ] |
|
9267 | 2977 |
]. |
5306 | 2978 |
^ self |
5009 | 2979 |
applicationNamed:#FileApplicationNoteBook |
5306 | 2980 |
ifPresentDo:[:appl | appl openApplByFileItem:anItem]. |
10669
079d85556631
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
10556
diff
changeset
|
2981 |
|
079d85556631
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
10556
diff
changeset
|
2982 |
"Modified: / 06-09-2011 / 11:11:15 / cg" |
3892 | 2983 |
! |
2984 |
||
4392 | 2985 |
openApplForFile:aFilename |
5306 | 2986 |
^ self openApplByFileItem:(DirectoryContentsBrowser itemClass fileName:aFilename). |
4392 | 2987 |
! |
2988 |
||
3892 | 2989 |
openCommandResultApplication |
2990 |
||
5009 | 2991 |
self |
2992 |
applicationNamed:#FileApplicationNoteBook |
|
2993 |
ifPresentDo:[:appl | ^ appl openCommandResultApplication]. |
|
2994 |
||
2995 |
^ nil |
|
3892 | 2996 |
! |
2997 |
||
5010 | 2998 |
openNewTextEditorOn:anItem |
5009 | 2999 |
self |
3000 |
applicationNamed:#FileApplicationNoteBook |
|
5010 | 3001 |
ifPresentDo:[:appl | ^ appl openNewTextEditorOn:anItem ]. |
5009 | 3002 |
|
3003 |
^ nil |
|
4880
87f511659680
edit file in context menu of DirectoryContentsBroser opens a new tab
penk
parents:
4878
diff
changeset
|
3004 |
! |
87f511659680
edit file in context menu of DirectoryContentsBroser opens a new tab
penk
parents:
4878
diff
changeset
|
3005 |
|
5010 | 3006 |
openSearchFileOn:anItem |
5009 | 3007 |
self |
3008 |
applicationNamed:#FileApplicationNoteBook |
|
5010 | 3009 |
ifPresentDo:[:appl | ^ appl openSearchFileOn:anItem]. |
5009 | 3010 |
|
3011 |
^ nil. |
|
3892 | 3012 |
! |
3013 |
||
5162 | 3014 |
openTextEditorForFile:aFilename |
3015 |
^ self openTextEditorOn:(DirectoryContentsBrowser itemClass fileName:aFilename). |
|
3016 |
! |
|
3017 |
||
5010 | 3018 |
openTextEditorOn:anItem |
5009 | 3019 |
self |
3020 |
applicationNamed:#FileApplicationNoteBook |
|
5010 | 3021 |
ifPresentDo:[:appl | ^ appl openTextEditorOn:anItem ]. |
5009 | 3022 |
|
3023 |
^ nil. |
|
3892 | 3024 |
! |
3025 |
||
5010 | 3026 |
openTextEditorOn:anItem type:aDirDescrOrFile |
5009 | 3027 |
self |
3028 |
applicationNamed:#FileApplicationNoteBook |
|
5010 | 3029 |
ifPresentDo:[:appl | ^ appl openTextEditorOn:anItem type:aDirDescrOrFile]. |
5009 | 3030 |
|
3031 |
^ nil. |
|
4618 | 3032 |
! |
3033 |
||
5959 | 3034 |
setCurrentFileName:aFilename |
3035 |
self setCurrentFileNames:(OrderedCollection with:aFilename). |
|
3036 |
! |
|
3037 |
||
3038 |
setCurrentFileNames:aCollectionOfFilenames |
|
3039 |
self currentFileNameHolder value:aCollectionOfFilenames. |
|
3040 |
! |
|
3041 |
||
11053 | 3042 |
tabStopConversionDialog |
3043 |
"open a dialog to allow change of the tab stop conversion (when reading/writing files)" |
|
3044 |
||
3045 |
|bindings| |
|
3046 |
||
3047 |
bindings := IdentityDictionary new. |
|
3048 |
bindings at:#tabStops put:(self inputTabColumnConversion asValue). |
|
3049 |
||
3050 |
(self openDialogInterface:#tabStopConversionDialogSpec withBindings:bindings) |
|
3051 |
ifTrue:[ |
|
3052 |
self inputTabColumnConversionHolder value:(bindings at:#tabStops) value |
|
3053 |
]. |
|
3054 |
||
3055 |
"Created: / 06-01-2012 / 15:36:06 / cg" |
|
3056 |
! |
|
3057 |
||
3892 | 3058 |
updateAndSelect:aColOfFiles |
4785
5a3f7a0c3ff1
symbolic link creation code fixed
Claus Gittinger <cg@exept.de>
parents:
4782
diff
changeset
|
3059 |
self updateCurrentDirectory. |
4707
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
3060 |
aColOfFiles notNil ifTrue:[ |
5959 | 3061 |
self setCurrentFileNames:aColOfFiles |
4707
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
3062 |
]. |
3892 | 3063 |
! |
3064 |
||
3065 |
updateCurrentDirectory |
|
5739 | 3066 |
self updateCurrentDirectory:false |
3067 |
! |
|
3068 |
||
3069 |
updateCurrentDirectory:withReread |
|
4785
5a3f7a0c3ff1
symbolic link creation code fixed
Claus Gittinger <cg@exept.de>
parents:
4782
diff
changeset
|
3070 |
DirectoryContents flushCachedDirectoryFor:(self getBestDirectory). |
5a3f7a0c3ff1
symbolic link creation code fixed
Claus Gittinger <cg@exept.de>
parents:
4782
diff
changeset
|
3071 |
|
5009 | 3072 |
self |
3073 |
applicationNamed:#DirectoryContentsBrowser |
|
5739 | 3074 |
ifPresentDo:[:appl | withReread ifTrue:[appl doUpdate] ifFalse:[appl doUpdateDirectoryContents]]. |
5009 | 3075 |
self |
3076 |
applicationNamed:#DirectoryTreeBrowser |
|
3077 |
ifPresentDo:[:appl | appl doUpdate]. |
|
4345 | 3078 |
! |
3079 |
||
5739 | 3080 |
updateCurrentDirectoryWithReread |
3081 |
self updateCurrentDirectory:true |
|
3082 |
! |
|
3083 |
||
4345 | 3084 |
withActivityIndicationDo:aBlock |
3085 |
||
3086 |
self activityVisibilityChannel value:true. |
|
3087 |
[ |
|
9361 | 3088 |
self withWaitCursorDo:[ |
3089 |
aBlock value. |
|
3090 |
] |
|
4345 | 3091 |
] ensure:[ |
3092 |
self activityVisibilityChannel value:false. |
|
3093 |
] |
|
3892 | 3094 |
! ! |
3095 |
||
3096 |
!AbstractFileBrowser methodsFor:'actions bookmarks'! |
|
3097 |
||
3098 |
addBookmark |
|
3099 |
self currentFilesAreInSameDirectory ifFalse:[^ self]. |
|
6725 | 3100 |
self addBookmarks:(self currentSelectedDirectories). |
5960 | 3101 |
self class saveBookmarksInDefaultBookmarksFile |
4679 | 3102 |
! |
3103 |
||
3104 |
addBookmarks:aColOfDirectories |
|
4672
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
3105 |
aColOfDirectories do:[ :path | |
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
3106 |
self class addBookmark:path |
3892 | 3107 |
]. |
3108 |
! |
|
3109 |
||
8013 | 3110 |
editBookmarks |
3111 |
||
3112 |
| default selectedDirectories | |
|
3113 |
||
3114 |
selectedDirectories := self currentSelectedDirectories. |
|
3115 |
selectedDirectories notEmpty ifTrue:[default := selectedDirectories first]. |
|
3116 |
self class editBookmarksWithDefault: default. |
|
3117 |
! |
|
3118 |
||
3892 | 3119 |
hasBookmarks |
4672
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
3120 |
^ self class hasBookmarks |
3892 | 3121 |
! |
3122 |
||
3123 |
hasBookmarksToRemove |
|
3124 |
|bookmarks directories| |
|
3125 |
||
3982 | 3126 |
directories := self currentSelectedDirectories. |
3892 | 3127 |
bookmarks := self class directoryBookmarks. |
3128 |
^ (bookmarks size > 0 and:[directories notEmpty]) |
|
3129 |
! |
|
3130 |
||
3131 |
removeBookmark |
|
4672
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
3132 |
self currentSelectedDirectories do:[:dir| |
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
3133 |
self class removeBookmark:dir |
3892 | 3134 |
]. |
4679 | 3135 |
! |
3136 |
||
3137 |
saveBookmarks |
|
3138 |
self class saveBookmarks |
|
3892 | 3139 |
! ! |
3140 |
||
3141 |
!AbstractFileBrowser methodsFor:'actions history'! |
|
3142 |
||
3143 |
addToCommandHistory:aCommandString for:aFilename |
|
6369 | 3144 |
|cmd suffix cmdHist historySize| |
3892 | 3145 |
|
3146 |
cmdHist := self class commandHistory. |
|
6482
00207f456339
isEmptyOrNil / notEmptyOrNil refactoring
Claus Gittinger <cg@exept.de>
parents:
6479
diff
changeset
|
3147 |
(aCommandString notEmptyOrNil) ifTrue:[ |
4414 | 3148 |
cmdHist notNil ifTrue:[ |
3149 |
cmdHist addFirst:aCommandString. |
|
6369 | 3150 |
historySize := self class commandHistorySize. |
3151 |
(historySize notNil and:[cmdHist size > historySize]) ifTrue:[ |
|
4414 | 3152 |
cmdHist removeLast |
3153 |
] |
|
3154 |
]. |
|
3155 |
aFilename notNil ifTrue:[ |
|
3156 |
cmd := aCommandString copyTo:(aCommandString indexOf:Character space ifAbsent:[aCommandString size + 1])-1. |
|
3157 |
DefaultCommandPerSuffix isNil ifTrue:[ |
|
3158 |
DefaultCommandPerSuffix := Dictionary new. |
|
3159 |
]. |
|
3160 |
suffix := aFilename asFilename suffix. |
|
3161 |
suffix notNil ifTrue:[ |
|
3162 |
DefaultCommandPerSuffix at:suffix put:cmd. |
|
3163 |
] |
|
3164 |
] |
|
3892 | 3165 |
] |
3166 |
! |
|
3167 |
||
3168 |
doBack |
|
6286 | 3169 |
"go backward in the history" |
3892 | 3170 |
|
4022 | 3171 |
| fileName| |
3172 |
||
6369 | 3173 |
fileName := self directoryHistory goBackward. |
3892 | 3174 |
fileName notNil ifTrue:[ |
4347 | 3175 |
self gotoFile:(fileName asFilename). |
3892 | 3176 |
] |
3177 |
! |
|
3178 |
||
3179 |
doForward |
|
6286 | 3180 |
"go forward in the history" |
3892 | 3181 |
|
3964 | 3182 |
| fileName| |
3183 |
||
6369 | 3184 |
fileName := self directoryHistory goForward. |
3892 | 3185 |
fileName notNil ifTrue:[ |
4414 | 3186 |
self gotoFile:(fileName asFilename). |
4022 | 3187 |
] ifFalse:[ |
4414 | 3188 |
self enableForward value:false. |
4022 | 3189 |
|
3190 |
]. |
|
3892 | 3191 |
! ! |
3192 |
||
3193 |
!AbstractFileBrowser methodsFor:'applications'! |
|
3194 |
||
5009 | 3195 |
applicationNamed:anApplicationName ifPresentDo:aBlock |
3196 |
|appl| |
|
3197 |
||
3198 |
appl := self applications at:anApplicationName ifAbsent:nil. |
|
3199 |
appl notNil ifTrue:[ |
|
3200 |
^ aBlock value:appl |
|
3201 |
]. |
|
3202 |
^ nil. |
|
3203 |
! |
|
3204 |
||
4004 | 3205 |
directoryContentsBrowser |
3206 |
^ self applications at:#DirectoryContentsBrowser ifAbsent:nil. |
|
3892 | 3207 |
! ! |
3208 |
||
3209 |
!AbstractFileBrowser methodsFor:'aspects'! |
|
3210 |
||
3211 |
applications |
|
3212 |
^ aspects at:#applications |
|
3213 |
! |
|
3214 |
||
3215 |
backgroundProcesses |
|
3216 |
||
3217 |
^ self aspectFor:#backgroundProcesses ifAbsent:[List new] |
|
3218 |
! |
|
3219 |
||
4230 | 3220 |
canMake |
6095 | 3221 |
^ self aspectFor:#canMake ifAbsent:[ false asValue ]. |
4230 | 3222 |
! |
3223 |
||
3892 | 3224 |
currentDirectories |
6725 | 3225 |
" returns a holder on a Collection of all currently selected directories |
3226 |
if only a file is selected, currentDirectories holds the directory of the file |
|
3892 | 3227 |
" |
3228 |
||
3229 |
^ self aspectFor:#currentDirectories ifAbsent:[ (OrderedCollection new) asValue ]. |
|
3230 |
! |
|
3231 |
||
6725 | 3232 |
currentDirectoriesValue |
3233 |
" returns a Collection of all currently selected directories |
|
3234 |
if only a file is selected, currentDirectories holds the directory of the file |
|
3235 |
" |
|
3236 |
||
3237 |
^ self currentDirectories value |
|
3238 |
! |
|
3239 |
||
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
3240 |
currentDirectory |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
3241 |
"return the single current directory or nil" |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
3242 |
|
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
3243 |
|directories| |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
3244 |
|
6725 | 3245 |
directories := self currentSelectedDirectories. |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
3246 |
(directories size ~= 1) ifTrue:[ |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
3247 |
^ nil |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
3248 |
]. |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
3249 |
^ directories first. |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
3250 |
! |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
3251 |
|
3892 | 3252 |
currentFileNameHolder |
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
3253 |
"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
|
3254 |
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
|
3255 |
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
|
3256 |
|
6589 | 3257 |
^ self aspectFor:#currentFileNameHolder |
3258 |
ifAbsent:[ |
|
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
3259 |
|currentSel| |
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3260 |
|
4692 | 3261 |
currentSel := self class currentSelection. |
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
3262 |
currentSel isEmpty ifTrue:[ |
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
3263 |
currentSel := OrderedCollection with:(Filename currentDirectory asAbsoluteFilename) |
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
3264 |
]. |
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
3265 |
currentSel asValue |
6589 | 3266 |
] |
3267 |
notPresentDo:[:holder| |
|
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
3268 |
|filenames newFilenames| |
4213
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
3269 |
filenames := holder value. |
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
3270 |
newFilenames := Set new. |
6589 | 3271 |
filenames do:[:eachFilename| |
3272 |
|existingFilename| |
|
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
3273 |
existingFilename := eachFilename. |
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
3274 |
existingFilename notNil ifTrue:[ |
9649
ad956ada348e
changed: #currentFileNameHolder
Claus Gittinger <cg@exept.de>
parents:
9607
diff
changeset
|
3275 |
[existingFilename isRootDirectory or:[existingFilename exists]] whileFalse:[ |
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
3276 |
existingFilename := existingFilename directory. |
4955
378481247391
if no item is selected directory up action do nothing now
penk
parents:
4950
diff
changeset
|
3277 |
]. |
9649
ad956ada348e
changed: #currentFileNameHolder
Claus Gittinger <cg@exept.de>
parents:
9607
diff
changeset
|
3278 |
existingFilename exists ifTrue:[ |
ad956ada348e
changed: #currentFileNameHolder
Claus Gittinger <cg@exept.de>
parents:
9607
diff
changeset
|
3279 |
newFilenames add:existingFilename. |
ad956ada348e
changed: #currentFileNameHolder
Claus Gittinger <cg@exept.de>
parents:
9607
diff
changeset
|
3280 |
]. |
4955
378481247391
if no item is selected directory up action do nothing now
penk
parents:
4950
diff
changeset
|
3281 |
] |
4213
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
3282 |
]. |
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
3283 |
newFilenames asOrderedCollection. |
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
3284 |
] |
9649
ad956ada348e
changed: #currentFileNameHolder
Claus Gittinger <cg@exept.de>
parents:
9607
diff
changeset
|
3285 |
|
ad956ada348e
changed: #currentFileNameHolder
Claus Gittinger <cg@exept.de>
parents:
9607
diff
changeset
|
3286 |
"Modified: / 27-11-2010 / 15:42:45 / cg" |
3892 | 3287 |
! |
3288 |
||
5528 | 3289 |
defaultFileEncoding |
3290 |
^ #'iso8859-1' "/ #'utf-8' |
|
3291 |
! |
|
3292 |
||
3892 | 3293 |
enableDirectoryUp |
3294 |
||
3295 |
^ self aspectFor:#enableDirectoryUp ifAbsent:[false asValue] |
|
3296 |
! |
|
3297 |
||
6456 | 3298 |
enableGotoDefaultDirectory |
3299 |
^ self aspectFor:#enableGotoDefaultDirectory ifAbsent:[ true asValue ]. |
|
4593 | 3300 |
! |
3301 |
||
8168 | 3302 |
enableGotoDesktop |
3303 |
^ self aspectFor:#enableGotoDesktop ifAbsent:[ true asValue ]. |
|
3304 |
! |
|
3305 |
||
9572 | 3306 |
enableGotoDesktopDirectory |
3307 |
^ self aspectFor:#enableGotoDesktopDirectory ifAbsent:[ true asValue ]. |
|
3308 |
||
3309 |
"Created: / 01-10-2010 / 16:19:17 / cg" |
|
3310 |
! |
|
3311 |
||
6434 | 3312 |
enableGotoSmalltalkDirectory |
6456 | 3313 |
^ self aspectFor:#enableGotoSmalltalkDirectory ifAbsent:[ true asValue ]. |
6434 | 3314 |
! |
3315 |
||
9677 | 3316 |
enableGotoTempDirectory |
3317 |
^ self aspectFor:#enableGotoTempDirectory ifAbsent:[ true asValue ]. |
|
3318 |
||
3319 |
"Created: / 29-12-2010 / 11:01:17 / cg" |
|
3320 |
! |
|
3321 |
||
3892 | 3322 |
enableHome |
3323 |
||
3324 |
^ self aspectFor:#enableHome ifAbsent:[ true asValue ]. |
|
3325 |
! |
|
3326 |
||
9596 | 3327 |
enableMakeCurrentDirectory |
3328 |
^ self aspectFor:#enableMakeCurrentDirectory ifAbsent:[ true asValue ]. |
|
3329 |
||
3330 |
"Created: / 26-10-2010 / 17:17:58 / cg" |
|
3331 |
! |
|
3332 |
||
3892 | 3333 |
enableViewNoteBookApplication |
3334 |
||
3335 |
^ self aspectFor:#enableViewNoteBookApplication ifAbsent:[false asValue] |
|
3336 |
! |
|
3337 |
||
5528 | 3338 |
fileEncoding |
3339 |
^ self fileEncodingHolder value |
|
3340 |
! |
|
3341 |
||
3342 |
fileEncoding:newEncoding |
|
5533 | 3343 |
self fileEncodingHolder value:newEncoding. |
3344 |
||
3345 |
self |
|
3346 |
applicationNamed:#FileApplicationNoteBook |
|
3347 |
ifPresentDo:[:nb | |
|
3348 |
|appl| |
|
3349 |
||
3350 |
appl := nb selectedApplication. |
|
5535 | 3351 |
(appl notNil and:[appl isTextEditor]) ifTrue:[ |
5533 | 3352 |
appl fileEncoding:newEncoding |
3353 |
] |
|
3354 |
]. |
|
5528 | 3355 |
! |
3356 |
||
5737 | 3357 |
fileEncodingHolder |
3358 |
^ self |
|
3359 |
aspectFor:#fileEncodingHolder |
|
3360 |
ifAbsent:[ |
|
3361 |
self |
|
3362 |
applicationNamed:#FileApplicationNoteBook |
|
3363 |
ifPresentDo:[:appl | appl fileEncodingHolder]. |
|
3364 |
] |
|
3365 |
! |
|
3366 |
||
5961 | 3367 |
firstSelectedFileName |
3368 |
|files| |
|
3369 |
||
7560 | 3370 |
files := self currentSelectedObjects. |
5961 | 3371 |
files notEmpty ifTrue:[ |
3372 |
^ files first |
|
3373 |
]. |
|
3374 |
^ nil |
|
7560 | 3375 |
|
3376 |
"Modified: / 04-12-2006 / 13:14:53 / cg" |
|
5961 | 3377 |
! |
3378 |
||
6456 | 3379 |
gotoDefaultDirectoryIsVisible |
9596 | 3380 |
^ true. |
3381 |
"/ ^ (Filename defaultDirectory asAbsoluteFilename) ~= (self smalltalkDirectory asAbsoluteFilename). |
|
3382 |
||
3383 |
"Modified: / 26-10-2010 / 17:23:51 / cg" |
|
6456 | 3384 |
! |
3385 |
||
9572 | 3386 |
gotoDesktopDirectoryIsVisible |
3387 |
Filename desktopDirectory = Filename homeDirectory ifTrue:[^ false]. |
|
3388 |
||
3389 |
^ (Filename desktopDirectory asAbsoluteFilename) ~= (self smalltalkDirectory asAbsoluteFilename). |
|
3390 |
||
3391 |
"Created: / 01-10-2010 / 16:26:27 / cg" |
|
3392 |
! |
|
3393 |
||
4618 | 3394 |
hasFileSelection |
3395 |
^ self aspectFor:#hasFileSelection ifAbsent:[ false asValue ]. |
|
3396 |
! |
|
3397 |
||
9490 | 3398 |
hasNotTwoDirectoriesSelectedHolder |
3399 |
^ self |
|
3400 |
aspectFor:#hasNotTwoDirectoriesSelectedHolder |
|
3401 |
ifAbsent:[ |
|
3402 |
BlockValue |
|
3403 |
with:[:m | self hasTwoDirectoriesSelected not] |
|
3404 |
argument:self currentFileNameHolder |
|
3405 |
]. |
|
3406 |
||
3407 |
"Created: / 20-05-2010 / 10:45:50 / cg" |
|
3408 |
! |
|
3409 |
||
5830 | 3410 |
hasNotTwoFilesSelectedHolder |
9490 | 3411 |
^ self |
3412 |
aspectFor:#hasNotTwoFilesSelectedHolder |
|
5830 | 3413 |
ifAbsent:[ |
3414 |
BlockValue |
|
3415 |
with:[:m | self hasTwoFilesSelected not] |
|
3416 |
argument:self currentFileNameHolder |
|
3417 |
]. |
|
9490 | 3418 |
|
3419 |
"Modified: / 20-05-2010 / 10:46:01 / cg" |
|
5830 | 3420 |
! |
3421 |
||
3892 | 3422 |
hasSelection |
3423 |
||
3424 |
^ self aspectFor:#hasSelection ifAbsent:[ false asValue ]. |
|
3425 |
! |
|
3426 |
||
9490 | 3427 |
hasTwoDirectoriesSelectedHolder |
3428 |
^ self |
|
3429 |
aspectFor:#hasTwoDirectoriesSelectedHolder |
|
3430 |
ifAbsent:[ |
|
3431 |
BlockValue |
|
3432 |
with:[:m | self hasTwoDirectoriesSelected] |
|
3433 |
argument:self currentFileNameHolder |
|
3434 |
]. |
|
3435 |
||
3436 |
"Created: / 20-05-2010 / 10:45:41 / cg" |
|
3437 |
! |
|
3438 |
||
4414 | 3439 |
hasTwoFilesSelectedHolder |
9490 | 3440 |
^ self |
3441 |
aspectFor:#hasTwoFilesSelectedHolder |
|
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
3442 |
ifAbsent:[ |
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
3443 |
BlockValue |
5830 | 3444 |
with:[:m | self hasTwoFilesSelected] |
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
3445 |
argument:self currentFileNameHolder |
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
3446 |
]. |
9490 | 3447 |
|
3448 |
"Modified: / 20-05-2010 / 10:46:08 / cg" |
|
4414 | 3449 |
! |
3450 |
||
11053 | 3451 |
inputTabColumnConversion |
3452 |
^ self inputTabColumnConversionHolder value |
|
3453 |
||
3454 |
"Created: / 06-01-2012 / 15:25:56 / cg" |
|
3455 |
! |
|
3456 |
||
3457 |
inputTabColumnConversionHolder |
|
3458 |
^ self |
|
3459 |
aspectFor:#inputTabColumnConversionHolder |
|
3460 |
ifAbsent:[ |
|
3461 |
self |
|
3462 |
applicationNamed:#FileApplicationNoteBook |
|
3463 |
ifPresentDo:[:appl | appl inputTabColumnConversionHolder]. |
|
3464 |
] |
|
3465 |
||
3466 |
"Created: / 06-01-2012 / 15:26:16 / cg" |
|
3467 |
! |
|
3468 |
||
3469 |
lineEndConvention |
|
3470 |
^ self lineEndConventionHolder value |
|
3471 |
||
3472 |
"Created: / 06-01-2012 / 13:05:14 / cg" |
|
3473 |
! |
|
3474 |
||
3475 |
lineEndConventionHolder |
|
3476 |
^ self |
|
3477 |
aspectFor:#lineEndConventionHolder |
|
3478 |
ifAbsent:[ |
|
3479 |
self |
|
3480 |
applicationNamed:#FileApplicationNoteBook |
|
3481 |
ifPresentDo:[:appl | appl lineEndConventionHolder]. |
|
3482 |
] |
|
3483 |
||
3484 |
"Created: / 06-01-2012 / 13:02:51 / cg" |
|
3485 |
! |
|
3486 |
||
5737 | 3487 |
lockFileEncoding:aBoolean |
3488 |
self lockFileEncodingHolder value:aBoolean. |
|
3489 |
||
3490 |
self |
|
3491 |
applicationNamed:#FileApplicationNoteBook |
|
3492 |
ifPresentDo:[:nb | |
|
3493 |
|appl| |
|
3494 |
||
3495 |
appl := nb selectedApplication. |
|
3496 |
(appl notNil and:[appl isTextEditor]) ifTrue:[ |
|
3497 |
appl lockFileEncoding:aBoolean |
|
3498 |
] |
|
3499 |
]. |
|
3500 |
! |
|
3501 |
||
3502 |
lockFileEncodingHolder |
|
3503 |
^ self |
|
3504 |
aspectFor:#lockFileEncodingHolder |
|
3505 |
ifAbsent:[ |
|
3506 |
self |
|
3507 |
applicationNamed:#FileApplicationNoteBook |
|
3508 |
ifPresentDo:[:appl | appl lockFileEncodingHolder]. |
|
3509 |
] |
|
3510 |
! |
|
3511 |
||
4523 | 3512 |
notify:aString |
11108 | 3513 |
"aString is shown in the lower pane" |
3514 |
||
4523 | 3515 |
self notifyChannel value:aString |
11108 | 3516 |
|
3517 |
"Modified (comment): / 11-01-2012 / 21:46:55 / cg" |
|
4523 | 3518 |
! |
3519 |
||
3892 | 3520 |
notifyChannel |
3521 |
||
3522 |
^ self aspectFor:#notifyChannel ifAbsent:['' asValue] |
|
4071 | 3523 |
! |
3524 |
||
9575
548adf8e9d98
added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents:
9572
diff
changeset
|
3525 |
progressPercentageHolder |
548adf8e9d98
added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents:
9572
diff
changeset
|
3526 |
^ self aspectFor:#progressPercentageHolder ifAbsent:[ nil asValue ]. |
548adf8e9d98
added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents:
9572
diff
changeset
|
3527 |
|
548adf8e9d98
added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents:
9572
diff
changeset
|
3528 |
"Created: / 11-10-2010 / 12:54:46 / cg" |
548adf8e9d98
added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents:
9572
diff
changeset
|
3529 |
! |
548adf8e9d98
added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents:
9572
diff
changeset
|
3530 |
|
4071 | 3531 |
rootHolder |
3532 |
"holder, which keeps the rootHolder of the treeView |
|
3533 |
" |
|
3534 |
||
4368
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
3535 |
^ self aspectFor:#rootHolder ifAbsent:[ |
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
3536 |
self class rootHolder asValue. |
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
3537 |
]. |
8192
26660fb61e7a
Make FileDialog usable as SubCanvas
Stefan Vogel <sv@exept.de>
parents:
8185
diff
changeset
|
3538 |
! |
26660fb61e7a
Make FileDialog usable as SubCanvas
Stefan Vogel <sv@exept.de>
parents:
8185
diff
changeset
|
3539 |
|
26660fb61e7a
Make FileDialog usable as SubCanvas
Stefan Vogel <sv@exept.de>
parents:
8185
diff
changeset
|
3540 |
rootHolder:aHolder |
26660fb61e7a
Make FileDialog usable as SubCanvas
Stefan Vogel <sv@exept.de>
parents:
8185
diff
changeset
|
3541 |
|
26660fb61e7a
Make FileDialog usable as SubCanvas
Stefan Vogel <sv@exept.de>
parents:
8185
diff
changeset
|
3542 |
self aspectFor:#rootHolder put:aHolder |
3892 | 3543 |
! ! |
3544 |
||
3545 |
!AbstractFileBrowser methodsFor:'aspects handling'! |
|
3546 |
||
3547 |
aspectFor:something ifAbsent:aBlock |
|
6284 | 3548 |
"returns the model for an aspect; these are stored in a common dictionary" |
3549 |
||
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3550 |
^ self aspectFor:something ifAbsent:aBlock notPresentDo:nil |
3892 | 3551 |
! |
3552 |
||
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3553 |
aspectFor:aKey ifAbsent:aBlock notPresentDo:notPresentBlock |
6284 | 3554 |
"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
|
3555 |
|
4213
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
3556 |
|holder saveAspectItem aspect| |
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
3557 |
|
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3558 |
holder := aspects at:aKey ifAbsent:[ |
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3559 |
masterApplication notNil ifTrue:[ |
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3560 |
holder := masterApplication aspectOrNil:aKey forSubApplication:self. |
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3561 |
]. |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3562 |
holder isNil ifTrue:[ |
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3563 |
saveAspectItem := self runtimeAspectValueFor:aKey. |
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3564 |
saveAspectItem notNil ifTrue:[ |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3565 |
saveAspectItem isHolder ifTrue:[ |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3566 |
holder := ValueHolder with:saveAspectItem value |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3567 |
] ifFalse:[ |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3568 |
holder := saveAspectItem value |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3569 |
]. |
4213
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
3570 |
] ifFalse:[ |
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3571 |
aspect := self userPreferencesAspectValueFor:aKey. |
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3572 |
aspect notNil ifTrue:[ |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3573 |
holder := aspect asValue |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3574 |
] ifFalse:[ |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3575 |
holder := aBlock value. |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3576 |
] |
4213
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
3577 |
]. |
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
3578 |
]. |
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
3579 |
holder notNil ifTrue:[ |
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3580 |
notPresentBlock notNil ifTrue:[ |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3581 |
holder value:(notPresentBlock value:holder). |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3582 |
]. |
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3583 |
aspects at:aKey put:holder |
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3584 |
]. |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3585 |
holder |
4213
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
3586 |
]. |
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
3587 |
^ holder |
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
3588 |
! |
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
3589 |
|
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3590 |
aspectFor:something put:aValueHolder |
6284 | 3591 |
"stores the model for an aspect; these are stored in a common dictionary" |
3592 |
||
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3593 |
aspects at:something put:aValueHolder |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3594 |
! |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3595 |
|
3892 | 3596 |
aspects |
6284 | 3597 |
"returns the common aspect dictionary" |
3598 |
||
3892 | 3599 |
^ aspects |
3600 |
! |
|
3601 |
||
3602 |
runtimeAspectValueFor:something |
|
3603 |
"returns the default aspect item from the class variable RuntimeAspects |
|
3604 |
" |
|
3605 |
^ self class runtimeAspects at:something ifAbsent:nil. |
|
3606 |
! |
|
3607 |
||
4201 | 3608 |
saveAspectValues |
3609 |
|saveAspects aspectValue| |
|
3610 |
||
3611 |
||
7078
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
3612 |
saveAspects := self class userPreferencesAspectList keys. |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
3613 |
saveAspects do:[ :aspectKey | |
4201 | 3614 |
aspectValue := (self perform:aspectKey) value. |
7078
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
3615 |
UserPreferences current |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
3616 |
at: ('fileBrowser_',aspectKey asString) asSymbol |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
3617 |
put: aspectValue. |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
3618 |
]. |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
3619 |
|
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
3620 |
"Modified: / 04-09-2006 / 10:02:41 / cg" |
4201 | 3621 |
! |
3622 |
||
3892 | 3623 |
saveRuntimeAspectValues |
3624 |
|savedAspects dictionary value isHolder aspect| |
|
3625 |
||
5941 | 3626 |
savedAspects := self class listOfRuntimeValuesToRemember. |
3892 | 3627 |
dictionary := Dictionary new. |
5941 | 3628 |
savedAspects do:[:aspectKey | |
4414 | 3629 |
aspect := self perform:aspectKey. |
3630 |
isHolder := aspect isValueModel. |
|
5941 | 3631 |
isHolder ifTrue:[ |
3632 |
value := aspect value |
|
3633 |
] ifFalse:[ |
|
3634 |
value := aspect |
|
3635 |
]. |
|
3636 |
dictionary at:aspectKey |
|
3637 |
put:(SaveAspectItem withValue:value isHolder:isHolder) |
|
3638 |
]. |
|
3639 |
RuntimeAspects := dictionary. |
|
3892 | 3640 |
! |
3641 |
||
4201 | 3642 |
userPreferencesAspectValueFor:something |
3643 |
"returns the default aspect from the Userpreferences |
|
3892 | 3644 |
" |
4201 | 3645 |
|
7078
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
3646 |
(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
|
3647 |
^ UserPreferences current |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
3648 |
at:('fileBrowser_',something) asSymbol |
9579
7107f49e4583
changed: #userPreferencesAspectValueFor:
Claus Gittinger <cg@exept.de>
parents:
9575
diff
changeset
|
3649 |
ifAbsent:nil "(self class userPreferencesAspectList at:something)". |
7107f49e4583
changed: #userPreferencesAspectValueFor:
Claus Gittinger <cg@exept.de>
parents:
9575
diff
changeset
|
3650 |
|
7107f49e4583
changed: #userPreferencesAspectValueFor:
Claus Gittinger <cg@exept.de>
parents:
9575
diff
changeset
|
3651 |
"Modified: / 14-10-2010 / 19:16:38 / cg" |
3892 | 3652 |
! ! |
3653 |
||
4011 | 3654 |
!AbstractFileBrowser methodsFor:'aspects-filter'! |
3655 |
||
9015 | 3656 |
filter:aString |
3657 |
self filterModel value:aString |
|
3658 |
! |
|
3659 |
||
4018 | 3660 |
filterBackgroundColor |
3661 |
||
3662 |
^ self aspectFor:#filterBackgroundColor ifAbsent:[Color white asValue] |
|
3663 |
! |
|
3664 |
||
4011 | 3665 |
filterBlockHolder |
3666 |
||
5658
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
3667 |
^ self aspectFor:#filterBlockHolder ifAbsent:[self makeFilterBlock asValue] |
4011 | 3668 |
! |
3669 |
||
3670 |
filterListModel |
|
3671 |
||
3672 |
^ self aspectFor:#filterListModel ifAbsent:[self class defaultFilterList] |
|
3673 |
! |
|
3674 |
||
3675 |
filterModel |
|
5941 | 3676 |
|m| |
3677 |
||
3678 |
m := self aspectFor:#filterModel ifAbsent:[(self filterListModel at:1) asValue]. |
|
3679 |
^ m |
|
4011 | 3680 |
! |
3681 |
||
8185
8b6f11fd7fbf
Make #filterModel reusable as SubCanvas
Stefan Vogel <sv@exept.de>
parents:
8172
diff
changeset
|
3682 |
filterModel:aHolder |
8b6f11fd7fbf
Make #filterModel reusable as SubCanvas
Stefan Vogel <sv@exept.de>
parents:
8172
diff
changeset
|
3683 |
self aspectFor:#filterModel put:aHolder. |
8b6f11fd7fbf
Make #filterModel reusable as SubCanvas
Stefan Vogel <sv@exept.de>
parents:
8172
diff
changeset
|
3684 |
! |
8b6f11fd7fbf
Make #filterModel reusable as SubCanvas
Stefan Vogel <sv@exept.de>
parents:
8172
diff
changeset
|
3685 |
|
4018 | 3686 |
filterValueBox |
3687 |
||
3688 |
^ self aspectFor:#filterValueBox ifAbsent:[ValueHolder new] |
|
3689 |
! |
|
3690 |
||
5658
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
3691 |
makeFilterBlock |
9102 | 3692 |
"return a two-arg filterblock on the files path- and base-name. This block should return true for files |
3693 |
to be shown" |
|
3694 |
||
7565
521264d23941
ignoreCase if Filename is not case sensitive in #makeFilterBlock
fm
parents:
7560
diff
changeset
|
3695 |
| filterString filterStrings filters showHidden yesOrNo filterBlock ignoreCase| |
5658
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
3696 |
|
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
3697 |
filterString := self filterModel value. |
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
3698 |
filterString = '' ifTrue:[filterString := '*']. |
7565
521264d23941
ignoreCase if Filename is not case sensitive in #makeFilterBlock
fm
parents:
7560
diff
changeset
|
3699 |
ignoreCase := "ignoreCaseInPattern ? "(Filename isCaseSensitive not). |
5658
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
3700 |
|
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
3701 |
filterStrings := filterString asCollectionOfSubstringsSeparatedBy:$;. |
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
3702 |
filters := filterStrings |
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
3703 |
collect:[:eachPattern | |
9296 | 3704 |
|pattern| |
3705 |
||
3706 |
pattern := eachPattern withoutSeparators. |
|
3707 |
yesOrNo := true. |
|
3708 |
(pattern startsWith:'~') ifTrue:[ |
|
3709 |
yesOrNo := false. |
|
3710 |
pattern := pattern copyFrom:2. |
|
5658
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
3711 |
]. |
9296 | 3712 |
yesOrNo ifTrue:[ |
3713 |
[:name :baseName | pattern match:baseName ignoreCase:ignoreCase] |
|
3714 |
] ifFalse:[ |
|
3715 |
[:name :baseName | (pattern match:baseName ignoreCase:ignoreCase) not] |
|
3716 |
]. |
|
3717 |
]. |
|
5658
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
3718 |
|
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
3719 |
filters size == 1 ifTrue:[ |
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
3720 |
filterBlock := filters first |
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
3721 |
] ifFalse:[ |
9102 | 3722 |
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
|
3723 |
]. |
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
3724 |
|
4011 | 3725 |
showHidden := self showHiddenFiles value. |
3726 |
showHidden ifTrue:[ |
|
5658
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
3727 |
^ filterBlock. |
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
3728 |
]. |
9296 | 3729 |
^ [:name :baseName | |
3730 |
name isHidden not and:[filterBlock value:name value:baseName]]. |
|
4018 | 3731 |
! |
3732 |
||
3733 |
shownFiles |
|
3734 |
||
3735 |
^ self aspectFor:#shownFiles ifAbsent:['-/-' asValue] |
|
4011 | 3736 |
! ! |
3737 |
||
3892 | 3738 |
!AbstractFileBrowser methodsFor:'aspects-history'! |
3739 |
||
3740 |
dirHistory |
|
6369 | 3741 |
"obsolete" |
3742 |
^ self directoryHistory |
|
3743 |
! |
|
3744 |
||
3745 |
directoryHistory |
|
3952 | 3746 |
^ self class directoryHistory |
3892 | 3747 |
! |
3748 |
||
3749 |
enableBack |
|
3750 |
||
3751 |
^ self aspectFor:#enableBack ifAbsent:[false asValue] |
|
3752 |
! |
|
3753 |
||
3754 |
enableFileHistory |
|
3755 |
||
3756 |
^ self aspectFor:#enableFileHistory ifAbsent:[false asValue] |
|
3757 |
! |
|
3758 |
||
3759 |
enableForward |
|
3760 |
||
3761 |
^ self aspectFor:#enableForward ifAbsent:[false asValue] |
|
3762 |
! |
|
3763 |
||
3764 |
fileHistory |
|
9820
07b7d7929e3e
variable renamed in: #fileHistory
Stefan Vogel <sv@exept.de>
parents:
9793
diff
changeset
|
3765 |
^ self aspectFor:#fileHistory ifAbsent:[OrderedSet new] |
3892 | 3766 |
! ! |
3767 |
||
3768 |
!AbstractFileBrowser methodsFor:'aspects-visibility'! |
|
3769 |
||
4345 | 3770 |
activityVisibilityChannel |
6284 | 3771 |
" activityVisibilityChannel switches the activity indicator on/off" |
4345 | 3772 |
|
3773 |
^ self aspectFor:#activityVisibilityChannel ifAbsent:[ false asValue ]. |
|
3774 |
! |
|
3775 |
||
6602 | 3776 |
changeSetBrowserItemVisible |
3777 |
^ Screen current ctrlDown. |
|
3778 |
! |
|
3779 |
||
4110 | 3780 |
openAlwaysInTextEditor |
4201 | 3781 |
" aspect for open every file in TextEditor dont use e.g. HtmlEditor for *.html'" |
4110 | 3782 |
|
3783 |
^ self aspectFor:#openAlwaysInTextEditor ifAbsent:[ false asValue ]. |
|
3784 |
! |
|
3785 |
||
3892 | 3786 |
openMultipleApplicationsForType |
3787 |
||
4201 | 3788 |
" aspect for open more applications for e.g. TextEditor and not change the contents of already |
3789 |
open TextEditor " |
|
3790 |
||
3892 | 3791 |
^ self aspectFor:#openMultipleApplicationsForType ifAbsent:[ false asValue ]. |
3792 |
! |
|
3793 |
||
4201 | 3794 |
showDirectoryTree |
3795 |
||
3796 |
^ self aspectFor:#showDirectoryTree ifAbsent:[ true asValue ] |
|
3892 | 3797 |
! |
3798 |
||
4554 | 3799 |
showDiskUsageHolder |
3800 |
|holder| |
|
3801 |
||
4560
0d3db5e27bc0
default for disk usage is false
Claus Gittinger <cg@exept.de>
parents:
4558
diff
changeset
|
3802 |
holder := self aspectFor:#showDiskUsageHolder ifAbsent:[ false asValue]. |
4781 | 3803 |
holder addDependent:self. |
4554 | 3804 |
^ holder |
3805 |
! |
|
3806 |
||
3892 | 3807 |
showHiddenFiles |
3808 |
||
9582 | 3809 |
^ self aspectFor:#showHiddenFiles ifAbsent:[ true asValue ]. |
3810 |
||
3811 |
"Modified: / 15-10-2010 / 10:28:17 / cg" |
|
3892 | 3812 |
! |
3813 |
||
9108 | 3814 |
showHiddenFiles:aHolder |
3815 |
self aspectFor:#showHiddenFiles put:aHolder. |
|
3816 |
! |
|
3817 |
||
3818 |
shownFiles:aHolder |
|
3819 |
self aspectFor:#shownFiles put:aHolder. |
|
3820 |
! |
|
3821 |
||
9945
b32126680c13
added: #tagsBrowserVisibleHolder
Claus Gittinger <cg@exept.de>
parents:
9820
diff
changeset
|
3822 |
tagsBrowserVisibleHolder |
b32126680c13
added: #tagsBrowserVisibleHolder
Claus Gittinger <cg@exept.de>
parents:
9820
diff
changeset
|
3823 |
masterApplication notNil ifTrue:[ |
b32126680c13
added: #tagsBrowserVisibleHolder
Claus Gittinger <cg@exept.de>
parents:
9820
diff
changeset
|
3824 |
^ masterApplication tagsBrowserVisibleHolder |
b32126680c13
added: #tagsBrowserVisibleHolder
Claus Gittinger <cg@exept.de>
parents:
9820
diff
changeset
|
3825 |
]. |
10762
311190be6490
changed: #tagsBrowserVisibleHolder
Claus Gittinger <cg@exept.de>
parents:
10757
diff
changeset
|
3826 |
^ self aspectFor:#tagsBrowserVisibleHolder ifAbsent:[ FileApplicationNoteBook::TextEditor defaultTagsBrowserVisible asValue ]. |
9945
b32126680c13
added: #tagsBrowserVisibleHolder
Claus Gittinger <cg@exept.de>
parents:
9820
diff
changeset
|
3827 |
|
b32126680c13
added: #tagsBrowserVisibleHolder
Claus Gittinger <cg@exept.de>
parents:
9820
diff
changeset
|
3828 |
"Created: / 27-06-2011 / 16:02:59 / cg" |
b32126680c13
added: #tagsBrowserVisibleHolder
Claus Gittinger <cg@exept.de>
parents:
9820
diff
changeset
|
3829 |
! |
b32126680c13
added: #tagsBrowserVisibleHolder
Claus Gittinger <cg@exept.de>
parents:
9820
diff
changeset
|
3830 |
|
10757
5bbe8b995a5f
added: #useCodeView2InTools
Claus Gittinger <cg@exept.de>
parents:
10747
diff
changeset
|
3831 |
useCodeView2InTools |
5bbe8b995a5f
added: #useCodeView2InTools
Claus Gittinger <cg@exept.de>
parents:
10747
diff
changeset
|
3832 |
^ self aspectFor:#useCodeView2InTools ifAbsent:[ UserPreferences current useCodeView2InTools asValue ]. |
5bbe8b995a5f
added: #useCodeView2InTools
Claus Gittinger <cg@exept.de>
parents:
10747
diff
changeset
|
3833 |
|
5bbe8b995a5f
added: #useCodeView2InTools
Claus Gittinger <cg@exept.de>
parents:
10747
diff
changeset
|
3834 |
"Created: / 06-10-2011 / 11:45:58 / cg" |
5bbe8b995a5f
added: #useCodeView2InTools
Claus Gittinger <cg@exept.de>
parents:
10747
diff
changeset
|
3835 |
! |
5bbe8b995a5f
added: #useCodeView2InTools
Claus Gittinger <cg@exept.de>
parents:
10747
diff
changeset
|
3836 |
|
4648 | 3837 |
userContextAvailable |
3838 |
||
3839 |
" aspect for show group and user columns in contents view |
|
3840 |
windows provides no user context" |
|
3841 |
||
3842 |
^ OperatingSystem isMSWINDOWSlike not |
|
3843 |
! |
|
3844 |
||
3892 | 3845 |
viewDescription |
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3846 |
"aspect for show file description in DirectoryContentsBrowser" |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3847 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3848 |
^ self directoryContentsBrowser viewDescription |
3892 | 3849 |
! |
3850 |
||
3851 |
viewDetails |
|
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3852 |
"aspect for show more file properties in DirectoryContentsBrowser |
4201 | 3853 |
" |
3892 | 3854 |
|
6121 | 3855 |
|directoryContentsBrowser| |
3856 |
||
3857 |
directoryContentsBrowser := self directoryContentsBrowser. |
|
3858 |
directoryContentsBrowser isNil ifTrue:[^ nil]. |
|
3859 |
^ directoryContentsBrowser viewDetails |
|
3892 | 3860 |
! |
3861 |
||
3862 |
viewDirectoryDescription |
|
3863 |
||
4201 | 3864 |
" aspect for auto open a TextView for Readme and other see getInfoItem Method files |
3865 |
on change directory " |
|
3866 |
||
3892 | 3867 |
^ self aspectFor:#viewDirectoryDescription ifAbsent:[ true asValue ]. |
3868 |
! |
|
3869 |
||
4201 | 3870 |
viewDirsInContentsBrowser |
3871 |
||
3872 |
^ self aspectFor:#viewDirsInContentsBrowser ifAbsent:[ false asValue ]. |
|
9319
23ae966d9dbf
comment/format in: #viewDirsInContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
9299
diff
changeset
|
3873 |
|
23ae966d9dbf
comment/format in: #viewDirsInContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
9299
diff
changeset
|
3874 |
" |
23ae966d9dbf
comment/format in: #viewDirsInContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
9299
diff
changeset
|
3875 |
UserPreferences current viewDirsInContentsBrowser |
23ae966d9dbf
comment/format in: #viewDirsInContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
9299
diff
changeset
|
3876 |
" |
4201 | 3877 |
! |
3878 |
||
5870 | 3879 |
viewFilesInContentsBrowser |
3880 |
||
3881 |
^ self aspectFor:#viewFilesInContentsBrowser ifAbsent:[ true asValue ]. |
|
3882 |
! |
|
3883 |
||
3892 | 3884 |
viewFilesInDirectoryTree |
3885 |
||
4201 | 3886 |
" aspect for view files in tree view (not only directories) " |
3887 |
||
3892 | 3888 |
^ self aspectFor:#viewFilesInDirectoryTree ifAbsent:[ false asValue ]. |
3889 |
! |
|
3890 |
||
3891 |
viewGroup |
|
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3892 |
" aspect for show group information in DirectoryContentsBrowser " |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3893 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3894 |
^ self directoryContentsBrowser viewGroup |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3895 |
! |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3896 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3897 |
viewIcon |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3898 |
" aspect for show file-type icon in DirectoryContentsBrowser " |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3899 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3900 |
^ self directoryContentsBrowser viewIcon |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3901 |
! |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3902 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3903 |
viewInodeNumber |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3904 |
" aspect for show inode numbers in DirectoryContentsBrowser " |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3905 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3906 |
^ self directoryContentsBrowser viewInodeNumber |
3892 | 3907 |
! |
3908 |
||
3909 |
viewNoteBookApplicationHolder |
|
3910 |
||
3911 |
^ self aspectFor:#viewNoteBookApplicationHolder ifAbsent:[ false asValue]. |
|
3912 |
! |
|
3913 |
||
3914 |
viewOwner |
|
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3915 |
" aspect for show owner information in DirectoryContentsBrowser " |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3916 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3917 |
^ self directoryContentsBrowser viewOwner |
3892 | 3918 |
! |
3919 |
||
3920 |
viewPermissions |
|
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3921 |
" aspect for show permission information in DirectoryContentsBrowser " |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3922 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3923 |
^ self directoryContentsBrowser viewPermissions |
3892 | 3924 |
! |
3925 |
||
3926 |
viewPreview |
|
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3927 |
" aspect for show image previev in DirectoryContentsBrowser " |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3928 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3929 |
^ self directoryContentsBrowser viewPreview |
3892 | 3930 |
! |
3931 |
||
3932 |
viewSize |
|
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3933 |
" aspect for show size information in DirectoryContentsBrowser " |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3934 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3935 |
^ self directoryContentsBrowser viewSize |
3892 | 3936 |
! |
3937 |
||
4974 | 3938 |
viewSizeInBytes |
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3939 |
" aspect for show size-in-bytes information in DirectoryContentsBrowser " |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3940 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3941 |
^ self directoryContentsBrowser viewSizeInBytes |
4974 | 3942 |
! |
3943 |
||
5312 | 3944 |
viewSizeInKiloBytes |
3945 |
" aspect for show size-in-kilobytes information in DirectoryContentsBrowser " |
|
3946 |
||
3947 |
^ self directoryContentsBrowser viewSizeInKiloBytes |
|
3948 |
! |
|
3949 |
||
3892 | 3950 |
viewTime |
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3951 |
" aspect for show time information in DirectoryContentsBrowser" |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3952 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3953 |
^ self directoryContentsBrowser viewTime |
3892 | 3954 |
! |
3955 |
||
3956 |
viewType |
|
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3957 |
" aspect for show suffix (type) information in DirectoryContentsBrowser" |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3958 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3959 |
^ self directoryContentsBrowser viewType |
3892 | 3960 |
! ! |
3961 |
||
3962 |
!AbstractFileBrowser methodsFor:'background processing'! |
|
3963 |
||
3964 |
executeCommand:cmd |
|
3965 |
||
3966 |
self executeCommand:cmd inDirectory:nil |
|
3967 |
! |
|
3968 |
||
5880 | 3969 |
executeCommand:cmd inDirectory:aDirectoryOrNil |
3892 | 3970 |
| nameString executionBlock| |
3971 |
||
5880 | 3972 |
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
|
3973 |
nameString := 'Execute: ', cmd. |
3892 | 3974 |
self makeExecutionResultProcessFor:executionBlock withName:nameString. |
3975 |
! |
|
3976 |
||
3977 |
getExecutionBlockForCommand:cmd |
|
3978 |
||
3979 |
^ self getExecutionBlockForCommand:cmd inDirectory:nil |
|
3980 |
! |
|
3981 |
||
5880 | 3982 |
getExecutionBlockForCommand:cmd inDirectory:directoryOrNil |
3983 |
| dir| |
|
3984 |
||
3985 |
dir := directoryOrNil. |
|
3986 |
directoryOrNil isNil ifTrue:[ |
|
3987 |
dir := self theSingleSelectedDirectoryOrNil. |
|
6671 | 3988 |
dir isNil ifTrue:[ |
3989 |
Dialog warn:'Please select a single directory.'. |
|
3990 |
AbortSignal raise. |
|
3991 |
^ nil |
|
3992 |
]. |
|
3892 | 3993 |
]. |
4523 | 3994 |
|
3995 |
^ [:stream| |
|
3996 |
stream notNil ifTrue:[ |
|
4414 | 3997 |
OperatingSystem |
3998 |
executeCommand:cmd |
|
3999 |
inputFrom:nil |
|
4000 |
outputTo:stream |
|
4001 |
errorTo:stream |
|
4002 |
inDirectory:dir |
|
4003 |
onError:[:status| false]. |
|
4004 |
] |
|
4523 | 4005 |
]. |
3892 | 4006 |
! |
4007 |
||
4008 |
killAllRunningBackgroundProcesses |
|
4009 |
||
4010 |
self backgroundProcesses do:[ : process | |
|
4523 | 4011 |
self notify:'kill ', process name. |
4414 | 4012 |
process terminate. |
3892 | 4013 |
]. |
4014 |
! |
|
4015 |
||
4016 |
makeExecutionResultProcessFor:aBlock withName:aString |
|
4017 |
| stream process appl nameString| |
|
4018 |
||
4019 |
appl := self openCommandResultApplication. |
|
4020 |
stream := appl resultStream. |
|
4021 |
nameString := aString ? 'Execution Result'. |
|
4022 |
appl changeTabTo:nameString. |
|
4523 | 4023 |
|
8355 | 4024 |
process := [ |
4025 |
[aBlock value:stream] |
|
4891
5422df926e2d
Stream streamErrorSignal -> StreamError
Stefan Vogel <sv@exept.de>
parents:
4881
diff
changeset
|
4026 |
ensure:[ |
4516
dc3b7a89598a
close command view if no output was generated
Claus Gittinger <cg@exept.de>
parents:
4496
diff
changeset
|
4027 |
self backgroundProcesses remove:process ifAbsent:[]. |
dc3b7a89598a
close command view if no output was generated
Claus Gittinger <cg@exept.de>
parents:
4496
diff
changeset
|
4028 |
appl process value:nil. |
dc3b7a89598a
close command view if no output was generated
Claus Gittinger <cg@exept.de>
parents:
4496
diff
changeset
|
4029 |
|
dc3b7a89598a
close command view if no output was generated
Claus Gittinger <cg@exept.de>
parents:
4496
diff
changeset
|
4030 |
"/ close automatically, if there was no output. |
4571 | 4031 |
"/ appl resultStream contents isEmpty ifTrue:[ |
4032 |
"/ appl doClose. |
|
4033 |
"/ ] |
|
8355 | 4034 |
stream nextPutLine:'Done.' |
4516
dc3b7a89598a
close command view if no output was generated
Claus Gittinger <cg@exept.de>
parents:
4496
diff
changeset
|
4035 |
] |
dc3b7a89598a
close command view if no output was generated
Claus Gittinger <cg@exept.de>
parents:
4496
diff
changeset
|
4036 |
] newProcess. |
3892 | 4037 |
process priority:(Processor userBackgroundPriority). |
4038 |
process name:nameString. |
|
4039 |
self backgroundProcesses add:process. |
|
4040 |
appl process value:process. |
|
4041 |
process resume. |
|
4042 |
! ! |
|
4043 |
||
4044 |
!AbstractFileBrowser methodsFor:'change & update'! |
|
4045 |
||
4915 | 4046 |
currentFileNameHolderChanged |
4047 |
"/ self currentFileNameHolderChangedForCommon |
|
4048 |
! |
|
4049 |
||
4577 | 4050 |
currentFileNameHolderChangedForCommon |
5476 | 4051 |
|newDirectories oldDirectories size rootInTreeView selection selectionNotEmpty| |
4368
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
4052 |
|
7560 | 4053 |
selection := self currentSelectedObjects. |
4368
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
4054 |
self class currentSelection:selection. |
4734 | 4055 |
|
5476 | 4056 |
selectionNotEmpty := selection notEmpty. |
4057 |
self hasSelection value:selectionNotEmpty. |
|
4058 |
self hasFileSelection value:(selectionNotEmpty and:[self firstSelectedFile notNil]). |
|
4734 | 4059 |
|
4368
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
4060 |
newDirectories := self directoriesForFiles:selection. |
6725 | 4061 |
oldDirectories := self currentSelectedDirectories. |
4011 | 4062 |
oldDirectories ~= newDirectories ifTrue:[ |
4347 | 4063 |
self currentDirectories value:newDirectories. |
4064 |
size := newDirectories size. |
|
4774 | 4065 |
rootInTreeView := self |
4066 |
applicationNamed:#DirectoryTreeBrowser |
|
5009 | 4067 |
ifPresentDo:[:appl | appl rootHolder]. |
4068 |
rootInTreeView := rootInTreeView value. |
|
5437
3556b0348494
directory up not allowed for drive root under windows
penk
parents:
5432
diff
changeset
|
4069 |
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
|
4070 |
|
4347 | 4071 |
newDirectories notEmpty ifTrue:[ |
6369 | 4072 |
self directoryHistory addToHistory:(newDirectories first asString). |
4347 | 4073 |
]. |
5074 | 4074 |
self enableHome value:((newDirectories includes:(Filename homeDirectory asAbsoluteFilename))not). |
8168 | 4075 |
self enableGotoDesktop value:((newDirectories includes:(Filename desktopDirectory asAbsoluteFilename))not). |
6456 | 4076 |
self enableGotoDefaultDirectory value:((newDirectories includes:(Filename defaultDirectory asAbsoluteFilename))not). |
4077 |
self enableGotoSmalltalkDirectory value:((newDirectories includes:(self smalltalkDirectory asAbsoluteFilename))not). |
|
9572 | 4078 |
self enableGotoDesktopDirectory value:((newDirectories includes:(Filename desktopDirectory asAbsoluteFilename))not). |
9677 | 4079 |
self enableGotoTempDirectory value:((newDirectories includes:(self tempDirectory asAbsoluteFilename))not). |
4011 | 4080 |
]. |
9599
6ffff091db22
changed: #currentFileNameHolderChangedForCommon
Claus Gittinger <cg@exept.de>
parents:
9596
diff
changeset
|
4081 |
self enableGotoDefaultDirectory value:(self currentDirectory isNil or:[self currentDirectory pathName ~= OperatingSystem getCurrentDirectory]). |
9596 | 4082 |
self enableMakeCurrentDirectory value:(newDirectories size == 1 |
4083 |
and:[ newDirectories first asFilename pathName ~= OperatingSystem getCurrentDirectory ]). |
|
4022 | 4084 |
self enableForward value:self canForward. |
4734 | 4085 |
self enableBack value:self canBackward. |
6095 | 4086 |
|
4087 |
self updateCanMake. |
|
7560 | 4088 |
|
9677 | 4089 |
"Modified: / 29-12-2010 / 11:01:52 / cg" |
4011 | 4090 |
! |
4091 |
||
4092 |
filterModelChanged |
|
4093 |
||
5658
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
4094 |
self filterBlockHolder value:(self makeFilterBlock). |
4011 | 4095 |
! |
4096 |
||
3892 | 4097 |
update:something with:aParameter from:changedObject |
4098 |
||
4099 |
" do here all the things that have to be done for every part of the FileBrowserV2 |
|
4100 |
and the things that have to be done if it runs standalone " |
|
4101 |
||
4102 |
changedObject == self currentFileNameHolder ifTrue:[ |
|
4577 | 4103 |
self currentFileNameHolderChangedForCommon. |
4368
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
4104 |
^ self |
3892 | 4105 |
]. |
3989 | 4106 |
changedObject == self sortCaseless ifTrue:[ |
4368
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
4107 |
self sortFileListsBy:#baseName withReverse:false. |
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
4108 |
^ self |
3989 | 4109 |
]. |
6785
cac8107d889c
clear reverseSort flag, when sort-order is changed via menu.
Claus Gittinger <cg@exept.de>
parents:
6767
diff
changeset
|
4110 |
changedObject == self sortBlockProperty ifTrue:[ |
cac8107d889c
clear reverseSort flag, when sort-order is changed via menu.
Claus Gittinger <cg@exept.de>
parents:
6767
diff
changeset
|
4111 |
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
|
4112 |
^ self |
cac8107d889c
clear reverseSort flag, when sort-order is changed via menu.
Claus Gittinger <cg@exept.de>
parents:
6767
diff
changeset
|
4113 |
]. |
4011 | 4114 |
(changedObject == self filterModel or:[changedObject == self showHiddenFiles]) ifTrue:[ |
4368
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
4115 |
self filterModelChanged. |
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
4116 |
^ self |
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
4117 |
]. |
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
4118 |
changedObject == self rootHolder ifTrue:[ |
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
4119 |
self class rootHolder:(self rootHolder value). |
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
4120 |
^ self |
4004 | 4121 |
]. |
4781 | 4122 |
changedObject == self showDiskUsageHolder ifTrue:[ |
6190 | 4123 |
self notify:nil. |
4781 | 4124 |
^ self |
4125 |
]. |
|
3989 | 4126 |
|
3892 | 4127 |
super update:something with:aParameter from:changedObject |
5543 | 4128 |
! |
4129 |
||
6095 | 4130 |
updateCanMake |
4131 |
|dir can| |
|
4132 |
||
4133 |
can := false. |
|
4134 |
dir := self currentDirectory. |
|
4135 |
dir notNil ifTrue:[ |
|
4136 |
can := (dir asFilename construct:'Makefile') exists. |
|
4137 |
OperatingSystem isMSWINDOWSlike ifTrue:[ |
|
4138 |
can ifFalse:[ |
|
4139 |
can := (self currentDirectory asFilename construct:'nt.mak') exists. |
|
4140 |
] |
|
4141 |
]. |
|
4142 |
]. |
|
4143 |
self canMake value:can. |
|
4144 |
! |
|
4145 |
||
5543 | 4146 |
updateListAfterDelete:colOfFiles |
4147 |
self updateCurrentDirectory |
|
3892 | 4148 |
! ! |
4149 |
||
4150 |
!AbstractFileBrowser methodsFor:'clipboard'! |
|
4151 |
||
4152 |
canPaste |
|
4153 |
||
4154 |
^ self aspectFor:#canPaste ifAbsent:[ false asValue ]. |
|
4155 |
! |
|
4156 |
||
4157 |
clipboard |
|
4158 |
||
4159 |
^ self aspectFor:#clipboard ifAbsent:[Clipboard new] |
|
4160 |
! |
|
4161 |
||
4162 |
copyFilesToClipBoard:colOfFiles |
|
4163 |
self putInClipBoard:colOfFiles as:#copy. |
|
4164 |
! |
|
4165 |
||
4166 |
cutFilesToClipBoard:colOfFiles |
|
4167 |
"defete current selected files/directories |
|
4168 |
" |
|
4169 |
self putInClipBoard:colOfFiles as:#cut. |
|
4170 |
! |
|
4171 |
||
4172 |
emptyClipBoard |
|
4173 |
||
4174 |
self clipboard files:nil. |
|
4175 |
self canPaste value:false. |
|
4176 |
! |
|
4177 |
||
4178 |
putInClipBoard:colOfFiles as:aSymbol |
|
4179 |
| stream clp| |
|
4180 |
||
4181 |
colOfFiles isEmpty ifTrue:[ ^ self]. |
|
4182 |
clp := self clipboard. |
|
4183 |
clp files:nil. |
|
4184 |
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
|
4185 |
|
603abfa8cf99
copy name(s) to clipboard - on lineFeed if only one file is selected
Claus Gittinger <cg@exept.de>
parents:
5756
diff
changeset
|
4186 |
stream := String writeStream. |
3892 | 4187 |
stream nextPutAll:aSymbol asString. |
4188 |
stream nextPutAll:' <'. |
|
4189 |
stream nextPutAll:colOfFiles first asString. |
|
4190 |
colOfFiles size > 1 ifTrue:[ |
|
4414 | 4191 |
stream nextPutAll:' ...'. |
3892 | 4192 |
]. |
4193 |
stream nextPutAll:'> to clipboard'. |
|
4194 |
||
4523 | 4195 |
self notify:stream contents. |
3892 | 4196 |
stream close. |
4197 |
clp files:colOfFiles. |
|
4198 |
self canPaste value:true. |
|
4199 |
! ! |
|
4200 |
||
4201 |
!AbstractFileBrowser methodsFor:'drag & drop'! |
|
4202 |
||
4203 |
canDropFiles:dropedObjects for:filename |
|
6284 | 4204 |
|filenameDirString filenameDir| |
3892 | 4205 |
|
4206 |
dropedObjects isEmpty ifTrue:[^ false]. |
|
6284 | 4207 |
|
3892 | 4208 |
filenameDir := self getDirWithoutFileName:filename. |
7491 | 4209 |
filenameDir isNil ifTrue:[^ false ]. |
6250
5b0673ccff1c
refactored intention revealing code:
Claus Gittinger <cg@exept.de>
parents:
6236
diff
changeset
|
4210 |
filenameDir isWritable ifFalse:[^ false]. |
6284 | 4211 |
|
3892 | 4212 |
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
|
4213 |
|
7ce6eae41e33
do not check if dropFile exists, if its an archive file
Claus Gittinger <cg@exept.de>
parents:
4959
diff
changeset
|
4214 |
dropedObjects do:[:aDropObject | |
6284 | 4215 |
(self canDropObject:aDropObject into:filenameDir) ifFalse:[^ false]. |
4216 |
"/ |dropFileName dropFileNameString physicalPathName| |
|
4217 |
"/ |
|
4218 |
"/ dropFileName := aDropObject theObject. |
|
4219 |
"/ dropFileNameString := dropFileName asString. |
|
4220 |
"/ dropFileName isDirectory ifTrue:[ |
|
4221 |
"/ (self fileName:filenameDirString startsWith:dropFileNameString) ifTrue:[ |
|
4222 |
"/ self notify:'Cannot drop a directory into one of its parent directories'. |
|
4223 |
"/ ^ false |
|
4224 |
"/ ] |
|
4225 |
"/ ] ifFalse:[ |
|
4226 |
"/ physicalPathName := dropFileName physicalPathName. |
|
4227 |
"/ (filenameDirString = dropFileName directory asString |
|
4228 |
"/ or:[ aDropObject isFileInArchive not and:[physicalPathName notNil |
|
4229 |
"/ and:[ filenameDirString = physicalPathName asFilename directory asString]]]) ifTrue:[ |
|
4230 |
"/ self notify:'Cannot drop a file into same directory'. |
|
4231 |
"/ ^ false |
|
4232 |
"/ ] |
|
4233 |
"/ ] |
|
4234 |
]. |
|
4235 |
self notify:nil. |
|
4236 |
^ true |
|
4237 |
! |
|
4238 |
||
4239 |
canDropObject:aDropObject into:aDirectory |
|
4240 |
|filenameDirString dropFileName dropFileNameString physicalPathName| |
|
4241 |
||
4242 |
dropFileName := aDropObject theObject. |
|
4243 |
dropFileNameString := dropFileName asString. |
|
4244 |
dropFileName isDirectory ifTrue:[ |
|
4245 |
filenameDirString := aDirectory asString. |
|
4246 |
(self fileName:filenameDirString startsWith:dropFileNameString) ifTrue:[ |
|
4247 |
self notify:'Cannot drop a directory into one of its parent directories'. |
|
4248 |
^ false |
|
4414 | 4249 |
] |
6284 | 4250 |
] ifFalse:[ |
4251 |
physicalPathName := dropFileName physicalPathName. |
|
4252 |
(aDirectory = dropFileName directory |
|
4253 |
or:[ aDropObject isFileInArchive not |
|
4254 |
and:[physicalPathName notNil |
|
4255 |
and:[ aDirectory = physicalPathName asFilename directory]]]) ifTrue:[ |
|
4256 |
self notify:'Cannot drop a file into same directory'. |
|
4257 |
^ false |
|
4258 |
] |
|
4259 |
]. |
|
4260 |
^ true. |
|
3892 | 4261 |
! |
4262 |
||
7406 | 4263 |
canDropObjects:aCollectionOfDropObjects in:aWidget |
4264 |
^ aCollectionOfDropObjects contains:[:dropObject | dropObject isFileObject] |
|
4265 |
||
4266 |
"Created: / 13-10-2006 / 15:52:49 / cg" |
|
4267 |
! |
|
4268 |
||
3892 | 4269 |
doStartDrag:aDropSource in:aView |
7829 | 4270 |
"set the cursors before starting the drag & drop operation" |
4271 |
||
3892 | 4272 |
|hdl| |
4273 |
||
4274 |
hdl := DragAndDropManager new. |
|
4275 |
||
4337
f2eed806e854
change first letter uppercase methods on class side to lowercase ones
penk
parents:
4317
diff
changeset
|
4276 |
hdl disabledCursor:self class disabledCursorImage. |
f2eed806e854
change first letter uppercase methods on class side to lowercase ones
penk
parents:
4317
diff
changeset
|
4277 |
hdl enabledCursor:self class enabledCursorImage. |
3892 | 4278 |
hdl alienCursor:nil. |
4279 |
||
4745 | 4280 |
hdl startDragFrom:aView dropSource:aDropSource offset:#topLeft. |
4281 |
||
7829 | 4282 |
"Modified: / 23-07-2007 / 23:00:38 / cg" |
6479 | 4283 |
! |
4284 |
||
7408 | 4285 |
dropObjects:aCollectionOfDropObjects in:aWidget at:position |
7990 | 4286 |
|fileEntryFieldHolder destDir dropObject fn d| |
4287 |
||
4288 |
fileEntryFieldHolder := self masterApplication notNil |
|
4289 |
ifTrue:[ self masterApplication fileEntryFieldHolder ] |
|
4290 |
ifFalse:[ self fileEntryFieldHolder ]. |
|
4291 |
||
4292 |
aWidget model == fileEntryFieldHolder ifTrue:[ |
|
7900
52ad708471ad
drop into fileName-path-field: goto that directory
Claus Gittinger <cg@exept.de>
parents:
7897
diff
changeset
|
4293 |
dropObject := aCollectionOfDropObjects first. |
52ad708471ad
drop into fileName-path-field: goto that directory
Claus Gittinger <cg@exept.de>
parents:
7897
diff
changeset
|
4294 |
dropObject isFileObject ifTrue:[ |
52ad708471ad
drop into fileName-path-field: goto that directory
Claus Gittinger <cg@exept.de>
parents:
7897
diff
changeset
|
4295 |
fn := dropObject theObject asFilename. |
52ad708471ad
drop into fileName-path-field: goto that directory
Claus Gittinger <cg@exept.de>
parents:
7897
diff
changeset
|
4296 |
dropObject isDirectory ifTrue:[ |
52ad708471ad
drop into fileName-path-field: goto that directory
Claus Gittinger <cg@exept.de>
parents:
7897
diff
changeset
|
4297 |
d := fn. |
52ad708471ad
drop into fileName-path-field: goto that directory
Claus Gittinger <cg@exept.de>
parents:
7897
diff
changeset
|
4298 |
] ifFalse:[ |
52ad708471ad
drop into fileName-path-field: goto that directory
Claus Gittinger <cg@exept.de>
parents:
7897
diff
changeset
|
4299 |
d := fn directory. |
52ad708471ad
drop into fileName-path-field: goto that directory
Claus Gittinger <cg@exept.de>
parents:
7897
diff
changeset
|
4300 |
]. |
7990 | 4301 |
fileEntryFieldHolder value:d pathName. |
7900
52ad708471ad
drop into fileName-path-field: goto that directory
Claus Gittinger <cg@exept.de>
parents:
7897
diff
changeset
|
4302 |
]. |
52ad708471ad
drop into fileName-path-field: goto that directory
Claus Gittinger <cg@exept.de>
parents:
7897
diff
changeset
|
4303 |
^ self. |
52ad708471ad
drop into fileName-path-field: goto that directory
Claus Gittinger <cg@exept.de>
parents:
7897
diff
changeset
|
4304 |
]. |
6479 | 4305 |
|
4306 |
destDir := self currentDirectory. |
|
4307 |
destDir isNil ifTrue:[^ self]. |
|
4308 |
||
8601 | 4309 |
self withWaitCursorDo:[ |
4310 |
aCollectionOfDropObjects do:[:dropObject | |
|
4311 |
|fn| |
|
4312 |
||
4313 |
dropObject isFileObject ifTrue:[ |
|
4314 |
fn := dropObject theObject asFilename. |
|
4315 |
dropObject isDirectory ifTrue:[ |
|
8808
cb6476c0cd3a
oops - drop of directories was broken
Claus Gittinger <cg@exept.de>
parents:
8716
diff
changeset
|
4316 |
fn recursiveCopyTo:destDir |
8601 | 4317 |
] ifFalse:[ |
8950
48c69259d82d
changed: #dropObjects:in:at:
Claus Gittinger <cg@exept.de>
parents:
8887
diff
changeset
|
4318 |
fn copyTo:(destDir / fn baseName ) |
8601 | 4319 |
] |
6479 | 4320 |
] |
8601 | 4321 |
]. |
4322 |
]. |
|
9268
fbeb680106c9
changed: #dropObjects:in:at:
Claus Gittinger <cg@exept.de>
parents:
9267
diff
changeset
|
4323 |
self directoryContentsBrowser notNil ifTrue:[ |
fbeb680106c9
changed: #dropObjects:in:at:
Claus Gittinger <cg@exept.de>
parents:
9267
diff
changeset
|
4324 |
self directoryContentsBrowser |
fbeb680106c9
changed: #dropObjects:in:at:
Claus Gittinger <cg@exept.de>
parents:
9267
diff
changeset
|
4325 |
directoryContentsChangeFlag:true; |
fbeb680106c9
changed: #dropObjects:in:at:
Claus Gittinger <cg@exept.de>
parents:
9267
diff
changeset
|
4326 |
wakeUp |
fbeb680106c9
changed: #dropObjects:in:at:
Claus Gittinger <cg@exept.de>
parents:
9267
diff
changeset
|
4327 |
]. |
7408 | 4328 |
|
4329 |
"Created: / 13-10-2006 / 18:26:41 / cg" |
|
3892 | 4330 |
! ! |
4331 |
||
4332 |
!AbstractFileBrowser methodsFor:'file operations'! |
|
4333 |
||
4334 |
copyFile:aSourceFile to:aDestFile |
|
6190 | 4335 |
"copy to" |
4336 |
||
7635 | 4337 |
^ self copyFile:aSourceFile to:aDestFile repairCorruptedFiles:false |
4338 |
||
4339 |
"Modified: / 07-02-2007 / 18:46:44 / cg" |
|
4340 |
! |
|
4341 |
||
4342 |
copyFile:aSourceFile to:aDestFile repairCorruptedFiles:repairCorruptedFiles |
|
4343 |
"copy to" |
|
4344 |
||
4345 |
|copyOperation msg| |
|
4346 |
||
4347 |
repairCorruptedFiles ifTrue:[ |
|
4348 |
copyOperation := FileOperation copyCorruptedFile:aSourceFile to:aDestFile |
|
4349 |
] ifFalse:[ |
|
4350 |
copyOperation := FileOperation copyFile:aSourceFile to:aDestFile withOverWriteWarning:true copyFileIfSame:true. |
|
4351 |
]. |
|
4352 |
copyOperation result ifTrue:[ |
|
6190 | 4353 |
msg := ('copy ', aSourceFile baseName, ' to:,', aDestFile baseName). |
3892 | 4354 |
] ifFalse:[ |
7635 | 4355 |
msg := copyOperation errorString. |
6190 | 4356 |
]. |
4357 |
self notify:msg. |
|
7635 | 4358 |
^ copyOperation result |
4359 |
||
4360 |
"Created: / 07-02-2007 / 18:46:34 / cg" |
|
3892 | 4361 |
! |
4362 |
||
4363 |
copyFiles:aColOfSourceFiles to:aDirectory |
|
6374 | 4364 |
|copy result| |
3892 | 4365 |
|
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
4366 |
self withActivityIndicationDo:[ |
5961 | 4367 |
copy := FileOperation copyFiles:aColOfSourceFiles to:aDirectory. |
6374 | 4368 |
copy result ifTrue:[ |
4369 |
result := Dictionary withKeys:(copy collectionOfCopiedFiles) andValues:(copy collectionOfNewFiles). |
|
4370 |
] ifFalse:[ |
|
4629
e8739857466c
show busyCursor while moving/copying files.
Claus Gittinger <cg@exept.de>
parents:
4624
diff
changeset
|
4371 |
self notify:copy errorString. |
e8739857466c
show busyCursor while moving/copying files.
Claus Gittinger <cg@exept.de>
parents:
4624
diff
changeset
|
4372 |
]. |
e8739857466c
show busyCursor while moving/copying files.
Claus Gittinger <cg@exept.de>
parents:
4624
diff
changeset
|
4373 |
self updateCurrentDirectory. |
3892 | 4374 |
]. |
6374 | 4375 |
^ result |
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
4376 |
|
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
4377 |
"Modified: / 25-07-2006 / 09:07:04 / cg" |
3892 | 4378 |
! |
4379 |
||
4707
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4380 |
copyOrMoveDialog:aCollectionOfFiles for:aDestinationDirectory |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4381 |
|size stream msg answer file| |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4382 |
|
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4383 |
size := aCollectionOfFiles size. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4384 |
|
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4385 |
"/ stream := WriteStream on:'' asText. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4386 |
"/ 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
|
4387 |
"/ size == 1 ifFalse:[ |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4388 |
"/ stream nextPutAll:'s'. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4389 |
"/ ]. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4390 |
"/ stream nextPutAll:': '. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4391 |
"/ 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
|
4392 |
"/ size == 1 ifFalse:[ |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4393 |
"/ stream nextPutAll:' ... '. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4394 |
"/ 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
|
4395 |
"/ ]. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4396 |
"/ stream cr; nextPutAll:'to: '. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4397 |
"/ 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
|
4398 |
"/ msg := stream contents |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4399 |
size == 1 ifTrue:[ |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4400 |
file := aCollectionOfFiles first. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4401 |
msg := resources |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4402 |
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
|
4403 |
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
|
4404 |
with:(file baseName allBold) |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4405 |
with:(aDestinationDirectory asFilename pathName allBold). |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4406 |
] ifFalse:[ |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4407 |
msg := resources |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4408 |
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
|
4409 |
with:size |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4410 |
with:(aDestinationDirectory asFilename pathName allBold). |
3892 | 4411 |
]. |
4707
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4412 |
|
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4413 |
answer := OptionBox |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4414 |
request:msg |
8127 | 4415 |
label:(resources string:'Copy or Move') |
5898
f6214812e1d2
dont send obsolete message to OptionBox
Claus Gittinger <cg@exept.de>
parents:
5888
diff
changeset
|
4416 |
image:(WarningBox iconBitmap) |
8127 | 4417 |
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
|
4418 |
values:#(#cancel #move #copy #copyAs) |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
4419 |
default:#copy. |
4707
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4420 |
answer isNil ifTrue:[answer := #cancel]. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4421 |
^ answer. |
3892 | 4422 |
! |
4423 |
||
4354
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
4424 |
copyOrMoveFiles:aColOfSourceFiles to:aDestinationDirectory |
4745 | 4425 |
"copy or move aColOfSourceFiles to aDirectory. |
4426 |
Asks the used if a move or a copy is wanted. |
|
4427 |
Returns true if the copyOrMove happened, false if user aborted the operation." |
|
4428 |
||
4707
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4429 |
|answer lastOld lastNew| |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4430 |
|
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4431 |
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
|
4432 |
answer == #copyAs ifTrue:[ |
4354
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
4433 |
aColOfSourceFiles do:[:eachSourceFile | |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
4434 |
|initial destFile srcBase dstBase| |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
4435 |
|
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
4436 |
srcBase := eachSourceFile asFilename baseName. |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
4437 |
lastOld isNil ifTrue:[ |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
4438 |
initial := srcBase |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
4439 |
] ifFalse:[ |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
4440 |
initial := DoWhatIMeanSupport |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
4441 |
goodRenameDefaultForFile:srcBase lastOld:lastOld lastNew:lastNew. |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
4442 |
]. |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
4443 |
dstBase := Dialog request:('Copy %1 as:' bindWith:srcBase) initialAnswer:initial. |
4745 | 4444 |
dstBase isNil ifTrue:[^ false]. |
4354
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
4445 |
self copyFile:eachSourceFile to:(aDestinationDirectory construct:dstBase). |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
4446 |
lastOld := srcBase. |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
4447 |
lastNew := dstBase. |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
4448 |
]. |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
4449 |
|
4745 | 4450 |
^ true. |
4354
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
4451 |
]. |
4707
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4452 |
answer == #copy ifTrue:[ |
4354
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
4453 |
self copyFiles:aColOfSourceFiles to:aDestinationDirectory. |
4745 | 4454 |
^ true. |
3892 | 4455 |
]. |
4707
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4456 |
answer == #move ifTrue:[ |
4354
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
4457 |
self moveFiles:aColOfSourceFiles to:aDestinationDirectory. |
4745 | 4458 |
^ true. |
3892 | 4459 |
]. |
4745 | 4460 |
^ false. |
3892 | 4461 |
! |
4462 |
||
6107 | 4463 |
copySelectionTo |
4464 |
"copy the selected file(s) to another directory" |
|
4465 |
||
7635 | 4466 |
self copySelectionToRepairingCorruptedFiles:false |
4467 |
||
4468 |
"Modified: / 07-02-2007 / 18:42:48 / cg" |
|
4469 |
! |
|
4470 |
||
4471 |
copySelectionToRepairingCorruptedFiles |
|
4472 |
"copy the selected file(s) to another directory" |
|
4473 |
||
4474 |
self copySelectionToRepairingCorruptedFiles:true |
|
4475 |
||
4476 |
"Created: / 07-02-2007 / 18:42:59 / cg" |
|
4477 |
! |
|
4478 |
||
4479 |
copySelectionToRepairingCorruptedFiles:repairingCorruptedFiles |
|
4480 |
"copy the selected file(s) to another directory" |
|
4481 |
||
6299 | 4482 |
|selectedFiles msg destination directory| |
4483 |
||
7560 | 4484 |
selectedFiles := self currentSelectedObjects copy. |
6299 | 4485 |
selectedFiles isEmptyOrNil ifTrue:[^ self]. |
4486 |
||
4487 |
msg := (selectedFiles size > 1) |
|
4488 |
ifTrue:[ 'Copy Selected Items To Directory:' ] |
|
4489 |
ifFalse:[ 'Copy "%1" To Directory:' ]. |
|
4490 |
||
4491 |
destination := Dialog |
|
7635 | 4492 |
requestDirectoryName:(resources stringWithCRs:msg with:selectedFiles first pathName) |
4493 |
default:(LastMoveDestination ? self currentDirectory) |
|
4494 |
ok:(resources string:'Copy') |
|
4495 |
abort:nil. |
|
4496 |
||
6299 | 4497 |
destination isEmptyOrNil ifTrue:[^ self]. |
4498 |
destination := destination asFilename. |
|
4499 |
||
4500 |
destination isDirectory ifFalse:[ |
|
4501 |
selectedFiles size == 1 ifTrue:[ |
|
4502 |
directory := destination directory. |
|
4503 |
directory isDirectory ifTrue:[ |
|
4504 |
LastMoveDestination := directory. |
|
7635 | 4505 |
self copyFile:selectedFiles first to:destination repairCorruptedFiles:repairingCorruptedFiles. |
6299 | 4506 |
^ self. |
4507 |
] |
|
4508 |
] |
|
4509 |
]. |
|
4510 |
||
4511 |
LastMoveDestination := destination. |
|
7635 | 4512 |
repairingCorruptedFiles ifTrue:[ |
4513 |
selectedFiles do:[:eachFile | |
|
4514 |
self copyFile:eachFile to:destination repairCorruptedFiles:repairingCorruptedFiles. |
|
4515 |
]. |
|
4516 |
^ self. |
|
4517 |
] ifFalse:[ |
|
4518 |
self copyFiles:selectedFiles to:destination |
|
4519 |
] |
|
4520 |
||
4521 |
"Created: / 07-02-2007 / 18:42:35 / cg" |
|
6107 | 4522 |
! |
4523 |
||
3892 | 4524 |
deleteFile:aFile |
6373 | 4525 |
"delete the selected files/directories" |
3892 | 4526 |
|
4527 |
^ self deleteFiles:(OrderedCollection with:aFile). |
|
4528 |
! |
|
4529 |
||
4530 |
deleteFiles:colOfFiles |
|
6373 | 4531 |
"delete some files/directories" |
4532 |
||
5081 | 4533 |
^ self deleteFiles:colOfFiles confirm:true. |
4534 |
! |
|
4535 |
||
4536 |
deleteFiles:colOfFiles confirm:confirm |
|
6373 | 4537 |
"delete some files/directories" |
4538 |
||
5673 | 4539 |
|delete result| |
3892 | 4540 |
|
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
4541 |
self withActivityIndicationDo:[ |
9575
548adf8e9d98
added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents:
9572
diff
changeset
|
4542 |
ProgressNotification handle:[:info | |
548adf8e9d98
added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents:
9572
diff
changeset
|
4543 |
self progressPercentageHolder value:info progressValue. |
548adf8e9d98
added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents:
9572
diff
changeset
|
4544 |
info proceed |
548adf8e9d98
added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents:
9572
diff
changeset
|
4545 |
] do:[ |
548adf8e9d98
added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents:
9572
diff
changeset
|
4546 |
delete := FileOperation deleteFiles:colOfFiles confirm:confirm. |
548adf8e9d98
added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents:
9572
diff
changeset
|
4547 |
result := delete result. |
548adf8e9d98
added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents:
9572
diff
changeset
|
4548 |
]. |
5673 | 4549 |
result notNil ifTrue:[ |
4550 |
result ifFalse:[ |
|
4551 |
self notify:delete errorString. |
|
5753 | 4552 |
] ifTrue:[ |
4553 |
self updateListAfterDelete:colOfFiles. |
|
4554 |
] |
|
4394 | 4555 |
]. |
5673 | 4556 |
]. |
4557 |
^ result. |
|
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
4558 |
|
9575
548adf8e9d98
added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents:
9572
diff
changeset
|
4559 |
"Modified: / 11-10-2010 / 13:08:24 / cg" |
3892 | 4560 |
! |
4561 |
||
6169 | 4562 |
eraseFiles:colOfFiles |
6373 | 4563 |
"erase (clear and delete) some files/directories" |
4564 |
||
6169 | 4565 |
^ self eraseFiles:colOfFiles confirm:true. |
4566 |
! |
|
4567 |
||
4568 |
eraseFiles:colOfFiles confirm:confirm |
|
6373 | 4569 |
"erase (clear and delete) some files/directories" |
4570 |
||
8462
a5d12742a900
changed #eraseFiles:confirm:
Claus Gittinger <cg@exept.de>
parents:
8454
diff
changeset
|
4571 |
|deleteOperation result fileSize| |
6169 | 4572 |
|
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
4573 |
self withActivityIndicationDo:[ |
8462
a5d12742a900
changed #eraseFiles:confirm:
Claus Gittinger <cg@exept.de>
parents:
8454
diff
changeset
|
4574 |
fileSize := colOfFiles first asFilename fileSize. |
8294 | 4575 |
deleteOperation := FileOperation eraseFiles:colOfFiles confirm:confirm. |
8462
a5d12742a900
changed #eraseFiles:confirm:
Claus Gittinger <cg@exept.de>
parents:
8454
diff
changeset
|
4576 |
(colOfFiles size == 1 and:[ fileSize < (10*1024*1024) ]) |
8294 | 4577 |
ifTrue:[ |
4578 |
result := deleteOperation result. |
|
4579 |
] ifFalse:[ |
|
4580 |
ProgressIndicator |
|
4581 |
displayProgressNotifications:'Erasing' |
|
4582 |
abortable:true |
|
4583 |
at:nil |
|
4584 |
during:[ |
|
4585 |
result := deleteOperation result. |
|
4586 |
]. |
|
4587 |
]. |
|
4588 |
||
6169 | 4589 |
result notNil ifTrue:[ |
4590 |
result ifFalse:[ |
|
8294 | 4591 |
self notify:deleteOperation errorString. |
6169 | 4592 |
] ifTrue:[ |
4593 |
self updateListAfterDelete:colOfFiles. |
|
4594 |
] |
|
4595 |
]. |
|
4596 |
]. |
|
4597 |
^ result. |
|
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
4598 |
|
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
4599 |
"Modified: / 25-07-2006 / 09:07:16 / cg" |
6169 | 4600 |
! |
4601 |
||
3892 | 4602 |
moveFile:aSourceFile to:aDestFile |
6373 | 4603 |
"move a file/directory" |
3892 | 4604 |
|
4605 |
|move| |
|
4606 |
||
5961 | 4607 |
move := FileOperation moveFile:aSourceFile to:aDestFile. |
3892 | 4608 |
move result ifTrue:[ |
4523 | 4609 |
self notify:('move ', aSourceFile asString, ' to ', aDestFile asString). |
3892 | 4610 |
] ifFalse:[ |
4523 | 4611 |
self notify:move errorString. |
3892 | 4612 |
]. |
4613 |
self updateCurrentDirectory. |
|
4614 |
^ move result |
|
4615 |
! |
|
4616 |
||
4617 |
moveFiles:aColOfSourceFiles to:aDirectory |
|
6373 | 4618 |
"move some files to aDirectory" |
4619 |
||
3892 | 4620 |
|move| |
4621 |
||
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
4622 |
self withActivityIndicationDo:[ |
5961 | 4623 |
move := FileOperation moveFiles:aColOfSourceFiles to:aDirectory. |
4629
e8739857466c
show busyCursor while moving/copying files.
Claus Gittinger <cg@exept.de>
parents:
4624
diff
changeset
|
4624 |
move result ifFalse:[ |
e8739857466c
show busyCursor while moving/copying files.
Claus Gittinger <cg@exept.de>
parents:
4624
diff
changeset
|
4625 |
self notify:move errorString. |
e8739857466c
show busyCursor while moving/copying files.
Claus Gittinger <cg@exept.de>
parents:
4624
diff
changeset
|
4626 |
]. |
e8739857466c
show busyCursor while moving/copying files.
Claus Gittinger <cg@exept.de>
parents:
4624
diff
changeset
|
4627 |
self updateCurrentDirectory. |
3892 | 4628 |
]. |
6373 | 4629 |
^ move collectionOfMovedFiles |
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
4630 |
|
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
4631 |
"Modified: / 25-07-2006 / 09:07:32 / cg" |
3892 | 4632 |
! |
4633 |
||
6107 | 4634 |
moveSelectionTo |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4635 |
"move the selected file(s) to another directory" |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4636 |
|
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4637 |
|destinationDirectory| |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4638 |
|
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4639 |
destinationDirectory := Dialog |
6352 | 4640 |
requestDirectoryName:(resources stringWithCRs:'Move Selected Items To:') |
5789 | 4641 |
default:(LastMoveDestination ? self currentDirectory) |
6952 | 4642 |
ok:(resources string:'Move') |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4643 |
abort:nil. |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4644 |
destinationDirectory isEmptyOrNil ifTrue:[^ self]. |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4645 |
|
5789 | 4646 |
LastMoveDestination := destinationDirectory. |
7560 | 4647 |
self moveFiles:(self currentSelectedObjects copy) to:destinationDirectory asFilename |
4648 |
||
4649 |
"Modified: / 04-12-2006 / 13:15:12 / cg" |
|
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4650 |
! |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4651 |
|
3892 | 4652 |
newDirectory |
4653 |
"ask for and create a new directory" |
|
4654 |
||
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4655 |
|selectedFiles singleSelectedFile defaultAnswer directory createOp newFile mime| |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4656 |
|
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4657 |
directory := self currentDirectory. |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4658 |
directory isNil ifTrue:[ |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4659 |
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
|
4660 |
^ self |
366465d1a8a5
warn on create new file or directory if nothing selected or more than one directory
penk
parents:
4976
diff
changeset
|
4661 |
]. |
4521 | 4662 |
|
4663 |
"/ 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
|
4664 |
selectedFiles := self currentSelectedFiles. |
4521 | 4665 |
selectedFiles size == 1 ifTrue:[ |
4666 |
singleSelectedFile := selectedFiles first. |
|
4667 |
||
4668 |
mime := MIMETypes mimeTypeForFilename:singleSelectedFile. |
|
4669 |
(mime notNil and:[mime isArchive]) ifTrue:[ |
|
4670 |
defaultAnswer := singleSelectedFile asFilename withoutSuffix baseName. |
|
4671 |
||
4672 |
mime := MIMETypes mimeTypeForFilename:defaultAnswer. |
|
4982
c38742d99bfd
care for nil mime in newDirectory
Claus Gittinger <cg@exept.de>
parents:
4979
diff
changeset
|
4673 |
(mime notNil and:[mime isArchive]) ifTrue:[ |
4521 | 4674 |
defaultAnswer := defaultAnswer asFilename withoutSuffix baseName |
4675 |
]. |
|
4676 |
]. |
|
4677 |
]. |
|
4678 |
||
5961 | 4679 |
|
4521 | 4680 |
defaultAnswer notNil ifTrue:[ |
5961 | 4681 |
createOp := FileOperation createDirectoryIn:directory initialAnswer:defaultAnswer. |
4521 | 4682 |
] ifFalse:[ |
5961 | 4683 |
createOp := FileOperation createDirectoryIn:directory. |
4521 | 4684 |
]. |
4685 |
createOp result ifFalse:[ ^ self]. |
|
4686 |
newFile := createOp createdFile. |
|
3892 | 4687 |
newFile notNil ifTrue:[ |
4414 | 4688 |
self updateCurrentDirectory. |
3892 | 4689 |
] |
4690 |
! |
|
4691 |
||
4692 |
newFile |
|
4693 |
"ask for and create a new file" |
|
4694 |
||
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4695 |
| curFile directory create file| |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4696 |
|
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4697 |
directory := self currentDirectory. |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4698 |
directory isNil ifTrue:[ |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4699 |
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
|
4700 |
^ self. |
366465d1a8a5
warn on create new file or directory if nothing selected or more than one directory
penk
parents:
4976
diff
changeset
|
4701 |
]. |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4702 |
|
3982 | 4703 |
curFile := self firstSelectedFile. |
3892 | 4704 |
curFile notNil ifTrue:[ |
4414 | 4705 |
file := curFile. |
3892 | 4706 |
] ifFalse:[ |
4414 | 4707 |
file := directory. |
3892 | 4708 |
]. |
5961 | 4709 |
create := FileOperation createFileIn:file. |
3892 | 4710 |
create result ifFalse:[ ^ self]. |
4711 |
self updateAndSelect:(OrderedCollection with:(create createdFile)). |
|
4712 |
! |
|
4713 |
||
4714 |
newHardLink |
|
4715 |
"ask for and create a hard link (unix only)" |
|
4716 |
||
6151 | 4717 |
self newLink:#hard. |
4718 |
! |
|
4719 |
||
4720 |
newLink:typeOfLink |
|
3892 | 4721 |
"ask for and create a symbolic if symbolic is true otherwise a hard link (unix only)" |
4722 |
||
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4723 |
| sel dir create createdFile| |
3892 | 4724 |
|
7560 | 4725 |
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
|
4726 |
(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
|
4727 |
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
|
4728 |
^ self |
366465d1a8a5
warn on create new file or directory if nothing selected or more than one directory
penk
parents:
4976
diff
changeset
|
4729 |
]. |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4730 |
dir := sel first. |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4731 |
|
6151 | 4732 |
create := FileOperation createLinkIn:dir soft:(typeOfLink == #soft). |
3892 | 4733 |
create result ifFalse:[ ^ self]. |
4734 |
createdFile := create createdFile. |
|
4735 |
createdFile notNil ifTrue:[ |
|
6151 | 4736 |
typeOfLink == #soft ifTrue:[ |
4785
5a3f7a0c3ff1
symbolic link creation code fixed
Claus Gittinger <cg@exept.de>
parents:
4782
diff
changeset
|
4737 |
self updateCurrentDirectory. |
5a3f7a0c3ff1
symbolic link creation code fixed
Claus Gittinger <cg@exept.de>
parents:
4782
diff
changeset
|
4738 |
] ifFalse:[ |
5a3f7a0c3ff1
symbolic link creation code fixed
Claus Gittinger <cg@exept.de>
parents:
4782
diff
changeset
|
4739 |
self updateAndSelect:(OrderedCollection with:createdFile). |
5a3f7a0c3ff1
symbolic link creation code fixed
Claus Gittinger <cg@exept.de>
parents:
4782
diff
changeset
|
4740 |
] |
3892 | 4741 |
]. |
7560 | 4742 |
|
4743 |
"Modified: / 04-12-2006 / 13:15:15 / cg" |
|
3892 | 4744 |
! |
4745 |
||
4746 |
newSoftLink |
|
4747 |
"ask for and create a soft link (unix only)" |
|
4748 |
||
6151 | 4749 |
self newLink:#soft. |
3892 | 4750 |
! |
4751 |
||
4752 |
pasteFiles |
|
6373 | 4753 |
"paste from clipBoard" |
4754 |
||
4755 |
|buffer destination files directories copiedFiles thisIsAFileMoveOperation| |
|
3892 | 4756 |
|
4757 |
files := self clipboard files. |
|
6482
00207f456339
isEmptyOrNil / notEmptyOrNil refactoring
Claus Gittinger <cg@exept.de>
parents:
6479
diff
changeset
|
4758 |
files isEmptyOrNil ifTrue:[ ^ self ]. |
6373 | 4759 |
|
4760 |
thisIsAFileMoveOperation := self clipboard method == #cut. |
|
4761 |
||
3892 | 4762 |
buffer := self clipboard copy. |
3982 | 4763 |
directories := self currentSelectedDirectories. |
5880 | 4764 |
directories size ~~ 1 ifTrue:[ |
4414 | 4765 |
|box dirStringCol| |
5880 | 4766 |
|
4414 | 4767 |
dirStringCol := directories collect:[:aDir| aDir asString]. |
4768 |
box := ListSelectionBox new. |
|
6373 | 4769 |
box title:'Paste into which directory ?'. |
4414 | 4770 |
box list:dirStringCol. |
4771 |
box okAction:[:sel | destination := sel asFilename]. |
|
5003
a14ce263ada5
boxes no longer show at pointer
Claus Gittinger <cg@exept.de>
parents:
4982
diff
changeset
|
4772 |
box show. |
a14ce263ada5
boxes no longer show at pointer
Claus Gittinger <cg@exept.de>
parents:
4982
diff
changeset
|
4773 |
box destroy. |
3892 | 4774 |
] ifFalse:[ |
5880 | 4775 |
destination := directories anElement. |
3892 | 4776 |
]. |
6373 | 4777 |
|
4778 |
thisIsAFileMoveOperation ifTrue:[ |
|
5081 | 4779 |
buffer files copy do:[:aFile| |
4780 |
aFile directory = destination ifTrue:[ |
|
4781 |
buffer files remove:aFile. |
|
4782 |
]. |
|
4783 |
]. |
|
4784 |
]. |
|
4785 |
copiedFiles := self copyFiles:(buffer files) to:destination. |
|
6374 | 4786 |
copiedFiles notEmptyOrNil ifTrue:[ |
4787 |
thisIsAFileMoveOperation ifTrue:[ |
|
4788 |
self deleteFiles:(copiedFiles keys) confirm:false. |
|
4789 |
]. |
|
4790 |
||
4791 |
"/ select those pasted files. |
|
4792 |
self updateCurrentDirectory:true. |
|
4793 |
self currentFileNameHolder value:copiedFiles values. |
|
4794 |
] |
|
3892 | 4795 |
! |
4796 |
||
4797 |
renameFile:aFile |
|
4798 |
"rename the selected file(s)" |
|
4799 |
||
9793
df3c1b8165fa
variable renamed in: #renameFile:
Stefan Vogel <sv@exept.de>
parents:
9784
diff
changeset
|
4800 |
^ self renameFiles:(Array with:aFile). |
3892 | 4801 |
! |
4802 |
||
4230 | 4803 |
renameFile:filename to:newFileString update:aBoolean |
3892 | 4804 |
"rename filename to newFileString" |
4805 |
||
4806 |
|rename| |
|
4807 |
||
5961 | 4808 |
rename := FileOperation renameFile:filename to:newFileString. |
3892 | 4809 |
rename result ifTrue:[ |
4230 | 4810 |
aBoolean ifTrue:[ |
4811 |
self updateAndSelect:(rename renamedFiles). |
|
4812 |
]. |
|
3892 | 4813 |
] ifFalse:[ |
4523 | 4814 |
self notify:rename errorString. |
3892 | 4815 |
]. |
4816 |
^ rename result |
|
4817 |
! |
|
4818 |
||
4819 |
renameFiles:aColOfFiles |
|
6373 | 4820 |
"rename some file(s)" |
3892 | 4821 |
|
4822 |
|rename| |
|
4823 |
||
5961 | 4824 |
rename := FileOperation renameFiles:aColOfFiles. |
3892 | 4825 |
rename result ifFalse:[ |
9793
df3c1b8165fa
variable renamed in: #renameFile:
Stefan Vogel <sv@exept.de>
parents:
9784
diff
changeset
|
4826 |
self notify:rename errorString. |
df3c1b8165fa
variable renamed in: #renameFile:
Stefan Vogel <sv@exept.de>
parents:
9784
diff
changeset
|
4827 |
^ nil. |
df3c1b8165fa
variable renamed in: #renameFile:
Stefan Vogel <sv@exept.de>
parents:
9784
diff
changeset
|
4828 |
]. |
df3c1b8165fa
variable renamed in: #renameFile:
Stefan Vogel <sv@exept.de>
parents:
9784
diff
changeset
|
4829 |
^ rename |
3892 | 4830 |
! |
4831 |
||
4832 |
renameSelection |
|
4833 |
"rename the selected file(s)" |
|
4834 |
||
9793
df3c1b8165fa
variable renamed in: #renameFile:
Stefan Vogel <sv@exept.de>
parents:
9784
diff
changeset
|
4835 |
|renamed| |
df3c1b8165fa
variable renamed in: #renameFile:
Stefan Vogel <sv@exept.de>
parents:
9784
diff
changeset
|
4836 |
|
df3c1b8165fa
variable renamed in: #renameFile:
Stefan Vogel <sv@exept.de>
parents:
9784
diff
changeset
|
4837 |
renamed := self renameFiles:(self currentSelectedObjects copy). |
df3c1b8165fa
variable renamed in: #renameFile:
Stefan Vogel <sv@exept.de>
parents:
9784
diff
changeset
|
4838 |
renamed notNil ifTrue:[ |
df3c1b8165fa
variable renamed in: #renameFile:
Stefan Vogel <sv@exept.de>
parents:
9784
diff
changeset
|
4839 |
self updateAndSelect:renamed renamedFiles. |
df3c1b8165fa
variable renamed in: #renameFile:
Stefan Vogel <sv@exept.de>
parents:
9784
diff
changeset
|
4840 |
]. |
7560 | 4841 |
|
4842 |
"Modified: / 04-12-2006 / 13:15:24 / cg" |
|
3892 | 4843 |
! ! |
4844 |
||
4080 | 4845 |
!AbstractFileBrowser methodsFor:'menu accessing'! |
3892 | 4846 |
|
9111
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
4847 |
bookmarksMenu |
3952 | 4848 |
<resource: #programMenu> |
4849 |
||
4672
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
4850 |
|menu bookmarks| |
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
4851 |
|
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
4852 |
menu := self class baseBookmarksMenuSpec decodeAsLiteralArray. |
7763 | 4853 |
|
4854 |
"/ add the bookmark items ... |
|
4855 |
bookmarks := self class directoryBookmarks. |
|
4856 |
bookmarks notEmptyOrNil ifTrue:[ |
|
4857 |
menu addItem:(MenuItem labeled:'-'). |
|
4858 |
bookmarks do:[:dirName | |
|
4859 |
menu addItem:((MenuItem label:dirName asString value:[ |
|
4860 |
(self currentSelectedDirectories includes:dirName) ifFalse:[ |
|
4861 |
self setCurrentFileName:dirName. |
|
4862 |
]. |
|
4863 |
])). |
|
4864 |
]. |
|
4865 |
]. |
|
4080 | 4866 |
menu findGuiResourcesIn:self. |
7763 | 4867 |
^ menu |
4868 |
||
4869 |
"Modified: / 27-03-2007 / 10:55:08 / cg" |
|
4870 |
! |
|
4871 |
||
4872 |
canBackward |
|
4873 |
^ self directoryHistory canBackward. |
|
4874 |
||
4875 |
"Modified: / 27-03-2007 / 10:54:55 / cg" |
|
4876 |
! |
|
4877 |
||
4878 |
canForward |
|
4879 |
^ self directoryHistory canForward. |
|
4880 |
||
4881 |
"Modified: / 27-03-2007 / 10:54:57 / cg" |
|
4882 |
! |
|
4883 |
||
9111
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
4884 |
gotoBookmarksMenu |
7763 | 4885 |
<resource: #programMenu> |
4886 |
||
4887 |
|menu bookmarks| |
|
4888 |
||
4889 |
menu := self class baseBookmarksMenuSpec2 decodeAsLiteralArray. |
|
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
4890 |
|
4672
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
4891 |
"/ add the bookmark items ... |
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
4892 |
bookmarks := self class directoryBookmarks. |
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
4893 |
bookmarks notEmptyOrNil ifTrue:[ |
4414 | 4894 |
menu addItem:(MenuItem labeled:'-'). |
4895 |
bookmarks do:[:dirName | |
|
4896 |
menu addItem:((MenuItem label:dirName asString value:[ |
|
6725 | 4897 |
(self currentSelectedDirectories includes:dirName) ifFalse:[ |
5959 | 4898 |
self setCurrentFileName:dirName. |
4414 | 4899 |
]. |
4900 |
])). |
|
4901 |
]. |
|
3952 | 4902 |
]. |
7763 | 4903 |
menu findGuiResourcesIn:self. |
3952 | 4904 |
^ menu |
4905 |
||
7763 | 4906 |
"Modified: / 27-03-2007 / 10:54:50 / cg" |
6099 | 4907 |
! |
4908 |
||
3892 | 4909 |
menuDirHistory:backOrForward |
7763 | 4910 |
"initialize the history menu" |
4911 |
||
3892 | 4912 |
<resource: #programMenu > |
4913 |
||
7763 | 4914 |
|hist menu pathList currentSel currentPath| |
4915 |
||
4916 |
hist := self directoryHistory. |
|
4917 |
hist isEmpty ifTrue:[^ nil]. |
|
4918 |
||
3892 | 4919 |
backOrForward == #back ifTrue:[ |
6725 | 4920 |
currentSel := self currentSelectedDirectories. |
4347 | 4921 |
currentSel size == 1 ifTrue:[ |
4922 |
currentPath := currentSel first asString. |
|
4923 |
] ifFalse:[ |
|
4924 |
currentPath := nil. |
|
4925 |
]. |
|
7763 | 4926 |
pathList := hist getBackCollection. |
3892 | 4927 |
] ifFalse:[ |
7763 | 4928 |
pathList := hist getForwardCollection. |
3892 | 4929 |
]. |
4022 | 4930 |
pathList isEmpty ifTrue:[ ^ nil]. |
7763 | 4931 |
|
6370 | 4932 |
pathList size > 30 ifTrue:[ |
4933 |
pathList := pathList copyTo:30 |
|
4934 |
]. |
|
7763 | 4935 |
|
4936 |
menu := Menu new. |
|
4937 |
||
3964 | 4938 |
pathList do:[:aPath| |
4347 | 4939 |
| menuItem | |
4940 |
menuItem := MenuItem new. |
|
4941 |
menuItem label:aPath. |
|
4942 |
menuItem value:[ |
|
5959 | 4943 |
self setCurrentFileName:(aPath asFilename). |
4347 | 4944 |
]. |
4945 |
menu addItem:menuItem. |
|
3952 | 4946 |
]. |
7763 | 4947 |
menu findGuiResourcesIn:self. |
3892 | 4948 |
^ menu |
7763 | 4949 |
|
4950 |
"Modified: / 27-03-2007 / 10:54:29 / cg" |
|
3892 | 4951 |
! |
4952 |
||
4953 |
menuDirHistoryBack |
|
4954 |
"initialize the directory menu |
|
4955 |
" |
|
4956 |
<resource: #programMenu > |
|
4957 |
||
4958 |
^ self menuDirHistory:#back. |
|
4959 |
! |
|
4960 |
||
4961 |
menuDirHistoryForward |
|
4962 |
"initialize the directory menu |
|
4963 |
" |
|
4964 |
<resource: #programMenu > |
|
4965 |
||
4966 |
^ self menuDirHistory:#forward. |
|
3906 | 4967 |
! |
4968 |
||
4969 |
menuFileHistory |
|
4970 |
"initialize the file history menu |
|
4971 |
" |
|
4972 |
<resource: #programMenu > |
|
4973 |
||
7763 | 4974 |
|menu hist text removeItem| |
3906 | 4975 |
|
4976 |
hist := self fileHistory. |
|
4977 |
hist isEmpty ifTrue:[^ nil]. |
|
4391
05ad03de6f3c
no icon in clearHistory menuItem
Claus Gittinger <cg@exept.de>
parents:
4368
diff
changeset
|
4978 |
|
7763 | 4979 |
menu := Menu new. |
4980 |
||
4981 |
hist copy do:[:aFileItem| |
|
4391
05ad03de6f3c
no icon in clearHistory menuItem
Claus Gittinger <cg@exept.de>
parents:
4368
diff
changeset
|
4982 |
aFileItem fileName exists ifTrue:[ |
05ad03de6f3c
no icon in clearHistory menuItem
Claus Gittinger <cg@exept.de>
parents:
4368
diff
changeset
|
4983 |
menu addItem:(MenuItem label: aFileItem fileName asString value:[ |
5959 | 4984 |
self setCurrentFileName:(aFileItem fileName). |
4391
05ad03de6f3c
no icon in clearHistory menuItem
Claus Gittinger <cg@exept.de>
parents:
4368
diff
changeset
|
4985 |
self openApplByFileItem:aFileItem |
05ad03de6f3c
no icon in clearHistory menuItem
Claus Gittinger <cg@exept.de>
parents:
4368
diff
changeset
|
4986 |
]). |
05ad03de6f3c
no icon in clearHistory menuItem
Claus Gittinger <cg@exept.de>
parents:
4368
diff
changeset
|
4987 |
] ifFalse:[ |
7763 | 4988 |
"/ remove all not existing history entries |
4989 |
hist remove:aFileItem. |
|
4391
05ad03de6f3c
no icon in clearHistory menuItem
Claus Gittinger <cg@exept.de>
parents:
4368
diff
changeset
|
4990 |
] |
3906 | 4991 |
]. |
7763 | 4992 |
menu addSeparator. |
4993 |
||
4080 | 4994 |
removeItem := MenuItem new. |
4995 |
removeItem translateLabel:true. |
|
4391
05ad03de6f3c
no icon in clearHistory menuItem
Claus Gittinger <cg@exept.de>
parents:
4368
diff
changeset
|
4996 |
text := resources string:'Clear History'. |
05ad03de6f3c
no icon in clearHistory menuItem
Claus Gittinger <cg@exept.de>
parents:
4368
diff
changeset
|
4997 |
"/ text := LabelAndIcon icon:(self class clearHistoryIcon) string:text. |
4080 | 4998 |
removeItem label:text. |
4999 |
removeItem value:[ |
|
4391
05ad03de6f3c
no icon in clearHistory menuItem
Claus Gittinger <cg@exept.de>
parents:
4368
diff
changeset
|
5000 |
self fileHistory removeAll. |
05ad03de6f3c
no icon in clearHistory menuItem
Claus Gittinger <cg@exept.de>
parents:
4368
diff
changeset
|
5001 |
self enableFileHistory value:false. |
3906 | 5002 |
]. |
5003 |
menu addItem:removeItem. |
|
7763 | 5004 |
menu findGuiResourcesIn:self. |
3906 | 5005 |
^ menu |
7763 | 5006 |
|
5007 |
"Modified: / 27-03-2007 / 10:52:40 / cg" |
|
3952 | 5008 |
! |
5009 |
||
4080 | 5010 |
sortMenu |
5011 |
<resource: #programMenu > |
|
5012 |
||
5013 |
|menu| |
|
5014 |
||
7763 | 5015 |
menu := Menu decodeFromLiteralArray:self class sortMenu. |
4080 | 5016 |
menu findGuiResourcesIn:self. |
5017 |
^ menu |
|
7763 | 5018 |
|
5019 |
"Modified: / 27-03-2007 / 10:47:42 / cg" |
|
4080 | 5020 |
! |
5021 |
||
5022 |
viewDetailsMenuSpec |
|
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
5023 |
|specContentsBrowser itemsContentsBrowser specHere itemsHere spec| |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
5024 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
5025 |
specHere := self class viewDetailsMenuSpec. |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
5026 |
itemsHere := specHere at:2. |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
5027 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
5028 |
specContentsBrowser := self directoryContentsBrowser class viewBrowserMenuSpec. |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
5029 |
itemsContentsBrowser := (specContentsBrowser at:2). |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
5030 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
5031 |
spec := specHere copy. |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
5032 |
spec at:2 put:(itemsContentsBrowser , itemsHere). |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
5033 |
^ spec |
4080 | 5034 |
! |
5035 |
||
5036 |
viewInContentsBrowserMenu |
|
5009 | 5037 |
self |
5038 |
applicationNamed:#DirectoryContentsBrowser |
|
5039 |
ifPresentDo:[:appl | ^ appl viewBrowserMenu]. |
|
5040 |
||
5041 |
^ nil. |
|
4080 | 5042 |
! |
5043 |
||
3952 | 5044 |
visitedDirectoriesMenu |
5045 |
<resource: #programMenu > |
|
5046 |
||
5047 |
|menu histCopy text removeItem| |
|
5048 |
||
7763 | 5049 |
histCopy := self directoryHistory. |
5050 |
histCopy isEmpty ifTrue:[^ nil]. |
|
5051 |
||
3952 | 5052 |
menu := Menu new. |
7763 | 5053 |
|
5054 |
histCopy do:[:aFile| |
|
5055 |
menu addItem:(MenuItem label:aFile asString value:[ |
|
5056 |
self setCurrentFileName:(aFile path asFilename). |
|
5057 |
]). |
|
5058 |
]. |
|
5059 |
menu addSeparator. |
|
5060 |
||
4672
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
5061 |
"/ 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
|
5062 |
text := (resources string:'Clear History'). |
3952 | 5063 |
removeItem := MenuItem new. |
4040 | 5064 |
removeItem translateLabel:true. |
3952 | 5065 |
removeItem label:text. |
5066 |
removeItem value:[ |
|
6369 | 5067 |
self directoryHistory removeAll. |
4347 | 5068 |
self enableForward value:self canForward. |
5069 |
self enableBack value:self canBackward. |
|
3952 | 5070 |
]. |
7763 | 5071 |
|
3952 | 5072 |
menu addItem:removeItem. |
7763 | 5073 |
menu findGuiResourcesIn:self. |
3952 | 5074 |
^ menu |
7763 | 5075 |
|
5076 |
"Modified: / 27-03-2007 / 10:50:39 / cg" |
|
3892 | 5077 |
! ! |
5078 |
||
5880 | 5079 |
!AbstractFileBrowser methodsFor:'menu actions'! |
5080 |
||
5081 |
doCompareTwoFiles |
|
5082 |
self openDiffView. |
|
5083 |
! |
|
5084 |
||
5085 |
doGoDirectoryUp |
|
5960 | 5086 |
| upDir directory rootInTreeView| |
5880 | 5087 |
|
5088 |
self enableDirectoryUp value ifFalse:[ ^ self]. |
|
5089 |
self currentFilesAreInSameDirectory ifTrue:[ |
|
5960 | 5090 |
directory := self currentDirectory. |
5091 |
directory isNil ifTrue:[ ^ self]. |
|
5880 | 5092 |
] ifFalse:[ |
5093 |
rootInTreeView := self |
|
5094 |
applicationNamed:#DirectoryTreeBrowser |
|
5095 |
ifPresentDo:[:appl | appl rootHolder]. |
|
5960 | 5096 |
directory := rootInTreeView value asFilename. |
5097 |
]. |
|
5098 |
upDir := directory directory. |
|
5959 | 5099 |
self setCurrentFileName:upDir. |
5880 | 5100 |
! |
5101 |
||
5102 |
doGotoDefaultDirectory |
|
5103 |
self gotoFile:(Filename defaultDirectory). |
|
5104 |
! |
|
5105 |
||
8091 | 5106 |
doGotoDesktopDirectory |
5107 |
self gotoFile:(Filename desktopDirectory). |
|
5108 |
! |
|
5109 |
||
5880 | 5110 |
doGotoHomeDirectory |
8091 | 5111 |
self gotoFile:(Filename homeDirectory). |
5880 | 5112 |
! |
5113 |
||
6434 | 5114 |
doGotoSmalltalkDirectory |
5115 |
self gotoFile:(self smalltalkDirectory). |
|
5116 |
! |
|
5117 |
||
9677 | 5118 |
doGotoTempDirectory |
5119 |
self gotoFile:(self tempDirectory). |
|
5120 |
||
5121 |
"Created: / 29-12-2010 / 11:03:17 / cg" |
|
5122 |
! |
|
5123 |
||
9596 | 5124 |
doMakeCurrentDirectory |
5125 |
OperatingSystem setCurrentDirectory:(self currentDirectory pathName). |
|
5126 |
self currentFileNameHolderChangedForCommon. |
|
5127 |
||
5128 |
"Created: / 26-10-2010 / 17:21:19 / cg" |
|
5129 |
! |
|
5130 |
||
5880 | 5131 |
fileGetInfo:longInfo |
5132 |
"get info on selected file - show it in a box" |
|
5133 |
||
5134 |
|string box updater| |
|
5135 |
||
5136 |
string := self getFileInfoStringForFirstSelectedFile:longInfo. |
|
5137 |
string notNil ifTrue:[ |
|
5138 |
box := InfoBox title:string. |
|
5139 |
updater := [ |
|
5140 |
[true] whileTrue:[ |
|
5141 |
Delay waitForSeconds:2. |
|
5142 |
string := self getFileInfoStringForFirstSelectedFile:longInfo. |
|
5143 |
string isNil ifTrue:[ ^ self]. |
|
5144 |
box title:string |
|
5145 |
] |
|
5146 |
] fork. |
|
5147 |
box show. |
|
5148 |
updater terminate. |
|
5149 |
box destroy |
|
5150 |
] |
|
6434 | 5151 |
! |
5152 |
||
5153 |
smalltalkDirectory |
|
8590 | 5154 |
|stxPath| |
6434 | 5155 |
|
5156 |
stxPath := OperatingSystem pathOfSTXExecutable. |
|
8590 | 5157 |
stxPath isNil ifTrue:[ |
5158 |
^ Filename currentDirectory |
|
5159 |
]. |
|
5160 |
^ stxPath asFilename directory. |
|
9677 | 5161 |
! |
5162 |
||
5163 |
tempDirectory |
|
5164 |
^ Filename tempDirectory. |
|
5165 |
||
5166 |
"Created: / 29-12-2010 / 11:03:00 / cg" |
|
5880 | 5167 |
! ! |
5168 |
||
4849 | 5169 |
!AbstractFileBrowser methodsFor:'menu actions-cvs'! |
3892 | 5170 |
|
5171 |
cvsAddAndCommit |
|
4849 | 5172 |
self cvsAddAndCommitAsBinary:false |
5173 |
! |
|
5174 |
||
5175 |
cvsAddAndCommitAsBinary:asBinary |
|
8588 | 5176 |
|sel log logArg binArg cmd dir executionBlock nameString| |
3892 | 5177 |
|
5178 |
log := Dialog |
|
4849 | 5179 |
requestText:(resources string:'Enter initial log message') |
4414 | 5180 |
lines:10 |
5181 |
columns:70 |
|
5182 |
initialAnswer:nil. |
|
8322
cf10f08b6164
care for cancel in #cvsAddAndCommitAsBinary:
Claus Gittinger <cg@exept.de>
parents:
8294
diff
changeset
|
5183 |
log isNil ifTrue:[^ self]. |
3892 | 5184 |
|
6205
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
5185 |
OperatingSystem isMSWINDOWSlike ifTrue:[ |
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
5186 |
logArg := '-m "' , log , '"'. |
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
5187 |
] ifFalse:[ |
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
5188 |
logArg := '-m ''' , log , ''''. |
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
5189 |
]. |
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
5190 |
|
8588 | 5191 |
binArg := ''. |
5192 |
asBinary ifTrue:[ |
|
5193 |
binArg := '-kb '. |
|
5194 |
]. |
|
3982 | 5195 |
sel := self currentSelectedFiles. |
3892 | 5196 |
executionBlock := [ : stream | |
4414 | 5197 |
log notNil ifTrue:[ |
5198 |
sel size > 0 ifTrue:[ |
|
5199 |
sel do:[:fn | |
|
8567
bcbadc9d40c3
allow checkin of files with a space
Claus Gittinger <cg@exept.de>
parents:
8563
diff
changeset
|
5200 |
|nameArg| |
bcbadc9d40c3
allow checkin of files with a space
Claus Gittinger <cg@exept.de>
parents:
8563
diff
changeset
|
5201 |
|
bcbadc9d40c3
allow checkin of files with a space
Claus Gittinger <cg@exept.de>
parents:
8563
diff
changeset
|
5202 |
nameArg := '"',fn baseName,'"'. |
bcbadc9d40c3
allow checkin of files with a space
Claus Gittinger <cg@exept.de>
parents:
8563
diff
changeset
|
5203 |
|
4414 | 5204 |
dir := self getDirWithoutFileName:fn. |
8588 | 5205 |
cmd := 'cvs add ',logArg,' ',binArg,nameArg. |
6204 | 5206 |
(self getExecutionBlockForCommand:cmd inDirectory:dir) value:stream. |
4849 | 5207 |
|
8567
bcbadc9d40c3
allow checkin of files with a space
Claus Gittinger <cg@exept.de>
parents:
8563
diff
changeset
|
5208 |
cmd := ('cvs commit -l ',logArg,' ',nameArg). |
6204 | 5209 |
(self getExecutionBlockForCommand:cmd inDirectory:dir) value:stream. |
8588 | 5210 |
"/ mhmh - it seems that only old CVS implementations (at least turqoise) |
5211 |
"/ support and need the 'admin -kb' command. |
|
5212 |
"/ 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
|
5213 |
asBinary ifTrue:[ |
8567
bcbadc9d40c3
allow checkin of files with a space
Claus Gittinger <cg@exept.de>
parents:
8563
diff
changeset
|
5214 |
cmd := ('cvs admin -kb ' , nameArg). |
6205
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
5215 |
(self getExecutionBlockForCommand:cmd inDirectory:dir) value:stream. |
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
5216 |
|
8567
bcbadc9d40c3
allow checkin of files with a space
Claus Gittinger <cg@exept.de>
parents:
8563
diff
changeset
|
5217 |
cmd := ('cvs upd ' , nameArg). |
6205
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
5218 |
(self getExecutionBlockForCommand:cmd inDirectory:dir) value:stream. |
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
5219 |
]. |
4414 | 5220 |
] |
5221 |
] |
|
5222 |
] |
|
3892 | 5223 |
]. |
4107 | 5224 |
nameString := 'Command> cvs add and commit'. |
3892 | 5225 |
self makeExecutionResultProcessFor:executionBlock withName:nameString. |
5226 |
! |
|
5227 |
||
4849 | 5228 |
cvsAddBinaryAndCommit |
5229 |
self cvsAddAndCommitAsBinary:true |
|
5230 |
! |
|
5231 |
||
3892 | 5232 |
cvsCommit |
6205
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
5233 |
|nSel log logArg msg cmd selectedFiles sel executionBlock nameString| |
3892 | 5234 |
|
3982 | 5235 |
selectedFiles:= self currentSelectedFiles. |
3892 | 5236 |
nSel := selectedFiles size. |
5237 |
||
5238 |
nSel == 1 ifTrue:[ |
|
8440 | 5239 |
msg := resources string:'Enter log message for checkIn of "%1"' with:(selectedFiles first baseName) |
3892 | 5240 |
] ifFalse:[ |
4414 | 5241 |
nSel > 1 ifTrue:[ |
6627 | 5242 |
msg := resources string:'Enter log message for %1 files to checkIn' with:nSel printString |
4414 | 5243 |
] ifFalse:[ |
6627 | 5244 |
msg := resources string:'Enter log message for checkIn' |
4414 | 5245 |
] |
3892 | 5246 |
]. |
5247 |
||
5248 |
log := Dialog |
|
4414 | 5249 |
requestText:msg |
5250 |
lines:10 |
|
5251 |
columns:70 |
|
5252 |
initialAnswer:nil. |
|
3892 | 5253 |
|
4663 | 5254 |
log isNil ifTrue:[^ self]. |
6205
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
5255 |
|
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
5256 |
OperatingSystem isMSWINDOWSlike ifTrue:[ |
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
5257 |
logArg := '-m "' , log , '"'. |
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
5258 |
] ifFalse:[ |
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
5259 |
logArg := '-m ''' , log , ''''. |
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
5260 |
]. |
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
5261 |
|
7560 | 5262 |
sel := self currentSelectedObjects. |
4663 | 5263 |
sel isEmpty ifTrue:[ ^ self ]. |
7560 | 5264 |
|
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
5265 |
executionBlock := [:stream | |
4663 | 5266 |
log notNil ifTrue:[ |
5267 |
sel size > 0 ifTrue:[ |
|
5268 |
sel do:[:fn | |
|
8568
fe221c53eead
allow checkin of files with a space
Claus Gittinger <cg@exept.de>
parents:
8567
diff
changeset
|
5269 |
| dir nameArg | |
fe221c53eead
allow checkin of files with a space
Claus Gittinger <cg@exept.de>
parents:
8567
diff
changeset
|
5270 |
|
fe221c53eead
allow checkin of files with a space
Claus Gittinger <cg@exept.de>
parents:
8567
diff
changeset
|
5271 |
nameArg := '"',fn baseName,'"'. |
4663 | 5272 |
dir := fn directory. |
8568
fe221c53eead
allow checkin of files with a space
Claus Gittinger <cg@exept.de>
parents:
8567
diff
changeset
|
5273 |
cmd := 'cvs commit ',logArg,' ' , nameArg. |
6204 | 5274 |
(self getExecutionBlockForCommand:cmd inDirectory:dir) value:stream. |
4663 | 5275 |
] |
5276 |
] |
|
5277 |
] |
|
4107 | 5278 |
]. |
5279 |
nameString := 'Command> cvs commit'. |
|
5280 |
self makeExecutionResultProcessFor:executionBlock withName:nameString. |
|
7560 | 5281 |
|
5282 |
"Modified: / 04-12-2006 / 13:16:39 / cg" |
|
3892 | 5283 |
! |
5284 |
||
9407
cf114ba82b6d
added: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
9405
diff
changeset
|
5285 |
cvsCompareWithNewest |
cf114ba82b6d
added: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
9405
diff
changeset
|
5286 |
|selectedFiles| |
cf114ba82b6d
added: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
9405
diff
changeset
|
5287 |
|
10915
dddb17fac591
changed: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
10887
diff
changeset
|
5288 |
self halt:'unimplemented'. |
9407
cf114ba82b6d
added: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
9405
diff
changeset
|
5289 |
selectedFiles:= self currentSelectedFiles. |
cf114ba82b6d
added: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
9405
diff
changeset
|
5290 |
selectedFiles do:[:each | |
cf114ba82b6d
added: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
9405
diff
changeset
|
5291 |
self halt. |
cf114ba82b6d
added: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
9405
diff
changeset
|
5292 |
]. |
10915
dddb17fac591
changed: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
10887
diff
changeset
|
5293 |
|
dddb17fac591
changed: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
10887
diff
changeset
|
5294 |
"Modified: / 29-11-2011 / 11:43:18 / cg" |
9407
cf114ba82b6d
added: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
9405
diff
changeset
|
5295 |
! |
cf114ba82b6d
added: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
9405
diff
changeset
|
5296 |
|
3892 | 5297 |
cvsRemoveAndRemoveFromCVS:filesToRemove |
5298 |
"remove the selected file(s) and their CVS containers - no questions asked" |
|
5299 |
||
6205
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
5300 |
|toRemove updateRunning executionBlock nameString| |
3892 | 5301 |
|
5302 |
updateRunning := self backgroundProcesses value notEmpty. |
|
5303 |
self killAllRunningBackgroundProcesses. |
|
5304 |
toRemove := OrderedCollection new. |
|
5305 |
||
5306 |
executionBlock := [ : stream | |
|
6205
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
5307 |
|cmd logArg| |
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
5308 |
|
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
5309 |
OperatingSystem isMSWINDOWSlike ifTrue:[ |
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
5310 |
logArg := '-m "' , 'removed via FileBrowser' , '"'. |
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
5311 |
] ifFalse:[ |
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
5312 |
logArg := '-m ''' , 'removed via FileBrowser' , ''''. |
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
5313 |
]. |
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
5314 |
|
4414 | 5315 |
filesToRemove do:[:fileName | |
5316 |
OperatingSystem accessDeniedErrorSignal handle:[:ex| |
|
5317 |
"was not able to remove it" |
|
6205
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
5318 |
| lastError msg | |
4414 | 5319 |
lastError := OperatingSystem lastErrorString. |
5320 |
msg := (resources string:'cannot remove ''%1'' !!' with:fileName). |
|
5321 |
lastError isNil ifFalse:[ |
|
5322 |
msg := msg , '\\(' , lastError , ')' |
|
5323 |
]. |
|
5324 |
Dialog warn:msg withCRs |
|
5325 |
] do:[ |
|
6250
5b0673ccff1c
refactored intention revealing code:
Claus Gittinger <cg@exept.de>
parents:
6236
diff
changeset
|
5326 |
(fileName isSymbolicLink) ifFalse:[ |
4414 | 5327 |
fileName remove. |
8568
fe221c53eead
allow checkin of files with a space
Claus Gittinger <cg@exept.de>
parents:
8567
diff
changeset
|
5328 |
cmd := ('cvs remove -f "',fileName baseName,'"'). |
6204 | 5329 |
(self getExecutionBlockForCommand:cmd) value:stream. |
4414 | 5330 |
] |
5331 |
]. |
|
5332 |
]. |
|
6205
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
5333 |
cmd := 'cvs commit -l ',logArg. |
6204 | 5334 |
(self getExecutionBlockForCommand:cmd) value:stream. |
3892 | 5335 |
]. |
4107 | 5336 |
nameString := 'Command> cvs remove and commit ', filesToRemove first baseName. |
3892 | 5337 |
filesToRemove size > 1 ifTrue:[ |
4414 | 5338 |
nameString := nameString, ' ...'. |
3892 | 5339 |
]. |
5340 |
self makeExecutionResultProcessFor:executionBlock withName:nameString. |
|
5341 |
! |
|
5342 |
||
5343 |
cvsRemoveFileAndCVSContainer |
|
5344 |
|sel question aswer| |
|
5345 |
||
4294 | 5346 |
sel := self currentSelectedFiles copy. |
3892 | 5347 |
sel size > 0 ifTrue:[ |
4294 | 5348 |
sel size > 1 ifTrue:[ |
5349 |
question := resources string:'Remove %1 selected files and their CVS containers ?' with:(sel size) |
|
5350 |
] ifFalse:[ |
|
5351 |
question := resources string:'Remove ''%1'' and its CVS container ?' with:(sel first baseName allBold) |
|
5352 |
]. |
|
5353 |
||
5354 |
aswer := Dialog |
|
5355 |
confirm:question withCRs |
|
6627 | 5356 |
yesLabel:(resources string:'Remove') |
5357 |
noLabel:(resources string:'Cancel'). |
|
4294 | 5358 |
aswer ifTrue:[ |
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
5359 |
self withActivityIndicationDo:[ |
4294 | 5360 |
self cvsRemoveAndRemoveFromCVS:sel |
5361 |
] |
|
5362 |
] |
|
3892 | 5363 |
] |
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
5364 |
|
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
5365 |
"Modified: / 25-07-2006 / 09:07:09 / cg" |
3892 | 5366 |
! |
5367 |
||
9338 | 5368 |
cvsRevisionLog |
5369 |
| cmd sel executionBlock nameString| |
|
5370 |
||
5371 |
sel := self currentSelectedObjects. |
|
5372 |
sel isEmpty ifTrue:[ ^ self ]. |
|
5373 |
||
5374 |
executionBlock := [:stream | |
|
5375 |
sel do:[:fn | |
|
5376 |
| dir nameArg | |
|
5377 |
||
5378 |
nameArg := '"',fn baseName,'"'. |
|
5379 |
dir := fn directory. |
|
5380 |
cmd := 'cvs log ' , nameArg. |
|
5381 |
(self getExecutionBlockForCommand:cmd inDirectory:dir) value:stream. |
|
5382 |
] |
|
5383 |
]. |
|
5384 |
nameString := 'Command> cvs log'. |
|
5385 |
self makeExecutionResultProcessFor:executionBlock withName:nameString. |
|
5386 |
! |
|
5387 |
||
8562 | 5388 |
cvsTagSelection |
5389 |
|tag stream cmd| |
|
5390 |
||
5391 |
tag := Dialog request:(resources string:'Tag:'). |
|
5392 |
||
5393 |
CVSSourceCodeManager notNil ifTrue:[ |
|
5394 |
cmd := CVSSourceCodeManager cvsExecutable. |
|
5395 |
] ifFalse:[ |
|
5396 |
cmd := 'cvs'. |
|
5397 |
]. |
|
5398 |
||
5399 |
stream := WriteStream on:''. |
|
5400 |
stream |
|
5401 |
nextPutAll:cmd; |
|
5402 |
nextPutAll:' tag -F '; |
|
5403 |
nextPutAll:'"'; |
|
5404 |
nextPutAll:tag; |
|
8563 | 5405 |
nextPutAll:'" '; |
5406 |
nextPutAll:(self makeFileNameArgumentString). |
|
5407 |
||
8562 | 5408 |
self executeCommand:stream contents. |
5409 |
! |
|
5410 |
||
3892 | 5411 |
cvsUpdateAll |
5412 |
| cmd | |
|
5413 |
||
8042
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
5414 |
CVSSourceCodeManager notNil ifTrue:[ |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
5415 |
cmd := CVSSourceCodeManager cvsExecutable. |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
5416 |
] ifFalse:[ |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
5417 |
cmd := 'cvs'. |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
5418 |
]. |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
5419 |
|
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
5420 |
self executeCommand:(cmd, ' upd -l'). |
3892 | 5421 |
! |
5422 |
||
5423 |
cvsUpdateAllRecursive |
|
5424 |
| cmd | |
|
5425 |
||
8042
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
5426 |
CVSSourceCodeManager notNil ifTrue:[ |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
5427 |
cmd := CVSSourceCodeManager cvsExecutable. |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
5428 |
] ifFalse:[ |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
5429 |
cmd := 'cvs'. |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
5430 |
]. |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
5431 |
self executeCommand:(cmd, ' upd -d'). |
3892 | 5432 |
! |
5433 |
||
5434 |
cvsUpdateSelection |
|
8042
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
5435 |
|stream cmd| |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
5436 |
|
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
5437 |
CVSSourceCodeManager notNil ifTrue:[ |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
5438 |
cmd := CVSSourceCodeManager cvsExecutable. |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
5439 |
] ifFalse:[ |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
5440 |
cmd := 'cvs'. |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
5441 |
]. |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
5442 |
|
3892 | 5443 |
stream := WriteStream on:''. |
8563 | 5444 |
stream |
5445 |
nextPutAll:cmd; |
|
5446 |
nextPutAll:' upd '; |
|
5447 |
nextPutAll:(self makeFileNameArgumentString). |
|
5448 |
||
5449 |
self executeCommand:stream contents. |
|
5450 |
! |
|
5451 |
||
5452 |
makeFileNameArgumentString |
|
5453 |
|stream| |
|
5454 |
||
5455 |
stream := WriteStream on:''. |
|
8042
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
5456 |
self currentSelectedFiles do:[: file | |
8563 | 5457 |
stream nextPut:$". |
4414 | 5458 |
stream nextPutAll:file baseName. |
8563 | 5459 |
stream nextPutAll:'" '. |
5460 |
]. |
|
5461 |
^ stream contents. |
|
3892 | 5462 |
! ! |
5463 |
||
6169 | 5464 |
!AbstractFileBrowser methodsFor:'menu actions-file'! |
3892 | 5465 |
|
4453
00e639bf2723
cut and copy files in toolbarmenu goes not to contentsbrowser only
penk
parents:
4432
diff
changeset
|
5466 |
copyFiles |
6169 | 5467 |
self |
5468 |
withSelectedFilesOrDirectoriesDo:[:filesOrDirs | self copyFilesToClipBoard:filesOrDirs] |
|
4453
00e639bf2723
cut and copy files in toolbarmenu goes not to contentsbrowser only
penk
parents:
4432
diff
changeset
|
5469 |
! |
00e639bf2723
cut and copy files in toolbarmenu goes not to contentsbrowser only
penk
parents:
4432
diff
changeset
|
5470 |
|
00e639bf2723
cut and copy files in toolbarmenu goes not to contentsbrowser only
penk
parents:
4432
diff
changeset
|
5471 |
cutFiles |
6169 | 5472 |
self |
5473 |
withSelectedFilesOrDirectoriesDo:[:filesOrDirs | self cutFilesToClipBoard:filesOrDirs] |
|
4453
00e639bf2723
cut and copy files in toolbarmenu goes not to contentsbrowser only
penk
parents:
4432
diff
changeset
|
5474 |
! |
00e639bf2723
cut and copy files in toolbarmenu goes not to contentsbrowser only
penk
parents:
4432
diff
changeset
|
5475 |
|
00e639bf2723
cut and copy files in toolbarmenu goes not to contentsbrowser only
penk
parents:
4432
diff
changeset
|
5476 |
deleteFiles |
6169 | 5477 |
self |
5478 |
withSelectedFilesOrDirectoriesDo:[:filesOrDirs | self deleteFiles:filesOrDirs] |
|
5479 |
! |
|
5480 |
||
5481 |
eraseFiles |
|
5482 |
self |
|
5483 |
withSelectedFilesOrDirectoriesDo:[:filesOrDirs | self eraseFiles:filesOrDirs] |
|
4940
4964068c4718
allow settings dialog to be opened from browser
Claus Gittinger <cg@exept.de>
parents:
4930
diff
changeset
|
5484 |
! |
4964068c4718
allow settings dialog to be opened from browser
Claus Gittinger <cg@exept.de>
parents:
4930
diff
changeset
|
5485 |
|
4964068c4718
allow settings dialog to be opened from browser
Claus Gittinger <cg@exept.de>
parents:
4930
diff
changeset
|
5486 |
openSettingsDialog |
4964068c4718
allow settings dialog to be opened from browser
Claus Gittinger <cg@exept.de>
parents:
4930
diff
changeset
|
5487 |
|dialog| |
4964068c4718
allow settings dialog to be opened from browser
Claus Gittinger <cg@exept.de>
parents:
4930
diff
changeset
|
5488 |
|
4964068c4718
allow settings dialog to be opened from browser
Claus Gittinger <cg@exept.de>
parents:
4930
diff
changeset
|
5489 |
dialog := FileBrowserV2SettingsDialog new. |
5034 | 5490 |
dialog settingsDialog:self. |
4940
4964068c4718
allow settings dialog to be opened from browser
Claus Gittinger <cg@exept.de>
parents:
4930
diff
changeset
|
5491 |
dialog allButOpen. |
4964068c4718
allow settings dialog to be opened from browser
Claus Gittinger <cg@exept.de>
parents:
4930
diff
changeset
|
5492 |
dialog doReload. |
4964068c4718
allow settings dialog to be opened from browser
Claus Gittinger <cg@exept.de>
parents:
4930
diff
changeset
|
5493 |
dialog openWindow |
6169 | 5494 |
! |
5495 |
||
5496 |
withSelectedFilesOrDirectoriesDo:aBlock |
|
5497 |
|files dirs| |
|
5498 |
||
5499 |
files := self currentSelectedFiles. |
|
5500 |
files notEmpty ifTrue:[ |
|
5501 |
aBlock value:files. |
|
5502 |
] ifFalse:[ |
|
5503 |
dirs := self currentSelectedDirectories. |
|
5504 |
dirs notEmpty ifTrue:[ |
|
5505 |
aBlock value:dirs. |
|
5506 |
]. |
|
5507 |
]. |
|
3892 | 5508 |
! ! |
5509 |
||
4849 | 5510 |
!AbstractFileBrowser methodsFor:'menu actions-help'! |
5511 |
||
5512 |
openAboutThisApplication |
|
5513 |
"opens an about box for this application." |
|
5514 |
||
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
5515 |
Dialog aboutClass:self class. |
4849 | 5516 |
! |
5517 |
||
5518 |
openHTMLDocument:relativeDocPath |
|
5519 |
HTMLDocumentView openFullOnDocumentationFile:relativeDocPath |
|
5520 |
! ! |
|
5521 |
||
5522 |
!AbstractFileBrowser methodsFor:'menu actions-tools'! |
|
3892 | 5523 |
|
8510 | 5524 |
allFilesInSelectedDirectoriesForWhich:aBlock |
5525 |
|directories allFiles| |
|
5526 |
||
5527 |
directories := self currentSelectedDirectories. |
|
5528 |
directories isEmpty ifTrue:[^ self]. |
|
5529 |
||
5530 |
allFiles := OrderedCollection new. |
|
5531 |
directories do:[:dir| |
|
5532 |
[ |
|
5533 |
|fileNames| |
|
5534 |
||
5535 |
fileNames := dir directoryContents. |
|
5536 |
fileNames notNil ifTrue:[ |
|
5537 |
fileNames := fileNames |
|
5538 |
collect:[:fn | dir construct:fn] |
|
5539 |
thenSelect:[:fn | fn isDirectory not and:[aBlock value:fn]]. |
|
5540 |
allFiles addAll:fileNames. |
|
5541 |
] |
|
5542 |
] on:FileStream openErrorSignal do:[:ex| |
|
5543 |
self warn:(resources stringWithCRs:'Cannot access: %1\(%2)' |
|
5544 |
with:ex pathName |
|
5545 |
with:ex description). |
|
5546 |
ex proceedWith:nil. |
|
5547 |
]. |
|
5548 |
]. |
|
5549 |
||
5550 |
^ allFiles |
|
5551 |
! |
|
5552 |
||
4721
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5553 |
conversionChainFrom:inSuffix to:outSuffix |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5554 |
|conv| |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5555 |
|
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5556 |
inSuffix = outSuffix ifTrue:[ |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5557 |
^ nil |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5558 |
]. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5559 |
|
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5560 |
"/ 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
|
5561 |
"/ 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
|
5562 |
|
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5563 |
conv := OrderedCollection new. |
4722 | 5564 |
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
|
5565 |
|
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5566 |
outSuffix = 'png' ifTrue:[ |
4722 | 5567 |
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
|
5568 |
^ conv. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5569 |
]. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5570 |
outSuffix = 'gif' ifTrue:[ |
4722 | 5571 |
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
|
5572 |
^ conv. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5573 |
]. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5574 |
outSuffix = 'xpm' ifTrue:[ |
4722 | 5575 |
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
|
5576 |
^ conv. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5577 |
]. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5578 |
outSuffix = 'jpg' ifTrue:[ |
4722 | 5579 |
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
|
5580 |
^ conv. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5581 |
]. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5582 |
self error:'unimplemented conversion'. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5583 |
! |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5584 |
|
9493
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5585 |
convertImageFrom:fileName to:outFile onError:exceptionBlock |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5586 |
|writer image outSuffix| |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5587 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5588 |
outSuffix := outFile suffix. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5589 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5590 |
((writer := MIMETypes imageReaderForSuffix:outSuffix) notNil |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5591 |
and:[ (image := Image fromFile:fileName) notNil |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5592 |
and:[ writer canRepresent:image ]]) ifTrue:[ |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5593 |
"/ can do it with Smalltalk tools |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5594 |
writer save:image onFile:outFile. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5595 |
^ self |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5596 |
] ifFalse:[ |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5597 |
"/ use external tools (pbm-package, if available) |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5598 |
self |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5599 |
convertImageUsingExternalFileToolsFrom:fileName |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5600 |
toSuffix:outSuffix |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5601 |
onError:exceptionBlock. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5602 |
]. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5603 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5604 |
"Created: / 20-05-2010 / 11:12:36 / cg" |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5605 |
! |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5606 |
|
4367 | 5607 |
convertImageToGIF |
4721
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5608 |
self convertImageToSuffix:'gif' |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5609 |
! |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5610 |
|
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5611 |
convertImageToJPG |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5612 |
self convertImageToSuffix:'jpg' |
4531 | 5613 |
! |
5614 |
||
5615 |
convertImageToPNG |
|
4721
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5616 |
self convertImageToSuffix:'png' |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5617 |
! |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5618 |
|
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5619 |
convertImageToSuffix:outSuffix |
9493
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5620 |
|outFile filesToConvert| |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5621 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5622 |
self withActivityIndicationDo:[ |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5623 |
filesToConvert := self currentSelectedObjects copy. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5624 |
filesToConvert do:[:fileName | |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5625 |
self notify:(resources string:'Converting: %1...' with:fileName baseName). |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5626 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5627 |
fileName isDirectory ifFalse:[ |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5628 |
|skip| |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5629 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5630 |
skip := false. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5631 |
outFile := fileName withSuffix:outSuffix. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5632 |
outFile exists ifTrue:[ |
4722 | 5633 |
|answer| |
5634 |
||
9493
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5635 |
answer := Dialog |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5636 |
confirmWithCancel:(resources string:'Overwrite existing %1 ?' with:outFile baseName allBold) |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5637 |
default:false. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5638 |
answer isNil ifTrue:[AbortSignal raise]. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5639 |
answer ifFalse:[ skip := true ]. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5640 |
]. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5641 |
skip ifFalse:[ |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5642 |
self |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5643 |
convertImageFrom:fileName |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5644 |
to:outFile |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5645 |
onError:[:errMsg | |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5646 |
filesToConvert size == 1 ifTrue:[ |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5647 |
Dialog warn:errMsg |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5648 |
] ifFalse:[ |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5649 |
(Dialog confirm:errMsg yesLabel:(resources string:'OK') noLabel:(resources string:'Cancel')) ifFalse:[ |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5650 |
^ self |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5651 |
] |
4721
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5652 |
]. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5653 |
]. |
9493
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5654 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5655 |
self updateAndSelect:nil. |
4367 | 5656 |
] |
9493
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5657 |
] |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5658 |
]. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5659 |
self notify:nil. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5660 |
] |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5661 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5662 |
"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
|
5663 |
! |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5664 |
|
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5665 |
convertImageToXPM |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5666 |
self convertImageToSuffix:'xpm' |
4367 | 5667 |
! |
5668 |
||
9493
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5669 |
convertImageUsingExternalFileToolsFrom:fileName toSuffix:outSuffix onError:exceptionBlock |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5670 |
|inFile outFile chainOfConversions conversionStream tempFileTemplate |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5671 |
eachConversionSuffixCommandPair eachConversionCommand eachConversionSuffix| |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5672 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5673 |
chainOfConversions := self conversionChainFrom:(fileName suffix) to:outSuffix. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5674 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5675 |
chainOfConversions isNil ifTrue:[ |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5676 |
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
|
5677 |
^ false |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5678 |
]. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5679 |
conversionStream := chainOfConversions readStream. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5680 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5681 |
tempFileTemplate := Filename newTemporary. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5682 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5683 |
inFile := fileName. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5684 |
eachConversionSuffixCommandPair := conversionStream next. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5685 |
eachConversionCommand := eachConversionSuffixCommandPair key. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5686 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5687 |
eachConversionCommand == #readToXPM ifTrue:[ |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5688 |
|image tempFileXPM| |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5689 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5690 |
image := Image fromFile:(inFile pathName). |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5691 |
image isNil ifTrue:[ |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5692 |
self warn:'Unknown format/not an image: ' , inFile baseName. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5693 |
^ false. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5694 |
]. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5695 |
tempFileXPM := tempFileTemplate withSuffix:'xpm'. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5696 |
image saveOn:tempFileXPM using:XPMReader. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5697 |
inFile := tempFileXPM. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5698 |
eachConversionSuffixCommandPair := conversionStream next. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5699 |
]. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5700 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5701 |
[ |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5702 |
|command errOutput errMsg| |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5703 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5704 |
[eachConversionSuffixCommandPair notNil] whileTrue:[ |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5705 |
eachConversionCommand := eachConversionSuffixCommandPair key. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5706 |
eachConversionSuffix := eachConversionSuffixCommandPair value. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5707 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5708 |
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
|
5709 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5710 |
outFile := tempFileTemplate withSuffix:eachConversionSuffix. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5711 |
command := eachConversionCommand |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5712 |
bindWith:(inFile pathName) |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5713 |
with:(outFile pathName). |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5714 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5715 |
errOutput := String writeStream. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5716 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5717 |
(OperatingSystem executeCommand:command errorTo:errOutput) ifFalse:[ |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5718 |
errMsg := resources |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5719 |
stringWithCRs:'Conversion of %1 to %2 using %3 failed:\\%4.' |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5720 |
with:inFile baseName allBold |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5721 |
with:eachConversionSuffix |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5722 |
with:eachConversionCommand allBold |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5723 |
with:errOutput contents. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5724 |
exceptionBlock value:errMsg. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5725 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5726 |
(inFile ~= fileName) ifTrue:[inFile delete]. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5727 |
outFile delete. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5728 |
^ false |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5729 |
]. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5730 |
(inFile ~= fileName) ifTrue:[inFile delete]. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5731 |
inFile := outFile. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5732 |
eachConversionSuffixCommandPair := conversionStream next |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5733 |
]. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5734 |
outFile moveTo:(fileName withSuffix:(chainOfConversions last value)). |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5735 |
] ifCurtailed:[ |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5736 |
(inFile ~= fileName) ifTrue:[inFile delete]. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5737 |
outFile delete. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5738 |
]. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5739 |
^ true. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5740 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5741 |
"Created: / 20-05-2010 / 11:05:50 / cg" |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5742 |
! |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5743 |
|
3892 | 5744 |
createProjectAndOpenProjectBrowser |
5745 |
|nm f s directory| |
|
5746 |
||
5747 |
self currentFilesAreInSameDirectory ifFalse:[^ self]. |
|
5960 | 5748 |
directory := self currentDirectory. |
3892 | 5749 |
nm := directory baseName. |
5750 |
f := (directory construct:nm) withSuffix:'prj'. |
|
5751 |
f exists ifTrue:[ |
|
4414 | 5752 |
Dialog warn:'A file named ' , f baseName , ' already exists.'. |
5753 |
^ self. |
|
3892 | 5754 |
]. |
5755 |
s := f writeStream. |
|
5756 |
s nextPutAll:' |
|
5757 |
name ''' , nm , ''' |
|
5758 |
type #classLibrary |
|
5759 |
package #''private:' , nm , ''' |
|
5760 |
prerequisites nil |
|
5761 |
||
5762 |
classes #( ) |
|
5763 |
'. |
|
5764 |
s close. |
|
5765 |
ProjectBrowser openOnFile:f. |
|
5766 |
! |
|
5767 |
||
5880 | 5768 |
doExecuteCommand |
5769 |
"execute an OperatingSystem-command" |
|
5770 |
||
5771 |
| action fileName| |
|
5772 |
||
5773 |
fileName := self firstSelectedFile. |
|
5774 |
action := [:command | |
|
5775 |
self addToCommandHistory:command for:fileName. |
|
5776 |
self executeCommand:command. |
|
5777 |
]. |
|
5778 |
self askForCommandFor:fileName thenDo:action |
|
5779 |
! |
|
5780 |
||
5781 |
doExecuteScript |
|
5782 |
"execute a smalltalk script" |
|
5783 |
||
5784 |
|textHolder dialog template dummyClass dummyInstance| |
|
5785 |
||
5786 |
template := |
|
5787 |
'"/ Smalltalk script: |
|
5788 |
||
5789 |
"/ the following variables are accessable: |
|
5790 |
"/ directory (= ' , (self theSingleSelectedDirectoryOrNil ? Filename homeDirectory) pathName , ') |
|
5791 |
"/ selectedFiles (= ...) |
|
5792 |
"/ |
|
5793 |
"/ Beginner warning: Smalltalk know-how is useful here ;-). |
|
5794 |
"/ |
|
5795 |
"/ Useful operations are: |
|
5796 |
"/ directory directoryContentsDo:[:eachBaseNameString | ...] |
|
5797 |
"/ directory directoryContentsAsFilenamesDo:[:eachFilename | ...] |
|
5798 |
"/ directory directory |
|
5799 |
"/ |
|
5800 |
"/ example: move all files which match a aarticular pattern to |
|
5801 |
"/ a separate directory: |
|
5802 |
"/ |
|
5803 |
"/ |directory idx prefix rest newDir oldFile newFile| |
|
5804 |
"/ |
|
5805 |
"/ directory := ''/mnt/var/priv/image/tv/frank/frank2/2131_008.jpg'' asFilename. |
|
5806 |
"/ |
|
5807 |
"/ directory directoryContentsDo:[:eachBaseNameString | |
|
5808 |
"/ (eachBaseNameString includes:$_) ifTrue:[ |
|
5809 |
"/ idx := eachBaseNameString indexOf:$_. |
|
5810 |
"/ prefix := eachBaseNameString copyTo:(idx - 1). |
|
5811 |
"/ rest := eachBaseNameString copyFrom:(idx + 1). |
|
5812 |
"/ newDir := directory construct:prefix. |
|
5813 |
"/ newDir exists ifFalse:[ |
|
5814 |
"/ (Dialog confirm:''Create '' , newDir pathName) ifTrue:[ |
|
5815 |
"/ newDir makeDirectory. |
|
5816 |
"/ ]. |
|
5817 |
"/ ]. |
|
5818 |
"/ newDir exists ifTrue:[ |
|
5819 |
"/ oldFile := directory construct:eachBaseNameString. |
|
5820 |
"/ newFile := newDir construct:rest. |
|
5821 |
"/ oldFile moveTo:newFile |
|
5822 |
"/ ] |
|
5823 |
"/ ] |
|
5824 |
"/ ] |
|
5825 |
'. |
|
5826 |
||
5827 |
LastScriptBlockString isNil ifTrue:[ |
|
5828 |
LastScriptBlockString := template. |
|
5829 |
]. |
|
5830 |
||
5831 |
textHolder := ValueHolder new. |
|
5832 |
dialog := Dialog |
|
5833 |
forRequestText:(resources string:'Enter script') |
|
5834 |
editViewClass:CodeView |
|
5835 |
lines:25 |
|
5836 |
columns:70 |
|
5837 |
initialAnswer:LastScriptBlockString |
|
5838 |
model:textHolder. |
|
5839 |
dialog addButton:(Button label:'Template' action:[textHolder value:template. textHolder changed:#value.]). |
|
5840 |
dialog open. |
|
5841 |
dialog accepted ifFalse:[^ self]. |
|
5842 |
||
5843 |
LastScriptBlockString := textHolder value. |
|
5844 |
||
5845 |
Class classConventionViolationConfirmationQuerySignal |
|
5846 |
answer:true |
|
5847 |
do:[ |
|
5848 |
dummyClass := Object class |
|
5849 |
name:#Dummy |
|
5850 |
inEnvironment:nil |
|
5851 |
subclassOf:Object |
|
5852 |
instanceVariableNames:'directory selectedFiles' |
|
5853 |
variable:false |
|
5854 |
words:true |
|
5855 |
pointers:true |
|
5856 |
classVariableNames:'' |
|
5857 |
poolDictionaries:'' |
|
5858 |
category:#dummyCategory |
|
5859 |
comment:nil |
|
5860 |
changed:true. |
|
5861 |
]. |
|
5862 |
||
5863 |
dummyInstance := dummyClass basicNew. |
|
5864 |
dummyInstance instVarAt:1 put:(self theSingleSelectedDirectoryOrNil ? Filename homeDirectory). |
|
5865 |
dummyInstance instVarAt:2 put:(self currentSelectedFiles value). |
|
5866 |
||
5867 |
Compiler |
|
5868 |
evaluate:textHolder value |
|
5869 |
in:nil |
|
5870 |
receiver:dummyInstance |
|
5871 |
notifying:nil |
|
5872 |
logged:false |
|
5873 |
ifFail:[] |
|
5874 |
compile:true. |
|
5875 |
||
5876 |
"/ fileName := self firstSelectedFile. |
|
5877 |
"/ action := [:command | |
|
5878 |
"/ self addToCommandHistory:command for:fileName. |
|
5879 |
"/ self executeCommand:command. |
|
5880 |
"/ ]. |
|
5881 |
"/ self askForCommandFor:fileName thenDo:action |
|
5882 |
! |
|
5883 |
||
4230 | 5884 |
doMake |
7938 | 5885 |
|dir cmd| |
4230 | 5886 |
|
5887 |
cmd := 'make'. |
|
7938 | 5888 |
dir := self theSingleSelectedDirectoryOrNil. |
5889 |
||
5890 |
OperatingSystem isMSWINDOWSlike ifTrue:[ |
|
5891 |
dir notNil ifTrue:[ |
|
5892 |
(dir construct:'bmake.bat') exists ifTrue:[ |
|
5893 |
cmd := 'bmake.bat'. |
|
5894 |
] |
|
5895 |
] |
|
5896 |
]. |
|
4230 | 5897 |
self executeCommand:cmd. |
5898 |
! |
|
5899 |
||
8256 | 5900 |
doOpenCBrowser |
5901 |
|destDir| |
|
5902 |
||
10747
aa57b76e8318
added: #cBrowserMenuItemVisible
Claus Gittinger <cg@exept.de>
parents:
10678
diff
changeset
|
5903 |
(CBrowser isNil or:[ CBrowser::Browser isNil ]) ifTrue:[ |
aa57b76e8318
added: #cBrowserMenuItemVisible
Claus Gittinger <cg@exept.de>
parents:
10678
diff
changeset
|
5904 |
Smalltalk loadPackage:'exept:CC' |
aa57b76e8318
added: #cBrowserMenuItemVisible
Claus Gittinger <cg@exept.de>
parents:
10678
diff
changeset
|
5905 |
]. |
8256 | 5906 |
destDir := self currentDirectory. |
5907 |
CBrowser::Browser openIn:destDir pathName |
|
10747
aa57b76e8318
added: #cBrowserMenuItemVisible
Claus Gittinger <cg@exept.de>
parents:
10678
diff
changeset
|
5908 |
|
aa57b76e8318
added: #cBrowserMenuItemVisible
Claus Gittinger <cg@exept.de>
parents:
10678
diff
changeset
|
5909 |
"Modified: / 04-10-2011 / 13:41:31 / cg" |
8256 | 5910 |
! |
5911 |
||
7829 | 5912 |
doOpenExplorer |
8882 | 5913 |
OperatingSystem isMSWINDOWSlike ifFalse:[ |
5914 |
self warn:'sorry - this operation is only available under windows'. |
|
5915 |
]. |
|
7829 | 5916 |
|
5917 |
OperatingSystem |
|
9343
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
5918 |
openApplicationForDocument:(self currentDirectory) |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
5919 |
operation:#explore. |
7829 | 5920 |
|
5921 |
"Modified: / 23-07-2007 / 23:01:22 / cg" |
|
5922 |
! |
|
5923 |
||
4317
bf3f150809c2
settings is a new application now and will be inserted under tools in
penk
parents:
4294
diff
changeset
|
5924 |
doOpenSettings |
8168 | 5925 |
self openSettingsDialog |
4317
bf3f150809c2
settings is a new application now and will be inserted under tools in
penk
parents:
4294
diff
changeset
|
5926 |
! |
bf3f150809c2
settings is a new application now and will be inserted under tools in
penk
parents:
4294
diff
changeset
|
5927 |
|
9343
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
5928 |
doOpenWithShellCommand |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
5929 |
"open using win32-shell" |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
5930 |
|
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
5931 |
|fileName| |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
5932 |
|
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
5933 |
fileName := self firstSelectedFile. |
9405
5b598565288a
changed: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9393
diff
changeset
|
5934 |
fileName notNil ifTrue:[ |
5b598565288a
changed: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9393
diff
changeset
|
5935 |
Win32OperatingSystem |
5b598565288a
changed: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9393
diff
changeset
|
5936 |
openApplicationForDocument:fileName pathName |
5b598565288a
changed: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9393
diff
changeset
|
5937 |
operation:#open |
5b598565288a
changed: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9393
diff
changeset
|
5938 |
] |
9343
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
5939 |
! |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
5940 |
|
7104 | 5941 |
editMode:aSymbol |
5942 |
self |
|
5943 |
applicationNamed:#FileApplicationNoteBook |
|
5944 |
ifPresentDo:[:appl | |
|
5945 |
|subApp| |
|
5946 |
||
5947 |
subApp := appl selectedApplication. |
|
5948 |
subApp notNil ifTrue:[ |
|
5949 |
^ subApp perform:aSymbol |
|
5950 |
] |
|
5951 |
]. |
|
5952 |
||
5953 |
"Created: / 11-09-2006 / 12:42:08 / cg" |
|
5954 |
! |
|
5955 |
||
5956 |
editModeInsert |
|
5957 |
self editMode:#editModeInsert |
|
5958 |
||
5959 |
"Created: / 11-09-2006 / 12:40:36 / cg" |
|
5960 |
! |
|
5961 |
||
5962 |
editModeInsertAndSelect |
|
5963 |
self editMode:#editModeInsertAndSelect |
|
5964 |
||
5965 |
"Created: / 11-09-2006 / 12:40:45 / cg" |
|
5966 |
! |
|
5967 |
||
5968 |
editModeOverwrite |
|
5969 |
self editMode:#editModeOverwrite |
|
5970 |
||
5971 |
"Modified: / 11-09-2006 / 12:42:26 / cg" |
|
5972 |
! |
|
5973 |
||
8454
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
5974 |
fileContentsAsByteArray |
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
5975 |
|file| |
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
5976 |
|
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
5977 |
file := self firstSelectedFile. |
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
5978 |
file isNil ifTrue:[^ self ]. |
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
5979 |
file asFilename fileSize > (1024*1024) ifTrue:[ |
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
5980 |
file asFilename fileSize > (128*1024*1024) ifTrue:[ |
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
5981 |
Dialog warn:'File is too big'. |
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
5982 |
^ self. |
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
5983 |
]. |
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
5984 |
(Dialog confirm:'File is big - proceed ?') ifFalse:[^ self]. |
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
5985 |
]. |
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
5986 |
file asFilename binaryContentsOfEntireFile inspect |
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
5987 |
! |
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
5988 |
|
3892 | 5989 |
fileFileIn |
5990 |
"fileIn the selected file(s)" |
|
5991 |
||
5992 |
self fileFileInLazy:false |
|
5993 |
! |
|
5994 |
||
7324 | 5995 |
fileFileIn:aFilename lazy:lazy |
5996 |
"fileIn a file" |
|
5997 |
||
5998 |
self withActivityIndicationDo:[ |
|
5999 |
self notify:('File in:', aFilename asFilename baseName). |
|
6000 |
self singleFileFileIn:aFilename lazy:lazy. |
|
6001 |
self notify:nil. |
|
6002 |
] |
|
6003 |
||
6004 |
"Created: / 20-09-2006 / 14:28:35 / cg" |
|
6005 |
! |
|
6006 |
||
3892 | 6007 |
fileFileInLazy |
6008 |
"fileIn the selected file(s). Do a quick load (no compilation)" |
|
6009 |
||
6010 |
self fileFileInLazy:true |
|
6011 |
! |
|
6012 |
||
6013 |
fileFileInLazy:lazy |
|
6014 |
"fileIn the selected file(s)" |
|
6015 |
||
7324 | 6016 |
self currentSelectedFiles do:[:fileName | |
6017 |
self fileIn:fileName lazy:lazy |
|
6018 |
]. |
|
6019 |
||
6020 |
"Modified: / 20-09-2006 / 14:29:24 / cg" |
|
3892 | 6021 |
! |
6022 |
||
6023 |
fileFileInToNameSpace |
|
6024 |
"fileIn the selected file(s)<into a nameSpace" |
|
6025 |
||
6026 |
|ns listOfKnownNameSpaces| |
|
6027 |
||
6028 |
listOfKnownNameSpaces := Set new. |
|
6029 |
NameSpace |
|
6672
478b83a3753a
max size to be shown without dialog
Claus Gittinger <cg@exept.de>
parents:
6671
diff
changeset
|
6030 |
allNameSpaces |
4414 | 6031 |
do:[:eachNameSpace | |
6032 |
listOfKnownNameSpaces add:eachNameSpace name |
|
6033 |
]. |
|
3892 | 6034 |
listOfKnownNameSpaces := listOfKnownNameSpaces asOrderedCollection sort. |
6035 |
||
6036 |
ns := Dialog |
|
4414 | 6037 |
request:'During fileIn, new classes are created in nameSpace:' |
6038 |
initialAnswer:(LastEnforcedNameSpace ? Class nameSpaceQuerySignal query name) |
|
6039 |
list:listOfKnownNameSpaces. |
|
3892 | 6040 |
ns isEmptyOrNil ifTrue:[^ self]. |
6041 |
||
6042 |
LastEnforcedNameSpace := ns. |
|
6043 |
ns := NameSpace name:ns. |
|
6044 |
||
6045 |
Class nameSpaceQuerySignal |
|
4414 | 6046 |
answer:ns |
6047 |
do:[ |
|
6048 |
self fileFileInLazy:false |
|
6049 |
] |
|
3892 | 6050 |
! |
6051 |
||
6052 |
fileFindAllDuplicates |
|
6053 |
"scan directory and all subdirs for duplicate files" |
|
6054 |
||
6055 |
|fileNames dir infoDir filesBySize |
|
6056 |
result info dirPrefix myName stream textBox maxLength directories| |
|
6057 |
||
6058 |
||
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
6059 |
self withActivityIndicationDo:[ |
4414 | 6060 |
result := Dictionary new. |
6061 |
myName := self class name asString. |
|
6062 |
directories := self currentSelectedDirectories. |
|
6063 |
directories isEmpty ifTrue:[^ self]. |
|
3892 | 6064 |
|
4414 | 6065 |
dir := directories first. |
3892 | 6066 |
"/ self label: myName, '- gathering file names ...'. |
4636
08b2b63e3107
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4629
diff
changeset
|
6067 |
[ |
08b2b63e3107
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4629
diff
changeset
|
6068 |
fileNames := dir recursiveDirectoryContents. |
08b2b63e3107
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4629
diff
changeset
|
6069 |
] on:FileStream openErrorSignal do:[:ex| |
6352 | 6070 |
self warn:(resources stringWithCRs:'Cannot access: %1\(%2)' |
6071 |
with:ex pathName |
|
6072 |
with:ex description). |
|
4636
08b2b63e3107
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4629
diff
changeset
|
6073 |
^ self |
08b2b63e3107
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4629
diff
changeset
|
6074 |
]. |
4765 | 6075 |
fileNames := fileNames |
6076 |
collect:[:fn | dir construct:fn] |
|
6077 |
thenSelect:[:fn | fn isDirectory not]. |
|
3892 | 6078 |
|
6079 |
"/ self label:myName , '- gathering sizes ...'. |
|
4414 | 6080 |
infoDir := Dictionary new. |
6081 |
fileNames do:[:fn | |
|
6082 |
infoDir at:fn put:(fn fileSize) |
|
6083 |
]. |
|
6084 |
||
6085 |
"/ for each, get the files size. |
|
6086 |
"/ in a first pass, look for files of the same size and |
|
6087 |
"/ compare them ... |
|
3892 | 6088 |
|
6089 |
"/ self label:myName , '- preselect possible duplicates ...'. |
|
4414 | 6090 |
filesBySize := Dictionary new. |
6091 |
infoDir keysAndValuesDo:[:fn :sz | |
|
6092 |
|entry| |
|
6093 |
||
6094 |
entry := filesBySize at:sz ifAbsentPut:[Set new]. |
|
6095 |
entry add:fn. |
|
6096 |
]. |
|
6097 |
||
6098 |
"/ any of same size ? |
|
3892 | 6099 |
|
6100 |
"/ self label:myName , '- checking for duplicates ...'. |
|
4414 | 6101 |
filesBySize do:[:entry | |
6102 |
|files| |
|
6103 |
||
6104 |
entry size > 1 ifTrue:[ |
|
6105 |
files := entry asArray. |
|
6106 |
1 to:files size-1 do:[:idx1 | |
|
6107 |
idx1+1 to:files size do:[:idx2 | |
|
6108 |
|fn1 fn2| |
|
6109 |
||
6110 |
fn1 := files at:idx1. |
|
6111 |
fn2 := files at:idx2. |
|
3892 | 6112 |
|
6113 |
"/ self label:myName , '- checking ' , fn1 baseName , ' vs. ' , fn2 baseName , ' ...'. |
|
4414 | 6114 |
(result at:fn2 ifAbsent:nil) ~= fn1 ifTrue:[ |
6115 |
"/ compare the files |
|
6116 |
(fn1 sameContentsAs:fn2) ifTrue:[ |
|
3892 | 6117 |
"/ Transcript show:'Same: '; show:fn1 baseName; show:' and '; showCR:fn2 baseName. |
4414 | 6118 |
result at:fn1 put:fn2. |
6119 |
] |
|
6120 |
] |
|
6121 |
] |
|
6122 |
] |
|
6123 |
] |
|
6124 |
]. |
|
3892 | 6125 |
|
6126 |
"/ self label:myName , '- sorting ...'. |
|
4414 | 6127 |
dirPrefix := dir pathName. |
6128 |
result := result associations. |
|
6129 |
result := result collect:[:assoc | |
|
6130 |
|f1 f2| |
|
6131 |
||
6132 |
f1 := assoc key name. |
|
6133 |
f2 := assoc value name. |
|
6134 |
(f1 startsWith:dirPrefix) ifTrue:[ |
|
6135 |
f1 := f1 copyFrom:dirPrefix size + 2. |
|
6136 |
]. |
|
6137 |
(f2 startsWith:dirPrefix) ifTrue:[ |
|
6138 |
f2 := f2 copyFrom:dirPrefix size + 2. |
|
6139 |
]. |
|
6140 |
f1 < f2 ifTrue:[ |
|
6141 |
f2 -> f1 |
|
6142 |
] ifFalse:[ |
|
6143 |
f1 -> f2 |
|
6144 |
] |
|
6145 |
]. |
|
6146 |
result sort:[:f1 :f2 | f2 value < f1 value]. |
|
6147 |
||
6148 |
info := OrderedCollection new. |
|
6149 |
result do:[:assoc | |
|
6150 |
info add:(assoc key , ' same as ' , assoc value) |
|
6151 |
]. |
|
6152 |
info isEmpty ifTrue:[ |
|
5543 | 6153 |
Dialog information:'No duplicate files found.'. |
6154 |
^ self. |
|
4414 | 6155 |
]. |
3892 | 6156 |
]. |
6157 |
||
6158 |
stream := WriteStream on:''. |
|
6159 |
info do:[:el| |
|
4535 | 6160 |
stream nextPutLine:el. |
3892 | 6161 |
]. |
5542 | 6162 |
|
3892 | 6163 |
textBox := TextBox new. |
6164 |
textBox initialText:(stream contents). |
|
5542 | 6165 |
stream close. |
4636
08b2b63e3107
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4629
diff
changeset
|
6166 |
textBox title:'File duplicates in directory: ', dir asString. |
3892 | 6167 |
textBox readOnly:true. |
6168 |
textBox noCancel. |
|
4636
08b2b63e3107
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4629
diff
changeset
|
6169 |
textBox label:'Duplicates in ', dir asString. |
3892 | 6170 |
maxLength := 10. |
6171 |
info do:[: el | |
|
4414 | 6172 |
maxLength := maxLength max:(el size). |
3892 | 6173 |
]. |
6174 |
textBox extent:((maxLength * 5)@(info size * 20)); sizeFixed:false. |
|
5542 | 6175 |
textBox maxExtent:Screen current extent. |
6176 |
textBox openModeless. |
|
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
6177 |
|
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
6178 |
"Modified: / 25-07-2006 / 09:07:22 / cg" |
3892 | 6179 |
! |
6180 |
||
10304
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6181 |
fileFindDuplicateFile |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6182 |
"scan directory for duplicates of the selected files" |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6183 |
|
10306 | 6184 |
|files filesBySize samePerFile stream textBox mustHaveMatches| |
10304
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6185 |
|
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6186 |
files := self currentSelectedFiles. |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6187 |
files isEmpty ifTrue:[^ self]. |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6188 |
|
10305
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6189 |
self withWaitCursorDo:[ |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6190 |
filesBySize := Dictionary new. |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6191 |
files do:[:fn | |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6192 |
|sz entry| |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6193 |
|
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6194 |
sz := fn asFilename fileSize. |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6195 |
(filesBySize at:sz ifAbsentPut:[Set new]) add:fn. |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6196 |
]. |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6197 |
|
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6198 |
samePerFile := Dictionary new. |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6199 |
|
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6200 |
self currentSelectedDirectories do:[:eachDir | |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6201 |
eachDir recursiveDirectoryContentsAsFilenamesDo:[:eachFile | |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6202 |
eachFile isDirectory ifFalse:[ |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6203 |
|sz possibleMatches| |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6204 |
|
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6205 |
sz := eachFile fileSize. |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6206 |
possibleMatches := filesBySize at:sz ifAbsent:nil. |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6207 |
possibleMatches notNil ifTrue:[ |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6208 |
possibleMatches do:[:eachFileWithSameSize | |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6209 |
eachFileWithSameSize ~= eachFile ifTrue:[ |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6210 |
(eachFileWithSameSize sameContentsAs:eachFile) ifTrue:[ |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6211 |
(samePerFile at:eachFileWithSameSize ifAbsentPut:[Set new]) add:eachFile |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6212 |
] |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6213 |
] |
10304
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6214 |
] |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6215 |
] |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6216 |
] |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6217 |
] |
10305
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6218 |
]. |
10304
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6219 |
]. |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6220 |
|
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6221 |
stream := WriteStream on:''. |
10306 | 6222 |
stream nextPutLine:'Duplicates:'. |
10305
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6223 |
(samePerFile keys asOrderedCollection sort:[:a :b | a asFilename baseName < b asFilename baseName]) |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6224 |
do:[:origFile | |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6225 |
|sameFiles| |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6226 |
|
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6227 |
sameFiles := samePerFile at:origFile. |
10304
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6228 |
stream nextPutLine:origFile baseName. |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6229 |
(sameFiles asOrderedCollection collect:[:each | each baseName]) sort do:[:eachSameName | |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6230 |
stream nextPutAll:' '; nextPutLine:eachSameName. |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6231 |
] |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6232 |
]. |
10306 | 6233 |
stream nextPutLine:'Files without duplicates:'. |
6234 |
(samePerFile keys asOrderedCollection sort:[:a :b | a asFilename baseName < b asFilename baseName]) |
|
6235 |
do:[:origFile | |
|
6236 |
|sameFiles| |
|
6237 |
||
6238 |
sameFiles := samePerFile at:origFile. |
|
6239 |
sameFiles isEmpty ifTrue:[ |
|
6240 |
stream nextPutLine:origFile baseName. |
|
6241 |
]. |
|
6242 |
]. |
|
6243 |
||
6244 |
mustHaveMatches := Dialog request:'Must have for duplicates matching ?:' initialAnswer:(LastMustMatchPattern ? '[a-z][a-z][a-z]_[0-9][0-9][0-9].*'). |
|
6245 |
mustHaveMatches notEmptyOrNil ifTrue:[ |
|
6246 |
LastMustMatchPattern := mustHaveMatches. |
|
6247 |
||
6248 |
stream nextPutLine:'Files without duplicates in xxx_nnn.jpg:'. |
|
6249 |
(samePerFile keys asOrderedCollection sort:[:a :b | a asFilename baseName < b asFilename baseName]) |
|
6250 |
do:[:origFile | |
|
6251 |
|sameFiles| |
|
6252 |
||
6253 |
sameFiles := samePerFile at:origFile. |
|
6254 |
sameFiles notEmpty ifTrue:[ |
|
6255 |
(sameFiles contains:[:file | mustHaveMatches match:file baseName]) ifFalse:[ |
|
6256 |
stream nextPutLine:origFile baseName. |
|
6257 |
] |
|
6258 |
]. |
|
6259 |
]. |
|
6260 |
]. |
|
10304
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6261 |
|
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6262 |
textBox := TextBox new. |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6263 |
textBox initialText:(stream contents). |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6264 |
textBox title:'Files with same contents'. |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6265 |
textBox readOnly:true. |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6266 |
textBox noCancel. |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6267 |
textBox extent:(350@400). |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6268 |
textBox maxExtent:Screen current extent. |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6269 |
textBox openModeless. "/ showAtPointer. |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6270 |
|
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6271 |
"Created: / 11-07-2011 / 12:39:44 / cg" |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6272 |
! |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6273 |
|
3892 | 6274 |
fileFindDuplicates |
6275 |
"scan directory for duplicate files" |
|
6276 |
||
8510 | 6277 |
|infoDir filesBySize result info stream textBox maxLength directories allFiles titleStream size| |
6278 |
||
6279 |
directories := self currentSelectedDirectories. |
|
3892 | 6280 |
|
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
6281 |
self withActivityIndicationDo:[ |
4355 | 6282 |
result := Dictionary new. |
6283 |
||
6284 |
directories := self currentSelectedDirectories. |
|
6285 |
directories isEmpty ifTrue:[^ self]. |
|
6286 |
||
8510 | 6287 |
allFiles := self allFilesInSelectedDirectoriesForWhich:[:f | true]. |
4355 | 6288 |
|
6289 |
infoDir := Dictionary new. |
|
6290 |
allFiles do:[:fn | |
|
6291 |
infoDir at:fn put:(fn info) |
|
6292 |
]. |
|
6293 |
||
6294 |
"/ for each, get the files size. |
|
6295 |
"/ in a first pass, look for files of the same size and |
|
6296 |
"/ compare them ... |
|
6297 |
||
6298 |
filesBySize := Dictionary new. |
|
6299 |
infoDir keysAndValuesDo:[:fn :info | |
|
6300 |
|sz entry| |
|
6301 |
||
6302 |
sz := info size. |
|
6303 |
entry := filesBySize at:sz ifAbsentPut:[Set new]. |
|
6304 |
entry add:fn. |
|
6305 |
]. |
|
6306 |
||
6307 |
"/ any of same size ? |
|
6308 |
||
6309 |
filesBySize do:[:entry | |
|
6310 |
|files| |
|
6311 |
||
6312 |
entry size > 1 ifTrue:[ |
|
6313 |
files := entry asArray. |
|
6314 |
1 to:files size-1 do:[:idx1 | |
|
6315 |
idx1+1 to:files size do:[:idx2 | |
|
6316 |
|fn1 fn2| |
|
6317 |
||
6318 |
fn1 := files at:idx1. |
|
6319 |
fn2 := files at:idx2. |
|
6320 |
||
6321 |
(result at:fn2 ifAbsent:nil) ~= fn1 ifTrue:[ |
|
6322 |
"/ compare the files |
|
6323 |
(fn1 sameContentsAs:fn2) ifTrue:[ |
|
3892 | 6324 |
"/ Transcript show:'Same: '; show:fn1 baseName; show:' and '; showCR:fn2 baseName. |
4355 | 6325 |
result at:fn1 put:fn2. |
6326 |
] |
|
6327 |
] |
|
6328 |
] |
|
6329 |
] |
|
6330 |
] |
|
6331 |
]. |
|
6332 |
||
6333 |
result := result associations. |
|
6334 |
result := result collect:[:assoc | |
|
6335 |
|f1 f2| |
|
6336 |
||
6337 |
f1 := assoc key asString. |
|
6338 |
f2 := assoc value asString. |
|
6339 |
f1 < f2 ifTrue:[ |
|
6340 |
f2 -> f1 |
|
6341 |
] ifFalse:[ |
|
6342 |
f1 -> f2 |
|
6343 |
] |
|
6344 |
]. |
|
5789 | 6345 |
"/ result sort:[:f1 :f2 | f1 key > f2 key "f2 value < f1 key value"]. |
6346 |
result sort:[:f1 :f2 | " f1 key > f2 key" f2 value < f1 key value]. |
|
4355 | 6347 |
|
6348 |
info := OrderedCollection new. |
|
6349 |
size := self getBestDirectory asString size. |
|
6350 |
result do:[:assoc | |
|
6351 |
|fn1 fn2| |
|
6352 |
||
6353 |
fn1 := assoc key. |
|
6354 |
fn2 := assoc value. |
|
6355 |
size > 1 ifTrue:[ |
|
6356 |
fn1 := ('..', (fn1 copyFrom:(size + 1))). |
|
6357 |
fn2 := ('..', (fn2 copyFrom:(size + 1))). |
|
6358 |
]. |
|
6359 |
(fn1 includes:Character space) ifTrue:[ |
|
6360 |
fn1 := '"' , fn1 , '"' |
|
6361 |
]. |
|
6362 |
(fn2 includes:Character space) ifTrue:[ |
|
6363 |
fn2 := '"' , fn2 , '"' |
|
6364 |
]. |
|
6365 |
info add:(fn1 , ' same as ' , fn2) |
|
6366 |
]. |
|
6367 |
info isEmpty ifTrue:[ |
|
5543 | 6368 |
Dialog information:'No duplicate files found.'. |
6369 |
^ self. |
|
4355 | 6370 |
]. |
3892 | 6371 |
]. |
6372 |
stream := WriteStream on:''. |
|
6373 |
info do:[:el| |
|
4535 | 6374 |
stream nextPutLine:el. |
3892 | 6375 |
]. |
6376 |
titleStream := WriteStream on:''. |
|
4636
08b2b63e3107
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4629
diff
changeset
|
6377 |
titleStream nextPutAll:'File duplicates in director'. |
3892 | 6378 |
directories size == 1 ifTrue:[ |
4355 | 6379 |
titleStream nextPutAll:'y: ', directories first asString. |
3892 | 6380 |
] ifFalse:[ |
4535 | 6381 |
titleStream nextPutLine:'ies: '. |
4355 | 6382 |
directories do:[:dir| |
6383 |
size > 1 ifTrue:[ |
|
6384 |
titleStream nextPutAll:'..'. |
|
4535 | 6385 |
titleStream nextPutLine:((dir asString) copyFrom:(size + 1)). |
4355 | 6386 |
] ifFalse:[ |
4535 | 6387 |
titleStream nextPutLine:(dir asString). |
4355 | 6388 |
]. |
6389 |
] |
|
3892 | 6390 |
]. |
5543 | 6391 |
|
3892 | 6392 |
textBox := TextBox new. |
6393 |
textBox initialText:(stream contents). |
|
6394 |
textBox title:(titleStream contents). |
|
6395 |
textBox readOnly:true. |
|
6396 |
textBox noCancel. |
|
4636
08b2b63e3107
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4629
diff
changeset
|
6397 |
stream := WriteStream on:'Duplicates in '. |
4170 | 6398 |
directories do:[ :aDirectory | |
4355 | 6399 |
stream nextPutAll:aDirectory baseName. |
6400 |
stream space. |
|
4050 | 6401 |
]. |
4170 | 6402 |
textBox label:stream contents. |
3892 | 6403 |
maxLength := 10. |
6404 |
info do:[: el | |
|
4355 | 6405 |
maxLength := maxLength max:(el size). |
3892 | 6406 |
]. |
5092 | 6407 |
textBox extent:((maxLength * 5)@((info size max:40)* 10)). |
6408 |
textBox maxExtent:Screen current extent. |
|
4355 | 6409 |
textBox openModeless. "/ showAtPointer. |
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
6410 |
|
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
6411 |
"Modified: / 25-07-2006 / 09:07:25 / cg" |
3892 | 6412 |
! |
6413 |
||
6414 |
fileFindFile |
|
5961 | 6415 |
|filename| |
6416 |
||
6417 |
filename := self firstSelectedFileName. |
|
6418 |
filename isNil ifTrue:[ |
|
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
6419 |
filename := Filename homeDirectory. |
3892 | 6420 |
]. |
4101 | 6421 |
FindFileApplication openOnFileName:filename for:self. |
3892 | 6422 |
! |
6423 |
||
8510 | 6424 |
fileFindSimilarImages |
6425 |
"scan directory for similar image files" |
|
6426 |
||
8512 | 6427 |
|result stream textBox directories imageFiles histogramsV histogramsH |
6428 |
similarV similarH similar alreadyPrinted| |
|
8510 | 6429 |
|
8524
cac6b19eae23
changed #fileFindSimilarImages
Claus Gittinger <cg@exept.de>
parents:
8512
diff
changeset
|
6430 |
self withWaitCursorDo:[ |
8510 | 6431 |
self withActivityIndicationDo:[ |
6432 |
result := Dictionary new. |
|
6433 |
||
6434 |
directories := self currentSelectedDirectories. |
|
6435 |
directories isEmpty ifTrue:[^ self]. |
|
6436 |
||
6437 |
imageFiles := self allFilesInSelectedDirectoriesForWhich:[:f | f mimeTypeFromName isImage]. |
|
8511 | 6438 |
"/ imageFiles := imageFiles select:[:f | f baseName startsWith:'foo']. |
6439 |
imageFiles sort:[:a :b | a pathName < b pathName]. |
|
6440 |
||
8510 | 6441 |
"/ for each, get the color histogram |
6442 |
histogramsV := Dictionary new. |
|
6443 |
histogramsH := Dictionary new. |
|
6444 |
imageFiles do:[:fn | |
|
6445 |
|hist image| |
|
6446 |
||
6447 |
image := Image fromFile:fn. |
|
6448 |
Transcript showCR:'generating histogram for ',fn baseName. |
|
6449 |
hist := ImageColorHistogram new forImage:image. |
|
6450 |
histogramsV at:fn put:(hist histogramVectorV). |
|
6451 |
histogramsH at:fn put:(hist histogramVectorH). |
|
6452 |
]. |
|
6453 |
||
6454 |
similarH := Dictionary new. |
|
6455 |
similarV := Dictionary new. |
|
6456 |
similar := Dictionary new. |
|
6457 |
||
8512 | 6458 |
(self firstSelectedFile notNil |
6459 |
ifTrue:[ Array with:self firstSelectedFile ] |
|
6460 |
ifFalse:[ imageFiles ]) |
|
6461 |
do:[:eachFile1 | |
|
8510 | 6462 |
|setOfSimilar distancesV distancesH| |
6463 |
||
6464 |
distancesV := OrderedCollection new. |
|
6465 |
distancesH := OrderedCollection new. |
|
6466 |
setOfSimilar := OrderedCollection new. |
|
6467 |
||
6468 |
imageFiles do:[:eachFile2 | |
|
6469 |
|v1 v2 dV dH| |
|
6470 |
||
6471 |
eachFile1 ~= eachFile2 ifTrue:[ |
|
6472 |
v1 := histogramsV at:eachFile1. |
|
6473 |
v2 := histogramsV at:eachFile2. |
|
6474 |
dV := ImageColorHistogram distanceFrom:v1 to:v2. |
|
6475 |
distancesV add:(eachFile2 -> dV). |
|
6476 |
v1 := histogramsH at:eachFile1. |
|
6477 |
v2 := histogramsH at:eachFile2. |
|
6478 |
dH := ImageColorHistogram distanceFrom:v1 to:v2. |
|
6479 |
distancesH add:(eachFile2 -> dH). |
|
6480 |
(dV < 10000 and:[dH < 10000]) ifTrue:[ |
|
8512 | 6481 |
setOfSimilar add:eachFile2->(dV + dH). |
8510 | 6482 |
]. |
6483 |
] |
|
6484 |
]. |
|
6485 |
distancesV sort:[:a1 :a2 | a1 value < a2 value]. |
|
6486 |
distancesH sort:[:a1 :a2 | a1 value < a2 value]. |
|
6487 |
similarV at:eachFile1 put:distancesV. |
|
6488 |
similarH at:eachFile1 put:distancesH. |
|
6489 |
setOfSimilar notEmpty ifTrue:[ similar at:eachFile1 put:setOfSimilar ]. |
|
6490 |
]. |
|
6491 |
||
6492 |
similar isEmpty ifTrue:[ |
|
6493 |
Dialog information:'No similarities found.'. |
|
6494 |
^ self. |
|
6495 |
]. |
|
6496 |
]. |
|
6497 |
||
6498 |
stream := WriteStream on:''. |
|
8512 | 6499 |
alreadyPrinted := Set new. |
6500 |
||
6501 |
imageFiles do:[:eachFile | |
|
6502 |
|eachSet| |
|
6503 |
||
6504 |
(alreadyPrinted includes:eachFile) ifFalse:[ |
|
6505 |
eachSet := similar at:eachFile ifAbsent:nil. |
|
6506 |
eachSet notNil ifTrue:[ |
|
6507 |
stream nextPutLine:eachFile pathName. |
|
6508 |
eachSet do:[:info | |
|
6509 |
|fn2 dist| |
|
6510 |
||
6511 |
fn2 := info key. |
|
6512 |
dist := info value. |
|
6513 |
stream nextPutAll:' '. |
|
6514 |
stream nextPutAll:fn2 pathName. |
|
6515 |
stream nextPutLine:' (',dist printString,')'. |
|
6516 |
alreadyPrinted add:fn2. |
|
6517 |
]. |
|
6518 |
stream cr. |
|
6519 |
]. |
|
8510 | 6520 |
]. |
6521 |
]. |
|
8524
cac6b19eae23
changed #fileFindSimilarImages
Claus Gittinger <cg@exept.de>
parents:
8512
diff
changeset
|
6522 |
]. |
8510 | 6523 |
|
6524 |
textBox := TextBox new. |
|
6525 |
textBox initialText:(stream contents). |
|
6526 |
textBox title:'File similarities:'. |
|
6527 |
textBox readOnly:true. |
|
6528 |
textBox noCancel. |
|
6529 |
||
6530 |
textBox label:'File similarities'. |
|
6531 |
textBox extent:(400@((similar size max:40)* 10)). |
|
6532 |
textBox maxExtent:Screen current extent. |
|
6533 |
textBox openModeless. "/ showAtPointer. |
|
6534 |
||
6535 |
"Modified: / 25-07-2006 / 09:07:25 / cg" |
|
6536 |
! |
|
6537 |
||
4618 | 6538 |
fileHexDump |
6539 |
||
6540 |
| file item| |
|
6541 |
||
6542 |
file := self firstSelectedFile. |
|
6543 |
file notNil ifTrue:[ |
|
6544 |
item := DirectoryContentsBrowser itemClass fileName:file. |
|
5009 | 6545 |
self |
6546 |
applicationNamed:#FileApplicationNoteBook |
|
6547 |
ifPresentDo:[:appl | appl openTextEditorWithHexPresentationOn:item]. |
|
4618 | 6548 |
]. |
6549 |
! |
|
6550 |
||
7324 | 6551 |
fileIn:aFilename |
6552 |
"fileIn a file" |
|
6553 |
||
6554 |
self fileIn:aFilename lazy:false |
|
6555 |
||
6556 |
"Created: / 20-09-2006 / 14:30:06 / cg" |
|
6557 |
! |
|
6558 |
||
6559 |
fileIn:aFilename lazy:lazy |
|
6560 |
"fileIn a file" |
|
6561 |
||
6562 |
self withActivityIndicationDo:[ |
|
6563 |
self notify:('File in:', aFilename asFilename baseName). |
|
6564 |
self singleFileFileIn:aFilename lazy:lazy. |
|
6565 |
self notify:nil. |
|
6566 |
] |
|
6567 |
||
6568 |
"Created: / 20-09-2006 / 14:29:21 / cg" |
|
6569 |
! |
|
6570 |
||
4930 | 6571 |
filterSelectedFiles:whichFilter |
6572 |
|selectedFiles numFiles msg filterBlock| |
|
6573 |
||
7560 | 6574 |
selectedFiles := self currentSelectedObjects. |
4930 | 6575 |
(numFiles := selectedFiles size) == 0 ifTrue:[^ self]. |
6576 |
||
6577 |
msg := 'Replace contents of file ''%2'' with output of %3-filter ?'. |
|
6578 |
numFiles > 1 ifTrue:[ |
|
6579 |
msg := 'Replace contents of %1 files with output of %3-filter ?'. |
|
6580 |
]. |
|
6581 |
||
6582 |
(Dialog |
|
6352 | 6583 |
confirm:(resources stringWithCRs:msg with:numFiles with:selectedFiles first baseName allBold with:whichFilter) |
4930 | 6584 |
initialAnswer:false |
6585 |
) ifFalse:[ |
|
6586 |
^ self |
|
6587 |
]. |
|
6588 |
||
6589 |
whichFilter == #rot13 ifTrue:[ |
|
6590 |
filterBlock := [:charIn | charIn rot13 ]. |
|
6591 |
]. |
|
6592 |
"/ add more here... |
|
6593 |
||
6594 |
filterBlock isNil ifTrue:[ |
|
6595 |
self information:'No such filter: ' , whichFilter. |
|
6596 |
^ self. |
|
6597 |
]. |
|
6598 |
||
6599 |
selectedFiles do:[:fileName | |
|
6600 |
|s| |
|
6601 |
||
6602 |
self notify:('Processing:', fileName baseName). |
|
6603 |
fileName isDirectory ifFalse:[ |
|
6604 |
[ |
|
6605 |
|inFile outFile in out| |
|
6606 |
||
6607 |
inFile := fileName asFilename. |
|
6608 |
outFile := (fileName pathName , '.filter') asFilename. |
|
6609 |
||
6610 |
[ |
|
6611 |
|charIn charOut| |
|
6612 |
||
6613 |
in := inFile readStream. |
|
6614 |
out := outFile writeStream. |
|
6615 |
[in atEnd] whileFalse:[ |
|
6616 |
charIn := in next. |
|
6617 |
charOut := filterBlock value:charIn. |
|
6618 |
out nextPut:charOut. |
|
6619 |
]. |
|
6620 |
outFile renameTo:inFile. |
|
6621 |
] ensure:[ |
|
6622 |
out notNil ifTrue:[ out close ]. |
|
6623 |
in notNil ifTrue:[ in close ]. |
|
6624 |
outFile delete. |
|
6625 |
] |
|
6626 |
] on:FileStream openErrorSignal do:[:ex| |
|
6627 |
self warn:('Cannot process "%1".' bindWith:fileName baseName allBold). |
|
6628 |
]. |
|
6629 |
] |
|
6630 |
]. |
|
6190 | 6631 |
self notify:nil. |
7560 | 6632 |
|
6633 |
"Modified: / 04-12-2006 / 13:14:48 / cg" |
|
4930 | 6634 |
! |
6635 |
||
9784 | 6636 |
forEachParsedXmlFileDo:aBlock |
6637 |
"parse all selected XML files, for each dom-tree, evaluate aBlock" |
|
6638 |
||
6639 |
self withActivityIndicationDo:[ |
|
6640 |
| selectedFiles xmlDocument | |
|
6641 |
||
6642 |
selectedFiles:= self currentSelectedFiles. |
|
6643 |
selectedFiles do:[:fileName | |
|
6644 |
XML::XMLSignal handle:[:ex | |
|
6645 |
Dialog information:('Error while reading XML:\ %1' bindWith:ex description) withCRs. |
|
6646 |
^ self. |
|
6647 |
] do:[ |
|
6648 |
|s d magic encoder document| |
|
6649 |
||
6650 |
s := fileName asFilename readStream. |
|
6651 |
s binary. |
|
6652 |
magic := (s next:2). |
|
6653 |
magic = #[254 255] ifTrue:[ |
|
6654 |
"/ UTF16BE |
|
6655 |
document := CharacterEncoder decodeString:(s upToEnd) from:#utf16be. |
|
6656 |
] ifFalse:[ |
|
6657 |
magic = #[255 254] ifTrue:[ |
|
6658 |
"/ UTF16LE |
|
6659 |
document := CharacterEncoder decodeString:(s upToEnd) from:#utf16le. |
|
6660 |
]. |
|
6661 |
]. |
|
6662 |
s close. |
|
6663 |
||
6664 |
document notNil ifTrue:[ |
|
6665 |
xmlDocument := XML::XMLParser |
|
6666 |
processDocumentString:document |
|
6667 |
beforeScanDo:[:parse| parse validate:false]. |
|
6668 |
] ifFalse:[ |
|
6669 |
xmlDocument := XML::XMLParser |
|
6670 |
processDocumentInFilename:fileName |
|
6671 |
beforeScanDo:[:parse| parse validate:false]. |
|
6672 |
] |
|
6673 |
]. |
|
6674 |
aBlock value:xmlDocument. |
|
6675 |
]. |
|
6676 |
] |
|
6677 |
||
6678 |
"Created: / 17-02-2011 / 13:58:21 / cg" |
|
6679 |
! |
|
6680 |
||
8832 | 6681 |
forEachSelectedFileIgnoringDirectories:ignoreDirs do:aBlock |
6682 |
|numItems path files| |
|
6683 |
||
6684 |
files := self currentSelectedFiles. |
|
6685 |
||
6686 |
(numItems := files size) > 2 ifTrue:[ |
|
6687 |
(self |
|
6688 |
confirm:(resources string:'Open for each of the %1 items ?' |
|
6689 |
with:numItems)) ifFalse:[^ self]. |
|
6690 |
]. |
|
6691 |
||
6692 |
self withActivityIndicationDo:[ |
|
6693 |
files do:[:fileName | |
|
6694 |
(ignoreDirs not or:[fileName isDirectory not]) ifTrue:[ |
|
6695 |
fileName isAbsolute ifTrue:[ |
|
6696 |
path := fileName getName. |
|
6697 |
] ifFalse:[ |
|
6698 |
path := fileName pathName. |
|
6699 |
]. |
|
6700 |
aBlock value:path |
|
6701 |
] |
|
6702 |
]. |
|
6703 |
]. |
|
6704 |
! |
|
6705 |
||
8648
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
6706 |
generateDetachedSignaturesForSelectedFiles |
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
6707 |
"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
|
6708 |
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
|
6709 |
|
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
6710 |
self withActivityIndicationDo:[ |
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
6711 |
self currentSelectedFiles do:[:fn | |
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
6712 |
|data hash signature signatureFile| |
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
6713 |
|
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
6714 |
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
|
6715 |
|
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
6716 |
data := fn contentsAsString. |
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
6717 |
hash := SHA1Stream hashValueOf:data. |
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
6718 |
|
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
6719 |
signature := Expecco::KeyFileGenerator new signExpeccoCode:hash. |
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
6720 |
|
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
6721 |
signatureFile := fn addSuffix:'sig'. |
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
6722 |
signatureFile contents:signature. |
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
6723 |
]. |
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
6724 |
self notify:nil. |
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
6725 |
] |
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
6726 |
! |
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
6727 |
|
8640
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
6728 |
generateSignaturesForSelectedFiles |
8645
00e4d07c6d6d
Generate signed expecco patch files
Stefan Vogel <sv@exept.de>
parents:
8641
diff
changeset
|
6729 |
"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
|
6730 |
|
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
6731 |
self withActivityIndicationDo:[ |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
6732 |
self currentSelectedFiles do:[:fn | |
8645
00e4d07c6d6d
Generate signed expecco patch files
Stefan Vogel <sv@exept.de>
parents:
8641
diff
changeset
|
6733 |
|pkcs7SignedData signatureFilename| |
00e4d07c6d6d
Generate signed expecco patch files
Stefan Vogel <sv@exept.de>
parents:
8641
diff
changeset
|
6734 |
|
8646 | 6735 |
self notify:'Generating signed file from: ', (fn baseName), '...'. |
8645
00e4d07c6d6d
Generate signed expecco patch files
Stefan Vogel <sv@exept.de>
parents:
8641
diff
changeset
|
6736 |
|
00e4d07c6d6d
Generate signed expecco patch files
Stefan Vogel <sv@exept.de>
parents:
8641
diff
changeset
|
6737 |
pkcs7SignedData := Expecco::KeyFileGenerator new signExpeccoCode:fn contentsOfEntireFile. |
8646 | 6738 |
signatureFilename := fn addSuffix:'signed'. |
8645
00e4d07c6d6d
Generate signed expecco patch files
Stefan Vogel <sv@exept.de>
parents:
8641
diff
changeset
|
6739 |
signatureFilename contents:pkcs7SignedData. |
8640
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
6740 |
]. |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
6741 |
self notify:nil. |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
6742 |
] |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
6743 |
! |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
6744 |
|
9784 | 6745 |
inspectXmlFile |
6746 |
"Show an XML file - either in an XMLInspector or fall back to |
|
6747 |
a plain inspector on the XML tree" |
|
6748 |
||
6749 |
self forEachParsedXmlFileDo:[:xmlDocument | |
|
6750 |
XML::XMLInspector notNil ifTrue:[ |
|
6751 |
XML::XMLInspector openOn:xmlDocument. |
|
6752 |
] ifFalse:[ |
|
6753 |
"fall back..." |
|
6754 |
xmlDocument inspect. |
|
6755 |
] |
|
6756 |
]. |
|
6757 |
||
6758 |
"Modified: / 17-02-2011 / 13:58:16 / cg" |
|
6759 |
! |
|
6760 |
||
3892 | 6761 |
installAllAsAutoloaded |
6762 |
"install all classes found here as autoloaded classes" |
|
6763 |
||
9674
3c3c1ef9974b
added: #installAllAsAutoloadedRecursive:
Claus Gittinger <cg@exept.de>
parents:
9649
diff
changeset
|
6764 |
self installAllAsAutoloadedRecursive:false |
3892 | 6765 |
! |
6766 |
||
6521 | 6767 |
installAllAsAutoloadedRecursive |
6768 |
"install all classes found here and in subdirectories as autoloaded classes" |
|
6769 |
||
9674
3c3c1ef9974b
added: #installAllAsAutoloadedRecursive:
Claus Gittinger <cg@exept.de>
parents:
9649
diff
changeset
|
6770 |
self installAllAsAutoloadedRecursive:true |
3c3c1ef9974b
added: #installAllAsAutoloadedRecursive:
Claus Gittinger <cg@exept.de>
parents:
9649
diff
changeset
|
6771 |
! |
3c3c1ef9974b
added: #installAllAsAutoloadedRecursive:
Claus Gittinger <cg@exept.de>
parents:
9649
diff
changeset
|
6772 |
|
3c3c1ef9974b
added: #installAllAsAutoloadedRecursive:
Claus Gittinger <cg@exept.de>
parents:
9649
diff
changeset
|
6773 |
installAllAsAutoloadedRecursive:aBoolean |
3c3c1ef9974b
added: #installAllAsAutoloadedRecursive:
Claus Gittinger <cg@exept.de>
parents:
9649
diff
changeset
|
6774 |
"install all classes found here (and in subdirs if aBoolean is true) as autoloaded classes" |
3c3c1ef9974b
added: #installAllAsAutoloadedRecursive:
Claus Gittinger <cg@exept.de>
parents:
9649
diff
changeset
|
6775 |
|
6521 | 6776 |
[ |
9674
3c3c1ef9974b
added: #installAllAsAutoloadedRecursive:
Claus Gittinger <cg@exept.de>
parents:
9649
diff
changeset
|
6777 |
|installAction| |
3c3c1ef9974b
added: #installAllAsAutoloadedRecursive:
Claus Gittinger <cg@exept.de>
parents:
9649
diff
changeset
|
6778 |
|
3c3c1ef9974b
added: #installAllAsAutoloadedRecursive:
Claus Gittinger <cg@exept.de>
parents:
9649
diff
changeset
|
6779 |
installAction := |
3c3c1ef9974b
added: #installAllAsAutoloadedRecursive:
Claus Gittinger <cg@exept.de>
parents:
9649
diff
changeset
|
6780 |
[:fn | |
3c3c1ef9974b
added: #installAllAsAutoloadedRecursive:
Claus Gittinger <cg@exept.de>
parents:
9649
diff
changeset
|
6781 |
(fn suffix = 'st') ifTrue:[ |
3c3c1ef9974b
added: #installAllAsAutoloadedRecursive:
Claus Gittinger <cg@exept.de>
parents:
9649
diff
changeset
|
6782 |
self notify:('Install as autoloaded: ', fn baseName). |
3c3c1ef9974b
added: #installAllAsAutoloadedRecursive:
Claus Gittinger <cg@exept.de>
parents:
9649
diff
changeset
|
6783 |
self installAsAutoloaded:fn. |
3c3c1ef9974b
added: #installAllAsAutoloadedRecursive:
Claus Gittinger <cg@exept.de>
parents:
9649
diff
changeset
|
6784 |
] |
3c3c1ef9974b
added: #installAllAsAutoloadedRecursive:
Claus Gittinger <cg@exept.de>
parents:
9649
diff
changeset
|
6785 |
]. |
3c3c1ef9974b
added: #installAllAsAutoloadedRecursive:
Claus Gittinger <cg@exept.de>
parents:
9649
diff
changeset
|
6786 |
|
6521 | 6787 |
self withActivityIndicationDo:[ |
6725 | 6788 |
self currentSelectedDirectories do:[:dir| |
9674
3c3c1ef9974b
added: #installAllAsAutoloadedRecursive:
Claus Gittinger <cg@exept.de>
parents:
9649
diff
changeset
|
6789 |
aBoolean ifTrue:[ |
9675
704831da3132
changed: #installAllAsAutoloadedRecursive:
Claus Gittinger <cg@exept.de>
parents:
9674
diff
changeset
|
6790 |
dir recursiveDirectoryContentsAsFilenamesDo:installAction |
9674
3c3c1ef9974b
added: #installAllAsAutoloadedRecursive:
Claus Gittinger <cg@exept.de>
parents:
9649
diff
changeset
|
6791 |
] ifFalse:[ |
3c3c1ef9974b
added: #installAllAsAutoloadedRecursive:
Claus Gittinger <cg@exept.de>
parents:
9649
diff
changeset
|
6792 |
dir directoryContentsAsFilenamesDo:installAction |
3c3c1ef9974b
added: #installAllAsAutoloadedRecursive:
Claus Gittinger <cg@exept.de>
parents:
9649
diff
changeset
|
6793 |
]. |
6521 | 6794 |
]. |
6795 |
self notify:nil. |
|
6796 |
] |
|
6797 |
] fork. |
|
6798 |
! |
|
6799 |
||
3892 | 6800 |
installAsAutoloaded:aFilename |
6801 |
"install aFilename as autoloaded class" |
|
6802 |
||
9455 | 6803 |
|chunks filename| |
5971
af337e1a857f
Use #setFilename:forClass:package: to define an abbreviation
Stefan Vogel <sv@exept.de>
parents:
5967
diff
changeset
|
6804 |
|
af337e1a857f
Use #setFilename:forClass:package: to define an abbreviation
Stefan Vogel <sv@exept.de>
parents:
5967
diff
changeset
|
6805 |
filename := aFilename asFilename. |
af337e1a857f
Use #setFilename:forClass:package: to define an abbreviation
Stefan Vogel <sv@exept.de>
parents:
5967
diff
changeset
|
6806 |
|
9455 | 6807 |
filename readingFileDo:[:s| |
6808 |
chunks := ChangeSet fromStream:s. |
|
6809 |
]. |
|
3892 | 6810 |
chunks |
4414 | 6811 |
select:[:eachChunk | eachChunk isClassDefinitionChange] |
5971
af337e1a857f
Use #setFilename:forClass:package: to define an abbreviation
Stefan Vogel <sv@exept.de>
parents:
5967
diff
changeset
|
6812 |
thenDo:[:eachClassChunk | |
8039
732cbc4ea214
keep absolute-pathname including suffix as classFilename
Claus Gittinger <cg@exept.de>
parents:
8013
diff
changeset
|
6813 |
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
|
6814 |
]. |
3892 | 6815 |
! |
6816 |
||
4558 | 6817 |
joinSelectedFiles |
6264 | 6818 |
|selectedFiles numFiles msg outFileName outFile outStream| |
4558 | 6819 |
|
7560 | 6820 |
selectedFiles := self currentSelectedObjects. |
4558 | 6821 |
(numFiles := selectedFiles size) <= 1 ifTrue:[^ self]. |
6822 |
||
6823 |
msg := 'Join each of the %1 files into single file named:\\Attention: order in which files were selected is relevant here !!'. |
|
6352 | 6824 |
outFileName := Dialog request:(resources stringWithCRs:msg with:numFiles with:selectedFiles first baseName). |
6264 | 6825 |
outFileName isEmptyOrNil ifTrue:[^ self]. |
6826 |
outFile := selectedFiles first directory construct:outFileName. |
|
4558 | 6827 |
|
6828 |
outStream := outFile writeStream. |
|
6829 |
||
6830 |
selectedFiles do:[:fileName | |
|
6831 |
|inStream| |
|
6832 |
||
6833 |
self notify:('Adding:', fileName baseName). |
|
6834 |
inStream := fileName readStream. |
|
6835 |
inStream copyToEndInto:outStream. |
|
6836 |
inStream close. |
|
6837 |
]. |
|
6838 |
outStream close. |
|
6190 | 6839 |
self notify:nil. |
7560 | 6840 |
|
6841 |
"Modified: / 04-12-2006 / 13:15:10 / cg" |
|
4558 | 6842 |
! |
6843 |
||
6292 | 6844 |
loadImageThenDo:aBlock |
3892 | 6845 |
|img path files| |
6846 |
||
3982 | 6847 |
files := self currentSelectedFiles. |
3892 | 6848 |
files isEmpty ifTrue:[ ^ self]. |
6849 |
files do:[:fileName | |
|
4414 | 6850 |
path := fileName. |
6851 |
path isDirectory ifFalse:[ |
|
6852 |
img := Image fromFile:(path pathName). |
|
6853 |
img notNil ifTrue:[ |
|
6292 | 6854 |
aBlock value:img |
4414 | 6855 |
] ifFalse:[ |
6292 | 6856 |
Dialog warn:'Unknown format: ' , fileName asString |
4414 | 6857 |
] |
6858 |
] |
|
3892 | 6859 |
]. |
6860 |
! |
|
6861 |
||
6862 |
openASN1Browser |
|
6863 |
||
6864 |
self openTool:OSI::ASN1Browser |
|
6865 |
! |
|
6866 |
||
6867 |
openAppletViewer |
|
6868 |
|numItems files| |
|
6869 |
||
3982 | 6870 |
files := self currentSelectedFiles. |
3892 | 6871 |
(numItems := files size) > 2 ifTrue:[ |
4414 | 6872 |
(self |
6873 |
confirm:(resources string:'open for each of the %1 items ?' |
|
6874 |
with:numItems)) ifFalse:[^ self]. |
|
3892 | 6875 |
]. |
6876 |
||
6877 |
Java startupJavaSystem. |
|
6878 |
"/ Java markAllClassesUninitialized. |
|
6879 |
"/ Java initAllStaticFields. |
|
6880 |
"/ Java initAllClasses. |
|
6881 |
||
6882 |
files do:[:fileName | |
|
4414 | 6883 |
|p path| |
6884 |
||
6885 |
path := fileName. |
|
6886 |
path isDirectory ifFalse:[ |
|
6887 |
p := Java |
|
6888 |
javaProcessForMainOf:(Java classForName:'sun.applet.AppletViewer') |
|
6889 |
argumentString:path pathName. |
|
6890 |
p resume. |
|
6891 |
] |
|
3892 | 6892 |
]. |
6893 |
! |
|
6894 |
||
6895 |
openCBrowser |
|
6031 | 6896 |
|dir files| |
5880 | 6897 |
|
6898 |
dir := self theSingleSelectedDirectoryOrNil. |
|
6899 |
dir isNil ifTrue:[ ^ self]. |
|
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
6900 |
self withActivityIndicationDo:[ |
7560 | 6901 |
files := self currentSelectedObjects. |
6031 | 6902 |
files notEmptyOrNil ifTrue:[ |
6903 |
CBrowser::Browser openOn:files first. |
|
6904 |
] ifFalse:[ |
|
6905 |
CBrowser::Browser openIn:dir. |
|
6906 |
] |
|
3892 | 6907 |
] |
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
6908 |
|
7560 | 6909 |
"Modified: / 04-12-2006 / 13:15:19 / cg" |
3892 | 6910 |
! |
6911 |
||
4230 | 6912 |
openChangeSetBrowser |
6913 |
self |
|
6914 |
openTool:ChangeSetBrowser |
|
6915 |
with:#openOnFile: |
|
6916 |
ignoreDirectories:true |
|
6917 |
! |
|
6918 |
||
3892 | 6919 |
openChangesBrowser |
6920 |
"open a change browser on the selected file(s)" |
|
6921 |
||
6922 |
self openTool:(UserPreferences current changesBrowserClass) |
|
6923 |
! |
|
6924 |
||
6925 |
openDiffView |
|
6926 |
"open a diff-view" |
|
6927 |
||
6388 | 6928 |
|name1 name2 text1 text2 d err nm l1 files title |
11052 | 6929 |
defaultName defaultDir lastFile sameContents msg| |
6460 | 6930 |
|
6931 |
files := self currentSelectedObjects. |
|
3892 | 6932 |
files isEmpty ifTrue:[ |
6460 | 6933 |
Dialog warn:(resources string:'You have to select a file first'). |
4414 | 6934 |
^ self. |
3892 | 6935 |
]. |
8287
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6936 |
|
3892 | 6937 |
(files size == 2) ifTrue:[ |
4414 | 6938 |
name1 := files last. |
6939 |
name2 := files first. |
|
3892 | 6940 |
] ifFalse:[ |
4414 | 6941 |
LastFileDiffFile notNil ifTrue:[ |
11052 | 6942 |
LastFileDiffFile exists ifTrue:[ |
6943 |
name1 := LastFileDiffFile. |
|
6944 |
]. |
|
6945 |
"/ | directory | |
|
6946 |
"/ directory := self currentDirectory. |
|
6947 |
"/ directory notNil ifTrue:[ |
|
6948 |
"/ lastFile := directory asFilename construct:(LastFileDiffFile baseName). |
|
6949 |
"/ (lastFile exists and:[lastFile isReadable]) ifTrue:[ |
|
6950 |
"/ name1 := lastFile. |
|
6951 |
"/ ] |
|
6952 |
"/ ] |
|
4414 | 6953 |
]. |
6954 |
name2 := files first. |
|
6460 | 6955 |
title := resources string:'Show differences between "%1" and:' with:name2 baseName. |
4414 | 6956 |
defaultName := name1 notNil ifTrue:[name1 baseName] ifFalse:[nil]. |
11052 | 6957 |
defaultDir := name1 notNil ifTrue:[name1 directory] ifFalse:[self currentDirectory]. |
4414 | 6958 |
name1 := DialogBox |
6959 |
requestFileName:title |
|
6960 |
default:defaultName |
|
6460 | 6961 |
ok:(resources string:'OK') |
6962 |
abort:(resources string:'Compare against File List') |
|
4414 | 6963 |
pattern:'*' |
11052 | 6964 |
fromDirectory:defaultDir. |
3892 | 6965 |
]. |
6966 |
||
8287
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6967 |
self withWaitCursorDo:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6968 |
(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
|
6969 |
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
|
6970 |
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
|
6971 |
name1 := nil. |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6972 |
l1 := 'browser contents' |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6973 |
] ifFalse:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6974 |
name1 := name1 asFilename. |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6975 |
LastFileDiffFile := name1. |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6976 |
name1 isReadable ifFalse:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6977 |
nm := name1. |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6978 |
name1 exists ifFalse:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6979 |
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
|
6980 |
] ifTrue:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6981 |
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
|
6982 |
]. |
4414 | 6983 |
]. |
8287
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6984 |
l1 := name1 pathName |
4414 | 6985 |
]. |
8287
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6986 |
|
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6987 |
err isNil ifTrue:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6988 |
name2 isReadable ifFalse:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6989 |
nm := name2. |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6990 |
name2 exists ifFalse:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6991 |
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
|
6992 |
] ifTrue:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6993 |
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
|
6994 |
]. |
4414 | 6995 |
]. |
6996 |
]. |
|
8287
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6997 |
err notNil ifTrue:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
6998 |
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
|
6999 |
^ self |
6176 | 7000 |
]. |
7001 |
||
8287
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7002 |
self withActivityIndicationDo:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7003 |
((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
|
7004 |
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
|
7005 |
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
|
7006 |
ProgressIndicator |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7007 |
displayBusyIndicator:'Comparing...' |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7008 |
at:(Screen default center) |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7009 |
during:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7010 |
sameContents := (name1 sameContentsAs:name2). |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7011 |
]. |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7012 |
sameContents ifTrue:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7013 |
self information:'Same contents.' |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7014 |
] ifFalse:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7015 |
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
|
7016 |
]. |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7017 |
] ifFalse:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7018 |
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
|
7019 |
]. |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7020 |
^ self. |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7021 |
]. |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7022 |
|
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7023 |
name1 notNil ifTrue:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7024 |
name1 isDirectory ifTrue:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7025 |
text1 := name1 directoryContents asString. |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7026 |
] ifFalse:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7027 |
text1 := name1 contents. |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7028 |
] |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7029 |
]. |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7030 |
name2 isDirectory ifTrue:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7031 |
text2 := name2 directoryContents asString. |
6460 | 7032 |
] ifFalse:[ |
8287
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7033 |
text2 := name2 contents. |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7034 |
]. |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7035 |
text1 = text2 ifTrue:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7036 |
(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
|
7037 |
msg := 'Same filename lists.' |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7038 |
] ifFalse:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7039 |
msg := 'Same contents.' |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7040 |
]. |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7041 |
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
|
7042 |
] ifFalse:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7043 |
d := DiffTextView |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7044 |
openOn:text1 label:l1 |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7045 |
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
|
7046 |
d topView label:(resources string:'File Differences'). |
6460 | 7047 |
] |
4414 | 7048 |
] |
3892 | 7049 |
] |
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
7050 |
|
11052 | 7051 |
"Modified: / 05-01-2012 / 14:26:20 / cg" |
3892 | 7052 |
! |
7053 |
||
9496
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
7054 |
openDirectoryDiffView |
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
7055 |
"open a directory diff-view" |
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
7056 |
|
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
7057 |
|name1 name2 files| |
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
7058 |
|
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
7059 |
files := self currentSelectedObjects. |
11108 | 7060 |
files notEmpty ifTrue:[ |
7061 |
name1 := files first asFilename. |
|
7062 |
name1 asFilename isDirectory ifFalse:[ |
|
7063 |
name1 := name1 directory |
|
7064 |
]. |
|
7065 |
]. |
|
7066 |
||
7067 |
(files size == 2) ifTrue:[ |
|
7068 |
name2 := files second. |
|
7069 |
] ifFalse:[ |
|
7070 |
(files size ~= 1) ifTrue:[ |
|
7071 |
Dialog warn:(resources string:'Please select one or two directories.'). |
|
7072 |
^ self. |
|
7073 |
]. |
|
7074 |
name2 := Dialog |
|
7075 |
requestDirectoryName:(resources |
|
7076 |
string:'Recursive compare "%1" with folder:' |
|
7077 |
with:name1 asFilename baseName) |
|
7078 |
default:(LastFileDiffDirectory ? self currentDirectory). |
|
7079 |
name2 isEmptyOrNil ifTrue:[^ self]. |
|
7080 |
LastFileDiffDirectory := name2. |
|
7081 |
]. |
|
7082 |
name2 := name2 asFilename. |
|
7083 |
||
7084 |
name2 asFilename isDirectory ifFalse:[ |
|
7085 |
name2 := name2 directory |
|
7086 |
]. |
|
7087 |
||
7088 |
self |
|
7089 |
applicationNamed:#FileApplicationNoteBook |
|
7090 |
ifPresentDo:[:appl | ^ appl openCompareDirectory:name1 with:name2]. |
|
9496
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
7091 |
|
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
7092 |
"Created: / 20-05-2010 / 15:01:17 / cg" |
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
7093 |
! |
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
7094 |
|
3892 | 7095 |
openEditor |
7096 |
self openTool:EditTextView |
|
7097 |
! |
|
7098 |
||
4957 | 7099 |
openGV |
7100 |
self openOSCommandWithFiles:'gv' |
|
7101 |
! |
|
7102 |
||
3892 | 7103 |
openHTMLReader |
7104 |
||
7105 |
self openTool:HTMLDocumentView ignoreDirectories:false |
|
7106 |
! |
|
7107 |
||
7108 |
openImageEditor |
|
6292 | 7109 |
[ |
7110 |
self loadImageThenDo:[:img | img edit] |
|
7111 |
] fork |
|
3892 | 7112 |
! |
7113 |
||
7114 |
openImageInspector |
|
6292 | 7115 |
[ |
7116 |
self loadImageThenDo:[:img | img inspect] |
|
7117 |
] fork |
|
3892 | 7118 |
! |
7119 |
||
7120 |
openImagePreview |
|
5778 | 7121 |
[ |
7122 |
self |
|
6292 | 7123 |
loadImageThenDo: |
5778 | 7124 |
[:img | |
7125 |
|i top viewer| |
|
7126 |
||
7127 |
top := StandardSystemView new. |
|
7128 |
||
7129 |
viewer := ImageView origin:0.0@0.0 corner:1.0@1.0 in:top. |
|
7130 |
i := img. |
|
7131 |
top extent:200@200. |
|
7132 |
top label:(img fileName asFilename directory baseName , Filename separator , img fileName asFilename baseName). |
|
7133 |
top openAndWait. |
|
7134 |
||
7135 |
(i width > 200 or:[i height > 200]) ifTrue:[ |
|
7136 |
i := i magnifiedPreservingRatioTo:200@200. |
|
7137 |
]. |
|
7138 |
viewer image:i. |
|
7139 |
]. |
|
3892 | 7140 |
] fork |
7141 |
! |
|
7142 |
||
7143 |
openMP3Player |
|
7144 |
|file| |
|
7145 |
||
3982 | 7146 |
file := self currentSelectedFiles. |
3892 | 7147 |
(file isEmpty) ifTrue:[ |
4414 | 7148 |
^ self. |
3892 | 7149 |
]. |
7150 |
file := file first. |
|
7151 |
(MP3PlayerApplication ? SaugFix::MP3PlayerApplication) playSong:file. |
|
7152 |
! |
|
7153 |
||
4957 | 7154 |
openOSCommandWithFiles:command |
7155 |
|files fileNames| |
|
7156 |
||
7157 |
files := self currentSelectedFiles. |
|
7158 |
(files isEmpty) ifTrue:[ |
|
7159 |
^ self. |
|
7160 |
]. |
|
7161 |
||
7162 |
fileNames := files collect:[:each | |
|
7163 |
'"' , each asFilename pathName , '"' |
|
7164 |
]. |
|
7165 |
||
7166 |
[ |
|
7167 |
OperatingSystem |
|
4959 | 7168 |
executeCommand:command , ' ' , fileNames asStringCollection asString |
7169 |
inDirectory:(files first asFilename directory). |
|
4957 | 7170 |
] fork |
7171 |
! |
|
7172 |
||
4820 | 7173 |
openPDFViewer |
5836
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
7174 |
|files fileNames cmd arg| |
4820 | 7175 |
|
7176 |
files := self currentSelectedFiles. |
|
7177 |
(files isEmpty) ifTrue:[ |
|
7178 |
^ self. |
|
7179 |
]. |
|
5836
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
7180 |
cmd := MIMETypes defaultCommandForMimeType:'application/pdf'. |
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
7181 |
cmd isNil ifTrue:[ |
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
7182 |
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
|
7183 |
^ self. |
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
7184 |
]. |
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
7185 |
|
4820 | 7186 |
fileNames := |
7187 |
files |
|
7188 |
collect: |
|
7189 |
[:each | |
|
7190 |
'"' , each asFilename pathName , '"' |
|
7191 |
]. |
|
5836
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
7192 |
arg := fileNames asStringCollection asStringWith:' '. |
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
7193 |
|
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
7194 |
(cmd includesString:'"%1"') ifTrue:[ |
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
7195 |
cmd := cmd copyReplaceString:'"%1"' withString:'%1' |
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
7196 |
]. |
4820 | 7197 |
|
4950 | 7198 |
[ |
5836
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
7199 |
OperatingSystem executeCommand:(cmd bindWith:arg). |
4950 | 7200 |
] fork |
5836
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
7201 |
|
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
7202 |
"Modified: / 12-05-2004 / 12:31:20 / cg" |
4820 | 7203 |
! |
7204 |
||
4958 | 7205 |
openRP |
7206 |
self openOSCommandWithFiles:'realplay' |
|
7207 |
! |
|
7208 |
||
8426 | 7209 |
openResourceFileEditor |
7210 |
||
7211 |
self |
|
7212 |
openTool: Tools::InternationalLanguageTranslationEditor |
|
7213 |
with: #openOnFile: |
|
7214 |
! |
|
7215 |
||
3892 | 7216 |
openSlideShow |
5880 | 7217 |
|dir| |
7218 |
||
7219 |
dir := self theSingleSelectedDirectoryOrNil. |
|
7220 |
dir isNil ifTrue:[^ self]. |
|
7221 |
||
3892 | 7222 |
CodingExamples_GUI::SlideShow openIn:dir. |
7223 |
! |
|
7224 |
||
7225 |
openSnapshotImageBrowser |
|
4491 | 7226 |
"Sorry, for now, only the old browser can handle snapShotImages." |
7227 |
||
3892 | 7228 |
^ self openTool:SystemBrowser with:#openOnSnapShotImage: ignoreDirectories:true |
7229 |
! |
|
7230 |
||
7231 |
openTerminal |
|
5880 | 7232 |
|dir| |
7233 |
||
7234 |
dir := self theSingleSelectedDirectoryOrHomeDir. |
|
3892 | 7235 |
|
5300 | 7236 |
TerminalApplication notNil ifTrue:[ |
7237 |
TerminalApplication openIn:dir |
|
7238 |
] ifFalse:[ |
|
7239 |
VT100TerminalView openShellIn:dir. |
|
7240 |
]. |
|
3892 | 7241 |
! |
7242 |
||
7243 |
openTool:aToolClass |
|
7244 |
"open a tool on the selected file(s)" |
|
7245 |
||
7246 |
^ self openTool:aToolClass ignoreDirectories:true |
|
7247 |
! |
|
7248 |
||
7249 |
openTool:aToolClass ignoreDirectories:ignoreDirs |
|
7250 |
"open a tool on the selected file(s)" |
|
7251 |
||
7252 |
^ self |
|
4414 | 7253 |
openTool:aToolClass |
7254 |
with:#openOn: |
|
7255 |
ignoreDirectories:ignoreDirs |
|
3892 | 7256 |
! |
7257 |
||
8426 | 7258 |
openTool:aToolClass with:aSelector |
7259 |
"open a tool on the selected file(s)" |
|
7260 |
||
7261 |
^ self openTool:aToolClass with:aSelector ignoreDirectories:true |
|
7262 |
! |
|
7263 |
||
3892 | 7264 |
openTool:aToolClass with:aSelector ignoreDirectories:ignoreDirs |
7265 |
"open a tool on the selected file(s)" |
|
7266 |
||
8832 | 7267 |
|tool| |
3892 | 7268 |
|
7269 |
aToolClass isNil ifTrue:[ |
|
4414 | 7270 |
Dialog warn:'Sorry, that tool seems to be not available'. |
7271 |
^ nil. |
|
3892 | 7272 |
]. |
8832 | 7273 |
self forEachSelectedFileIgnoringDirectories:ignoreDirs do:[:path | |
7274 |
tool := aToolClass perform:aSelector with:path. |
|
3892 | 7275 |
]. |
7276 |
^ tool |
|
8832 | 7277 |
! |
7278 |
||
7279 |
openWebBrowser |
|
9343
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
7280 |
self |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
7281 |
forEachSelectedFileIgnoringDirectories:true |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
7282 |
do:[:path | |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
7283 |
Error |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
7284 |
handle:[:ex | |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
7285 |
Dialog warn:'Shell execution failed: ',ex description |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
7286 |
] do:[ |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
7287 |
OperatingSystem openApplicationForDocument:path operation:#open. |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
7288 |
^ self. |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
7289 |
] |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
7290 |
]. |
3892 | 7291 |
! |
7292 |
||
6022 | 7293 |
openWorkspace |
7294 |
self |
|
7295 |
openTool:WorkspaceApplication |
|
7296 |
with:#openOnFile: |
|
7297 |
ignoreDirectories:true |
|
7298 |
! |
|
7299 |
||
4950 | 7300 |
openXV |
4957 | 7301 |
self openOSCommandWithFiles:'xv' |
4950 | 7302 |
! |
7303 |
||
3892 | 7304 |
openZipTool |
5880 | 7305 |
|zipTool| |
3892 | 7306 |
|
7307 |
(zipTool := self openTool:ZipTool) notNil ifTrue:[ |
|
5880 | 7308 |
zipTool initialExtractDirectory:(self theSingleSelectedDirectoryOrHomeDir). |
3892 | 7309 |
]. |
7310 |
! |
|
7311 |
||
7312 |
readAbbrevFile |
|
7313 |
"read the abbrev file and install classes found there as autoloaded classes" |
|
7314 |
||
5880 | 7315 |
|directories| |
3892 | 7316 |
|
3982 | 7317 |
directories := self currentSelectedDirectories. |
3892 | 7318 |
directories isEmpty ifTrue:[^ self]. |
7319 |
||
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
7320 |
self withActivityIndicationDo:[ |
5880 | 7321 |
directories do:[:eachDir | |
7322 |
Smalltalk installAutoloadedClassesFrom:(eachDir construct:'abbrev.stc'). |
|
7323 |
] |
|
5828 | 7324 |
] |
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
7325 |
|
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
7326 |
"Modified: / 25-07-2006 / 09:07:43 / cg" |
3892 | 7327 |
! |
7328 |
||
6460 | 7329 |
readAndShowResources |
7330 |
self withActivityIndicationDo:[ |
|
7331 |
| selectedFiles| |
|
7332 |
||
7333 |
selectedFiles:= self currentSelectedFiles. |
|
7334 |
selectedFiles do:[:fileName | |
|
7335 |
resources := ResourcePack fromFile:fileName. |
|
7336 |
resources inspect. |
|
7337 |
]. |
|
7338 |
] |
|
7339 |
! |
|
7340 |
||
3892 | 7341 |
singleFileFileIn:fileName lazy:lazy |
7342 |
"fileIn the selected file(s)" |
|
7343 |
||
9299
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
7344 |
|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
|
7345 |
|
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
7346 |
fileName isRegularFile ifFalse:[ |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
7347 |
^ self. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
7348 |
]. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
7349 |
|
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
7350 |
[ |
4345 | 7351 |
(ObjectFileLoader notNil |
5491 | 7352 |
and:[ObjectFileLoader hasValidBinaryExtension:fileName]) ifTrue:[ |
4345 | 7353 |
AbortOperationRequest catch:[ |
7354 |
|p| |
|
7355 |
||
7356 |
"/ |
|
7357 |
"/ look if already loaded ... then unload first |
|
7358 |
"/ |
|
7359 |
p := fileName pathName. |
|
7360 |
(ObjectFileLoader loadedObjectFiles includes:p) ifTrue:[ |
|
7361 |
(Dialog confirm:(resources |
|
7362 |
string:'%1 is already loaded; load anyway ?' |
|
7363 |
with:p)) ifFalse:[ |
|
7364 |
^ self |
|
7365 |
]. |
|
7366 |
notifyString := 'unloading old ' , p , ' ...'. |
|
7367 |
Transcript showCR:notifyString. |
|
4523 | 7368 |
self notify:notifyString. |
4345 | 7369 |
ObjectFileLoader unloadObjectFile:p. |
7370 |
]. |
|
7371 |
||
7372 |
notifyString := 'loading ' , p , ' ...'. |
|
7373 |
Transcript showCR:notifyString. |
|
4523 | 7374 |
self notify:notifyString. |
4345 | 7375 |
ObjectFileLoader loadObjectFile:p. |
7376 |
Class addInfoRecord:('fileIn ' , fileName asFilename pathName) |
|
7377 |
] |
|
7378 |
] ifFalse:[ ((fileName hasSuffix:'cls') |
|
7379 |
and:[((fileName mimeTypeOfContents ? '') startsWith:'application/x-smalltalk-source') not ]) ifTrue:[ |
|
7380 |
"/ loading a binary class file |
|
4636
08b2b63e3107
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4629
diff
changeset
|
7381 |
aStream := fileName readStreamOrNil. |
4345 | 7382 |
aStream notNil ifTrue:[ |
7383 |
aStream fileInBinary. |
|
7384 |
] |
|
7385 |
] ifFalse:[ |
|
9299
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
7386 |
((fileName hasSuffix:'class') or:[(fileName hasSuffix:'cla')]) ifTrue:[ |
4345 | 7387 |
"/ loading a java class file |
7388 |
JavaClassReader notNil ifTrue:[ |
|
5491 | 7389 |
JavaClassReader loadFile:fileName |
4345 | 7390 |
] |
7391 |
] ifFalse:[ (fileName hasSuffix:'sif') ifTrue:[ |
|
7392 |
"/ loading a sif (smalltalk interchange format) file |
|
7393 |
SmalltalkInterchangeSTXFileInManager autoload. |
|
7394 |
SmalltalkInterchangeFileManager newForFileIn |
|
7395 |
fileName: fileName pathName; |
|
7396 |
fileIn. |
|
7397 |
] ifFalse:[ (fileName hasSuffix:'pcl') ifTrue:[ |
|
7398 |
Parcel isNil ifTrue:[ |
|
7399 |
Dialog warn:'Parcel support not loaded.' |
|
7400 |
] ifFalse:[ |
|
7401 |
Parcel loadParcelFrom: fileName pathName |
|
7402 |
] |
|
7403 |
] ifFalse:[ |
|
9299
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
7404 |
"/ ask programming languages... |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
7405 |
lang := ProgrammingLanguage allDetect:[:l | l canReadSourceFile:fileName] ifNone:nil. |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
7406 |
(lang notNil and:[lang ~= SmalltalkLanguage]) ifTrue:[ |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
7407 |
lang fileIn:fileName. |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
7408 |
] ifFalse:[ |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
7409 |
"/ loading a regular (chunk) or xml source file |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
7410 |
Error handle:[:ex | |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
7411 |
self errorNotify:'Error on file in: ', ex description. |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
7412 |
] do:[ |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
7413 |
aStream := fileName readStream. |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
7414 |
[ |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
7415 |
Class withoutUpdatingChangesDo:[ |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
7416 |
wasLazy := Compiler compileLazy:lazy. |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
7417 |
Smalltalk fileInStream:aStream. |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
7418 |
]. |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
7419 |
Class addInfoRecord:('fileIn ' , fileName asString) |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
7420 |
] ensure:[ |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
7421 |
Compiler compileLazy:wasLazy. |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
7422 |
aStream close |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
7423 |
] |
4345 | 7424 |
] |
7425 |
] |
|
9299
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
7426 |
]]] |
4345 | 7427 |
]] |
6281
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
7428 |
] 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
|
7429 |
|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
|
7430 |
|
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
7431 |
isRedef := false. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
7432 |
sig := ex signal. |
10887
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7433 |
(dontAskSignals notNil and:[dontAskSignals includesKey:sig]) ifTrue:[ |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7434 |
action := #continue |
6281
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
7435 |
] ifFalse:[ |
10887
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7436 |
(sig == NoHandlerError and:[ex parameter rejected]) ifTrue:[ |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7437 |
ex reject |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7438 |
]. |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7439 |
sig == Class methodRedefinitionNotification ifTrue:[ |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7440 |
msg := 'trying to overwrite method:\\ ' , ex oldMethod whoString , '\\in package ''' |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7441 |
, ex oldPackage , ''' with method from package ''' , ex newPackage , ''''. |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7442 |
label := 'Method redefinition in fileIn'. |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7443 |
redefKind := 'method'. |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7444 |
isRedef := true. |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7445 |
] ifFalse:[sig == Class classRedefinitionNotification ifTrue:[ |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7446 |
msg := 'trying to redefine class: ' , ex oldClass name allBold , '\\in package ''' |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7447 |
, ex oldPackage , ''' with new definition from package ''' , ex newPackage , ''''. |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7448 |
label := 'Class redefinition in fileIn'. |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7449 |
redefKind := 'class'. |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7450 |
isRedef := true. |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7451 |
] ifFalse:[sig == HaltInterrupt ifTrue:[ |sender| |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7452 |
label := msg := 'Breakpoint/Halt in fileIn'. |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7453 |
sender := ex suspendedContext. |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7454 |
msg := msg , '\\in ' , sender receiver class name , '>>' , sender sender selector |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7455 |
] ifFalse:[ |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7456 |
label := 'Error in fileIn'. |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7457 |
msg := 'error in fileIn: %1' |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7458 |
]]]. |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7459 |
|
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7460 |
msg := msg bindWith:ex description. |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7461 |
|
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7462 |
labels := #('Cancel' 'Skip' 'Debug' 'Compare Sources'). |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7463 |
values := #(abort skip debug compareSources). |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7464 |
|
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7465 |
isRedef ifTrue:[ |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7466 |
msg := msg, ('%<cr>%<cr>Continue will install the change and assign the %1 to the new package. |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7467 |
Keep Package will install the change, but keep the %1 in the old package.' bindWith:redefKind). |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7468 |
|
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7469 |
labels := labels , #('Keep Package' ). |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7470 |
values := values , #(keep). |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7471 |
]. |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7472 |
|
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7473 |
labels := labels , #( 'Continue' 'ContinueForAll'). |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7474 |
values := values , #( continue continueForAll). |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7475 |
|
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7476 |
AbortAllOperationWantedQuery query ifTrue:[ |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7477 |
labels := #('Cancel All') , labels. |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7478 |
values := #(cancelAll) , values. |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7479 |
]. |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7480 |
|
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7481 |
action := Dialog |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7482 |
choose:(msg withCRs) |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7483 |
label:label |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7484 |
image:(WarningBox iconBitmap) |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7485 |
labels:labels |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7486 |
values:values |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7487 |
default:#continue |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7488 |
onCancel:#abort. |
6281
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
7489 |
]. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
7490 |
|
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
7491 |
action == #continueForAll ifTrue:[ |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
7492 |
dontAskSignals isNil ifTrue:[ |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
7493 |
dontAskSignals := IdentityDictionary new. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
7494 |
]. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
7495 |
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
|
7496 |
action := #continue. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
7497 |
]. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
7498 |
|
8887
f9ab42af84ff
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
8882
diff
changeset
|
7499 |
(action == #compareSources) ifTrue:[ |
f9ab42af84ff
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
8882
diff
changeset
|
7500 |
DiffCodeView |
f9ab42af84ff
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
8882
diff
changeset
|
7501 |
openOn:(ex oldMethod source) label:'Old Source' |
f9ab42af84ff
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
8882
diff
changeset
|
7502 |
and:(ex newMethod source) label:'New Source' |
f9ab42af84ff
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
8882
diff
changeset
|
7503 |
title:ex description. |
f9ab42af84ff
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
8882
diff
changeset
|
7504 |
ex resignalAs:ex |
f9ab42af84ff
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
8882
diff
changeset
|
7505 |
]. |
8082
40a926dc460d
On class/method redefinition allow the user to select both #keep and #continue
Stefan Vogel <sv@exept.de>
parents:
8068
diff
changeset
|
7506 |
(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
|
7507 |
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
|
7508 |
]. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
7509 |
action == #abort ifTrue:[ |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
7510 |
AbortOperationRequest raise. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
7511 |
ex return |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
7512 |
]. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
7513 |
action == #cancelAll ifTrue:[ |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
7514 |
AbortAllOperationRequest raise. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
7515 |
ex return |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
7516 |
]. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
7517 |
action == #skip ifTrue:[ |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
7518 |
ex proceedWith:nil |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
7519 |
]. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
7520 |
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
|
7521 |
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
|
7522 |
withMessage:ex description |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
7523 |
mayProceed:true. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
7524 |
ex proceedWith:nil. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
7525 |
]. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
7526 |
ex reject |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
7527 |
] |
7040 | 7528 |
|
10887
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7529 |
"Modified: / 22-11-2011 / 13:52:17 / cg" |
4531 | 7530 |
! |
7531 |
||
4558 | 7532 |
splitFile:infile intoPiecesOfSize:kiloBytes |
7533 |
|bytesPerSplit splitIndex bufferSize buffer n |
|
7534 |
inStream outFile outStream remaining remainingInThisOutfile| |
|
7535 |
||
7536 |
bufferSize := 32*1024. |
|
7537 |
||
7538 |
inStream := infile readStream. |
|
7539 |
||
7540 |
bytesPerSplit := kiloBytes * 1024. |
|
7541 |
||
7542 |
remaining := infile fileSize. |
|
7543 |
splitIndex := 1. |
|
7544 |
[remaining > 0] whileTrue:[ |
|
7545 |
outFile := infile pathName , '_' , (splitIndex printString leftPaddedTo:3 with:$0). |
|
7546 |
outStream := outFile asFilename writeStream. |
|
7547 |
remainingInThisOutfile := remaining min:bytesPerSplit. |
|
7548 |
[remainingInThisOutfile > 0] whileTrue:[ |
|
7549 |
buffer := ByteArray new:bufferSize. |
|
7550 |
n := inStream |
|
7551 |
nextBytes:(bufferSize min:remainingInThisOutfile) |
|
7552 |
into:buffer |
|
7553 |
startingAt:1. |
|
7554 |
outStream nextPutBytes:n from:buffer startingAt:1. |
|
7555 |
remainingInThisOutfile := remainingInThisOutfile - n. |
|
7556 |
remaining := remaining - n. |
|
7557 |
]. |
|
7558 |
outStream close. |
|
7559 |
splitIndex := splitIndex + 1. |
|
7560 |
]. |
|
7561 |
inStream close. |
|
7562 |
! |
|
7563 |
||
7564 |
splitSelectedFiles |
|
6264 | 7565 |
|selectedFiles numFiles msg sizeString kiloBytes| |
4558 | 7566 |
|
7560 | 7567 |
selectedFiles := self currentSelectedObjects. |
4558 | 7568 |
(numFiles := selectedFiles size) == 0 ifTrue:[^ self]. |
7569 |
||
6265 | 7570 |
msg := (numFiles > 1) |
7571 |
ifTrue:'Split each of the %1 files into pieces of size (in kB):' |
|
7572 |
ifFalse:'Split %2 into pieces of size (in kB):'. |
|
4558 | 7573 |
|
6352 | 7574 |
sizeString := Dialog request:(resources stringWithCRs:msg with:numFiles with:selectedFiles first baseName). |
6264 | 7575 |
sizeString isEmptyOrNil ifTrue:[^ self]. |
7576 |
kiloBytes := Integer readFrom:sizeString onError:nil. |
|
4558 | 7577 |
kiloBytes isNil ifTrue:[^ self]. |
7578 |
||
7579 |
selectedFiles do:[:fileName | |
|
7580 |
self notify:('Splitting:', fileName baseName). |
|
7581 |
fileName isDirectory ifFalse:[ |
|
7582 |
self splitFile:fileName intoPiecesOfSize:kiloBytes. |
|
7583 |
] |
|
7584 |
]. |
|
6190 | 7585 |
self notify:nil. |
6265 | 7586 |
|
7560 | 7587 |
"Modified: / 04-12-2006 / 13:15:26 / cg" |
4558 | 7588 |
! |
7589 |
||
4531 | 7590 |
truncateSelectedFilesToZeroSize |
4554 | 7591 |
|selectedFiles numFiles msg| |
4531 | 7592 |
|
7560 | 7593 |
selectedFiles := self currentSelectedObjects. |
4554 | 7594 |
(numFiles := selectedFiles size) == 0 ifTrue:[^ self]. |
7595 |
||
4930 | 7596 |
msg := 'Really truncate file ''%2'' to zero length ?\\WARNING: contents of file is lost !!\This cannot be undone.'. |
4554 | 7597 |
numFiles > 1 ifTrue:[ |
4930 | 7598 |
msg := 'Really truncate %1 files to zero length ?\\WARNING: contents of files is lost !!\This cannot be undone.'. |
4554 | 7599 |
]. |
4531 | 7600 |
|
7601 |
(Dialog |
|
6352 | 7602 |
confirm:(resources stringWithCRs:msg with:numFiles with:selectedFiles first baseName allBold) |
4531 | 7603 |
initialAnswer:false |
7604 |
) ifFalse:[ |
|
7605 |
^ self |
|
7606 |
]. |
|
7607 |
||
7608 |
selectedFiles do:[:fileName | |
|
7609 |
|s| |
|
7610 |
||
7611 |
self notify:('Truncating:', fileName baseName). |
|
7612 |
fileName isDirectory ifFalse:[ |
|
4636
08b2b63e3107
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4629
diff
changeset
|
7613 |
[ |
08b2b63e3107
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4629
diff
changeset
|
7614 |
s := fileName writeStream. |
08b2b63e3107
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4629
diff
changeset
|
7615 |
s close. |
08b2b63e3107
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4629
diff
changeset
|
7616 |
] on:FileStream openErrorSignal do:[:ex| |
4531 | 7617 |
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
|
7618 |
]. |
4531 | 7619 |
] |
7620 |
]. |
|
6190 | 7621 |
self notify:nil. |
7560 | 7622 |
|
7623 |
"Modified: / 04-12-2006 / 13:15:28 / cg" |
|
3892 | 7624 |
! ! |
7625 |
||
4849 | 7626 |
!AbstractFileBrowser methodsFor:'menu queries-cvs'! |
3892 | 7627 |
|
7628 |
canCvsAddAndCommit |
|
7629 |
||
3982 | 7630 |
|selectedFiles| |
7631 |
||
7632 |
selectedFiles := self currentSelectedFiles. |
|
7633 |
^ (selectedFiles notEmpty and:[self currentFilesAreInSameDirectory]). |
|
3892 | 7634 |
! |
7635 |
||
7636 |
canRemoveCVSContainer |
|
5356
d08261ab1567
care for nonexisting bookmarks file in open
Claus Gittinger <cg@exept.de>
parents:
5334
diff
changeset
|
7637 |
^ self currentSelectedFiles |
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
7638 |
contains:[:fileName| |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
7639 |
|dirOfFile cvsDir| |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
7640 |
|
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
7641 |
dirOfFile := self getDirWithoutFileName:fileName. |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
7642 |
cvsDir := dirOfFile construct:'CVS'. |
5318 | 7643 |
cvsDir isDirectory |
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
7644 |
]. |
3892 | 7645 |
! ! |
7646 |
||
4849 | 7647 |
!AbstractFileBrowser methodsFor:'menu queries-tools'! |
3892 | 7648 |
|
6521 | 7649 |
anySTFilesOrDirectoriesPresent |
7650 |
^ self anyDirectoriesOrFilesPresentWithSuffix:'st' |
|
7651 |
! |
|
7652 |
||
3892 | 7653 |
anySTFilesPresent |
7654 |
^ self anyFilesPresentWithSuffix:'st' |
|
7655 |
! |
|
7656 |
||
7657 |
canCreateNewProject |
|
7658 |
||
3982 | 7659 |
| selectedFiles | |
3892 | 7660 |
|
7661 |
self currentFilesAreInSameDirectory ifFalse:[^ false]. |
|
3982 | 7662 |
selectedFiles := self currentSelectedFiles. |
3892 | 7663 |
^ [ |
4414 | 7664 |
((selectedFiles detect:[:fileName| | suffix| |
7665 |
suffix := fileName suffix asLowercase. |
|
7666 |
(suffix = 'prj' or:[suffix = 'st']) |
|
7667 |
] ifNone:[nil]) notNil) |
|
3982 | 7668 |
] |
3892 | 7669 |
! |
7670 |
||
7671 |
canDoTerminal |
|
7672 |
||
7673 |
^ OperatingSystem isUNIXlike |
|
7674 |
or:[OperatingSystem isMSWINDOWSlike] |
|
7675 |
! |
|
7676 |
||
7677 |
canDoTerminalAndSystemIsDOS |
|
7678 |
||
7679 |
^ self canDoTerminal and:[OperatingSystem isMSWINDOWSlike] |
|
7680 |
! |
|
7681 |
||
7682 |
canDoTerminalAndSystemIsUnix |
|
7683 |
||
7684 |
^ self canDoTerminal and:[OperatingSystem isUNIXlike] |
|
7685 |
! |
|
7686 |
||
8640
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
7687 |
canGenerateSignatureFiles |
8645
00e4d07c6d6d
Generate signed expecco patch files
Stefan Vogel <sv@exept.de>
parents:
8641
diff
changeset
|
7688 |
"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
|
7689 |
|
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
7690 |
Expecco::KeyFileGenerator isNil ifTrue:[ ^ false ]. |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
7691 |
Expecco::KeyFile isNil ifTrue:[ ^ false ]. |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
7692 |
|
8645
00e4d07c6d6d
Generate signed expecco patch files
Stefan Vogel <sv@exept.de>
parents:
8641
diff
changeset
|
7693 |
^ self currentSelectedFiles notEmptyOrNil |
8640
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
7694 |
! |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
7695 |
|
3892 | 7696 |
canReadAbbrevFile |
7697 |
||
5960 | 7698 |
|currentDirectory| |
3892 | 7699 |
|
7700 |
self currentFilesAreInSameDirectory ifFalse:[^ false]. |
|
5960 | 7701 |
currentDirectory := self currentDirectory. |
7702 |
^ currentDirectory notNil |
|
7703 |
and:[ (currentDirectory construct:'abbrev.stc') exists ] |
|
3892 | 7704 |
! |
7705 |
||
7706 |
canRemoveFromSourcePath |
|
7707 |
||
7708 |
^ false |
|
7709 |
! |
|
7710 |
||
7711 |
hasASN1 |
|
7712 |
^ [ OSI::ASN1Parser notNil |
|
4414 | 7713 |
and:[OSI::ASN1Parser isLoaded]] |
3892 | 7714 |
|
7715 |
! |
|
7716 |
||
7717 |
hasASN1AndSelection |
|
7718 |
^ [ self hasSelection value |
|
4414 | 7719 |
and:[self currentSelectedFiles size > 0 |
7720 |
and:[OSI::ASN1Parser notNil |
|
7721 |
and:[OSI::ASN1Parser isLoaded]]]] |
|
3892 | 7722 |
! |
7723 |
||
7724 |
hasCBrowser |
|
7725 |
^ [ CBrowser::Browser notNil ] |
|
7726 |
! |
|
7727 |
||
7728 |
hasJava |
|
7729 |
||
7730 |
^ [ JavaClassReader notNil |
|
4414 | 7731 |
and:[JavaClassReader isLoaded]] |
3892 | 7732 |
! |
7733 |
||
7734 |
hasJavaAndSelection |
|
7735 |
||
3982 | 7736 |
^ [ self currentSelectedFiles size > 0 |
4414 | 7737 |
and:[JavaClassReader notNil |
7738 |
and:[JavaClassReader isLoaded]]] |
|
3892 | 7739 |
! |
7740 |
||
7741 |
hasMP3Player |
|
7742 |
||
7743 |
^ [ MP3PlayerApplication notNil |
|
4414 | 7744 |
or:[SaugFix::MP3PlayerApplication notNil ]] |
3892 | 7745 |
! |
7746 |
||
7747 |
hasMP3PlayerAndSelection |
|
7748 |
||
3982 | 7749 |
^ [ self currentSelectedFiles size > 0 |
4414 | 7750 |
and:[ self hasMP3Player value]] |
3892 | 7751 |
! |
7752 |
||
8426 | 7753 |
hasResourceFileSelected |
7754 |
||
7755 |
^ [ |
|
7756 |
|sel| |
|
7757 |
||
7758 |
sel := self currentSelectedFiles. |
|
7759 |
sel notEmptyOrNil ifTrue:[ |
|
7760 |
sel conform:[:fn | fn suffix asLowercase = 'rs']. |
|
7761 |
] ifFalse:[ |
|
7762 |
false |
|
7763 |
] |
|
7764 |
] |
|
7765 |
! |
|
7766 |
||
3892 | 7767 |
hasSlideShow |
7768 |
||
7769 |
^ [CodingExamples_GUI::SlideShow notNil] |
|
7770 |
! |
|
7771 |
||
7772 |
hasSnapshotSelection |
|
7773 |
||
7774 |
^ [ |
|
4414 | 7775 |
| files | |
8426 | 7776 |
|
4414 | 7777 |
files := self currentSelectedFiles. |
7778 |
((files size == 1) |
|
7779 |
and:[ files first hasSuffix:'img' ]) |
|
3892 | 7780 |
] |
7781 |
! |
|
7782 |
||
7869 | 7783 |
hasXml |
9206 | 7784 |
^ [ XML::XMLParser notNil ] |
7869 | 7785 |
! |
7786 |
||
7787 |
hasXmlFileSelected |
|
8611
3d979ab577b7
xml-inspector always enabled.
Claus Gittinger <cg@exept.de>
parents:
8601
diff
changeset
|
7788 |
"/ 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
|
7789 |
"/ then handle the error when it ever fails during xml-parsing. |
7869 | 7790 |
|
8426 | 7791 |
^ [ |
7792 |
|sel fileName| |
|
7869 | 7793 |
|
7794 |
sel := self currentSelectedFiles. |
|
7795 |
sel size == 1 ifTrue:[ |
|
7796 |
fileName := sel first. |
|
7797 |
fileName notNil ifTrue:[ |
|
8611
3d979ab577b7
xml-inspector always enabled.
Claus Gittinger <cg@exept.de>
parents:
8601
diff
changeset
|
7798 |
#('xml' 'vdx') includes:fileName suffix asLowercase |
7869 | 7799 |
] ifFalse:[ |
7800 |
false |
|
7801 |
] |
|
7802 |
] ifFalse:[ |
|
7803 |
false |
|
7804 |
] |
|
7805 |
] |
|
7806 |
! |
|
7807 |
||
3892 | 7808 |
hasZipFileSelected |
9764
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
7809 |
|sel fileName suff| |
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
7810 |
|
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
7811 |
sel := self currentSelectedFiles. |
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
7812 |
sel size == 1 ifFalse:[^ false]. |
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
7813 |
|
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
7814 |
fileName := sel first. |
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
7815 |
fileName isNil ifTrue:[^ false]. |
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
7816 |
|
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
7817 |
suff := fileName suffix asLowercase. |
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
7818 |
(suff = 'zip' or:[suff = 'jar']) ifTrue:[^ true]. |
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
7819 |
|
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
7820 |
^ fileName mimeTypeOfContents = 'application/x-zip-compressed' |
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
7821 |
|
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
7822 |
"Modified: / 14-02-2011 / 17:17:03 / cg" |
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
7823 |
! |
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
7824 |
|
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
7825 |
hasZipFileSelectedHolder |
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
7826 |
^ [ self hasZipFileSelected ] |
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
7827 |
|
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
7828 |
"Created: / 14-02-2011 / 17:16:08 / cg" |
3892 | 7829 |
! |
7830 |
||
7831 |
javaSupportLoaded |
|
7832 |
||
7833 |
^ false |
|
7834 |
! ! |
|
7835 |
||
3906 | 7836 |
!AbstractFileBrowser methodsFor:'presentation'! |
7837 |
||
7838 |
getModeString:modeBits |
|
7839 |
"convert file-mode bits into a more user-friendly string. |
|
7840 |
This is wrong here - should be moved into OperatingSystem." |
|
7841 |
||
7842 |
^ self getModeString:modeBits |
|
4414 | 7843 |
with:#( 'owner:' $r $w $x |
7844 |
' group:' $r $w $x |
|
7845 |
' others:' $r $w $x ) |
|
3906 | 7846 |
! |
7847 |
||
7848 |
getModeString:modeBits with:texts |
|
7849 |
"convert file-mode bits into a more user-friendly string. |
|
7850 |
This is wrong here - should be moved into OperatingSystem." |
|
7851 |
||
7852 |
|bits modeString| |
|
7853 |
||
7854 |
bits := modeBits bitAnd:8r777. |
|
7855 |
modeString := ''. |
|
7856 |
||
7857 |
#( nil 8r400 8r200 8r100 nil 8r040 8r020 8r010 nil 8r004 8r002 8r001 ) |
|
7858 |
with: texts do:[:bitMask :access | |
|
4414 | 7859 |
|ch| |
7860 |
||
7861 |
bitMask isNil ifTrue:[ |
|
7862 |
modeString := modeString , access |
|
7863 |
] ifFalse:[ |
|
7864 |
(bits bitAnd:bitMask) == 0 ifTrue:[ |
|
7865 |
ch := $- |
|
7866 |
] ifFalse:[ |
|
7867 |
ch := access |
|
7868 |
]. |
|
7869 |
modeString := modeString copyWith:ch |
|
7870 |
] |
|
3906 | 7871 |
]. |
7872 |
^ modeString |
|
7873 |
! ! |
|
7874 |
||
5880 | 7875 |
!AbstractFileBrowser methodsFor:'private'! |
7876 |
||
7877 |
theSingleSelectedDirectoryOrHomeDir |
|
7878 |
|dir| |
|
7879 |
||
5888 | 7880 |
dir := self theSingleSelectedDirectoryOrNil. |
5880 | 7881 |
dir isNil ifTrue:[ dir := Filename homeDirectory]. |
7882 |
^ dir. |
|
7883 |
! |
|
7884 |
||
7885 |
theSingleSelectedDirectoryOrNil |
|
7886 |
|dirs| |
|
7887 |
||
7888 |
dirs := self currentSelectedDirectories. |
|
7889 |
dirs size ~= 1 ifTrue:[ ^ nil]. |
|
7890 |
^ dirs anElement. |
|
7891 |
! ! |
|
7892 |
||
3892 | 7893 |
!AbstractFileBrowser methodsFor:'queries'! |
7894 |
||
8256 | 7895 |
cBrowserLoaded |
7896 |
^ CBrowser::Browser notNil |
|
7897 |
! |
|
7898 |
||
10747
aa57b76e8318
added: #cBrowserMenuItemVisible
Claus Gittinger <cg@exept.de>
parents:
10678
diff
changeset
|
7899 |
cBrowserMenuItemVisible |
aa57b76e8318
added: #cBrowserMenuItemVisible
Claus Gittinger <cg@exept.de>
parents:
10678
diff
changeset
|
7900 |
^ self cBrowserLoaded or:[ OperatingSystem getLoginName = 'cg' ] |
aa57b76e8318
added: #cBrowserMenuItemVisible
Claus Gittinger <cg@exept.de>
parents:
10678
diff
changeset
|
7901 |
|
aa57b76e8318
added: #cBrowserMenuItemVisible
Claus Gittinger <cg@exept.de>
parents:
10678
diff
changeset
|
7902 |
"Created: / 04-10-2011 / 13:40:38 / cg" |
aa57b76e8318
added: #cBrowserMenuItemVisible
Claus Gittinger <cg@exept.de>
parents:
10678
diff
changeset
|
7903 |
! |
aa57b76e8318
added: #cBrowserMenuItemVisible
Claus Gittinger <cg@exept.de>
parents:
10678
diff
changeset
|
7904 |
|
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
7905 |
getAllFilesAsStrings |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
7906 |
"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
|
7907 |
|
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
7908 |
^ self subclassResponsibility |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
7909 |
! |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
7910 |
|
3906 | 7911 |
getFileInfoStringForFirstSelectedFile:longInfo |
7912 |
"get stat info on selected file - return a string which can be |
|
7913 |
shown in a box" |
|
7914 |
||
5973
0baf6c6b685f
#linkInfo now returns the info also for files that are not a symlink
Stefan Vogel <sv@exept.de>
parents:
5971
diff
changeset
|
7915 |
|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
|
7916 |
sizeString fileSize tAccess tModification buffer| |
3906 | 7917 |
|
7560 | 7918 |
selFiles := self currentSelectedObjects. |
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
7919 |
selFiles size ~~ 1 ifTrue:[ ^ nil]. |
3906 | 7920 |
filename := selFiles first. |
7921 |
||
8364 | 7922 |
info := filename linkInfo. |
9111
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
7923 |
info isNil ifTrue:[ |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
7924 |
^ 'Cannot get fileInfo'. |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
7925 |
^ nil |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
7926 |
]. |
8364 | 7927 |
|
5755
5e8165d55605
replaced '' writeStream by String writeStream
Claus Gittinger <cg@exept.de>
parents:
5753
diff
changeset
|
7928 |
buffer := Text writeStream. |
4765 | 7929 |
|
7930 |
buffer |
|
7931 |
nextPutAll:'filename: '; |
|
7932 |
nextPutLine:filename asString. |
|
7933 |
||
8364 | 7934 |
OperatingSystem isMSDOSlike ifTrue: [ |
7935 |
(info alternativeName notNil |
|
7936 |
and:[ info alternativeName ~= info fullName ]) ifTrue:[ |
|
7937 |
buffer nextPutAll:'shortname: '. |
|
7938 |
buffer nextPutLine:info alternativeName. |
|
7939 |
] |
|
7940 |
]. |
|
7941 |
||
5360
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
7942 |
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
|
7943 |
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
|
7944 |
filename exists ifFalse:[ |
5360
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
7945 |
buffer nextPutAll:'broken '. |
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
7946 |
]. |
4765 | 7947 |
buffer |
7948 |
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
|
7949 |
nextPutLine:(info path ? '???'). |
3906 | 7950 |
] 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
|
7951 |
(longInfo and:[info isRegular]) ifTrue:[ |
5360
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
7952 |
fileOutput := filename fileType. |
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
7953 |
]. |
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
7954 |
|
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
7955 |
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
|
7956 |
s := info type asString |
5360
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
7957 |
] ifFalse:[ |
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
7958 |
s := 'regular (' , fileOutput , ')' |
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
7959 |
]. |
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
7960 |
buffer nextPutLine:s. |
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
7961 |
]. |
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
7962 |
|
4707
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
7963 |
fileSize := info fileSize. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
7964 |
sizeString := 'size: ', fileSize printString. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
7965 |
longInfo ifTrue:[ |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
7966 |
fileSize > 1024 ifTrue:[ |
8172 | 7967 |
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
|
7968 |
]. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
7969 |
]. |
4765 | 7970 |
buffer nextPutLine:sizeString. |
3906 | 7971 |
|
7972 |
modeBits := info mode. |
|
7973 |
modeString := self getModeString:modeBits. |
|
4765 | 7974 |
|
7975 |
buffer nextPutAll:'access: '; nextPutAll:modeString. |
|
3906 | 7976 |
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
|
7977 |
buffer nextPutAll:' ('; nextPutAll:(modeBits printStringRadix:8); nextPut:$). |
3906 | 7978 |
]. |
4765 | 7979 |
buffer |
7980 |
cr; |
|
7981 |
nextPutAll:'owner: '; |
|
7982 |
nextPutLine:(OperatingSystem getUserNameFromID:(info uid)). |
|
7983 |
||
3906 | 7984 |
longInfo ifTrue:[ |
4765 | 7985 |
buffer |
7986 |
nextPutAll:'group: '; |
|
7987 |
nextPutLine:(OperatingSystem getGroupNameFromID:(info gid)). |
|
7988 |
||
7989 |
tAccess := info accessTime. |
|
7990 |
buffer |
|
7991 |
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
|
7992 |
nextPutAll:tAccess asDate printString; |
4765 | 7993 |
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
|
7994 |
nextPutLine:tAccess asTime printString. |
4765 | 7995 |
|
7996 |
tModification := info modificationTime. |
|
7997 |
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
|
7998 |
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
|
7999 |
nextPutAll:tModification asDate printString; |
4765 | 8000 |
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
|
8001 |
nextPutLine:tModification asTime printString. |
3906 | 8002 |
]. |
4765 | 8003 |
^ buffer contents |
7560 | 8004 |
|
7633
0a85c590f98f
ignore nil-return from get link name (for broken links)
Claus Gittinger <cg@exept.de>
parents:
7585
diff
changeset
|
8005 |
"Modified: / 07-02-2007 / 10:38:14 / cg" |
3906 | 8006 |
! |
8007 |
||
8510 | 8008 |
hasImageColorHistogram |
8009 |
^ ImageColorHistogram notNil |
|
8010 |
! |
|
8011 |
||
10258 | 8012 |
hasSubversionSupport |
10678
3a574f143d8f
changed: #hasSubversionSupport
Claus Gittinger <cg@exept.de>
parents:
10669
diff
changeset
|
8013 |
^ ConfigurableFeatures hasSubversionSupport |
10258 | 8014 |
|
8015 |
"Created: / 24-06-2010 / 19:59:07 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
10678
3a574f143d8f
changed: #hasSubversionSupport
Claus Gittinger <cg@exept.de>
parents:
10669
diff
changeset
|
8016 |
"Modified: / 07-09-2011 / 10:41:19 / cg" |
10258 | 8017 |
! |
8018 |
||
8019 |
hasSubversionWorkingCopySelected |
|
8020 |
||
8021 |
^((self currentDirectory / '.svn') exists) and: |
|
8022 |
[(self currentDirectory / '.svn' / 'entries') exists]. |
|
8023 |
||
8024 |
"Created: / 24-06-2010 / 20:13:13 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
8025 |
! |
|
8026 |
||
3892 | 8027 |
initialCommandFor:fileName into:aBox |
8028 |
"set a useful initial command for execute box." |
|
8029 |
||
4496
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
8030 |
self class initialCommandFor:fileName in:Filename currentDirectory intoBox:aBox |
3892 | 8031 |
! |
8032 |
||
8033 |
isAbstractFileBrowser |
|
8034 |
||
8035 |
^ true |
|
8036 |
! |
|
8037 |
||
8038 |
systemIsDOS |
|
8039 |
||
8040 |
^ OperatingSystem isMSDOSlike |
|
8041 |
! |
|
8042 |
||
8043 |
systemIsUnix |
|
8044 |
^ OperatingSystem isUNIXlike |
|
8045 |
! ! |
|
8046 |
||
8047 |
!AbstractFileBrowser methodsFor:'queries-file'! |
|
8048 |
||
8049 |
allItemsOfCurrentDirectory |
|
5009 | 8050 |
self |
4774 | 8051 |
applicationNamed:#DirectoryContentsBrowser |
5009 | 8052 |
ifPresentDo:[:app | ^ app allItemsOfCurrentDirectory]. |
8053 |
||
8054 |
^ nil |
|
3892 | 8055 |
! |
8056 |
||
8057 |
anyFilesPresentWithSuffix:suffix |
|
6725 | 8058 |
self currentSelectedDirectories do:[:dir| |
4636
08b2b63e3107
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4629
diff
changeset
|
8059 |
[ |
5810
4661bf4c3bbf
openErrorSignal arg: always a string
Claus Gittinger <cg@exept.de>
parents:
5789
diff
changeset
|
8060 |
(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
|
8061 |
] on:FileStream openErrorSignal do:[:ex|]. |
3892 | 8062 |
]. |
8063 |
^ false. |
|
8064 |
! |
|
8065 |
||
4771
9290fdb65a5d
#getCommonForCurrentFiles renamed to #commonPrefixOfSelectedFiles
Claus Gittinger <cg@exept.de>
parents:
4769
diff
changeset
|
8066 |
commonPrefixOfSelectedFiles |
4773 | 8067 |
|selFiles stringCol firstPre| |
4771
9290fdb65a5d
#getCommonForCurrentFiles renamed to #commonPrefixOfSelectedFiles
Claus Gittinger <cg@exept.de>
parents:
4769
diff
changeset
|
8068 |
|
7560 | 8069 |
selFiles := self currentSelectedObjects. |
4771
9290fdb65a5d
#getCommonForCurrentFiles renamed to #commonPrefixOfSelectedFiles
Claus Gittinger <cg@exept.de>
parents:
4769
diff
changeset
|
8070 |
selFiles isEmpty ifTrue:[^ nil]. |
9290fdb65a5d
#getCommonForCurrentFiles renamed to #commonPrefixOfSelectedFiles
Claus Gittinger <cg@exept.de>
parents:
4769
diff
changeset
|
8071 |
|
4772 | 8072 |
stringCol := selFiles collect:[:file | file asString]. |
4773 | 8073 |
firstPre := stringCol at:1. |
4771
9290fdb65a5d
#getCommonForCurrentFiles renamed to #commonPrefixOfSelectedFiles
Claus Gittinger <cg@exept.de>
parents:
4769
diff
changeset
|
8074 |
stringCol from:2 do:[:el| |
4773 | 8075 |
firstPre := firstPre commonPrefixWith:el. |
4771
9290fdb65a5d
#getCommonForCurrentFiles renamed to #commonPrefixOfSelectedFiles
Claus Gittinger <cg@exept.de>
parents:
4769
diff
changeset
|
8076 |
]. |
4773 | 8077 |
^ firstPre asFilename |
7560 | 8078 |
|
8079 |
"Modified: / 04-12-2006 / 13:14:25 / cg" |
|
4771
9290fdb65a5d
#getCommonForCurrentFiles renamed to #commonPrefixOfSelectedFiles
Claus Gittinger <cg@exept.de>
parents:
4769
diff
changeset
|
8080 |
! |
9290fdb65a5d
#getCommonForCurrentFiles renamed to #commonPrefixOfSelectedFiles
Claus Gittinger <cg@exept.de>
parents:
4769
diff
changeset
|
8081 |
|
3892 | 8082 |
currentFilesAreInSameDirectory |
8083 |
||
4881
e6fc72aac6e6
multiple select allowed in DirectoryTreeBrowser some changes in DirectoryContentsBrowser
penk
parents:
4880
diff
changeset
|
8084 |
^ self parentDirectoriesOfCurrentFiles size < 2 |
3892 | 8085 |
! |
8086 |
||
8087 |
currentFilesHasDirectories |
|
8088 |
||
6725 | 8089 |
^ self currentSelectedDirectories notEmpty. |
3892 | 8090 |
! |
8091 |
||
3982 | 8092 |
directoriesForFiles:aFileCol |
8093 |
||
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
8094 |
^ (aFileCol collect:[:file| self getDirWithoutFileName:file]) asSet. |
3982 | 8095 |
! |
8096 |
||
3892 | 8097 |
fileListIsEmpty |
5009 | 8098 |
self |
8099 |
applicationNamed:#DirectoryContentsBrowser |
|
8100 |
ifPresentDo:[:appl | ^ appl fileListIsEmpty]. |
|
8101 |
||
8102 |
^ nil. |
|
3892 | 8103 |
! |
8104 |
||
8105 |
fileListIsNotEmpty |
|
8106 |
||
8107 |
^ self fileListIsEmpty not. |
|
8108 |
! |
|
8109 |
||
8110 |
fileName:aFilename1 startsWith:aFilename2 |
|
6284 | 8111 |
" check if aFilename2 is a prefix of aFilename1" |
3892 | 8112 |
|
8113 |
| file1 file2 | |
|
8114 |
||
6284 | 8115 |
(aFilename2 isNil or:[aFilename1 isNil]) ifTrue:[ ^ false]. |
3892 | 8116 |
file1 := aFilename1 asFilename. |
8117 |
file2 := aFilename2 asFilename. |
|
6284 | 8118 |
|
3892 | 8119 |
file2 isRootDirectory ifTrue:[ ^ true]. |
6284 | 8120 |
|
3892 | 8121 |
((file1 isDirectory) |
8122 |
and:[(file2 isDirectory) |
|
8123 |
and:[file1 directory = file2 directory]]) ifTrue:[ |
|
4414 | 8124 |
^ file1 baseName = file2 baseName |
3892 | 8125 |
]. |
3982 | 8126 |
^ (file1 pathName) startsWith:(file2 pathName) |
3892 | 8127 |
! |
8128 |
||
8129 |
getAllFilesAsStringCollection |
|
5009 | 8130 |
self |
8131 |
applicationNamed:#DirectoryContentsBrowser |
|
8132 |
ifPresentDo:[:appl | ^ appl getAllFilesAsStringCollection]. |
|
8133 |
||
8134 |
^ nil |
|
3892 | 8135 |
! |
8136 |
||
8137 |
getBestDirectory |
|
8138 |
||
8139 |
|selFiles stringCol firstPre| |
|
8140 |
||
6725 | 8141 |
selFiles := self currentSelectedDirectories. |
3892 | 8142 |
selFiles isEmpty ifTrue:[^ nil]. |
8143 |
selFiles size == 1 ifTrue:[^ selFiles first]. |
|
4486 | 8144 |
stringCol := (selFiles collect:[:file| file asString]) asOrderedCollection. |
3892 | 8145 |
firstPre := stringCol at:1. |
8146 |
stringCol from:2 do:[:el| |
|
4414 | 8147 |
firstPre := firstPre commonPrefixWith:el. |
3892 | 8148 |
]. |
8149 |
(firstPre endsWith:(OperatingSystem fileSeparator)) ifTrue:[ |
|
4414 | 8150 |
firstPre removeLast. |
3892 | 8151 |
]. |
8152 |
^ firstPre asFilename |
|
8153 |
! |
|
8154 |
||
8155 |
getDirWithoutFileName:aFileName |
|
8156 |
||
8157 |
| dir | |
|
8158 |
aFileName isNil ifTrue:[ |
|
4414 | 8159 |
^ aFileName. |
3892 | 8160 |
]. |
8161 |
dir := aFileName asFilename. |
|
8162 |
dir isDirectory ifFalse:[ |
|
4414 | 8163 |
dir := dir directory. |
3892 | 8164 |
]. |
8165 |
^ dir. |
|
8166 |
! |
|
8167 |
||
8168 |
getInfoItem |
|
8169 |
"get filename of a description-file (.dir.info, README etc.); |
|
8170 |
This file is automatically shown when a directory is enterred. |
|
8171 |
You can add more names below if you like." |
|
8172 |
||
5880 | 8173 |
|dir| |
8174 |
||
8175 |
dir := self theSingleSelectedDirectoryOrNil. |
|
8176 |
dir isNil ifTrue:[ ^ nil]. |
|
3892 | 8177 |
|
8178 |
#( |
|
8179 |
'.dir.info' |
|
8180 |
'README' |
|
8181 |
'ReadMe' |
|
8182 |
'Readme' |
|
8183 |
'readme' |
|
8184 |
'read.me' |
|
8185 |
'Read.me' |
|
8186 |
'READ.ME' |
|
8187 |
'README.TXT' |
|
8188 |
'readme.txt' |
|
8189 |
'Readme.txt' |
|
8190 |
'Info.txt' |
|
8191 |
'info.txt' |
|
8192 |
'INFO.TXT' |
|
8193 |
) do:[:f | |
|
5883 | 8194 |
|n| |
4414 | 8195 |
|
5880 | 8196 |
n := dir construct:f. |
4414 | 8197 |
(n isReadable and:[n isDirectory not]) ifTrue:[ |
8198 |
^ DirectoryContentsBrowser itemClass fileName:n |
|
8199 |
] |
|
3892 | 8200 |
]. |
8201 |
^ nil |
|
4881
e6fc72aac6e6
multiple select allowed in DirectoryTreeBrowser some changes in DirectoryContentsBrowser
penk
parents:
4880
diff
changeset
|
8202 |
! |
e6fc72aac6e6
multiple select allowed in DirectoryTreeBrowser some changes in DirectoryContentsBrowser
penk
parents:
4880
diff
changeset
|
8203 |
|
e6fc72aac6e6
multiple select allowed in DirectoryTreeBrowser some changes in DirectoryContentsBrowser
penk
parents:
4880
diff
changeset
|
8204 |
parentDirectoriesOfCurrentFiles |
e6fc72aac6e6
multiple select allowed in DirectoryTreeBrowser some changes in DirectoryContentsBrowser
penk
parents:
4880
diff
changeset
|
8205 |
|
8251
9fd0533be7d9
changed #parentDirectoriesOfCurrentFiles
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
8206 |
^ (self currentSelectedObjects |
8253 | 8207 |
collect:[:file | file directory]) asSet |
7560 | 8208 |
|
8209 |
"Modified: / 04-12-2006 / 13:15:21 / cg" |
|
6521 | 8210 |
! |
8211 |
||
8212 |
recursiveAnyFilesPresentWithSuffix:suffix |
|
6652 | 8213 |
^ true. "/ the code below is too slow for a menu enabling operation |
8214 |
||
8215 |
"/ |directories| |
|
8216 |
"/ |
|
8217 |
"/ directories := self currentDirectories value. |
|
8218 |
"/ directories do:[:dir| |
|
8219 |
"/ [ |
|
8220 |
"/ dir recursiveDirectoryContentsDo:[:f | |
|
8221 |
"/ (f asFilename suffix = suffix) ifTrue:[ ^ true] |
|
8222 |
"/ ] |
|
8223 |
"/ ] on:FileStream openErrorSignal do:[:ex|]. |
|
8224 |
"/ ]. |
|
8225 |
"/ ^ false. |
|
6586 | 8226 |
! |
8227 |
||
8228 |
recursiveAnySTFilesPresent |
|
8229 |
^ self recursiveAnyFilesPresentWithSuffix:'st' |
|
3982 | 8230 |
! ! |
8231 |
||
8232 |
!AbstractFileBrowser methodsFor:'selection'! |
|
8233 |
||
8234 |
currentSelectedDirectories |
|
6725 | 8235 |
^ self currentDirectoriesValue. |
3982 | 8236 |
! |
8237 |
||
8238 |
currentSelectedFiles |
|
7560 | 8239 |
^ self currentSelectedObjects select:[:file | file isDirectory not]. |
8240 |
||
8241 |
"Modified: / 04-12-2006 / 13:14:39 / cg" |
|
3982 | 8242 |
! |
8243 |
||
6460 | 8244 |
currentSelectedObjects |
8245 |
^ self currentFileNameHolder value |
|
8246 |
! |
|
8247 |
||
3982 | 8248 |
firstSelectedFile |
7560 | 8249 |
^ self currentSelectedObjects |
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
8250 |
detect:[:file | file asFilename isDirectory not] |
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
8251 |
ifNone:[]. |
7560 | 8252 |
|
8253 |
"Modified: / 04-12-2006 / 13:14:50 / cg" |
|
4414 | 8254 |
! |
8255 |
||
9490 | 8256 |
hasOnlyDirectoriesSelected |
8257 |
^ self currentSelectedObjects conform:[:file | file isDirectory]. |
|
8258 |
||
8259 |
"Created: / 20-05-2010 / 10:45:03 / cg" |
|
8260 |
! |
|
8261 |
||
4414 | 8262 |
hasOnlyFilesSelected |
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
8263 |
|
7560 | 8264 |
^ self currentSelectedObjects conform:[:file | file isDirectory not]. |
8265 |
||
8266 |
"Modified: / 04-12-2006 / 13:15:01 / cg" |
|
4414 | 8267 |
! |
8268 |
||
9490 | 8269 |
hasTwoDirectoriesSelected |
8270 |
||
8271 |
^ self currentSelectedObjects size == 2 |
|
8272 |
and:[self hasOnlyDirectoriesSelected] |
|
8273 |
||
8274 |
"Created: / 20-05-2010 / 10:45:18 / cg" |
|
8275 |
! |
|
8276 |
||
4414 | 8277 |
hasTwoFilesSelected |
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
8278 |
|
7560 | 8279 |
^ self currentSelectedObjects size == 2 |
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
8280 |
and:[self hasOnlyFilesSelected] |
7560 | 8281 |
|
8282 |
"Modified: / 04-12-2006 / 13:15:04 / cg" |
|
3892 | 8283 |
! ! |
8284 |
||
3964 | 8285 |
!AbstractFileBrowser methodsFor:'sorting'! |
8286 |
||
3989 | 8287 |
currentSortOrder |
4027 | 8288 |
^ self aspectFor:#currentSortOrder ifAbsent:[ Dictionary new asValue ]. |
3989 | 8289 |
! |
8290 |
||
8291 |
sortBlockHolder |
|
8292 |
^ self aspectFor:#sortBlockHolder ifAbsent:[ |
|
5383 | 8293 |
(FileSorter directoriesBeforeFiles:(self sortDirectoriesBeforeFiles value and:[self viewDirsInContentsBrowser value]) |
8294 |
selector:#fileName |
|
8295 |
sortCaseless:self sortCaseless value |
|
8296 |
sortReverse:false) asValue. |
|
3989 | 8297 |
]. |
8298 |
! |
|
8299 |
||
8300 |
sortBlockProperty |
|
6785
cac8107d889c
clear reverseSort flag, when sort-order is changed via menu.
Claus Gittinger <cg@exept.de>
parents:
6767
diff
changeset
|
8301 |
|v| |
4027 | 8302 |
|
6785
cac8107d889c
clear reverseSort flag, when sort-order is changed via menu.
Claus Gittinger <cg@exept.de>
parents:
6767
diff
changeset
|
8303 |
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
|
8304 |
v addDependent:self. |
cac8107d889c
clear reverseSort flag, when sort-order is changed via menu.
Claus Gittinger <cg@exept.de>
parents:
6767
diff
changeset
|
8305 |
^ v. |
3989 | 8306 |
! |
8307 |
||
8308 |
sortCaseless |
|
4201 | 8309 |
" aspect for sort caseless " |
3989 | 8310 |
|
8311 |
^ self aspectFor:#sortCaseless ifAbsent:[ |
|
9393 | 8312 |
(Filename isCaseSensitive not) asValue. |
8313 |
] |
|
3989 | 8314 |
! |
8315 |
||
4074 | 8316 |
sortDirectoriesBeforeFiles |
8317 |
||
4201 | 8318 |
" aspect for sort directories always before files" |
4074 | 8319 |
^ self aspectFor:#sortDirectoriesBeforeFiles ifAbsent:[ true asValue ]. |
8320 |
! |
|
8321 |
||
3989 | 8322 |
sortFileListsBy:instanceName |
8323 |
||
8324 |
self sortFileListsBy:instanceName withReverse:true |
|
8325 |
! |
|
8326 |
||
8327 |
sortFileListsBy:instanceName withReverse:aBoolean |
|
8994
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
8328 |
| aSymbol sortCaselessLocal currentSortOrder sorter isReverse| |
3964 | 8329 |
|
8330 |
aSymbol := instanceName asSymbol. |
|
4027 | 8331 |
self sortBlockProperty setValue:instanceName asSymbol. |
4151 | 8332 |
sortCaselessLocal := self sortCaseless value. |
4027 | 8333 |
currentSortOrder := self currentSortOrder value. |
7841
ea9a45f1cd5e
oops - repair bad currentSorter
Claus Gittinger <cg@exept.de>
parents:
7829
diff
changeset
|
8334 |
currentSortOrder isEmptyOrNil ifTrue:[ |
ea9a45f1cd5e
oops - repair bad currentSorter
Claus Gittinger <cg@exept.de>
parents:
7829
diff
changeset
|
8335 |
self currentSortOrder value:(currentSortOrder := Dictionary new). |
4343 | 8336 |
currentSortOrder at:#column put:aSymbol. |
8337 |
currentSortOrder at:#reverse put:false. |
|
8338 |
currentSortOrder at:#sortCaseless put:sortCaselessLocal. |
|
3964 | 8339 |
] ifFalse:[ |
4343 | 8340 |
(currentSortOrder at:#sortCaseless) ~= sortCaselessLocal ifTrue:[ |
8341 |
"/ sort caseless changed |
|
8342 |
currentSortOrder at:#sortCaseless put:sortCaselessLocal. |
|
8343 |
] ifFalse:[ |
|
8344 |
(currentSortOrder at:#column) = aSymbol ifTrue:[ |
|
8345 |
"/ same column like before - change sort order ifReverse is true |
|
8346 |
aBoolean ifTrue:[ |
|
8347 |
isReverse := currentSortOrder at:#reverse. |
|
8348 |
currentSortOrder at:#reverse put:(isReverse not). |
|
8349 |
]. |
|
8350 |
] ifFalse:[ |
|
8351 |
"/ another column - remark column |
|
8352 |
currentSortOrder at:#column put:aSymbol. |
|
8353 |
] |
|
8354 |
] |
|
3964 | 8355 |
]. |
4027 | 8356 |
self currentSortOrder changed. |
9111
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
8357 |
|
5383 | 8358 |
sorter := FileSorter directoriesBeforeFiles:(self sortDirectoriesBeforeFiles value and:[self viewDirsInContentsBrowser value]) |
8359 |
selector:instanceName |
|
8360 |
sortCaseless:sortCaselessLocal |
|
8361 |
sortReverse:(currentSortOrder at:#reverse). |
|
8362 |
self sortBlockHolder value:sorter. |
|
7841
ea9a45f1cd5e
oops - repair bad currentSorter
Claus Gittinger <cg@exept.de>
parents:
7829
diff
changeset
|
8363 |
|
ea9a45f1cd5e
oops - repair bad currentSorter
Claus Gittinger <cg@exept.de>
parents:
7829
diff
changeset
|
8364 |
"Modified: / 18-09-2007 / 09:42:47 / cg" |
3964 | 8365 |
! ! |
8366 |
||
3892 | 8367 |
!AbstractFileBrowser methodsFor:'startup & release'! |
8368 |
||
8369 |
makeDependent |
|
4074 | 8370 |
self filterModel addDependent:self. |
4004 | 8371 |
self currentFileNameHolder addDependent:self. |
4074 | 8372 |
self sortDirectoriesBeforeFiles addDependent:self. |
4004 | 8373 |
self sortCaseless addDependent:self. |
4011 | 8374 |
self showHiddenFiles addDependent:self. |
4368
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
8375 |
self rootHolder addDependent:self. |
3892 | 8376 |
! |
8377 |
||
8378 |
masterApplication:anApplication |
|
8379 |
||
8380 |
masterApplication isNil ifTrue:[ |
|
4414 | 8381 |
(anApplication notNil and:[anApplication askFor:#isAbstractFileBrowser]) ifTrue:[ |
8382 |
aspects := anApplication aspects |
|
8383 |
] ifFalse:[ |
|
8384 |
aspects isNil ifTrue:[ |
|
8385 |
aspects := IdentityDictionary new. |
|
8386 |
aspects at:#applications put:(IdentityDictionary new). |
|
8387 |
] |
|
8388 |
]. |
|
8389 |
self applications at:(self className) put:self. |
|
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
8390 |
"/ self makeDependent. |
3892 | 8391 |
]. |
3952 | 8392 |
^ super masterApplication:anApplication. |
3892 | 8393 |
! |
8394 |
||
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
8395 |
postBuildWith:aBuilder |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
8396 |
self makeDependent. |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
8397 |
super postBuildWith:aBuilder. |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
8398 |
! |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
8399 |
|
3892 | 8400 |
postOpenWith:aBuilder |
8401 |
||
8402 |
super postOpenWith:aBuilder. |
|
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
8403 |
self windowGroup showWaitCursorWhenBusyForMillis:100. |
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
8404 |
|
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
8405 |
"Modified: / 25-07-2006 / 09:12:45 / cg" |
3892 | 8406 |
! ! |
8407 |
||
8408 |
!AbstractFileBrowser::Clipboard methodsFor:'accessing'! |
|
8409 |
||
8410 |
files |
|
8411 |
"return the value of the instance variable 'files' (automatically generated)" |
|
8412 |
||
8413 |
^ files |
|
8414 |
! |
|
8415 |
||
8416 |
files:something |
|
8417 |
"set the value of the instance variable 'files' (automatically generated)" |
|
8418 |
||
8419 |
files := something. |
|
8420 |
! |
|
8421 |
||
8422 |
method |
|
8423 |
"return the value of the instance variable 'method' (automatically generated)" |
|
8424 |
||
8425 |
^ method |
|
8426 |
! |
|
8427 |
||
8428 |
method:something |
|
8429 |
"set the value of the instance variable 'method' (automatically generated)" |
|
8430 |
||
8431 |
method := something. |
|
8432 |
! ! |
|
8433 |
||
8434 |
!AbstractFileBrowser::CodeExecutionLock methodsFor:'accessing'! |
|
8435 |
||
8436 |
locked |
|
8437 |
"return the value of the instance variable 'locked' (automatically generated)" |
|
8438 |
||
8439 |
locked isNil ifTrue:[ |
|
4414 | 8440 |
locked := false. |
3892 | 8441 |
]. |
8442 |
^ locked |
|
8443 |
! ! |
|
8444 |
||
8445 |
!AbstractFileBrowser::CodeExecutionLock methodsFor:'actions'! |
|
8446 |
||
8447 |
doIfUnLocked:aBlock |
|
8448 |
||
8449 |
self locked ifFalse:[ |
|
4414 | 8450 |
aBlock value. |
3892 | 8451 |
]. |
8452 |
! |
|
8453 |
||
8454 |
doLocked:aBlock |
|
8455 |
||
8456 |
locked := true. |
|
4004 | 8457 |
aBlock ensure:[ |
4414 | 8458 |
locked := false. |
4004 | 8459 |
] |
3892 | 8460 |
! ! |
8461 |
||
3952 | 8462 |
!AbstractFileBrowser::DirectoryHistory class methodsFor:'defaults'! |
8463 |
||
6369 | 8464 |
defaultHistorySize |
8465 |
^ 50 |
|
3892 | 8466 |
! ! |
8467 |
||
6371 | 8468 |
!AbstractFileBrowser::DirectoryHistory class methodsFor:'instance creation'! |
4032 | 8469 |
|
8470 |
new |
|
6371 | 8471 |
^ (super new) initializeHistory. |
6369 | 8472 |
! ! |
8473 |
||
8474 |
!AbstractFileBrowser::DirectoryHistory methodsFor:'accessing'! |
|
8475 |
||
8476 |
historySize |
|
8477 |
historySize isNil ifTrue:[^ self class defaultHistorySize]. |
|
8478 |
^ historySize |
|
8479 |
! |
|
8480 |
||
8481 |
historySize:aNumber |
|
8482 |
historySize := aNumber |
|
4032 | 8483 |
! ! |
8484 |
||
3892 | 8485 |
!AbstractFileBrowser::DirectoryHistory methodsFor:'actions'! |
8486 |
||
3952 | 8487 |
addToHistory:aPath |
7566
3e92cf7a6706
ignore trailing file-separator in history.
Claus Gittinger <cg@exept.de>
parents:
7565
diff
changeset
|
8488 |
| item pathToAdd | |
3e92cf7a6706
ignore trailing file-separator in history.
Claus Gittinger <cg@exept.de>
parents:
7565
diff
changeset
|
8489 |
|
3e92cf7a6706
ignore trailing file-separator in history.
Claus Gittinger <cg@exept.de>
parents:
7565
diff
changeset
|
8490 |
pathToAdd := aPath. |
3e92cf7a6706
ignore trailing file-separator in history.
Claus Gittinger <cg@exept.de>
parents:
7565
diff
changeset
|
8491 |
(pathToAdd endsWith:(Filename separator)) ifTrue:[ |
3e92cf7a6706
ignore trailing file-separator in history.
Claus Gittinger <cg@exept.de>
parents:
7565
diff
changeset
|
8492 |
pathToAdd asFilename isRootDirectory ifFalse:[ |
3e92cf7a6706
ignore trailing file-separator in history.
Claus Gittinger <cg@exept.de>
parents:
7565
diff
changeset
|
8493 |
pathToAdd := pathToAdd copyWithoutLast:(Filename separator asString size). |
3e92cf7a6706
ignore trailing file-separator in history.
Claus Gittinger <cg@exept.de>
parents:
7565
diff
changeset
|
8494 |
] |
3e92cf7a6706
ignore trailing file-separator in history.
Claus Gittinger <cg@exept.de>
parents:
7565
diff
changeset
|
8495 |
]. |
3e92cf7a6706
ignore trailing file-separator in history.
Claus Gittinger <cg@exept.de>
parents:
7565
diff
changeset
|
8496 |
|
3e92cf7a6706
ignore trailing file-separator in history.
Claus Gittinger <cg@exept.de>
parents:
7565
diff
changeset
|
8497 |
item := self getItemFor:pathToAdd. |
3e92cf7a6706
ignore trailing file-separator in history.
Claus Gittinger <cg@exept.de>
parents:
7565
diff
changeset
|
8498 |
self backForwardListAdd:pathToAdd. |
3952 | 8499 |
item isNil ifTrue:[ |
4347 | 8500 |
" not already in history" |
6369 | 8501 |
self size >= self historySize ifTrue:[ |
4347 | 8502 |
self removeLast. |
8503 |
]. |
|
7566
3e92cf7a6706
ignore trailing file-separator in history.
Claus Gittinger <cg@exept.de>
parents:
7565
diff
changeset
|
8504 |
item := DirectoryHistoryItem path:pathToAdd. |
3952 | 8505 |
] ifFalse:[ |
4347 | 8506 |
"already been there before; move the entry to |
8507 |
the beginning, so it will fall out later." |
|
8508 |
self remove:item. |
|
10381
ad4b61b0b2fd
duplicate code in if refactored
Claus Gittinger <cg@exept.de>
parents:
10306
diff
changeset
|
8509 |
]. |
ad4b61b0b2fd
duplicate code in if refactored
Claus Gittinger <cg@exept.de>
parents:
10306
diff
changeset
|
8510 |
self addFirst:item |
ad4b61b0b2fd
duplicate code in if refactored
Claus Gittinger <cg@exept.de>
parents:
10306
diff
changeset
|
8511 |
|
ad4b61b0b2fd
duplicate code in if refactored
Claus Gittinger <cg@exept.de>
parents:
10306
diff
changeset
|
8512 |
"Modified: / 24-07-2011 / 07:12:54 / cg" |
3952 | 8513 |
! |
8514 |
||
4347 | 8515 |
backForwardListAdd:aPath |
8516 |
|pathIndex| |
|
8517 |
||
8518 |
pathIndex := backForwardList indexOf:aPath. |
|
8519 |
pathIndex == 0 ifTrue:[ |
|
8520 |
" a new path comes in remove forward paths " |
|
8521 |
(backForwardList size) > backForwardIndex ifTrue:[ |
|
8522 |
backForwardList removeFromIndex:(backForwardIndex + 1) toIndex:(backForwardList size). |
|
8523 |
]. |
|
8524 |
] ifFalse:[ |
|
8525 |
backForwardList remove:aPath. |
|
8526 |
pathIndex <= backForwardIndex ifTrue:[ |
|
8527 |
backForwardIndex := backForwardIndex - 1. |
|
8528 |
] |
|
4022 | 8529 |
]. |
4347 | 8530 |
backForwardList add:aPath afterIndex:backForwardIndex. |
8531 |
backForwardIndex := backForwardIndex + 1. |
|
6369 | 8532 |
backForwardIndex > self historySize ifTrue:[ |
4347 | 8533 |
backForwardList removeFirst. |
8534 |
backForwardIndex := backForwardIndex - 1. |
|
3892 | 8535 |
]. |
4347 | 8536 |
! |
8537 |
||
8538 |
goBackward |
|
4288 | 8539 |
"return the first path of the backward list; |
8540 |
remove it from the back list and add it ti the forward list." |
|
4022 | 8541 |
|
4347 | 8542 |
|retPath| |
8543 |
||
8544 |
self canBackward ifTrue:[ |
|
8545 |
retPath := backForwardList at:(backForwardIndex - 1). |
|
8546 |
backForwardIndex := backForwardIndex - 1. |
|
4288 | 8547 |
]. |
4022 | 8548 |
^ retPath. |
8549 |
! |
|
8550 |
||
8551 |
goForward |
|
4288 | 8552 |
"return the first path of the forward list; |
8553 |
remove it from the list." |
|
4022 | 8554 |
|
4347 | 8555 |
|retPath| |
8556 |
||
8557 |
self canForward ifTrue:[ |
|
8558 |
retPath := backForwardList at:backForwardIndex + 1. |
|
8559 |
backForwardIndex := backForwardIndex + 1. |
|
4288 | 8560 |
]. |
4022 | 8561 |
^ retPath. |
8562 |
! |
|
8563 |
||
8564 |
resetForwardBackward |
|
8565 |
||
4347 | 8566 |
self initialize |
4022 | 8567 |
! |
8568 |
||
8569 |
setPosition:aPosition for:aPath |
|
8570 |
||
8571 |
self do:[:item| |
|
4414 | 8572 |
item path = aPath ifTrue:[ |
8573 |
item position:aPosition. |
|
8574 |
] |
|
4022 | 8575 |
]. |
3892 | 8576 |
! ! |
8577 |
||
4870 | 8578 |
!AbstractFileBrowser::DirectoryHistory methodsFor:'initialization'! |
4032 | 8579 |
|
6371 | 8580 |
initializeHistory |
4032 | 8581 |
|
4347 | 8582 |
backForwardList := OrderedCollection new. |
8583 |
self reverseDo:[:el| |
|
8584 |
backForwardList add:el path. |
|
8585 |
]. |
|
8586 |
backForwardIndex := backForwardList size. |
|
4032 | 8587 |
! ! |
8588 |
||
3892 | 8589 |
!AbstractFileBrowser::DirectoryHistory methodsFor:'queries'! |
8590 |
||
4288 | 8591 |
canBackward |
4347 | 8592 |
|
8593 |
^ backForwardIndex > 1 |
|
4288 | 8594 |
! |
8595 |
||
3892 | 8596 |
canForward |
4347 | 8597 |
|
8598 |
^ (backForwardList size >= (backForwardIndex + 1)) |
|
8599 |
! |
|
8600 |
||
8601 |
getBackCollection |
|
8602 |
||
8603 |
| backCol | |
|
8604 |
||
8605 |
backCol := OrderedCollection new. |
|
8606 |
self canBackward ifTrue:[ |
|
8607 |
| tmpCol | |
|
8608 |
tmpCol := backForwardList copyTo:backForwardIndex - 1. |
|
8609 |
tmpCol reverseDo:[ :el| |
|
8610 |
backCol add:el. |
|
8611 |
] |
|
8612 |
]. |
|
8613 |
^ backCol |
|
3952 | 8614 |
! |
8615 |
||
8616 |
getForwardCollection |
|
8617 |
||
4347 | 8618 |
| forwCol | |
8619 |
||
8620 |
forwCol := OrderedCollection new. |
|
8621 |
self canForward ifTrue:[ |
|
8622 |
forwCol := backForwardList copyFrom:(backForwardIndex + 1) |
|
8623 |
]. |
|
8624 |
^ forwCol |
|
3952 | 8625 |
! |
8626 |
||
8627 |
getItemFor:aPath |
|
6627 | 8628 |
^ self detect:[:item| item path = aPath] ifNone:nil. |
8629 |
"/ self do:[:item| item path = aPath ifTrue:[^ item]]. |
|
8630 |
"/ ^ nil. |
|
3952 | 8631 |
! |
8632 |
||
8633 |
getPositionFor:aPath |
|
8634 |
||
8635 |
|item| |
|
8636 |
||
8637 |
item := self getItemFor:aPath. |
|
8638 |
||
8639 |
item notNil ifTrue:[ |
|
4414 | 8640 |
^ item position. |
3952 | 8641 |
]. |
8642 |
^ nil |
|
8643 |
! |
|
8644 |
||
8645 |
includesPath:aPath |
|
6627 | 8646 |
^ self contains:[:item | item path = aPath]. |
8647 |
||
8648 |
"/ self do:[:item| item path = aPath ifTrue:[^ true]]. |
|
8649 |
"/ ^ false. |
|
4347 | 8650 |
! |
8651 |
||
8652 |
nextBackwardItem |
|
8653 |
"return the first path of the backward list" |
|
8654 |
||
8655 |
|retPath| |
|
8656 |
||
8657 |
self canBackward ifTrue:[ |
|
8658 |
retPath := backForwardList at:backForwardIndex. |
|
8659 |
]. |
|
8660 |
^ retPath. |
|
8661 |
! |
|
8662 |
||
8663 |
nextForwardItem |
|
8664 |
"return the first path of the forward list" |
|
8665 |
||
8666 |
|retPath| |
|
8667 |
||
8668 |
self canForward ifTrue:[ |
|
8669 |
retPath := backForwardList at:backForwardIndex + 1. |
|
8670 |
]. |
|
8671 |
^ retPath. |
|
3952 | 8672 |
! ! |
8673 |
||
8674 |
!AbstractFileBrowser::DirectoryHistory::DirectoryHistoryItem class methodsFor:'instance creation'! |
|
8675 |
||
8676 |
path:aPath |
|
8677 |
||
8678 |
^ self new path:aPath |
|
8679 |
! ! |
|
8680 |
||
8681 |
!AbstractFileBrowser::DirectoryHistory::DirectoryHistoryItem methodsFor:'accessing'! |
|
8682 |
||
6433 | 8683 |
asFilename |
8684 |
^ path asFilename |
|
8685 |
! |
|
8686 |
||
3952 | 8687 |
path |
8688 |
"return the value of the instance variable 'path' (automatically generated)" |
|
8689 |
||
8690 |
^ path |
|
8691 |
! |
|
8692 |
||
8693 |
path:something |
|
8694 |
"set the value of the instance variable 'path' (automatically generated)" |
|
8695 |
||
8696 |
path := something. |
|
8697 |
! |
|
8698 |
||
8699 |
position |
|
8700 |
"return the value of the instance variable 'position' (automatically generated)" |
|
8701 |
||
8702 |
^ position |
|
8703 |
! |
|
8704 |
||
8705 |
position:something |
|
8706 |
"set the value of the instance variable 'position' (automatically generated)" |
|
8707 |
||
8708 |
position := something. |
|
8709 |
! |
|
8710 |
||
8711 |
printString |
|
8712 |
||
8713 |
^ self path asString |
|
3892 | 8714 |
! ! |
8715 |
||
8716 |
!AbstractFileBrowser::SaveAspectItem class methodsFor:'instance creation'! |
|
8717 |
||
8718 |
withValue:aValue isHolder:aBoolean |
|
8719 |
||
8720 |
| instance | |
|
8721 |
||
8722 |
instance := self basicNew. |
|
8723 |
instance value:aValue. |
|
8724 |
instance isHolder:aBoolean. |
|
8725 |
^ instance |
|
8726 |
! ! |
|
8727 |
||
8728 |
!AbstractFileBrowser::SaveAspectItem methodsFor:'accessing'! |
|
8729 |
||
8730 |
isHolder |
|
8731 |
"return the value of the instance variable 'isHolder' (automatically generated)" |
|
8732 |
||
8733 |
^ isHolder |
|
8734 |
! |
|
8735 |
||
8736 |
isHolder:something |
|
8737 |
"set the value of the instance variable 'isHolder' (automatically generated)" |
|
8738 |
||
8739 |
isHolder := something. |
|
8740 |
! |
|
8741 |
||
8742 |
value |
|
8743 |
"return the value of the instance variable 'value' (automatically generated)" |
|
8744 |
||
8745 |
^ value |
|
8746 |
! |
|
8747 |
||
8748 |
value:something |
|
8749 |
"set the value of the instance variable 'value' (automatically generated)" |
|
8750 |
||
8751 |
value := something. |
|
8752 |
! ! |
|
8753 |
||
8754 |
!AbstractFileBrowser class methodsFor:'documentation'! |
|
8755 |
||
10305
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
8756 |
version |
11108 | 8757 |
^ '$Header: /cvs/stx/stx/libtool/AbstractFileBrowser.st,v 1.480 2012-01-12 02:03:59 cg Exp $' |
10305
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
8758 |
! |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
8759 |
|
8832 | 8760 |
version_CVS |
11108 | 8761 |
^ '$Header: /cvs/stx/stx/libtool/AbstractFileBrowser.st,v 1.480 2012-01-12 02:03:59 cg Exp $' |
3892 | 8762 |
! ! |