author | Claus Gittinger <cg@exept.de> |
Fri, 24 Aug 2018 14:01:23 +0200 | |
changeset 18352 | ee486b3355c7 |
parent 18274 | 78c789c6c2bf |
child 18389 | 028d70eb907a |
permissions | -rw-r--r-- |
18274 | 1 |
"{ Encoding: utf8 }" |
2 |
||
5140 | 3 |
" |
4 |
COPYRIGHT (c) 2002 by eXept Software AG |
|
5 |
All Rights Reserved |
|
6 |
||
7 |
This software is furnished under a license and may be used |
|
8 |
only in accordance with the terms of that license and with the |
|
9 |
inclusion of the above copyright notice. This software may not |
|
10 |
be provided or otherwise made available to, or used by, any |
|
11 |
other person. No title to or ownership of the software is |
|
12 |
hereby transferred. |
|
13 |
" |
|
15211 | 14 |
"{ Package: 'stx:libtool' }" |
15 |
||
16 |
"{ NameSpace: Smalltalk }" |
|
17 |
||
18 |
ApplicationModel subclass:#AbstractFileBrowser |
|
19 |
instanceVariableNames:'aspects' |
|
16720 | 20 |
classVariableNames:'CommandHistory CommandHistorySize DefaultCommandPerSuffix |
21 |
DefaultFilters DirectoryBookmarks LastEnforcedNameSpace |
|
22 |
LastFileDiffDirectory LastFileDiffFile LastFileSelection |
|
23 |
LastMercurialRepository LastMoveDestination LastMustMatchPattern |
|
24 |
LastScriptBlockString RootHolder RuntimeAspects |
|
17768 | 25 |
VisitedDirectories MaxFileSizeShownWithoutAsking' |
15211 | 26 |
poolDictionaries:'' |
27 |
category:'Interface-Tools-File' |
|
28 |
! |
|
3892 | 29 |
|
30 |
AbstractFileBrowser class instanceVariableNames:'DisabledCursorImage EnabledCursorImage' |
|
31 |
||
32 |
" |
|
33 |
The following class instance variables are inherited by this class: |
|
34 |
||
14126 | 35 |
ApplicationModel - ClassResources |
36 |
Model - |
|
37 |
Object - |
|
3892 | 38 |
" |
39 |
! |
|
40 |
||
41 |
Object subclass:#Clipboard |
|
14126 | 42 |
instanceVariableNames:'method files' |
43 |
classVariableNames:'' |
|
44 |
poolDictionaries:'' |
|
45 |
privateIn:AbstractFileBrowser |
|
3892 | 46 |
! |
47 |
||
48 |
Object subclass:#CodeExecutionLock |
|
14126 | 49 |
instanceVariableNames:'locked' |
50 |
classVariableNames:'' |
|
51 |
poolDictionaries:'' |
|
52 |
privateIn:AbstractFileBrowser |
|
3892 | 53 |
! |
54 |
||
4366 | 55 |
List subclass:#DirectoryHistory |
14126 | 56 |
instanceVariableNames:'forwardList backList lastWasForwardPath lastBackPath lastAddPath |
57 |
backForwardList backForwardIndex historySize' |
|
58 |
classVariableNames:'HistorySize' |
|
59 |
poolDictionaries:'' |
|
60 |
privateIn:AbstractFileBrowser |
|
3952 | 61 |
! |
62 |
||
63 |
Object subclass:#DirectoryHistoryItem |
|
14126 | 64 |
instanceVariableNames:'path position' |
65 |
classVariableNames:'' |
|
66 |
poolDictionaries:'' |
|
67 |
privateIn:AbstractFileBrowser::DirectoryHistory |
|
3892 | 68 |
! |
69 |
||
70 |
Object subclass:#SaveAspectItem |
|
14126 | 71 |
instanceVariableNames:'value isHolder' |
72 |
classVariableNames:'' |
|
73 |
poolDictionaries:'' |
|
74 |
privateIn:AbstractFileBrowser |
|
3892 | 75 |
! |
76 |
||
5140 | 77 |
!AbstractFileBrowser class methodsFor:'documentation'! |
78 |
||
79 |
copyright |
|
80 |
" |
|
81 |
COPYRIGHT (c) 2002 by eXept Software AG |
|
82 |
All Rights Reserved |
|
83 |
||
84 |
This software is furnished under a license and may be used |
|
85 |
only in accordance with the terms of that license and with the |
|
86 |
inclusion of the above copyright notice. This software may not |
|
87 |
be provided or otherwise made available to, or used by, any |
|
88 |
other person. No title to or ownership of the software is |
|
89 |
hereby transferred. |
|
90 |
" |
|
5967 | 91 |
! |
92 |
||
93 |
documentation |
|
94 |
" |
|
95 |
[Author:] |
|
96 |
Christian Penk |
|
9111
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
97 |
|
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
98 |
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
|
99 |
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
|
100 |
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
|
101 |
and as a container is almost incomprehensable... |
17768 | 102 |
|
103 |
[class variables:] |
|
104 |
CommandHistory |
|
105 |
CommandHistorySize |
|
106 |
DefaultCommandPerSuffix |
|
107 |
DefaultFilters |
|
108 |
DirectoryBookmarks |
|
109 |
LastEnforcedNameSpace |
|
110 |
LastFileDiffDirectory |
|
111 |
LastFileDiffFile |
|
112 |
LastFileSelection |
|
113 |
LastMercurialRepository |
|
114 |
LastMoveDestination |
|
115 |
LastMustMatchPattern |
|
116 |
LastScriptBlockString |
|
117 |
RootHolder |
|
118 |
RuntimeAspects |
|
119 |
VisitedDirectories |
|
120 |
MaxFileSizeShownWithoutAsking ..... for big files, I will ask if only the first part is |
|
121 |
to be shown. This number (if non-nil) suppresses this |
|
122 |
question for files smaller. |
|
123 |
The initial default is 1Mb (1024*1024) |
|
5967 | 124 |
" |
5140 | 125 |
! ! |
3892 | 126 |
|
4672
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
127 |
!AbstractFileBrowser class methodsFor:'accessing'! |
3952 | 128 |
|
4368
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
129 |
currentSelection |
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
130 |
|
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
131 |
LastFileSelection isNil ifTrue:[ |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
132 |
LastFileSelection := #(). |
4368
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
133 |
]. |
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
134 |
^ LastFileSelection |
4368
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 |
|
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
137 |
currentSelection:aFilenameCol |
6589 | 138 |
aFilenameCol notEmptyOrNil ifTrue:[ |
12102 | 139 |
LastFileSelection := aFilenameCol collect:[:file | (file ? '') asFilename] |
6589 | 140 |
] |
4368
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
141 |
! |
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
142 |
|
3952 | 143 |
directoryHistory |
144 |
||
12062
0056d17cf012
conflict classVar vs. private class
Claus Gittinger <cg@exept.de>
parents:
11996
diff
changeset
|
145 |
VisitedDirectories isNil ifTrue:[ |
0056d17cf012
conflict classVar vs. private class
Claus Gittinger <cg@exept.de>
parents:
11996
diff
changeset
|
146 |
VisitedDirectories := self directoryHistoryClass new. |
0056d17cf012
conflict classVar vs. private class
Claus Gittinger <cg@exept.de>
parents:
11996
diff
changeset
|
147 |
"/ VisitedDirectories inspect. |
0056d17cf012
conflict classVar vs. private class
Claus Gittinger <cg@exept.de>
parents:
11996
diff
changeset
|
148 |
]. |
0056d17cf012
conflict classVar vs. private class
Claus Gittinger <cg@exept.de>
parents:
11996
diff
changeset
|
149 |
^ VisitedDirectories |
0056d17cf012
conflict classVar vs. private class
Claus Gittinger <cg@exept.de>
parents:
11996
diff
changeset
|
150 |
|
0056d17cf012
conflict classVar vs. private class
Claus Gittinger <cg@exept.de>
parents:
11996
diff
changeset
|
151 |
"Modified: / 21-11-2012 / 08:45:49 / cg" |
3952 | 152 |
! |
153 |
||
17768 | 154 |
maxFileSizeShownWithoutAsking |
155 |
"the max. filesize which is loaded without asking if only the first |
|
156 |
part should be shown" |
|
157 |
||
158 |
^ MaxFileSizeShownWithoutAsking ? (1024*1024) |
|
159 |
||
160 |
"Created: / 19-11-2017 / 14:48:19 / cg" |
|
161 |
! |
|
162 |
||
163 |
maxFileSizeShownWithoutAsking:anIntegerOrNilForDefault |
|
164 |
"the max. filesize which is loaded without asking if only the first |
|
17769 | 165 |
part should be shown. |
166 |
Nil resets to the default (currently 1Mb)" |
|
17768 | 167 |
|
168 |
MaxFileSizeShownWithoutAsking := anIntegerOrNilForDefault |
|
169 |
||
17769 | 170 |
" |
171 |
self maxFileSizeShownWithoutAsking:nil |
|
172 |
" |
|
173 |
||
17768 | 174 |
"Created: / 19-11-2017 / 14:48:45 / cg" |
175 |
! |
|
176 |
||
3952 | 177 |
resetClassVars |
12062
0056d17cf012
conflict classVar vs. private class
Claus Gittinger <cg@exept.de>
parents:
11996
diff
changeset
|
178 |
VisitedDirectories := nil. |
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
179 |
LastFileSelection := nil. |
5936 | 180 |
|
181 |
" |
|
182 |
AbstractFileBrowser resetClassVars |
|
183 |
" |
|
12062
0056d17cf012
conflict classVar vs. private class
Claus Gittinger <cg@exept.de>
parents:
11996
diff
changeset
|
184 |
|
0056d17cf012
conflict classVar vs. private class
Claus Gittinger <cg@exept.de>
parents:
11996
diff
changeset
|
185 |
"Modified: / 21-11-2012 / 08:45:53 / cg" |
4368
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
186 |
! |
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
187 |
|
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
188 |
rootHolder |
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
189 |
|
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
190 |
^ RootHolder |
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
191 |
! |
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
192 |
|
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
193 |
rootHolder:aRoot |
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
194 |
|
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
195 |
RootHolder := aRoot |
3952 | 196 |
! ! |
197 |
||
4915 | 198 |
!AbstractFileBrowser class methodsFor:'accessing-bookmarks'! |
4672
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
199 |
|
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
200 |
addBookmark:aDirectoryPath |
6114
36fb19194510
Rename Base64Coder>>#decodingOf: to #decode:
Stefan Vogel <sv@exept.de>
parents:
6113
diff
changeset
|
201 |
"add aDirectoryPath to the list of our known bookmarks. |
36fb19194510
Rename Base64Coder>>#decodingOf: to #decode:
Stefan Vogel <sv@exept.de>
parents:
6113
diff
changeset
|
202 |
Do not add duplicates." |
36fb19194510
Rename Base64Coder>>#decodingOf: to #decode:
Stefan Vogel <sv@exept.de>
parents:
6113
diff
changeset
|
203 |
|
36fb19194510
Rename Base64Coder>>#decodingOf: to #decode:
Stefan Vogel <sv@exept.de>
parents:
6113
diff
changeset
|
204 |
|bookmarks| |
4672
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
205 |
|
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
206 |
bookmarks := self directoryBookmarks. |
6114
36fb19194510
Rename Base64Coder>>#decodingOf: to #decode:
Stefan Vogel <sv@exept.de>
parents:
6113
diff
changeset
|
207 |
(bookmarks includes:aDirectoryPath) ifFalse:[ |
36fb19194510
Rename Base64Coder>>#decodingOf: to #decode:
Stefan Vogel <sv@exept.de>
parents:
6113
diff
changeset
|
208 |
bookmarks add:aDirectoryPath asFilename. |
4672
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
209 |
]. |
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
210 |
! |
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
211 |
|
8013 | 212 |
bookmarksFrom:aFileNameOrString |
12390 | 213 |
|bookmarks s fileName line| |
8013 | 214 |
|
215 |
fileName := aFileNameOrString asFilename. |
|
216 |
[ |
|
217 |
s := fileName readStream. |
|
218 |
] on:OpenError do:[:ex| |
|
219 |
^ nil. |
|
220 |
]. |
|
221 |
||
222 |
bookmarks := OrderedCollection new. |
|
223 |
[s atEnd] whileFalse:[ |
|
12390 | 224 |
line := s nextLine. |
225 |
(line startsWith:';') ifFalse:[ |
|
226 |
bookmarks add:(Base64Coder decode:line) asString. |
|
227 |
] |
|
8013 | 228 |
]. |
229 |
s close. |
|
230 |
||
231 |
^ bookmarks |
|
232 |
! |
|
233 |
||
4679 | 234 |
defaultBookMarksFileDirectory |
12390 | 235 |
"the directory, where the default bookmarks are stored (as defaultBookMarksFilename)" |
236 |
||
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
237 |
^ Filename homeDirectory |
4679 | 238 |
! |
239 |
||
240 |
defaultBookMarksFilename |
|
12390 | 241 |
"the filename, in which the default bookmarks are stored (in defaultBookMarksDirectory)" |
242 |
||
4679 | 243 |
^ '.fileBrowserBookmarks' |
244 |
! |
|
245 |
||
246 |
directoryBookmarks |
|
247 |
DirectoryBookmarks isNil ifTrue:[ |
|
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
248 |
self loadBookmarksFrom:(self defaultBookMarksFileDirectory construct:self defaultBookMarksFilename). |
4679 | 249 |
|
250 |
DirectoryBookmarks isEmptyOrNil ifTrue:[ |
|
17979 | 251 |
DirectoryBookmarks := |
252 |
OrderedCollection |
|
253 |
with:(Filename homeDirectory asAbsoluteFilename) |
|
254 |
with:(Filename currentDirectory asAbsoluteFilename). |
|
4679 | 255 |
] |
256 |
]. |
|
257 |
^ DirectoryBookmarks |
|
258 |
||
259 |
" |
|
5438
fa19d526d85d
directoryBookmarks must be stored without lineLimit (see base64 encoder)
Claus Gittinger <cg@exept.de>
parents:
5437
diff
changeset
|
260 |
DirectoryBookmarks := nil. |
fa19d526d85d
directoryBookmarks must be stored without lineLimit (see base64 encoder)
Claus Gittinger <cg@exept.de>
parents:
5437
diff
changeset
|
261 |
self directoryBookmarks. |
4679 | 262 |
" |
263 |
! |
|
264 |
||
8013 | 265 |
directoryBookmarks: collectionOfFilenames |
266 |
||
267 |
DirectoryBookmarks := collectionOfFilenames. |
|
268 |
self saveBookmarksInDefaultBookmarksFile. |
|
269 |
! |
|
270 |
||
271 |
editBookmarksWithDefault: aFilenameOrNil |
|
272 |
| oldBookmarks newBookmarks | |
|
273 |
||
274 |
oldBookmarks := self directoryBookmarks copy. |
|
275 |
newBookmarks := BookmarksEditDialog openWith: oldBookmarks defaultBookmark: aFilenameOrNil. |
|
276 |
newBookmarks isNil ifTrue:[^ self]. |
|
277 |
self directoryBookmarks: newBookmarks. |
|
9681
00195b8c6cf6
comment/format in: #editBookmarksWithDefault:
Claus Gittinger <cg@exept.de>
parents:
9677
diff
changeset
|
278 |
|
00195b8c6cf6
comment/format in: #editBookmarksWithDefault:
Claus Gittinger <cg@exept.de>
parents:
9677
diff
changeset
|
279 |
"Modified: / 13-01-2011 / 12:52:28 / cg" |
8013 | 280 |
! |
281 |
||
4672
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
282 |
hasBookmarks |
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
283 |
^ self directoryBookmarks notEmptyOrNil |
4672
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
284 |
! |
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
285 |
|
4679 | 286 |
loadBookmarksFrom:aFileNameOrString |
8013 | 287 |
|bookmarks| |
288 |
||
289 |
bookmarks := self bookmarksFrom: aFileNameOrString. |
|
290 |
bookmarks isNil ifTrue:[^ self]. |
|
4679 | 291 |
|
292 |
DirectoryBookmarks := OrderedCollection new. |
|
293 |
bookmarks do:[:eachPath | |
|
294 |
self addBookmark:eachPath asFilename |
|
295 |
]. |
|
296 |
! |
|
297 |
||
4672
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
298 |
removeBookmark:aDirectoryPath |
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
299 |
|bookmarks| |
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 |
bookmarks := self directoryBookmarks. |
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
302 |
bookmarks isEmptyOrNil ifTrue:[ ^ self]. |
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
303 |
|
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
304 |
bookmarks remove:aDirectoryPath ifAbsent:[]. |
4679 | 305 |
! |
306 |
||
307 |
saveBookmarks |
|
308 |
|fn| |
|
309 |
||
310 |
fn := Dialog |
|
9607 | 311 |
requestFileNameForSave:(self resources string:'Save Bookmarks') |
4679 | 312 |
default:(self defaultBookMarksFilename) |
313 |
fromDirectory:(self defaultBookMarksFileDirectory). |
|
314 |
fn isEmptyOrNil ifTrue:[^ self]. |
|
315 |
||
316 |
self saveBookmarksIn:fn |
|
9607 | 317 |
|
318 |
"Modified: / 27-10-2010 / 11:27:09 / cg" |
|
4679 | 319 |
! |
320 |
||
8013 | 321 |
saveBookmarks: bookmarks in:aFileNameOrString |
6114
36fb19194510
Rename Base64Coder>>#decodingOf: to #decode:
Stefan Vogel <sv@exept.de>
parents:
6113
diff
changeset
|
322 |
"save the bokmarks in aFileNameOrString. |
36fb19194510
Rename Base64Coder>>#decodingOf: to #decode:
Stefan Vogel <sv@exept.de>
parents:
6113
diff
changeset
|
323 |
Use Base64 coding" |
36fb19194510
Rename Base64Coder>>#decodingOf: to #decode:
Stefan Vogel <sv@exept.de>
parents:
6113
diff
changeset
|
324 |
|
13683 | 325 |
|bookmarkStream fileName coder| |
4679 | 326 |
|
327 |
fileName := aFileNameOrString asFilename. |
|
328 |
fileName exists ifTrue:[ |
|
13683 | 329 |
fileName renameTo:(fileName addSuffix:'sav'). |
4679 | 330 |
]. |
6114
36fb19194510
Rename Base64Coder>>#decodingOf: to #decode:
Stefan Vogel <sv@exept.de>
parents:
6113
diff
changeset
|
331 |
bookmarkStream := fileName writeStream. |
36fb19194510
Rename Base64Coder>>#decodingOf: to #decode:
Stefan Vogel <sv@exept.de>
parents:
6113
diff
changeset
|
332 |
|
36fb19194510
Rename Base64Coder>>#decodingOf: to #decode:
Stefan Vogel <sv@exept.de>
parents:
6113
diff
changeset
|
333 |
"save each bookmark in one line" |
36fb19194510
Rename Base64Coder>>#decodingOf: to #decode:
Stefan Vogel <sv@exept.de>
parents:
6113
diff
changeset
|
334 |
coder := (Base64Coder on:bookmarkStream) lineLimit:nil. |
4679 | 335 |
bookmarks do:[:eachPath | |
6114
36fb19194510
Rename Base64Coder>>#decodingOf: to #decode:
Stefan Vogel <sv@exept.de>
parents:
6113
diff
changeset
|
336 |
eachPath asFilename pathName acceptVisitor:coder. |
36fb19194510
Rename Base64Coder>>#decodingOf: to #decode:
Stefan Vogel <sv@exept.de>
parents:
6113
diff
changeset
|
337 |
coder flush. |
36fb19194510
Rename Base64Coder>>#decodingOf: to #decode:
Stefan Vogel <sv@exept.de>
parents:
6113
diff
changeset
|
338 |
bookmarkStream cr. |
36fb19194510
Rename Base64Coder>>#decodingOf: to #decode:
Stefan Vogel <sv@exept.de>
parents:
6113
diff
changeset
|
339 |
]. |
12391 | 340 |
bookmarkStream syncData; close. |
5960 | 341 |
! |
342 |
||
8013 | 343 |
saveBookmarksIn:aFileNameOrString |
344 |
"save the bokmarks in aFileNameOrString. |
|
345 |
Use Base64 coding" |
|
346 |
||
347 |
| bookmarks | |
|
348 |
||
349 |
bookmarks := self directoryBookmarks. |
|
350 |
self saveBookmarks: bookmarks in:aFileNameOrString |
|
351 |
! |
|
352 |
||
5960 | 353 |
saveBookmarksInDefaultBookmarksFile |
354 |
self saveBookmarksIn:(self defaultBookMarksFileDirectory construct:self defaultBookMarksFilename) |
|
4672
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
355 |
! ! |
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
356 |
|
4915 | 357 |
!AbstractFileBrowser class methodsFor:'accessing-classes'! |
4672
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
358 |
|
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
359 |
directoryHistoryClass |
12062
0056d17cf012
conflict classVar vs. private class
Claus Gittinger <cg@exept.de>
parents:
11996
diff
changeset
|
360 |
^ DirectoryHistory |
0056d17cf012
conflict classVar vs. private class
Claus Gittinger <cg@exept.de>
parents:
11996
diff
changeset
|
361 |
|
0056d17cf012
conflict classVar vs. private class
Claus Gittinger <cg@exept.de>
parents:
11996
diff
changeset
|
362 |
"Modified: / 21-11-2012 / 08:46:34 / cg" |
4672
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
363 |
! ! |
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
364 |
|
3892 | 365 |
!AbstractFileBrowser class methodsFor:'defaults'! |
366 |
||
367 |
commandHistory |
|
368 |
||
369 |
CommandHistory isNil ifTrue:[ |
|
4414 | 370 |
CommandHistory := OrderedCollection new. |
3892 | 371 |
]. |
372 |
^ CommandHistory |
|
373 |
! |
|
374 |
||
375 |
commandHistorySize |
|
4190 | 376 |
"max no of entries in the HistoryList " |
6369 | 377 |
|
3892 | 378 |
CommandHistorySize isNil ifTrue:[ |
6369 | 379 |
CommandHistorySize := 150 |
3892 | 380 |
]. |
381 |
^ CommandHistorySize |
|
382 |
! |
|
383 |
||
384 |
defaultFilterList |
|
385 |
||
386 |
DefaultFilters isNil ifTrue:[ |
|
4414 | 387 |
DefaultFilters := #( '*' |
388 |
'*.st' |
|
389 |
'*.[h,c]*' |
|
12760 | 390 |
'*.txt; *.htm*' |
391 |
'*.gif; *.xpm; *.jpg; *.png' |
|
392 |
'~*o; ~*.obj; ~*.dll;' |
|
4414 | 393 |
) |
3892 | 394 |
]. |
395 |
^ DefaultFilters. |
|
12760 | 396 |
|
397 |
" |
|
398 |
DefaultFilters := nil |
|
399 |
" |
|
3892 | 400 |
! |
401 |
||
4496
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
402 |
initialCommandFor:fileName in:aDirectory intoBox:aBox |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
403 |
"set a useful initial command in an execute box." |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
404 |
|
4523 | 405 |
|mime cmd select path suffix baseName pathName| |
4496
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
406 |
|
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
407 |
path := aDirectory filenameFor:fileName. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
408 |
baseName := path baseName. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
409 |
suffix := path suffix. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
410 |
|
16160 | 411 |
cmd := UserPreferences current defaultFileOpenCommandFor:suffix. |
412 |
cmd notNil ifTrue:[ |
|
413 |
aBox initialText:(cmd bindWith:fileName pathName). |
|
414 |
^ self |
|
415 |
]. |
|
416 |
||
4496
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
417 |
mime := MIMETypes mimeTypeForSuffix:suffix. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
418 |
"/ mime notNil ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
419 |
"/ cmd := self initialCommandForMIME:mime file:path |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
420 |
"/ ]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
421 |
|
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
422 |
"/ 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
|
423 |
"/ XXX or from resources. |
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 |
(path type == #regular) ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
426 |
path isExecutableProgram ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
427 |
aBox initialText:(path pathName , ' <arguments>'). |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
428 |
^ self |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
429 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
430 |
|
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
431 |
select := true. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
432 |
|
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
433 |
"some heuristics - my personal preferences ... |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
434 |
(actually this should come from a configfile)" |
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 |
(baseName endsWith:'akefile') ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
437 |
aBox initialText:'make target' selectFrom:6 to:11. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
438 |
^ self |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
439 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
440 |
|
18264 | 441 |
cmd := MIMETypes defaultCommandTemplateToOpenMimeType:mime. |
4496
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
442 |
cmd notNil ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
443 |
select := false |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
444 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
445 |
|
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
446 |
cmd isNil ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
447 |
suffix := path suffix. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
448 |
(suffix = 'C') ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
449 |
cmd := 'g++ -c %1'. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
450 |
select := 6. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
451 |
] ifFalse:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
452 |
suffix := suffix asLowercase. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
453 |
|
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
454 |
(suffix = 'taz') ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
455 |
aBox initialText:'zcat %1 | tar tvf -'. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
456 |
select := false. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
457 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
458 |
(suffix = 'tar') ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
459 |
cmd := 'tar tvf %1'. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
460 |
select := 7. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
461 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
462 |
(suffix = 'zoo') ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
463 |
cmd := 'zoo -list %1'. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
464 |
select := 9. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
465 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
466 |
(suffix = 'zip') ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
467 |
cmd := 'unzip -l %1'. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
468 |
select := 8. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
469 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
470 |
(suffix = 'jar') ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
471 |
cmd := 'unzip -l %1'. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
472 |
select := 8. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
473 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
474 |
(suffix = 'z') ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
475 |
(baseName asLowercase endsWith:'tar.z') ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
476 |
cmd := 'zcat %1 | tar tvf -'. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
477 |
select := false. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
478 |
] ifFalse:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
479 |
cmd := 'uncompress %1' |
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 |
(suffix = 'gz') ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
483 |
(baseName asLowercase endsWith:'tar.gz') ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
484 |
cmd := ('gunzip < %1 | tar tvf -' ). |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
485 |
select := false. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
486 |
] ifFalse:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
487 |
cmd := 'gunzip %1'. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
488 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
489 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
490 |
(suffix = 'html') ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
491 |
cmd := 'netscape %1' |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
492 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
493 |
(suffix = 'htm') ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
494 |
cmd := 'netscape %1' |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
495 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
496 |
(suffix = 'uue') ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
497 |
cmd := 'uudecode %1' |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
498 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
499 |
(suffix = 'c') ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
500 |
cmd := 'cc -c %1'. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
501 |
select := 5. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
502 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
503 |
(suffix = 'cc') ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
504 |
cmd := 'g++ -c %1'. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
505 |
select := 6. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
506 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
507 |
(suffix = 'xbm') ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
508 |
cmd := 'bitmap %1' |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
509 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
510 |
(suffix = 'ps') ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
511 |
cmd := 'ghostview %1' |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
512 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
513 |
((suffix = '1') or:[suffix = 'man']) ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
514 |
cmd := 'nroff -man %1'. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
515 |
select := 10. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
516 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
517 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
518 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
519 |
|
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
520 |
cmd isNil ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
521 |
DefaultCommandPerSuffix isNil ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
522 |
cmd := '<cmd>' |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
523 |
] ifFalse:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
524 |
cmd := DefaultCommandPerSuffix |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
525 |
at:suffix |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
526 |
ifAbsent:'<cmd>'. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
527 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
528 |
cmd := cmd , ' %1'. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
529 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
530 |
|
4523 | 531 |
pathName := path pathName. |
532 |
OperatingSystem isUNIXlike ifTrue:[ |
|
533 |
pathName includesSeparator ifTrue:[ |
|
534 |
pathName := '"' , pathName , '"' |
|
535 |
] |
|
536 |
]. |
|
537 |
||
538 |
cmd := cmd bindWith:pathName. |
|
4496
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
539 |
select == false ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
540 |
aBox initialText:cmd |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
541 |
] ifFalse:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
542 |
select class == Interval ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
543 |
aBox initialText:cmd selectFrom:select start to:select stop |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
544 |
] ifFalse:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
545 |
select isInteger ifFalse:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
546 |
select := (cmd indexOf:Character space ifAbsent:[cmd size + 1]) - 1. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
547 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
548 |
aBox initialText:cmd selectFrom:1 to:select |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
549 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
550 |
] |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
551 |
] |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
552 |
|
18264 | 553 |
"Modified: / 24-09-1997 / 16:34:52 / stefan" |
554 |
"Modified: / 09-04-1998 / 17:15:57 / cg" |
|
555 |
"Modified: / 09-07-2018 / 11:16:30 / Stefan Vogel" |
|
3892 | 556 |
! |
557 |
||
5941 | 558 |
listOfRuntimeValuesToRemember |
559 |
" list of all aspects that will be remembered after closing a FileBrowserV2" |
|
560 |
||
561 |
^ #( |
|
562 |
"/ #filterModel |
|
563 |
#enableFileHistory |
|
564 |
#fileHistory |
|
565 |
#currentSortOrder |
|
566 |
#sortBlockProperty |
|
567 |
) |
|
3892 | 568 |
! |
569 |
||
570 |
resetAspects |
|
571 |
||
572 |
RuntimeAspects := nil. |
|
573 |
||
5941 | 574 |
" |
575 |
self resetAspects |
|
576 |
" |
|
3892 | 577 |
! |
578 |
||
579 |
runtimeAspects |
|
580 |
||
581 |
RuntimeAspects isNil ifTrue:[ |
|
4414 | 582 |
RuntimeAspects := Dictionary new. |
3892 | 583 |
]. |
584 |
^ RuntimeAspects |
|
585 |
! |
|
586 |
||
4201 | 587 |
userPreferencesAspectList |
588 |
" list of all aspects that will be saved with save settings |
|
589 |
that aspects will be image consistent if the settings are saved in Launcher |
|
11501 | 590 |
don't forget to add a access methods in UserPreferences if you add a aspect here |
4201 | 591 |
" |
592 |
||
7078
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
593 |
^ Dictionary |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
594 |
withKeysAndValues:#( |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
595 |
viewDirsInContentsBrowser true |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
596 |
showDirectoryTree true |
11501 | 597 |
showHiddenFiles true |
7078
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
598 |
viewDescription false |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
599 |
viewDetails true |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
600 |
viewDirectoryDescription false |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
601 |
viewFilesInDirectoryTree false |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
602 |
viewGroup false |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
603 |
viewOwner false |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
604 |
viewPermissions false |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
605 |
viewPreview false |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
606 |
viewSize true |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
607 |
viewSizeInKiloBytes false |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
608 |
viewSizeInBytes false |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
609 |
viewTime true |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
610 |
viewType false |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
611 |
openMultipleApplicationsForType false |
7788 | 612 |
filenameEntryFieldVisibleHolder true |
613 |
toolBarVisibleHolder true |
|
7078
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
614 |
sortDirectoriesBeforeFiles true |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
615 |
openAlwaysInTextEditor false |
15111 | 616 |
alwaysUseSmalltalkTools true |
7078
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
617 |
sortCaseless false |
13011 | 618 |
"/ useCodeView2InTools true -- vanishes |
14709
dc6998e427f4
Added option to show directories always in top of the list in directory contents view.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14659
diff
changeset
|
619 |
showDirectoriesOnTop false |
4201 | 620 |
) |
7078
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
621 |
|
11501 | 622 |
"Modified: / 11-05-2012 / 09:22:04 / cg" |
14709
dc6998e427f4
Added option to show directories always in top of the list in directory contents view.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14659
diff
changeset
|
623 |
"Modified: / 12-08-2014 / 13:13:57 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
3892 | 624 |
! ! |
625 |
||
17202 | 626 |
!AbstractFileBrowser class methodsFor:'drag & drop'! |
627 |
||
628 |
doStartDrag:aDropSource in:aView |
|
629 |
"set the cursors before starting the drag & drop operation" |
|
630 |
||
631 |
|hdl| |
|
632 |
||
633 |
hdl := DragAndDropManager new. |
|
634 |
||
635 |
hdl disabledCursor:self disabledCursorIcon. |
|
636 |
hdl enabledCursor:self enabledCursorIcon. |
|
637 |
hdl alienCursor:nil. |
|
638 |
||
639 |
hdl startDragFrom:aView dropSource:aDropSource offset:#topLeft. |
|
640 |
||
641 |
"Modified: / 23-07-2007 / 23:00:38 / cg" |
|
642 |
! ! |
|
643 |
||
5398 | 644 |
!AbstractFileBrowser class methodsFor:'help specs'! |
645 |
||
17889 | 646 |
basicHelpSpec |
6099 | 647 |
<resource: #help> |
648 |
||
17889 | 649 |
^ super helpSpec addPairsFrom:#( |
6099 | 650 |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
651 |
#lockFileEncoding |
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
652 |
'Do not guess the encoding from the file''s contents.' |
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
653 |
|
6100 | 654 |
#closeTabButton |
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
655 |
'Close this tab' |
6100 | 656 |
|
6099 | 657 |
#addTerminal |
17182 | 658 |
'Add a shell terminal page' |
6099 | 659 |
|
660 |
#make |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
661 |
'Call the make command' |
6099 | 662 |
|
663 |
#searchFile |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
664 |
'Search a file' |
6099 | 665 |
|
666 |
#directoryUp |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
667 |
'Directory up' |
6099 | 668 |
|
669 |
#directoryBack |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
670 |
'Directory back' |
6099 | 671 |
|
672 |
#directoryForward |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
673 |
'Directory forward' |
6099 | 674 |
|
675 |
#directoryHistory |
|
676 |
'Directory' |
|
677 |
||
678 |
#copyFile |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
679 |
'Copy the selected file(s)' |
6099 | 680 |
|
681 |
#cutFile |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
682 |
'Cut the selected file(s)' |
6099 | 683 |
|
684 |
#editFile |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
685 |
'Edit the selected file' |
6099 | 686 |
|
687 |
#fileHome |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
688 |
'Goto home directory' |
6099 | 689 |
|
8093 | 690 |
#fileDesktop |
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
691 |
'Goto desktop directory' |
8093 | 692 |
|
6099 | 693 |
#fileGotoDefault |
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
694 |
'Goto default directory (ST/X start directory)' |
6099 | 695 |
|
6454 | 696 |
#fileGotoSmalltalkDirectory |
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
697 |
'Goto Smalltalk directory (ST/X application)' |
6454 | 698 |
|
6456 | 699 |
#fileGotoDefaultDirectory |
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
700 |
'Goto current directory' |
6456 | 701 |
|
6099 | 702 |
#pasteFile |
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
703 |
'Paste file(s)' |
6099 | 704 |
|
705 |
#deleteFile |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
706 |
'Delete the selected file(s)' |
6099 | 707 |
|
708 |
#fileIn |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
709 |
'File in' |
6099 | 710 |
|
711 |
#fileHistory |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
712 |
'File history' |
6099 | 713 |
|
714 |
#fileGotoBookmark |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
715 |
'Goto bookmarked directory' |
6099 | 716 |
|
717 |
#hideToolBar |
|
13910 | 718 |
'Hide the toolbar (show again via "View"-menu)' |
6099 | 719 |
|
720 |
#hideFilenameEntryField |
|
13910 | 721 |
'Hide filename & filter fields (show again via "View"-menu)' |
722 |
||
723 |
#hideBookmarks |
|
724 |
'Hide the bookmarks (show again via "View"-menu)' |
|
6099 | 725 |
|
726 |
#openChangeBrowser |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
727 |
'Open a Changebrowser on file' |
6099 | 728 |
|
729 |
#showFileDetails |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
730 |
'Show file details' |
6099 | 731 |
|
732 |
#hideFileDetails |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
733 |
'Hide file details' |
6099 | 734 |
|
735 |
#toggleDetails |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
736 |
'Show/hide file details' |
6099 | 737 |
|
738 |
#viewDetails |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
739 |
'Show/hide file details' |
6099 | 740 |
|
741 |
#selectDetails |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
742 |
'Select file details to be shown' |
6099 | 743 |
|
8088 | 744 |
#showDifferences |
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
745 |
'Show differences between file and editor versions' |
8088 | 746 |
|
747 |
#toggleHexDisplay |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
748 |
'Toggle between hexadecimal and textual representation' |
8088 | 749 |
|
750 |
#findInBrowser |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
751 |
'Navigate the browser''s file list to the edited file' |
8088 | 752 |
|
753 |
#saveFile |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
754 |
'Save the editor''s contents into the file' |
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
755 |
|
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
756 |
#saveFileAs |
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
757 |
'Save the editor''s contents into another file' |
8088 | 758 |
|
759 |
#reloadFile |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
760 |
'Reload from the file' |
8088 | 761 |
|
762 |
||
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
763 |
'Send to the printer' |
8088 | 764 |
|
6099 | 765 |
). |
766 |
||
8261 | 767 |
" |
17889 | 768 |
self helpSpec |
8261 | 769 |
" |
770 |
||
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
771 |
"Modified: / 06-10-2011 / 14:55:27 / cg" |
8261 | 772 |
! |
773 |
||
17889 | 774 |
helpSpec |
8261 | 775 |
<resource: #programHelp> |
776 |
||
777 |
|spec hist resources| |
|
778 |
||
17889 | 779 |
spec := self basicHelpSpec. |
8261 | 780 |
|
781 |
"/ add help items for the history |
|
6099 | 782 |
hist := self directoryHistory. |
783 |
hist notNil ifTrue:[ |
|
784 |
resources := self classResources. |
|
785 |
hist canForward ifTrue:[ |
|
7879
9c64dea1b14a
block as a flyByHelpText item.
Claus Gittinger <cg@exept.de>
parents:
7869
diff
changeset
|
786 |
spec at:#directoryForward put:[ resources string:'Forward to: %1' with:hist nextForwardItem ]. |
6099 | 787 |
]. |
788 |
hist canBackward ifTrue:[ |
|
7879
9c64dea1b14a
block as a flyByHelpText item.
Claus Gittinger <cg@exept.de>
parents:
7869
diff
changeset
|
789 |
spec at:#directoryBack put:[ resources string:'Back to: %1' with:hist nextBackwardItem ]. |
6099 | 790 |
]. |
791 |
]. |
|
792 |
^ spec. |
|
793 |
||
794 |
" |
|
17889 | 795 |
self helpSpec |
6099 | 796 |
" |
797 |
||
7879
9c64dea1b14a
block as a flyByHelpText item.
Claus Gittinger <cg@exept.de>
parents:
7869
diff
changeset
|
798 |
"Modified: / 03-11-2007 / 12:05:01 / cg" |
5398 | 799 |
! ! |
800 |
||
8994
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
801 |
!AbstractFileBrowser class methodsFor:'image specs'! |
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
802 |
|
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
803 |
clearHistoryIcon |
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
804 |
<resource: #programImage> |
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
805 |
|
17413 | 806 |
^ ToolbarIconLibrary deleteIcon |
807 |
"/ ^ Icon deleteIcon |
|
808 |
||
809 |
"Modified: / 15-02-2017 / 19:45:24 / cg" |
|
8994
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
810 |
! |
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
811 |
|
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
812 |
copyIcon |
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
813 |
<resource: #programImage> |
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
814 |
|
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
815 |
^ ToolbarIconLibrary copyIcon |
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
816 |
! |
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
817 |
|
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
818 |
cutIcon |
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
819 |
<resource: #programImage> |
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
820 |
|
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
821 |
^ ToolbarIconLibrary cut20x20Icon2 "cut28x28Icon" |
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
822 |
! |
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
823 |
|
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
824 |
deleteIcon |
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
825 |
<resource: #programImage> |
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
826 |
|
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
827 |
^ ToolbarIconLibrary erase20x20Icon "/ delete28x28Icon |
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
828 |
! |
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
829 |
|
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
830 |
directoryUpIcon |
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
831 |
<resource: #programImage> |
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
832 |
|
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
833 |
^ ToolbarIconLibrary directoryUpIcon |
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
834 |
! |
3892 | 835 |
|
15211 | 836 |
disabledCursorIcon |
837 |
"This resource specification was automatically generated |
|
838 |
by the ImageEditor of ST/X." |
|
839 |
||
840 |
"Do not manually edit this!! If it is corrupted, |
|
841 |
the ImageEditor may not be able to read the specification." |
|
842 |
||
843 |
" |
|
17202 | 844 |
self disabledCursorIcon inspect |
845 |
ImageEditor openOnClass:self andSelector:#disabledCursorIcon |
|
15211 | 846 |
Icon flushCachedIcons |
847 |
" |
|
848 |
||
849 |
<resource: #image> |
|
850 |
||
851 |
^Icon |
|
852 |
constantNamed:#'AbstractFileBrowser class disabledCursorIcon' |
|
853 |
ifAbsentPut:[(Depth1Image new) width: 32; height: 32; photometric:(#palette); bitsPerSample:(#[1]); samplesPerPixel:(1); bits:(ByteArray fromPackedString:' |
|
854 |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@_ @@@XF@@@H@P@@DOB@@BLLP@AA@"@@RHD @H1AD@BRHI@@$QBP@IBH$@BPQI@@"BLP@D QH@ADBB@@H0Q@@AC |
|
855 |
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:' |
|
856 |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@_ @@@_>@@@O?0@@G?>@@C<O0@A?@>@@_8G @O?A<@C38O@@<_C0@OC8<@C0_O@@>C?0@G _8@A<C>@@O0_@@A? |
|
857 |
? @@O?0@@A?8@@@G8@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@b') ; yourself); yourself] |
|
858 |
! |
|
6337 | 859 |
|
15211 | 860 |
enabledCursorIcon |
861 |
"This resource specification was automatically generated |
|
862 |
by the ImageEditor of ST/X." |
|
863 |
||
864 |
"Do not manually edit this!! If it is corrupted, |
|
865 |
the ImageEditor may not be able to read the specification." |
|
866 |
||
867 |
" |
|
17202 | 868 |
self enabledCursorIcon inspect |
869 |
ImageEditor openOnClass:self andSelector:#enabledCursorIcon |
|
15211 | 870 |
Icon flushCachedIcons |
871 |
" |
|
872 |
||
873 |
<resource: #image> |
|
874 |
||
875 |
^Icon |
|
876 |
constantNamed:#'AbstractFileBrowser class enabledCursorIcon' |
|
877 |
ifAbsentPut:[(Depth1Image new) width: 32; height: 32; photometric:(#palette); bitsPerSample:(#[1]); samplesPerPixel:(1); bits:(ByteArray fromPackedString:' |
|
878 |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@E@@@@AP@@@@T@@@@E@@@@AP@@@@T@@@@E@@@@AP@@@@@@@@?0_0@@@@@@C?A?@@@@@@@@AP@@@@T@@@@E@@@@A |
|
879 |
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:' |
|
880 |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@G@@@@A0@@@@\@@@@G@@@@A0@@@@\@@@@G@@@@A0@@@@\@@@?8?0@O>O<@C?#?@@@G@@@@A0@@@@\@@@@G@@@@A |
|
881 |
0@@@@\@@@@G@@@@A0@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@b') ; yourself); yourself] |
|
882 |
! |
|
6337 | 883 |
|
3892 | 884 |
fileInIcon |
885 |
<resource: #programImage> |
|
886 |
||
6116 | 887 |
^ ToolbarIconLibrary fileInIcon |
3892 | 888 |
! |
889 |
||
6079 | 890 |
historyBackIcon |
891 |
<resource: #programImage> |
|
892 |
||
893 |
^ ToolbarIconLibrary historyBackIcon |
|
894 |
! |
|
895 |
||
896 |
historyForwardIcon |
|
897 |
<resource: #programImage> |
|
898 |
||
899 |
^ ToolbarIconLibrary historyForwardIcon |
|
900 |
! |
|
901 |
||
3892 | 902 |
homeIcon |
903 |
<resource: #programImage> |
|
904 |
||
6079 | 905 |
^ ToolbarIconLibrary homeIcon |
3892 | 906 |
! |
907 |
||
6074 | 908 |
homeIcon2 |
6079 | 909 |
<resource: #programImage> |
910 |
||
911 |
^ ToolbarIconLibrary homeIcon2 |
|
6074 | 912 |
! |
913 |
||
914 |
htmlReloadIcon |
|
915 |
<resource: #programImage> |
|
916 |
||
917 |
^ ToolbarIconLibrary reload22x22Icon |
|
918 |
! |
|
919 |
||
15211 | 920 |
leftDownIcon |
921 |
<resource: #image> |
|
922 |
"This resource specification was automatically generated |
|
923 |
by the ImageEditor of ST/X." |
|
924 |
"Do not manually edit this!! If it is corrupted, |
|
925 |
the ImageEditor may not be able to read the specification." |
|
926 |
" |
|
927 |
self leftDownIcon inspect |
|
928 |
ImageEditor openOnClass:self andSelector:#leftDownIcon" |
|
929 |
||
930 |
^ Icon constantNamed:#'AbstractFileBrowser class leftDownIcon' |
|
931 |
ifAbsentPut:[ |
|
932 |
(Depth2Image new) |
|
933 |
width:28; |
|
934 |
height:28; |
|
935 |
photometric:(#palette); |
|
936 |
bitsPerSample:(#( 2 )); |
|
937 |
samplesPerPixel:(1); |
|
938 |
bits:(ByteArray |
|
939 |
fromPackedString:' |
|
940 |
UUUUUUUUUUUPAUUUUUUUP@UUUUUUUPB!!UUUUUU@B*AUUUUU@B*(UUUUUPB** UUUUPB***AUUUTB***(EUUUB****%UUUR*****UUUUU@*%UUUUUUPJ)UUUU |
|
941 |
UUTB*UUUUUUU@*%UUUUUUPJ)UUUUUUTB*UUUUUUU@*%UUUUUUPJ)UUUUUUTB*UUUUUUU@*$@@@@AUPJ*****)UTB******UU@******%UPJ*****)UTAUUUU |
|
942 |
UUUU@@@@@@@AUUUUUUUUUP@a'); |
|
943 |
colorMapFromArray:#[ 255 255 255 0 0 0 40 40 100 255 0 0 ]; |
|
944 |
mask:((ImageMask new) |
|
945 |
width:28; |
|
946 |
height:28; |
|
947 |
bits:(ByteArray |
|
948 |
fromPackedString:' |
|
949 |
@@@@@@@@@@@@ @@@@\@@@@O @@@G<@@@C? @@A?<@@@?? @@_?<@@G?? @@C<@@@@?@@@@O0@@@C<@@@@?@@@@O0@@@C<@@@@?@@@@O0@@@C??? @???8@O? |
|
950 |
?>@C??? @???8@O??>@@@@@@@@@@@@@a'); |
|
951 |
yourself); |
|
952 |
yourself |
|
953 |
] |
|
954 |
! |
|
955 |
||
956 |
menuHistoryList9x20Icon |
|
957 |
<resource: #image> |
|
958 |
"This resource specification was automatically generated |
|
959 |
by the ImageEditor of ST/X." |
|
960 |
"Do not manually edit this!! If it is corrupted, |
|
961 |
the ImageEditor may not be able to read the specification." |
|
962 |
" |
|
963 |
self menuHistoryList9x20Icon inspect |
|
964 |
ImageEditor openOnClass:self andSelector:#menuHistoryList9x20Icon |
|
965 |
Icon flushCachedIcons" |
|
966 |
||
967 |
^ Icon constantNamed:#'AbstractFileBrowser class menuHistoryList9x20Icon' |
|
968 |
ifAbsentPut:[ |
|
969 |
(Depth1Image new) |
|
970 |
width:9; |
|
971 |
height:20; |
|
972 |
photometric:(#palette); |
|
973 |
bitsPerSample:(#( 1 )); |
|
974 |
samplesPerPixel:(1); |
|
975 |
bits:(ByteArray |
|
976 |
fromPackedString:'@@@@@A0@G@@\@A0@G@@\@A0@G@@\@A0@G@A?@C8@G@@H@G<@@@@@@@@a'); |
|
977 |
colorMapFromArray:#[ 255 255 255 0 0 0 ]; |
|
978 |
mask:((ImageMask new) |
|
979 |
width:9; |
|
980 |
height:20; |
|
981 |
bits:(ByteArray |
|
982 |
fromPackedString:'@@@@@A0@G@@\@A0@G@@\@A0@G@@\@A0@G@A?@C8@G@@H@G<@@@@@@@@a'); |
|
983 |
yourself); |
|
984 |
yourself |
|
985 |
] |
|
986 |
! |
|
987 |
||
988 |
menuHistoryListIcon |
|
989 |
<resource: #image> |
|
990 |
"This resource specification was automatically generated |
|
991 |
by the ImageEditor of ST/X." |
|
992 |
"Do not manually edit this!! If it is corrupted, |
|
993 |
the ImageEditor may not be able to read the specification." |
|
994 |
" |
|
995 |
self menuHistoryListIcon inspect |
|
996 |
ImageEditor openOnClass:self andSelector:#menuHistoryListIcon" |
|
997 |
||
998 |
^ Icon constantNamed:#'AbstractFileBrowser class menuHistoryListIcon' |
|
999 |
ifAbsentPut:[ |
|
1000 |
(Depth1Image new) |
|
1001 |
width:12; |
|
1002 |
height:12; |
|
1003 |
photometric:(#palette); |
|
1004 |
bitsPerSample:(#( 1 )); |
|
1005 |
samplesPerPixel:(1); |
|
1006 |
bits:(ByteArray fromPackedString:'??S?<O?0??C?<O?0??/?=_?0??C?<O?0'); |
|
1007 |
colorMapFromArray:#[ 255 255 255 0 0 0 ]; |
|
1008 |
mask:((ImageMask new) |
|
1009 |
width:12; |
|
1010 |
height:12; |
|
1011 |
bits:(ByteArray fromPackedString:'@@@O@@<@C0A?8C?@G8@O@@X@@@A?8@@@'); |
|
1012 |
yourself); |
|
1013 |
yourself |
|
1014 |
] |
|
1015 |
! |
|
3892 | 1016 |
|
6087 | 1017 |
newDirectoryIcon |
6074 | 1018 |
<resource: #programImage> |
1019 |
||
6087 | 1020 |
^ ToolbarIconLibrary newDirectoryIcon |
3923 | 1021 |
! |
1022 |
||
6091 | 1023 |
removeTabIcon |
1024 |
<resource: #programImage> |
|
1025 |
||
1026 |
^ ToolbarIconLibrary removeTabIcon |
|
1027 |
! |
|
1028 |
||
3892 | 1029 |
vt100Terminal |
1030 |
<resource: #programImage> |
|
1031 |
||
1032 |
^ ToolbarIconLibrary shell20x20Icon |
|
1033 |
! ! |
|
1034 |
||
5528 | 1035 |
!AbstractFileBrowser class methodsFor:'interface specs'! |
1036 |
||
15211 | 1037 |
encodingDialogSpec |
1038 |
"This resource specification was automatically generated |
|
1039 |
by the UIPainter of ST/X." |
|
1040 |
||
1041 |
"Do not manually edit this!! If it is corrupted, |
|
1042 |
the UIPainter may not be able to read the specification." |
|
1043 |
||
1044 |
" |
|
1045 |
UIPainter new openOnClass:AbstractFileBrowser andSelector:#encodingDialogSpec |
|
1046 |
AbstractFileBrowser new openInterface:#encodingDialogSpec |
|
1047 |
" |
|
1048 |
||
1049 |
<resource: #canvas> |
|
1050 |
||
1051 |
^ |
|
1052 |
#(FullSpec |
|
1053 |
name: encodingDialogSpec |
|
1054 |
window: |
|
1055 |
(WindowSpec |
|
1056 |
label: 'File Encoding' |
|
1057 |
name: 'File Encoding' |
|
1058 |
min: (Point 10 10) |
|
1059 |
bounds: (Rectangle 0 0 379 590) |
|
1060 |
) |
|
1061 |
component: |
|
1062 |
(SpecCollection |
|
1063 |
collection: ( |
|
1064 |
(LabelSpec |
|
1065 |
label: 'Select the External (File-) Encoding:' |
|
1066 |
name: 'Label1' |
|
1067 |
layout: (LayoutFrame 0 0 0 0 0 1 30 0) |
|
1068 |
translateLabel: true |
|
1069 |
adjust: left |
|
1070 |
) |
|
1071 |
(DataSetSpec |
|
1072 |
name: 'Table1' |
|
1073 |
layout: (LayoutFrame 0 0 30 0 0 1 -60 1) |
|
1074 |
model: selectedEncoding |
|
1075 |
hasHorizontalScrollBar: true |
|
1076 |
hasVerticalScrollBar: true |
|
1077 |
dataList: encodingList |
|
1078 |
has3Dseparators: true |
|
1079 |
columns: |
|
1080 |
(Array |
|
1081 |
||
1082 |
(DataSetColumnSpec |
|
1083 |
label: 'Encoding' |
|
1084 |
labelButtonType: Button |
|
1085 |
height: heightOfFirstRow |
|
1086 |
model: at: |
|
1087 |
canSelect: false |
|
1088 |
isResizeable: false |
|
1089 |
showRowSeparator: false |
|
1090 |
showColSeparator: false |
|
1091 |
) |
|
1092 |
(DataSetColumnSpec |
|
1093 |
label: 'Description' |
|
1094 |
labelButtonType: Button |
|
1095 |
height: heightOfFirstRow |
|
1096 |
model: at: |
|
1097 |
canSelect: false |
|
1098 |
isResizeable: false |
|
1099 |
showRowSeparator: false |
|
1100 |
showColSeparator: false |
|
1101 |
) |
|
1102 |
) |
|
1103 |
doubleClickChannel: accept |
|
1104 |
) |
|
1105 |
(CheckBoxSpec |
|
1106 |
label: 'Lock Encoding' |
|
1107 |
name: 'LockEncodingCheckBox' |
|
1108 |
layout: (LayoutFrame 3 0 -60 1 217 0 -30 1) |
|
1109 |
activeHelpKey: lockFileEncoding |
|
1110 |
model: lockFileEncoding |
|
1111 |
translateLabel: true |
|
1112 |
) |
|
1113 |
(HorizontalPanelViewSpec |
|
1114 |
name: 'ButtonPanel' |
|
1115 |
layout: (LayoutFrame 0 0 -30 1 0 1 0 1) |
|
1116 |
horizontalLayout: fitSpace |
|
1117 |
verticalLayout: center |
|
1118 |
horizontalSpace: 3 |
|
1119 |
verticalSpace: 3 |
|
1120 |
reverseOrderIfOKAtLeft: true |
|
1121 |
component: |
|
1122 |
(SpecCollection |
|
1123 |
collection: ( |
|
1124 |
(ActionButtonSpec |
|
1125 |
label: 'Cancel' |
|
1126 |
name: 'Button2' |
|
1127 |
translateLabel: true |
|
1128 |
model: cancel |
|
1129 |
extent: (Point 183 22) |
|
1130 |
) |
|
1131 |
(ActionButtonSpec |
|
1132 |
label: 'OK' |
|
1133 |
name: 'Button1' |
|
1134 |
translateLabel: true |
|
1135 |
model: accept |
|
1136 |
isDefault: true |
|
1137 |
extent: (Point 184 22) |
|
1138 |
) |
|
1139 |
) |
|
1140 |
||
1141 |
) |
|
1142 |
) |
|
1143 |
) |
|
1144 |
||
1145 |
) |
|
1146 |
) |
|
1147 |
! |
|
1148 |
||
1149 |
lineEndConventionDialogSpec |
|
1150 |
"This resource specification was automatically generated |
|
1151 |
by the UIPainter of ST/X." |
|
1152 |
||
1153 |
"Do not manually edit this!! If it is corrupted, |
|
1154 |
the UIPainter may not be able to read the specification." |
|
1155 |
||
1156 |
" |
|
1157 |
UIPainter new openOnClass:AbstractFileBrowser andSelector:#lineEndConventionDialogSpec |
|
1158 |
AbstractFileBrowser new openInterface:#lineEndConventionDialogSpec |
|
1159 |
" |
|
1160 |
||
1161 |
<resource: #canvas> |
|
1162 |
||
1163 |
^ |
|
15212 | 1164 |
#(FullSpec |
1165 |
name: lineEndConventionDialogSpec |
|
1166 |
window: |
|
1167 |
(WindowSpec |
|
1168 |
label: 'Line-End Convention' |
|
1169 |
name: 'Line-End Convention' |
|
1170 |
min: (Point 10 10) |
|
1171 |
bounds: (Rectangle 0 0 379 239) |
|
1172 |
) |
|
1173 |
component: |
|
1174 |
(SpecCollection |
|
1175 |
collection: ( |
|
1176 |
(LabelSpec |
|
1177 |
label: 'Select the Line-End Convention (used when saving files):' |
|
1178 |
name: 'Label1' |
|
1179 |
layout: (LayoutFrame 0 0 0 0 0 1 30 0) |
|
1180 |
translateLabel: true |
|
1181 |
adjust: left |
|
1182 |
) |
|
1183 |
(VerticalPanelViewSpec |
|
1184 |
name: 'VerticalPanel1' |
|
1185 |
layout: (LayoutFrame 20 0 40 0 0 1 -30 1) |
|
1186 |
horizontalLayout: fit |
|
1187 |
verticalLayout: topSpace |
|
1188 |
horizontalSpace: 3 |
|
1189 |
verticalSpace: 3 |
|
1190 |
component: |
|
1191 |
(SpecCollection |
|
1192 |
collection: ( |
|
1193 |
(RadioButtonSpec |
|
1194 |
label: 'NL (Unix)' |
|
1195 |
name: 'RadioButton1' |
|
1196 |
translateLabel: true |
|
1197 |
model: lineEndConvention |
|
1198 |
isTriggerOnDown: true |
|
1199 |
select: nl |
|
1200 |
extent: (Point 359 22) |
|
1201 |
) |
|
1202 |
(RadioButtonSpec |
|
1203 |
label: 'CR-NL (MSDOS)' |
|
1204 |
name: 'RadioButton4' |
|
1205 |
translateLabel: true |
|
1206 |
model: lineEndConvention |
|
1207 |
isTriggerOnDown: true |
|
1208 |
select: crlf |
|
1209 |
extent: (Point 359 22) |
|
1210 |
) |
|
1211 |
(RadioButtonSpec |
|
1212 |
label: 'CR (VMS and pre OSX mac)' |
|
1213 |
name: 'RadioButton5' |
|
1214 |
translateLabel: true |
|
1215 |
model: lineEndConvention |
|
1216 |
isTriggerOnDown: true |
|
1217 |
select: cr |
|
1218 |
extent: (Point 359 22) |
|
15211 | 1219 |
) |
15212 | 1220 |
(RadioButtonSpec |
1221 |
label: 'ETX (some modem protocols and mainframe files)' |
|
1222 |
name: 'RadioButton6' |
|
1223 |
translateLabel: true |
|
1224 |
model: lineEndConvention |
|
1225 |
isTriggerOnDown: true |
|
1226 |
select: etx |
|
1227 |
extent: (Point 359 22) |
|
1228 |
) |
|
1229 |
(RadioButtonSpec |
|
1230 |
label: 'EOT (some modem protocols and mainframe files)' |
|
1231 |
name: 'RadioButton7' |
|
1232 |
translateLabel: true |
|
1233 |
model: lineEndConvention |
|
1234 |
isTriggerOnDown: true |
|
1235 |
select: eot |
|
1236 |
extent: (Point 359 22) |
|
15211 | 1237 |
) |
15212 | 1238 |
) |
1239 |
||
1240 |
) |
|
15211 | 1241 |
) |
15212 | 1242 |
(HorizontalPanelViewSpec |
1243 |
name: 'ButtonPanel' |
|
1244 |
layout: (LayoutFrame 0 0 -30 1 0 1 0 1) |
|
1245 |
horizontalLayout: fitSpace |
|
1246 |
verticalLayout: center |
|
1247 |
horizontalSpace: 3 |
|
1248 |
verticalSpace: 3 |
|
1249 |
reverseOrderIfOKAtLeft: true |
|
1250 |
component: |
|
1251 |
(SpecCollection |
|
1252 |
collection: ( |
|
1253 |
(ActionButtonSpec |
|
1254 |
label: 'Cancel' |
|
1255 |
name: 'Button2' |
|
1256 |
translateLabel: true |
|
1257 |
model: cancel |
|
1258 |
extent: (Point 185 22) |
|
1259 |
) |
|
1260 |
(ActionButtonSpec |
|
1261 |
label: 'OK' |
|
1262 |
name: 'Button1' |
|
1263 |
translateLabel: true |
|
1264 |
model: accept |
|
1265 |
isDefault: true |
|
1266 |
extent: (Point 185 22) |
|
1267 |
) |
|
1268 |
) |
|
1269 |
||
1270 |
) |
|
1271 |
) |
|
1272 |
) |
|
1273 |
||
1274 |
) |
|
1275 |
) |
|
15211 | 1276 |
! |
1277 |
||
1278 |
tabStopConversionDialogSpec |
|
1279 |
"This resource specification was automatically generated |
|
1280 |
by the UIPainter of ST/X." |
|
1281 |
||
1282 |
"Do not manually edit this!! If it is corrupted, |
|
1283 |
the UIPainter may not be able to read the specification." |
|
1284 |
||
1285 |
" |
|
1286 |
UIPainter new openOnClass:AbstractFileBrowser andSelector:#tabStopConversionDialogSpec |
|
1287 |
AbstractFileBrowser new openInterface:#tabStopConversionDialogSpec |
|
1288 |
" |
|
1289 |
||
1290 |
<resource: #canvas> |
|
1291 |
||
1292 |
^ |
|
1293 |
#(FullSpec |
|
1294 |
name: 'tabStopConversionDialogSpec' |
|
1295 |
window: |
|
1296 |
(WindowSpec |
|
1297 |
label: 'Tab-Stop Conversion' |
|
1298 |
name: 'Tab-Stop Conversion' |
|
1299 |
min: (Point 10 10) |
|
1300 |
bounds: (Rectangle 0 0 379 239) |
|
1301 |
) |
|
1302 |
component: |
|
1303 |
(SpecCollection |
|
1304 |
collection: ( |
|
1305 |
(LabelSpec |
|
1306 |
label: 'Select the Tab-Stop Conversion (used when saving files):' |
|
1307 |
name: 'Label1' |
|
1308 |
layout: (LayoutFrame 0 0 0 0 0 1 30 0) |
|
1309 |
translateLabel: true |
|
1310 |
adjust: left |
|
1311 |
) |
|
1312 |
(VerticalPanelViewSpec |
|
1313 |
name: 'VerticalPanel1' |
|
1314 |
layout: (LayoutFrame 0 0 30 0 0 1 -30 1) |
|
1315 |
horizontalLayout: center |
|
1316 |
verticalLayout: center |
|
1317 |
horizontalSpace: 3 |
|
1318 |
verticalSpace: 3 |
|
1319 |
component: |
|
1320 |
(SpecCollection |
|
1321 |
collection: ( |
|
1322 |
(RadioButtonSpec |
|
1323 |
label: '4' |
|
1324 |
name: 'RadioButton1' |
|
1325 |
translateLabel: true |
|
1326 |
model: tabStops |
|
1327 |
isTriggerOnDown: true |
|
1328 |
select: 4 |
|
1329 |
extent: (Point 136 22) |
|
1330 |
) |
|
1331 |
(RadioButtonSpec |
|
1332 |
label: '8' |
|
1333 |
name: 'RadioButton4' |
|
1334 |
translateLabel: true |
|
1335 |
model: tabStops |
|
1336 |
isTriggerOnDown: true |
|
1337 |
select: 8 |
|
1338 |
extent: (Point 136 22) |
|
1339 |
) |
|
1340 |
) |
|
1341 |
||
1342 |
) |
|
1343 |
) |
|
1344 |
(HorizontalPanelViewSpec |
|
1345 |
name: 'ButtonPanel' |
|
1346 |
layout: (LayoutFrame 0 0 -30 1 0 1 0 1) |
|
1347 |
horizontalLayout: fitSpace |
|
1348 |
verticalLayout: center |
|
1349 |
horizontalSpace: 3 |
|
1350 |
verticalSpace: 3 |
|
1351 |
reverseOrderIfOKAtLeft: true |
|
1352 |
component: |
|
1353 |
(SpecCollection |
|
1354 |
collection: ( |
|
1355 |
(ActionButtonSpec |
|
1356 |
label: 'Cancel' |
|
1357 |
name: 'Button2' |
|
1358 |
translateLabel: true |
|
1359 |
model: cancel |
|
1360 |
extent: (Point 185 22) |
|
1361 |
) |
|
1362 |
(ActionButtonSpec |
|
1363 |
label: 'OK' |
|
1364 |
name: 'Button1' |
|
1365 |
translateLabel: true |
|
1366 |
model: accept |
|
1367 |
isDefault: true |
|
1368 |
extent: (Point 185 22) |
|
1369 |
) |
|
1370 |
) |
|
1371 |
||
1372 |
) |
|
1373 |
) |
|
1374 |
) |
|
1375 |
||
1376 |
) |
|
1377 |
) |
|
1378 |
||
1379 |
"Modified: / 28-02-2012 / 11:12:38 / cg" |
|
1380 |
! ! |
|
5528 | 1381 |
|
3892 | 1382 |
!AbstractFileBrowser class methodsFor:'menu specs'! |
1383 |
||
15211 | 1384 |
baseBookmarksMenuSpec |
1385 |
"This resource specification was automatically generated |
|
1386 |
by the MenuEditor of ST/X." |
|
1387 |
||
1388 |
"Do not manually edit this!! If it is corrupted, |
|
1389 |
the MenuEditor may not be able to read the specification." |
|
1390 |
||
1391 |
" |
|
1392 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#baseBookmarksMenuSpec |
|
1393 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser baseBookmarksMenuSpec)) startUp |
|
1394 |
" |
|
1395 |
||
1396 |
<resource: #menu> |
|
1397 |
||
1398 |
^ |
|
1399 |
#(Menu |
|
1400 |
( |
|
1401 |
(MenuItem |
|
1402 |
enabled: currentFilesHasDirectories |
|
1403 |
label: 'Add Bookmark' |
|
1404 |
itemValue: addBookmark |
|
1405 |
translateLabel: true |
|
1406 |
) |
|
1407 |
(MenuItem |
|
1408 |
enabled: hasBookmarksToRemove |
|
1409 |
label: 'Remove Bookmark' |
|
1410 |
itemValue: removeBookmark |
|
1411 |
translateLabel: true |
|
1412 |
) |
|
1413 |
(MenuItem |
|
1414 |
label: 'Save Bookmarks In...' |
|
1415 |
itemValue: saveBookmarks |
|
1416 |
translateLabel: true |
|
1417 |
) |
|
1418 |
) |
|
1419 |
nil |
|
1420 |
nil |
|
1421 |
) |
|
1422 |
! |
|
1423 |
||
1424 |
baseBookmarksMenuSpec2 |
|
1425 |
"This resource specification was automatically generated |
|
1426 |
by the MenuEditor of ST/X." |
|
1427 |
||
1428 |
"Do not manually edit this!! If it is corrupted, |
|
1429 |
the MenuEditor may not be able to read the specification." |
|
1430 |
||
1431 |
" |
|
1432 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#baseBookmarksMenuSpec2 |
|
1433 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser baseBookmarksMenuSpec2)) startUp |
|
1434 |
" |
|
1435 |
||
1436 |
<resource: #menu> |
|
1437 |
||
1438 |
^ |
|
1439 |
#(Menu |
|
1440 |
( |
|
1441 |
(MenuItem |
|
1442 |
label: 'Edit Bookmarks' |
|
1443 |
itemValue: editBookmarks |
|
1444 |
translateLabel: true |
|
1445 |
) |
|
1446 |
(MenuItem |
|
1447 |
label: '-' |
|
1448 |
) |
|
1449 |
(MenuItem |
|
1450 |
enabled: currentFilesHasDirectories |
|
1451 |
label: 'Add Bookmark' |
|
1452 |
itemValue: addBookmark |
|
1453 |
translateLabel: true |
|
1454 |
) |
|
1455 |
) |
|
1456 |
nil |
|
1457 |
nil |
|
1458 |
) |
|
1459 |
! |
|
1460 |
||
1461 |
browserMenu |
|
1462 |
"This resource specification was automatically generated |
|
1463 |
by the MenuEditor of ST/X." |
|
1464 |
||
1465 |
"Do not manually edit this!! If it is corrupted, |
|
1466 |
the MenuEditor may not be able to read the specification." |
|
1467 |
||
1468 |
||
1469 |
" |
|
1470 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#browserMenu |
|
1471 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser browserMenu)) startUp |
|
1472 |
" |
|
1473 |
||
1474 |
<resource: #menu> |
|
1475 |
||
1476 |
^ |
|
1477 |
#(Menu |
|
1478 |
( |
|
1479 |
(MenuItem |
|
1480 |
label: 'Spawn Filebrowser' |
|
1481 |
itemValue: doSpawn |
|
1482 |
translateLabel: true |
|
1483 |
shortcutKey: Ctrln |
|
1484 |
) |
|
1485 |
(MenuItem |
|
1486 |
label: 'Windows Explorer' |
|
1487 |
itemValue: doOpenExplorer |
|
1488 |
translateLabel: true |
|
17946 | 1489 |
isVisible: systemIsDOS |
15211 | 1490 |
) |
1491 |
(MenuItem |
|
1492 |
label: 'Open Finder' |
|
1493 |
itemValue: doOpenFinder |
|
1494 |
translateLabel: true |
|
1495 |
isVisible: systemIsOSX |
|
1496 |
) |
|
1497 |
(MenuItem |
|
1498 |
label: 'C Browser' |
|
1499 |
itemValue: doOpenCBrowser |
|
1500 |
translateLabel: true |
|
1501 |
isVisible: cBrowserMenuItemVisible |
|
1502 |
) |
|
1503 |
(MenuItem |
|
1504 |
label: '-' |
|
1505 |
) |
|
1506 |
(MenuItem |
|
1507 |
label: 'Add Text Editor Page' |
|
1508 |
itemValue: newTextEditor |
|
1509 |
translateLabel: true |
|
1510 |
shortcutKey: Ctrlt |
|
1511 |
) |
|
1512 |
(MenuItem |
|
1513 |
label: 'Add Shell Terminal Page' |
|
1514 |
itemValue: doAddTerminal |
|
1515 |
translateLabel: true |
|
1516 |
) |
|
1517 |
(MenuItem |
|
1518 |
label: 'Add Archiver Page' |
|
1519 |
itemValue: doAddArchiver |
|
1520 |
translateLabel: true |
|
1521 |
) |
|
1522 |
(MenuItem |
|
1523 |
label: 'Add Search Page' |
|
1524 |
itemValue: doOpenSearchFile |
|
1525 |
translateLabel: true |
|
1526 |
) |
|
1527 |
(MenuItem |
|
1528 |
label: '-' |
|
1529 |
isVisible: false |
|
1530 |
) |
|
1531 |
(MenuItem |
|
1532 |
label: 'Settings...' |
|
1533 |
itemValue: doOpenSettings |
|
1534 |
translateLabel: true |
|
1535 |
isVisible: false |
|
1536 |
) |
|
1537 |
(MenuItem |
|
1538 |
label: 'Encoding...' |
|
1539 |
itemValue: fileEncodingDialog |
|
1540 |
translateLabel: true |
|
1541 |
isVisible: false |
|
1542 |
) |
|
1543 |
(MenuItem |
|
1544 |
label: 'Line End Convention...' |
|
1545 |
itemValue: lineEndConventionDialog |
|
1546 |
translateLabel: true |
|
1547 |
isVisible: false |
|
1548 |
) |
|
1549 |
(MenuItem |
|
1550 |
label: 'Tab Stop Conversion...' |
|
1551 |
itemValue: tabStopConversionDialog |
|
1552 |
translateLabel: true |
|
1553 |
isVisible: false |
|
1554 |
) |
|
1555 |
(MenuItem |
|
1556 |
label: '-' |
|
1557 |
) |
|
1558 |
(MenuItem |
|
1559 |
label: 'Exit' |
|
1560 |
itemValue: closeRequest |
|
1561 |
translateLabel: true |
|
1562 |
) |
|
1563 |
) |
|
1564 |
nil |
|
1565 |
nil |
|
1566 |
) |
|
1567 |
||
17724 | 1568 |
"Modified: / 29-10-2017 / 11:13:49 / cg" |
15211 | 1569 |
! |
1570 |
||
1571 |
directoryMenu |
|
1572 |
"This resource specification was automatically generated |
|
1573 |
by the MenuEditor of ST/X." |
|
1574 |
||
1575 |
"Do not manually edit this!! If it is corrupted, |
|
1576 |
the MenuEditor may not be able to read the specification." |
|
1577 |
||
1578 |
||
1579 |
" |
|
1580 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#directoryMenu |
|
1581 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser directoryMenu)) startUp |
|
1582 |
" |
|
1583 |
||
1584 |
<resource: #menu> |
|
1585 |
||
1586 |
^ |
|
1587 |
#(Menu |
|
1588 |
( |
|
1589 |
(MenuItem |
|
1590 |
label: 'Bookmarks' |
|
1591 |
submenuChannel: bookmarksMenu |
|
1592 |
) |
|
1593 |
(MenuItem |
|
1594 |
label: 'Visited Directories' |
|
1595 |
submenuChannel: visitedDirectoriesMenu |
|
1596 |
) |
|
1597 |
(MenuItem |
|
1598 |
label: '-' |
|
1599 |
) |
|
1600 |
(MenuItem |
|
1601 |
label: 'Up' |
|
1602 |
itemValue: doGoDirectoryUp |
|
1603 |
) |
|
1604 |
(MenuItem |
|
1605 |
activeHelpKey: directoryBack |
|
1606 |
enabled: enableBack |
|
1607 |
label: 'Back' |
|
1608 |
itemValue: doBack |
|
1609 |
) |
|
1610 |
(MenuItem |
|
1611 |
activeHelpKey: directoryBack |
|
1612 |
enabled: enableForward |
|
1613 |
label: 'Forward' |
|
1614 |
itemValue: doForward |
|
1615 |
) |
|
1616 |
(MenuItem |
|
1617 |
label: '-' |
|
1618 |
) |
|
1619 |
(MenuItem |
|
1620 |
enabled: enableHome |
|
1621 |
label: 'Home Directory' |
|
1622 |
itemValue: doGotoHomeDirectory |
|
1623 |
) |
|
1624 |
(MenuItem |
|
1625 |
enabled: enableGotoDesktopDirectory |
|
1626 |
label: 'Desktop' |
|
1627 |
itemValue: doGotoDesktopDirectory |
|
1628 |
) |
|
1629 |
(MenuItem |
|
18352 | 1630 |
enabled: enableGotoDownloadsDirectory |
1631 |
label: 'Downloads' |
|
1632 |
itemValue: doGotoDownloadsDirectory |
|
1633 |
) |
|
1634 |
(MenuItem |
|
15211 | 1635 |
enabled: enableGotoDefaultDirectory |
1636 |
label: 'Default (Current) Directory' |
|
1637 |
itemValue: doGotoDefaultDirectory |
|
1638 |
) |
|
1639 |
(MenuItem |
|
1640 |
enabled: enableGotoSmalltalkDirectory |
|
1641 |
label: 'Smalltalk (Application) Directory' |
|
1642 |
itemValue: doGotoSmalltalkDirectory |
|
1643 |
) |
|
1644 |
(MenuItem |
|
17187 | 1645 |
enabled: enableGotoSmalltalkWorkspaceDirectory |
1646 |
label: 'Smalltalk Workspace Directory' |
|
1647 |
itemValue: doGotoSmalltalkWorkspaceDirectory |
|
1648 |
) |
|
1649 |
(MenuItem |
|
15211 | 1650 |
enabled: enableGotoTempDirectory |
1651 |
label: 'Smalltalk Temp Directory' |
|
1652 |
itemValue: doGotoTempDirectory |
|
1653 |
) |
|
1654 |
(MenuItem |
|
1655 |
label: '-' |
|
17582 | 1656 |
isVisible: false |
15211 | 1657 |
) |
1658 |
(MenuItem |
|
1659 |
enabled: enableMakeCurrentDirectory |
|
1660 |
label: 'Make this the Default (Current) Directory' |
|
1661 |
itemValue: doMakeCurrentDirectory |
|
17582 | 1662 |
isVisible: false |
15211 | 1663 |
) |
1664 |
) |
|
1665 |
nil |
|
1666 |
nil |
|
1667 |
) |
|
17582 | 1668 |
|
1669 |
"Modified: / 17-07-2017 / 10:08:31 / cg" |
|
15211 | 1670 |
! |
1671 |
||
1672 |
editMenu |
|
1673 |
"This resource specification was automatically generated |
|
1674 |
by the MenuEditor of ST/X." |
|
1675 |
||
1676 |
"Do not manually edit this!! If it is corrupted, |
|
1677 |
the MenuEditor may not be able to read the specification." |
|
1678 |
||
1679 |
" |
|
1680 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#editMenu |
|
1681 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser editMenu)) startUp |
|
1682 |
" |
|
1683 |
||
1684 |
<resource: #menu> |
|
1685 |
||
1686 |
^ |
|
1687 |
#(Menu |
|
1688 |
( |
|
1689 |
(MenuItem |
|
1690 |
enabled: hasFileSelection |
|
1691 |
label: 'Copy Selected Filenames to Clipboard' |
|
1692 |
itemValue: copySelectedFilenames |
|
1693 |
translateLabel: true |
|
1694 |
) |
|
1695 |
(MenuItem |
|
1696 |
enabled: fileListIsNotEmpty |
|
1697 |
label: 'Copy all Filenames to Clipboard' |
|
1698 |
itemValue: copyFileList |
|
1699 |
translateLabel: true |
|
1700 |
) |
|
1701 |
) |
|
1702 |
nil |
|
1703 |
nil |
|
1704 |
) |
|
1705 |
! |
|
1706 |
||
1707 |
emptyMenuSpec |
|
1708 |
"This resource specification was automatically generated |
|
1709 |
by the MenuEditor of ST/X." |
|
1710 |
||
1711 |
"Do not manually edit this!! If it is corrupted, |
|
1712 |
the MenuEditor may not be able to read the specification." |
|
1713 |
||
1714 |
" |
|
1715 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#emptyMenuSpec |
|
1716 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser emptyMenuSpec)) startUp |
|
1717 |
" |
|
1718 |
||
1719 |
<resource: #menu> |
|
1720 |
||
1721 |
^ |
|
1722 |
#(#Menu |
|
1723 |
#( |
|
1724 |
) |
|
1725 |
nil |
|
1726 |
nil |
|
1727 |
) |
|
1728 |
! |
|
1729 |
||
1730 |
extraMenu |
|
1731 |
"This resource specification was automatically generated |
|
1732 |
by the MenuEditor of ST/X." |
|
1733 |
||
1734 |
"Do not manually edit this!! If it is corrupted, |
|
1735 |
the MenuEditor may not be able to read the specification." |
|
1736 |
||
1737 |
||
1738 |
" |
|
1739 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#extraMenu |
|
1740 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser extraMenu)) startUp |
|
1741 |
" |
|
1742 |
||
1743 |
<resource: #menu> |
|
1744 |
||
1745 |
^ |
|
1746 |
#(Menu |
|
1747 |
( |
|
1748 |
(MenuItem |
|
1749 |
label: 'Encoding...' |
|
1750 |
itemValue: fileEncodingDialog |
|
1751 |
translateLabel: true |
|
1752 |
) |
|
1753 |
(MenuItem |
|
1754 |
label: 'Line End Convention...' |
|
1755 |
itemValue: lineEndConventionDialog |
|
1756 |
translateLabel: true |
|
1757 |
) |
|
1758 |
(MenuItem |
|
1759 |
label: 'Tab Stop Conversion...' |
|
1760 |
itemValue: tabStopConversionDialog |
|
1761 |
translateLabel: true |
|
1762 |
) |
|
1763 |
(MenuItem |
|
1764 |
label: '-' |
|
1765 |
) |
|
1766 |
(MenuItem |
|
1767 |
label: 'Settings...' |
|
1768 |
itemValue: doOpenSettings |
|
1769 |
translateLabel: true |
|
1770 |
labelImage: (ResourceRetriever ToolbarIconLibrary settings16x16Icon 'Settings...') |
|
1771 |
) |
|
1772 |
) |
|
1773 |
nil |
|
1774 |
nil |
|
1775 |
) |
|
1776 |
! |
|
1777 |
||
1778 |
fileMenu |
|
1779 |
"This resource specification was automatically generated |
|
1780 |
by the MenuEditor of ST/X." |
|
1781 |
||
1782 |
"Do not manually edit this!! If it is corrupted, |
|
1783 |
the MenuEditor may not be able to read the specification." |
|
1784 |
||
1785 |
||
1786 |
" |
|
1787 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#fileMenu |
|
1788 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser fileMenu)) startUp |
|
1789 |
" |
|
1790 |
||
1791 |
<resource: #menu> |
|
1792 |
||
1793 |
^ |
|
1794 |
#(Menu |
|
1795 |
( |
|
1796 |
(MenuItem |
|
1797 |
enabled: enableFileHistory |
|
1798 |
label: 'File History' |
|
1799 |
submenuChannel: menuFileHistory |
|
1800 |
) |
|
1801 |
(MenuItem |
|
1802 |
label: '-' |
|
1803 |
) |
|
1804 |
(MenuItem |
|
1805 |
label: 'Open' |
|
1806 |
itemValue: doShowFileContents |
|
1807 |
) |
|
1808 |
(MenuItem |
|
1809 |
label: '-' |
|
1810 |
) |
|
1811 |
(MenuItem |
|
1812 |
enabled: hasFileSelection |
|
1813 |
label: 'FileIn' |
|
1814 |
itemValue: fileFileIn |
|
1815 |
) |
|
1816 |
(MenuItem |
|
1817 |
enabled: hasFileSelection |
|
1818 |
label: 'FileIn to Namespace...' |
|
1819 |
itemValue: fileFileInToNameSpace |
|
1820 |
) |
|
1821 |
(MenuItem |
|
1822 |
enabled: hasPackageDirectorySelected |
|
1823 |
label: 'Load Package from Here' |
|
1824 |
itemValue: fileFileInPackage |
|
1825 |
) |
|
1826 |
(MenuItem |
|
1827 |
label: '-' |
|
1828 |
) |
|
1829 |
(MenuItem |
|
1830 |
label: 'New' |
|
1831 |
submenuChannel: newMenu |
|
1832 |
keepLinkedMenu: true |
|
1833 |
) |
|
1834 |
(MenuItem |
|
1835 |
label: '-' |
|
1836 |
) |
|
1837 |
(MenuItem |
|
1838 |
enabled: hasSelection |
|
1839 |
label: 'Cut' |
|
1840 |
itemValue: cutFiles |
|
1841 |
) |
|
1842 |
(MenuItem |
|
1843 |
enabled: hasSelection |
|
1844 |
label: 'Copy' |
|
1845 |
itemValue: copyFiles |
|
1846 |
) |
|
1847 |
(MenuItem |
|
1848 |
enabled: canPaste |
|
1849 |
label: 'Paste' |
|
1850 |
itemValue: pasteFiles |
|
1851 |
) |
|
1852 |
(MenuItem |
|
1853 |
enabled: hasSelection |
|
1854 |
label: 'Delete' |
|
1855 |
itemValue: deleteFiles |
|
1856 |
) |
|
1857 |
(MenuItem |
|
1858 |
enabled: hasSelection |
|
1859 |
label: 'Erase' |
|
1860 |
itemValue: eraseFiles |
|
1861 |
) |
|
1862 |
(MenuItem |
|
1863 |
label: '-' |
|
1864 |
) |
|
1865 |
(MenuItem |
|
1866 |
enabled: hasSelection |
|
1867 |
label: 'Rename...' |
|
1868 |
itemValue: renameSelection |
|
1869 |
shortcutKey: Rename |
|
1870 |
) |
|
1871 |
(MenuItem |
|
1872 |
enabled: hasSelection |
|
1873 |
label: 'Move To...' |
|
1874 |
itemValue: moveSelectionTo |
|
1875 |
) |
|
1876 |
(MenuItem |
|
1877 |
enabled: hasSelection |
|
1878 |
label: 'Copy To...' |
|
1879 |
itemValue: copySelectionTo |
|
1880 |
) |
|
1881 |
(MenuItem |
|
1882 |
enabled: hasSelection |
|
1883 |
label: 'Properties...' |
|
1884 |
itemValue: doShowProperties |
|
1885 |
) |
|
1886 |
(MenuItem |
|
1887 |
label: '-' |
|
1888 |
isVisible: javaSupportLoaded |
|
1889 |
) |
|
1890 |
(MenuItem |
|
1891 |
enabled: canAddToClassPath |
|
1892 |
label: 'Add to Java Class Path' |
|
1893 |
isVisible: javaSupportLoaded |
|
1894 |
) |
|
1895 |
(MenuItem |
|
1896 |
enabled: canRemoveFromClassPath |
|
1897 |
label: 'Remove from Java Class Path' |
|
1898 |
isVisible: javaSupportLoaded |
|
1899 |
) |
|
1900 |
(MenuItem |
|
1901 |
enabled: canAddToSourcePath |
|
1902 |
label: 'Add to Java Source Path' |
|
1903 |
isVisible: javaSupportLoaded |
|
1904 |
) |
|
1905 |
(MenuItem |
|
1906 |
enabled: canRemoveFromSourcePath |
|
1907 |
label: 'Remove from Java Source Path' |
|
1908 |
isVisible: javaSupportLoaded |
|
1909 |
) |
|
1910 |
) |
|
1911 |
nil |
|
1912 |
nil |
|
1913 |
) |
|
1914 |
! |
|
1915 |
||
1916 |
fileOpMenu |
|
1917 |
"This resource specification was automatically generated |
|
1918 |
by the MenuEditor of ST/X." |
|
1919 |
||
1920 |
"Do not manually edit this!! If it is corrupted, |
|
1921 |
the MenuEditor may not be able to read the specification." |
|
1922 |
||
1923 |
||
1924 |
" |
|
1925 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#fileOpMenu |
|
1926 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser fileOpMenu)) startUp |
|
1927 |
" |
|
1928 |
||
1929 |
<resource: #menu> |
|
1930 |
||
1931 |
^ |
|
1932 |
#(Menu |
|
1933 |
( |
|
1934 |
(MenuItem |
|
1935 |
enabled: hasFileSelection |
|
15906 | 1936 |
label: 'Split (by size)...' |
15211 | 1937 |
itemValue: splitSelectedFiles |
1938 |
) |
|
1939 |
(MenuItem |
|
1940 |
enabled: hasFileSelection |
|
15906 | 1941 |
label: 'Split (by #lines)...' |
1942 |
itemValue: splitSelectedFilesByLines |
|
1943 |
) |
|
1944 |
(MenuItem |
|
1945 |
enabled: hasFileSelection |
|
15211 | 1946 |
label: 'Join...' |
1947 |
itemValue: joinSelectedFiles |
|
1948 |
) |
|
1949 |
(MenuItem |
|
1950 |
enabled: hasFileSelection |
|
1951 |
label: 'Copy Corrupted File To...' |
|
1952 |
itemValue: copySelectionToRepairingCorruptedFiles |
|
1953 |
) |
|
1954 |
(MenuItem |
|
15569 | 1955 |
label: 'Copy Corrupted File From -> To...' |
1956 |
itemValue: copyFromToRepairingCorruptedFiles |
|
1957 |
) |
|
1958 |
(MenuItem |
|
15211 | 1959 |
label: '-' |
1960 |
) |
|
1961 |
(MenuItem |
|
1962 |
enabled: hasFileSelection |
|
1963 |
label: 'Rot13...' |
|
1964 |
itemValue: filterSelectedFiles: |
|
1965 |
argument: rot13 |
|
1966 |
) |
|
1967 |
(MenuItem |
|
1968 |
label: '-' |
|
1969 |
) |
|
1970 |
(MenuItem |
|
1971 |
enabled: hasFileSelection |
|
1972 |
label: 'Truncate...' |
|
1973 |
itemValue: truncateSelectedFilesToZeroSize |
|
1974 |
) |
|
1975 |
(MenuItem |
|
1976 |
label: '-' |
|
1977 |
) |
|
1978 |
(MenuItem |
|
1979 |
label: 'Load Signature Support Package' |
|
1980 |
itemValue: loadSignatureSupport |
|
1981 |
isVisible: cannotGenerateSignatureFiles |
|
1982 |
) |
|
1983 |
(MenuItem |
|
1984 |
enabled: canGenerateSignatureFiles |
|
1985 |
label: 'Generate Signed Files' |
|
1986 |
itemValue: generateSignaturesForSelectedFiles |
|
1987 |
) |
|
1988 |
(MenuItem |
|
1989 |
enabled: canGenerateSignatureFiles |
|
1990 |
label: 'Generate Detached Signature Files (use for dll)' |
|
1991 |
itemValue: generateDetachedSignaturesForSelectedFiles |
|
1992 |
) |
|
1993 |
(MenuItem |
|
1994 |
enabled: canGenerateSignatureFiles |
|
1995 |
label: 'Generate Patch Installer for File(s)' |
|
1996 |
itemValue: generatePatchInstallerForSelectedFiles |
|
1997 |
) |
|
1998 |
(MenuItem |
|
1999 |
label: '-' |
|
2000 |
) |
|
2001 |
(MenuItem |
|
2002 |
enabled: hasFileSelection |
|
2003 |
label: 'File Differences' |
|
2004 |
itemValue: openDiffView |
|
2005 |
isVisible: hasTwoFilesSelectedHolder |
|
2006 |
) |
|
2007 |
(MenuItem |
|
2008 |
enabled: hasFileSelection |
|
2009 |
label: 'File Differences...' |
|
2010 |
itemValue: openDiffView |
|
2011 |
isVisible: hasNotTwoFilesSelectedHolder |
|
2012 |
) |
|
2013 |
(MenuItem |
|
2014 |
enabled: hasSelection |
|
2015 |
label: 'Directory Differences' |
|
2016 |
itemValue: openDirectoryDiffView |
|
2017 |
isVisible: hasTwoDirectoriesSelectedHolder |
|
2018 |
) |
|
2019 |
(MenuItem |
|
2020 |
enabled: hasSelection |
|
2021 |
label: 'Directory Differences...' |
|
2022 |
itemValue: openDirectoryDiffView |
|
2023 |
isVisible: hasNotTwoDirectoriesSelectedHolder |
|
2024 |
) |
|
17831 | 2025 |
(MenuItem |
2026 |
label: '-' |
|
2027 |
) |
|
2028 |
(MenuItem |
|
2029 |
label: 'Remove .bak and .sav Files...' |
|
2030 |
itemValue: removeBakAndSavFiles |
|
2031 |
) |
|
15211 | 2032 |
) |
2033 |
nil |
|
2034 |
nil |
|
2035 |
) |
|
2036 |
! |
|
2037 |
||
2038 |
newMenu |
|
2039 |
"This resource specification was automatically generated |
|
2040 |
by the MenuEditor of ST/X." |
|
2041 |
||
2042 |
"Do not manually edit this!! If it is corrupted, |
|
2043 |
the MenuEditor may not be able to read the specification." |
|
2044 |
||
2045 |
" |
|
2046 |
MenuEditor new openOnClass:DirectoryTreeBrowser andSelector:#newMenu |
|
2047 |
(Menu new fromLiteralArrayEncoding:(DirectoryTreeBrowser newMenu)) startUp |
|
2048 |
" |
|
2049 |
||
2050 |
<resource: #menu> |
|
2051 |
||
2052 |
^ |
|
2053 |
#(#Menu |
|
2054 |
#( |
|
2055 |
#(#MenuItem |
|
2056 |
#label: 'Directory...' |
|
2057 |
#translateLabel: true |
|
2058 |
#value: #newDirectory |
|
2059 |
) |
|
2060 |
#(#MenuItem |
|
2061 |
#label: 'File...' |
|
2062 |
#translateLabel: true |
|
2063 |
#value: #newFile |
|
2064 |
) |
|
2065 |
#(#MenuItem |
|
2066 |
#label: 'Hard Link...' |
|
2067 |
#translateLabel: true |
|
2068 |
#value: #newHardLink |
|
2069 |
) |
|
2070 |
#(#MenuItem |
|
2071 |
#label: 'Symbolic Link...' |
|
2072 |
#translateLabel: true |
|
2073 |
#value: #newSoftLink |
|
2074 |
) |
|
2075 |
) |
|
2076 |
nil |
|
2077 |
nil |
|
2078 |
) |
|
2079 |
! |
|
2080 |
||
2081 |
scmMenuSlice |
|
2082 |
"This resource specification was automatically generated |
|
2083 |
by the MenuEditor of ST/X." |
|
2084 |
||
2085 |
"Do not manually edit this!! If it is corrupted, |
|
2086 |
the MenuEditor may not be able to read the specification." |
|
2087 |
||
2088 |
||
2089 |
" |
|
2090 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#scmMenuSlice |
|
2091 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser scmMenuSlice)) startUp |
|
2092 |
" |
|
2093 |
||
2094 |
<resource: #menu> |
|
2095 |
||
2096 |
^ |
|
2097 |
#(Menu |
|
2098 |
( |
|
2099 |
(MenuItem |
|
2100 |
label: 'CVS' |
|
2101 |
isVisible: cvsMenusAreShown |
|
2102 |
submenuChannel: cvsMenu |
|
2103 |
) |
|
2104 |
(MenuItem |
|
2105 |
label: 'SVN' |
|
2106 |
isVisible: svnMenusAreShown |
|
2107 |
submenuChannel: svnMenu |
|
2108 |
) |
|
2109 |
(MenuItem |
|
2110 |
label: 'Mercurial' |
|
2111 |
isVisible: mercurialMenusAreShown |
|
2112 |
submenuChannel: mercurialMenu |
|
2113 |
) |
|
2114 |
(MenuItem |
|
2115 |
label: 'HG' |
|
2116 |
isVisible: hgMenusAreShown |
|
2117 |
submenuChannel: hgMenu |
|
2118 |
) |
|
2119 |
(MenuItem |
|
2120 |
label: 'Perforce' |
|
2121 |
isVisible: perforceMenusAreShown |
|
2122 |
submenuChannel: perforceMenu |
|
2123 |
) |
|
2124 |
) |
|
2125 |
nil |
|
2126 |
nil |
|
2127 |
) |
|
2128 |
! |
|
2129 |
||
2130 |
showMenuSpec |
|
2131 |
"This resource specification was automatically generated |
|
2132 |
by the MenuEditor of ST/X." |
|
2133 |
||
2134 |
"Do not manually edit this!! If it is corrupted, |
|
2135 |
the MenuEditor may not be able to read the specification." |
|
2136 |
||
2137 |
" |
|
2138 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#showMenuSpec |
|
2139 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser showMenuSpec)) startUp |
|
2140 |
" |
|
2141 |
||
2142 |
<resource: #menu> |
|
2143 |
||
2144 |
^ |
|
2145 |
#(Menu |
|
2146 |
( |
|
2147 |
(MenuItem |
|
2148 |
label: 'Hidden Files' |
|
2149 |
translateLabel: true |
|
2150 |
hideMenuOnActivated: false |
|
2151 |
indication: showHiddenFiles |
|
2152 |
) |
|
2153 |
(MenuItem |
|
2154 |
label: '-' |
|
2155 |
) |
|
2156 |
(MenuItem |
|
2157 |
label: 'Directory Tree' |
|
2158 |
translateLabel: true |
|
2159 |
hideMenuOnActivated: false |
|
2160 |
indication: showDirectoryTree |
|
2161 |
) |
|
2162 |
(MenuItem |
|
2163 |
label: 'Regular Files in TreeView (Left)' |
|
2164 |
translateLabel: true |
|
2165 |
hideMenuOnActivated: false |
|
2166 |
indication: viewFilesInDirectoryTree |
|
2167 |
) |
|
2168 |
(MenuItem |
|
2169 |
label: 'Directories in ContentsView (Right)' |
|
2170 |
translateLabel: true |
|
2171 |
hideMenuOnActivated: false |
|
2172 |
indication: viewDirsInContentsBrowser |
|
2173 |
) |
|
2174 |
(MenuItem |
|
2175 |
enabled: enableViewNoteBookApplication |
|
2176 |
label: 'File Applications' |
|
2177 |
translateLabel: true |
|
2178 |
hideMenuOnActivated: false |
|
2179 |
indication: viewNoteBookApplicationHolder |
|
2180 |
) |
|
2181 |
(MenuItem |
|
2182 |
label: '-' |
|
2183 |
) |
|
2184 |
(MenuItem |
|
2185 |
label: 'DiskUsage' |
|
2186 |
translateLabel: true |
|
2187 |
hideMenuOnActivated: false |
|
2188 |
indication: showDiskUsageHolder |
|
2189 |
) |
|
2190 |
) |
|
2191 |
nil |
|
2192 |
nil |
|
2193 |
) |
|
2194 |
! |
|
2195 |
||
2196 |
showMenuSpecForDialog |
|
2197 |
"This resource specification was automatically generated |
|
2198 |
by the MenuEditor of ST/X." |
|
2199 |
||
2200 |
"Do not manually edit this!! If it is corrupted, |
|
2201 |
the MenuEditor may not be able to read the specification." |
|
2202 |
||
2203 |
" |
|
2204 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#showMenuSpecForDialog |
|
2205 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser showMenuSpecForDialog)) startUp |
|
2206 |
" |
|
2207 |
||
2208 |
<resource: #menu> |
|
2209 |
||
2210 |
^ |
|
2211 |
#(Menu |
|
2212 |
( |
|
2213 |
(MenuItem |
|
2214 |
label: 'Hidden Files' |
|
2215 |
translateLabel: true |
|
2216 |
hideMenuOnActivated: false |
|
2217 |
indication: showHiddenFiles |
|
2218 |
) |
|
2219 |
) |
|
2220 |
nil |
|
2221 |
nil |
|
2222 |
) |
|
2223 |
! |
|
2224 |
||
2225 |
sortMenu |
|
2226 |
"This resource specification was automatically generated |
|
2227 |
by the MenuEditor of ST/X." |
|
2228 |
||
2229 |
"Do not manually edit this!! If it is corrupted, |
|
2230 |
the MenuEditor may not be able to read the specification." |
|
2231 |
||
2232 |
" |
|
2233 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#sortMenu |
|
2234 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser sortMenu)) startUp |
|
2235 |
" |
|
2236 |
||
2237 |
<resource: #menu> |
|
2238 |
||
2239 |
^ |
|
2240 |
#(#Menu |
|
2241 |
#( |
|
2242 |
#(#MenuItem |
|
2243 |
#label: 'By Filename' |
|
2244 |
#translateLabel: true |
|
2245 |
#hideMenuOnActivated: false |
|
2246 |
#choice: #sortBlockProperty |
|
2247 |
#choiceValue: #baseName |
|
2248 |
) |
|
2249 |
#(#MenuItem |
|
2250 |
#label: 'By Extension' |
|
2251 |
#translateLabel: true |
|
2252 |
#hideMenuOnActivated: false |
|
2253 |
#choice: #sortBlockProperty |
|
2254 |
#choiceValue: #suffix |
|
2255 |
) |
|
2256 |
#(#MenuItem |
|
2257 |
#label: 'By Permissions' |
|
2258 |
#translateLabel: true |
|
2259 |
#hideMenuOnActivated: false |
|
2260 |
#choice: #sortBlockProperty |
|
2261 |
#choiceValue: #permissions |
|
2262 |
) |
|
2263 |
#(#MenuItem |
|
2264 |
#label: 'By Owner' |
|
2265 |
#translateLabel: true |
|
2266 |
#isVisible: #viewOwner |
|
2267 |
#hideMenuOnActivated: false |
|
2268 |
#choice: #sortBlockProperty |
|
2269 |
#choiceValue: #owner |
|
2270 |
) |
|
2271 |
#(#MenuItem |
|
2272 |
#label: 'By Group' |
|
2273 |
#translateLabel: true |
|
2274 |
#isVisible: #viewOwner |
|
2275 |
#hideMenuOnActivated: false |
|
2276 |
#choice: #sortBlockProperty |
|
2277 |
#choiceValue: #group |
|
2278 |
) |
|
2279 |
#(#MenuItem |
|
2280 |
#label: 'By Size' |
|
2281 |
#translateLabel: true |
|
2282 |
#hideMenuOnActivated: false |
|
2283 |
#choice: #sortBlockProperty |
|
2284 |
#choiceValue: #fileSize |
|
2285 |
) |
|
2286 |
#(#MenuItem |
|
2287 |
#label: 'By Date && Time' |
|
2288 |
#translateLabel: true |
|
2289 |
#hideMenuOnActivated: false |
|
2290 |
#choice: #sortBlockProperty |
|
2291 |
#choiceValue: #modificationTime |
|
2292 |
) |
|
2293 |
#(#MenuItem |
|
2294 |
#label: '-' |
|
2295 |
) |
|
2296 |
#(#MenuItem |
|
2297 |
#label: 'Ignore Case in Sort' |
|
2298 |
#translateLabel: true |
|
2299 |
#hideMenuOnActivated: false |
|
2300 |
#indication: #sortCaseless |
|
2301 |
) |
|
2302 |
#(#MenuItem |
|
2303 |
#label: 'Directories before Files' |
|
2304 |
#translateLabel: true |
|
2305 |
#hideMenuOnActivated: false |
|
2306 |
#indication: #sortDirectoriesBeforeFiles |
|
2307 |
) |
|
2308 |
) |
|
2309 |
nil |
|
2310 |
nil |
|
2311 |
) |
|
2312 |
! |
|
2313 |
||
2314 |
toolsMenuSpec |
|
2315 |
"This resource specification was automatically generated |
|
2316 |
by the MenuEditor of ST/X." |
|
2317 |
||
2318 |
"Do not manually edit this!! If it is corrupted, |
|
2319 |
the MenuEditor may not be able to read the specification." |
|
2320 |
||
2321 |
||
2322 |
" |
|
2323 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#toolsMenuSpec |
|
2324 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser toolsMenuSpec)) startUp |
|
2325 |
" |
|
2326 |
||
2327 |
<resource: #menu> |
|
2328 |
||
2329 |
^ |
|
2330 |
#(Menu |
|
2331 |
( |
|
2332 |
(MenuItem |
|
2333 |
label: 'Open (Win32-Shell)' |
|
2334 |
itemValue: doOpenWithShellCommand |
|
2335 |
isVisible: systemIsDOS |
|
2336 |
) |
|
2337 |
(MenuItem |
|
18013 | 2338 |
label: 'Open (OSX-Application)' |
2339 |
itemValue: doOpenWithShellCommand |
|
2340 |
isVisible: systemIsOSX |
|
2341 |
) |
|
2342 |
(MenuItem |
|
15211 | 2343 |
label: 'Execute UNIX Command...' |
2344 |
itemValue: doExecuteCommand |
|
2345 |
isVisible: systemIsUnix |
|
2346 |
) |
|
2347 |
(MenuItem |
|
2348 |
label: 'Execute DOS Command...' |
|
2349 |
itemValue: doExecuteCommand |
|
2350 |
isVisible: systemIsDOS |
|
2351 |
) |
|
2352 |
(MenuItem |
|
2353 |
label: 'Execute Script...' |
|
2354 |
itemValue: doExecuteScript |
|
2355 |
) |
|
2356 |
(MenuItem |
|
2357 |
enabled: canDoTerminal |
|
2358 |
label: 'Shell Terminal' |
|
2359 |
itemValue: openTerminal |
|
2360 |
isVisible: canDoTerminalAndSystemIsUnix |
|
2361 |
labelImage: (ResourceRetriever ToolbarIconLibrary terminal16x16Icon 'Shell Terminal') |
|
2362 |
) |
|
2363 |
(MenuItem |
|
2364 |
enabled: canDoTerminal |
|
2365 |
label: 'DOS Terminal' |
|
2366 |
itemValue: openTerminal |
|
2367 |
isVisible: canDoTerminalAndSystemIsDOS |
|
2368 |
labelImage: (ResourceRetriever ToolbarIconLibrary terminal16x16Icon 'DOS Terminal') |
|
2369 |
) |
|
2370 |
(MenuItem |
|
2371 |
label: '-' |
|
2372 |
) |
|
2373 |
(MenuItem |
|
2374 |
enabled: hasFileSelection |
|
2375 |
label: 'Changes Browser' |
|
2376 |
itemValue: openChangesBrowser |
|
2377 |
) |
|
2378 |
(MenuItem |
|
2379 |
enabled: hasFileSelection |
|
2380 |
label: 'ChangeSet Browser' |
|
2381 |
itemValue: openChangeSetBrowser |
|
2382 |
isVisible: changeSetBrowserItemVisible |
|
2383 |
) |
|
2384 |
(MenuItem |
|
2385 |
enabled: hasFileSelection |
|
2386 |
label: 'Workspace' |
|
2387 |
itemValue: openWorkspace |
|
2388 |
) |
|
2389 |
(MenuItem |
|
2390 |
label: '-' |
|
2391 |
) |
|
2392 |
(MenuItem |
|
2393 |
enabled: canReadAbbrevFile |
|
2394 |
label: 'Install Autoloaded' |
|
2395 |
itemValue: readAbbrevFile |
|
2396 |
) |
|
2397 |
(MenuItem |
|
2398 |
enabled: anySTFilesPresent |
|
2399 |
label: 'Install all ST-Files as Autoloaded' |
|
2400 |
itemValue: installAllAsAutoloaded |
|
2401 |
) |
|
2402 |
(MenuItem |
|
2403 |
enabled: recursiveAnySTFilesPresent |
|
2404 |
label: 'Recursive Install all ST-Files as Autoloaded' |
|
2405 |
itemValue: installAllAsAutoloadedRecursive |
|
2406 |
) |
|
2407 |
(MenuItem |
|
2408 |
label: '-' |
|
2409 |
) |
|
2410 |
(MenuItem |
|
2411 |
enabled: hasJava |
|
2412 |
label: 'Add Directory to Java Source Path (stx:libjava)' |
|
2413 |
itemValue: addDirToJavaSourcePath |
|
2414 |
) |
|
2415 |
(MenuItem |
|
2416 |
enabled: hasJava |
|
2417 |
label: 'Add Selected Files to Java Source Path (stx:libjava)' |
|
2418 |
itemValue: fileAddToJavaSourcePath |
|
2419 |
) |
|
2420 |
(MenuItem |
|
2421 |
label: '-' |
|
2422 |
) |
|
2423 |
(MenuItem |
|
2424 |
label: 'File Operations' |
|
2425 |
submenuChannel: fileOpMenu |
|
2426 |
) |
|
2427 |
(MenuItem |
|
2428 |
label: 'File Utilities' |
|
2429 |
submenu: |
|
2430 |
(Menu |
|
2431 |
( |
|
2432 |
(MenuItem |
|
2433 |
enabled: hasFileSelection |
|
2434 |
label: 'Editor' |
|
2435 |
itemValue: openEditor |
|
2436 |
) |
|
2437 |
(MenuItem |
|
2438 |
enabled: hasFileSelection |
|
2439 |
label: 'HTML Reader' |
|
2440 |
itemValue: openHTMLReader |
|
2441 |
) |
|
2442 |
(MenuItem |
|
2443 |
enabled: hasFileSelection |
|
2444 |
label: 'Web Browser' |
|
2445 |
itemValue: openWebBrowser |
|
2446 |
) |
|
2447 |
(MenuItem |
|
2448 |
label: 'XML Inspector' |
|
2449 |
itemValue: inspectXmlFile |
|
2450 |
isVisible: hasXml |
|
2451 |
showBusyCursorWhilePerforming: true |
|
2452 |
) |
|
2453 |
(MenuItem |
|
2454 |
enabled: hasFileSelection |
|
2455 |
label: 'Acroread (PDF Viewer)' |
|
2456 |
itemValue: openPDFViewer |
|
2457 |
) |
|
2458 |
(MenuItem |
|
2459 |
enabled: hasASN1AndSelection |
|
2460 |
label: 'ASN1 Browser' |
|
2461 |
itemValue: openASN1Browser |
|
2462 |
isVisible: hasASN1 |
|
2463 |
) |
|
2464 |
(MenuItem |
|
2465 |
enabled: hasCBrowser |
|
2466 |
label: 'C Browser' |
|
2467 |
itemValue: openCBrowser |
|
2468 |
isVisible: hasCBrowser |
|
2469 |
) |
|
2470 |
(MenuItem |
|
2471 |
enabled: canOpenMonticelloBrowser |
|
2472 |
label: 'Monticello Browser' |
|
2473 |
itemValue: doOpenMonticelloBrowser |
|
2474 |
) |
|
2475 |
(MenuItem |
|
2476 |
enabled: hasJavaAndSelection |
|
2477 |
label: 'Applet Viewer' |
|
2478 |
itemValue: openAppletViewer |
|
2479 |
isVisible: hasJava |
|
2480 |
) |
|
2481 |
(MenuItem |
|
2482 |
enabled: hasMP3PlayerAndSelection |
|
2483 |
label: 'MP3 Player' |
|
2484 |
itemValue: openMP3Player |
|
2485 |
isVisible: hasMP3Player |
|
2486 |
) |
|
2487 |
(MenuItem |
|
2488 |
enabled: hasFileSelection |
|
2489 |
label: 'xv (Image Viewer)' |
|
2490 |
itemValue: openXV |
|
2491 |
isVisible: systemIsUnix |
|
2492 |
) |
|
2493 |
(MenuItem |
|
2494 |
enabled: currentFilesAreInSameDirectory |
|
2495 |
label: 'Slide Show' |
|
2496 |
itemValue: openSlideShow |
|
2497 |
isVisible: hasSlideShow |
|
2498 |
) |
|
2499 |
(MenuItem |
|
2500 |
enabled: hasFileSelection |
|
2501 |
label: 'gv (Postscript Viewer)' |
|
2502 |
itemValue: openGV |
|
2503 |
isVisible: systemIsUnix |
|
2504 |
) |
|
2505 |
(MenuItem |
|
2506 |
enabled: hasMP3PlayerAndSelection |
|
2507 |
label: 'MP3 Player' |
|
2508 |
itemValue: openMP3Player |
|
2509 |
isVisible: hasMP3Player |
|
2510 |
) |
|
2511 |
(MenuItem |
|
2512 |
enabled: hasFileSelection |
|
2513 |
label: 'Realplay (avi viewer)' |
|
2514 |
itemValue: openRP |
|
2515 |
isVisible: systemIsUnix |
|
2516 |
) |
|
2517 |
(MenuItem |
|
2518 |
label: '-' |
|
2519 |
) |
|
2520 |
(MenuItem |
|
2521 |
label: 'Smalltalk' |
|
2522 |
submenu: |
|
2523 |
(Menu |
|
2524 |
( |
|
2525 |
(MenuItem |
|
2526 |
enabled: hasSnapshotSelection |
|
2527 |
label: 'Snapshot Image Browser' |
|
2528 |
itemValue: openSnapshotImageBrowser |
|
2529 |
) |
|
2530 |
(MenuItem |
|
2531 |
enabled: canCreateNewProject |
|
2532 |
label: 'Create Smalltalk Project' |
|
2533 |
itemValue: createProjectAndOpenProjectBrowser |
|
2534 |
) |
|
2535 |
(MenuItem |
|
2536 |
label: '-' |
|
2537 |
) |
|
2538 |
(MenuItem |
|
2539 |
enabled: hasResourceFileSelected |
|
2540 |
label: 'Show Contents of Resourcefile' |
|
2541 |
itemValue: readAndShowResources |
|
2542 |
) |
|
2543 |
(MenuItem |
|
2544 |
enabled: hasResourceFileSelected |
|
2545 |
label: 'Resource File Editor' |
|
2546 |
itemValue: openResourceFileEditor |
|
2547 |
showBusyCursorWhilePerforming: true |
|
2548 |
) |
|
2549 |
(MenuItem |
|
2550 |
label: '-' |
|
2551 |
) |
|
2552 |
(MenuItem |
|
2553 |
enabled: hasFileSelection |
|
2554 |
label: 'Contents as ByteArray' |
|
2555 |
itemValue: fileContentsAsByteArray |
|
2556 |
) |
|
2557 |
) |
|
2558 |
nil |
|
2559 |
nil |
|
2560 |
) |
|
2561 |
) |
|
2562 |
(MenuItem |
|
2563 |
label: 'Image' |
|
2564 |
submenu: |
|
2565 |
(Menu |
|
2566 |
( |
|
2567 |
(MenuItem |
|
2568 |
enabled: hasFileSelection |
|
2569 |
label: 'Image Editor' |
|
2570 |
itemValue: openImageEditor |
|
2571 |
) |
|
2572 |
(MenuItem |
|
2573 |
enabled: hasFileSelection |
|
2574 |
label: 'Image Preview' |
|
2575 |
itemValue: openImagePreview |
|
2576 |
) |
|
2577 |
(MenuItem |
|
2578 |
enabled: hasFileSelection |
|
2579 |
label: 'Image Inspector' |
|
2580 |
itemValue: openImageInspector |
|
2581 |
) |
|
2582 |
(MenuItem |
|
2583 |
label: '-' |
|
2584 |
) |
|
2585 |
(MenuItem |
|
2586 |
enabled: hasFileSelection |
|
2587 |
label: 'Convert to GIF' |
|
2588 |
itemValue: convertImageToGIF |
|
2589 |
) |
|
2590 |
(MenuItem |
|
2591 |
enabled: hasFileSelection |
|
2592 |
label: 'Convert to PNG' |
|
2593 |
itemValue: convertImageToPNG |
|
2594 |
) |
|
2595 |
(MenuItem |
|
2596 |
enabled: hasFileSelection |
|
2597 |
label: 'Convert to XPM' |
|
2598 |
itemValue: convertImageToXPM |
|
2599 |
) |
|
2600 |
(MenuItem |
|
2601 |
enabled: hasFileSelection |
|
2602 |
label: 'Convert to JPG' |
|
2603 |
itemValue: convertImageToJPG |
|
2604 |
) |
|
2605 |
) |
|
2606 |
nil |
|
2607 |
nil |
|
2608 |
) |
|
2609 |
) |
|
2610 |
(MenuItem |
|
15528 | 2611 |
label: 'Web' |
2612 |
submenu: |
|
2613 |
(Menu |
|
2614 |
( |
|
2615 |
(MenuItem |
|
2616 |
label: 'Fetch File by URL...' |
|
2617 |
itemValue: fetchFileByURL |
|
2618 |
) |
|
2619 |
) |
|
2620 |
nil |
|
2621 |
nil |
|
2622 |
) |
|
2623 |
) |
|
2624 |
(MenuItem |
|
15211 | 2625 |
enabled: hasZipFileSelectedHolder |
2626 |
label: 'ZipFile Tool' |
|
2627 |
itemValue: openZipTool |
|
2628 |
) |
|
2629 |
(MenuItem |
|
2630 |
enabled: hasFileSelection |
|
2631 |
label: 'Hex Dump' |
|
2632 |
itemValue: fileHexDump |
|
2633 |
) |
|
2634 |
) |
|
2635 |
nil |
|
2636 |
nil |
|
2637 |
) |
|
2638 |
) |
|
2639 |
(MenuItem |
|
2640 |
label: 'Find' |
|
2641 |
submenu: |
|
2642 |
(Menu |
|
2643 |
( |
|
2644 |
(MenuItem |
|
2645 |
label: 'File...' |
|
2646 |
itemValue: fileFindFile |
|
2647 |
) |
|
2648 |
(MenuItem |
|
2649 |
enabled: hasFileSelection |
|
2650 |
label: 'Same Contents as Selected...' |
|
2651 |
itemValue: fileFindDuplicateFile |
|
2652 |
) |
|
2653 |
(MenuItem |
|
2654 |
label: 'Duplicate Files' |
|
2655 |
itemValue: fileFindDuplicates |
|
2656 |
) |
|
2657 |
(MenuItem |
|
2658 |
enabled: hasSelection |
|
2659 |
label: 'All Duplicate Files (Recursive)' |
|
2660 |
itemValue: fileFindAllDuplicates |
|
2661 |
) |
|
2662 |
(MenuItem |
|
17686 | 2663 |
label: 'Similar Image Files (by Colors)' |
15211 | 2664 |
itemValue: fileFindSimilarImages |
2665 |
isVisible: hasImageColorHistogram |
|
2666 |
) |
|
17686 | 2667 |
(MenuItem |
2668 |
label: 'Similar Image Files (by Form)' |
|
2669 |
itemValue: fileFindSimilarImagesByForm |
|
2670 |
isVisible: hasImageHistogram |
|
2671 |
) |
|
15211 | 2672 |
) |
2673 |
nil |
|
2674 |
nil |
|
2675 |
) |
|
2676 |
) |
|
2677 |
) |
|
2678 |
nil |
|
2679 |
nil |
|
2680 |
) |
|
17686 | 2681 |
|
2682 |
"Modified: / 10-09-2017 / 16:50:09 / cg" |
|
15211 | 2683 |
! |
2684 |
||
2685 |
viewDetailsMenuSpec |
|
2686 |
"This resource specification was automatically generated |
|
2687 |
by the MenuEditor of ST/X." |
|
2688 |
||
2689 |
"Do not manually edit this!! If it is corrupted, |
|
2690 |
the MenuEditor may not be able to read the specification." |
|
2691 |
||
2692 |
" |
|
2693 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#viewDetailsMenuSpec |
|
2694 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser viewDetailsMenuSpec)) startUp |
|
2695 |
" |
|
2696 |
||
2697 |
<resource: #menu> |
|
2698 |
||
2699 |
^ |
|
2700 |
#(#Menu |
|
2701 |
#( |
|
2702 |
#(#MenuItem |
|
2703 |
#label: '-' |
|
2704 |
) |
|
2705 |
#(#MenuItem |
|
2706 |
#label: 'Hidden Files' |
|
2707 |
#translateLabel: true |
|
2708 |
#indication: #showHiddenFiles |
|
2709 |
) |
|
2710 |
) |
|
2711 |
nil |
|
2712 |
nil |
|
2713 |
) |
|
2714 |
! ! |
|
3892 | 2715 |
|
11144 | 2716 |
!AbstractFileBrowser class methodsFor:'menu specs-scm'! |
2717 |
||
15211 | 2718 |
cvsMenu |
2719 |
"This resource specification was automatically generated |
|
2720 |
by the MenuEditor of ST/X." |
|
2721 |
||
2722 |
"Do not manually edit this!! If it is corrupted, |
|
2723 |
the MenuEditor may not be able to read the specification." |
|
2724 |
||
2725 |
||
2726 |
" |
|
2727 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#cvsMenu |
|
2728 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser cvsMenu)) startUp |
|
2729 |
" |
|
2730 |
||
2731 |
<resource: #menu> |
|
2732 |
||
2733 |
^ |
|
2734 |
#(Menu |
|
2735 |
( |
|
2736 |
(MenuItem |
|
2737 |
label: 'Commit (CVS)...' |
|
2738 |
itemValue: cvsCommit |
|
2739 |
translateLabel: true |
|
2740 |
) |
|
2741 |
(MenuItem |
|
2742 |
enabled: canCvsAddAndCommit |
|
2743 |
label: 'Add && Commit...' |
|
2744 |
itemValue: cvsAddAndCommit |
|
2745 |
translateLabel: true |
|
2746 |
) |
|
2747 |
(MenuItem |
|
2748 |
enabled: canCvsAddAndCommit |
|
2749 |
label: 'Add as Binary && Commit...' |
|
2750 |
itemValue: cvsAddBinaryAndCommit |
|
2751 |
translateLabel: true |
|
2752 |
) |
|
2753 |
(MenuItem |
|
2754 |
label: 'Commit Folder (CVS)...' |
|
2755 |
itemValue: cvsCommitFolder |
|
2756 |
translateLabel: true |
|
2757 |
) |
|
2758 |
(MenuItem |
|
2759 |
label: '-' |
|
2760 |
) |
|
2761 |
(MenuItem |
|
2762 |
enabled: hasSelection |
|
2763 |
label: 'Update selected Files/Directories' |
|
2764 |
itemValue: cvsUpdateSelection |
|
2765 |
translateLabel: true |
|
2766 |
) |
|
2767 |
(MenuItem |
|
2768 |
label: 'Update Directory Local' |
|
2769 |
itemValue: cvsUpdateAll |
|
2770 |
translateLabel: true |
|
2771 |
) |
|
2772 |
(MenuItem |
|
2773 |
label: 'Update Directory Recursive' |
|
2774 |
itemValue: cvsUpdateAllRecursive |
|
2775 |
translateLabel: true |
|
2776 |
) |
|
2777 |
(MenuItem |
|
2778 |
label: '-' |
|
2779 |
) |
|
2780 |
(MenuItem |
|
2781 |
enabled: hasSelection |
|
2782 |
label: 'Tag...' |
|
2783 |
itemValue: cvsTagSelection |
|
2784 |
translateLabel: true |
|
2785 |
) |
|
2786 |
(MenuItem |
|
2787 |
enabled: hasSelection |
|
2788 |
label: 'Revision Log' |
|
2789 |
itemValue: cvsRevisionLog |
|
2790 |
translateLabel: true |
|
2791 |
) |
|
2792 |
(MenuItem |
|
2793 |
enabled: hasSelection |
|
2794 |
label: 'Compare with newest in Repository' |
|
2795 |
itemValue: cvsCompareWithNewest |
|
2796 |
translateLabel: true |
|
2797 |
) |
|
2798 |
(MenuItem |
|
2799 |
label: '-' |
|
2800 |
) |
|
2801 |
(MenuItem |
|
2802 |
enabled: canRemoveCVSContainer |
|
2803 |
label: 'Remove File && CVS Container...' |
|
2804 |
itemValue: cvsRemoveFileAndCVSContainer |
|
2805 |
translateLabel: true |
|
2806 |
) |
|
2807 |
) |
|
2808 |
nil |
|
2809 |
nil |
|
2810 |
) |
|
2811 |
! |
|
2812 |
||
2813 |
mercurialMenu |
|
2814 |
"This resource specification was automatically generated |
|
2815 |
by the MenuEditor of ST/X." |
|
2816 |
||
2817 |
"Do not manually edit this!! If it is corrupted, |
|
2818 |
the MenuEditor may not be able to read the specification." |
|
2819 |
||
2820 |
||
2821 |
" |
|
2822 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#mercurialMenu |
|
2823 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser mercurialMenu)) startUp |
|
2824 |
" |
|
2825 |
||
2826 |
<resource: #menu> |
|
2827 |
||
2828 |
^ |
|
2829 |
#(Menu |
|
2830 |
( |
|
2831 |
(MenuItem |
|
2832 |
label: 'Add' |
|
2833 |
itemValue: mercurialAdd |
|
2834 |
translateLabel: true |
|
2835 |
) |
|
2836 |
(MenuItem |
|
2837 |
label: 'Commit Changes' |
|
2838 |
itemValue: mercurialCommit |
|
2839 |
translateLabel: true |
|
2840 |
) |
|
2841 |
(MenuItem |
|
2842 |
label: 'Push...' |
|
2843 |
itemValue: mercurialPush |
|
2844 |
translateLabel: true |
|
2845 |
) |
|
2846 |
(MenuItem |
|
2847 |
label: 'Status' |
|
2848 |
itemValue: mercurialStatus |
|
2849 |
translateLabel: true |
|
2850 |
) |
|
2851 |
(MenuItem |
|
2852 |
label: '-' |
|
2853 |
) |
|
2854 |
(MenuItem |
|
2855 |
label: 'Init' |
|
2856 |
itemValue: mercurialInit |
|
2857 |
translateLabel: true |
|
2858 |
) |
|
2859 |
) |
|
2860 |
nil |
|
2861 |
nil |
|
2862 |
) |
|
2863 |
||
2864 |
"Modified: / 17-01-2012 / 15:57:40 / cg" |
|
2865 |
! |
|
2866 |
||
2867 |
perforceMenu |
|
2868 |
"This resource specification was automatically generated |
|
2869 |
by the MenuEditor of ST/X." |
|
2870 |
||
2871 |
"Do not manually edit this!! If it is corrupted, |
|
2872 |
the MenuEditor may not be able to read the specification." |
|
2873 |
||
2874 |
||
2875 |
" |
|
2876 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#perforceMenu |
|
2877 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser perforceMenu)) startUp |
|
2878 |
" |
|
2879 |
||
2880 |
<resource: #menu> |
|
2881 |
||
2882 |
^ |
|
2883 |
#(Menu |
|
2884 |
( |
|
2885 |
(MenuItem |
|
2886 |
label: 'Commit' |
|
2887 |
itemValue: perforceCommit |
|
2888 |
translateLabel: true |
|
2889 |
) |
|
2890 |
) |
|
2891 |
nil |
|
2892 |
nil |
|
2893 |
) |
|
2894 |
||
2895 |
"Created: / 15-01-2012 / 13:12:30 / cg" |
|
2896 |
! ! |
|
11144 | 2897 |
|
3892 | 2898 |
!AbstractFileBrowser class methodsFor:'misc'! |
2899 |
||
2900 |
newLock |
|
2901 |
^ CodeExecutionLock new |
|
2902 |
! ! |
|
2903 |
||
17288 | 2904 |
!AbstractFileBrowser class methodsFor:'queries'! |
2905 |
||
2906 |
isAbstract |
|
2907 |
^ self == AbstractFileBrowser |
|
2908 |
! ! |
|
2909 |
||
17868 | 2910 |
!AbstractFileBrowser class methodsFor:'queries-file'! |
2911 |
||
2912 |
getBestDirectoryFrom:directories |
|
2913 |
"from a set of directories, return the common parent directory" |
|
2914 |
||
2915 |
|stringCol firstPre| |
|
2916 |
||
2917 |
directories isEmpty ifTrue:[^ nil]. |
|
2918 |
directories size == 1 ifTrue:[^ directories first]. |
|
2919 |
stringCol := (directories collect:[:file| file asString]) asOrderedCollection. |
|
2920 |
firstPre := stringCol at:1. |
|
2921 |
stringCol from:2 do:[:el| |
|
2922 |
firstPre := firstPre commonPrefixWith:el. |
|
2923 |
]. |
|
2924 |
(firstPre endsWith:(OperatingSystem fileSeparator)) ifTrue:[ |
|
2925 |
firstPre removeLast. |
|
2926 |
]. |
|
2927 |
^ firstPre asFilename |
|
2928 |
! ! |
|
2929 |
||
5644
e24749db1f5f
share resources with FileBrowser
Claus Gittinger <cg@exept.de>
parents:
5634
diff
changeset
|
2930 |
!AbstractFileBrowser class methodsFor:'resources'! |
e24749db1f5f
share resources with FileBrowser
Claus Gittinger <cg@exept.de>
parents:
5634
diff
changeset
|
2931 |
|
e24749db1f5f
share resources with FileBrowser
Claus Gittinger <cg@exept.de>
parents:
5634
diff
changeset
|
2932 |
classResources |
e24749db1f5f
share resources with FileBrowser
Claus Gittinger <cg@exept.de>
parents:
5634
diff
changeset
|
2933 |
^ FileBrowser classResources |
e24749db1f5f
share resources with FileBrowser
Claus Gittinger <cg@exept.de>
parents:
5634
diff
changeset
|
2934 |
! ! |
e24749db1f5f
share resources with FileBrowser
Claus Gittinger <cg@exept.de>
parents:
5634
diff
changeset
|
2935 |
|
17746 | 2936 |
!AbstractFileBrowser class methodsFor:'utilities - dump'! |
4610 | 2937 |
|
17744 | 2938 |
contentsOfBytesAsDump:data base:numberBase numberOfAddressDigits:addrDigits addressStart:virtualStart characterEncoding:characterEncodingSymbol |
2939 |
"utility helper: generate a hexDump with addresses; |
|
2940 |
characterEncodingSymbol determines how characters are to be shown in the right (character) columns. |
|
2941 |
By default, this is iso8859-1, but supported are also ebcdic and ascii7, |
|
2942 |
to support display of alien encoded binary data." |
|
2943 |
||
2944 |
|lines nHexLines replacementForUnprintable colsPerByte characterDecoder| |
|
2945 |
||
2946 |
(characterEncodingSymbol isNil or:[characterEncodingSymbol == #'iso8859-1']) ifFalse:[ |
|
2947 |
characterDecoder := CharacterEncoder encoderToEncodeFrom:characterEncodingSymbol into:#unicode. |
|
2948 |
]. |
|
17252 | 2949 |
|
2950 |
"/ used to be: |
|
2951 |
"/ replacementForUnprintable := $. |
|
2952 |
replacementForUnprintable := Character value:16rB7. "/ a centered dot. |
|
11281
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2953 |
|
17744 | 2954 |
"/ cols needed per byte in the hex dump |
2955 |
colsPerByte := ((255 printStringRadix:numberBase) size). |
|
2956 |
||
11281
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2957 |
"generate a virtual collection which evaluates and returns lines on-demand" |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2958 |
|
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2959 |
nHexLines := (data size + 15) // 16. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2960 |
|
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2961 |
lines := VirtualArray new. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2962 |
lines setSize:nHexLines + (nHexLines // 16). |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2963 |
lines |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2964 |
generator:[:lineNr | |
17744 | 2965 |
|blockNr lineNrInBlock startOffset lineStream asciiLineStream byte line |
2966 |
decodedChar charPrinted| |
|
11281
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2967 |
|
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2968 |
blockNr := (lineNr - 1) // 17. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2969 |
lineNrInBlock := (lineNr - 1) \\ 17. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2970 |
|
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2971 |
lineNrInBlock == 16 ifTrue:[ |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2972 |
line := '' |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2973 |
] ifFalse:[ |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2974 |
startOffset := ((blockNr * 16) + lineNrInBlock) * 16. |
17744 | 2975 |
|
2976 |
"/ two streams; one for the hex bytes, one for the ascii-interpretation |
|
11281
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2977 |
lineStream := String writeStream. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2978 |
asciiLineStream := String writeStream. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2979 |
|
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2980 |
lineStream nextPutAll:((startOffset+virtualStart) hexPrintString:addrDigits). |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2981 |
lineStream nextPutAll:': '. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2982 |
1 to:16 do:[:i | |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2983 |
i ~~ 1 ifTrue:[ lineStream space ]. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2984 |
|
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2985 |
(startOffset + i) > data size ifTrue:[ |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2986 |
asciiLineStream nextPut:(Character space). |
17744 | 2987 |
lineStream spaces:colsPerByte. |
11281
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2988 |
] ifFalse:[ |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2989 |
byte := data at:startOffset + i. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2990 |
|
17746 | 2991 |
lineStream nextPutAll:(byte printStringRadix:numberBase size:colsPerByte fill:$0). |
17744 | 2992 |
|
11281
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2993 |
|
17744 | 2994 |
decodedChar := byte. |
2995 |
characterDecoder notNil ifTrue:[ |
|
2996 |
decodedChar := characterDecoder encode:byte. |
|
2997 |
]. |
|
2998 |
||
2999 |
charPrinted := replacementForUnprintable. |
|
3000 |
decodedChar notNil ifTrue:[ |
|
3001 |
((decodedChar between:32 and:127) or:[(decodedChar between:(128+32) and:(128+127))]) ifTrue:[ |
|
3002 |
charPrinted := Character value:decodedChar. |
|
16188 | 3003 |
] ifFalse:[ |
17744 | 3004 |
(decodedChar between:0 and:31) ifTrue:[ |
3005 |
"/ the 'nul', 'soh' .. 'gs' chars in unicodePage 2400 |
|
3006 |
"/ are perfect here, but usually not available in the font |
|
3007 |
"/ and we have currently no way of knowing if they are... |
|
3008 |
"/ (could let the font draw into a bitmap and check if there is something...) |
|
18274 | 3009 |
"/ For now, write a dot.· |
17744 | 3010 |
"/ charPrinted := (Character value:(byte + 16r2400)) |
3011 |
]. |
|
16188 | 3012 |
]. |
11281
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
3013 |
]. |
17744 | 3014 |
asciiLineStream nextPut:charPrinted. |
11281
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
3015 |
]. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
3016 |
]. |
17744 | 3017 |
line := (lineStream contents paddedTo:(addrDigits + 1 + ((colsPerByte+1)*16) + 6)) |
11281
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
3018 |
, asciiLineStream contents. |
11262 | 3019 |
]. |
11281
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
3020 |
line |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
3021 |
]. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
3022 |
^ lines. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
3023 |
|
17744 | 3024 |
"Created: / 12-11-2017 / 11:24:29 / cg" |
17750 | 3025 |
"Modified: / 12-11-2017 / 14:17:59 / cg" |
17744 | 3026 |
! |
3027 |
||
17753 | 3028 |
contentsOfBytesAsHexDump:data numberOfAddressDigits:addrDigits addressStart:virtualStart |
17744 | 3029 |
"utility helper: generate a hexDump with addresses; the character columns at the right show |
3030 |
the iso8859-1 characters" |
|
17753 | 3031 |
|
3032 |
^ self |
|
17744 | 3033 |
contentsOfBytesAsDump:data base:16 |
3034 |
numberOfAddressDigits:addrDigits |
|
3035 |
addressStart:virtualStart |
|
17753 | 3036 |
characterEncoding:#'iso8859-1' |
11262 | 3037 |
|
3038 |
"Created: / 13-02-2012 / 15:01:46 / cg" |
|
17744 | 3039 |
"Modified: / 12-11-2017 / 12:07:12 / cg" |
17753 | 3040 |
"Modified: / 14-11-2017 / 17:48:19 / mawalch" |
17744 | 3041 |
! |
3042 |
||
3043 |
contentsOfBytesAsHexDump:data numberOfAddressDigits:addrDigits addressStart:virtualStart characterEncoding:characterEncodingSymbol |
|
3044 |
"utility helper: generate a hexDump with addresses; |
|
3045 |
characterEncodingSymbol determines how characters are to be shown in the right (character) columns. |
|
3046 |
By default, this is iso8859-1, but supported are also ebcdic and ascii7, |
|
3047 |
to support display of alien encoded binary data." |
|
3048 |
||
3049 |
^ self |
|
3050 |
contentsOfBytesAsDump:data base:16 |
|
3051 |
numberOfAddressDigits:addrDigits |
|
3052 |
addressStart:virtualStart |
|
3053 |
characterEncoding:characterEncodingSymbol |
|
3054 |
||
3055 |
"Created: / 12-11-2017 / 11:21:44 / cg" |
|
3056 |
! |
|
3057 |
||
3058 |
contentsOfFileAsDump:f base:numberBase withLimit:limitOrNil lastPart:showLastPartOrNil characterEncoding:characterEncoding |
|
3059 |
"opens the file, get its contents and generates a dump for it" |
|
3060 |
||
4610 | 3061 |
|resources fileName stream data offs |
17768 | 3062 |
addrDigits lines answer sizeLimit showLastPart setNewLimit thisFileSizeString| |
4610 | 3063 |
|
3064 |
resources := self classResources. |
|
3065 |
||
3066 |
fileName := f baseName. |
|
3067 |
f isDirectory ifTrue:[ |
|
3068 |
Dialog warn:(resources string:'%1 is a directory.' with:fileName). |
|
3069 |
^ nil |
|
3070 |
]. |
|
3071 |
f exists ifFalse:[ |
|
3072 |
Dialog warn:(resources string:'oops, ''%1'' is gone or unreadable.' with:fileName). |
|
3073 |
^ nil |
|
3074 |
]. |
|
3075 |
f isReadable ifFalse:[ |
|
3076 |
Dialog warn:(resources string:'''%1'' is unreadable.' with:fileName). |
|
3077 |
^ nil |
|
3078 |
]. |
|
17768 | 3079 |
f fileSize > (self maxFileSizeShownWithoutAsking) ifTrue:[ |
8472 | 3080 |
limitOrNil notNil ifTrue:[ |
3081 |
sizeLimit := limitOrNil. |
|
3082 |
showLastPart := showLastPartOrNil |
|
3083 |
] ifFalse:[ |
|
17768 | 3084 |
setNewLimit := false. |
3085 |
thisFileSizeString := (UnitConverter fileSizeStringFor:f fileSize). |
|
3086 |
||
3087 |
Dialog |
|
3088 |
withOptoutOption:[ setNewLimit := true ] |
|
3089 |
labelled:(resources string:'No longer ask for files smaller than %1' with:thisFileSizeString) |
|
3090 |
do:[ |
|
3091 |
answer := Dialog |
|
3092 |
confirmWithCancel:(resources |
|
3093 |
stringWithCRs:'"%1" is very large (%2).\\Show all or only the first 4 Mb ?' |
|
3094 |
with:(fileName contractTo:40) allBold |
|
3095 |
with:thisFileSizeString) |
|
3096 |
labels:#('Cancel' 'Show All' 'Show First Part' ). |
|
3097 |
]. |
|
8472 | 3098 |
answer isNil ifTrue:[^ nil]. |
3099 |
answer ifTrue:[ |
|
17769 | 3100 |
sizeLimit := (4 * 1024 * 1024) "max:self maxFileSizeShownWithoutAsking". |
17768 | 3101 |
] ifFalse:[ |
3102 |
setNewLimit ifTrue:[ |
|
3103 |
self maxFileSizeShownWithoutAsking:(self maxFileSizeShownWithoutAsking max:f fileSize). |
|
3104 |
]. |
|
3105 |
]. |
|
8436 | 3106 |
]. |
4610 | 3107 |
]. |
3108 |
||
3109 |
stream := f readStream binary. |
|
8436 | 3110 |
sizeLimit notNil ifTrue:[ |
8472 | 3111 |
showLastPart == true ifTrue:[ |
3112 |
stream position:(f fileSize - sizeLimit). |
|
3113 |
]. |
|
8436 | 3114 |
data := stream nextBytes:sizeLimit. |
3115 |
] ifFalse:[ |
|
3116 |
data := stream contents. |
|
3117 |
]. |
|
4610 | 3118 |
stream close. |
3119 |
||
3120 |
offs := 0. |
|
3121 |
lines := StringCollection new. |
|
3122 |
||
3123 |
addrDigits := ((f fileSize + 1) log:16) truncated + 1. |
|
3124 |
||
11262 | 3125 |
^ self |
17744 | 3126 |
contentsOfBytesAsDump:data base:numberBase |
11262 | 3127 |
numberOfAddressDigits:addrDigits |
3128 |
addressStart:0 |
|
17744 | 3129 |
characterEncoding:characterEncoding |
3130 |
||
3131 |
"Created: / 12-11-2017 / 12:08:10 / cg" |
|
17769 | 3132 |
"Modified: / 19-11-2017 / 15:01:34 / cg" |
17744 | 3133 |
! |
3134 |
||
3135 |
contentsOfFileAsHexDump:f |
|
3136 |
"opens the file, get its contents and generates a dump for it" |
|
3137 |
||
3138 |
^ self |
|
3139 |
contentsOfFileAsHexDump:f |
|
3140 |
withLimit:nil |
|
3141 |
lastPart:nil |
|
3142 |
characterEncoding:#'iso8859-1' |
|
3143 |
||
3144 |
"Modified (comment): / 12-11-2017 / 12:09:30 / cg" |
|
3145 |
! |
|
3146 |
||
3147 |
contentsOfFileAsHexDump:f withLimit:limitOrNil lastPart:showLastPartOrNil |
|
3148 |
"opens the file, get its contents and generates a dump for it" |
|
3149 |
||
3150 |
^ self |
|
3151 |
contentsOfFileAsHexDump:f |
|
3152 |
withLimit:limitOrNil |
|
3153 |
lastPart:showLastPartOrNil |
|
3154 |
characterEncoding:#'iso-8859-1' |
|
3155 |
||
3156 |
"Modified (comment): / 12-11-2017 / 12:09:34 / cg" |
|
3157 |
! |
|
3158 |
||
3159 |
contentsOfFileAsHexDump:f withLimit:limitOrNil lastPart:showLastPartOrNil characterEncoding:characterEncoding |
|
3160 |
"opens the file, get its contents and generates a dump for it" |
|
3161 |
||
3162 |
^ self |
|
3163 |
contentsOfFileAsDump:f base:16 |
|
3164 |
withLimit:limitOrNil |
|
3165 |
lastPart:showLastPartOrNil |
|
3166 |
characterEncoding:characterEncoding |
|
3167 |
||
3168 |
"Created: / 12-11-2017 / 12:02:05 / cg" |
|
4610 | 3169 |
! ! |
3170 |
||
17868 | 3171 |
!AbstractFileBrowser class methodsFor:'utilities - files'! |
3172 |
||
3173 |
allFilesInDirectories:directories forWhich:aBlock |
|
3174 |
|allFiles| |
|
3175 |
||
3176 |
directories isEmpty ifTrue:[^ #()]. |
|
3177 |
||
3178 |
allFiles := OrderedCollection new. |
|
3179 |
directories do:[:dir| |
|
3180 |
[ |
|
3181 |
|fileNames| |
|
3182 |
||
3183 |
fileNames := dir directoryContents. |
|
3184 |
fileNames notNil ifTrue:[ |
|
3185 |
fileNames := fileNames |
|
3186 |
collect:[:fn | dir construct:fn] |
|
3187 |
thenSelect:[:fn | fn isDirectory not and:[aBlock value:fn]]. |
|
3188 |
allFiles addAll:fileNames. |
|
3189 |
] |
|
3190 |
] on:FileStream openErrorSignal do:[:ex| |
|
3191 |
self warn:(self classResources stringWithCRs:'Cannot access: %1\(%2)' |
|
3192 |
with:ex pathName |
|
3193 |
with:ex description). |
|
3194 |
ex proceedWith:nil. |
|
3195 |
]. |
|
3196 |
]. |
|
3197 |
||
3198 |
^ allFiles |
|
3199 |
! |
|
3200 |
||
3201 |
fileFindDuplicatesIn:directories |
|
3202 |
"scan directories for duplicate files. |
|
17871 | 3203 |
return a dictionary mapping duplicate files to their original; |
3204 |
the oldest file found will be the value (original), the younger files (copies) will be the keys. |
|
17868 | 3205 |
Files without duplicate(s) will not have an entry in the dictionary." |
3206 |
||
3207 |
|infoDir filesBySize anySameSized |
|
3208 |
result allFiles| |
|
3209 |
||
3210 |
directories isEmpty ifTrue:[^ #()]. |
|
3211 |
||
3212 |
allFiles := self allFilesInDirectories:directories forWhich:[:f | true]. |
|
3213 |
allFiles isEmpty ifTrue:[^ #()]. |
|
3214 |
||
3215 |
"/ for each, get the file's info (size, modificationTime etc.). |
|
3216 |
infoDir := Dictionary new. |
|
3217 |
allFiles do:[:fn | |
|
3218 |
infoDir at:fn put:(fn info) |
|
3219 |
]. |
|
3220 |
||
3221 |
"/ in a first pass, collect groups by the same size |
|
3222 |
"/ remember those fileSizes for which multiple files exist |
|
3223 |
filesBySize := Dictionary new. |
|
3224 |
anySameSized := false. |
|
3225 |
infoDir keysAndValuesDo:[:fn :info | |
|
3226 |
|sz entry| |
|
3227 |
||
3228 |
sz := info fileSize. |
|
3229 |
entry := filesBySize at:sz ifAbsentPut:[Set new]. |
|
3230 |
entry add:fn. |
|
3231 |
entry size > 1 ifTrue:[ anySameSized := true ]. |
|
3232 |
]. |
|
3233 |
||
3234 |
"/ any of same size ? |
|
3235 |
anySameSized ifFalse:[^ #() ]. |
|
3236 |
||
3237 |
result := Dictionary new. |
|
3238 |
||
3239 |
"/ now walk over the same-sized files and compare the contents. |
|
3240 |
filesBySize do:[:entry | |
|
3241 |
|files| |
|
3242 |
||
3243 |
entry size > 1 ifTrue:[ |
|
3244 |
files := entry asArray. |
|
3245 |
files |
|
3246 |
sort:[:a :b | |
|
3247 |
|tA tB| |
|
3248 |
tA := (infoDir at:a) modificationTime. |
|
3249 |
tB := (infoDir at:b) modificationTime. |
|
3250 |
tA < tB |
|
3251 |
]. |
|
3252 |
||
3253 |
1 to:files size-1 do:[:idx1 | |
|
3254 |
|fn1| |
|
3255 |
||
3256 |
fn1 := files at:idx1. |
|
3257 |
idx1+1 to:files size do:[:idx2 | |
|
3258 |
|fn2| |
|
3259 |
||
3260 |
fn2 := files at:idx2. |
|
3261 |
||
3262 |
(result at:fn2 ifAbsent:nil) ~= fn1 ifTrue:[ |
|
3263 |
"/ compare the files |
|
3264 |
(fn1 sameContentsAs:fn2) ifTrue:[ |
|
3265 |
"/ Transcript show:'Same: '; show:fn1 baseName; show:' and '; showCR:fn2 baseName. |
|
17871 | 3266 |
result at:fn2 put:fn1. |
17868 | 3267 |
] |
3268 |
] |
|
3269 |
] |
|
3270 |
] |
|
3271 |
] |
|
3272 |
]. |
|
3273 |
||
17869 | 3274 |
result := result associations copy. |
3275 |
"/ result := result collect:[:assoc | |
|
3276 |
"/ |f1 f2| |
|
3277 |
"/ |
|
3278 |
"/ f1 := assoc key asString. |
|
3279 |
"/ f2 := assoc value asString. |
|
3280 |
"/ f1 < f2 ifTrue:[ |
|
3281 |
"/ f2 -> f1 |
|
3282 |
"/ ] ifFalse:[ |
|
3283 |
"/ f1 -> f2 |
|
3284 |
"/ ] |
|
3285 |
"/ ]. |
|
17868 | 3286 |
"/ result sort:[:f1 :f2 | f1 key > f2 key "f2 value < f1 key value"]. |
3287 |
result sort:[:f1 :f2 | " f1 key > f2 key" f2 value < f1 key value]. |
|
17869 | 3288 |
result sort:[:f1 :f2 | f1 key < f2 key]. |
17868 | 3289 |
^ result |
3290 |
! ! |
|
3291 |
||
3892 | 3292 |
!AbstractFileBrowser methodsFor:'actions'! |
3293 |
||
3294 |
askForCommandFor:fileName thenDo:aBlock |
|
6284 | 3295 |
"setup and launch a querybox to ask for a unix command. |
3892 | 3296 |
Then evaluate aBlock passing the command-string as argument." |
3297 |
||
16160 | 3298 |
|box osName commandString alwaysOpenLikeThisHolder openCmd suffix| |
3892 | 3299 |
|
3300 |
osName := OperatingSystem platformName. |
|
3301 |
||
3302 |
box := FilenameEnterBox |
|
4414 | 3303 |
title:(resources string:'Execute %1 command:' with:osName) |
3304 |
okText:(resources string:'Execute') |
|
4523 | 3305 |
action:[:cmd | commandString := cmd]. |
3892 | 3306 |
|
3307 |
fileName notNil ifTrue:[ |
|
4414 | 3308 |
self initialCommandFor:fileName into:box. |
3892 | 3309 |
]. |
16160 | 3310 |
alwaysOpenLikeThisHolder := false asValue. |
3311 |
box verticalPanel add:((CheckBox label:'Always use this command for this file type') model:alwaysOpenLikeThisHolder). |
|
3892 | 3312 |
box directory:(self getDirWithoutFileName:fileName). |
16160 | 3313 |
box open. |
3314 |
||
3315 |
"/ box destroy. |
|
3316 |
alwaysOpenLikeThisHolder value ifTrue:[ |
|
3317 |
openCmd := commandString upTo:$". |
|
3318 |
suffix := fileName suffix. |
|
16306 | 3319 |
UserPreferences current |
3320 |
defaultFileOpenCommandFor:suffix put:(openCmd,' "%1"'); |
|
3321 |
beModified. |
|
3322 |
self breakPoint:#cg. |
|
16160 | 3323 |
]. |
3324 |
||
4523 | 3325 |
commandString notNil ifTrue:[ |
3326 |
aBlock value:commandString |
|
3327 |
]. |
|
3328 |
||
3892 | 3329 |
"Modified: / 7.9.1995 / 10:31:54 / claus" |
3330 |
"Modified: / 16.9.1997 / 15:35:10 / stefan" |
|
3331 |
"Modified: / 14.8.1998 / 14:12:52 / cg" |
|
3332 |
! |
|
3333 |
||
3334 |
changeFileBrowserTitleTo:aString |
|
4774 | 3335 |
self |
3336 |
applicationNamed:#FileBrowserV2 |
|
5009 | 3337 |
ifPresentDo:[:app | app changeFileBrowserTitleTo:aString] |
3892 | 3338 |
! |
3339 |
||
3340 |
copyFileList |
|
4774 | 3341 |
"copy the fileList to the clipBoard" |
3342 |
||
4973
e4b72eec43d3
refactoring the browserItemList access in directoryContentsBrowser
penk
parents:
4963
diff
changeset
|
3343 |
|fileList| |
e4b72eec43d3
refactoring the browserItemList access in directoryContentsBrowser
penk
parents:
4963
diff
changeset
|
3344 |
|
e4b72eec43d3
refactoring the browserItemList access in directoryContentsBrowser
penk
parents:
4963
diff
changeset
|
3345 |
fileList := self |
4774 | 3346 |
applicationNamed:#DirectoryContentsBrowser |
5009 | 3347 |
ifPresentDo:[:app | app browserFileList]. |
3348 |
||
3349 |
fileList notNil ifTrue:[ |
|
3350 |
self copyFileListToClipBoard:fileList. |
|
3351 |
] |
|
4973
e4b72eec43d3
refactoring the browserItemList access in directoryContentsBrowser
penk
parents:
4963
diff
changeset
|
3352 |
! |
e4b72eec43d3
refactoring the browserItemList access in directoryContentsBrowser
penk
parents:
4963
diff
changeset
|
3353 |
|
e4b72eec43d3
refactoring the browserItemList access in directoryContentsBrowser
penk
parents:
4963
diff
changeset
|
3354 |
copyFileListToClipBoard:fileList |
4774 | 3355 |
"copy the itemList to the clipBoard" |
3356 |
||
3357 |
|stream| |
|
3358 |
||
4973
e4b72eec43d3
refactoring the browserItemList access in directoryContentsBrowser
penk
parents:
4963
diff
changeset
|
3359 |
fileList isEmpty ifTrue:[^ self]. |
4774 | 3360 |
|
5772
603abfa8cf99
copy name(s) to clipboard - on lineFeed if only one file is selected
Claus Gittinger <cg@exept.de>
parents:
5756
diff
changeset
|
3361 |
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
|
3362 |
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
|
3363 |
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
|
3364 |
] ifFalse:[ |
603abfa8cf99
copy name(s) to clipboard - on lineFeed if only one file is selected
Claus Gittinger <cg@exept.de>
parents:
5756
diff
changeset
|
3365 |
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
|
3366 |
(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
|
3367 |
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
|
3368 |
] |
603abfa8cf99
copy name(s) to clipboard - on lineFeed if only one file is selected
Claus Gittinger <cg@exept.de>
parents:
5756
diff
changeset
|
3369 |
]. |
3892 | 3370 |
]. |
6034 | 3371 |
self window setClipboardText:stream contents. |
3892 | 3372 |
! |
3373 |
||
3374 |
copySelectedFilenames |
|
4774 | 3375 |
"copy the selected fileNames to the clipBoard" |
3376 |
||
4973
e4b72eec43d3
refactoring the browserItemList access in directoryContentsBrowser
penk
parents:
4963
diff
changeset
|
3377 |
|fileList| |
e4b72eec43d3
refactoring the browserItemList access in directoryContentsBrowser
penk
parents:
4963
diff
changeset
|
3378 |
|
e4b72eec43d3
refactoring the browserItemList access in directoryContentsBrowser
penk
parents:
4963
diff
changeset
|
3379 |
fileList := self |
4774 | 3380 |
applicationNamed:#DirectoryContentsBrowser |
5009 | 3381 |
ifPresentDo:[:appl | appl selectedFileNames]. |
3382 |
fileList notNil ifTrue:[ |
|
3383 |
self copyFileListToClipBoard:fileList. |
|
3384 |
]. |
|
3892 | 3385 |
! |
3386 |
||
10923 | 3387 |
doAddArchiver |
3388 |
|files| |
|
3389 |
||
3390 |
files := self currentSelectedFiles. |
|
3391 |
files size == 1 ifFalse:[ |
|
17818 | 3392 |
Dialog information:(resources string:'Select exactly one archive.'). |
10923 | 3393 |
^ self |
3394 |
]. |
|
3395 |
||
3396 |
self |
|
3397 |
applicationNamed:#FileApplicationNoteBook |
|
3398 |
ifPresentDo:[:appl | appl doAddArchiverOn:files first]. |
|
3399 |
||
3400 |
"Created: / 29-11-2011 / 19:01:31 / cg" |
|
17818 | 3401 |
"Modified: / 29-11-2017 / 12:25:47 / cg" |
10923 | 3402 |
! |
3403 |
||
3892 | 3404 |
doAddTerminal |
5960 | 3405 |
|dir| |
3406 |
||
3407 |
dir := self currentDirectory. |
|
3892 | 3408 |
|
5960 | 3409 |
dir isNil ifTrue:[ |
4414 | 3410 |
dir := Filename homeDirectory |
3892 | 3411 |
]. |
4774 | 3412 |
|
5009 | 3413 |
self |
3414 |
applicationNamed:#FileApplicationNoteBook |
|
3415 |
ifPresentDo:[:appl | appl addTerminalIn:dir]. |
|
3892 | 3416 |
! |
3417 |
||
3418 |
doOpenSearchFile |
|
5961 | 3419 |
|item file| |
3420 |
||
3421 |
file := self firstSelectedFileName. |
|
3422 |
file isNil ifTrue:[ |
|
3423 |
file := Filename homeDirectory asAbsoluteFilename. |
|
3424 |
]. |
|
3425 |
item := DirectoryContentsBrowser itemClass fileName:file. |
|
3892 | 3426 |
self openSearchFileOn:item. |
3427 |
! |
|
3428 |
||
3429 |
doShowFileContents |
|
5009 | 3430 |
self |
3431 |
applicationNamed:#DirectoryContentsBrowser |
|
3432 |
ifPresentDo:[:appl | ^ appl doShowFileContents]. |
|
3433 |
||
3434 |
^ nil |
|
3892 | 3435 |
! |
3436 |
||
3437 |
doShowProperties |
|
3438 |
"show long stat (file)-info" |
|
3439 |
||
3440 |
self fileGetInfo:true |
|
3441 |
! |
|
3442 |
||
14577 | 3443 |
enterAction |
3444 |
self |
|
3445 |
applicationNamed:#DirectoryContentsBrowser |
|
3446 |
ifPresentDo:[:appl | appl ~~ self ifTrue:[ appl enterAction ]]. |
|
3447 |
! |
|
3448 |
||
5528 | 3449 |
fileEncodingDialog |
14497 | 3450 |
"open a dialog to allow change of the file's character encoding. |
5528 | 3451 |
Files are converted to internal encoding when read, and converted back |
3452 |
to this encoding when saved. |
|
3453 |
Notice: currently, not too many encodings are supported by the system." |
|
3454 |
||
3455 |
|bindings encodings encodingDescr idx selectedEncoding| |
|
3456 |
||
3457 |
encodingDescr := CharacterEncoder supportedExternalEncodings. |
|
3458 |
encodings := encodingDescr collect:[:d | d isNil ifTrue:[nil] ifFalse:[d first]]. |
|
3459 |
||
3460 |
bindings := IdentityDictionary new. |
|
3461 |
bindings at:#encodingList put:encodingDescr. |
|
3462 |
bindings at:#selectedEncoding put:(encodings indexOf:self fileEncoding ifAbsent:1) asValue. |
|
5737 | 3463 |
bindings at:#lockFileEncoding put:(self lockFileEncodingHolder value asValue). |
3464 |
||
5528 | 3465 |
(self openDialogInterface:#encodingDialogSpec withBindings:bindings) |
3466 |
ifTrue:[ |
|
3467 |
idx := (bindings at:#selectedEncoding) value. |
|
3468 |
selectedEncoding := encodings at:idx. |
|
3469 |
selectedEncoding notNil ifTrue:[ |
|
5704 | 3470 |
self fileEncoding:selectedEncoding asSymbol. |
5528 | 3471 |
]. |
5737 | 3472 |
self lockFileEncoding:(bindings at:#lockFileEncoding) value. |
5528 | 3473 |
]. |
3474 |
||
3475 |
"Modified: 30.6.1997 / 14:41:12 / cg" |
|
3476 |
! |
|
3477 |
||
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
3478 |
gotoFile:aFilename |
5380
2f738f3a34b1
fixed bug introduced by stefans beautification ;-)
Claus Gittinger <cg@exept.de>
parents:
5374
diff
changeset
|
3479 |
"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
|
3480 |
|
5959 | 3481 |
|currentFileNameHolder currentSel| |
3482 |
||
3483 |
currentFileNameHolder := self currentFileNameHolder. |
|
3484 |
||
3485 |
currentSel := currentFileNameHolder value. |
|
5380
2f738f3a34b1
fixed bug introduced by stefans beautification ;-)
Claus Gittinger <cg@exept.de>
parents:
5374
diff
changeset
|
3486 |
(currentSel includes:aFilename) ifFalse:[ |
9677 | 3487 |
self withWaitCursorDo:[ |
3488 |
currentFileNameHolder value:(OrderedCollection with:(aFilename asAbsoluteFilename)). |
|
3489 |
] |
|
3490 |
]. |
|
3491 |
||
3492 |
"Modified: / 29-12-2010 / 11:04:29 / cg" |
|
3892 | 3493 |
! |
3494 |
||
11053 | 3495 |
lineEndConventionDialog |
3496 |
"open a dialog to allow change of the line end conventions |
|
3497 |
(when writing files)" |
|
3498 |
||
3499 |
|bindings| |
|
3500 |
||
3501 |
bindings := IdentityDictionary new. |
|
3502 |
bindings at:#lineEndConvention put:(self lineEndConvention asValue). |
|
3503 |
||
3504 |
(self openDialogInterface:#lineEndConventionDialogSpec withBindings:bindings) |
|
3505 |
ifTrue:[ |
|
15208 | 3506 |
self lineEndConventionHolder value:(bindings at:#lineEndConvention) value asSymbol |
11053 | 3507 |
]. |
3508 |
||
3509 |
"Created: / 06-01-2012 / 15:34:51 / cg" |
|
3510 |
! |
|
3511 |
||
4392 | 3512 |
newTextEditor |
5009 | 3513 |
self |
3514 |
applicationNamed:#FileApplicationNoteBook |
|
15936 | 3515 |
ifPresentDo:[:appl | |
3516 |
|editor files item| |
|
3517 |
||
3518 |
editor := appl newTextEditor. |
|
3519 |
(files := self currentSelectedFiles) size == 1 ifTrue:[ |
|
3520 |
item := DirectoryContentsBrowser itemClass fileName:files first. |
|
3521 |
editor item:item. |
|
3522 |
]. |
|
3523 |
^ editor |
|
3524 |
]. |
|
5009 | 3525 |
|
3526 |
^ nil. |
|
3527 |
! |
|
3528 |
||
3529 |
openApplByFileItem:anItem |
|
8490 | 3530 |
"/ q: is the following always wanted ? |
9267 | 3531 |
self window sensor shiftDown ifFalse:[ |
17715 | 3532 |
((anItem mimeType startsWith:'application/x-expecco-') |
3533 |
and:[(Smalltalk at:#ExpeccoStartup) notNil]) ifTrue:[ |
|
3534 |
(Smalltalk at:#ExpeccoStartup) main:{anItem fileName asString}. |
|
3535 |
^ self. |
|
3536 |
]. |
|
3537 |
||
10669
079d85556631
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
10556
diff
changeset
|
3538 |
"/ cg: no - batch and shell scripts are to be |
079d85556631
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
10556
diff
changeset
|
3539 |
"/ anItem fileName isExecutableProgram ifTrue:[ |
079d85556631
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
10556
diff
changeset
|
3540 |
"/ self executeCommand:anItem fileName pathName. |
079d85556631
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
10556
diff
changeset
|
3541 |
"/ ^ self. |
079d85556631
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
10556
diff
changeset
|
3542 |
"/ ]. |
9267 | 3543 |
|
8490 | 3544 |
"/ OperatingSystem isMSWINDOWSlike ifTrue:[ |
3545 |
"/ Error handle:[:ex | |
|
3546 |
"/ ] do:[ |
|
3547 |
"/ OperatingSystem |
|
3548 |
"/ shellExecute:nil |
|
3549 |
"/ lpOperation:'open' |
|
3550 |
"/ lpFile:(anItem fileName pathName) |
|
3551 |
"/ lpParameters:nil |
|
3552 |
"/ lpDirectory:(self directory pathName) |
|
3553 |
"/ nShowCmd:#SW_SHOWNORMAL. |
|
3554 |
"/ ^ self. |
|
3555 |
"/ ] |
|
3556 |
"/ ] |
|
9267 | 3557 |
]. |
5306 | 3558 |
^ self |
5009 | 3559 |
applicationNamed:#FileApplicationNoteBook |
5306 | 3560 |
ifPresentDo:[:appl | appl openApplByFileItem:anItem]. |
10669
079d85556631
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
10556
diff
changeset
|
3561 |
|
079d85556631
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
10556
diff
changeset
|
3562 |
"Modified: / 06-09-2011 / 11:11:15 / cg" |
17715 | 3563 |
"Modified: / 18-10-2017 / 10:15:15 / stefan" |
3892 | 3564 |
! |
3565 |
||
4392 | 3566 |
openApplForFile:aFilename |
5306 | 3567 |
^ self openApplByFileItem:(DirectoryContentsBrowser itemClass fileName:aFilename). |
4392 | 3568 |
! |
3569 |
||
3892 | 3570 |
openCommandResultApplication |
3571 |
||
5009 | 3572 |
self |
3573 |
applicationNamed:#FileApplicationNoteBook |
|
3574 |
ifPresentDo:[:appl | ^ appl openCommandResultApplication]. |
|
3575 |
||
3576 |
^ nil |
|
3892 | 3577 |
! |
3578 |
||
5010 | 3579 |
openNewTextEditorOn:anItem |
5009 | 3580 |
self |
3581 |
applicationNamed:#FileApplicationNoteBook |
|
5010 | 3582 |
ifPresentDo:[:appl | ^ appl openNewTextEditorOn:anItem ]. |
5009 | 3583 |
|
3584 |
^ nil |
|
4880
87f511659680
edit file in context menu of DirectoryContentsBroser opens a new tab
penk
parents:
4878
diff
changeset
|
3585 |
! |
87f511659680
edit file in context menu of DirectoryContentsBroser opens a new tab
penk
parents:
4878
diff
changeset
|
3586 |
|
5010 | 3587 |
openSearchFileOn:anItem |
5009 | 3588 |
self |
3589 |
applicationNamed:#FileApplicationNoteBook |
|
5010 | 3590 |
ifPresentDo:[:appl | ^ appl openSearchFileOn:anItem]. |
5009 | 3591 |
|
3592 |
^ nil. |
|
3892 | 3593 |
! |
3594 |
||
5162 | 3595 |
openTextEditorForFile:aFilename |
3596 |
^ self openTextEditorOn:(DirectoryContentsBrowser itemClass fileName:aFilename). |
|
3597 |
! |
|
3598 |
||
5010 | 3599 |
openTextEditorOn:anItem |
5009 | 3600 |
self |
3601 |
applicationNamed:#FileApplicationNoteBook |
|
5010 | 3602 |
ifPresentDo:[:appl | ^ appl openTextEditorOn:anItem ]. |
5009 | 3603 |
|
3604 |
^ nil. |
|
3892 | 3605 |
! |
3606 |
||
5010 | 3607 |
openTextEditorOn:anItem type:aDirDescrOrFile |
5009 | 3608 |
self |
3609 |
applicationNamed:#FileApplicationNoteBook |
|
5010 | 3610 |
ifPresentDo:[:appl | ^ appl openTextEditorOn:anItem type:aDirDescrOrFile]. |
5009 | 3611 |
|
3612 |
^ nil. |
|
4618 | 3613 |
! |
3614 |
||
5959 | 3615 |
setCurrentFileName:aFilename |
3616 |
self setCurrentFileNames:(OrderedCollection with:aFilename). |
|
3617 |
! |
|
3618 |
||
3619 |
setCurrentFileNames:aCollectionOfFilenames |
|
3620 |
self currentFileNameHolder value:aCollectionOfFilenames. |
|
3621 |
! |
|
3622 |
||
11053 | 3623 |
tabStopConversionDialog |
3624 |
"open a dialog to allow change of the tab stop conversion (when reading/writing files)" |
|
3625 |
||
3626 |
|bindings| |
|
3627 |
||
3628 |
bindings := IdentityDictionary new. |
|
3629 |
bindings at:#tabStops put:(self inputTabColumnConversion asValue). |
|
3630 |
||
3631 |
(self openDialogInterface:#tabStopConversionDialogSpec withBindings:bindings) |
|
3632 |
ifTrue:[ |
|
3633 |
self inputTabColumnConversionHolder value:(bindings at:#tabStops) value |
|
3634 |
]. |
|
3635 |
||
3636 |
"Created: / 06-01-2012 / 15:36:06 / cg" |
|
3637 |
! |
|
3638 |
||
3892 | 3639 |
updateAndSelect:aColOfFiles |
4785
5a3f7a0c3ff1
symbolic link creation code fixed
Claus Gittinger <cg@exept.de>
parents:
4782
diff
changeset
|
3640 |
self updateCurrentDirectory. |
4707
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
3641 |
aColOfFiles notNil ifTrue:[ |
5959 | 3642 |
self setCurrentFileNames:aColOfFiles |
4707
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
3643 |
]. |
3892 | 3644 |
! |
3645 |
||
3646 |
updateCurrentDirectory |
|
5739 | 3647 |
self updateCurrentDirectory:false |
3648 |
! |
|
3649 |
||
3650 |
updateCurrentDirectory:withReread |
|
4785
5a3f7a0c3ff1
symbolic link creation code fixed
Claus Gittinger <cg@exept.de>
parents:
4782
diff
changeset
|
3651 |
DirectoryContents flushCachedDirectoryFor:(self getBestDirectory). |
5a3f7a0c3ff1
symbolic link creation code fixed
Claus Gittinger <cg@exept.de>
parents:
4782
diff
changeset
|
3652 |
|
5009 | 3653 |
self |
3654 |
applicationNamed:#DirectoryContentsBrowser |
|
5739 | 3655 |
ifPresentDo:[:appl | withReread ifTrue:[appl doUpdate] ifFalse:[appl doUpdateDirectoryContents]]. |
5009 | 3656 |
self |
3657 |
applicationNamed:#DirectoryTreeBrowser |
|
3658 |
ifPresentDo:[:appl | appl doUpdate]. |
|
4345 | 3659 |
! |
3660 |
||
5739 | 3661 |
updateCurrentDirectoryWithReread |
3662 |
self updateCurrentDirectory:true |
|
3663 |
! |
|
3664 |
||
4345 | 3665 |
withActivityIndicationDo:aBlock |
3666 |
||
3667 |
self activityVisibilityChannel value:true. |
|
3668 |
[ |
|
9361 | 3669 |
self withWaitCursorDo:[ |
3670 |
aBlock value. |
|
3671 |
] |
|
4345 | 3672 |
] ensure:[ |
3673 |
self activityVisibilityChannel value:false. |
|
3674 |
] |
|
3892 | 3675 |
! ! |
3676 |
||
3677 |
!AbstractFileBrowser methodsFor:'actions bookmarks'! |
|
3678 |
||
3679 |
addBookmark |
|
3680 |
self currentFilesAreInSameDirectory ifFalse:[^ self]. |
|
6725 | 3681 |
self addBookmarks:(self currentSelectedDirectories). |
5960 | 3682 |
self class saveBookmarksInDefaultBookmarksFile |
4679 | 3683 |
! |
3684 |
||
3685 |
addBookmarks:aColOfDirectories |
|
4672
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
3686 |
aColOfDirectories do:[ :path | |
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
3687 |
self class addBookmark:path |
3892 | 3688 |
]. |
3689 |
! |
|
3690 |
||
8013 | 3691 |
editBookmarks |
17849 | 3692 |
self class editBookmarksWithDefault: self currentSelectedDirectories firstOrNil. |
3693 |
||
3694 |
"Modified: / 13-12-2017 / 23:24:39 / stefan" |
|
8013 | 3695 |
! |
3696 |
||
3892 | 3697 |
hasBookmarks |
4672
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
3698 |
^ self class hasBookmarks |
3892 | 3699 |
! |
3700 |
||
3701 |
hasBookmarksToRemove |
|
3702 |
|bookmarks directories| |
|
3703 |
||
3982 | 3704 |
directories := self currentSelectedDirectories. |
3892 | 3705 |
bookmarks := self class directoryBookmarks. |
17416 | 3706 |
^ (bookmarks notEmptyOrNil and:[directories notEmpty]) |
3707 |
||
3708 |
"Modified: / 17-02-2017 / 08:25:22 / cg" |
|
3892 | 3709 |
! |
3710 |
||
3711 |
removeBookmark |
|
4672
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
3712 |
self currentSelectedDirectories do:[:dir| |
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
3713 |
self class removeBookmark:dir |
3892 | 3714 |
]. |
4679 | 3715 |
! |
3716 |
||
3717 |
saveBookmarks |
|
3718 |
self class saveBookmarks |
|
3892 | 3719 |
! ! |
3720 |
||
3721 |
!AbstractFileBrowser methodsFor:'actions history'! |
|
3722 |
||
3723 |
addToCommandHistory:aCommandString for:aFilename |
|
6369 | 3724 |
|cmd suffix cmdHist historySize| |
3892 | 3725 |
|
3726 |
cmdHist := self class commandHistory. |
|
6482
00207f456339
isEmptyOrNil / notEmptyOrNil refactoring
Claus Gittinger <cg@exept.de>
parents:
6479
diff
changeset
|
3727 |
(aCommandString notEmptyOrNil) ifTrue:[ |
4414 | 3728 |
cmdHist notNil ifTrue:[ |
3729 |
cmdHist addFirst:aCommandString. |
|
6369 | 3730 |
historySize := self class commandHistorySize. |
3731 |
(historySize notNil and:[cmdHist size > historySize]) ifTrue:[ |
|
4414 | 3732 |
cmdHist removeLast |
3733 |
] |
|
3734 |
]. |
|
3735 |
aFilename notNil ifTrue:[ |
|
3736 |
cmd := aCommandString copyTo:(aCommandString indexOf:Character space ifAbsent:[aCommandString size + 1])-1. |
|
3737 |
DefaultCommandPerSuffix isNil ifTrue:[ |
|
3738 |
DefaultCommandPerSuffix := Dictionary new. |
|
3739 |
]. |
|
3740 |
suffix := aFilename asFilename suffix. |
|
3741 |
suffix notNil ifTrue:[ |
|
3742 |
DefaultCommandPerSuffix at:suffix put:cmd. |
|
3743 |
] |
|
3744 |
] |
|
3892 | 3745 |
] |
3746 |
! |
|
3747 |
||
3748 |
doBack |
|
6286 | 3749 |
"go backward in the history" |
3892 | 3750 |
|
4022 | 3751 |
| fileName| |
3752 |
||
6369 | 3753 |
fileName := self directoryHistory goBackward. |
3892 | 3754 |
fileName notNil ifTrue:[ |
4347 | 3755 |
self gotoFile:(fileName asFilename). |
3892 | 3756 |
] |
3757 |
! |
|
3758 |
||
3759 |
doForward |
|
6286 | 3760 |
"go forward in the history" |
3892 | 3761 |
|
3964 | 3762 |
| fileName| |
3763 |
||
6369 | 3764 |
fileName := self directoryHistory goForward. |
3892 | 3765 |
fileName notNil ifTrue:[ |
4414 | 3766 |
self gotoFile:(fileName asFilename). |
4022 | 3767 |
] ifFalse:[ |
4414 | 3768 |
self enableForward value:false. |
4022 | 3769 |
|
3770 |
]. |
|
3892 | 3771 |
! ! |
3772 |
||
3773 |
!AbstractFileBrowser methodsFor:'applications'! |
|
3774 |
||
5009 | 3775 |
applicationNamed:anApplicationName ifPresentDo:aBlock |
3776 |
|appl| |
|
3777 |
||
3778 |
appl := self applications at:anApplicationName ifAbsent:nil. |
|
3779 |
appl notNil ifTrue:[ |
|
3780 |
^ aBlock value:appl |
|
3781 |
]. |
|
3782 |
^ nil. |
|
3783 |
! |
|
3784 |
||
4004 | 3785 |
directoryContentsBrowser |
3786 |
^ self applications at:#DirectoryContentsBrowser ifAbsent:nil. |
|
3892 | 3787 |
! ! |
3788 |
||
3789 |
!AbstractFileBrowser methodsFor:'aspects'! |
|
3790 |
||
3791 |
applications |
|
3792 |
^ aspects at:#applications |
|
3793 |
! |
|
3794 |
||
3795 |
backgroundProcesses |
|
3796 |
||
3797 |
^ self aspectFor:#backgroundProcesses ifAbsent:[List new] |
|
3798 |
! |
|
3799 |
||
4230 | 3800 |
canMake |
15259 | 3801 |
^ self aspectFor:#canMake ifAbsent:[ ValueHolder with:false ]. |
4230 | 3802 |
! |
3803 |
||
18246 | 3804 |
canOpenChangeBrowser |
3805 |
^ self aspectFor:#canOpenChangeBrowser ifAbsent:[ false asValue ]. |
|
3806 |
||
3807 |
"Created: / 30-06-2018 / 18:29:53 / Claus Gittinger" |
|
3808 |
! |
|
3809 |
||
3892 | 3810 |
currentDirectories |
6725 | 3811 |
" returns a holder on a Collection of all currently selected directories |
3812 |
if only a file is selected, currentDirectories holds the directory of the file |
|
3892 | 3813 |
" |
3814 |
||
3815 |
^ self aspectFor:#currentDirectories ifAbsent:[ (OrderedCollection new) asValue ]. |
|
3816 |
! |
|
3817 |
||
6725 | 3818 |
currentDirectoriesValue |
3819 |
" returns a Collection of all currently selected directories |
|
3820 |
if only a file is selected, currentDirectories holds the directory of the file |
|
3821 |
" |
|
3822 |
||
3823 |
^ self currentDirectories value |
|
3824 |
! |
|
3825 |
||
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
3826 |
currentDirectory |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
3827 |
"return the single current directory or nil" |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
3828 |
|
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
3829 |
|directories| |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
3830 |
|
6725 | 3831 |
directories := self currentSelectedDirectories. |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
3832 |
(directories size ~= 1) ifTrue:[ |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
3833 |
^ nil |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
3834 |
]. |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
3835 |
^ directories first. |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
3836 |
! |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
3837 |
|
13856 | 3838 |
currentDirectoryDisplayed |
3839 |
"Return a directory as Filename that is currently displayed in the browser" |
|
3840 |
||
3841 |
^self subclassResponsibility |
|
3842 |
||
3843 |
"Created: / 14-01-2013 / 11:57:17 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
3844 |
! |
|
3845 |
||
3892 | 3846 |
currentFileNameHolder |
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
3847 |
"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
|
3848 |
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
|
3849 |
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
|
3850 |
|
6589 | 3851 |
^ self aspectFor:#currentFileNameHolder |
3852 |
ifAbsent:[ |
|
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
3853 |
|currentSel| |
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3854 |
|
4692 | 3855 |
currentSel := self class currentSelection. |
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
3856 |
currentSel isEmpty ifTrue:[ |
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
3857 |
currentSel := OrderedCollection with:(Filename currentDirectory asAbsoluteFilename) |
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
3858 |
]. |
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
3859 |
currentSel asValue |
6589 | 3860 |
] |
3861 |
notPresentDo:[:holder| |
|
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
3862 |
|filenames newFilenames| |
4213
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
3863 |
filenames := holder value. |
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
3864 |
newFilenames := Set new. |
6589 | 3865 |
filenames do:[:eachFilename| |
3866 |
|existingFilename| |
|
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
3867 |
existingFilename := eachFilename. |
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
3868 |
existingFilename notNil ifTrue:[ |
9649
ad956ada348e
changed: #currentFileNameHolder
Claus Gittinger <cg@exept.de>
parents:
9607
diff
changeset
|
3869 |
[existingFilename isRootDirectory or:[existingFilename exists]] whileFalse:[ |
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
3870 |
existingFilename := existingFilename directory. |
4955
378481247391
if no item is selected directory up action do nothing now
penk
parents:
4950
diff
changeset
|
3871 |
]. |
9649
ad956ada348e
changed: #currentFileNameHolder
Claus Gittinger <cg@exept.de>
parents:
9607
diff
changeset
|
3872 |
existingFilename exists ifTrue:[ |
ad956ada348e
changed: #currentFileNameHolder
Claus Gittinger <cg@exept.de>
parents:
9607
diff
changeset
|
3873 |
newFilenames add:existingFilename. |
ad956ada348e
changed: #currentFileNameHolder
Claus Gittinger <cg@exept.de>
parents:
9607
diff
changeset
|
3874 |
]. |
4955
378481247391
if no item is selected directory up action do nothing now
penk
parents:
4950
diff
changeset
|
3875 |
] |
4213
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
3876 |
]. |
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
3877 |
newFilenames asOrderedCollection. |
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
3878 |
] |
9649
ad956ada348e
changed: #currentFileNameHolder
Claus Gittinger <cg@exept.de>
parents:
9607
diff
changeset
|
3879 |
|
ad956ada348e
changed: #currentFileNameHolder
Claus Gittinger <cg@exept.de>
parents:
9607
diff
changeset
|
3880 |
"Modified: / 27-11-2010 / 15:42:45 / cg" |
3892 | 3881 |
! |
3882 |
||
5528 | 3883 |
defaultFileEncoding |
3884 |
^ #'iso8859-1' "/ #'utf-8' |
|
3885 |
! |
|
3886 |
||
3892 | 3887 |
enableDirectoryUp |
3888 |
||
15259 | 3889 |
^ self aspectFor:#enableDirectoryUp ifAbsent:[ValueHolder with:false] |
3892 | 3890 |
! |
3891 |
||
6456 | 3892 |
enableGotoDefaultDirectory |
15259 | 3893 |
^ self aspectFor:#enableGotoDefaultDirectory ifAbsent:[ ValueHolder with:true ]. |
4593 | 3894 |
! |
3895 |
||
8168 | 3896 |
enableGotoDesktop |
14308 | 3897 |
"/ backward compatibility |
3898 |
^ self enableGotoDesktopDirectory. |
|
8168 | 3899 |
! |
3900 |
||
9572 | 3901 |
enableGotoDesktopDirectory |
15259 | 3902 |
^ self aspectFor:#enableGotoDesktopDirectory ifAbsent:[ ValueHolder with:true ]. |
9572 | 3903 |
|
3904 |
"Created: / 01-10-2010 / 16:19:17 / cg" |
|
3905 |
! |
|
3906 |
||
18352 | 3907 |
enableGotoDownloadsDirectory |
3908 |
^ self aspectFor:#enableGotoDownloadsDirectory ifAbsent:[ ValueHolder with:true ]. |
|
3909 |
||
3910 |
"Created: / 01-10-2010 / 16:19:17 / cg" |
|
3911 |
! |
|
3912 |
||
6434 | 3913 |
enableGotoSmalltalkDirectory |
6456 | 3914 |
^ self aspectFor:#enableGotoSmalltalkDirectory ifAbsent:[ true asValue ]. |
6434 | 3915 |
! |
3916 |
||
17187 | 3917 |
enableGotoSmalltalkWorkspaceDirectory |
3918 |
^ self aspectFor:#enableGotoSmalltalkWorkspaceDirectory ifAbsent:[ true asValue ]. |
|
3919 |
! |
|
3920 |
||
9677 | 3921 |
enableGotoTempDirectory |
3922 |
^ self aspectFor:#enableGotoTempDirectory ifAbsent:[ true asValue ]. |
|
3923 |
||
3924 |
"Created: / 29-12-2010 / 11:01:17 / cg" |
|
3925 |
! |
|
3926 |
||
3892 | 3927 |
enableHome |
3928 |
||
3929 |
^ self aspectFor:#enableHome ifAbsent:[ true asValue ]. |
|
3930 |
! |
|
3931 |
||
9596 | 3932 |
enableMakeCurrentDirectory |
3933 |
^ self aspectFor:#enableMakeCurrentDirectory ifAbsent:[ true asValue ]. |
|
3934 |
||
3935 |
"Created: / 26-10-2010 / 17:17:58 / cg" |
|
3936 |
! |
|
3937 |
||
3892 | 3938 |
enableViewNoteBookApplication |
3939 |
||
3940 |
^ self aspectFor:#enableViewNoteBookApplication ifAbsent:[false asValue] |
|
3941 |
! |
|
3942 |
||
5528 | 3943 |
fileEncoding |
3944 |
^ self fileEncodingHolder value |
|
3945 |
! |
|
3946 |
||
3947 |
fileEncoding:newEncoding |
|
5533 | 3948 |
self fileEncodingHolder value:newEncoding. |
3949 |
||
3950 |
self |
|
3951 |
applicationNamed:#FileApplicationNoteBook |
|
3952 |
ifPresentDo:[:nb | |
|
3953 |
|appl| |
|
3954 |
||
3955 |
appl := nb selectedApplication. |
|
5535 | 3956 |
(appl notNil and:[appl isTextEditor]) ifTrue:[ |
5533 | 3957 |
appl fileEncoding:newEncoding |
3958 |
] |
|
3959 |
]. |
|
5528 | 3960 |
! |
3961 |
||
5737 | 3962 |
fileEncodingHolder |
3963 |
^ self |
|
3964 |
aspectFor:#fileEncodingHolder |
|
3965 |
ifAbsent:[ |
|
3966 |
self |
|
3967 |
applicationNamed:#FileApplicationNoteBook |
|
3968 |
ifPresentDo:[:appl | appl fileEncodingHolder]. |
|
3969 |
] |
|
3970 |
! |
|
3971 |
||
17485 | 3972 |
fileEntryFieldHolder |
3973 |
^ self subclassResponsibility. |
|
3974 |
||
3975 |
"Created: / 31-03-2017 / 11:36:49 / stefan" |
|
3976 |
! |
|
3977 |
||
5961 | 3978 |
firstSelectedFileName |
3979 |
|files| |
|
3980 |
||
7560 | 3981 |
files := self currentSelectedObjects. |
5961 | 3982 |
files notEmpty ifTrue:[ |
3983 |
^ files first |
|
3984 |
]. |
|
3985 |
^ nil |
|
7560 | 3986 |
|
3987 |
"Modified: / 04-12-2006 / 13:14:53 / cg" |
|
5961 | 3988 |
! |
3989 |
||
6456 | 3990 |
gotoDefaultDirectoryIsVisible |
9596 | 3991 |
^ true. |
3992 |
"/ ^ (Filename defaultDirectory asAbsoluteFilename) ~= (self smalltalkDirectory asAbsoluteFilename). |
|
3993 |
||
3994 |
"Modified: / 26-10-2010 / 17:23:51 / cg" |
|
6456 | 3995 |
! |
3996 |
||
9572 | 3997 |
gotoDesktopDirectoryIsVisible |
3998 |
Filename desktopDirectory = Filename homeDirectory ifTrue:[^ false]. |
|
3999 |
||
4000 |
^ (Filename desktopDirectory asAbsoluteFilename) ~= (self smalltalkDirectory asAbsoluteFilename). |
|
4001 |
||
4002 |
"Created: / 01-10-2010 / 16:26:27 / cg" |
|
4003 |
! |
|
4004 |
||
4618 | 4005 |
hasFileSelection |
4006 |
^ self aspectFor:#hasFileSelection ifAbsent:[ false asValue ]. |
|
4007 |
! |
|
4008 |
||
9490 | 4009 |
hasNotTwoDirectoriesSelectedHolder |
4010 |
^ self |
|
4011 |
aspectFor:#hasNotTwoDirectoriesSelectedHolder |
|
4012 |
ifAbsent:[ |
|
4013 |
BlockValue |
|
4014 |
with:[:m | self hasTwoDirectoriesSelected not] |
|
4015 |
argument:self currentFileNameHolder |
|
4016 |
]. |
|
4017 |
||
4018 |
"Created: / 20-05-2010 / 10:45:50 / cg" |
|
4019 |
! |
|
4020 |
||
5830 | 4021 |
hasNotTwoFilesSelectedHolder |
9490 | 4022 |
^ self |
4023 |
aspectFor:#hasNotTwoFilesSelectedHolder |
|
5830 | 4024 |
ifAbsent:[ |
4025 |
BlockValue |
|
4026 |
with:[:m | self hasTwoFilesSelected not] |
|
4027 |
argument:self currentFileNameHolder |
|
4028 |
]. |
|
9490 | 4029 |
|
4030 |
"Modified: / 20-05-2010 / 10:46:01 / cg" |
|
5830 | 4031 |
! |
4032 |
||
3892 | 4033 |
hasSelection |
17923 | 4034 |
"aspect holding true, if a file is selected" |
3892 | 4035 |
|
4036 |
^ self aspectFor:#hasSelection ifAbsent:[ false asValue ]. |
|
4037 |
! |
|
4038 |
||
9490 | 4039 |
hasTwoDirectoriesSelectedHolder |
4040 |
^ self |
|
4041 |
aspectFor:#hasTwoDirectoriesSelectedHolder |
|
4042 |
ifAbsent:[ |
|
4043 |
BlockValue |
|
4044 |
with:[:m | self hasTwoDirectoriesSelected] |
|
4045 |
argument:self currentFileNameHolder |
|
4046 |
]. |
|
4047 |
||
4048 |
"Created: / 20-05-2010 / 10:45:41 / cg" |
|
4049 |
! |
|
4050 |
||
4414 | 4051 |
hasTwoFilesSelectedHolder |
9490 | 4052 |
^ self |
4053 |
aspectFor:#hasTwoFilesSelectedHolder |
|
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
4054 |
ifAbsent:[ |
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
4055 |
BlockValue |
5830 | 4056 |
with:[:m | self hasTwoFilesSelected] |
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
4057 |
argument:self currentFileNameHolder |
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
4058 |
]. |
9490 | 4059 |
|
4060 |
"Modified: / 20-05-2010 / 10:46:08 / cg" |
|
4414 | 4061 |
! |
4062 |
||
11053 | 4063 |
inputTabColumnConversion |
4064 |
^ self inputTabColumnConversionHolder value |
|
4065 |
||
4066 |
"Created: / 06-01-2012 / 15:25:56 / cg" |
|
4067 |
! |
|
4068 |
||
4069 |
inputTabColumnConversionHolder |
|
4070 |
^ self |
|
4071 |
aspectFor:#inputTabColumnConversionHolder |
|
4072 |
ifAbsent:[ |
|
4073 |
self |
|
4074 |
applicationNamed:#FileApplicationNoteBook |
|
4075 |
ifPresentDo:[:appl | appl inputTabColumnConversionHolder]. |
|
4076 |
] |
|
4077 |
||
4078 |
"Created: / 06-01-2012 / 15:26:16 / cg" |
|
4079 |
! |
|
4080 |
||
4081 |
lineEndConvention |
|
15208 | 4082 |
^ self lineEndConventionHolder value asSymbol |
11053 | 4083 |
|
4084 |
"Created: / 06-01-2012 / 13:05:14 / cg" |
|
4085 |
! |
|
4086 |
||
11591 | 4087 |
lineEndConvention: aSymbol |
15208 | 4088 |
self lineEndConventionHolder value: aSymbol asSymbol |
11591 | 4089 |
|
4090 |
"Created: / 11-07-2012 / 19:51:58 / cg" |
|
4091 |
! |
|
4092 |
||
11053 | 4093 |
lineEndConventionHolder |
4094 |
^ self |
|
4095 |
aspectFor:#lineEndConventionHolder |
|
4096 |
ifAbsent:[ |
|
4097 |
self |
|
4098 |
applicationNamed:#FileApplicationNoteBook |
|
4099 |
ifPresentDo:[:appl | appl lineEndConventionHolder]. |
|
4100 |
] |
|
4101 |
||
4102 |
"Created: / 06-01-2012 / 13:02:51 / cg" |
|
4103 |
! |
|
4104 |
||
5737 | 4105 |
lockFileEncoding:aBoolean |
4106 |
self lockFileEncodingHolder value:aBoolean. |
|
4107 |
||
4108 |
self |
|
4109 |
applicationNamed:#FileApplicationNoteBook |
|
4110 |
ifPresentDo:[:nb | |
|
4111 |
|appl| |
|
4112 |
||
4113 |
appl := nb selectedApplication. |
|
4114 |
(appl notNil and:[appl isTextEditor]) ifTrue:[ |
|
4115 |
appl lockFileEncoding:aBoolean |
|
4116 |
] |
|
4117 |
]. |
|
4118 |
! |
|
4119 |
||
4120 |
lockFileEncodingHolder |
|
4121 |
^ self |
|
4122 |
aspectFor:#lockFileEncodingHolder |
|
4123 |
ifAbsent:[ |
|
4124 |
self |
|
4125 |
applicationNamed:#FileApplicationNoteBook |
|
4126 |
ifPresentDo:[:appl | appl lockFileEncodingHolder]. |
|
4127 |
] |
|
4128 |
! |
|
4129 |
||
13856 | 4130 |
makeCommandHolder |
4131 |
^ self aspectFor:#makeCommandHolder ifAbsent:[ nil asValue ]. |
|
4132 |
||
4133 |
"Created: / 13-04-2012 / 17:01:26 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
4134 |
! |
|
4135 |
||
4523 | 4136 |
notify:aString |
11108 | 4137 |
"aString is shown in the lower pane" |
4138 |
||
4523 | 4139 |
self notifyChannel value:aString |
11108 | 4140 |
|
4141 |
"Modified (comment): / 11-01-2012 / 21:46:55 / cg" |
|
4523 | 4142 |
! |
4143 |
||
3892 | 4144 |
notifyChannel |
4145 |
||
4146 |
^ self aspectFor:#notifyChannel ifAbsent:['' asValue] |
|
4071 | 4147 |
! |
4148 |
||
9575
548adf8e9d98
added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents:
9572
diff
changeset
|
4149 |
progressPercentageHolder |
548adf8e9d98
added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents:
9572
diff
changeset
|
4150 |
^ self aspectFor:#progressPercentageHolder ifAbsent:[ nil asValue ]. |
548adf8e9d98
added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents:
9572
diff
changeset
|
4151 |
|
548adf8e9d98
added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents:
9572
diff
changeset
|
4152 |
"Created: / 11-10-2010 / 12:54:46 / cg" |
548adf8e9d98
added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents:
9572
diff
changeset
|
4153 |
! |
548adf8e9d98
added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents:
9572
diff
changeset
|
4154 |
|
4071 | 4155 |
rootHolder |
4156 |
"holder, which keeps the rootHolder of the treeView |
|
4157 |
" |
|
4158 |
||
4368
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
4159 |
^ self aspectFor:#rootHolder ifAbsent:[ |
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
4160 |
self class rootHolder asValue. |
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
4161 |
]. |
8192
26660fb61e7a
Make FileDialog usable as SubCanvas
Stefan Vogel <sv@exept.de>
parents:
8185
diff
changeset
|
4162 |
! |
26660fb61e7a
Make FileDialog usable as SubCanvas
Stefan Vogel <sv@exept.de>
parents:
8185
diff
changeset
|
4163 |
|
26660fb61e7a
Make FileDialog usable as SubCanvas
Stefan Vogel <sv@exept.de>
parents:
8185
diff
changeset
|
4164 |
rootHolder:aHolder |
26660fb61e7a
Make FileDialog usable as SubCanvas
Stefan Vogel <sv@exept.de>
parents:
8185
diff
changeset
|
4165 |
|
26660fb61e7a
Make FileDialog usable as SubCanvas
Stefan Vogel <sv@exept.de>
parents:
8185
diff
changeset
|
4166 |
self aspectFor:#rootHolder put:aHolder |
3892 | 4167 |
! ! |
4168 |
||
4169 |
!AbstractFileBrowser methodsFor:'aspects handling'! |
|
4170 |
||
4171 |
aspectFor:something ifAbsent:aBlock |
|
6284 | 4172 |
"returns the model for an aspect; these are stored in a common dictionary" |
4173 |
||
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
4174 |
^ self aspectFor:something ifAbsent:aBlock notPresentDo:nil |
3892 | 4175 |
! |
4176 |
||
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4177 |
aspectFor:aKey ifAbsent:aBlock notPresentDo:notPresentBlock |
6284 | 4178 |
"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
|
4179 |
|
4213
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
4180 |
|holder saveAspectItem aspect| |
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
4181 |
|
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4182 |
holder := aspects at:aKey ifAbsent:[ |
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
4183 |
masterApplication notNil ifTrue:[ |
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4184 |
holder := masterApplication aspectOrNil:aKey forSubApplication:self. |
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
4185 |
]. |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
4186 |
holder isNil ifTrue:[ |
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4187 |
saveAspectItem := self runtimeAspectValueFor:aKey. |
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
4188 |
saveAspectItem notNil ifTrue:[ |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
4189 |
saveAspectItem isHolder ifTrue:[ |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
4190 |
holder := ValueHolder with:saveAspectItem value |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
4191 |
] ifFalse:[ |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
4192 |
holder := saveAspectItem value |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
4193 |
]. |
4213
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
4194 |
] ifFalse:[ |
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4195 |
aspect := self userPreferencesAspectValueFor:aKey. |
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
4196 |
aspect notNil ifTrue:[ |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
4197 |
holder := aspect asValue |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
4198 |
] ifFalse:[ |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
4199 |
holder := aBlock value. |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
4200 |
] |
4213
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
4201 |
]. |
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
4202 |
]. |
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
4203 |
holder notNil ifTrue:[ |
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
4204 |
notPresentBlock notNil ifTrue:[ |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
4205 |
holder value:(notPresentBlock value:holder). |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
4206 |
]. |
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4207 |
aspects at:aKey put:holder |
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
4208 |
]. |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
4209 |
holder |
4213
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
4210 |
]. |
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
4211 |
^ holder |
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
4212 |
! |
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
4213 |
|
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
4214 |
aspectFor:something put:aValueHolder |
6284 | 4215 |
"stores the model for an aspect; these are stored in a common dictionary" |
4216 |
||
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
4217 |
aspects at:something put:aValueHolder |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
4218 |
! |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
4219 |
|
3892 | 4220 |
aspects |
6284 | 4221 |
"returns the common aspect dictionary" |
4222 |
||
3892 | 4223 |
^ aspects |
4224 |
! |
|
4225 |
||
4226 |
runtimeAspectValueFor:something |
|
4227 |
"returns the default aspect item from the class variable RuntimeAspects |
|
4228 |
" |
|
4229 |
^ self class runtimeAspects at:something ifAbsent:nil. |
|
4230 |
! |
|
4231 |
||
4201 | 4232 |
saveAspectValues |
16306 | 4233 |
|prefs saveAspects aspectValue| |
4234 |
||
4235 |
prefs := UserPreferences current. |
|
4236 |
||
7078
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
4237 |
saveAspects := self class userPreferencesAspectList keys. |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
4238 |
saveAspects do:[ :aspectKey | |
4201 | 4239 |
aspectValue := (self perform:aspectKey) value. |
16306 | 4240 |
prefs |
7078
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
4241 |
at: ('fileBrowser_',aspectKey asString) asSymbol |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
4242 |
put: aspectValue. |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
4243 |
]. |
16306 | 4244 |
prefs beModified. |
4245 |
||
7078
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
4246 |
"Modified: / 04-09-2006 / 10:02:41 / cg" |
4201 | 4247 |
! |
4248 |
||
3892 | 4249 |
saveRuntimeAspectValues |
4250 |
|savedAspects dictionary value isHolder aspect| |
|
4251 |
||
5941 | 4252 |
savedAspects := self class listOfRuntimeValuesToRemember. |
3892 | 4253 |
dictionary := Dictionary new. |
5941 | 4254 |
savedAspects do:[:aspectKey | |
4414 | 4255 |
aspect := self perform:aspectKey. |
4256 |
isHolder := aspect isValueModel. |
|
5941 | 4257 |
isHolder ifTrue:[ |
4258 |
value := aspect value |
|
4259 |
] ifFalse:[ |
|
4260 |
value := aspect |
|
4261 |
]. |
|
4262 |
dictionary at:aspectKey |
|
4263 |
put:(SaveAspectItem withValue:value isHolder:isHolder) |
|
4264 |
]. |
|
4265 |
RuntimeAspects := dictionary. |
|
3892 | 4266 |
! |
4267 |
||
4201 | 4268 |
userPreferencesAspectValueFor:something |
4269 |
"returns the default aspect from the Userpreferences |
|
3892 | 4270 |
" |
4201 | 4271 |
|
7078
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
4272 |
(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
|
4273 |
^ UserPreferences current |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
4274 |
at:('fileBrowser_',something) asSymbol |
9579
7107f49e4583
changed: #userPreferencesAspectValueFor:
Claus Gittinger <cg@exept.de>
parents:
9575
diff
changeset
|
4275 |
ifAbsent:nil "(self class userPreferencesAspectList at:something)". |
7107f49e4583
changed: #userPreferencesAspectValueFor:
Claus Gittinger <cg@exept.de>
parents:
9575
diff
changeset
|
4276 |
|
7107f49e4583
changed: #userPreferencesAspectValueFor:
Claus Gittinger <cg@exept.de>
parents:
9575
diff
changeset
|
4277 |
"Modified: / 14-10-2010 / 19:16:38 / cg" |
3892 | 4278 |
! ! |
4279 |
||
4011 | 4280 |
!AbstractFileBrowser methodsFor:'aspects-filter'! |
4281 |
||
9015 | 4282 |
filter:aString |
4283 |
self filterModel value:aString |
|
4284 |
! |
|
4285 |
||
4018 | 4286 |
filterBackgroundColor |
4287 |
||
4288 |
^ self aspectFor:#filterBackgroundColor ifAbsent:[Color white asValue] |
|
4289 |
! |
|
4290 |
||
4011 | 4291 |
filterBlockHolder |
4292 |
||
5658
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
4293 |
^ self aspectFor:#filterBlockHolder ifAbsent:[self makeFilterBlock asValue] |
4011 | 4294 |
! |
4295 |
||
4296 |
filterListModel |
|
4297 |
||
4298 |
^ self aspectFor:#filterListModel ifAbsent:[self class defaultFilterList] |
|
4299 |
! |
|
4300 |
||
4301 |
filterModel |
|
5941 | 4302 |
|m| |
4303 |
||
4304 |
m := self aspectFor:#filterModel ifAbsent:[(self filterListModel at:1) asValue]. |
|
4305 |
^ m |
|
4011 | 4306 |
! |
4307 |
||
8185
8b6f11fd7fbf
Make #filterModel reusable as SubCanvas
Stefan Vogel <sv@exept.de>
parents:
8172
diff
changeset
|
4308 |
filterModel:aHolder |
8b6f11fd7fbf
Make #filterModel reusable as SubCanvas
Stefan Vogel <sv@exept.de>
parents:
8172
diff
changeset
|
4309 |
self aspectFor:#filterModel put:aHolder. |
8b6f11fd7fbf
Make #filterModel reusable as SubCanvas
Stefan Vogel <sv@exept.de>
parents:
8172
diff
changeset
|
4310 |
! |
8b6f11fd7fbf
Make #filterModel reusable as SubCanvas
Stefan Vogel <sv@exept.de>
parents:
8172
diff
changeset
|
4311 |
|
4018 | 4312 |
filterValueBox |
4313 |
||
4314 |
^ self aspectFor:#filterValueBox ifAbsent:[ValueHolder new] |
|
4315 |
! |
|
4316 |
||
5658
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
4317 |
makeFilterBlock |
14497 | 4318 |
"return a two-arg filterblock on the file's path- and base-name. This block should return true for files |
9102 | 4319 |
to be shown" |
4320 |
||
17481 | 4321 |
| filterString filterStrings filters notFilters showHidden filterBlock caseSensitive| |
5658
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
4322 |
|
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
4323 |
filterString := self filterModel value. |
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
4324 |
filterString = '' ifTrue:[filterString := '*']. |
17481 | 4325 |
caseSensitive := "ignoreCaseInPattern ?" Filename isCaseSensitive. |
5658
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
4326 |
|
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
4327 |
filterStrings := filterString asCollectionOfSubstringsSeparatedBy:$;. |
12760 | 4328 |
filterStrings := filterStrings |
4329 |
select:[:eachFilter | eachFilter withoutSeparators notEmpty]. |
|
4330 |
||
5658
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
4331 |
filters := filterStrings |
12760 | 4332 |
reject:[:eachFilter | eachFilter withoutSeparators startsWith:'~'] |
4333 |
thenCollect: |
|
4334 |
[:eachPattern | |
|
4335 |
|pattern| |
|
4336 |
||
4337 |
pattern := eachPattern withoutSeparators. |
|
15597 | 4338 |
pattern includesMatchCharacters ifFalse:[ |
4339 |
"JV@2012-03-05: Add implict star at the beginning and at the end of pattern, |
|
4340 |
that's how most of the other applications behave - do what most users expect" |
|
17772 | 4341 |
"/ pattern first == $* ifFalse:[pattern := '*' , pattern]. |
4342 |
"/ pattern last == $* ifFalse:[pattern := pattern , '*']. |
|
4343 |
[:name :baseName | baseName asLowercase includesString:pattern caseSensitive:caseSensitive] |
|
4344 |
] ifTrue:[ |
|
4345 |
pattern = '*' ifTrue:[ |
|
4346 |
[:name :baseName | true]. |
|
4347 |
] ifFalse:[ |
|
4348 |
[:name :baseName | pattern match:baseName caseSensitive:caseSensitive] |
|
4349 |
]. |
|
15597 | 4350 |
]. |
12760 | 4351 |
]. |
4352 |
||
4353 |
notFilters := filterStrings |
|
4354 |
select:[:eachFilter | eachFilter withoutSeparators startsWith:'~'] |
|
4355 |
thenCollect: |
|
4356 |
[:eachPattern | |
|
9296 | 4357 |
|pattern| |
4358 |
||
4359 |
pattern := eachPattern withoutSeparators. |
|
12760 | 4360 |
pattern := (pattern copyFrom:2) withoutSeparators. |
17481 | 4361 |
[:name :baseName | pattern match:baseName caseSensitive:caseSensitive] |
9296 | 4362 |
]. |
5658
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
4363 |
|
12760 | 4364 |
|
4365 |
(filters size == 1 and:[notFilters isEmpty]) ifTrue:[ |
|
5658
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
4366 |
filterBlock := filters first |
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
4367 |
] ifFalse:[ |
12760 | 4368 |
filters isEmpty ifTrue:[ |
4369 |
filterBlock := [:name :baseName | |
|
4370 |
(notFilters contains:[:aFilter | aFilter value:name value:baseName ]) not |
|
4371 |
]. |
|
4372 |
] ifFalse:[ |
|
4373 |
notFilters isEmpty ifTrue:[ |
|
4374 |
filterBlock := [:name :baseName | |
|
4375 |
(filters contains:[:aFilter | aFilter value:name value:baseName ]) |
|
4376 |
]. |
|
4377 |
] ifFalse:[ |
|
4378 |
filterBlock := [:name :baseName | |
|
4379 |
(filters contains:[:aFilter | aFilter value:name value:baseName ]) |
|
4380 |
and:[ (notFilters contains:[:aFilter | aFilter value:name value:baseName ]) not ] |
|
4381 |
]. |
|
4382 |
] |
|
4383 |
] |
|
5658
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
4384 |
]. |
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
4385 |
|
4011 | 4386 |
showHidden := self showHiddenFiles value. |
4387 |
showHidden ifTrue:[ |
|
5658
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
4388 |
^ filterBlock. |
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
4389 |
]. |
9296 | 4390 |
^ [:name :baseName | |
4391 |
name isHidden not and:[filterBlock value:name value:baseName]]. |
|
13856 | 4392 |
|
4393 |
"Modified: / 05-02-2012 / 01:42:36 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
17481 | 4394 |
"Modified: / 27-03-2017 / 12:52:08 / stefan" |
17772 | 4395 |
"Modified: / 20-11-2017 / 22:02:04 / cg" |
4018 | 4396 |
! |
4397 |
||
4398 |
shownFiles |
|
4399 |
||
4400 |
^ self aspectFor:#shownFiles ifAbsent:['-/-' asValue] |
|
4011 | 4401 |
! ! |
4402 |
||
14126 | 4403 |
|
3892 | 4404 |
!AbstractFileBrowser methodsFor:'aspects-history'! |
4405 |
||
4406 |
dirHistory |
|
6369 | 4407 |
"obsolete" |
4408 |
^ self directoryHistory |
|
4409 |
! |
|
4410 |
||
4411 |
directoryHistory |
|
3952 | 4412 |
^ self class directoryHistory |
3892 | 4413 |
! |
4414 |
||
4415 |
enableBack |
|
4416 |
||
15259 | 4417 |
^ self aspectFor:#enableBack ifAbsent:[ValueHolder with:false] |
3892 | 4418 |
! |
4419 |
||
4420 |
enableFileHistory |
|
4421 |
||
15259 | 4422 |
^ self aspectFor:#enableFileHistory ifAbsent:[ValueHolder with:false] |
3892 | 4423 |
! |
4424 |
||
4425 |
enableForward |
|
4426 |
||
15259 | 4427 |
^ self aspectFor:#enableForward ifAbsent:[ValueHolder with:false] |
3892 | 4428 |
! |
4429 |
||
4430 |
fileHistory |
|
9820
07b7d7929e3e
variable renamed in: #fileHistory
Stefan Vogel <sv@exept.de>
parents:
9793
diff
changeset
|
4431 |
^ self aspectFor:#fileHistory ifAbsent:[OrderedSet new] |
3892 | 4432 |
! ! |
4433 |
||
4434 |
!AbstractFileBrowser methodsFor:'aspects-visibility'! |
|
4435 |
||
4345 | 4436 |
activityVisibilityChannel |
6284 | 4437 |
" activityVisibilityChannel switches the activity indicator on/off" |
4345 | 4438 |
|
15259 | 4439 |
^ self aspectFor:#activityVisibilityChannel ifAbsent:[ ValueHolder with:false ]. |
4345 | 4440 |
! |
4441 |
||
15111 | 4442 |
alwaysUseSmalltalkTools |
4443 |
" aspect to prevent os tools to be opened on double click" |
|
4444 |
||
15259 | 4445 |
^ self aspectFor:#alwaysUseSmalltalkTools ifAbsent:[ ValueHolder with:true ]. |
15111 | 4446 |
! |
4447 |
||
6602 | 4448 |
changeSetBrowserItemVisible |
4449 |
^ Screen current ctrlDown. |
|
4450 |
! |
|
4451 |
||
11135 | 4452 |
cvsMenusAreShown |
11156
11c0b4cbc836
Use Configurable includesFeature:#Feature instead of direct send of #hasFeature
vrany
parents:
11149
diff
changeset
|
4453 |
^ ConfigurableFeatures includesFeature: #CVSSupportEnabled |
11135 | 4454 |
|
4455 |
"Created: / 15-01-2012 / 13:00:05 / cg" |
|
11156
11c0b4cbc836
Use Configurable includesFeature:#Feature instead of direct send of #hasFeature
vrany
parents:
11149
diff
changeset
|
4456 |
"Modified: / 19-01-2012 / 10:43:30 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
11135 | 4457 |
! |
4458 |
||
13856 | 4459 |
hgMenusAreShown |
4460 |
^ (ConfigurableFeatures includesFeature: #HGSupportEnabled) |
|
4461 |
||
4462 |
"Created: / 14-01-2013 / 11:53:51 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
4463 |
! |
|
4464 |
||
11135 | 4465 |
mercurialMenusAreShown |
11147 | 4466 |
^ ConfigurableFeatures hasMercurialSupportEnabled |
11135 | 4467 |
|
4468 |
"Created: / 15-01-2012 / 13:00:00 / cg" |
|
4469 |
! |
|
4470 |
||
4110 | 4471 |
openAlwaysInTextEditor |
18274 | 4472 |
"aspect for open every file in TextEditor don't use e.g. HtmlEditor for *.html'" |
4110 | 4473 |
|
15111 | 4474 |
^ self aspectFor:#openAlwaysInTextEditor ifAbsent:[ false asValue ]. |
18274 | 4475 |
|
4476 |
"Modified (comment): / 19-07-2018 / 15:28:00 / Stefan Vogel" |
|
4110 | 4477 |
! |
4478 |
||
3892 | 4479 |
openMultipleApplicationsForType |
4480 |
||
4201 | 4481 |
" aspect for open more applications for e.g. TextEditor and not change the contents of already |
4482 |
open TextEditor " |
|
4483 |
||
3892 | 4484 |
^ self aspectFor:#openMultipleApplicationsForType ifAbsent:[ false asValue ]. |
4485 |
! |
|
4486 |
||
11137 | 4487 |
perforceMenusAreShown |
11996
e3b824f2d454
changed: #perforceMenusAreShown
Claus Gittinger <cg@exept.de>
parents:
11995
diff
changeset
|
4488 |
^ (ConfigurableFeatures includesFeature: #PerforceSupportEnabled) |
e3b824f2d454
changed: #perforceMenusAreShown
Claus Gittinger <cg@exept.de>
parents:
11995
diff
changeset
|
4489 |
and:[ ConfigurableFeatures hasPerforceSupportEnabled ] |
11137 | 4490 |
|
4491 |
"Created: / 15-01-2012 / 13:12:11 / cg" |
|
11156
11c0b4cbc836
Use Configurable includesFeature:#Feature instead of direct send of #hasFeature
vrany
parents:
11149
diff
changeset
|
4492 |
"Modified: / 19-01-2012 / 10:43:42 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
11996
e3b824f2d454
changed: #perforceMenusAreShown
Claus Gittinger <cg@exept.de>
parents:
11995
diff
changeset
|
4493 |
"Modified: / 02-11-2012 / 11:19:59 / cg" |
11137 | 4494 |
! |
4495 |
||
14709
dc6998e427f4
Added option to show directories always in top of the list in directory contents view.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14659
diff
changeset
|
4496 |
showDirectoriesOnTop |
dc6998e427f4
Added option to show directories always in top of the list in directory contents view.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14659
diff
changeset
|
4497 |
|
dc6998e427f4
Added option to show directories always in top of the list in directory contents view.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14659
diff
changeset
|
4498 |
^ self aspectFor:#showDirectoriesOnTop ifAbsent:[ false asValue ] |
dc6998e427f4
Added option to show directories always in top of the list in directory contents view.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14659
diff
changeset
|
4499 |
|
dc6998e427f4
Added option to show directories always in top of the list in directory contents view.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14659
diff
changeset
|
4500 |
"Created: / 12-08-2014 / 13:02:39 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
dc6998e427f4
Added option to show directories always in top of the list in directory contents view.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14659
diff
changeset
|
4501 |
! |
dc6998e427f4
Added option to show directories always in top of the list in directory contents view.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14659
diff
changeset
|
4502 |
|
4201 | 4503 |
showDirectoryTree |
4504 |
||
4505 |
^ self aspectFor:#showDirectoryTree ifAbsent:[ true asValue ] |
|
3892 | 4506 |
! |
4507 |
||
4554 | 4508 |
showDiskUsageHolder |
4509 |
|holder| |
|
4510 |
||
4560
0d3db5e27bc0
default for disk usage is false
Claus Gittinger <cg@exept.de>
parents:
4558
diff
changeset
|
4511 |
holder := self aspectFor:#showDiskUsageHolder ifAbsent:[ false asValue]. |
4781 | 4512 |
holder addDependent:self. |
4554 | 4513 |
^ holder |
4514 |
! |
|
4515 |
||
3892 | 4516 |
showHiddenFiles |
4517 |
||
9582 | 4518 |
^ self aspectFor:#showHiddenFiles ifAbsent:[ true asValue ]. |
4519 |
||
4520 |
"Modified: / 15-10-2010 / 10:28:17 / cg" |
|
3892 | 4521 |
! |
4522 |
||
9108 | 4523 |
showHiddenFiles:aHolder |
4524 |
self aspectFor:#showHiddenFiles put:aHolder. |
|
4525 |
! |
|
4526 |
||
4527 |
shownFiles:aHolder |
|
4528 |
self aspectFor:#shownFiles put:aHolder. |
|
4529 |
! |
|
4530 |
||
11135 | 4531 |
svnMenusAreShown |
11156
11c0b4cbc836
Use Configurable includesFeature:#Feature instead of direct send of #hasFeature
vrany
parents:
11149
diff
changeset
|
4532 |
^ ConfigurableFeatures includesFeature: #SubversionSupportEnabled |
11135 | 4533 |
|
4534 |
"Created: / 15-01-2012 / 13:02:03 / cg" |
|
11156
11c0b4cbc836
Use Configurable includesFeature:#Feature instead of direct send of #hasFeature
vrany
parents:
11149
diff
changeset
|
4535 |
"Modified: / 19-01-2012 / 10:43:46 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
11135 | 4536 |
! |
4537 |
||
9945
b32126680c13
added: #tagsBrowserVisibleHolder
Claus Gittinger <cg@exept.de>
parents:
9820
diff
changeset
|
4538 |
tagsBrowserVisibleHolder |
b32126680c13
added: #tagsBrowserVisibleHolder
Claus Gittinger <cg@exept.de>
parents:
9820
diff
changeset
|
4539 |
masterApplication notNil ifTrue:[ |
11162
faf8af233ac0
changed: #tagsBrowserVisibleHolder
Claus Gittinger <cg@exept.de>
parents:
11156
diff
changeset
|
4540 |
^ masterApplication perform:#tagsBrowserVisibleHolder ifNotUnderstood:false |
9945
b32126680c13
added: #tagsBrowserVisibleHolder
Claus Gittinger <cg@exept.de>
parents:
9820
diff
changeset
|
4541 |
]. |
10762
311190be6490
changed: #tagsBrowserVisibleHolder
Claus Gittinger <cg@exept.de>
parents:
10757
diff
changeset
|
4542 |
^ self aspectFor:#tagsBrowserVisibleHolder ifAbsent:[ FileApplicationNoteBook::TextEditor defaultTagsBrowserVisible asValue ]. |
9945
b32126680c13
added: #tagsBrowserVisibleHolder
Claus Gittinger <cg@exept.de>
parents:
9820
diff
changeset
|
4543 |
|
b32126680c13
added: #tagsBrowserVisibleHolder
Claus Gittinger <cg@exept.de>
parents:
9820
diff
changeset
|
4544 |
"Created: / 27-06-2011 / 16:02:59 / cg" |
b32126680c13
added: #tagsBrowserVisibleHolder
Claus Gittinger <cg@exept.de>
parents:
9820
diff
changeset
|
4545 |
! |
b32126680c13
added: #tagsBrowserVisibleHolder
Claus Gittinger <cg@exept.de>
parents:
9820
diff
changeset
|
4546 |
|
10757
5bbe8b995a5f
added: #useCodeView2InTools
Claus Gittinger <cg@exept.de>
parents:
10747
diff
changeset
|
4547 |
useCodeView2InTools |
5bbe8b995a5f
added: #useCodeView2InTools
Claus Gittinger <cg@exept.de>
parents:
10747
diff
changeset
|
4548 |
^ self aspectFor:#useCodeView2InTools ifAbsent:[ UserPreferences current useCodeView2InTools asValue ]. |
5bbe8b995a5f
added: #useCodeView2InTools
Claus Gittinger <cg@exept.de>
parents:
10747
diff
changeset
|
4549 |
|
5bbe8b995a5f
added: #useCodeView2InTools
Claus Gittinger <cg@exept.de>
parents:
10747
diff
changeset
|
4550 |
"Created: / 06-10-2011 / 11:45:58 / cg" |
5bbe8b995a5f
added: #useCodeView2InTools
Claus Gittinger <cg@exept.de>
parents:
10747
diff
changeset
|
4551 |
! |
5bbe8b995a5f
added: #useCodeView2InTools
Claus Gittinger <cg@exept.de>
parents:
10747
diff
changeset
|
4552 |
|
4648 | 4553 |
userContextAvailable |
4554 |
||
4555 |
" aspect for show group and user columns in contents view |
|
4556 |
windows provides no user context" |
|
4557 |
||
4558 |
^ OperatingSystem isMSWINDOWSlike not |
|
4559 |
! |
|
4560 |
||
3892 | 4561 |
viewDescription |
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4562 |
"aspect for show file description in DirectoryContentsBrowser" |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4563 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4564 |
^ self directoryContentsBrowser viewDescription |
3892 | 4565 |
! |
4566 |
||
4567 |
viewDetails |
|
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4568 |
"aspect for show more file properties in DirectoryContentsBrowser |
4201 | 4569 |
" |
3892 | 4570 |
|
6121 | 4571 |
|directoryContentsBrowser| |
4572 |
||
4573 |
directoryContentsBrowser := self directoryContentsBrowser. |
|
4574 |
directoryContentsBrowser isNil ifTrue:[^ nil]. |
|
4575 |
^ directoryContentsBrowser viewDetails |
|
3892 | 4576 |
! |
4577 |
||
4578 |
viewDirectoryDescription |
|
4579 |
||
4201 | 4580 |
" aspect for auto open a TextView for Readme and other see getInfoItem Method files |
4581 |
on change directory " |
|
4582 |
||
3892 | 4583 |
^ self aspectFor:#viewDirectoryDescription ifAbsent:[ true asValue ]. |
4584 |
! |
|
4585 |
||
4201 | 4586 |
viewDirsInContentsBrowser |
4587 |
||
4588 |
^ self aspectFor:#viewDirsInContentsBrowser ifAbsent:[ false asValue ]. |
|
9319
23ae966d9dbf
comment/format in: #viewDirsInContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
9299
diff
changeset
|
4589 |
|
23ae966d9dbf
comment/format in: #viewDirsInContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
9299
diff
changeset
|
4590 |
" |
23ae966d9dbf
comment/format in: #viewDirsInContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
9299
diff
changeset
|
4591 |
UserPreferences current viewDirsInContentsBrowser |
23ae966d9dbf
comment/format in: #viewDirsInContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
9299
diff
changeset
|
4592 |
" |
4201 | 4593 |
! |
4594 |
||
5870 | 4595 |
viewFilesInContentsBrowser |
4596 |
||
4597 |
^ self aspectFor:#viewFilesInContentsBrowser ifAbsent:[ true asValue ]. |
|
4598 |
! |
|
4599 |
||
3892 | 4600 |
viewFilesInDirectoryTree |
4601 |
||
4201 | 4602 |
" aspect for view files in tree view (not only directories) " |
4603 |
||
3892 | 4604 |
^ self aspectFor:#viewFilesInDirectoryTree ifAbsent:[ false asValue ]. |
4605 |
! |
|
4606 |
||
4607 |
viewGroup |
|
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4608 |
" aspect for show group information in DirectoryContentsBrowser " |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4609 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4610 |
^ self directoryContentsBrowser viewGroup |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4611 |
! |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4612 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4613 |
viewIcon |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4614 |
" aspect for show file-type icon in DirectoryContentsBrowser " |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4615 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4616 |
^ self directoryContentsBrowser viewIcon |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4617 |
! |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4618 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4619 |
viewInodeNumber |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4620 |
" aspect for show inode numbers in DirectoryContentsBrowser " |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4621 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4622 |
^ self directoryContentsBrowser viewInodeNumber |
3892 | 4623 |
! |
4624 |
||
4625 |
viewNoteBookApplicationHolder |
|
4626 |
||
4627 |
^ self aspectFor:#viewNoteBookApplicationHolder ifAbsent:[ false asValue]. |
|
4628 |
! |
|
4629 |
||
4630 |
viewOwner |
|
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4631 |
" aspect for show owner information in DirectoryContentsBrowser " |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4632 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4633 |
^ self directoryContentsBrowser viewOwner |
3892 | 4634 |
! |
4635 |
||
4636 |
viewPermissions |
|
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4637 |
" aspect for show permission information in DirectoryContentsBrowser " |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4638 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4639 |
^ self directoryContentsBrowser viewPermissions |
3892 | 4640 |
! |
4641 |
||
4642 |
viewPreview |
|
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4643 |
" aspect for show image previev in DirectoryContentsBrowser " |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4644 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4645 |
^ self directoryContentsBrowser viewPreview |
3892 | 4646 |
! |
4647 |
||
4648 |
viewSize |
|
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4649 |
" aspect for show size information in DirectoryContentsBrowser " |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4650 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4651 |
^ self directoryContentsBrowser viewSize |
3892 | 4652 |
! |
4653 |
||
4974 | 4654 |
viewSizeInBytes |
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4655 |
" aspect for show size-in-bytes information in DirectoryContentsBrowser " |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4656 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4657 |
^ self directoryContentsBrowser viewSizeInBytes |
4974 | 4658 |
! |
4659 |
||
5312 | 4660 |
viewSizeInKiloBytes |
4661 |
" aspect for show size-in-kilobytes information in DirectoryContentsBrowser " |
|
4662 |
||
4663 |
^ self directoryContentsBrowser viewSizeInKiloBytes |
|
4664 |
! |
|
4665 |
||
3892 | 4666 |
viewTime |
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4667 |
" aspect for show time information in DirectoryContentsBrowser" |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4668 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4669 |
^ self directoryContentsBrowser viewTime |
3892 | 4670 |
! |
4671 |
||
4672 |
viewType |
|
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4673 |
" aspect for show suffix (type) information in DirectoryContentsBrowser" |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4674 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4675 |
^ self directoryContentsBrowser viewType |
3892 | 4676 |
! ! |
4677 |
||
4678 |
!AbstractFileBrowser methodsFor:'background processing'! |
|
4679 |
||
4680 |
executeCommand:cmd |
|
4681 |
||
4682 |
self executeCommand:cmd inDirectory:nil |
|
4683 |
! |
|
4684 |
||
5880 | 4685 |
executeCommand:cmd inDirectory:aDirectoryOrNil |
3892 | 4686 |
| nameString executionBlock| |
4687 |
||
5880 | 4688 |
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
|
4689 |
nameString := 'Execute: ', cmd. |
3892 | 4690 |
self makeExecutionResultProcessFor:executionBlock withName:nameString. |
4691 |
! |
|
4692 |
||
4693 |
getExecutionBlockForCommand:cmd |
|
4694 |
||
4695 |
^ self getExecutionBlockForCommand:cmd inDirectory:nil |
|
4696 |
! |
|
4697 |
||
5880 | 4698 |
getExecutionBlockForCommand:cmd inDirectory:directoryOrNil |
4699 |
| dir| |
|
4700 |
||
4701 |
dir := directoryOrNil. |
|
4702 |
directoryOrNil isNil ifTrue:[ |
|
4703 |
dir := self theSingleSelectedDirectoryOrNil. |
|
6671 | 4704 |
dir isNil ifTrue:[ |
12493 | 4705 |
Dialog warn:(resources string:'Please select a single directory.'). |
16732 | 4706 |
AbortOperationRequest raise. |
6671 | 4707 |
^ nil |
4708 |
]. |
|
3892 | 4709 |
]. |
4523 | 4710 |
|
4711 |
^ [:stream| |
|
4712 |
stream notNil ifTrue:[ |
|
4414 | 4713 |
OperatingSystem |
4714 |
executeCommand:cmd |
|
4715 |
inputFrom:nil |
|
4716 |
outputTo:stream |
|
4717 |
errorTo:stream |
|
4718 |
inDirectory:dir |
|
16732 | 4719 |
lineWise:true |
16825 | 4720 |
showWindow:false |
4414 | 4721 |
onError:[:status| false]. |
4722 |
] |
|
4523 | 4723 |
]. |
3892 | 4724 |
! |
4725 |
||
4726 |
killAllRunningBackgroundProcesses |
|
4727 |
||
4728 |
self backgroundProcesses do:[ : process | |
|
4523 | 4729 |
self notify:'kill ', process name. |
4414 | 4730 |
process terminate. |
3892 | 4731 |
]. |
4732 |
! |
|
4733 |
||
4734 |
makeExecutionResultProcessFor:aBlock withName:aString |
|
4735 |
| stream process appl nameString| |
|
4736 |
||
4737 |
appl := self openCommandResultApplication. |
|
4738 |
stream := appl resultStream. |
|
4739 |
nameString := aString ? 'Execution Result'. |
|
4740 |
appl changeTabTo:nameString. |
|
4523 | 4741 |
|
16102 | 4742 |
process := |
4743 |
[ |
|
4744 |
[aBlock value:stream] |
|
4745 |
ensure:[ |
|
4746 |
self backgroundProcesses remove:process ifAbsent:[]. |
|
4747 |
appl process value:nil. |
|
4748 |
||
4749 |
"/ close automatically, if there was no output. |
|
4571 | 4750 |
"/ appl resultStream contents isEmpty ifTrue:[ |
4751 |
"/ appl doClose. |
|
4752 |
"/ ] |
|
16102 | 4753 |
stream nextPutLine:'Done.'. |
4754 |
self enqueueMessage:#updateCurrentDirectory. |
|
4755 |
] |
|
4756 |
] newProcess. |
|
3892 | 4757 |
process priority:(Processor userBackgroundPriority). |
4758 |
process name:nameString. |
|
4759 |
self backgroundProcesses add:process. |
|
4760 |
appl process value:process. |
|
4761 |
process resume. |
|
4762 |
! ! |
|
4763 |
||
4764 |
!AbstractFileBrowser methodsFor:'change & update'! |
|
4765 |
||
4915 | 4766 |
currentFileNameHolderChanged |
4767 |
"/ self currentFileNameHolderChangedForCommon |
|
4768 |
! |
|
4769 |
||
4577 | 4770 |
currentFileNameHolderChangedForCommon |
5476 | 4771 |
|newDirectories oldDirectories size rootInTreeView selection selectionNotEmpty| |
4368
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
4772 |
|
7560 | 4773 |
selection := self currentSelectedObjects. |
4368
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
4774 |
self class currentSelection:selection. |
4734 | 4775 |
|
13521 | 4776 |
selectionNotEmpty := selection notEmptyOrNil. |
5476 | 4777 |
self hasSelection value:selectionNotEmpty. |
4778 |
self hasFileSelection value:(selectionNotEmpty and:[self firstSelectedFile notNil]). |
|
18246 | 4779 |
self canOpenChangeBrowser value:(selectionNotEmpty). |
4734 | 4780 |
|
4368
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
4781 |
newDirectories := self directoriesForFiles:selection. |
6725 | 4782 |
oldDirectories := self currentSelectedDirectories. |
4011 | 4783 |
oldDirectories ~= newDirectories ifTrue:[ |
4347 | 4784 |
self currentDirectories value:newDirectories. |
4785 |
size := newDirectories size. |
|
4774 | 4786 |
rootInTreeView := self |
4787 |
applicationNamed:#DirectoryTreeBrowser |
|
5009 | 4788 |
ifPresentDo:[:appl | appl rootHolder]. |
4789 |
rootInTreeView := rootInTreeView value. |
|
5437
3556b0348494
directory up not allowed for drive root under windows
penk
parents:
5432
diff
changeset
|
4790 |
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
|
4791 |
|
4347 | 4792 |
newDirectories notEmpty ifTrue:[ |
6369 | 4793 |
self directoryHistory addToHistory:(newDirectories first asString). |
4347 | 4794 |
]. |
5074 | 4795 |
self enableHome value:((newDirectories includes:(Filename homeDirectory asAbsoluteFilename))not). |
14308 | 4796 |
"/ self enableGotoDesktop value:((newDirectories includes:(Filename desktopDirectory asAbsoluteFilename))not). |
6456 | 4797 |
self enableGotoDefaultDirectory value:((newDirectories includes:(Filename defaultDirectory asAbsoluteFilename))not). |
4798 |
self enableGotoSmalltalkDirectory value:((newDirectories includes:(self smalltalkDirectory asAbsoluteFilename))not). |
|
9572 | 4799 |
self enableGotoDesktopDirectory value:((newDirectories includes:(Filename desktopDirectory asAbsoluteFilename))not). |
18352 | 4800 |
self enableGotoDownloadsDirectory value:((newDirectories includes:(Filename downloadsDirectory asAbsoluteFilename))not). |
9677 | 4801 |
self enableGotoTempDirectory value:((newDirectories includes:(self tempDirectory asAbsoluteFilename))not). |
4011 | 4802 |
]. |
9599
6ffff091db22
changed: #currentFileNameHolderChangedForCommon
Claus Gittinger <cg@exept.de>
parents:
9596
diff
changeset
|
4803 |
self enableGotoDefaultDirectory value:(self currentDirectory isNil or:[self currentDirectory pathName ~= OperatingSystem getCurrentDirectory]). |
9596 | 4804 |
self enableMakeCurrentDirectory value:(newDirectories size == 1 |
4805 |
and:[ newDirectories first asFilename pathName ~= OperatingSystem getCurrentDirectory ]). |
|
4022 | 4806 |
self enableForward value:self canForward. |
4734 | 4807 |
self enableBack value:self canBackward. |
6095 | 4808 |
|
13856 | 4809 |
self updateCanMake. |
7560 | 4810 |
|
9677 | 4811 |
"Modified: / 29-12-2010 / 11:01:52 / cg" |
13856 | 4812 |
"Modified: / 17-12-2013 / 08:23:31 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
18246 | 4813 |
"Modified: / 30-06-2018 / 18:30:44 / Claus Gittinger" |
4011 | 4814 |
! |
4815 |
||
4816 |
filterModelChanged |
|
4817 |
||
5658
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
4818 |
self filterBlockHolder value:(self makeFilterBlock). |
4011 | 4819 |
! |
4820 |
||
3892 | 4821 |
update:something with:aParameter from:changedObject |
4822 |
||
4823 |
" do here all the things that have to be done for every part of the FileBrowserV2 |
|
4824 |
and the things that have to be done if it runs standalone " |
|
4825 |
||
4826 |
changedObject == self currentFileNameHolder ifTrue:[ |
|
4577 | 4827 |
self currentFileNameHolderChangedForCommon. |
4368
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
4828 |
^ self |
3892 | 4829 |
]. |
3989 | 4830 |
changedObject == self sortCaseless ifTrue:[ |
4368
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
4831 |
self sortFileListsBy:#baseName withReverse:false. |
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
4832 |
^ self |
3989 | 4833 |
]. |
6785
cac8107d889c
clear reverseSort flag, when sort-order is changed via menu.
Claus Gittinger <cg@exept.de>
parents:
6767
diff
changeset
|
4834 |
changedObject == self sortBlockProperty ifTrue:[ |
cac8107d889c
clear reverseSort flag, when sort-order is changed via menu.
Claus Gittinger <cg@exept.de>
parents:
6767
diff
changeset
|
4835 |
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
|
4836 |
^ self |
cac8107d889c
clear reverseSort flag, when sort-order is changed via menu.
Claus Gittinger <cg@exept.de>
parents:
6767
diff
changeset
|
4837 |
]. |
4011 | 4838 |
(changedObject == self filterModel or:[changedObject == self showHiddenFiles]) ifTrue:[ |
4368
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
4839 |
self filterModelChanged. |
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
4840 |
^ self |
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
4841 |
]. |
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
4842 |
changedObject == self rootHolder ifTrue:[ |
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
4843 |
self class rootHolder:(self rootHolder value). |
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
4844 |
^ self |
4004 | 4845 |
]. |
4781 | 4846 |
changedObject == self showDiskUsageHolder ifTrue:[ |
6190 | 4847 |
self notify:nil. |
4781 | 4848 |
^ self |
4849 |
]. |
|
3989 | 4850 |
|
3892 | 4851 |
super update:something with:aParameter from:changedObject |
5543 | 4852 |
! |
4853 |
||
6095 | 4854 |
updateCanMake |
4855 |
|dir can| |
|
4856 |
||
4857 |
can := false. |
|
4858 |
dir := self currentDirectory. |
|
4859 |
dir notNil ifTrue:[ |
|
13856 | 4860 |
"/ Check for make |
6095 | 4861 |
can := (dir asFilename construct:'Makefile') exists. |
13856 | 4862 |
can ifFalse:[ |
4863 |
can := (dir asFilename construct:'makefile') exists. |
|
4864 |
]. |
|
6095 | 4865 |
OperatingSystem isMSWINDOWSlike ifTrue:[ |
4866 |
can ifFalse:[ |
|
13856 | 4867 |
can := (self currentDirectory asFilename construct:'bc.mak') exists. |
6095 | 4868 |
] |
4869 |
]. |
|
13856 | 4870 |
can ifTrue:[ |
4871 |
self makeCommandHolder value: 'make'. |
|
4872 |
self canMake value: true. |
|
4873 |
^ self |
|
4874 |
]. |
|
4875 |
||
4876 |
"/Check for Apache ant |
|
4877 |
(OperatingSystem canExecuteCommand: 'ant') ifTrue:[ |
|
4878 |
can := (dir asFilename construct:'build.xml') exists. |
|
4879 |
can ifTrue:[ |
|
4880 |
self makeCommandHolder value: 'ant'. |
|
4881 |
self canMake value: true. |
|
4882 |
^ self |
|
4883 |
]. |
|
4884 |
]. |
|
4885 |
||
4886 |
"/Add more here... |
|
4887 |
||
6095 | 4888 |
]. |
4889 |
self canMake value:can. |
|
13856 | 4890 |
|
4891 |
"Modified: / 17-12-2013 / 08:13:39 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
6095 | 4892 |
! |
4893 |
||
5543 | 4894 |
updateListAfterDelete:colOfFiles |
17871 | 4895 |
self updateCurrentDirectoryWithReread |
3892 | 4896 |
! ! |
4897 |
||
4898 |
!AbstractFileBrowser methodsFor:'clipboard'! |
|
4899 |
||
4900 |
canPaste |
|
4901 |
||
15259 | 4902 |
^ self aspectFor:#canPaste ifAbsent:[ ValueHolder with:false ]. |
3892 | 4903 |
! |
4904 |
||
4905 |
clipboard |
|
4906 |
||
4907 |
^ self aspectFor:#clipboard ifAbsent:[Clipboard new] |
|
4908 |
! |
|
4909 |
||
4910 |
copyFilesToClipBoard:colOfFiles |
|
4911 |
self putInClipBoard:colOfFiles as:#copy. |
|
4912 |
! |
|
4913 |
||
4914 |
cutFilesToClipBoard:colOfFiles |
|
4915 |
"defete current selected files/directories |
|
4916 |
" |
|
4917 |
self putInClipBoard:colOfFiles as:#cut. |
|
4918 |
! |
|
4919 |
||
4920 |
emptyClipBoard |
|
4921 |
||
4922 |
self clipboard files:nil. |
|
4923 |
self canPaste value:false. |
|
4924 |
! |
|
4925 |
||
4926 |
putInClipBoard:colOfFiles as:aSymbol |
|
4927 |
| stream clp| |
|
4928 |
||
4929 |
colOfFiles isEmpty ifTrue:[ ^ self]. |
|
4930 |
clp := self clipboard. |
|
4931 |
clp files:nil. |
|
4932 |
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
|
4933 |
|
603abfa8cf99
copy name(s) to clipboard - on lineFeed if only one file is selected
Claus Gittinger <cg@exept.de>
parents:
5756
diff
changeset
|
4934 |
stream := String writeStream. |
3892 | 4935 |
stream nextPutAll:aSymbol asString. |
4936 |
stream nextPutAll:' <'. |
|
4937 |
stream nextPutAll:colOfFiles first asString. |
|
4938 |
colOfFiles size > 1 ifTrue:[ |
|
4414 | 4939 |
stream nextPutAll:' ...'. |
3892 | 4940 |
]. |
4941 |
stream nextPutAll:'> to clipboard'. |
|
4942 |
||
4523 | 4943 |
self notify:stream contents. |
3892 | 4944 |
clp files:colOfFiles. |
4945 |
self canPaste value:true. |
|
4946 |
! ! |
|
4947 |
||
4948 |
!AbstractFileBrowser methodsFor:'drag & drop'! |
|
4949 |
||
4950 |
canDropFiles:dropedObjects for:filename |
|
6284 | 4951 |
|filenameDirString filenameDir| |
3892 | 4952 |
|
4953 |
dropedObjects isEmpty ifTrue:[^ false]. |
|
6284 | 4954 |
|
3892 | 4955 |
filenameDir := self getDirWithoutFileName:filename. |
7491 | 4956 |
filenameDir isNil ifTrue:[^ false ]. |
13232 | 4957 |
filenameDir isWritableDirectory ifFalse:[^ false]. |
6284 | 4958 |
|
3892 | 4959 |
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
|
4960 |
|
7ce6eae41e33
do not check if dropFile exists, if its an archive file
Claus Gittinger <cg@exept.de>
parents:
4959
diff
changeset
|
4961 |
dropedObjects do:[:aDropObject | |
6284 | 4962 |
(self canDropObject:aDropObject into:filenameDir) ifFalse:[^ false]. |
4963 |
"/ |dropFileName dropFileNameString physicalPathName| |
|
4964 |
"/ |
|
4965 |
"/ dropFileName := aDropObject theObject. |
|
4966 |
"/ dropFileNameString := dropFileName asString. |
|
4967 |
"/ dropFileName isDirectory ifTrue:[ |
|
4968 |
"/ (self fileName:filenameDirString startsWith:dropFileNameString) ifTrue:[ |
|
4969 |
"/ self notify:'Cannot drop a directory into one of its parent directories'. |
|
4970 |
"/ ^ false |
|
4971 |
"/ ] |
|
4972 |
"/ ] ifFalse:[ |
|
4973 |
"/ physicalPathName := dropFileName physicalPathName. |
|
4974 |
"/ (filenameDirString = dropFileName directory asString |
|
4975 |
"/ or:[ aDropObject isFileInArchive not and:[physicalPathName notNil |
|
4976 |
"/ and:[ filenameDirString = physicalPathName asFilename directory asString]]]) ifTrue:[ |
|
4977 |
"/ self notify:'Cannot drop a file into same directory'. |
|
4978 |
"/ ^ false |
|
4979 |
"/ ] |
|
4980 |
"/ ] |
|
4981 |
]. |
|
4982 |
self notify:nil. |
|
4983 |
^ true |
|
4984 |
! |
|
4985 |
||
4986 |
canDropObject:aDropObject into:aDirectory |
|
4987 |
|filenameDirString dropFileName dropFileNameString physicalPathName| |
|
4988 |
||
4989 |
dropFileName := aDropObject theObject. |
|
4990 |
dropFileNameString := dropFileName asString. |
|
4991 |
dropFileName isDirectory ifTrue:[ |
|
4992 |
filenameDirString := aDirectory asString. |
|
4993 |
(self fileName:filenameDirString startsWith:dropFileNameString) ifTrue:[ |
|
4994 |
self notify:'Cannot drop a directory into one of its parent directories'. |
|
4995 |
^ false |
|
4414 | 4996 |
] |
6284 | 4997 |
] ifFalse:[ |
4998 |
physicalPathName := dropFileName physicalPathName. |
|
4999 |
(aDirectory = dropFileName directory |
|
5000 |
or:[ aDropObject isFileInArchive not |
|
5001 |
and:[physicalPathName notNil |
|
5002 |
and:[ aDirectory = physicalPathName asFilename directory]]]) ifTrue:[ |
|
5003 |
self notify:'Cannot drop a file into same directory'. |
|
5004 |
^ false |
|
5005 |
] |
|
5006 |
]. |
|
5007 |
^ true. |
|
3892 | 5008 |
! |
5009 |
||
7406 | 5010 |
canDropObjects:aCollectionOfDropObjects in:aWidget |
17865 | 5011 |
^ aCollectionOfDropObjects contains:#isFileObject |
7406 | 5012 |
|
5013 |
"Created: / 13-10-2006 / 15:52:49 / cg" |
|
5014 |
! |
|
5015 |
||
17202 | 5016 |
doStartDrag:arg1 in:arg2 |
5017 |
^ self class doStartDrag:arg1 in:arg2 |
|
6479 | 5018 |
! |
5019 |
||
7408 | 5020 |
dropObjects:aCollectionOfDropObjects in:aWidget at:position |
7990 | 5021 |
|fileEntryFieldHolder destDir dropObject fn d| |
5022 |
||
5023 |
fileEntryFieldHolder := self masterApplication notNil |
|
5024 |
ifTrue:[ self masterApplication fileEntryFieldHolder ] |
|
5025 |
ifFalse:[ self fileEntryFieldHolder ]. |
|
5026 |
||
5027 |
aWidget model == fileEntryFieldHolder ifTrue:[ |
|
7900
52ad708471ad
drop into fileName-path-field: goto that directory
Claus Gittinger <cg@exept.de>
parents:
7897
diff
changeset
|
5028 |
dropObject := aCollectionOfDropObjects first. |
52ad708471ad
drop into fileName-path-field: goto that directory
Claus Gittinger <cg@exept.de>
parents:
7897
diff
changeset
|
5029 |
dropObject isFileObject ifTrue:[ |
52ad708471ad
drop into fileName-path-field: goto that directory
Claus Gittinger <cg@exept.de>
parents:
7897
diff
changeset
|
5030 |
fn := dropObject theObject asFilename. |
52ad708471ad
drop into fileName-path-field: goto that directory
Claus Gittinger <cg@exept.de>
parents:
7897
diff
changeset
|
5031 |
dropObject isDirectory ifTrue:[ |
52ad708471ad
drop into fileName-path-field: goto that directory
Claus Gittinger <cg@exept.de>
parents:
7897
diff
changeset
|
5032 |
d := fn. |
52ad708471ad
drop into fileName-path-field: goto that directory
Claus Gittinger <cg@exept.de>
parents:
7897
diff
changeset
|
5033 |
] ifFalse:[ |
52ad708471ad
drop into fileName-path-field: goto that directory
Claus Gittinger <cg@exept.de>
parents:
7897
diff
changeset
|
5034 |
d := fn directory. |
52ad708471ad
drop into fileName-path-field: goto that directory
Claus Gittinger <cg@exept.de>
parents:
7897
diff
changeset
|
5035 |
]. |
7990 | 5036 |
fileEntryFieldHolder value:d pathName. |
7900
52ad708471ad
drop into fileName-path-field: goto that directory
Claus Gittinger <cg@exept.de>
parents:
7897
diff
changeset
|
5037 |
]. |
52ad708471ad
drop into fileName-path-field: goto that directory
Claus Gittinger <cg@exept.de>
parents:
7897
diff
changeset
|
5038 |
^ self. |
52ad708471ad
drop into fileName-path-field: goto that directory
Claus Gittinger <cg@exept.de>
parents:
7897
diff
changeset
|
5039 |
]. |
6479 | 5040 |
|
5041 |
destDir := self currentDirectory. |
|
5042 |
destDir isNil ifTrue:[^ self]. |
|
5043 |
||
8601 | 5044 |
self withWaitCursorDo:[ |
5045 |
aCollectionOfDropObjects do:[:dropObject | |
|
5046 |
|fn| |
|
5047 |
||
5048 |
dropObject isFileObject ifTrue:[ |
|
5049 |
fn := dropObject theObject asFilename. |
|
5050 |
dropObject isDirectory ifTrue:[ |
|
8808
cb6476c0cd3a
oops - drop of directories was broken
Claus Gittinger <cg@exept.de>
parents:
8716
diff
changeset
|
5051 |
fn recursiveCopyTo:destDir |
8601 | 5052 |
] ifFalse:[ |
8950
48c69259d82d
changed: #dropObjects:in:at:
Claus Gittinger <cg@exept.de>
parents:
8887
diff
changeset
|
5053 |
fn copyTo:(destDir / fn baseName ) |
8601 | 5054 |
] |
6479 | 5055 |
] |
8601 | 5056 |
]. |
5057 |
]. |
|
9268
fbeb680106c9
changed: #dropObjects:in:at:
Claus Gittinger <cg@exept.de>
parents:
9267
diff
changeset
|
5058 |
self directoryContentsBrowser notNil ifTrue:[ |
fbeb680106c9
changed: #dropObjects:in:at:
Claus Gittinger <cg@exept.de>
parents:
9267
diff
changeset
|
5059 |
self directoryContentsBrowser |
fbeb680106c9
changed: #dropObjects:in:at:
Claus Gittinger <cg@exept.de>
parents:
9267
diff
changeset
|
5060 |
directoryContentsChangeFlag:true; |
fbeb680106c9
changed: #dropObjects:in:at:
Claus Gittinger <cg@exept.de>
parents:
9267
diff
changeset
|
5061 |
wakeUp |
fbeb680106c9
changed: #dropObjects:in:at:
Claus Gittinger <cg@exept.de>
parents:
9267
diff
changeset
|
5062 |
]. |
7408 | 5063 |
|
5064 |
"Created: / 13-10-2006 / 18:26:41 / cg" |
|
3892 | 5065 |
! ! |
5066 |
||
5067 |
!AbstractFileBrowser methodsFor:'file operations'! |
|
5068 |
||
5069 |
copyFile:aSourceFile to:aDestFile |
|
6190 | 5070 |
"copy to" |
5071 |
||
7635 | 5072 |
^ self copyFile:aSourceFile to:aDestFile repairCorruptedFiles:false |
5073 |
||
5074 |
"Modified: / 07-02-2007 / 18:46:44 / cg" |
|
5075 |
! |
|
5076 |
||
5077 |
copyFile:aSourceFile to:aDestFile repairCorruptedFiles:repairCorruptedFiles |
|
5078 |
"copy to" |
|
5079 |
||
5080 |
|copyOperation msg| |
|
5081 |
||
5082 |
repairCorruptedFiles ifTrue:[ |
|
5083 |
copyOperation := FileOperation copyCorruptedFile:aSourceFile to:aDestFile |
|
5084 |
] ifFalse:[ |
|
5085 |
copyOperation := FileOperation copyFile:aSourceFile to:aDestFile withOverWriteWarning:true copyFileIfSame:true. |
|
5086 |
]. |
|
5087 |
copyOperation result ifTrue:[ |
|
6190 | 5088 |
msg := ('copy ', aSourceFile baseName, ' to:,', aDestFile baseName). |
3892 | 5089 |
] ifFalse:[ |
7635 | 5090 |
msg := copyOperation errorString. |
6190 | 5091 |
]. |
5092 |
self notify:msg. |
|
7635 | 5093 |
^ copyOperation result |
5094 |
||
5095 |
"Created: / 07-02-2007 / 18:46:34 / cg" |
|
3892 | 5096 |
! |
5097 |
||
5098 |
copyFiles:aColOfSourceFiles to:aDirectory |
|
6374 | 5099 |
|copy result| |
3892 | 5100 |
|
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
5101 |
self withActivityIndicationDo:[ |
5961 | 5102 |
copy := FileOperation copyFiles:aColOfSourceFiles to:aDirectory. |
6374 | 5103 |
copy result ifTrue:[ |
5104 |
result := Dictionary withKeys:(copy collectionOfCopiedFiles) andValues:(copy collectionOfNewFiles). |
|
5105 |
] ifFalse:[ |
|
4629
e8739857466c
show busyCursor while moving/copying files.
Claus Gittinger <cg@exept.de>
parents:
4624
diff
changeset
|
5106 |
self notify:copy errorString. |
e8739857466c
show busyCursor while moving/copying files.
Claus Gittinger <cg@exept.de>
parents:
4624
diff
changeset
|
5107 |
]. |
e8739857466c
show busyCursor while moving/copying files.
Claus Gittinger <cg@exept.de>
parents:
4624
diff
changeset
|
5108 |
self updateCurrentDirectory. |
3892 | 5109 |
]. |
6374 | 5110 |
^ result |
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
5111 |
|
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
5112 |
"Modified: / 25-07-2006 / 09:07:04 / cg" |
3892 | 5113 |
! |
5114 |
||
15569 | 5115 |
copyFromToRepairingCorruptedFiles |
5116 |
"ask for source and destination and copy the entered file. |
|
5117 |
Especially useful for raw devices to copy corrupted disks/files |
|
5118 |
" |
|
5119 |
||
5120 |
|source destination| |
|
5121 |
||
5122 |
source := Dialog |
|
5123 |
requestDirectoryName:(resources string:'Copy from:') |
|
5124 |
default:(LastMoveDestination ? self currentDirectory) |
|
5125 |
ok:(resources string:'Continue') |
|
5126 |
abort:nil. |
|
5127 |
||
5128 |
source isEmptyOrNil ifTrue:[^ self]. |
|
5129 |
source := source asFilename. |
|
5130 |
||
5131 |
destination := Dialog |
|
5132 |
requestDirectoryName:(resources string:'Copy "%1" to:' with:source) |
|
5133 |
default:(LastMoveDestination ? self currentDirectory) |
|
5134 |
ok:(resources string:'Copy') |
|
5135 |
abort:nil. |
|
5136 |
||
5137 |
destination isEmptyOrNil ifTrue:[^ self]. |
|
5138 |
destination := destination asFilename. |
|
5139 |
||
5140 |
self copyFile:source to:destination repairCorruptedFiles:true. |
|
5141 |
! |
|
5142 |
||
4707
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
5143 |
copyOrMoveDialog:aCollectionOfFiles for:aDestinationDirectory |
12850 | 5144 |
|size msg answer file| |
4707
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
5145 |
|
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
5146 |
size := aCollectionOfFiles size. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
5147 |
|
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
5148 |
"/ stream := WriteStream on:'' asText. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
5149 |
"/ 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
|
5150 |
"/ size == 1 ifFalse:[ |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
5151 |
"/ stream nextPutAll:'s'. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
5152 |
"/ ]. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
5153 |
"/ stream nextPutAll:': '. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
5154 |
"/ 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
|
5155 |
"/ size == 1 ifFalse:[ |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
5156 |
"/ stream nextPutAll:' ... '. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
5157 |
"/ 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
|
5158 |
"/ ]. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
5159 |
"/ stream cr; nextPutAll:'to: '. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
5160 |
"/ 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
|
5161 |
"/ msg := stream contents |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
5162 |
size == 1 ifTrue:[ |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
5163 |
file := aCollectionOfFiles first. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
5164 |
msg := resources |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
5165 |
stringWithCRs:'Copy or move\\%1:\ %2\to:\ %3 ?' |
17762 | 5166 |
with:(resources string: |
5167 |
(file type == #regular |
|
5168 |
ifTrue:'file' |
|
5169 |
ifFalse:[ |
|
5170 |
file isDirectory |
|
5171 |
ifTrue:'directory' |
|
5172 |
ifFalse:'object'])) |
|
4707
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
5173 |
with:(file baseName allBold) |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
5174 |
with:(aDestinationDirectory asFilename pathName allBold). |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
5175 |
] ifFalse:[ |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
5176 |
msg := resources |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
5177 |
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
|
5178 |
with:size |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
5179 |
with:(aDestinationDirectory asFilename pathName allBold). |
3892 | 5180 |
]. |
4707
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
5181 |
|
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
5182 |
answer := OptionBox |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
5183 |
request:msg |
8127 | 5184 |
label:(resources string:'Copy or Move') |
5898
f6214812e1d2
dont send obsolete message to OptionBox
Claus Gittinger <cg@exept.de>
parents:
5888
diff
changeset
|
5185 |
image:(WarningBox iconBitmap) |
8127 | 5186 |
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
|
5187 |
values:#(#cancel #move #copy #copyAs) |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
5188 |
default:#copy. |
4707
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
5189 |
answer isNil ifTrue:[answer := #cancel]. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
5190 |
^ answer. |
17762 | 5191 |
|
5192 |
"Modified: / 17-11-2017 / 13:16:42 / cg" |
|
3892 | 5193 |
! |
5194 |
||
4354
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
5195 |
copyOrMoveFiles:aColOfSourceFiles to:aDestinationDirectory |
4745 | 5196 |
"copy or move aColOfSourceFiles to aDirectory. |
5197 |
Asks the used if a move or a copy is wanted. |
|
5198 |
Returns true if the copyOrMove happened, false if user aborted the operation." |
|
5199 |
||
4707
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
5200 |
|answer lastOld lastNew| |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
5201 |
|
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
5202 |
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
|
5203 |
answer == #copyAs ifTrue:[ |
4354
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
5204 |
aColOfSourceFiles do:[:eachSourceFile | |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
5205 |
|initial destFile srcBase dstBase| |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
5206 |
|
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
5207 |
srcBase := eachSourceFile asFilename baseName. |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
5208 |
lastOld isNil ifTrue:[ |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
5209 |
initial := srcBase |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
5210 |
] ifFalse:[ |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
5211 |
initial := DoWhatIMeanSupport |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
5212 |
goodRenameDefaultForFile:srcBase lastOld:lastOld lastNew:lastNew. |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
5213 |
]. |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
5214 |
dstBase := Dialog request:('Copy %1 as:' bindWith:srcBase) initialAnswer:initial. |
4745 | 5215 |
dstBase isNil ifTrue:[^ false]. |
4354
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
5216 |
self copyFile:eachSourceFile to:(aDestinationDirectory construct:dstBase). |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
5217 |
lastOld := srcBase. |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
5218 |
lastNew := dstBase. |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
5219 |
]. |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
5220 |
|
4745 | 5221 |
^ true. |
4354
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
5222 |
]. |
4707
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
5223 |
answer == #copy ifTrue:[ |
4354
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
5224 |
self copyFiles:aColOfSourceFiles to:aDestinationDirectory. |
4745 | 5225 |
^ true. |
3892 | 5226 |
]. |
4707
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
5227 |
answer == #move ifTrue:[ |
4354
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
5228 |
self moveFiles:aColOfSourceFiles to:aDestinationDirectory. |
4745 | 5229 |
^ true. |
3892 | 5230 |
]. |
4745 | 5231 |
^ false. |
3892 | 5232 |
! |
5233 |
||
6107 | 5234 |
copySelectionTo |
5235 |
"copy the selected file(s) to another directory" |
|
5236 |
||
13704 | 5237 |
self copySelectionToRepairingCorruptedFiles:false. |
5238 |
self updateCurrentDirectoryWithReread. |
|
7635 | 5239 |
|
5240 |
"Modified: / 07-02-2007 / 18:42:48 / cg" |
|
5241 |
! |
|
5242 |
||
5243 |
copySelectionToRepairingCorruptedFiles |
|
5244 |
"copy the selected file(s) to another directory" |
|
5245 |
||
13704 | 5246 |
self copySelectionToRepairingCorruptedFiles:true. |
5247 |
self updateCurrentDirectoryWithReread. |
|
7635 | 5248 |
|
5249 |
"Created: / 07-02-2007 / 18:42:59 / cg" |
|
5250 |
! |
|
5251 |
||
5252 |
copySelectionToRepairingCorruptedFiles:repairingCorruptedFiles |
|
5253 |
"copy the selected file(s) to another directory" |
|
5254 |
||
6299 | 5255 |
|selectedFiles msg destination directory| |
5256 |
||
7560 | 5257 |
selectedFiles := self currentSelectedObjects copy. |
6299 | 5258 |
selectedFiles isEmptyOrNil ifTrue:[^ self]. |
5259 |
||
5260 |
msg := (selectedFiles size > 1) |
|
14588 | 5261 |
ifTrue:[ 'Copy Selected Items to Directory:' ] |
5262 |
ifFalse:[ 'Copy "%1" to Directory:' ]. |
|
6299 | 5263 |
|
5264 |
destination := Dialog |
|
14588 | 5265 |
requestDirectoryName:(resources stringWithCRs:msg with:selectedFiles first baseName) |
7635 | 5266 |
default:(LastMoveDestination ? self currentDirectory) |
5267 |
ok:(resources string:'Copy') |
|
5268 |
abort:nil. |
|
5269 |
||
6299 | 5270 |
destination isEmptyOrNil ifTrue:[^ self]. |
5271 |
destination := destination asFilename. |
|
5272 |
||
5273 |
destination isDirectory ifFalse:[ |
|
5274 |
selectedFiles size == 1 ifTrue:[ |
|
5275 |
directory := destination directory. |
|
5276 |
directory isDirectory ifTrue:[ |
|
5277 |
LastMoveDestination := directory. |
|
7635 | 5278 |
self copyFile:selectedFiles first to:destination repairCorruptedFiles:repairingCorruptedFiles. |
6299 | 5279 |
^ self. |
5280 |
] |
|
5281 |
] |
|
5282 |
]. |
|
5283 |
||
5284 |
LastMoveDestination := destination. |
|
7635 | 5285 |
repairingCorruptedFiles ifTrue:[ |
5286 |
selectedFiles do:[:eachFile | |
|
5287 |
self copyFile:eachFile to:destination repairCorruptedFiles:repairingCorruptedFiles. |
|
5288 |
]. |
|
5289 |
^ self. |
|
5290 |
] ifFalse:[ |
|
5291 |
self copyFiles:selectedFiles to:destination |
|
5292 |
] |
|
5293 |
||
5294 |
"Created: / 07-02-2007 / 18:42:35 / cg" |
|
6107 | 5295 |
! |
5296 |
||
3892 | 5297 |
deleteFile:aFile |
6373 | 5298 |
"delete the selected files/directories" |
3892 | 5299 |
|
5300 |
^ self deleteFiles:(OrderedCollection with:aFile). |
|
5301 |
! |
|
5302 |
||
5303 |
deleteFiles:colOfFiles |
|
6373 | 5304 |
"delete some files/directories" |
5305 |
||
5081 | 5306 |
^ self deleteFiles:colOfFiles confirm:true. |
5307 |
! |
|
5308 |
||
5309 |
deleteFiles:colOfFiles confirm:confirm |
|
6373 | 5310 |
"delete some files/directories" |
5311 |
||
5673 | 5312 |
|delete result| |
3892 | 5313 |
|
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
5314 |
self withActivityIndicationDo:[ |
9575
548adf8e9d98
added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents:
9572
diff
changeset
|
5315 |
ProgressNotification handle:[:info | |
548adf8e9d98
added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents:
9572
diff
changeset
|
5316 |
self progressPercentageHolder value:info progressValue. |
548adf8e9d98
added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents:
9572
diff
changeset
|
5317 |
info proceed |
548adf8e9d98
added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents:
9572
diff
changeset
|
5318 |
] do:[ |
548adf8e9d98
added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents:
9572
diff
changeset
|
5319 |
delete := FileOperation deleteFiles:colOfFiles confirm:confirm. |
548adf8e9d98
added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents:
9572
diff
changeset
|
5320 |
result := delete result. |
548adf8e9d98
added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents:
9572
diff
changeset
|
5321 |
]. |
5673 | 5322 |
result notNil ifTrue:[ |
5323 |
result ifFalse:[ |
|
5324 |
self notify:delete errorString. |
|
5753 | 5325 |
] ifTrue:[ |
5326 |
self updateListAfterDelete:colOfFiles. |
|
5327 |
] |
|
4394 | 5328 |
]. |
5673 | 5329 |
]. |
5330 |
^ result. |
|
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
5331 |
|
9575
548adf8e9d98
added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents:
9572
diff
changeset
|
5332 |
"Modified: / 11-10-2010 / 13:08:24 / cg" |
3892 | 5333 |
! |
5334 |
||
6169 | 5335 |
eraseFiles:colOfFiles |
6373 | 5336 |
"erase (clear and delete) some files/directories" |
5337 |
||
6169 | 5338 |
^ self eraseFiles:colOfFiles confirm:true. |
5339 |
! |
|
5340 |
||
5341 |
eraseFiles:colOfFiles confirm:confirm |
|
6373 | 5342 |
"erase (clear and delete) some files/directories" |
5343 |
||
8462
a5d12742a900
changed #eraseFiles:confirm:
Claus Gittinger <cg@exept.de>
parents:
8454
diff
changeset
|
5344 |
|deleteOperation result fileSize| |
6169 | 5345 |
|
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
5346 |
self withActivityIndicationDo:[ |
8462
a5d12742a900
changed #eraseFiles:confirm:
Claus Gittinger <cg@exept.de>
parents:
8454
diff
changeset
|
5347 |
fileSize := colOfFiles first asFilename fileSize. |
8294 | 5348 |
deleteOperation := FileOperation eraseFiles:colOfFiles confirm:confirm. |
8462
a5d12742a900
changed #eraseFiles:confirm:
Claus Gittinger <cg@exept.de>
parents:
8454
diff
changeset
|
5349 |
(colOfFiles size == 1 and:[ fileSize < (10*1024*1024) ]) |
8294 | 5350 |
ifTrue:[ |
5351 |
result := deleteOperation result. |
|
5352 |
] ifFalse:[ |
|
5353 |
ProgressIndicator |
|
5354 |
displayProgressNotifications:'Erasing' |
|
5355 |
abortable:true |
|
5356 |
at:nil |
|
5357 |
during:[ |
|
5358 |
result := deleteOperation result. |
|
5359 |
]. |
|
5360 |
]. |
|
5361 |
||
6169 | 5362 |
result notNil ifTrue:[ |
5363 |
result ifFalse:[ |
|
8294 | 5364 |
self notify:deleteOperation errorString. |
6169 | 5365 |
] ifTrue:[ |
5366 |
self updateListAfterDelete:colOfFiles. |
|
5367 |
] |
|
5368 |
]. |
|
5369 |
]. |
|
5370 |
^ result. |
|
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
5371 |
|
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
5372 |
"Modified: / 25-07-2006 / 09:07:16 / cg" |
6169 | 5373 |
! |
5374 |
||
3892 | 5375 |
moveFile:aSourceFile to:aDestFile |
6373 | 5376 |
"move a file/directory" |
3892 | 5377 |
|
5378 |
|move| |
|
5379 |
||
5961 | 5380 |
move := FileOperation moveFile:aSourceFile to:aDestFile. |
3892 | 5381 |
move result ifTrue:[ |
15346 | 5382 |
self notify:(resources string: 'move "%1" to "%2"' with:aSourceFile asString with:aDestFile asString). |
3892 | 5383 |
] ifFalse:[ |
4523 | 5384 |
self notify:move errorString. |
3892 | 5385 |
]. |
17871 | 5386 |
self updateCurrentDirectoryWithReread. |
3892 | 5387 |
^ move result |
5388 |
! |
|
5389 |
||
5390 |
moveFiles:aColOfSourceFiles to:aDirectory |
|
6373 | 5391 |
"move some files to aDirectory" |
5392 |
||
3892 | 5393 |
|move| |
5394 |
||
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
5395 |
self withActivityIndicationDo:[ |
5961 | 5396 |
move := FileOperation moveFiles:aColOfSourceFiles to:aDirectory. |
4629
e8739857466c
show busyCursor while moving/copying files.
Claus Gittinger <cg@exept.de>
parents:
4624
diff
changeset
|
5397 |
move result ifFalse:[ |
e8739857466c
show busyCursor while moving/copying files.
Claus Gittinger <cg@exept.de>
parents:
4624
diff
changeset
|
5398 |
self notify:move errorString. |
e8739857466c
show busyCursor while moving/copying files.
Claus Gittinger <cg@exept.de>
parents:
4624
diff
changeset
|
5399 |
]. |
17871 | 5400 |
self updateCurrentDirectoryWithReread. |
3892 | 5401 |
]. |
6373 | 5402 |
^ move collectionOfMovedFiles |
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
5403 |
|
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
5404 |
"Modified: / 25-07-2006 / 09:07:32 / cg" |
3892 | 5405 |
! |
5406 |
||
6107 | 5407 |
moveSelectionTo |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
5408 |
"move the selected file(s) to another directory" |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
5409 |
|
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
5410 |
|destinationDirectory| |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
5411 |
|
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
5412 |
destinationDirectory := Dialog |
14588 | 5413 |
requestDirectoryName:(resources stringWithCRs:'Move Selected Items to Directory:') |
5789 | 5414 |
default:(LastMoveDestination ? self currentDirectory) |
6952 | 5415 |
ok:(resources string:'Move') |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
5416 |
abort:nil. |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
5417 |
destinationDirectory isEmptyOrNil ifTrue:[^ self]. |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
5418 |
|
5789 | 5419 |
LastMoveDestination := destinationDirectory. |
13704 | 5420 |
self moveFiles:(self currentSelectedObjects copy) to:destinationDirectory asFilename. |
5421 |
self updateCurrentDirectoryWithReread. |
|
5422 |
||
7560 | 5423 |
|
5424 |
"Modified: / 04-12-2006 / 13:15:12 / cg" |
|
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
5425 |
! |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
5426 |
|
3892 | 5427 |
newDirectory |
5428 |
"ask for and create a new directory" |
|
5429 |
||
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
5430 |
|selectedFiles singleSelectedFile defaultAnswer directory createOp newFile mime| |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
5431 |
|
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
5432 |
directory := self currentDirectory. |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
5433 |
directory isNil ifTrue:[ |
18175 | 5434 |
self warn:'Select a single directory to create a directory' translate:true. |
4979
366465d1a8a5
warn on create new file or directory if nothing selected or more than one directory
penk
parents:
4976
diff
changeset
|
5435 |
^ self |
366465d1a8a5
warn on create new file or directory if nothing selected or more than one directory
penk
parents:
4976
diff
changeset
|
5436 |
]. |
4521 | 5437 |
|
5438 |
"/ 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
|
5439 |
selectedFiles := self currentSelectedFiles. |
4521 | 5440 |
selectedFiles size == 1 ifTrue:[ |
5441 |
singleSelectedFile := selectedFiles first. |
|
5442 |
||
5443 |
mime := MIMETypes mimeTypeForFilename:singleSelectedFile. |
|
13714 | 5444 |
(mime notNil and:[mime isArchiveType]) ifTrue:[ |
4521 | 5445 |
defaultAnswer := singleSelectedFile asFilename withoutSuffix baseName. |
5446 |
||
5447 |
mime := MIMETypes mimeTypeForFilename:defaultAnswer. |
|
13714 | 5448 |
(mime notNil and:[mime isArchiveType]) ifTrue:[ |
4521 | 5449 |
defaultAnswer := defaultAnswer asFilename withoutSuffix baseName |
5450 |
]. |
|
5451 |
]. |
|
5452 |
]. |
|
5453 |
||
5961 | 5454 |
|
4521 | 5455 |
defaultAnswer notNil ifTrue:[ |
5961 | 5456 |
createOp := FileOperation createDirectoryIn:directory initialAnswer:defaultAnswer. |
4521 | 5457 |
] ifFalse:[ |
5961 | 5458 |
createOp := FileOperation createDirectoryIn:directory. |
4521 | 5459 |
]. |
5460 |
createOp result ifFalse:[ ^ self]. |
|
5461 |
newFile := createOp createdFile. |
|
3892 | 5462 |
newFile notNil ifTrue:[ |
17871 | 5463 |
self updateCurrentDirectoryWithReread. |
3892 | 5464 |
] |
17818 | 5465 |
|
5466 |
"Modified: / 29-11-2017 / 12:26:41 / cg" |
|
18175 | 5467 |
"Modified: / 01-06-2018 / 12:49:43 / Claus Gittinger" |
3892 | 5468 |
! |
5469 |
||
5470 |
newFile |
|
5471 |
"ask for and create a new file" |
|
5472 |
||
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
5473 |
| curFile directory create file| |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
5474 |
|
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
5475 |
directory := self currentDirectory. |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
5476 |
directory isNil ifTrue:[ |
18175 | 5477 |
self warn:'Select a single directory to create a file.' translate:true. |
4979
366465d1a8a5
warn on create new file or directory if nothing selected or more than one directory
penk
parents:
4976
diff
changeset
|
5478 |
^ self. |
366465d1a8a5
warn on create new file or directory if nothing selected or more than one directory
penk
parents:
4976
diff
changeset
|
5479 |
]. |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
5480 |
|
3982 | 5481 |
curFile := self firstSelectedFile. |
3892 | 5482 |
curFile notNil ifTrue:[ |
4414 | 5483 |
file := curFile. |
3892 | 5484 |
] ifFalse:[ |
4414 | 5485 |
file := directory. |
3892 | 5486 |
]. |
5961 | 5487 |
create := FileOperation createFileIn:file. |
3892 | 5488 |
create result ifFalse:[ ^ self]. |
5489 |
self updateAndSelect:(OrderedCollection with:(create createdFile)). |
|
17818 | 5490 |
|
5491 |
"Modified: / 29-11-2017 / 12:26:51 / cg" |
|
18175 | 5492 |
"Modified: / 01-06-2018 / 12:49:50 / Claus Gittinger" |
3892 | 5493 |
! |
5494 |
||
5495 |
newHardLink |
|
5496 |
"ask for and create a hard link (unix only)" |
|
5497 |
||
6151 | 5498 |
self newLink:#hard. |
5499 |
! |
|
5500 |
||
5501 |
newLink:typeOfLink |
|
3892 | 5502 |
"ask for and create a symbolic if symbolic is true otherwise a hard link (unix only)" |
5503 |
||
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
5504 |
| sel dir create createdFile| |
3892 | 5505 |
|
7560 | 5506 |
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
|
5507 |
(sel size ~= 1) ifTrue:[ |
18175 | 5508 |
self warn:'Select one directory to link' translate:true. |
4979
366465d1a8a5
warn on create new file or directory if nothing selected or more than one directory
penk
parents:
4976
diff
changeset
|
5509 |
^ self |
366465d1a8a5
warn on create new file or directory if nothing selected or more than one directory
penk
parents:
4976
diff
changeset
|
5510 |
]. |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
5511 |
dir := sel first. |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
5512 |
|
6151 | 5513 |
create := FileOperation createLinkIn:dir soft:(typeOfLink == #soft). |
3892 | 5514 |
create result ifFalse:[ ^ self]. |
5515 |
createdFile := create createdFile. |
|
5516 |
createdFile notNil ifTrue:[ |
|
6151 | 5517 |
typeOfLink == #soft ifTrue:[ |
17871 | 5518 |
self updateCurrentDirectoryWithReread. |
4785
5a3f7a0c3ff1
symbolic link creation code fixed
Claus Gittinger <cg@exept.de>
parents:
4782
diff
changeset
|
5519 |
] ifFalse:[ |
5a3f7a0c3ff1
symbolic link creation code fixed
Claus Gittinger <cg@exept.de>
parents:
4782
diff
changeset
|
5520 |
self updateAndSelect:(OrderedCollection with:createdFile). |
5a3f7a0c3ff1
symbolic link creation code fixed
Claus Gittinger <cg@exept.de>
parents:
4782
diff
changeset
|
5521 |
] |
3892 | 5522 |
]. |
7560 | 5523 |
|
17818 | 5524 |
"Modified: / 29-11-2017 / 12:26:58 / cg" |
18175 | 5525 |
"Modified: / 01-06-2018 / 12:49:32 / Claus Gittinger" |
3892 | 5526 |
! |
5527 |
||
5528 |
newSoftLink |
|
5529 |
"ask for and create a soft link (unix only)" |
|
5530 |
||
6151 | 5531 |
self newLink:#soft. |
3892 | 5532 |
! |
5533 |
||
5534 |
pasteFiles |
|
6373 | 5535 |
"paste from clipBoard" |
5536 |
||
5537 |
|buffer destination files directories copiedFiles thisIsAFileMoveOperation| |
|
3892 | 5538 |
|
5539 |
files := self clipboard files. |
|
6482
00207f456339
isEmptyOrNil / notEmptyOrNil refactoring
Claus Gittinger <cg@exept.de>
parents:
6479
diff
changeset
|
5540 |
files isEmptyOrNil ifTrue:[ ^ self ]. |
6373 | 5541 |
|
5542 |
thisIsAFileMoveOperation := self clipboard method == #cut. |
|
5543 |
||
3892 | 5544 |
buffer := self clipboard copy. |
3982 | 5545 |
directories := self currentSelectedDirectories. |
5880 | 5546 |
directories size ~~ 1 ifTrue:[ |
4414 | 5547 |
|box dirStringCol| |
5880 | 5548 |
|
4414 | 5549 |
dirStringCol := directories collect:[:aDir| aDir asString]. |
5550 |
box := ListSelectionBox new. |
|
6373 | 5551 |
box title:'Paste into which directory ?'. |
4414 | 5552 |
box list:dirStringCol. |
5553 |
box okAction:[:sel | destination := sel asFilename]. |
|
5003
a14ce263ada5
boxes no longer show at pointer
Claus Gittinger <cg@exept.de>
parents:
4982
diff
changeset
|
5554 |
box show. |
a14ce263ada5
boxes no longer show at pointer
Claus Gittinger <cg@exept.de>
parents:
4982
diff
changeset
|
5555 |
box destroy. |
3892 | 5556 |
] ifFalse:[ |
5880 | 5557 |
destination := directories anElement. |
3892 | 5558 |
]. |
6373 | 5559 |
|
5560 |
thisIsAFileMoveOperation ifTrue:[ |
|
5081 | 5561 |
buffer files copy do:[:aFile| |
5562 |
aFile directory = destination ifTrue:[ |
|
5563 |
buffer files remove:aFile. |
|
5564 |
]. |
|
5565 |
]. |
|
5566 |
]. |
|
5567 |
copiedFiles := self copyFiles:(buffer files) to:destination. |
|
6374 | 5568 |
copiedFiles notEmptyOrNil ifTrue:[ |
5569 |
thisIsAFileMoveOperation ifTrue:[ |
|
5570 |
self deleteFiles:(copiedFiles keys) confirm:false. |
|
5571 |
]. |
|
5572 |
||
5573 |
"/ select those pasted files. |
|
5574 |
self updateCurrentDirectory:true. |
|
5575 |
self currentFileNameHolder value:copiedFiles values. |
|
5576 |
] |
|
3892 | 5577 |
! |
5578 |
||
5579 |
renameFile:aFile |
|
5580 |
"rename the selected file(s)" |
|
5581 |
||
9793
df3c1b8165fa
variable renamed in: #renameFile:
Stefan Vogel <sv@exept.de>
parents:
9784
diff
changeset
|
5582 |
^ self renameFiles:(Array with:aFile). |
3892 | 5583 |
! |
5584 |
||
4230 | 5585 |
renameFile:filename to:newFileString update:aBoolean |
3892 | 5586 |
"rename filename to newFileString" |
5587 |
||
5588 |
|rename| |
|
5589 |
||
5961 | 5590 |
rename := FileOperation renameFile:filename to:newFileString. |
3892 | 5591 |
rename result ifTrue:[ |
4230 | 5592 |
aBoolean ifTrue:[ |
5593 |
self updateAndSelect:(rename renamedFiles). |
|
5594 |
]. |
|
3892 | 5595 |
] ifFalse:[ |
4523 | 5596 |
self notify:rename errorString. |
3892 | 5597 |
]. |
5598 |
^ rename result |
|
5599 |
! |
|
5600 |
||
5601 |
renameFiles:aColOfFiles |
|
6373 | 5602 |
"rename some file(s)" |
3892 | 5603 |
|
5604 |
|rename| |
|
5605 |
||
5961 | 5606 |
rename := FileOperation renameFiles:aColOfFiles. |
3892 | 5607 |
rename result ifFalse:[ |
9793
df3c1b8165fa
variable renamed in: #renameFile:
Stefan Vogel <sv@exept.de>
parents:
9784
diff
changeset
|
5608 |
self notify:rename errorString. |
df3c1b8165fa
variable renamed in: #renameFile:
Stefan Vogel <sv@exept.de>
parents:
9784
diff
changeset
|
5609 |
^ nil. |
df3c1b8165fa
variable renamed in: #renameFile:
Stefan Vogel <sv@exept.de>
parents:
9784
diff
changeset
|
5610 |
]. |
df3c1b8165fa
variable renamed in: #renameFile:
Stefan Vogel <sv@exept.de>
parents:
9784
diff
changeset
|
5611 |
^ rename |
3892 | 5612 |
! |
5613 |
||
5614 |
renameSelection |
|
5615 |
"rename the selected file(s)" |
|
5616 |
||
9793
df3c1b8165fa
variable renamed in: #renameFile:
Stefan Vogel <sv@exept.de>
parents:
9784
diff
changeset
|
5617 |
|renamed| |
df3c1b8165fa
variable renamed in: #renameFile:
Stefan Vogel <sv@exept.de>
parents:
9784
diff
changeset
|
5618 |
|
df3c1b8165fa
variable renamed in: #renameFile:
Stefan Vogel <sv@exept.de>
parents:
9784
diff
changeset
|
5619 |
renamed := self renameFiles:(self currentSelectedObjects copy). |
df3c1b8165fa
variable renamed in: #renameFile:
Stefan Vogel <sv@exept.de>
parents:
9784
diff
changeset
|
5620 |
renamed notNil ifTrue:[ |
df3c1b8165fa
variable renamed in: #renameFile:
Stefan Vogel <sv@exept.de>
parents:
9784
diff
changeset
|
5621 |
self updateAndSelect:renamed renamedFiles. |
df3c1b8165fa
variable renamed in: #renameFile:
Stefan Vogel <sv@exept.de>
parents:
9784
diff
changeset
|
5622 |
]. |
7560 | 5623 |
|
5624 |
"Modified: / 04-12-2006 / 13:15:24 / cg" |
|
3892 | 5625 |
! ! |
5626 |
||
4080 | 5627 |
!AbstractFileBrowser methodsFor:'menu accessing'! |
3892 | 5628 |
|
9111
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
5629 |
bookmarksMenu |
3952 | 5630 |
<resource: #programMenu> |
5631 |
||
14941 | 5632 |
^ self bookmarksMenuForBaseSpec:self class baseBookmarksMenuSpec. |
5633 |
! |
|
5634 |
||
5635 |
bookmarksMenuForBaseSpec:aBaseMenuSpec |
|
5636 |
<resource: #programMenu> |
|
5637 |
||
4672
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
5638 |
|menu bookmarks| |
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
5639 |
|
14941 | 5640 |
menu := aBaseMenuSpec decodeAsLiteralArray. |
7763 | 5641 |
|
5642 |
"/ add the bookmark items ... |
|
5643 |
bookmarks := self class directoryBookmarks. |
|
5644 |
bookmarks notEmptyOrNil ifTrue:[ |
|
14604 | 5645 |
menu addSeparator. |
7763 | 5646 |
bookmarks do:[:dirName | |
12963 | 5647 |
menu addItem:(MenuItem |
5648 |
label:dirName asString |
|
5649 |
itemValue:[ |
|
5650 |
(self currentSelectedDirectories includes:dirName) ifFalse:[ |
|
5651 |
self setCurrentFileName:dirName. |
|
5652 |
]. |
|
5653 |
]). |
|
7763 | 5654 |
]. |
5655 |
]. |
|
4080 | 5656 |
menu findGuiResourcesIn:self. |
7763 | 5657 |
^ menu |
5658 |
||
11135 | 5659 |
"Modified: / 14-01-2012 / 21:14:03 / cg" |
7763 | 5660 |
! |
5661 |
||
5662 |
canBackward |
|
5663 |
^ self directoryHistory canBackward. |
|
5664 |
||
5665 |
"Modified: / 27-03-2007 / 10:54:55 / cg" |
|
5666 |
! |
|
5667 |
||
5668 |
canForward |
|
5669 |
^ self directoryHistory canForward. |
|
5670 |
||
5671 |
"Modified: / 27-03-2007 / 10:54:57 / cg" |
|
5672 |
! |
|
5673 |
||
9111
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
5674 |
gotoBookmarksMenu |
7763 | 5675 |
<resource: #programMenu> |
5676 |
||
14941 | 5677 |
^ self bookmarksMenuForBaseSpec:self class baseBookmarksMenuSpec2. |
6099 | 5678 |
! |
5679 |
||
3892 | 5680 |
menuDirHistory:backOrForward |
7763 | 5681 |
"initialize the history menu" |
5682 |
||
3892 | 5683 |
<resource: #programMenu > |
5684 |
||
7763 | 5685 |
|hist menu pathList currentSel currentPath| |
5686 |
||
5687 |
hist := self directoryHistory. |
|
5688 |
hist isEmpty ifTrue:[^ nil]. |
|
5689 |
||
3892 | 5690 |
backOrForward == #back ifTrue:[ |
6725 | 5691 |
currentSel := self currentSelectedDirectories. |
4347 | 5692 |
currentSel size == 1 ifTrue:[ |
5693 |
currentPath := currentSel first asString. |
|
5694 |
] ifFalse:[ |
|
5695 |
currentPath := nil. |
|
5696 |
]. |
|
7763 | 5697 |
pathList := hist getBackCollection. |
3892 | 5698 |
] ifFalse:[ |
7763 | 5699 |
pathList := hist getForwardCollection. |
3892 | 5700 |
]. |
4022 | 5701 |
pathList isEmpty ifTrue:[ ^ nil]. |
7763 | 5702 |
|
6370 | 5703 |
pathList size > 30 ifTrue:[ |
5704 |
pathList := pathList copyTo:30 |
|
5705 |
]. |
|
7763 | 5706 |
|
5707 |
menu := Menu new. |
|
5708 |
||
3964 | 5709 |
pathList do:[:aPath| |
14593 | 5710 |
menu addItem:(MenuItem |
5711 |
label:aPath |
|
5712 |
itemValue:[ self setCurrentFileName:(aPath asFilename) ] |
|
5713 |
translateLabel:false). |
|
3952 | 5714 |
]. |
7763 | 5715 |
menu findGuiResourcesIn:self. |
3892 | 5716 |
^ menu |
7763 | 5717 |
|
11783 | 5718 |
"Modified: / 09-09-2012 / 13:07:22 / cg" |
3892 | 5719 |
! |
5720 |
||
5721 |
menuDirHistoryBack |
|
5722 |
"initialize the directory menu |
|
5723 |
" |
|
5724 |
<resource: #programMenu > |
|
5725 |
||
5726 |
^ self menuDirHistory:#back. |
|
5727 |
! |
|
5728 |
||
5729 |
menuDirHistoryForward |
|
5730 |
"initialize the directory menu |
|
5731 |
" |
|
5732 |
<resource: #programMenu > |
|
5733 |
||
5734 |
^ self menuDirHistory:#forward. |
|
3906 | 5735 |
! |
5736 |
||
5737 |
menuFileHistory |
|
5738 |
"initialize the file history menu |
|
5739 |
" |
|
5740 |
<resource: #programMenu > |
|
5741 |
||
7763 | 5742 |
|menu hist text removeItem| |
3906 | 5743 |
|
5744 |
hist := self fileHistory. |
|
5745 |
hist isEmpty ifTrue:[^ nil]. |
|
4391
05ad03de6f3c
no icon in clearHistory menuItem
Claus Gittinger <cg@exept.de>
parents:
4368
diff
changeset
|
5746 |
|
7763 | 5747 |
menu := Menu new. |
5748 |
||
5749 |
hist copy do:[:aFileItem| |
|
4391
05ad03de6f3c
no icon in clearHistory menuItem
Claus Gittinger <cg@exept.de>
parents:
4368
diff
changeset
|
5750 |
aFileItem fileName exists ifTrue:[ |
12963 | 5751 |
menu addItem:(MenuItem |
5752 |
label: aFileItem fileName asString |
|
14593 | 5753 |
itemValue: |
5754 |
[ |
|
5755 |
self setCurrentFileName:(aFileItem fileName). |
|
5756 |
self openApplByFileItem:aFileItem |
|
5757 |
] |
|
5758 |
translateLabel:false). |
|
4391
05ad03de6f3c
no icon in clearHistory menuItem
Claus Gittinger <cg@exept.de>
parents:
4368
diff
changeset
|
5759 |
] ifFalse:[ |
7763 | 5760 |
"/ remove all not existing history entries |
5761 |
hist remove:aFileItem. |
|
4391
05ad03de6f3c
no icon in clearHistory menuItem
Claus Gittinger <cg@exept.de>
parents:
4368
diff
changeset
|
5762 |
] |
3906 | 5763 |
]. |
7763 | 5764 |
menu addSeparator. |
5765 |
||
4080 | 5766 |
removeItem := MenuItem new. |
5767 |
removeItem translateLabel:true. |
|
4391
05ad03de6f3c
no icon in clearHistory menuItem
Claus Gittinger <cg@exept.de>
parents:
4368
diff
changeset
|
5768 |
text := resources string:'Clear History'. |
05ad03de6f3c
no icon in clearHistory menuItem
Claus Gittinger <cg@exept.de>
parents:
4368
diff
changeset
|
5769 |
"/ text := LabelAndIcon icon:(self class clearHistoryIcon) string:text. |
4080 | 5770 |
removeItem label:text. |
11783 | 5771 |
removeItem |
5772 |
itemValue:[ |
|
5773 |
self fileHistory removeAll. |
|
5774 |
self enableFileHistory value:false. |
|
5775 |
]. |
|
3906 | 5776 |
menu addItem:removeItem. |
7763 | 5777 |
menu findGuiResourcesIn:self. |
3906 | 5778 |
^ menu |
7763 | 5779 |
|
11783 | 5780 |
"Modified (format): / 09-09-2012 / 13:07:36 / cg" |
3952 | 5781 |
! |
5782 |
||
4080 | 5783 |
sortMenu |
5784 |
<resource: #programMenu > |
|
5785 |
||
5786 |
|menu| |
|
5787 |
||
7763 | 5788 |
menu := Menu decodeFromLiteralArray:self class sortMenu. |
4080 | 5789 |
menu findGuiResourcesIn:self. |
5790 |
^ menu |
|
7763 | 5791 |
|
5792 |
"Modified: / 27-03-2007 / 10:47:42 / cg" |
|
4080 | 5793 |
! |
5794 |
||
5795 |
viewDetailsMenuSpec |
|
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
5796 |
|specContentsBrowser itemsContentsBrowser specHere itemsHere spec| |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
5797 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
5798 |
specHere := self class viewDetailsMenuSpec. |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
5799 |
itemsHere := specHere at:2. |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
5800 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
5801 |
specContentsBrowser := self directoryContentsBrowser class viewBrowserMenuSpec. |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
5802 |
itemsContentsBrowser := (specContentsBrowser at:2). |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
5803 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
5804 |
spec := specHere copy. |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
5805 |
spec at:2 put:(itemsContentsBrowser , itemsHere). |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
5806 |
^ spec |
4080 | 5807 |
! |
5808 |
||
5809 |
viewInContentsBrowserMenu |
|
5009 | 5810 |
self |
5811 |
applicationNamed:#DirectoryContentsBrowser |
|
5812 |
ifPresentDo:[:appl | ^ appl viewBrowserMenu]. |
|
5813 |
||
5814 |
^ nil. |
|
4080 | 5815 |
! |
5816 |
||
3952 | 5817 |
visitedDirectoriesMenu |
5818 |
<resource: #programMenu > |
|
5819 |
||
5820 |
|menu histCopy text removeItem| |
|
5821 |
||
7763 | 5822 |
histCopy := self directoryHistory. |
5823 |
histCopy isEmpty ifTrue:[^ nil]. |
|
5824 |
||
3952 | 5825 |
menu := Menu new. |
7763 | 5826 |
|
5827 |
histCopy do:[:aFile| |
|
12963 | 5828 |
menu addItem:(MenuItem |
5829 |
label:aFile asString |
|
5830 |
itemValue:[ |
|
5831 |
self setCurrentFileName:(aFile path asFilename). |
|
5832 |
]). |
|
7763 | 5833 |
]. |
5834 |
menu addSeparator. |
|
5835 |
||
4672
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
5836 |
"/ 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
|
5837 |
text := (resources string:'Clear History'). |
3952 | 5838 |
removeItem := MenuItem new. |
4040 | 5839 |
removeItem translateLabel:true. |
3952 | 5840 |
removeItem label:text. |
11783 | 5841 |
removeItem |
5842 |
itemValue:[ |
|
5843 |
self directoryHistory removeAll. |
|
5844 |
self enableForward value:self canForward. |
|
5845 |
self enableBack value:self canBackward. |
|
5846 |
]. |
|
7763 | 5847 |
|
3952 | 5848 |
menu addItem:removeItem. |
7763 | 5849 |
menu findGuiResourcesIn:self. |
3952 | 5850 |
^ menu |
7763 | 5851 |
|
11783 | 5852 |
"Modified: / 09-09-2012 / 13:07:45 / cg" |
3892 | 5853 |
! ! |
5854 |
||
5880 | 5855 |
!AbstractFileBrowser methodsFor:'menu actions'! |
5856 |
||
5857 |
doCompareTwoFiles |
|
5858 |
self openDiffView. |
|
5859 |
! |
|
5860 |
||
5861 |
doGoDirectoryUp |
|
5960 | 5862 |
| upDir directory rootInTreeView| |
5880 | 5863 |
|
5864 |
self enableDirectoryUp value ifFalse:[ ^ self]. |
|
5865 |
self currentFilesAreInSameDirectory ifTrue:[ |
|
5960 | 5866 |
directory := self currentDirectory. |
5867 |
directory isNil ifTrue:[ ^ self]. |
|
5880 | 5868 |
] ifFalse:[ |
5869 |
rootInTreeView := self |
|
5870 |
applicationNamed:#DirectoryTreeBrowser |
|
5871 |
ifPresentDo:[:appl | appl rootHolder]. |
|
5960 | 5872 |
directory := rootInTreeView value asFilename. |
5873 |
]. |
|
5874 |
upDir := directory directory. |
|
5959 | 5875 |
self setCurrentFileName:upDir. |
5880 | 5876 |
! |
5877 |
||
5878 |
doGotoDefaultDirectory |
|
5879 |
self gotoFile:(Filename defaultDirectory). |
|
5880 |
! |
|
5881 |
||
8091 | 5882 |
doGotoDesktopDirectory |
5883 |
self gotoFile:(Filename desktopDirectory). |
|
5884 |
! |
|
5885 |
||
18036 | 5886 |
doGotoDocumentsDirectory |
5887 |
self gotoFile:(Filename documentsDirectory). |
|
5888 |
! |
|
5889 |
||
5890 |
doGotoDownloadsDirectory |
|
5891 |
self gotoFile:(Filename downloadsDirectory). |
|
5892 |
! |
|
5893 |
||
5880 | 5894 |
doGotoHomeDirectory |
8091 | 5895 |
self gotoFile:(Filename homeDirectory). |
5880 | 5896 |
! |
5897 |
||
6434 | 5898 |
doGotoSmalltalkDirectory |
5899 |
self gotoFile:(self smalltalkDirectory). |
|
5900 |
! |
|
5901 |
||
17187 | 5902 |
doGotoSmalltalkWorkspaceDirectory |
5903 |
self gotoFile:(UserPreferences current workspaceDirectory). |
|
5904 |
! |
|
5905 |
||
9677 | 5906 |
doGotoTempDirectory |
5907 |
self gotoFile:(self tempDirectory). |
|
5908 |
||
5909 |
"Created: / 29-12-2010 / 11:03:17 / cg" |
|
5910 |
! |
|
5911 |
||
9596 | 5912 |
doMakeCurrentDirectory |
17582 | 5913 |
<resource: #obsolete> |
5914 |
||
5915 |
"/ no longer |
|
5916 |
^ self |
|
5917 |
"/ OperatingSystem setCurrentDirectory:(self currentDirectory pathName). |
|
5918 |
"/ self currentFileNameHolderChangedForCommon. |
|
9596 | 5919 |
|
5920 |
"Created: / 26-10-2010 / 17:21:19 / cg" |
|
17582 | 5921 |
"Modified (format): / 17-07-2017 / 10:09:39 / cg" |
9596 | 5922 |
! |
5923 |
||
5880 | 5924 |
fileGetInfo:longInfo |
5925 |
"get info on selected file - show it in a box" |
|
5926 |
||
5927 |
|string box updater| |
|
5928 |
||
5929 |
string := self getFileInfoStringForFirstSelectedFile:longInfo. |
|
5930 |
string notNil ifTrue:[ |
|
5931 |
box := InfoBox title:string. |
|
5932 |
updater := [ |
|
5933 |
[true] whileTrue:[ |
|
5934 |
Delay waitForSeconds:2. |
|
5935 |
string := self getFileInfoStringForFirstSelectedFile:longInfo. |
|
5936 |
string isNil ifTrue:[ ^ self]. |
|
5937 |
box title:string |
|
5938 |
] |
|
5939 |
] fork. |
|
5940 |
box show. |
|
5941 |
updater terminate. |
|
5942 |
box destroy |
|
5943 |
] |
|
6434 | 5944 |
! |
5945 |
||
17686 | 5946 |
showDeltaBetweenTwoImageFiles |
5947 |
|i1 i2 delta| |
|
5948 |
||
5949 |
i1 := Image fromFile:(self selectedFileNames first). |
|
5950 |
i2 := Image fromFile:(self selectedFileNames second). |
|
5951 |
delta := ImageAlgorithms new differenceImageBetween:i1 and:i2. |
|
5952 |
ImageView openOn:delta. |
|
5953 |
||
5954 |
"Created: / 10-09-2017 / 16:59:08 / cg" |
|
5955 |
! |
|
5956 |
||
6434 | 5957 |
smalltalkDirectory |
8590 | 5958 |
|stxPath| |
6434 | 5959 |
|
5960 |
stxPath := OperatingSystem pathOfSTXExecutable. |
|
8590 | 5961 |
stxPath isNil ifTrue:[ |
5962 |
^ Filename currentDirectory |
|
5963 |
]. |
|
5964 |
^ stxPath asFilename directory. |
|
9677 | 5965 |
! |
5966 |
||
5967 |
tempDirectory |
|
5968 |
^ Filename tempDirectory. |
|
5969 |
||
5970 |
"Created: / 29-12-2010 / 11:03:00 / cg" |
|
5880 | 5971 |
! ! |
5972 |
||
11139 | 5973 |
!AbstractFileBrowser methodsFor:'menu actions-file'! |
5974 |
||
14262 | 5975 |
addDirToJavaSourcePath |
5976 |
"add the current path to java's sourcePath |
|
5977 |
(only available with ST/J System" |
|
5978 |
||
5979 |
Java addToSourcePath:self currentDirectory pathName |
|
5980 |
||
5981 |
"Modified: 14.12.1996 / 15:37:47 / cg" |
|
5982 |
"Created: 2.8.1997 / 14:11:19 / cg" |
|
5983 |
! |
|
5984 |
||
11139 | 5985 |
copyFiles |
5986 |
self |
|
5987 |
withSelectedFilesOrDirectoriesDo:[:filesOrDirs | self copyFilesToClipBoard:filesOrDirs] |
|
5988 |
! |
|
5989 |
||
5990 |
cutFiles |
|
5991 |
self |
|
5992 |
withSelectedFilesOrDirectoriesDo:[:filesOrDirs | self cutFilesToClipBoard:filesOrDirs] |
|
5993 |
! |
|
5994 |
||
5995 |
deleteFiles |
|
5996 |
self |
|
5997 |
withSelectedFilesOrDirectoriesDo:[:filesOrDirs | self deleteFiles:filesOrDirs] |
|
5998 |
! |
|
5999 |
||
6000 |
eraseFiles |
|
6001 |
self |
|
6002 |
withSelectedFilesOrDirectoriesDo:[:filesOrDirs | self eraseFiles:filesOrDirs] |
|
6003 |
! |
|
6004 |
||
14262 | 6005 |
fileAddToJavaSourcePath |
6006 |
"add the current path to java's sourcePath |
|
6007 |
(only available with ST/J System" |
|
6008 |
||
17865 | 6009 |
Java notNil ifTrue:[ |
6010 |
self currentSelectedObjects do:[:each | |
|
6011 |
Java addToSourcePath:(each pathName) |
|
6012 |
]. |
|
14262 | 6013 |
]. |
6014 |
||
6015 |
"Created: / 9.11.1998 / 05:41:34 / cg" |
|
6016 |
"Modified: / 9.11.1998 / 05:56:00 / cg" |
|
6017 |
! |
|
6018 |
||
11139 | 6019 |
openSettingsDialog |
6020 |
|dialog| |
|
6021 |
||
6022 |
dialog := FileBrowserV2SettingsDialog new. |
|
6023 |
dialog settingsDialog:self. |
|
6024 |
dialog allButOpen. |
|
6025 |
dialog doReload. |
|
6026 |
dialog openWindow |
|
6027 |
! |
|
6028 |
||
6029 |
withSelectedFilesOrDirectoriesDo:aBlock |
|
6030 |
|files dirs| |
|
6031 |
||
6032 |
files := self currentSelectedFiles. |
|
6033 |
files notEmpty ifTrue:[ |
|
6034 |
aBlock value:files. |
|
6035 |
] ifFalse:[ |
|
6036 |
dirs := self currentSelectedDirectories. |
|
6037 |
dirs notEmpty ifTrue:[ |
|
6038 |
aBlock value:dirs. |
|
6039 |
]. |
|
6040 |
]. |
|
6041 |
! ! |
|
6042 |
||
6043 |
!AbstractFileBrowser methodsFor:'menu actions-help'! |
|
6044 |
||
6045 |
openAboutThisApplication |
|
6046 |
"opens an about box for this application." |
|
6047 |
||
6048 |
Dialog aboutClass:self class. |
|
6049 |
! |
|
6050 |
||
6051 |
openHTMLDocument:relativeDocPath |
|
6052 |
HTMLDocumentView openFullOnDocumentationFile:relativeDocPath |
|
6053 |
! ! |
|
6054 |
||
6055 |
!AbstractFileBrowser methodsFor:'menu actions-scm-cvs'! |
|
3892 | 6056 |
|
15905 | 6057 |
canCvsAddAndCommit |
6058 |
||
6059 |
|selectedFiles| |
|
6060 |
||
6061 |
selectedFiles := self currentSelectedObjects. |
|
6062 |
^ (selectedFiles notEmpty and:[self currentFilesAreInSameDirectory]). |
|
6063 |
! |
|
6064 |
||
6065 |
canRemoveCVSContainer |
|
6066 |
^ self currentSelectedFiles |
|
6067 |
contains:[:fileName| |
|
6068 |
|dirOfFile cvsDir| |
|
6069 |
||
6070 |
dirOfFile := self getDirWithoutFileName:fileName. |
|
6071 |
cvsDir := dirOfFile construct:'CVS'. |
|
6072 |
cvsDir isDirectory |
|
6073 |
]. |
|
6074 |
! |
|
6075 |
||
12777 | 6076 |
commitFilesToCVS:files |
6077 |
|numFiles| |
|
6078 |
||
6079 |
(numFiles := files size) > 0 ifTrue:[ |
|
6080 |
self withActivityIndicationDo:[ |
|
6081 |
self cvsCommitFiles:files |
|
6082 |
] |
|
6083 |
] |
|
6084 |
! |
|
6085 |
||
3892 | 6086 |
cvsAddAndCommit |
4849 | 6087 |
self cvsAddAndCommitAsBinary:false |
6088 |
! |
|
6089 |
||
6090 |
cvsAddAndCommitAsBinary:asBinary |
|
8588 | 6091 |
|sel log logArg binArg cmd dir executionBlock nameString| |
3892 | 6092 |
|
6093 |
log := Dialog |
|
11139 | 6094 |
requestText:(resources string:'Enter initial log message:') |
4414 | 6095 |
lines:10 |
6096 |
columns:70 |
|
6097 |
initialAnswer:nil. |
|
8322
cf10f08b6164
care for cancel in #cvsAddAndCommitAsBinary:
Claus Gittinger <cg@exept.de>
parents:
8294
diff
changeset
|
6098 |
log isNil ifTrue:[^ self]. |
3892 | 6099 |
|
6205
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
6100 |
OperatingSystem isMSWINDOWSlike ifTrue:[ |
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
6101 |
logArg := '-m "' , log , '"'. |
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
6102 |
] ifFalse:[ |
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
6103 |
logArg := '-m ''' , log , ''''. |
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
6104 |
]. |
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
6105 |
|
8588 | 6106 |
binArg := ''. |
6107 |
asBinary ifTrue:[ |
|
6108 |
binArg := '-kb '. |
|
6109 |
]. |
|
3982 | 6110 |
sel := self currentSelectedFiles. |
11139 | 6111 |
executionBlock := |
6112 |
[:stream | |
|
6113 |
log notNil ifTrue:[ |
|
17416 | 6114 |
sel notEmptyOrNil ifTrue:[ |
11139 | 6115 |
sel do:[:fn | |
6116 |
|nameArg| |
|
6117 |
||
6118 |
nameArg := '"',fn baseName,'"'. |
|
6119 |
||
6120 |
dir := self getDirWithoutFileName:fn. |
|
6121 |
cmd := 'cvs add ',logArg,' ',binArg,nameArg. |
|
6122 |
(self getExecutionBlockForCommand:cmd inDirectory:dir) value:stream. |
|
6123 |
||
6124 |
cmd := ('cvs commit -l ',logArg,' ',nameArg). |
|
6205
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
6125 |
(self getExecutionBlockForCommand:cmd inDirectory:dir) value:stream. |
11139 | 6126 |
"/ mhmh - it seems that only old CVS implementations (at least turqoise) |
6127 |
"/ support and need the 'admin -kb' command. |
|
6128 |
"/ newer ones use the '-kb' option in the 'cvs add' command |
|
6129 |
asBinary ifTrue:[ |
|
6130 |
cmd := ('cvs admin -kb ' , nameArg). |
|
6131 |
(self getExecutionBlockForCommand:cmd inDirectory:dir) value:stream. |
|
6132 |
||
6133 |
cmd := ('cvs upd ' , nameArg). |
|
6134 |
(self getExecutionBlockForCommand:cmd inDirectory:dir) value:stream. |
|
6135 |
]. |
|
6136 |
] |
|
6137 |
] |
|
6138 |
] |
|
6139 |
]. |
|
4107 | 6140 |
nameString := 'Command> cvs add and commit'. |
3892 | 6141 |
self makeExecutionResultProcessFor:executionBlock withName:nameString. |
11139 | 6142 |
|
17416 | 6143 |
"Modified: / 17-02-2017 / 08:25:16 / cg" |
3892 | 6144 |
! |
6145 |
||
4849 | 6146 |
cvsAddBinaryAndCommit |
6147 |
self cvsAddAndCommitAsBinary:true |
|
6148 |
! |
|
6149 |
||
3892 | 6150 |
cvsCommit |
12777 | 6151 |
|selectedFiles| |
3892 | 6152 |
|
3982 | 6153 |
selectedFiles:= self currentSelectedFiles. |
12777 | 6154 |
self cvsCommitFiles:selectedFiles |
6155 |
! |
|
6156 |
||
6157 |
cvsCommitFiles:files |
|
6158 |
|nFiles log logTmp s logArg msg executionBlock nameString | |
|
6159 |
||
6160 |
nFiles := files size. |
|
6161 |
nFiles == 0 ifTrue:[^ self]. |
|
6162 |
||
6163 |
nFiles == 1 ifTrue:[ |
|
6164 |
msg := resources string:'Enter log message for checkIn of "%1"' with:(files first baseName) |
|
3892 | 6165 |
] ifFalse:[ |
12777 | 6166 |
nFiles > 1 ifTrue:[ |
6167 |
msg := resources string:'Enter log message for %1 files to checkIn' with:nFiles printString |
|
4414 | 6168 |
] ifFalse:[ |
6627 | 6169 |
msg := resources string:'Enter log message for checkIn' |
4414 | 6170 |
] |
3892 | 6171 |
]. |
6172 |
||
6173 |
log := Dialog |
|
4414 | 6174 |
requestText:msg |
6175 |
lines:10 |
|
6176 |
columns:70 |
|
6177 |
initialAnswer:nil. |
|
3892 | 6178 |
|
4663 | 6179 |
log isNil ifTrue:[^ self]. |
12777 | 6180 |
log := log replChar:$" withString:'\"'. |
6205
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
6181 |
|
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
6182 |
OperatingSystem isMSWINDOWSlike ifTrue:[ |
12777 | 6183 |
"/ save the log message into another tempFile ... |
13121 | 6184 |
s := FileStream newTemporary. |
6185 |
logTmp := s fileName. |
|
12777 | 6186 |
s nextPutAll:log. |
6187 |
s close. |
|
6188 |
||
6189 |
logArg := '-F "', logTmp pathName, '"'. |
|
6205
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
6190 |
] ifFalse:[ |
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
6191 |
logArg := '-m ''' , log , ''''. |
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
6192 |
]. |
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
6193 |
|
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
6194 |
executionBlock := [:stream | |
12777 | 6195 |
[ |
6196 |
files do:[:fn | |
|
6197 |
| dir nameArg cmd | |
|
6198 |
||
6199 |
nameArg := '"',fn baseName,'"'. |
|
6200 |
dir := fn directory. |
|
6201 |
cmd := 'cvs commit ',logArg,' ' , nameArg. |
|
6202 |
stream showCR:fn pathName. |
|
6203 |
(self getExecutionBlockForCommand:cmd inDirectory:dir) value:stream. |
|
4663 | 6204 |
] |
12777 | 6205 |
] ensure:[ |
6206 |
logTmp notNil ifTrue:[ logTmp remove ]. |
|
6207 |
]. |
|
4107 | 6208 |
]. |
6209 |
nameString := 'Command> cvs commit'. |
|
6210 |
self makeExecutionResultProcessFor:executionBlock withName:nameString. |
|
3892 | 6211 |
! |
6212 |
||
14527 | 6213 |
cvsCommitFolder |
6214 |
|dir log logTmp s logArg msg executionBlock nameString | |
|
6215 |
||
6216 |
(dir := self currentDirectory) isNil ifTrue:[ ^ self ]. |
|
6217 |
||
6218 |
msg := resources string:'Enter log message for checkIn of "%1"' with:(dir baseName). |
|
6219 |
log := Dialog |
|
6220 |
requestText:msg |
|
6221 |
lines:10 |
|
6222 |
columns:70 |
|
6223 |
initialAnswer:nil. |
|
6224 |
||
6225 |
log isNil ifTrue:[^ self]. |
|
6226 |
log := log replChar:$" withString:'\"'. |
|
6227 |
||
6228 |
OperatingSystem isMSWINDOWSlike ifTrue:[ |
|
6229 |
"/ save the log message into another tempFile ... |
|
6230 |
s := FileStream newTemporary. |
|
6231 |
logTmp := s fileName. |
|
6232 |
s nextPutAll:log. |
|
6233 |
s close. |
|
6234 |
||
6235 |
logArg := '-F "', logTmp pathName, '"'. |
|
6236 |
] ifFalse:[ |
|
6237 |
logArg := '-m ''' , log , ''''. |
|
6238 |
]. |
|
6239 |
||
6240 |
executionBlock := [:stream | |
|
6241 |
[ |
|
6242 |
|cmd| |
|
6243 |
||
6244 |
cmd := 'cvs commit ',logArg. |
|
6245 |
(self getExecutionBlockForCommand:cmd inDirectory:dir) value:stream. |
|
6246 |
] ensure:[ |
|
6247 |
logTmp notNil ifTrue:[ logTmp remove ]. |
|
6248 |
]. |
|
6249 |
]. |
|
6250 |
||
6251 |
nameString := 'Command> cvs commit'. |
|
6252 |
self makeExecutionResultProcessFor:executionBlock withName:nameString. |
|
6253 |
! |
|
6254 |
||
9407
cf114ba82b6d
added: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
9405
diff
changeset
|
6255 |
cvsCompareWithNewest |
cf114ba82b6d
added: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
9405
diff
changeset
|
6256 |
|selectedFiles| |
cf114ba82b6d
added: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
9405
diff
changeset
|
6257 |
|
cf114ba82b6d
added: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
9405
diff
changeset
|
6258 |
selectedFiles:= self currentSelectedFiles. |
cf114ba82b6d
added: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
9405
diff
changeset
|
6259 |
selectedFiles do:[:each | |
11176
eb02b211e777
changed: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
11162
diff
changeset
|
6260 |
|out diffs| |
eb02b211e777
changed: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
11162
diff
changeset
|
6261 |
|
15589 | 6262 |
out := CharacterWriteStream new:100. |
11176
eb02b211e777
changed: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
11162
diff
changeset
|
6263 |
OperatingSystem |
eb02b211e777
changed: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
11162
diff
changeset
|
6264 |
executeCommand:'cvs diff -b ',each baseName |
eb02b211e777
changed: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
11162
diff
changeset
|
6265 |
outputTo:out |
eb02b211e777
changed: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
11162
diff
changeset
|
6266 |
inDirectory:each directoryName. |
eb02b211e777
changed: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
11162
diff
changeset
|
6267 |
diffs := out contents. |
eb02b211e777
changed: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
11162
diff
changeset
|
6268 |
TextView openWith:diffs. |
eb02b211e777
changed: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
11162
diff
changeset
|
6269 |
]. |
eb02b211e777
changed: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
11162
diff
changeset
|
6270 |
|
eb02b211e777
changed: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
11162
diff
changeset
|
6271 |
"Modified: / 23-01-2012 / 14:08:28 / cg" |
9407
cf114ba82b6d
added: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
9405
diff
changeset
|
6272 |
! |
cf114ba82b6d
added: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
9405
diff
changeset
|
6273 |
|
15211 | 6274 |
cvsRemoveAndRemoveFromCVS:filesToRemove |
6275 |
"remove the selected file(s) and their CVS containers - no questions asked" |
|
6276 |
||
6277 |
|toRemove updateRunning executionBlock nameString| |
|
6278 |
||
6279 |
updateRunning := self backgroundProcesses value notEmpty. |
|
6280 |
self killAllRunningBackgroundProcesses. |
|
6281 |
toRemove := OrderedCollection new. |
|
6282 |
||
6283 |
executionBlock := |
|
6284 |
[:stream | |
|
6285 |
|cmd logArg prevDir prevFiles| |
|
6286 |
||
6287 |
OperatingSystem isMSWINDOWSlike ifTrue:[ |
|
6288 |
logArg := '-m "' , 'removed via FileBrowser' , '"'. |
|
6289 |
] ifFalse:[ |
|
6290 |
logArg := '-m ''' , 'removed via FileBrowser' , ''''. |
|
6291 |
]. |
|
6292 |
prevFiles := ''. |
|
6293 |
||
6294 |
filesToRemove do:[:fileName | |
|
6295 |
|dir file| |
|
6296 |
||
6297 |
dir := fileName directory. |
|
6298 |
(prevDir notNil and:[prevDir ~= dir]) ifTrue:[ |
|
6299 |
cmd := 'cvs commit -l ',logArg, ' ',prevFiles. |
|
6300 |
"/ Transcript show:prevDir; space; showCR:cmd. |
|
6301 |
(self getExecutionBlockForCommand:cmd inDirectory:prevDir) value:stream. |
|
6302 |
prevFiles := ''. |
|
6303 |
]. |
|
6304 |
||
17116 | 6305 |
OsError handle:[:ex| |
15211 | 6306 |
"was not able to remove it" |
6307 |
| lastError msg | |
|
6308 |
lastError := OperatingSystem lastErrorString. |
|
6309 |
msg := (resources string:'cannot remove ''%1'' !!' with:fileName). |
|
6310 |
lastError isNil ifFalse:[ |
|
6311 |
msg := msg , '\\(' , lastError , ')' |
|
6312 |
]. |
|
6313 |
Dialog warn:msg withCRs |
|
6314 |
] do:[ |
|
6315 |
(fileName isSymbolicLink) ifFalse:[ |
|
6316 |
fileName remove. |
|
6317 |
file := fileName baseName. |
|
6318 |
cmd := ('cvs remove -f "',file,'"'). |
|
6319 |
(self getExecutionBlockForCommand:cmd inDirectory:dir) value:stream. |
|
6320 |
"/ Transcript show:dir; space; showCR:cmd. |
|
6321 |
] |
|
6322 |
]. |
|
6323 |
prevDir := dir. |
|
6324 |
prevFiles := prevFiles,' ',file. |
|
6325 |
]. |
|
6326 |
cmd := 'cvs commit -l ',logArg, ' ',prevFiles. |
|
6327 |
"/ Transcript show:prevDir; space; showCR:cmd. |
|
6328 |
(self getExecutionBlockForCommand:cmd inDirectory:prevDir) value:stream. |
|
6329 |
]. |
|
6330 |
nameString := 'Command> cvs remove and commit ', filesToRemove first baseName. |
|
6331 |
filesToRemove size > 1 ifTrue:[ |
|
6332 |
nameString := nameString, ' ...'. |
|
6333 |
]. |
|
6334 |
self makeExecutionResultProcessFor:executionBlock withName:nameString. |
|
6335 |
! |
|
3892 | 6336 |
|
6337 |
cvsRemoveFileAndCVSContainer |
|
12493 | 6338 |
|files| |
6339 |
||
6340 |
files := self currentSelectedFiles copy. |
|
6341 |
self removeFilesAndCVSContainers:files |
|
3892 | 6342 |
! |
6343 |
||
9338 | 6344 |
cvsRevisionLog |
6345 |
| cmd sel executionBlock nameString| |
|
6346 |
||
6347 |
sel := self currentSelectedObjects. |
|
6348 |
sel isEmpty ifTrue:[ ^ self ]. |
|
6349 |
||
6350 |
executionBlock := [:stream | |
|
6351 |
sel do:[:fn | |
|
6352 |
| dir nameArg | |
|
6353 |
||
6354 |
nameArg := '"',fn baseName,'"'. |
|
6355 |
dir := fn directory. |
|
6356 |
cmd := 'cvs log ' , nameArg. |
|
6357 |
(self getExecutionBlockForCommand:cmd inDirectory:dir) value:stream. |
|
6358 |
] |
|
6359 |
]. |
|
6360 |
nameString := 'Command> cvs log'. |
|
6361 |
self makeExecutionResultProcessFor:executionBlock withName:nameString. |
|
6362 |
! |
|
6363 |
||
8562 | 6364 |
cvsTagSelection |
12856 | 6365 |
|tag tags cmd| |
6366 |
||
6367 |
tag := Dialog |
|
6368 |
request:(resources string:'Tag (possibly multiple, separated by ";"):') |
|
6369 |
initialAnswer:(CVSSourceCodeManager recentTag). |
|
6370 |
tag isEmptyOrNil ifTrue:[^ self ]. |
|
6371 |
||
6372 |
CVSSourceCodeManager recentTag:tag. |
|
8562 | 6373 |
|
6374 |
CVSSourceCodeManager notNil ifTrue:[ |
|
6375 |
cmd := CVSSourceCodeManager cvsExecutable. |
|
6376 |
] ifFalse:[ |
|
6377 |
cmd := 'cvs'. |
|
6378 |
]. |
|
6379 |
||
12856 | 6380 |
tags := tag asCollectionOfSubstringsSeparatedByAny:',;'. |
6381 |
tags do:[:eachTag | |
|
6382 |
self executeCommand:('%1 tag -F "%2" %3' |
|
6383 |
bindWith:cmd |
|
12858 | 6384 |
with:(eachTag withoutSeparators) |
12856 | 6385 |
with:(self makeFileNameArgumentString)) |
6386 |
]. |
|
8562 | 6387 |
! |
6388 |
||
3892 | 6389 |
cvsUpdateAll |
6390 |
| cmd | |
|
6391 |
||
8042
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
6392 |
CVSSourceCodeManager notNil ifTrue:[ |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
6393 |
cmd := CVSSourceCodeManager cvsExecutable. |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
6394 |
] ifFalse:[ |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
6395 |
cmd := 'cvs'. |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
6396 |
]. |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
6397 |
|
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
6398 |
self executeCommand:(cmd, ' upd -l'). |
3892 | 6399 |
! |
6400 |
||
6401 |
cvsUpdateAllRecursive |
|
6402 |
| cmd | |
|
6403 |
||
8042
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
6404 |
CVSSourceCodeManager notNil ifTrue:[ |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
6405 |
cmd := CVSSourceCodeManager cvsExecutable. |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
6406 |
] ifFalse:[ |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
6407 |
cmd := 'cvs'. |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
6408 |
]. |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
6409 |
self executeCommand:(cmd, ' upd -d'). |
3892 | 6410 |
! |
6411 |
||
6412 |
cvsUpdateSelection |
|
8042
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
6413 |
|stream cmd| |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
6414 |
|
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
6415 |
CVSSourceCodeManager notNil ifTrue:[ |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
6416 |
cmd := CVSSourceCodeManager cvsExecutable. |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
6417 |
] ifFalse:[ |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
6418 |
cmd := 'cvs'. |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
6419 |
]. |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
6420 |
|
15589 | 6421 |
stream := CharacterWriteStream new. |
8563 | 6422 |
stream |
6423 |
nextPutAll:cmd; |
|
6424 |
nextPutAll:' upd '; |
|
6425 |
nextPutAll:(self makeFileNameArgumentString). |
|
6426 |
||
6427 |
self executeCommand:stream contents. |
|
6428 |
! |
|
6429 |
||
6430 |
makeFileNameArgumentString |
|
6431 |
|stream| |
|
6432 |
||
15589 | 6433 |
stream := CharacterWriteStream new. |
8042
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
6434 |
self currentSelectedFiles do:[: file | |
8563 | 6435 |
stream nextPut:$". |
4414 | 6436 |
stream nextPutAll:file baseName. |
8563 | 6437 |
stream nextPutAll:'" '. |
6438 |
]. |
|
6439 |
^ stream contents. |
|
12493 | 6440 |
! |
6441 |
||
6442 |
removeFilesAndCVSContainers:files |
|
6443 |
|numFiles question aswer| |
|
6444 |
||
6445 |
(numFiles := files size) > 0 ifTrue:[ |
|
6446 |
numFiles > 1 ifTrue:[ |
|
6447 |
question := resources string:'Remove %1 selected files and their CVS containers ?' with:numFiles |
|
6448 |
] ifFalse:[ |
|
6449 |
question := resources string:'Remove ''%1'' and its CVS container ?' with:(files first baseName allBold) |
|
6450 |
]. |
|
6451 |
||
6452 |
aswer := Dialog |
|
6453 |
confirm:question withCRs |
|
6454 |
yesLabel:(resources string:'Remove') |
|
6455 |
noLabel:(resources string:'Cancel'). |
|
6456 |
||
6457 |
aswer ifTrue:[ |
|
6458 |
self withActivityIndicationDo:[ |
|
6459 |
self cvsRemoveAndRemoveFromCVS:files |
|
6460 |
] |
|
6461 |
] |
|
6462 |
] |
|
3892 | 6463 |
! ! |
6464 |
||
14126 | 6465 |
|
11139 | 6466 |
!AbstractFileBrowser methodsFor:'menu actions-scm-mercurial'! |
6467 |
||
6468 |
mercurialAdd |
|
6469 |
|executionBlock sel maxCmdSize| |
|
6470 |
||
6471 |
maxCmdSize := 512. |
|
6472 |
||
6473 |
sel := self currentSelectedObjects. |
|
6474 |
sel isEmptyOrNil ifTrue:[ |
|
6475 |
^ self |
|
6476 |
]. |
|
6477 |
||
6478 |
executionBlock := |
|
6479 |
[:stream | |
|
6480 |
|prevDir cmd| |
|
6481 |
||
6482 |
prevDir := nil. |
|
6483 |
sel do:[:fn | |
|
6484 |
|nameArg dir| |
|
6485 |
||
6486 |
nameArg := '"',fn baseName,'"'. |
|
6487 |
dir := fn directory. |
|
6488 |
(dir ~= prevDir or:[ (cmd size + nameArg size) > maxCmdSize]) ifTrue:[ |
|
6489 |
"/ flush |
|
6490 |
cmd notNil ifTrue:[ |
|
6491 |
(self getExecutionBlockForCommand:cmd inDirectory:prevDir) value:stream. |
|
6492 |
cmd := nil. |
|
6493 |
] |
|
6494 |
]. |
|
6495 |
cmd isNil ifTrue:[ |
|
6496 |
cmd := 'hg add'. |
|
6497 |
]. |
|
6498 |
cmd := cmd,' ',nameArg. |
|
6499 |
prevDir := dir. |
|
6500 |
]. |
|
6501 |
cmd notNil ifTrue:[ |
|
6502 |
(self getExecutionBlockForCommand:cmd inDirectory:prevDir) value:stream. |
|
6503 |
cmd := nil. |
|
6504 |
]. |
|
6505 |
stream nextPutLine:'Commit to finish the transaction'. |
|
6506 |
]. |
|
6507 |
||
6508 |
self makeExecutionResultProcessFor:executionBlock withName:'Command> hg add'. |
|
6509 |
||
6510 |
"Created: / 15-01-2012 / 15:55:47 / cg" |
|
6511 |
! |
|
6512 |
||
6513 |
mercurialCommit |
|
6514 |
|dir executionBlock| |
|
6515 |
||
6516 |
"/ dir := self currentDirectory. |
|
6517 |
dir := self directoryContentsBrowser directory. |
|
6518 |
executionBlock := |
|
6519 |
[:stream | |
|
6520 |
(self getExecutionBlockForCommand:'hg commit' |
|
6521 |
inDirectory:dir) value:stream. |
|
6522 |
stream nextPutLine:'Push to sync other repositories'. |
|
6169 | 6523 |
]. |
11139 | 6524 |
|
6525 |
self makeExecutionResultProcessFor:executionBlock withName:'Command> hg commit'. |
|
6526 |
||
6527 |
"Created: / 15-01-2012 / 16:21:27 / cg" |
|
6528 |
! |
|
6529 |
||
11144 | 6530 |
mercurialInit |
6531 |
|dir executionBlock| |
|
6532 |
||
6533 |
dir := self directoryContentsBrowser directory. |
|
6534 |
||
6535 |
(Dialog confirm:(resources |
|
6536 |
string:'Initialize new Mercurial Repository in %1?' |
|
6537 |
with:dir baseName)) ifFalse:[^ self]. |
|
6538 |
||
6539 |
executionBlock := |
|
6540 |
[:stream | |
|
6541 |
(self getExecutionBlockForCommand:('hg init') |
|
6542 |
inDirectory:dir) value:stream. |
|
6543 |
]. |
|
6544 |
||
6545 |
self makeExecutionResultProcessFor:executionBlock withName:'Command> hg init'. |
|
6546 |
||
6547 |
"Created: / 17-01-2012 / 15:58:46 / cg" |
|
6548 |
! |
|
6549 |
||
11139 | 6550 |
mercurialPush |
6551 |
|destination dir executionBlock| |
|
6552 |
||
6553 |
destination := Dialog request:'Mercurial Repository' |
|
6554 |
initialAnswer:(LastMercurialRepository ? MercurialSourceCodeManager repositoryName). |
|
6555 |
destination isEmptyOrNil ifTrue:[^ self]. |
|
6556 |
||
6557 |
LastMercurialRepository := destination. |
|
6558 |
||
6559 |
dir := self directoryContentsBrowser directory. |
|
6560 |
executionBlock := |
|
6561 |
[:stream | |
|
6562 |
(self getExecutionBlockForCommand:('hg push "%1"' bindWith:destination) |
|
6563 |
inDirectory:dir) value:stream. |
|
6564 |
]. |
|
6565 |
||
6566 |
self makeExecutionResultProcessFor:executionBlock withName:'Command> hg push'. |
|
6567 |
||
6568 |
"Created: / 15-01-2012 / 16:29:41 / cg" |
|
6569 |
! |
|
6570 |
||
6571 |
mercurialStatus |
|
6572 |
|executionBlock sel maxCmdSize| |
|
6573 |
||
6574 |
maxCmdSize := 512. |
|
6575 |
||
6576 |
sel := self currentSelectedObjects. |
|
6577 |
sel isEmptyOrNil ifTrue:[ |
|
6578 |
^ self |
|
6579 |
]. |
|
6580 |
||
6581 |
executionBlock := |
|
6582 |
[:stream | |
|
6583 |
|prevDir cmd| |
|
6584 |
||
6585 |
prevDir := nil. |
|
6586 |
sel do:[:fn | |
|
6587 |
|nameArg dir| |
|
6588 |
||
6589 |
nameArg := '"',fn baseName,'"'. |
|
6590 |
dir := fn directory. |
|
6591 |
(dir ~= prevDir or:[ (cmd size + nameArg size) > maxCmdSize]) ifTrue:[ |
|
6592 |
"/ flush |
|
6593 |
cmd notNil ifTrue:[ |
|
6594 |
(self getExecutionBlockForCommand:cmd inDirectory:prevDir) value:stream. |
|
6595 |
cmd := nil. |
|
6596 |
] |
|
6597 |
]. |
|
6598 |
cmd isNil ifTrue:[ |
|
6599 |
cmd := 'hg status'. |
|
6600 |
]. |
|
6601 |
cmd := cmd,' ',nameArg. |
|
6602 |
prevDir := dir. |
|
6603 |
]. |
|
6604 |
cmd notNil ifTrue:[ |
|
6605 |
(self getExecutionBlockForCommand:cmd inDirectory:prevDir) value:stream. |
|
6606 |
cmd := nil. |
|
6607 |
]. |
|
6608 |
]. |
|
6609 |
||
6610 |
self makeExecutionResultProcessFor:executionBlock withName:'Command> hg status'. |
|
6611 |
||
6612 |
"Created: / 15-01-2012 / 19:43:08 / cg" |
|
3892 | 6613 |
! ! |
6614 |
||
4849 | 6615 |
!AbstractFileBrowser methodsFor:'menu actions-tools'! |
3892 | 6616 |
|
8510 | 6617 |
allFilesInSelectedDirectoriesForWhich:aBlock |
17868 | 6618 |
^ self class allFilesInDirectories:(self currentSelectedDirectories) forWhich:aBlock |
8510 | 6619 |
! |
6620 |
||
4721
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6621 |
conversionChainFrom:inSuffix to:outSuffix |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6622 |
|conv| |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6623 |
|
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6624 |
inSuffix = outSuffix ifTrue:[ |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6625 |
^ nil |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6626 |
]. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6627 |
|
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6628 |
"/ 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
|
6629 |
"/ 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
|
6630 |
|
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6631 |
conv := OrderedCollection new. |
4722 | 6632 |
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
|
6633 |
|
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6634 |
outSuffix = 'png' ifTrue:[ |
4722 | 6635 |
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
|
6636 |
^ conv. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6637 |
]. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6638 |
outSuffix = 'gif' ifTrue:[ |
4722 | 6639 |
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
|
6640 |
^ conv. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6641 |
]. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6642 |
outSuffix = 'xpm' ifTrue:[ |
4722 | 6643 |
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
|
6644 |
^ conv. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6645 |
]. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6646 |
outSuffix = 'jpg' ifTrue:[ |
4722 | 6647 |
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
|
6648 |
^ conv. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6649 |
]. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6650 |
self error:'unimplemented conversion'. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6651 |
! |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6652 |
|
9493
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6653 |
convertImageFrom:fileName to:outFile onError:exceptionBlock |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6654 |
|writer image outSuffix| |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6655 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6656 |
outSuffix := outFile suffix. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6657 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6658 |
((writer := MIMETypes imageReaderForSuffix:outSuffix) notNil |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6659 |
and:[ (image := Image fromFile:fileName) notNil |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6660 |
and:[ writer canRepresent:image ]]) ifTrue:[ |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6661 |
"/ can do it with Smalltalk tools |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6662 |
writer save:image onFile:outFile. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6663 |
] ifFalse:[ |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6664 |
"/ use external tools (pbm-package, if available) |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6665 |
self |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6666 |
convertImageUsingExternalFileToolsFrom:fileName |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6667 |
toSuffix:outSuffix |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6668 |
onError:exceptionBlock. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6669 |
]. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6670 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6671 |
"Created: / 20-05-2010 / 11:12:36 / cg" |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6672 |
! |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6673 |
|
4367 | 6674 |
convertImageToGIF |
4721
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6675 |
self convertImageToSuffix:'gif' |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6676 |
! |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6677 |
|
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6678 |
convertImageToJPG |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6679 |
self convertImageToSuffix:'jpg' |
4531 | 6680 |
! |
6681 |
||
6682 |
convertImageToPNG |
|
4721
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6683 |
self convertImageToSuffix:'png' |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6684 |
! |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6685 |
|
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6686 |
convertImageToSuffix:outSuffix |
9493
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6687 |
|outFile filesToConvert| |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6688 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6689 |
self withActivityIndicationDo:[ |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6690 |
filesToConvert := self currentSelectedObjects copy. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6691 |
filesToConvert do:[:fileName | |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6692 |
self notify:(resources string:'Converting: %1...' with:fileName baseName). |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6693 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6694 |
fileName isDirectory ifFalse:[ |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6695 |
|skip| |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6696 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6697 |
skip := false. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6698 |
outFile := fileName withSuffix:outSuffix. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6699 |
outFile exists ifTrue:[ |
4722 | 6700 |
|answer| |
6701 |
||
9493
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6702 |
answer := Dialog |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6703 |
confirmWithCancel:(resources string:'Overwrite existing %1 ?' with:outFile baseName allBold) |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6704 |
default:false. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6705 |
answer isNil ifTrue:[AbortSignal raise]. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6706 |
answer ifFalse:[ skip := true ]. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6707 |
]. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6708 |
skip ifFalse:[ |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6709 |
self |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6710 |
convertImageFrom:fileName |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6711 |
to:outFile |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6712 |
onError:[:errMsg | |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6713 |
filesToConvert size == 1 ifTrue:[ |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6714 |
Dialog warn:errMsg |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6715 |
] ifFalse:[ |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6716 |
(Dialog confirm:errMsg yesLabel:(resources string:'OK') noLabel:(resources string:'Cancel')) ifFalse:[ |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6717 |
^ self |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6718 |
] |
4721
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6719 |
]. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6720 |
]. |
9493
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6721 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6722 |
self updateAndSelect:nil. |
4367 | 6723 |
] |
9493
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6724 |
] |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6725 |
]. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6726 |
self notify:nil. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6727 |
] |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6728 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6729 |
"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
|
6730 |
! |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6731 |
|
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6732 |
convertImageToXPM |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6733 |
self convertImageToSuffix:'xpm' |
4367 | 6734 |
! |
6735 |
||
9493
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6736 |
convertImageUsingExternalFileToolsFrom:fileName toSuffix:outSuffix onError:exceptionBlock |
13121 | 6737 |
|inFile outFile chainOfConversions conversionStream |
9493
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6738 |
eachConversionSuffixCommandPair eachConversionCommand eachConversionSuffix| |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6739 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6740 |
chainOfConversions := self conversionChainFrom:(fileName suffix) to:outSuffix. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6741 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6742 |
chainOfConversions isNil ifTrue:[ |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6743 |
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
|
6744 |
^ false |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6745 |
]. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6746 |
conversionStream := chainOfConversions readStream. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6747 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6748 |
inFile := fileName. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6749 |
eachConversionSuffixCommandPair := conversionStream next. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6750 |
eachConversionCommand := eachConversionSuffixCommandPair key. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6751 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6752 |
eachConversionCommand == #readToXPM ifTrue:[ |
13121 | 6753 |
|image tempStreamXPM| |
9493
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6754 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6755 |
image := Image fromFile:(inFile pathName). |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6756 |
image isNil ifTrue:[ |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6757 |
self warn:'Unknown format/not an image: ' , inFile baseName. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6758 |
^ false. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6759 |
]. |
13121 | 6760 |
tempStreamXPM := FileStream newTemporaryWithSuffix:'xpm'. |
6761 |
XPMReader save:image onStream:tempStreamXPM. |
|
6762 |
tempStreamXPM close. |
|
6763 |
inFile := tempStreamXPM fileName. |
|
9493
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6764 |
eachConversionSuffixCommandPair := conversionStream next. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6765 |
]. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6766 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6767 |
[ |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6768 |
|command errOutput errMsg| |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6769 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6770 |
[eachConversionSuffixCommandPair notNil] whileTrue:[ |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6771 |
eachConversionCommand := eachConversionSuffixCommandPair key. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6772 |
eachConversionSuffix := eachConversionSuffixCommandPair value. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6773 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6774 |
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
|
6775 |
|
13121 | 6776 |
outFile := (FileStream newTemporaryWithSuffix:eachConversionSuffix) close pathName. |
9493
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6777 |
command := eachConversionCommand |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6778 |
bindWith:(inFile pathName) |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6779 |
with:(outFile pathName). |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6780 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6781 |
errOutput := String writeStream. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6782 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6783 |
(OperatingSystem executeCommand:command errorTo:errOutput) ifFalse:[ |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6784 |
errMsg := resources |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6785 |
stringWithCRs:'Conversion of %1 to %2 using %3 failed:\\%4.' |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6786 |
with:inFile baseName allBold |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6787 |
with:eachConversionSuffix |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6788 |
with:eachConversionCommand allBold |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6789 |
with:errOutput contents. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6790 |
exceptionBlock value:errMsg. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6791 |
|
18024 | 6792 |
(inFile ~= fileName) ifTrue:[inFile remove]. |
6793 |
outFile remove. |
|
9493
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6794 |
^ false |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6795 |
]. |
18024 | 6796 |
(inFile ~= fileName) ifTrue:[inFile remove]. |
9493
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6797 |
inFile := outFile. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6798 |
eachConversionSuffixCommandPair := conversionStream next |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6799 |
]. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6800 |
outFile moveTo:(fileName withSuffix:(chainOfConversions last value)). |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6801 |
] ifCurtailed:[ |
18024 | 6802 |
(inFile ~= fileName) ifTrue:[inFile remove]. |
6803 |
outFile remove. |
|
9493
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6804 |
]. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6805 |
^ true. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6806 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6807 |
"Created: / 20-05-2010 / 11:05:50 / cg" |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6808 |
! |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6809 |
|
3892 | 6810 |
createProjectAndOpenProjectBrowser |
6811 |
|nm f s directory| |
|
6812 |
||
6813 |
self currentFilesAreInSameDirectory ifFalse:[^ self]. |
|
5960 | 6814 |
directory := self currentDirectory. |
3892 | 6815 |
nm := directory baseName. |
6816 |
f := (directory construct:nm) withSuffix:'prj'. |
|
6817 |
f exists ifTrue:[ |
|
4414 | 6818 |
Dialog warn:'A file named ' , f baseName , ' already exists.'. |
6819 |
^ self. |
|
3892 | 6820 |
]. |
6821 |
s := f writeStream. |
|
6822 |
s nextPutAll:' |
|
6823 |
name ''' , nm , ''' |
|
6824 |
type #classLibrary |
|
6825 |
package #''private:' , nm , ''' |
|
6826 |
prerequisites nil |
|
6827 |
||
6828 |
classes #( ) |
|
6829 |
'. |
|
6830 |
s close. |
|
6831 |
ProjectBrowser openOnFile:f. |
|
6832 |
! |
|
6833 |
||
5880 | 6834 |
doExecuteCommand |
6835 |
"execute an OperatingSystem-command" |
|
6836 |
||
6837 |
| action fileName| |
|
6838 |
||
6839 |
fileName := self firstSelectedFile. |
|
6840 |
action := [:command | |
|
6841 |
self addToCommandHistory:command for:fileName. |
|
6842 |
self executeCommand:command. |
|
6843 |
]. |
|
6844 |
self askForCommandFor:fileName thenDo:action |
|
6845 |
! |
|
6846 |
||
6847 |
doExecuteScript |
|
16941 | 6848 |
"execute a Smalltalk script" |
5880 | 6849 |
|
6850 |
|textHolder dialog template dummyClass dummyInstance| |
|
6851 |
||
6852 |
template := |
|
6853 |
'"/ Smalltalk script: |
|
6854 |
||
16084 | 6855 |
"/ the following variables are accessible: |
5880 | 6856 |
"/ directory (= ' , (self theSingleSelectedDirectoryOrNil ? Filename homeDirectory) pathName , ') |
6857 |
"/ selectedFiles (= ...) |
|
6858 |
"/ |
|
6859 |
"/ Beginner warning: Smalltalk know-how is useful here ;-). |
|
6860 |
"/ |
|
6861 |
"/ Useful operations are: |
|
6862 |
"/ directory directoryContentsDo:[:eachBaseNameString | ...] |
|
6863 |
"/ directory directoryContentsAsFilenamesDo:[:eachFilename | ...] |
|
6864 |
"/ directory directory |
|
6865 |
"/ |
|
6866 |
"/ example: move all files which match a aarticular pattern to |
|
6867 |
"/ a separate directory: |
|
6868 |
"/ |
|
6869 |
"/ |directory idx prefix rest newDir oldFile newFile| |
|
6870 |
"/ |
|
6871 |
"/ directory := ''/mnt/var/priv/image/tv/frank/frank2/2131_008.jpg'' asFilename. |
|
6872 |
"/ |
|
6873 |
"/ directory directoryContentsDo:[:eachBaseNameString | |
|
6874 |
"/ (eachBaseNameString includes:$_) ifTrue:[ |
|
6875 |
"/ idx := eachBaseNameString indexOf:$_. |
|
6876 |
"/ prefix := eachBaseNameString copyTo:(idx - 1). |
|
6877 |
"/ rest := eachBaseNameString copyFrom:(idx + 1). |
|
6878 |
"/ newDir := directory construct:prefix. |
|
6879 |
"/ newDir exists ifFalse:[ |
|
6880 |
"/ (Dialog confirm:''Create '' , newDir pathName) ifTrue:[ |
|
6881 |
"/ newDir makeDirectory. |
|
6882 |
"/ ]. |
|
6883 |
"/ ]. |
|
6884 |
"/ newDir exists ifTrue:[ |
|
6885 |
"/ oldFile := directory construct:eachBaseNameString. |
|
6886 |
"/ newFile := newDir construct:rest. |
|
6887 |
"/ oldFile moveTo:newFile |
|
6888 |
"/ ] |
|
6889 |
"/ ] |
|
6890 |
"/ ] |
|
6891 |
'. |
|
6892 |
||
6893 |
LastScriptBlockString isNil ifTrue:[ |
|
6894 |
LastScriptBlockString := template. |
|
6895 |
]. |
|
6896 |
||
6897 |
textHolder := ValueHolder new. |
|
6898 |
dialog := Dialog |
|
6899 |
forRequestText:(resources string:'Enter script') |
|
6900 |
editViewClass:CodeView |
|
6901 |
lines:25 |
|
6902 |
columns:70 |
|
6903 |
initialAnswer:LastScriptBlockString |
|
6904 |
model:textHolder. |
|
6905 |
dialog addButton:(Button label:'Template' action:[textHolder value:template. textHolder changed:#value.]). |
|
6906 |
dialog open. |
|
6907 |
dialog accepted ifFalse:[^ self]. |
|
6908 |
||
6909 |
LastScriptBlockString := textHolder value. |
|
6910 |
||
6911 |
Class classConventionViolationConfirmationQuerySignal |
|
6912 |
answer:true |
|
6913 |
do:[ |
|
6914 |
dummyClass := Object class |
|
6915 |
name:#Dummy |
|
6916 |
inEnvironment:nil |
|
6917 |
subclassOf:Object |
|
6918 |
instanceVariableNames:'directory selectedFiles' |
|
6919 |
variable:false |
|
6920 |
words:true |
|
6921 |
pointers:true |
|
6922 |
classVariableNames:'' |
|
6923 |
poolDictionaries:'' |
|
6924 |
category:#dummyCategory |
|
6925 |
comment:nil |
|
6926 |
changed:true. |
|
6927 |
]. |
|
6928 |
||
6929 |
dummyInstance := dummyClass basicNew. |
|
6930 |
dummyInstance instVarAt:1 put:(self theSingleSelectedDirectoryOrNil ? Filename homeDirectory). |
|
6931 |
dummyInstance instVarAt:2 put:(self currentSelectedFiles value). |
|
6932 |
||
6933 |
Compiler |
|
6934 |
evaluate:textHolder value |
|
6935 |
in:nil |
|
6936 |
receiver:dummyInstance |
|
6937 |
notifying:nil |
|
6938 |
logged:false |
|
6939 |
ifFail:[] |
|
6940 |
compile:true. |
|
6941 |
||
6942 |
"/ fileName := self firstSelectedFile. |
|
6943 |
"/ action := [:command | |
|
6944 |
"/ self addToCommandHistory:command for:fileName. |
|
6945 |
"/ self executeCommand:command. |
|
6946 |
"/ ]. |
|
6947 |
"/ self askForCommandFor:fileName thenDo:action |
|
6948 |
! |
|
6949 |
||
4230 | 6950 |
doMake |
7938 | 6951 |
|dir cmd| |
4230 | 6952 |
|
13856 | 6953 |
cmd := self makeCommandHolder value. |
6954 |
||
6955 |
"Make" |
|
6956 |
cmd = 'make' ifTrue:[ |
|
6957 |
dir := self theSingleSelectedDirectoryOrNil. |
|
6958 |
OperatingSystem isMSWINDOWSlike ifTrue:[ |
|
6959 |
dir notNil ifTrue:[ |
|
6960 |
(dir construct:'bmake.bat') exists ifTrue:[ |
|
6961 |
cmd := 'bmake.bat'. |
|
6962 |
] |
|
7938 | 6963 |
] |
13856 | 6964 |
]. |
6965 |
self executeCommand:cmd. |
|
6966 |
^self. |
|
6967 |
]. |
|
6968 |
||
6969 |
"Apache ant" |
|
6970 |
cmd = 'ant' ifTrue:[ |
|
6971 |
self executeCommand:cmd. |
|
6972 |
^self. |
|
6973 |
]. |
|
6974 |
||
6975 |
"Add more here..." |
|
6976 |
||
6977 |
"Modified (comment): / 13-04-2012 / 17:07:02 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
4230 | 6978 |
! |
6979 |
||
8256 | 6980 |
doOpenCBrowser |
11712
ed8877d9356b
comment/format in: #doOpenCBrowser
Claus Gittinger <cg@exept.de>
parents:
11688
diff
changeset
|
6981 |
"the CBrowser is an eXept-internal C-language IDE tool. |
ed8877d9356b
comment/format in: #doOpenCBrowser
Claus Gittinger <cg@exept.de>
parents:
11688
diff
changeset
|
6982 |
(no longer of much interest, since we have VC and eclipse, but this was written |
ed8877d9356b
comment/format in: #doOpenCBrowser
Claus Gittinger <cg@exept.de>
parents:
11688
diff
changeset
|
6983 |
20 years ago ;-)" |
ed8877d9356b
comment/format in: #doOpenCBrowser
Claus Gittinger <cg@exept.de>
parents:
11688
diff
changeset
|
6984 |
|
8256 | 6985 |
|destDir| |
6986 |
||
10747
aa57b76e8318
added: #cBrowserMenuItemVisible
Claus Gittinger <cg@exept.de>
parents:
10678
diff
changeset
|
6987 |
(CBrowser isNil or:[ CBrowser::Browser isNil ]) ifTrue:[ |
aa57b76e8318
added: #cBrowserMenuItemVisible
Claus Gittinger <cg@exept.de>
parents:
10678
diff
changeset
|
6988 |
Smalltalk loadPackage:'exept:CC' |
aa57b76e8318
added: #cBrowserMenuItemVisible
Claus Gittinger <cg@exept.de>
parents:
10678
diff
changeset
|
6989 |
]. |
8256 | 6990 |
destDir := self currentDirectory. |
6991 |
CBrowser::Browser openIn:destDir pathName |
|
10747
aa57b76e8318
added: #cBrowserMenuItemVisible
Claus Gittinger <cg@exept.de>
parents:
10678
diff
changeset
|
6992 |
|
aa57b76e8318
added: #cBrowserMenuItemVisible
Claus Gittinger <cg@exept.de>
parents:
10678
diff
changeset
|
6993 |
"Modified: / 04-10-2011 / 13:41:31 / cg" |
11712
ed8877d9356b
comment/format in: #doOpenCBrowser
Claus Gittinger <cg@exept.de>
parents:
11688
diff
changeset
|
6994 |
"Modified (comment): / 27-07-2012 / 20:41:40 / cg" |
8256 | 6995 |
! |
6996 |
||
7829 | 6997 |
doOpenExplorer |
11642
72cd5c5e2615
changed: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
11591
diff
changeset
|
6998 |
self currentDirectory asFilename openExplorer |
72cd5c5e2615
changed: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
11591
diff
changeset
|
6999 |
|
72cd5c5e2615
changed: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
11591
diff
changeset
|
7000 |
"Modified: / 21-07-2012 / 12:28:36 / cg" |
7829 | 7001 |
! |
7002 |
||
12473 | 7003 |
doOpenFinder |
7004 |
self currentDirectory asFilename openFinder |
|
7005 |
||
7006 |
"Modified: / 21-07-2012 / 12:28:36 / cg" |
|
7007 |
! |
|
7008 |
||
12811 | 7009 |
doOpenMonticelloBrowser |
12874
f08360e7ac62
oops - startup did not enable directoryUp
Claus Gittinger <cg@exept.de>
parents:
12871
diff
changeset
|
7010 |
MCMczReader isNil ifTrue:[ Smalltalk loadPackage:'stx:goodies/monticello']. |
f08360e7ac62
oops - startup did not enable directoryUp
Claus Gittinger <cg@exept.de>
parents:
12871
diff
changeset
|
7011 |
|
12811 | 7012 |
self withWaitCursorDo:[ |
7013 |
self currentSelectedFiles do:[:fn | |
|
7014 |
|version snapshot| |
|
7015 |
||
7016 |
fn suffix asLowercase = 'mcz' ifTrue:[ |
|
7017 |
version := MCMczReader versionFromFile:fn. |
|
7018 |
snapshot := version snapshot. |
|
7019 |
(Tools::ChangeSetBrowser2 |
|
7020 |
on: snapshot asChangeSet |
|
7021 |
label: version info name) |
|
7022 |
beTwoColumn; |
|
7023 |
targetNamespace:nil; |
|
7024 |
targetPackage:nil; |
|
7025 |
open |
|
7026 |
] |
|
7027 |
] |
|
7028 |
] |
|
7029 |
! |
|
7030 |
||
4317
bf3f150809c2
settings is a new application now and will be inserted under tools in
penk
parents:
4294
diff
changeset
|
7031 |
doOpenSettings |
8168 | 7032 |
self openSettingsDialog |
4317
bf3f150809c2
settings is a new application now and will be inserted under tools in
penk
parents:
4294
diff
changeset
|
7033 |
! |
bf3f150809c2
settings is a new application now and will be inserted under tools in
penk
parents:
4294
diff
changeset
|
7034 |
|
9343
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
7035 |
doOpenWithShellCommand |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
7036 |
"open using win32-shell" |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
7037 |
|
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
7038 |
|fileName| |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
7039 |
|
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
7040 |
fileName := self firstSelectedFile. |
9405
5b598565288a
changed: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9393
diff
changeset
|
7041 |
fileName notNil ifTrue:[ |
11642
72cd5c5e2615
changed: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
11591
diff
changeset
|
7042 |
OperatingSystem |
9405
5b598565288a
changed: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9393
diff
changeset
|
7043 |
openApplicationForDocument:fileName pathName |
5b598565288a
changed: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9393
diff
changeset
|
7044 |
operation:#open |
5b598565288a
changed: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9393
diff
changeset
|
7045 |
] |
11642
72cd5c5e2615
changed: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
11591
diff
changeset
|
7046 |
|
72cd5c5e2615
changed: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
11591
diff
changeset
|
7047 |
"Modified: / 21-07-2012 / 12:26:10 / cg" |
9343
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
7048 |
! |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
7049 |
|
7104 | 7050 |
editMode:aSymbol |
7051 |
self |
|
7052 |
applicationNamed:#FileApplicationNoteBook |
|
7053 |
ifPresentDo:[:appl | |
|
7054 |
|subApp| |
|
7055 |
||
7056 |
subApp := appl selectedApplication. |
|
7057 |
subApp notNil ifTrue:[ |
|
7058 |
^ subApp perform:aSymbol |
|
7059 |
] |
|
7060 |
]. |
|
7061 |
||
7062 |
"Created: / 11-09-2006 / 12:42:08 / cg" |
|
7063 |
! |
|
7064 |
||
7065 |
editModeInsert |
|
7066 |
self editMode:#editModeInsert |
|
7067 |
||
7068 |
"Created: / 11-09-2006 / 12:40:36 / cg" |
|
7069 |
! |
|
7070 |
||
7071 |
editModeInsertAndSelect |
|
7072 |
self editMode:#editModeInsertAndSelect |
|
7073 |
||
7074 |
"Created: / 11-09-2006 / 12:40:45 / cg" |
|
7075 |
! |
|
7076 |
||
7077 |
editModeOverwrite |
|
7078 |
self editMode:#editModeOverwrite |
|
7079 |
||
7080 |
"Modified: / 11-09-2006 / 12:42:26 / cg" |
|
7081 |
! |
|
7082 |
||
15528 | 7083 |
fetchFileByURL |
7084 |
|url destinationFilename| |
|
7085 |
||
17818 | 7086 |
url := Dialog request:(resources string:'URL to Fetch:') initialAnswer:'http://host/path'. |
15528 | 7087 |
url isEmptyOrNil ifTrue:[^ self]. |
7088 |
url := url asURL. |
|
7089 |
||
17818 | 7090 |
destinationFilename := Dialog request:(resources string:'Download As:') initialAnswer:(UnixFilename named:url path) baseName. |
15528 | 7091 |
destinationFilename isEmptyOrNil ifTrue:[^ self]. |
7092 |
||
7093 |
destinationFilename := self currentDirectory asFilename / destinationFilename. |
|
7094 |
destinationFilename exists ifTrue:[ |
|
7095 |
|answer| |
|
7096 |
||
7097 |
answer := Dialog |
|
7098 |
confirm:(resources string:'Overwrite existing %1 ?' with:destinationFilename baseName allBold) |
|
7099 |
default:false. |
|
7100 |
answer ~~ true ifTrue:[^ self]. |
|
7101 |
]. |
|
7102 |
self withActivityIndicationDo:[ |
|
7103 |
self notify:(resources string:'Fetching %1' with:url). |
|
7104 |
HTTPInterface get:url destinationFile:destinationFilename. |
|
7105 |
self notify:nil. |
|
7106 |
] |
|
7107 |
||
17818 | 7108 |
"Modified: / 29-11-2017 / 12:26:13 / cg" |
15528 | 7109 |
! |
7110 |
||
8454
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
7111 |
fileContentsAsByteArray |
17769 | 7112 |
|file fileSize| |
8454
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
7113 |
|
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
7114 |
file := self firstSelectedFile. |
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
7115 |
file isNil ifTrue:[^ self ]. |
17769 | 7116 |
|
7117 |
file := file asFilename. |
|
7118 |
||
7119 |
(fileSize := file fileSize) > (1024*1024) ifTrue:[ |
|
7120 |
fileSize > (128*1024*1024) ifTrue:[ |
|
11889 | 7121 |
Dialog warn:(resources string:'File is too big'). |
8454
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
7122 |
^ self. |
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
7123 |
]. |
17769 | 7124 |
(Dialog confirm:(resources |
7125 |
string:'File is big (%1) - proceed?' |
|
7126 |
with:(UnitConverter fileSizeStringFor:fileSize)) |
|
7127 |
) ifFalse:[^ self]. |
|
7128 |
]. |
|
7129 |
file binaryContentsOfEntireFile inspect |
|
7130 |
||
7131 |
"Modified: / 19-11-2017 / 14:58:43 / cg" |
|
8454
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
7132 |
! |
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
7133 |
|
3892 | 7134 |
fileFileIn |
7135 |
"fileIn the selected file(s)" |
|
7136 |
||
7137 |
self fileFileInLazy:false |
|
7138 |
! |
|
7139 |
||
7324 | 7140 |
fileFileIn:aFilename lazy:lazy |
7141 |
"fileIn a file" |
|
7142 |
||
7143 |
self withActivityIndicationDo:[ |
|
7144 |
self notify:('File in:', aFilename asFilename baseName). |
|
7145 |
self singleFileFileIn:aFilename lazy:lazy. |
|
7146 |
self notify:nil. |
|
7147 |
] |
|
7148 |
||
7149 |
"Created: / 20-09-2006 / 14:28:35 / cg" |
|
7150 |
! |
|
7151 |
||
3892 | 7152 |
fileFileInLazy |
7153 |
"fileIn the selected file(s). Do a quick load (no compilation)" |
|
7154 |
||
7155 |
self fileFileInLazy:true |
|
7156 |
! |
|
7157 |
||
7158 |
fileFileInLazy:lazy |
|
7159 |
"fileIn the selected file(s)" |
|
7160 |
||
7324 | 7161 |
self currentSelectedFiles do:[:fileName | |
7162 |
self fileIn:fileName lazy:lazy |
|
7163 |
]. |
|
7164 |
||
7165 |
"Modified: / 20-09-2006 / 14:29:24 / cg" |
|
3892 | 7166 |
! |
7167 |
||
12497 | 7168 |
fileFileInPackage |
7169 |
"assuming the current directory is a package directory, load it" |
|
7170 |
||
7171 |
|packageDir dir path top packageID| |
|
7172 |
||
7173 |
"/ find a reasonable package-id (walk up until we find stx) |
|
7174 |
path := ''. |
|
7175 |
dir := packageDir := self currentDirectory. |
|
7176 |
||
7177 |
top := (Smalltalk projectDirectoryForPackage:'stx') asFilename. |
|
7178 |
[ (dir / 'stx') = top ] whileFalse:[ |
|
7179 |
path := dir baseName , '/' , path. |
|
7180 |
dir := dir directory. |
|
7181 |
dir isNil ifTrue:[ |
|
12707
6e9276c4fc95
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
12684
diff
changeset
|
7182 |
Dialog warn:'Could not find a path from "stx" to the current directory.'. |
12497 | 7183 |
"/ should ask the user for a packageID and proceed... |
7184 |
^ self. |
|
7185 |
]. |
|
7186 |
]. |
|
12707
6e9276c4fc95
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
12684
diff
changeset
|
7187 |
packageID := path copyButLast:1. |
12497 | 7188 |
Smalltalk loadPackage:packageID fromDirectory:packageDir asAutoloaded:true |
7189 |
! |
|
7190 |
||
3892 | 7191 |
fileFileInToNameSpace |
7192 |
"fileIn the selected file(s)<into a nameSpace" |
|
7193 |
||
7194 |
|ns listOfKnownNameSpaces| |
|
7195 |
||
7196 |
listOfKnownNameSpaces := Set new. |
|
7197 |
NameSpace |
|
6672
478b83a3753a
max size to be shown without dialog
Claus Gittinger <cg@exept.de>
parents:
6671
diff
changeset
|
7198 |
allNameSpaces |
4414 | 7199 |
do:[:eachNameSpace | |
7200 |
listOfKnownNameSpaces add:eachNameSpace name |
|
7201 |
]. |
|
3892 | 7202 |
listOfKnownNameSpaces := listOfKnownNameSpaces asOrderedCollection sort. |
7203 |
||
7204 |
ns := Dialog |
|
4414 | 7205 |
request:'During fileIn, new classes are created in nameSpace:' |
7206 |
initialAnswer:(LastEnforcedNameSpace ? Class nameSpaceQuerySignal query name) |
|
7207 |
list:listOfKnownNameSpaces. |
|
3892 | 7208 |
ns isEmptyOrNil ifTrue:[^ self]. |
7209 |
||
7210 |
LastEnforcedNameSpace := ns. |
|
7211 |
ns := NameSpace name:ns. |
|
7212 |
||
7213 |
Class nameSpaceQuerySignal |
|
4414 | 7214 |
answer:ns |
7215 |
do:[ |
|
7216 |
self fileFileInLazy:false |
|
7217 |
] |
|
3892 | 7218 |
! |
7219 |
||
7220 |
fileFindAllDuplicates |
|
7221 |
"scan directory and all subdirs for duplicate files" |
|
7222 |
||
7223 |
|fileNames dir infoDir filesBySize |
|
7224 |
result info dirPrefix myName stream textBox maxLength directories| |
|
7225 |
||
7226 |
||
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
7227 |
self withActivityIndicationDo:[ |
4414 | 7228 |
result := Dictionary new. |
7229 |
myName := self class name asString. |
|
7230 |
directories := self currentSelectedDirectories. |
|
7231 |
directories isEmpty ifTrue:[^ self]. |
|
3892 | 7232 |
|
4414 | 7233 |
dir := directories first. |
3892 | 7234 |
"/ self label: myName, '- gathering file names ...'. |
4636
08b2b63e3107
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4629
diff
changeset
|
7235 |
[ |
08b2b63e3107
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4629
diff
changeset
|
7236 |
fileNames := dir recursiveDirectoryContents. |
08b2b63e3107
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4629
diff
changeset
|
7237 |
] on:FileStream openErrorSignal do:[:ex| |
6352 | 7238 |
self warn:(resources stringWithCRs:'Cannot access: %1\(%2)' |
7239 |
with:ex pathName |
|
7240 |
with:ex description). |
|
4636
08b2b63e3107
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4629
diff
changeset
|
7241 |
^ self |
08b2b63e3107
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4629
diff
changeset
|
7242 |
]. |
4765 | 7243 |
fileNames := fileNames |
7244 |
collect:[:fn | dir construct:fn] |
|
7245 |
thenSelect:[:fn | fn isDirectory not]. |
|
3892 | 7246 |
|
7247 |
"/ self label:myName , '- gathering sizes ...'. |
|
4414 | 7248 |
infoDir := Dictionary new. |
7249 |
fileNames do:[:fn | |
|
7250 |
infoDir at:fn put:(fn fileSize) |
|
7251 |
]. |
|
7252 |
||
14497 | 7253 |
"/ for each, get the file's size. |
4414 | 7254 |
"/ in a first pass, look for files of the same size and |
7255 |
"/ compare them ... |
|
3892 | 7256 |
|
7257 |
"/ self label:myName , '- preselect possible duplicates ...'. |
|
4414 | 7258 |
filesBySize := Dictionary new. |
7259 |
infoDir keysAndValuesDo:[:fn :sz | |
|
7260 |
|entry| |
|
7261 |
||
7262 |
entry := filesBySize at:sz ifAbsentPut:[Set new]. |
|
7263 |
entry add:fn. |
|
7264 |
]. |
|
7265 |
||
7266 |
"/ any of same size ? |
|
3892 | 7267 |
|
7268 |
"/ self label:myName , '- checking for duplicates ...'. |
|
4414 | 7269 |
filesBySize do:[:entry | |
7270 |
|files| |
|
7271 |
||
7272 |
entry size > 1 ifTrue:[ |
|
7273 |
files := entry asArray. |
|
7274 |
1 to:files size-1 do:[:idx1 | |
|
7275 |
idx1+1 to:files size do:[:idx2 | |
|
7276 |
|fn1 fn2| |
|
7277 |
||
7278 |
fn1 := files at:idx1. |
|
7279 |
fn2 := files at:idx2. |
|
3892 | 7280 |
|
7281 |
"/ self label:myName , '- checking ' , fn1 baseName , ' vs. ' , fn2 baseName , ' ...'. |
|
4414 | 7282 |
(result at:fn2 ifAbsent:nil) ~= fn1 ifTrue:[ |
7283 |
"/ compare the files |
|
7284 |
(fn1 sameContentsAs:fn2) ifTrue:[ |
|
3892 | 7285 |
"/ Transcript show:'Same: '; show:fn1 baseName; show:' and '; showCR:fn2 baseName. |
4414 | 7286 |
result at:fn1 put:fn2. |
7287 |
] |
|
7288 |
] |
|
7289 |
] |
|
7290 |
] |
|
7291 |
] |
|
7292 |
]. |
|
3892 | 7293 |
|
7294 |
"/ self label:myName , '- sorting ...'. |
|
4414 | 7295 |
dirPrefix := dir pathName. |
7296 |
result := result associations. |
|
7297 |
result := result collect:[:assoc | |
|
7298 |
|f1 f2| |
|
7299 |
||
7300 |
f1 := assoc key name. |
|
7301 |
f2 := assoc value name. |
|
7302 |
(f1 startsWith:dirPrefix) ifTrue:[ |
|
7303 |
f1 := f1 copyFrom:dirPrefix size + 2. |
|
7304 |
]. |
|
7305 |
(f2 startsWith:dirPrefix) ifTrue:[ |
|
7306 |
f2 := f2 copyFrom:dirPrefix size + 2. |
|
7307 |
]. |
|
7308 |
f1 < f2 ifTrue:[ |
|
7309 |
f2 -> f1 |
|
7310 |
] ifFalse:[ |
|
7311 |
f1 -> f2 |
|
7312 |
] |
|
7313 |
]. |
|
7314 |
result sort:[:f1 :f2 | f2 value < f1 value]. |
|
7315 |
||
7316 |
info := OrderedCollection new. |
|
7317 |
result do:[:assoc | |
|
7318 |
info add:(assoc key , ' same as ' , assoc value) |
|
7319 |
]. |
|
7320 |
info isEmpty ifTrue:[ |
|
11889 | 7321 |
Dialog information:(resources string:'No duplicate files found.'). |
5543 | 7322 |
^ self. |
4414 | 7323 |
]. |
3892 | 7324 |
]. |
7325 |
||
15589 | 7326 |
stream := CharacterWriteStream new. |
11688 | 7327 |
stream nextPutAllLines:info. |
5542 | 7328 |
|
3892 | 7329 |
textBox := TextBox new. |
7330 |
textBox initialText:(stream contents). |
|
5542 | 7331 |
stream close. |
11889 | 7332 |
textBox title:(resources string:'File duplicates in directory: %1' with:dir asString). |
3892 | 7333 |
textBox readOnly:true. |
7334 |
textBox noCancel. |
|
11889 | 7335 |
textBox label:(resources string:'Duplicates in %1' with:dir asString). |
3892 | 7336 |
maxLength := 10. |
7337 |
info do:[: el | |
|
4414 | 7338 |
maxLength := maxLength max:(el size). |
3892 | 7339 |
]. |
7340 |
textBox extent:((maxLength * 5)@(info size * 20)); sizeFixed:false. |
|
5542 | 7341 |
textBox maxExtent:Screen current extent. |
7342 |
textBox openModeless. |
|
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
7343 |
|
11688 | 7344 |
"Modified: / 27-07-2012 / 09:29:00 / cg" |
3892 | 7345 |
! |
7346 |
||
10304
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
7347 |
fileFindDuplicateFile |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
7348 |
"scan directory for duplicates of the selected files" |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
7349 |
|
10306 | 7350 |
|files filesBySize samePerFile stream textBox mustHaveMatches| |
10304
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
7351 |
|
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
7352 |
files := self currentSelectedFiles. |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
7353 |
files isEmpty ifTrue:[^ self]. |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
7354 |
|
10305
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
7355 |
self withWaitCursorDo:[ |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
7356 |
filesBySize := Dictionary new. |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
7357 |
files do:[:fn | |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
7358 |
|sz entry| |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
7359 |
|
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
7360 |
sz := fn asFilename fileSize. |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
7361 |
(filesBySize at:sz ifAbsentPut:[Set new]) add:fn. |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
7362 |
]. |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
7363 |
|
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
7364 |
samePerFile := Dictionary new. |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
7365 |
|
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
7366 |
self currentSelectedDirectories do:[:eachDir | |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
7367 |
eachDir recursiveDirectoryContentsAsFilenamesDo:[:eachFile | |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
7368 |
eachFile isDirectory ifFalse:[ |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
7369 |
|sz possibleMatches| |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
7370 |
|
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
7371 |
sz := eachFile fileSize. |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
7372 |
possibleMatches := filesBySize at:sz ifAbsent:nil. |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
7373 |
possibleMatches notNil ifTrue:[ |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
7374 |
possibleMatches do:[:eachFileWithSameSize | |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
7375 |
eachFileWithSameSize ~= eachFile ifTrue:[ |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
7376 |
(eachFileWithSameSize sameContentsAs:eachFile) ifTrue:[ |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
7377 |
(samePerFile at:eachFileWithSameSize ifAbsentPut:[Set new]) add:eachFile |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
7378 |
] |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
7379 |
] |
10304
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
7380 |
] |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
7381 |
] |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
7382 |
] |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
7383 |
] |
10305
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
7384 |
]. |
10304
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
7385 |
]. |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
7386 |
|
15589 | 7387 |
stream := CharacterWriteStream with:'Duplicates:'. |
10305
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
7388 |
(samePerFile keys asOrderedCollection sort:[:a :b | a asFilename baseName < b asFilename baseName]) |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
7389 |
do:[:origFile | |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
7390 |
|sameFiles| |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
7391 |
|
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
7392 |
sameFiles := samePerFile at:origFile. |
10304
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
7393 |
stream nextPutLine:origFile baseName. |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
7394 |
(sameFiles asOrderedCollection collect:[:each | each baseName]) sort do:[:eachSameName | |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
7395 |
stream nextPutAll:' '; nextPutLine:eachSameName. |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
7396 |
] |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
7397 |
]. |
10306 | 7398 |
stream nextPutLine:'Files without duplicates:'. |
7399 |
(samePerFile keys asOrderedCollection sort:[:a :b | a asFilename baseName < b asFilename baseName]) |
|
7400 |
do:[:origFile | |
|
7401 |
|sameFiles| |
|
7402 |
||
7403 |
sameFiles := samePerFile at:origFile. |
|
7404 |
sameFiles isEmpty ifTrue:[ |
|
7405 |
stream nextPutLine:origFile baseName. |
|
7406 |
]. |
|
7407 |
]. |
|
7408 |
||
7409 |
mustHaveMatches := Dialog request:'Must have for duplicates matching ?:' initialAnswer:(LastMustMatchPattern ? '[a-z][a-z][a-z]_[0-9][0-9][0-9].*'). |
|
7410 |
mustHaveMatches notEmptyOrNil ifTrue:[ |
|
7411 |
LastMustMatchPattern := mustHaveMatches. |
|
7412 |
||
7413 |
stream nextPutLine:'Files without duplicates in xxx_nnn.jpg:'. |
|
7414 |
(samePerFile keys asOrderedCollection sort:[:a :b | a asFilename baseName < b asFilename baseName]) |
|
7415 |
do:[:origFile | |
|
7416 |
|sameFiles| |
|
7417 |
||
7418 |
sameFiles := samePerFile at:origFile. |
|
7419 |
sameFiles notEmpty ifTrue:[ |
|
7420 |
(sameFiles contains:[:file | mustHaveMatches match:file baseName]) ifFalse:[ |
|
7421 |
stream nextPutLine:origFile baseName. |
|
7422 |
] |
|
7423 |
]. |
|
7424 |
]. |
|
7425 |
]. |
|
10304
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
7426 |
|
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
7427 |
textBox := TextBox new. |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
7428 |
textBox initialText:(stream contents). |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
7429 |
textBox title:'Files with same contents'. |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
7430 |
textBox readOnly:true. |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
7431 |
textBox noCancel. |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
7432 |
textBox extent:(350@400). |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
7433 |
textBox maxExtent:Screen current extent. |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
7434 |
textBox openModeless. "/ showAtPointer. |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
7435 |
|
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
7436 |
"Created: / 11-07-2011 / 12:39:44 / cg" |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
7437 |
! |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
7438 |
|
3892 | 7439 |
fileFindDuplicates |
7440 |
"scan directory for duplicate files" |
|
7441 |
||
17869 | 7442 |
|directories duplicates info |
7443 |
commonDir prefixSize stream titleStream textBox maxLength| |
|
8510 | 7444 |
|
7445 |
directories := self currentSelectedDirectories. |
|
17869 | 7446 |
duplicates := self class fileFindDuplicatesIn:directories. |
7447 |
duplicates isEmpty ifTrue:[ |
|
17868 | 7448 |
Dialog information:'No duplicate files found.'. |
7449 |
^ self. |
|
7450 |
]. |
|
7451 |
||
7452 |
info := OrderedCollection new. |
|
17869 | 7453 |
commonDir := self getBestDirectory. |
7454 |
prefixSize := commonDir asString size. |
|
7455 |
duplicates do:[:assoc | |
|
17871 | 7456 |
|dup orig| |
7457 |
||
7458 |
dup := assoc key. |
|
7459 |
orig := assoc value. |
|
17868 | 7460 |
prefixSize > 1 ifTrue:[ |
17871 | 7461 |
dup := dup pathNameRelativeFrom:commonDir. |
7462 |
orig := orig pathNameRelativeFrom:commonDir. |
|
17869 | 7463 |
"/ fn1 := ('..', (fn1 name copyFrom:(prefixSize + 1))). |
7464 |
"/ fn2 := ('..', (fn2 copyFrom:(prefixSize + 1))). |
|
17868 | 7465 |
]. |
17871 | 7466 |
(dup includes:Character space) ifTrue:[ |
7467 |
dup := '"' , dup , '"' |
|
7468 |
]. |
|
7469 |
(orig includes:Character space) ifTrue:[ |
|
7470 |
orig := '"' , orig , '"' |
|
7471 |
]. |
|
7472 |
info add:(dup , ' duplicate of ' , orig) |
|
17868 | 7473 |
]. |
7474 |
||
15589 | 7475 |
stream := CharacterWriteStream new. |
11688 | 7476 |
stream nextPutAllLines:info. |
7477 |
||
17869 | 7478 |
titleStream := CharacterWriteStream with:'File duplicates in director'. |
3892 | 7479 |
directories size == 1 ifTrue:[ |
12602 | 7480 |
titleStream nextPutAll:'y: '; nextPutAll: directories first asString. |
3892 | 7481 |
] ifFalse:[ |
4535 | 7482 |
titleStream nextPutLine:'ies: '. |
4355 | 7483 |
directories do:[:dir| |
17868 | 7484 |
prefixSize > 1 ifTrue:[ |
4355 | 7485 |
titleStream nextPutAll:'..'. |
17868 | 7486 |
titleStream nextPutLine:((dir asString) copyFrom:(prefixSize + 1)). |
4355 | 7487 |
] ifFalse:[ |
4535 | 7488 |
titleStream nextPutLine:(dir asString). |
4355 | 7489 |
]. |
7490 |
] |
|
3892 | 7491 |
]. |
5543 | 7492 |
|
3892 | 7493 |
textBox := TextBox new. |
7494 |
textBox initialText:(stream contents). |
|
7495 |
textBox title:(titleStream contents). |
|
7496 |
textBox readOnly:true. |
|
7497 |
textBox noCancel. |
|
14715 | 7498 |
stream := WriteStream on:''. |
7499 |
stream nextPutAll:'Duplicates in '. |
|
4170 | 7500 |
directories do:[ :aDirectory | |
4355 | 7501 |
stream nextPutAll:aDirectory baseName. |
7502 |
stream space. |
|
4050 | 7503 |
]. |
4170 | 7504 |
textBox label:stream contents. |
3892 | 7505 |
maxLength := 10. |
7506 |
info do:[: el | |
|
4355 | 7507 |
maxLength := maxLength max:(el size). |
3892 | 7508 |
]. |
5092 | 7509 |
textBox extent:((maxLength * 5)@((info size max:40)* 10)). |
7510 |
textBox maxExtent:Screen current extent. |
|
17869 | 7511 |
textBox addButton:(Button |
7512 |
label:(resources string:'Remove Duplicates') |
|
7513 |
action:[ |
|
7514 |
(Dialog confirm:(resources string:'Remove %1 duplicate files?' with:duplicates size)) ifTrue:[ |
|
7515 |
duplicates do:[:eachAssoc | |
|
17871 | 7516 |
eachAssoc key remove |
17869 | 7517 |
]. |
17871 | 7518 |
]. |
7519 |
textBox close. |
|
7520 |
self updateCurrentDirectoryWithReread. |
|
17869 | 7521 |
]). |
4355 | 7522 |
textBox openModeless. "/ showAtPointer. |
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
7523 |
|
11688 | 7524 |
"Modified: / 27-07-2012 / 09:29:14 / cg" |
3892 | 7525 |
! |
7526 |
||
7527 |
fileFindFile |
|
5961 | 7528 |
|filename| |
7529 |
||
7530 |
filename := self firstSelectedFileName. |
|
7531 |
filename isNil ifTrue:[ |
|
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
7532 |
filename := Filename homeDirectory. |
3892 | 7533 |
]. |
4101 | 7534 |
FindFileApplication openOnFileName:filename for:self. |
3892 | 7535 |
! |
7536 |
||
8510 | 7537 |
fileFindSimilarImages |
7538 |
"scan directory for similar image files" |
|
7539 |
||
8512 | 7540 |
|result stream textBox directories imageFiles histogramsV histogramsH |
7541 |
similarV similarH similar alreadyPrinted| |
|
8510 | 7542 |
|
8524
cac6b19eae23
changed #fileFindSimilarImages
Claus Gittinger <cg@exept.de>
parents:
8512
diff
changeset
|
7543 |
self withWaitCursorDo:[ |
8510 | 7544 |
self withActivityIndicationDo:[ |
7545 |
result := Dictionary new. |
|
7546 |
||
7547 |
directories := self currentSelectedDirectories. |
|
7548 |
directories isEmpty ifTrue:[^ self]. |
|
7549 |
||
13714 | 7550 |
imageFiles := self allFilesInSelectedDirectoriesForWhich:[:f | f mimeTypeFromName isImageType]. |
8511 | 7551 |
"/ imageFiles := imageFiles select:[:f | f baseName startsWith:'foo']. |
7552 |
imageFiles sort:[:a :b | a pathName < b pathName]. |
|
7553 |
||
8510 | 7554 |
"/ for each, get the color histogram |
7555 |
histogramsV := Dictionary new. |
|
7556 |
histogramsH := Dictionary new. |
|
7557 |
imageFiles do:[:fn | |
|
7558 |
|hist image| |
|
7559 |
||
7560 |
image := Image fromFile:fn. |
|
7561 |
Transcript showCR:'generating histogram for ',fn baseName. |
|
7562 |
hist := ImageColorHistogram new forImage:image. |
|
7563 |
histogramsV at:fn put:(hist histogramVectorV). |
|
7564 |
histogramsH at:fn put:(hist histogramVectorH). |
|
7565 |
]. |
|
7566 |
||
7567 |
similarH := Dictionary new. |
|
7568 |
similarV := Dictionary new. |
|
7569 |
similar := Dictionary new. |
|
7570 |
||
8512 | 7571 |
(self firstSelectedFile notNil |
7572 |
ifTrue:[ Array with:self firstSelectedFile ] |
|
7573 |
ifFalse:[ imageFiles ]) |
|
7574 |
do:[:eachFile1 | |
|
8510 | 7575 |
|setOfSimilar distancesV distancesH| |
7576 |
||
7577 |
distancesV := OrderedCollection new. |
|
7578 |
distancesH := OrderedCollection new. |
|
7579 |
setOfSimilar := OrderedCollection new. |
|
7580 |
||
7581 |
imageFiles do:[:eachFile2 | |
|
7582 |
|v1 v2 dV dH| |
|
7583 |
||
7584 |
eachFile1 ~= eachFile2 ifTrue:[ |
|
7585 |
v1 := histogramsV at:eachFile1. |
|
7586 |
v2 := histogramsV at:eachFile2. |
|
7587 |
dV := ImageColorHistogram distanceFrom:v1 to:v2. |
|
7588 |
distancesV add:(eachFile2 -> dV). |
|
7589 |
v1 := histogramsH at:eachFile1. |
|
7590 |
v2 := histogramsH at:eachFile2. |
|
7591 |
dH := ImageColorHistogram distanceFrom:v1 to:v2. |
|
7592 |
distancesH add:(eachFile2 -> dH). |
|
7593 |
(dV < 10000 and:[dH < 10000]) ifTrue:[ |
|
8512 | 7594 |
setOfSimilar add:eachFile2->(dV + dH). |
8510 | 7595 |
]. |
7596 |
] |
|
7597 |
]. |
|
7598 |
distancesV sort:[:a1 :a2 | a1 value < a2 value]. |
|
7599 |
distancesH sort:[:a1 :a2 | a1 value < a2 value]. |
|
7600 |
similarV at:eachFile1 put:distancesV. |
|
7601 |
similarH at:eachFile1 put:distancesH. |
|
7602 |
setOfSimilar notEmpty ifTrue:[ similar at:eachFile1 put:setOfSimilar ]. |
|
7603 |
]. |
|
7604 |
||
7605 |
similar isEmpty ifTrue:[ |
|
7606 |
Dialog information:'No similarities found.'. |
|
7607 |
^ self. |
|
7608 |
]. |
|
7609 |
]. |
|
7610 |
||
15589 | 7611 |
stream := CharacterWriteStream new. |
8512 | 7612 |
alreadyPrinted := Set new. |
7613 |
||
7614 |
imageFiles do:[:eachFile | |
|
7615 |
|eachSet| |
|
7616 |
||
7617 |
(alreadyPrinted includes:eachFile) ifFalse:[ |
|
7618 |
eachSet := similar at:eachFile ifAbsent:nil. |
|
7619 |
eachSet notNil ifTrue:[ |
|
7620 |
stream nextPutLine:eachFile pathName. |
|
7621 |
eachSet do:[:info | |
|
7622 |
|fn2 dist| |
|
7623 |
||
7624 |
fn2 := info key. |
|
7625 |
dist := info value. |
|
7626 |
stream nextPutAll:' '. |
|
7627 |
stream nextPutAll:fn2 pathName. |
|
7628 |
stream nextPutLine:' (',dist printString,')'. |
|
7629 |
alreadyPrinted add:fn2. |
|
7630 |
]. |
|
7631 |
stream cr. |
|
7632 |
]. |
|
8510 | 7633 |
]. |
7634 |
]. |
|
8524
cac6b19eae23
changed #fileFindSimilarImages
Claus Gittinger <cg@exept.de>
parents:
8512
diff
changeset
|
7635 |
]. |
8510 | 7636 |
|
7637 |
textBox := TextBox new. |
|
7638 |
textBox initialText:(stream contents). |
|
7639 |
textBox title:'File similarities:'. |
|
7640 |
textBox readOnly:true. |
|
7641 |
textBox noCancel. |
|
7642 |
||
7643 |
textBox label:'File similarities'. |
|
7644 |
textBox extent:(400@((similar size max:40)* 10)). |
|
7645 |
textBox maxExtent:Screen current extent. |
|
7646 |
textBox openModeless. "/ showAtPointer. |
|
7647 |
||
7648 |
"Modified: / 25-07-2006 / 09:07:25 / cg" |
|
7649 |
! |
|
7650 |
||
4618 | 7651 |
fileHexDump |
17744 | 7652 |
|file item| |
4618 | 7653 |
|
7654 |
file := self firstSelectedFile. |
|
7655 |
file notNil ifTrue:[ |
|
7656 |
item := DirectoryContentsBrowser itemClass fileName:file. |
|
5009 | 7657 |
self |
7658 |
applicationNamed:#FileApplicationNoteBook |
|
7659 |
ifPresentDo:[:appl | appl openTextEditorWithHexPresentationOn:item]. |
|
4618 | 7660 |
]. |
17744 | 7661 |
|
7662 |
"Modified (format): / 12-11-2017 / 11:19:56 / cg" |
|
4618 | 7663 |
! |
7664 |
||
7324 | 7665 |
fileIn:aFilename |
7666 |
"fileIn a file" |
|
7667 |
||
7668 |
self fileIn:aFilename lazy:false |
|
7669 |
||
7670 |
"Created: / 20-09-2006 / 14:30:06 / cg" |
|
7671 |
! |
|
7672 |
||
7673 |
fileIn:aFilename lazy:lazy |
|
7674 |
"fileIn a file" |
|
7675 |
||
7676 |
self withActivityIndicationDo:[ |
|
7677 |
self notify:('File in:', aFilename asFilename baseName). |
|
7678 |
self singleFileFileIn:aFilename lazy:lazy. |
|
7679 |
self notify:nil. |
|
7680 |
] |
|
7681 |
||
7682 |
"Created: / 20-09-2006 / 14:29:21 / cg" |
|
7683 |
! |
|
7684 |
||
4930 | 7685 |
filterSelectedFiles:whichFilter |
7686 |
|selectedFiles numFiles msg filterBlock| |
|
7687 |
||
7560 | 7688 |
selectedFiles := self currentSelectedObjects. |
4930 | 7689 |
(numFiles := selectedFiles size) == 0 ifTrue:[^ self]. |
7690 |
||
7691 |
msg := 'Replace contents of file ''%2'' with output of %3-filter ?'. |
|
7692 |
numFiles > 1 ifTrue:[ |
|
7693 |
msg := 'Replace contents of %1 files with output of %3-filter ?'. |
|
7694 |
]. |
|
7695 |
||
7696 |
(Dialog |
|
6352 | 7697 |
confirm:(resources stringWithCRs:msg with:numFiles with:selectedFiles first baseName allBold with:whichFilter) |
4930 | 7698 |
initialAnswer:false |
7699 |
) ifFalse:[ |
|
7700 |
^ self |
|
7701 |
]. |
|
7702 |
||
7703 |
whichFilter == #rot13 ifTrue:[ |
|
7704 |
filterBlock := [:charIn | charIn rot13 ]. |
|
7705 |
]. |
|
7706 |
"/ add more here... |
|
7707 |
||
7708 |
filterBlock isNil ifTrue:[ |
|
7709 |
self information:'No such filter: ' , whichFilter. |
|
7710 |
^ self. |
|
7711 |
]. |
|
7712 |
||
7713 |
selectedFiles do:[:fileName | |
|
7714 |
|s| |
|
7715 |
||
7716 |
self notify:('Processing:', fileName baseName). |
|
7717 |
fileName isDirectory ifFalse:[ |
|
7718 |
[ |
|
7719 |
|inFile outFile in out| |
|
7720 |
||
7721 |
inFile := fileName asFilename. |
|
7722 |
outFile := (fileName pathName , '.filter') asFilename. |
|
7723 |
||
7724 |
[ |
|
7725 |
|charIn charOut| |
|
7726 |
||
7727 |
in := inFile readStream. |
|
7728 |
out := outFile writeStream. |
|
7729 |
[in atEnd] whileFalse:[ |
|
7730 |
charIn := in next. |
|
7731 |
charOut := filterBlock value:charIn. |
|
7732 |
out nextPut:charOut. |
|
7733 |
]. |
|
13683 | 7734 |
out close. out:= nil. |
4930 | 7735 |
outFile renameTo:inFile. |
7736 |
] ensure:[ |
|
7737 |
out notNil ifTrue:[ out close ]. |
|
7738 |
in notNil ifTrue:[ in close ]. |
|
18024 | 7739 |
outFile remove. |
4930 | 7740 |
] |
7741 |
] on:FileStream openErrorSignal do:[:ex| |
|
7742 |
self warn:('Cannot process "%1".' bindWith:fileName baseName allBold). |
|
7743 |
]. |
|
7744 |
] |
|
7745 |
]. |
|
6190 | 7746 |
self notify:nil. |
7560 | 7747 |
|
7748 |
"Modified: / 04-12-2006 / 13:14:48 / cg" |
|
4930 | 7749 |
! |
7750 |
||
9784 | 7751 |
forEachParsedXmlFileDo:aBlock |
7752 |
"parse all selected XML files, for each dom-tree, evaluate aBlock" |
|
7753 |
||
7754 |
self withActivityIndicationDo:[ |
|
7755 |
| selectedFiles xmlDocument | |
|
7756 |
||
7757 |
selectedFiles:= self currentSelectedFiles. |
|
7758 |
selectedFiles do:[:fileName | |
|
7759 |
XML::XMLSignal handle:[:ex | |
|
14551 | 7760 |
Dialog |
7761 |
information:('Error while reading XML:\ %1' bindWith:ex description) withCRs |
|
7762 |
title:'XML Error'. |
|
9784 | 7763 |
^ self. |
7764 |
] do:[ |
|
7765 |
|s d magic encoder document| |
|
7766 |
||
7767 |
s := fileName asFilename readStream. |
|
14012 | 7768 |
[ |
7769 |
s binary. |
|
7770 |
magic := (s next:2). |
|
7771 |
magic = #[254 255] ifTrue:[ |
|
7772 |
"/ UTF16BE |
|
7773 |
document := CharacterEncoder decodeString:(s upToEnd) from:#utf16be. |
|
7774 |
] ifFalse:[ |
|
7775 |
magic = #[255 254] ifTrue:[ |
|
7776 |
"/ UTF16LE |
|
7777 |
document := CharacterEncoder decodeString:(s upToEnd) from:#utf16le. |
|
7778 |
]. |
|
7779 |
]. |
|
7780 |
] ensure:[ |
|
7781 |
s close. |
|
7782 |
]. |
|
9784 | 7783 |
document notNil ifTrue:[ |
7784 |
xmlDocument := XML::XMLParser |
|
7785 |
processDocumentString:document |
|
7786 |
beforeScanDo:[:parse| parse validate:false]. |
|
7787 |
] ifFalse:[ |
|
7788 |
xmlDocument := XML::XMLParser |
|
7789 |
processDocumentInFilename:fileName |
|
7790 |
beforeScanDo:[:parse| parse validate:false]. |
|
7791 |
] |
|
7792 |
]. |
|
7793 |
aBlock value:xmlDocument. |
|
7794 |
]. |
|
7795 |
] |
|
7796 |
||
7797 |
"Created: / 17-02-2011 / 13:58:21 / cg" |
|
7798 |
! |
|
7799 |
||
8832 | 7800 |
forEachSelectedFileIgnoringDirectories:ignoreDirs do:aBlock |
7801 |
|numItems path files| |
|
7802 |
||
7803 |
files := self currentSelectedFiles. |
|
7804 |
||
7805 |
(numItems := files size) > 2 ifTrue:[ |
|
7806 |
(self |
|
7807 |
confirm:(resources string:'Open for each of the %1 items ?' |
|
7808 |
with:numItems)) ifFalse:[^ self]. |
|
7809 |
]. |
|
7810 |
||
7811 |
self withActivityIndicationDo:[ |
|
7812 |
files do:[:fileName | |
|
7813 |
(ignoreDirs not or:[fileName isDirectory not]) ifTrue:[ |
|
7814 |
fileName isAbsolute ifTrue:[ |
|
17239 | 7815 |
path := fileName name. |
8832 | 7816 |
] ifFalse:[ |
7817 |
path := fileName pathName. |
|
7818 |
]. |
|
7819 |
aBlock value:path |
|
7820 |
] |
|
7821 |
]. |
|
7822 |
]. |
|
17239 | 7823 |
|
7824 |
"Modified: / 19-01-2017 / 16:57:03 / stefan" |
|
8832 | 7825 |
! |
7826 |
||
8648
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
7827 |
generateDetachedSignaturesForSelectedFiles |
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
7828 |
"generate detached signature (pkcs7) files from the contents of the selected files. |
16941 | 7829 |
For Smalltalk text files, better use #generateSignaturesForSelectedFiles." |
8648
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
7830 |
|
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
7831 |
self withActivityIndicationDo:[ |
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
7832 |
self currentSelectedFiles do:[:fn | |
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
7833 |
|data hash signature signatureFile| |
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
7834 |
|
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
7835 |
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
|
7836 |
|
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
7837 |
data := fn contentsAsString. |
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
7838 |
hash := SHA1Stream hashValueOf:data. |
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
7839 |
|
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
7840 |
signature := Expecco::KeyFileGenerator new signExpeccoCode:hash. |
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
7841 |
|
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
7842 |
signatureFile := fn addSuffix:'sig'. |
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
7843 |
signatureFile contents:signature. |
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
7844 |
]. |
13677 | 7845 |
self updateCurrentDirectoryWithReread. |
8648
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
7846 |
self notify:nil. |
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
7847 |
] |
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
7848 |
! |
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
7849 |
|
15211 | 7850 |
generatePatchInstallerForSelectedFiles |
7851 |
"generate an expecco patch, which installs the selected file(s). |
|
7852 |
Opens a dialog asking for the target directory and if the patch should be signed" |
|
7853 |
||
7854 |
|dialog targetDirHolder targetDir |
|
7855 |
generateSignedPatchHolder patchFileNameHolder patchFileName| |
|
7856 |
||
7857 |
targetDirHolder := '.' asValue. |
|
7858 |
generateSignedPatchHolder := true asValue. |
|
7859 |
patchFileNameHolder := '/tmp/00nn_patchFile.st' asValue. |
|
7860 |
||
7861 |
dialog := Dialog new. |
|
7862 |
dialog label:(resources string:'Patch Installer for File(s)'). |
|
7863 |
dialog addTextLabel:'Patchfile Name' adjust:#left. |
|
7864 |
dialog addInputFieldOn:patchFileNameHolder tabable:true. |
|
7865 |
dialog addTextLabel:'Target directory (relative to executable''s directory at execution time)' adjust:#left. |
|
7866 |
dialog addInputFieldOn:targetDirHolder tabable:true. |
|
7867 |
dialog addCheckBox:'Generate Signed Patch' on:generateSignedPatchHolder. |
|
7868 |
dialog addAbortAndOkButtons. |
|
7869 |
dialog open. |
|
7870 |
||
7871 |
dialog accepted ifFalse:[^ self]. |
|
7872 |
||
7873 |
targetDir := targetDirHolder value asFilename. |
|
7874 |
patchFileName := patchFileNameHolder value asFilename. |
|
7875 |
||
7876 |
self withActivityIndicationDo:[ |
|
7877 |
|outStream zipArchive pkcs7SignedData signatureFilename| |
|
7878 |
||
7879 |
self notify:'Generating self extracting st script: ', patchFileName name, '...'. |
|
7880 |
outStream := patchFileName writeStream. |
|
7881 |
outStream nextPutAll:' |
|
7882 |
|patchStream zipArchive| |
|
7883 |
patchStream := Expecco::Browser::CurrentPatchStreamQuery query. |
|
7884 |
patchStream isNil ifTrue:[ self error:''sorry, this patch can only be installed in expecco 2.6.2 and newer (missing CurrentPatchStreamQuery)'']. |
|
7885 |
zipArchive := ZipArchive readingFrom:patchStream. |
|
7886 |
zipArchive members do:[:each | zipArchive extract:each fileName]. |
|
7887 |
patchStream setToEnd. "/ to force fileIn to finish |
|
7888 |
!! |
|
7889 |
||
7890 |
!! !! |
|
7891 |
||
7892 |
'. |
|
7893 |
zipArchive := ZipArchive writingTo:outStream. "/ newFileNamed:(patchFileName). |
|
7894 |
||
7895 |
self currentSelectedFiles do:[:fn | |
|
7896 |
|inStream signatureFilename| |
|
7897 |
||
7898 |
inStream := fn asFilename readStream. |
|
7899 |
zipArchive addFile: (targetDir construct:fn asFilename baseName) name fromStream:inStream. |
|
7900 |
inStream close. |
|
7901 |
]. |
|
7902 |
||
16975 | 7903 |
zipArchive close. |
15211 | 7904 |
|
7905 |
generateSignedPatchHolder value ifTrue:[ |
|
7906 |
self notify:'Generating signed file from: ', patchFileName name, '...'. |
|
7907 |
||
7908 |
pkcs7SignedData := Expecco::KeyFileGenerator new signExpeccoCode:patchFileName contentsOfEntireFile. |
|
7909 |
signatureFilename := patchFileName withSuffix:'expeccoPatch'. |
|
7910 |
signatureFilename contents:pkcs7SignedData. |
|
7911 |
]. |
|
7912 |
self notify:nil. |
|
7913 |
] |
|
7914 |
! |
|
13783 | 7915 |
|
8640
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
7916 |
generateSignaturesForSelectedFiles |
13783 | 7917 |
"generate signed pkcs7 files from the contents of the selected files. |
7918 |
These can be delivered as expeccoPatch files" |
|
8640
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
7919 |
|
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
7920 |
self withActivityIndicationDo:[ |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
7921 |
self currentSelectedFiles do:[:fn | |
8645
00e4d07c6d6d
Generate signed expecco patch files
Stefan Vogel <sv@exept.de>
parents:
8641
diff
changeset
|
7922 |
|pkcs7SignedData signatureFilename| |
00e4d07c6d6d
Generate signed expecco patch files
Stefan Vogel <sv@exept.de>
parents:
8641
diff
changeset
|
7923 |
|
8646 | 7924 |
self notify:'Generating signed file from: ', (fn baseName), '...'. |
8645
00e4d07c6d6d
Generate signed expecco patch files
Stefan Vogel <sv@exept.de>
parents:
8641
diff
changeset
|
7925 |
|
00e4d07c6d6d
Generate signed expecco patch files
Stefan Vogel <sv@exept.de>
parents:
8641
diff
changeset
|
7926 |
pkcs7SignedData := Expecco::KeyFileGenerator new signExpeccoCode:fn contentsOfEntireFile. |
12094 | 7927 |
signatureFilename := fn withSuffix:'expeccoPatch'. |
8645
00e4d07c6d6d
Generate signed expecco patch files
Stefan Vogel <sv@exept.de>
parents:
8641
diff
changeset
|
7928 |
signatureFilename contents:pkcs7SignedData. |
8640
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
7929 |
]. |
13677 | 7930 |
self updateCurrentDirectoryWithReread. |
8640
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
7931 |
self notify:nil. |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
7932 |
] |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
7933 |
! |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
7934 |
|
9784 | 7935 |
inspectXmlFile |
7936 |
"Show an XML file - either in an XMLInspector or fall back to |
|
7937 |
a plain inspector on the XML tree" |
|
7938 |
||
7939 |
self forEachParsedXmlFileDo:[:xmlDocument | |
|
7940 |
XML::XMLInspector notNil ifTrue:[ |
|
7941 |
XML::XMLInspector openOn:xmlDocument. |
|
7942 |
] ifFalse:[ |
|
7943 |
"fall back..." |
|
7944 |
xmlDocument inspect. |
|
7945 |
] |
|
7946 |
]. |
|
7947 |
||
7948 |
"Modified: / 17-02-2011 / 13:58:16 / cg" |
|
7949 |
! |
|
7950 |
||
3892 | 7951 |
installAllAsAutoloaded |
7952 |
"install all classes found here as autoloaded classes" |
|
7953 |
||
9674
3c3c1ef9974b
added: #installAllAsAutoloadedRecursive:
Claus Gittinger <cg@exept.de>
parents:
9649
diff
changeset
|
7954 |
self installAllAsAutoloadedRecursive:false |
3892 | 7955 |
! |
7956 |
||
6521 | 7957 |
installAllAsAutoloadedRecursive |
7958 |
"install all classes found here and in subdirectories as autoloaded classes" |
|
7959 |
||
9674
3c3c1ef9974b
added: #installAllAsAutoloadedRecursive:
Claus Gittinger <cg@exept.de>
parents:
9649
diff
changeset
|
7960 |
self installAllAsAutoloadedRecursive:true |
3c3c1ef9974b
added: #installAllAsAutoloadedRecursive:
Claus Gittinger <cg@exept.de>
parents:
9649
diff
changeset
|
7961 |
! |
3c3c1ef9974b
added: #installAllAsAutoloadedRecursive:
Claus Gittinger <cg@exept.de>
parents:
9649
diff
changeset
|
7962 |
|
3c3c1ef9974b
added: #installAllAsAutoloadedRecursive:
Claus Gittinger <cg@exept.de>
parents:
9649
diff
changeset
|
7963 |
installAllAsAutoloadedRecursive:aBoolean |
3c3c1ef9974b
added: #installAllAsAutoloadedRecursive:
Claus Gittinger <cg@exept.de>
parents:
9649
diff
changeset
|
7964 |
"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
|
7965 |
|
6521 | 7966 |
[ |
15507 | 7967 |
LoadInProgressQuery answerNotifyLoadingDo:[ |
7968 |
|installAction| |
|
7969 |
||
7970 |
installAction := |
|
7971 |
[:fn | |
|
7972 |
(fn suffix = 'st') ifTrue:[ |
|
7973 |
self notify:('Install as autoloaded: ', fn baseName). |
|
7974 |
self installAsAutoloaded:fn. |
|
7975 |
] |
|
7976 |
]. |
|
7977 |
||
7978 |
self withActivityIndicationDo:[ |
|
7979 |
self currentSelectedDirectories do:[:dir| |
|
7980 |
aBoolean ifTrue:[ |
|
7981 |
dir recursiveDirectoryContentsAsFilenamesDo:installAction |
|
7982 |
] ifFalse:[ |
|
7983 |
dir directoryContentsAsFilenamesDo:installAction |
|
15152 | 7984 |
]. |
9674
3c3c1ef9974b
added: #installAllAsAutoloadedRecursive:
Claus Gittinger <cg@exept.de>
parents:
9649
diff
changeset
|
7985 |
]. |
15507 | 7986 |
self notify:nil. |
7987 |
]. |
|
7988 |
] |
|
6521 | 7989 |
] fork. |
7990 |
! |
|
7991 |
||
3892 | 7992 |
installAsAutoloaded:aFilename |
7993 |
"install aFilename as autoloaded class" |
|
7994 |
||
13292 | 7995 |
Smalltalk installAutoloadedClassFromSourceFile:aFilename |
7996 |
||
7997 |
"Modified: / 01-08-2013 / 16:58:09 / cg" |
|
3892 | 7998 |
! |
7999 |
||
15211 | 8000 |
joinSelectedFiles |
8001 |
|selectedFiles numFiles msg outFileName outFile outStream| |
|
8002 |
||
8003 |
selectedFiles := self currentSelectedObjects. |
|
8004 |
(numFiles := selectedFiles size) <= 1 ifTrue:[^ self]. |
|
8005 |
||
8006 |
msg := 'Join each of the %1 files into single file named:\\Attention: order in which files were selected is relevant here !!'. |
|
8007 |
outFileName := Dialog request:(resources stringWithCRs:msg with:numFiles with:selectedFiles first baseName). |
|
8008 |
outFileName isEmptyOrNil ifTrue:[^ self]. |
|
8009 |
outFile := selectedFiles first directory construct:outFileName. |
|
8010 |
||
8011 |
outStream := outFile writeStream. |
|
8012 |
||
8013 |
selectedFiles do:[:fileName | |
|
8014 |
self notify:('Adding:', fileName baseName). |
|
17997 | 8015 |
fileName readingFileDo:[:inStream | |
8016 |
inStream copyToEndInto:outStream. |
|
8017 |
]. |
|
15211 | 8018 |
]. |
8019 |
outStream close. |
|
8020 |
self notify:nil. |
|
8021 |
||
8022 |
"Modified: / 04-12-2006 / 13:15:10 / cg" |
|
8023 |
! |
|
4558 | 8024 |
|
6292 | 8025 |
loadImageThenDo:aBlock |
3892 | 8026 |
|img path files| |
8027 |
||
3982 | 8028 |
files := self currentSelectedFiles. |
3892 | 8029 |
files isEmpty ifTrue:[ ^ self]. |
8030 |
files do:[:fileName | |
|
4414 | 8031 |
path := fileName. |
8032 |
path isDirectory ifFalse:[ |
|
8033 |
img := Image fromFile:(path pathName). |
|
8034 |
img notNil ifTrue:[ |
|
6292 | 8035 |
aBlock value:img |
4414 | 8036 |
] ifFalse:[ |
15346 | 8037 |
Dialog warn:(resources string:'Unknown image format: "%1"' with:fileName asString) |
4414 | 8038 |
] |
8039 |
] |
|
3892 | 8040 |
]. |
8041 |
! |
|
8042 |
||
13089 | 8043 |
loadSignatureSupport |
8044 |
Expecco::KeyFileGenerator isNil ifTrue:[ |
|
14047 | 8045 |
Smalltalk loadPackage:'exept:expecco/license' |
13089 | 8046 |
]. |
8047 |
! |
|
8048 |
||
3892 | 8049 |
openASN1Browser |
8050 |
||
8051 |
self openTool:OSI::ASN1Browser |
|
8052 |
! |
|
8053 |
||
8054 |
openAppletViewer |
|
8055 |
|numItems files| |
|
8056 |
||
3982 | 8057 |
files := self currentSelectedFiles. |
3892 | 8058 |
(numItems := files size) > 2 ifTrue:[ |
4414 | 8059 |
(self |
8060 |
confirm:(resources string:'open for each of the %1 items ?' |
|
8061 |
with:numItems)) ifFalse:[^ self]. |
|
3892 | 8062 |
]. |
8063 |
||
8064 |
Java startupJavaSystem. |
|
8065 |
"/ Java markAllClassesUninitialized. |
|
8066 |
"/ Java initAllStaticFields. |
|
8067 |
"/ Java initAllClasses. |
|
8068 |
||
8069 |
files do:[:fileName | |
|
4414 | 8070 |
|p path| |
8071 |
||
8072 |
path := fileName. |
|
8073 |
path isDirectory ifFalse:[ |
|
8074 |
p := Java |
|
8075 |
javaProcessForMainOf:(Java classForName:'sun.applet.AppletViewer') |
|
8076 |
argumentString:path pathName. |
|
8077 |
p resume. |
|
8078 |
] |
|
3892 | 8079 |
]. |
8080 |
! |
|
8081 |
||
8082 |
openCBrowser |
|
6031 | 8083 |
|dir files| |
5880 | 8084 |
|
8085 |
dir := self theSingleSelectedDirectoryOrNil. |
|
8086 |
dir isNil ifTrue:[ ^ self]. |
|
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
8087 |
self withActivityIndicationDo:[ |
7560 | 8088 |
files := self currentSelectedObjects. |
6031 | 8089 |
files notEmptyOrNil ifTrue:[ |
8090 |
CBrowser::Browser openOn:files first. |
|
8091 |
] ifFalse:[ |
|
8092 |
CBrowser::Browser openIn:dir. |
|
8093 |
] |
|
3892 | 8094 |
] |
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
8095 |
|
7560 | 8096 |
"Modified: / 04-12-2006 / 13:15:19 / cg" |
3892 | 8097 |
! |
8098 |
||
4230 | 8099 |
openChangeSetBrowser |
11712
ed8877d9356b
comment/format in: #doOpenCBrowser
Claus Gittinger <cg@exept.de>
parents:
11688
diff
changeset
|
8100 |
"open a changeSet browser on the selected file(s)" |
ed8877d9356b
comment/format in: #doOpenCBrowser
Claus Gittinger <cg@exept.de>
parents:
11688
diff
changeset
|
8101 |
|
4230 | 8102 |
self |
11712
ed8877d9356b
comment/format in: #doOpenCBrowser
Claus Gittinger <cg@exept.de>
parents:
11688
diff
changeset
|
8103 |
openTool:(UserPreferences current changeSetBrowserClass) |
4230 | 8104 |
with:#openOnFile: |
8105 |
ignoreDirectories:true |
|
11712
ed8877d9356b
comment/format in: #doOpenCBrowser
Claus Gittinger <cg@exept.de>
parents:
11688
diff
changeset
|
8106 |
|
ed8877d9356b
comment/format in: #doOpenCBrowser
Claus Gittinger <cg@exept.de>
parents:
11688
diff
changeset
|
8107 |
"Modified (comment): / 27-07-2012 / 20:42:55 / cg" |
4230 | 8108 |
! |
8109 |
||
3892 | 8110 |
openChangesBrowser |
8111 |
"open a change browser on the selected file(s)" |
|
8112 |
||
18246 | 8113 |
self currentSelectedDirectories notEmptyOrNil ifTrue:[ |
18248 | 8114 |
GitHubSmalltalkPackageReader notNil ifTrue:[ |
8115 |
self currentSelectedDirectories do:[:fn | |
|
8116 |
(fn suffix = 'package') ifTrue:[ |
|
8117 |
ChangeSetBrowser openOn:(GitHubSmalltalkPackageReader readPackageFrom:fn). |
|
8118 |
]. |
|
8119 |
(fn suffix = 'class') ifTrue:[ |
|
8120 |
ChangeSetBrowser openOn:(GitHubSmalltalkClassReader readClassFrom:fn). |
|
8121 |
]. |
|
8122 |
]. |
|
8123 |
^ self. |
|
8124 |
]. |
|
18246 | 8125 |
]. |
8126 |
||
3892 | 8127 |
self openTool:(UserPreferences current changesBrowserClass) |
18246 | 8128 |
|
18248 | 8129 |
"Modified: / 30-06-2018 / 20:33:24 / Claus Gittinger" |
3892 | 8130 |
! |
8131 |
||
8132 |
openDiffView |
|
15215 | 8133 |
"open a diff-view on the two selected files" |
8134 |
||
8135 |
|name1 name2 files title |
|
8136 |
defaultName defaultDir| |
|
6460 | 8137 |
|
8138 |
files := self currentSelectedObjects. |
|
3892 | 8139 |
files isEmpty ifTrue:[ |
6460 | 8140 |
Dialog warn:(resources string:'You have to select a file first'). |
4414 | 8141 |
^ self. |
3892 | 8142 |
]. |
8287
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
8143 |
|
3892 | 8144 |
(files size == 2) ifTrue:[ |
4414 | 8145 |
name1 := files last. |
8146 |
name2 := files first. |
|
3892 | 8147 |
] ifFalse:[ |
4414 | 8148 |
LastFileDiffFile notNil ifTrue:[ |
11052 | 8149 |
LastFileDiffFile exists ifTrue:[ |
8150 |
name1 := LastFileDiffFile. |
|
8151 |
]. |
|
8152 |
"/ | directory | |
|
8153 |
"/ directory := self currentDirectory. |
|
8154 |
"/ directory notNil ifTrue:[ |
|
8155 |
"/ lastFile := directory asFilename construct:(LastFileDiffFile baseName). |
|
8156 |
"/ (lastFile exists and:[lastFile isReadable]) ifTrue:[ |
|
8157 |
"/ name1 := lastFile. |
|
8158 |
"/ ] |
|
8159 |
"/ ] |
|
4414 | 8160 |
]. |
8161 |
name2 := files first. |
|
6460 | 8162 |
title := resources string:'Show differences between "%1" and:' with:name2 baseName. |
4414 | 8163 |
defaultName := name1 notNil ifTrue:[name1 baseName] ifFalse:[nil]. |
11052 | 8164 |
defaultDir := name1 notNil ifTrue:[name1 directory] ifFalse:[self currentDirectory]. |
4414 | 8165 |
name1 := DialogBox |
8166 |
requestFileName:title |
|
8167 |
default:defaultName |
|
6460 | 8168 |
ok:(resources string:'OK') |
8169 |
abort:(resources string:'Compare against File List') |
|
4414 | 8170 |
pattern:'*' |
11052 | 8171 |
fromDirectory:defaultDir. |
3892 | 8172 |
]. |
15215 | 8173 |
self openDiffViewOn:name1 and:name2 |
8174 |
||
8175 |
"Modified: / 03-05-2012 / 08:03:16 / cg" |
|
8176 |
! |
|
8177 |
||
8178 |
openDiffViewOn:fileArg1 and:fileArg2 |
|
8179 |
"open a diff-view on two files" |
|
8180 |
||
17769 | 8181 |
|file1 file2 file1Size file2Size text1 text2 d err nm l1 sameContents msg| |
15215 | 8182 |
|
8183 |
file1 := fileArg1. |
|
8184 |
file2 := fileArg2. |
|
3892 | 8185 |
|
8287
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
8186 |
self withWaitCursorDo:[ |
15215 | 8187 |
(file1 isNil or:[file1 asString isEmpty]) ifTrue:[ |
8287
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
8188 |
text1 := self getAllFilesAsStrings asStringCollection withTabs. |
14126 | 8189 |
text1 := text1 collect:[:l | l isNil ifTrue:[' '] ifFalse:[l string]]. |
15215 | 8190 |
file1 := nil. |
8287
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
8191 |
l1 := 'browser contents' |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
8192 |
] ifFalse:[ |
15215 | 8193 |
file1 := file1 asFilename. |
8194 |
LastFileDiffFile := file1. |
|
8195 |
file1 isReadable ifFalse:[ |
|
8196 |
nm := file1. |
|
8197 |
file1 exists ifFalse:[ |
|
8287
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
8198 |
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
|
8199 |
] ifTrue:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
8200 |
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
|
8201 |
]. |
4414 | 8202 |
]. |
15215 | 8203 |
l1 := file1 pathName |
4414 | 8204 |
]. |
8287
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
8205 |
|
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
8206 |
err isNil ifTrue:[ |
15215 | 8207 |
file2 isReadable ifFalse:[ |
8208 |
nm := file2. |
|
8209 |
file2 exists ifFalse:[ |
|
8287
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
8210 |
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
|
8211 |
] ifTrue:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
8212 |
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
|
8213 |
]. |
4414 | 8214 |
]. |
8215 |
]. |
|
8287
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
8216 |
err notNil ifTrue:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
8217 |
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
|
8218 |
^ self |
6176 | 8219 |
]. |
8220 |
||
8287
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
8221 |
self withActivityIndicationDo:[ |
17769 | 8222 |
file1Size := file1 isNil ifTrue:[0] ifFalse:[file1 fileSize]. |
8223 |
file2Size := file2 isNil ifTrue:[0] ifFalse:[file2 fileSize]. |
|
8224 |
||
8225 |
((file1Size > (1024*1024*32)) or:[ file2Size > (1024*1024*32) ]) ifTrue:[ |
|
8226 |
file1Size = file2Size ifTrue:[ |
|
8287
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
8227 |
ProgressIndicator |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
8228 |
displayBusyIndicator:'Comparing...' |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
8229 |
at:(Screen default center) |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
8230 |
during:[ |
15215 | 8231 |
sameContents := (file1 sameContentsAs:file2). |
8287
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
8232 |
]. |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
8233 |
sameContents ifTrue:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
8234 |
self information:'Same contents.' |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
8235 |
] ifFalse:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
8236 |
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
|
8237 |
]. |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
8238 |
] ifFalse:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
8239 |
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
|
8240 |
]. |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
8241 |
^ self. |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
8242 |
]. |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
8243 |
|
15215 | 8244 |
file1 notNil ifTrue:[ |
8245 |
file1 isDirectory ifTrue:[ |
|
8246 |
text1 := file1 directoryContents asString. |
|
8287
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
8247 |
] ifFalse:[ |
15215 | 8248 |
text1 := file1 contents. |
8287
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
8249 |
] |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
8250 |
]. |
15215 | 8251 |
file2 isDirectory ifTrue:[ |
8252 |
text2 := file2 directoryContents asString. |
|
6460 | 8253 |
] ifFalse:[ |
15215 | 8254 |
text2 := file2 contents. |
8287
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
8255 |
]. |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
8256 |
text1 = text2 ifTrue:[ |
15215 | 8257 |
(file1 isDirectory or:[file2 isDirectory]) ifTrue:[ |
8287
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
8258 |
msg := 'Same filename lists.' |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
8259 |
] ifFalse:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
8260 |
msg := 'Same contents.' |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
8261 |
]. |
16911 | 8262 |
self information:msg |
8287
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
8263 |
] ifFalse:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
8264 |
d := DiffTextView |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
8265 |
openOn:text1 label:l1 |
15215 | 8266 |
and:text2 label:file2 pathName. |
8287
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
8267 |
d topView label:(resources string:'File Differences'). |
6460 | 8268 |
] |
4414 | 8269 |
] |
3892 | 8270 |
] |
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
8271 |
|
17769 | 8272 |
"Modified: / 19-11-2017 / 15:00:47 / cg" |
3892 | 8273 |
! |
8274 |
||
9496
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
8275 |
openDirectoryDiffView |
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
8276 |
"open a directory diff-view" |
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
8277 |
|
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
8278 |
|name1 name2 files| |
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
8279 |
|
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
8280 |
files := self currentSelectedObjects. |
11108 | 8281 |
files notEmpty ifTrue:[ |
8282 |
name1 := files first asFilename. |
|
8283 |
name1 asFilename isDirectory ifFalse:[ |
|
8284 |
name1 := name1 directory |
|
8285 |
]. |
|
8286 |
]. |
|
8287 |
||
8288 |
(files size == 2) ifTrue:[ |
|
8289 |
name2 := files second. |
|
8290 |
] ifFalse:[ |
|
8291 |
(files size ~= 1) ifTrue:[ |
|
8292 |
Dialog warn:(resources string:'Please select one or two directories.'). |
|
8293 |
^ self. |
|
8294 |
]. |
|
8295 |
name2 := Dialog |
|
8296 |
requestDirectoryName:(resources |
|
8297 |
string:'Recursive compare "%1" with folder:' |
|
8298 |
with:name1 asFilename baseName) |
|
8299 |
default:(LastFileDiffDirectory ? self currentDirectory). |
|
8300 |
name2 isEmptyOrNil ifTrue:[^ self]. |
|
8301 |
LastFileDiffDirectory := name2. |
|
8302 |
]. |
|
8303 |
name2 := name2 asFilename. |
|
8304 |
||
8305 |
name2 asFilename isDirectory ifFalse:[ |
|
8306 |
name2 := name2 directory |
|
8307 |
]. |
|
8308 |
||
8309 |
self |
|
8310 |
applicationNamed:#FileApplicationNoteBook |
|
8311 |
ifPresentDo:[:appl | ^ appl openCompareDirectory:name1 with:name2]. |
|
9496
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
8312 |
|
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
8313 |
"Created: / 20-05-2010 / 15:01:17 / cg" |
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
8314 |
! |
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
8315 |
|
3892 | 8316 |
openEditor |
8317 |
self openTool:EditTextView |
|
8318 |
! |
|
8319 |
||
4957 | 8320 |
openGV |
8321 |
self openOSCommandWithFiles:'gv' |
|
8322 |
! |
|
8323 |
||
3892 | 8324 |
openHTMLReader |
8325 |
||
8326 |
self openTool:HTMLDocumentView ignoreDirectories:false |
|
8327 |
! |
|
8328 |
||
8329 |
openImageEditor |
|
6292 | 8330 |
[ |
8331 |
self loadImageThenDo:[:img | img edit] |
|
8332 |
] fork |
|
3892 | 8333 |
! |
8334 |
||
8335 |
openImageInspector |
|
6292 | 8336 |
[ |
8337 |
self loadImageThenDo:[:img | img inspect] |
|
8338 |
] fork |
|
3892 | 8339 |
! |
8340 |
||
8341 |
openImagePreview |
|
5778 | 8342 |
[ |
8343 |
self |
|
6292 | 8344 |
loadImageThenDo: |
5778 | 8345 |
[:img | |
8346 |
|i top viewer| |
|
8347 |
||
8348 |
top := StandardSystemView new. |
|
8349 |
||
8350 |
viewer := ImageView origin:0.0@0.0 corner:1.0@1.0 in:top. |
|
8351 |
i := img. |
|
8352 |
top extent:200@200. |
|
8353 |
top label:(img fileName asFilename directory baseName , Filename separator , img fileName asFilename baseName). |
|
8354 |
top openAndWait. |
|
8355 |
||
8356 |
(i width > 200 or:[i height > 200]) ifTrue:[ |
|
8357 |
i := i magnifiedPreservingRatioTo:200@200. |
|
8358 |
]. |
|
8359 |
viewer image:i. |
|
8360 |
]. |
|
3892 | 8361 |
] fork |
8362 |
! |
|
8363 |
||
8364 |
openMP3Player |
|
8365 |
|file| |
|
8366 |
||
3982 | 8367 |
file := self currentSelectedFiles. |
3892 | 8368 |
(file isEmpty) ifTrue:[ |
4414 | 8369 |
^ self. |
3892 | 8370 |
]. |
8371 |
file := file first. |
|
8372 |
(MP3PlayerApplication ? SaugFix::MP3PlayerApplication) playSong:file. |
|
8373 |
! |
|
8374 |
||
4957 | 8375 |
openOSCommandWithFiles:command |
8376 |
|files fileNames| |
|
8377 |
||
8378 |
files := self currentSelectedFiles. |
|
8379 |
(files isEmpty) ifTrue:[ |
|
8380 |
^ self. |
|
8381 |
]. |
|
8382 |
||
8383 |
fileNames := files collect:[:each | |
|
8384 |
'"' , each asFilename pathName , '"' |
|
8385 |
]. |
|
8386 |
||
8387 |
[ |
|
8388 |
OperatingSystem |
|
4959 | 8389 |
executeCommand:command , ' ' , fileNames asStringCollection asString |
8390 |
inDirectory:(files first asFilename directory). |
|
4957 | 8391 |
] fork |
8392 |
! |
|
8393 |
||
4820 | 8394 |
openPDFViewer |
5836
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
8395 |
|files fileNames cmd arg| |
4820 | 8396 |
|
8397 |
files := self currentSelectedFiles. |
|
8398 |
(files isEmpty) ifTrue:[ |
|
8399 |
^ self. |
|
8400 |
]. |
|
12972 | 8401 |
cmd := MIMETypes defaultCommandTemplateToOpenMimeType:'application/pdf'. |
5836
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
8402 |
cmd isNil ifTrue:[ |
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
8403 |
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
|
8404 |
^ self. |
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
8405 |
]. |
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
8406 |
|
4820 | 8407 |
fileNames := |
8408 |
files |
|
8409 |
collect: |
|
8410 |
[:each | |
|
8411 |
'"' , each asFilename pathName , '"' |
|
8412 |
]. |
|
5836
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
8413 |
arg := fileNames asStringCollection asStringWith:' '. |
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
8414 |
|
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
8415 |
(cmd includesString:'"%1"') ifTrue:[ |
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
8416 |
cmd := cmd copyReplaceString:'"%1"' withString:'%1' |
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
8417 |
]. |
4820 | 8418 |
|
4950 | 8419 |
[ |
5836
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
8420 |
OperatingSystem executeCommand:(cmd bindWith:arg). |
4950 | 8421 |
] fork |
5836
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
8422 |
|
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
8423 |
"Modified: / 12-05-2004 / 12:31:20 / cg" |
4820 | 8424 |
! |
8425 |
||
4958 | 8426 |
openRP |
8427 |
self openOSCommandWithFiles:'realplay' |
|
8428 |
! |
|
8429 |
||
8426 | 8430 |
openResourceFileEditor |
8431 |
||
8432 |
self |
|
8433 |
openTool: Tools::InternationalLanguageTranslationEditor |
|
8434 |
with: #openOnFile: |
|
8435 |
! |
|
8436 |
||
3892 | 8437 |
openSlideShow |
5880 | 8438 |
|dir| |
8439 |
||
8440 |
dir := self theSingleSelectedDirectoryOrNil. |
|
8441 |
dir isNil ifTrue:[^ self]. |
|
8442 |
||
3892 | 8443 |
CodingExamples_GUI::SlideShow openIn:dir. |
8444 |
! |
|
8445 |
||
8446 |
openSnapshotImageBrowser |
|
4491 | 8447 |
"Sorry, for now, only the old browser can handle snapShotImages." |
8448 |
||
3892 | 8449 |
^ self openTool:SystemBrowser with:#openOnSnapShotImage: ignoreDirectories:true |
8450 |
! |
|
8451 |
||
8452 |
openTerminal |
|
5880 | 8453 |
|dir| |
8454 |
||
8455 |
dir := self theSingleSelectedDirectoryOrHomeDir. |
|
3892 | 8456 |
|
5300 | 8457 |
TerminalApplication notNil ifTrue:[ |
8458 |
TerminalApplication openIn:dir |
|
8459 |
] ifFalse:[ |
|
8460 |
VT100TerminalView openShellIn:dir. |
|
8461 |
]. |
|
3892 | 8462 |
! |
8463 |
||
8464 |
openTool:aToolClass |
|
8465 |
"open a tool on the selected file(s)" |
|
8466 |
||
8467 |
^ self openTool:aToolClass ignoreDirectories:true |
|
8468 |
! |
|
8469 |
||
8470 |
openTool:aToolClass ignoreDirectories:ignoreDirs |
|
8471 |
"open a tool on the selected file(s)" |
|
8472 |
||
8473 |
^ self |
|
4414 | 8474 |
openTool:aToolClass |
8475 |
with:#openOn: |
|
8476 |
ignoreDirectories:ignoreDirs |
|
3892 | 8477 |
! |
8478 |
||
8426 | 8479 |
openTool:aToolClass with:aSelector |
8480 |
"open a tool on the selected file(s)" |
|
8481 |
||
8482 |
^ self openTool:aToolClass with:aSelector ignoreDirectories:true |
|
8483 |
! |
|
8484 |
||
3892 | 8485 |
openTool:aToolClass with:aSelector ignoreDirectories:ignoreDirs |
8486 |
"open a tool on the selected file(s)" |
|
8487 |
||
8832 | 8488 |
|tool| |
3892 | 8489 |
|
8490 |
aToolClass isNil ifTrue:[ |
|
4414 | 8491 |
Dialog warn:'Sorry, that tool seems to be not available'. |
8492 |
^ nil. |
|
3892 | 8493 |
]. |
8832 | 8494 |
self forEachSelectedFileIgnoringDirectories:ignoreDirs do:[:path | |
8495 |
tool := aToolClass perform:aSelector with:path. |
|
3892 | 8496 |
]. |
8497 |
^ tool |
|
8832 | 8498 |
! |
8499 |
||
8500 |
openWebBrowser |
|
9343
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
8501 |
self |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
8502 |
forEachSelectedFileIgnoringDirectories:true |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
8503 |
do:[:path | |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
8504 |
Error |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
8505 |
handle:[:ex | |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
8506 |
Dialog warn:'Shell execution failed: ',ex description |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
8507 |
] do:[ |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
8508 |
OperatingSystem openApplicationForDocument:path operation:#open. |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
8509 |
^ self. |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
8510 |
] |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
8511 |
]. |
3892 | 8512 |
! |
8513 |
||
6022 | 8514 |
openWorkspace |
8515 |
self |
|
8516 |
openTool:WorkspaceApplication |
|
8517 |
with:#openOnFile: |
|
8518 |
ignoreDirectories:true |
|
8519 |
! |
|
8520 |
||
4950 | 8521 |
openXV |
4957 | 8522 |
self openOSCommandWithFiles:'xv' |
4950 | 8523 |
! |
8524 |
||
3892 | 8525 |
openZipTool |
5880 | 8526 |
|zipTool| |
3892 | 8527 |
|
8528 |
(zipTool := self openTool:ZipTool) notNil ifTrue:[ |
|
5880 | 8529 |
zipTool initialExtractDirectory:(self theSingleSelectedDirectoryOrHomeDir). |
3892 | 8530 |
]. |
8531 |
! |
|
8532 |
||
8533 |
readAbbrevFile |
|
8534 |
"read the abbrev file and install classes found there as autoloaded classes" |
|
8535 |
||
5880 | 8536 |
|directories| |
3892 | 8537 |
|
3982 | 8538 |
directories := self currentSelectedDirectories. |
3892 | 8539 |
directories isEmpty ifTrue:[^ self]. |
8540 |
||
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
8541 |
self withActivityIndicationDo:[ |
5880 | 8542 |
directories do:[:eachDir | |
8543 |
Smalltalk installAutoloadedClassesFrom:(eachDir construct:'abbrev.stc'). |
|
8544 |
] |
|
5828 | 8545 |
] |
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
8546 |
|
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
8547 |
"Modified: / 25-07-2006 / 09:07:43 / cg" |
3892 | 8548 |
! |
8549 |
||
6460 | 8550 |
readAndShowResources |
8551 |
self withActivityIndicationDo:[ |
|
8552 |
| selectedFiles| |
|
8553 |
||
8554 |
selectedFiles:= self currentSelectedFiles. |
|
8555 |
selectedFiles do:[:fileName | |
|
8556 |
resources := ResourcePack fromFile:fileName. |
|
8557 |
resources inspect. |
|
8558 |
]. |
|
8559 |
] |
|
8560 |
! |
|
8561 |
||
17831 | 8562 |
removeBakAndSavFiles |
8563 |
"remove all .sav and .bak files (after confirmation)" |
|
8564 |
||
8565 |
|filesToRemove directories| |
|
8566 |
||
8567 |
directories := self currentSelectedDirectories. |
|
8568 |
directories isEmptyOrNil ifTrue:[ |
|
8569 |
directories := Array with:self currentDirectory |
|
8570 |
]. |
|
8571 |
||
8572 |
self withActivityIndicationDo:[ |
|
8573 |
filesToRemove := OrderedCollection new. |
|
8574 |
directories do:[:eachDirectoryToScan | |
|
8575 |
eachDirectoryToScan filesDo:[:fn | |
|
8576 |
(#('sav' 'bak') includes:fn suffix) ifTrue:[ |
|
8577 |
filesToRemove add:fn. |
|
8578 |
] |
|
8579 |
] |
|
8580 |
]. |
|
8581 |
filesToRemove isEmpty ifTrue:[ |
|
8582 |
Dialog information:(resources string:'Nothing to remove'). |
|
8583 |
^ self. |
|
8584 |
]. |
|
8585 |
(Dialog confirm:(resources string:'Remove %1 file(s) ?' with:filesToRemove size)) ifFalse:[ |
|
8586 |
^ self |
|
8587 |
]. |
|
8588 |
filesToRemove do:[:each | |
|
8589 |
each remove |
|
8590 |
]. |
|
17871 | 8591 |
self updateCurrentDirectoryWithReread |
17831 | 8592 |
]. |
8593 |
! |
|
8594 |
||
3892 | 8595 |
singleFileFileIn:fileName lazy:lazy |
8596 |
"fileIn the selected file(s)" |
|
8597 |
||
9299
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
8598 |
|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
|
8599 |
|
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8600 |
fileName isRegularFile ifFalse:[ |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8601 |
^ self. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8602 |
]. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8603 |
|
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8604 |
[ |
4345 | 8605 |
(ObjectFileLoader notNil |
5491 | 8606 |
and:[ObjectFileLoader hasValidBinaryExtension:fileName]) ifTrue:[ |
4345 | 8607 |
AbortOperationRequest catch:[ |
8608 |
|p| |
|
8609 |
||
8610 |
"/ |
|
8611 |
"/ look if already loaded ... then unload first |
|
8612 |
"/ |
|
8613 |
p := fileName pathName. |
|
8614 |
(ObjectFileLoader loadedObjectFiles includes:p) ifTrue:[ |
|
8615 |
(Dialog confirm:(resources |
|
8616 |
string:'%1 is already loaded; load anyway ?' |
|
8617 |
with:p)) ifFalse:[ |
|
8618 |
^ self |
|
8619 |
]. |
|
8620 |
notifyString := 'unloading old ' , p , ' ...'. |
|
8621 |
Transcript showCR:notifyString. |
|
4523 | 8622 |
self notify:notifyString. |
4345 | 8623 |
ObjectFileLoader unloadObjectFile:p. |
8624 |
]. |
|
8625 |
||
8626 |
notifyString := 'loading ' , p , ' ...'. |
|
8627 |
Transcript showCR:notifyString. |
|
4523 | 8628 |
self notify:notifyString. |
12426 | 8629 |
(ObjectFileLoader loadObjectFile:p) isNil ifTrue:[ |
8630 |
notifyString := 'Error: could not load ' , p. |
|
8631 |
Transcript showCR:notifyString. |
|
8632 |
self notify:notifyString. |
|
8633 |
] ifFalse:[ |
|
8634 |
Class addInfoRecord:('fileIn ' , fileName asFilename pathName) |
|
8635 |
]. |
|
4345 | 8636 |
] |
8637 |
] ifFalse:[ ((fileName hasSuffix:'cls') |
|
8638 |
and:[((fileName mimeTypeOfContents ? '') startsWith:'application/x-smalltalk-source') not ]) ifTrue:[ |
|
8639 |
"/ loading a binary class file |
|
4636
08b2b63e3107
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4629
diff
changeset
|
8640 |
aStream := fileName readStreamOrNil. |
4345 | 8641 |
aStream notNil ifTrue:[ |
8642 |
aStream fileInBinary. |
|
8643 |
] |
|
8644 |
] ifFalse:[ |
|
9299
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
8645 |
((fileName hasSuffix:'class') or:[(fileName hasSuffix:'cla')]) ifTrue:[ |
4345 | 8646 |
"/ loading a java class file |
8647 |
JavaClassReader notNil ifTrue:[ |
|
5491 | 8648 |
JavaClassReader loadFile:fileName |
4345 | 8649 |
] |
8650 |
] ifFalse:[ (fileName hasSuffix:'sif') ifTrue:[ |
|
8651 |
"/ loading a sif (smalltalk interchange format) file |
|
8652 |
SmalltalkInterchangeSTXFileInManager autoload. |
|
8653 |
SmalltalkInterchangeFileManager newForFileIn |
|
8654 |
fileName: fileName pathName; |
|
8655 |
fileIn. |
|
8656 |
] ifFalse:[ (fileName hasSuffix:'pcl') ifTrue:[ |
|
8657 |
Parcel isNil ifTrue:[ |
|
8658 |
Dialog warn:'Parcel support not loaded.' |
|
8659 |
] ifFalse:[ |
|
8660 |
Parcel loadParcelFrom: fileName pathName |
|
8661 |
] |
|
13968
45cdc56fd50a
Added support for filing-in .jar files.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13910
diff
changeset
|
8662 |
] ifFalse:[ (fileName hasSuffix:'jar') ifTrue:[ |
45cdc56fd50a
Added support for filing-in .jar files.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13910
diff
changeset
|
8663 |
JavaVM isNil ifTrue:[ |
45cdc56fd50a
Added support for filing-in .jar files.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13910
diff
changeset
|
8664 |
Dialog warn: (resources string: 'Java support is not loaded.'). |
45cdc56fd50a
Added support for filing-in .jar files.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13910
diff
changeset
|
8665 |
^ self. |
45cdc56fd50a
Added support for filing-in .jar files.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13910
diff
changeset
|
8666 |
] ifFalse:[ |
45cdc56fd50a
Added support for filing-in .jar files.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13910
diff
changeset
|
8667 |
JavaVM booted ifFalse:[ |
45cdc56fd50a
Added support for filing-in .jar files.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13910
diff
changeset
|
8668 |
(Dialog confirm: (resources string: 'Java is not initialized. Initialize now?')) ifFalse:[ ^ self. ]. |
45cdc56fd50a
Added support for filing-in .jar files.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13910
diff
changeset
|
8669 |
JavaVM boot. |
45cdc56fd50a
Added support for filing-in .jar files.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13910
diff
changeset
|
8670 |
]. |
45cdc56fd50a
Added support for filing-in .jar files.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13910
diff
changeset
|
8671 |
JavaVM loadClassesIn: fileName. |
45cdc56fd50a
Added support for filing-in .jar files.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13910
diff
changeset
|
8672 |
] |
4345 | 8673 |
] ifFalse:[ |
9299
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
8674 |
"/ ask programming languages... |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
8675 |
lang := ProgrammingLanguage allDetect:[:l | l canReadSourceFile:fileName] ifNone:nil. |
14360 | 8676 |
(lang isNil and:[(fileName hasSuffix:'js')]) ifTrue:[ |
14362 | 8677 |
Smalltalk loadPackage:'stx:libjavascript'. |
14360 | 8678 |
lang := ProgrammingLanguage allDetect:[:l | l canReadSourceFile:fileName] ifNone:nil. |
8679 |
]. |
|
9299
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
8680 |
(lang notNil and:[lang ~= SmalltalkLanguage]) ifTrue:[ |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
8681 |
lang fileIn:fileName. |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
8682 |
] ifFalse:[ |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
8683 |
"/ loading a regular (chunk) or xml source file |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
8684 |
Error handle:[:ex | |
15675 | 8685 |
self errorNotify:'Error during file in: ', ex description. |
15981 | 8686 |
ex resume. |
9299
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
8687 |
] do:[ |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
8688 |
aStream := fileName readStream. |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
8689 |
[ |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
8690 |
Class withoutUpdatingChangesDo:[ |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
8691 |
wasLazy := Compiler compileLazy:lazy. |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
8692 |
Smalltalk fileInStream:aStream. |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
8693 |
]. |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
8694 |
Class addInfoRecord:('fileIn ' , fileName asString) |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
8695 |
] ensure:[ |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
8696 |
Compiler compileLazy:wasLazy. |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
8697 |
aStream close |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
8698 |
] |
4345 | 8699 |
] |
8700 |
] |
|
13968
45cdc56fd50a
Added support for filing-in .jar files.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13910
diff
changeset
|
8701 |
]]]] |
4345 | 8702 |
]] |
6281
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8703 |
] 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
|
8704 |
|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
|
8705 |
|
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8706 |
isRedef := false. |
12684 | 8707 |
sig := ex creator. |
10887
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8708 |
(dontAskSignals notNil and:[dontAskSignals includesKey:sig]) ifTrue:[ |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8709 |
action := #continue |
6281
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8710 |
] ifFalse:[ |
10887
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8711 |
(sig == NoHandlerError and:[ex parameter rejected]) ifTrue:[ |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8712 |
ex reject |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8713 |
]. |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8714 |
sig == Class methodRedefinitionNotification ifTrue:[ |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8715 |
msg := 'trying to overwrite method:\\ ' , ex oldMethod whoString , '\\in package ''' |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8716 |
, ex oldPackage , ''' with method from package ''' , ex newPackage , ''''. |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8717 |
label := 'Method redefinition in fileIn'. |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8718 |
redefKind := 'method'. |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8719 |
isRedef := true. |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8720 |
] ifFalse:[sig == Class classRedefinitionNotification ifTrue:[ |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8721 |
msg := 'trying to redefine class: ' , ex oldClass name allBold , '\\in package ''' |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8722 |
, ex oldPackage , ''' with new definition from package ''' , ex newPackage , ''''. |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8723 |
label := 'Class redefinition in fileIn'. |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8724 |
redefKind := 'class'. |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8725 |
isRedef := true. |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8726 |
] ifFalse:[sig == HaltInterrupt ifTrue:[ |sender| |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8727 |
label := msg := 'Breakpoint/Halt in fileIn'. |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8728 |
sender := ex suspendedContext. |
18274 | 8729 |
msg := msg , ('\\in %1 » %2' bindWith:(sender receiver class name) with:(sender sender selector)) |
10887
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8730 |
] ifFalse:[ |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8731 |
label := 'Error in fileIn'. |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8732 |
msg := 'error in fileIn: %1' |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8733 |
]]]. |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8734 |
|
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8735 |
msg := msg bindWith:ex description. |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8736 |
|
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8737 |
labels := #('Cancel' 'Skip' 'Debug' 'Compare Sources'). |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8738 |
values := #(abort skip debug compareSources). |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8739 |
|
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8740 |
isRedef ifTrue:[ |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8741 |
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
|
8742 |
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
|
8743 |
|
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8744 |
labels := labels , #('Keep Package' ). |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8745 |
values := values , #(keep). |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8746 |
]. |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8747 |
|
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8748 |
labels := labels , #( 'Continue' 'ContinueForAll'). |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8749 |
values := values , #( continue continueForAll). |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8750 |
|
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8751 |
AbortAllOperationWantedQuery query ifTrue:[ |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8752 |
labels := #('Cancel All') , labels. |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8753 |
values := #(cancelAll) , values. |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8754 |
]. |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8755 |
|
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8756 |
action := Dialog |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8757 |
choose:(msg withCRs) |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8758 |
label:label |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8759 |
image:(WarningBox iconBitmap) |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8760 |
labels:labels |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8761 |
values:values |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8762 |
default:#continue |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8763 |
onCancel:#abort. |
6281
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8764 |
]. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8765 |
|
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8766 |
action == #continueForAll ifTrue:[ |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8767 |
dontAskSignals isNil ifTrue:[ |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8768 |
dontAskSignals := IdentityDictionary new. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8769 |
]. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8770 |
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
|
8771 |
action := #continue. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8772 |
]. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8773 |
|
8887
f9ab42af84ff
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
8882
diff
changeset
|
8774 |
(action == #compareSources) ifTrue:[ |
f9ab42af84ff
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
8882
diff
changeset
|
8775 |
DiffCodeView |
f9ab42af84ff
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
8882
diff
changeset
|
8776 |
openOn:(ex oldMethod source) label:'Old Source' |
f9ab42af84ff
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
8882
diff
changeset
|
8777 |
and:(ex newMethod source) label:'New Source' |
f9ab42af84ff
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
8882
diff
changeset
|
8778 |
title:ex description. |
f9ab42af84ff
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
8882
diff
changeset
|
8779 |
ex resignalAs:ex |
f9ab42af84ff
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
8882
diff
changeset
|
8780 |
]. |
8082
40a926dc460d
On class/method redefinition allow the user to select both #keep and #continue
Stefan Vogel <sv@exept.de>
parents:
8068
diff
changeset
|
8781 |
(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
|
8782 |
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
|
8783 |
]. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8784 |
action == #abort ifTrue:[ |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8785 |
AbortOperationRequest raise. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8786 |
ex return |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8787 |
]. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8788 |
action == #cancelAll ifTrue:[ |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8789 |
AbortAllOperationRequest raise. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8790 |
ex return |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8791 |
]. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8792 |
action == #skip ifTrue:[ |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8793 |
ex proceedWith:nil |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8794 |
]. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8795 |
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
|
8796 |
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
|
8797 |
withMessage:ex description |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8798 |
mayProceed:true. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8799 |
ex proceedWith:nil. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8800 |
]. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8801 |
ex reject |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8802 |
] |
7040 | 8803 |
|
10887
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8804 |
"Modified: / 22-11-2011 / 13:52:17 / cg" |
13968
45cdc56fd50a
Added support for filing-in .jar files.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13910
diff
changeset
|
8805 |
"Modified: / 19-02-2014 / 12:49:33 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
4531 | 8806 |
! |
8807 |
||
4558 | 8808 |
splitFile:infile intoPiecesOfSize:kiloBytes |
8809 |
|bytesPerSplit splitIndex bufferSize buffer n |
|
8810 |
inStream outFile outStream remaining remainingInThisOutfile| |
|
8811 |
||
8812 |
bufferSize := 32*1024. |
|
8813 |
||
8814 |
inStream := infile readStream. |
|
8815 |
||
8816 |
bytesPerSplit := kiloBytes * 1024. |
|
8817 |
||
8818 |
remaining := infile fileSize. |
|
8819 |
splitIndex := 1. |
|
8820 |
[remaining > 0] whileTrue:[ |
|
8821 |
outFile := infile pathName , '_' , (splitIndex printString leftPaddedTo:3 with:$0). |
|
8822 |
outStream := outFile asFilename writeStream. |
|
8823 |
remainingInThisOutfile := remaining min:bytesPerSplit. |
|
8824 |
[remainingInThisOutfile > 0] whileTrue:[ |
|
8825 |
buffer := ByteArray new:bufferSize. |
|
8826 |
n := inStream |
|
8827 |
nextBytes:(bufferSize min:remainingInThisOutfile) |
|
8828 |
into:buffer |
|
8829 |
startingAt:1. |
|
8830 |
outStream nextPutBytes:n from:buffer startingAt:1. |
|
8831 |
remainingInThisOutfile := remainingInThisOutfile - n. |
|
8832 |
remaining := remaining - n. |
|
8833 |
]. |
|
8834 |
outStream close. |
|
8835 |
splitIndex := splitIndex + 1. |
|
8836 |
]. |
|
8837 |
inStream close. |
|
8838 |
! |
|
8839 |
||
15906 | 8840 |
splitFile:infile intoPiecesWithNumberOfLines:numberOfLines |
8841 |
|splitIndex line |
|
8842 |
inStream outFile outStream remainingLinesInThisOutfile| |
|
8843 |
||
8844 |
inStream := infile readStream. |
|
8845 |
||
8846 |
splitIndex := 1. |
|
8847 |
[inStream atEnd] whileFalse:[ |
|
8848 |
outFile := infile pathName , '_' , (splitIndex printString leftPaddedTo:3 with:$0). |
|
8849 |
outStream := outFile asFilename writeStream. |
|
8850 |
remainingLinesInThisOutfile := numberOfLines. |
|
8851 |
[(remainingLinesInThisOutfile > 0) and:[inStream atEnd not]] whileTrue:[ |
|
8852 |
line := inStream nextLine. |
|
15910 | 8853 |
outStream nextPutLine:line. |
15906 | 8854 |
remainingLinesInThisOutfile := remainingLinesInThisOutfile - 1. |
8855 |
]. |
|
8856 |
outStream close. |
|
8857 |
splitIndex := splitIndex + 1. |
|
8858 |
]. |
|
8859 |
inStream close. |
|
8860 |
! |
|
8861 |
||
4558 | 8862 |
splitSelectedFiles |
6264 | 8863 |
|selectedFiles numFiles msg sizeString kiloBytes| |
4558 | 8864 |
|
12871 | 8865 |
selectedFiles := self currentSelectedFiles. |
4558 | 8866 |
(numFiles := selectedFiles size) == 0 ifTrue:[^ self]. |
8867 |
||
6265 | 8868 |
msg := (numFiles > 1) |
8869 |
ifTrue:'Split each of the %1 files into pieces of size (in kB):' |
|
8870 |
ifFalse:'Split %2 into pieces of size (in kB):'. |
|
4558 | 8871 |
|
6352 | 8872 |
sizeString := Dialog request:(resources stringWithCRs:msg with:numFiles with:selectedFiles first baseName). |
6264 | 8873 |
sizeString isEmptyOrNil ifTrue:[^ self]. |
8874 |
kiloBytes := Integer readFrom:sizeString onError:nil. |
|
4558 | 8875 |
kiloBytes isNil ifTrue:[^ self]. |
8876 |
||
8877 |
selectedFiles do:[:fileName | |
|
8878 |
self notify:('Splitting:', fileName baseName). |
|
8879 |
fileName isDirectory ifFalse:[ |
|
8880 |
self splitFile:fileName intoPiecesOfSize:kiloBytes. |
|
8881 |
] |
|
8882 |
]. |
|
6190 | 8883 |
self notify:nil. |
6265 | 8884 |
|
7560 | 8885 |
"Modified: / 04-12-2006 / 13:15:26 / cg" |
4558 | 8886 |
! |
8887 |
||
15906 | 8888 |
splitSelectedFilesByLines |
8889 |
|selectedFiles numFiles msg numLinesString numLines| |
|
8890 |
||
8891 |
selectedFiles := self currentSelectedFiles. |
|
8892 |
(numFiles := selectedFiles size) == 0 ifTrue:[^ self]. |
|
8893 |
||
8894 |
msg := (numFiles > 1) |
|
8895 |
ifTrue:'Split each of the %1 files into pieces with number of lines:' |
|
8896 |
ifFalse:'Split %2 into pieces with number of lines:'. |
|
8897 |
||
8898 |
numLinesString := Dialog request:(resources stringWithCRs:msg with:numFiles with:selectedFiles first baseName). |
|
8899 |
numLinesString isEmptyOrNil ifTrue:[^ self]. |
|
8900 |
||
8901 |
numLines := Integer readFrom:numLinesString onError:nil. |
|
8902 |
numLines isNil ifTrue:[^ self]. |
|
8903 |
||
8904 |
selectedFiles do:[:fileName | |
|
8905 |
self notify:('Splitting:', fileName baseName). |
|
8906 |
fileName isDirectory ifFalse:[ |
|
8907 |
self splitFile:fileName intoPiecesWithNumberOfLines:numLines |
|
8908 |
] |
|
8909 |
]. |
|
8910 |
self notify:nil. |
|
8911 |
! |
|
8912 |
||
15211 | 8913 |
truncateSelectedFilesToZeroSize |
8914 |
|selectedFiles numFiles msg| |
|
8915 |
||
8916 |
selectedFiles := self currentSelectedObjects. |
|
8917 |
(numFiles := selectedFiles size) == 0 ifTrue:[^ self]. |
|
8918 |
||
8919 |
msg := 'Really truncate file ''%2'' to zero length ?\\WARNING: contents of file is lost !!\This cannot be undone.'. |
|
8920 |
numFiles > 1 ifTrue:[ |
|
8921 |
msg := 'Really truncate %1 files to zero length ?\\WARNING: contents of files is lost !!\This cannot be undone.'. |
|
8922 |
]. |
|
8923 |
||
8924 |
(Dialog |
|
8925 |
confirm:(resources stringWithCRs:msg with:numFiles with:selectedFiles first baseName allBold) |
|
8926 |
initialAnswer:false |
|
8927 |
) ifFalse:[ |
|
8928 |
^ self |
|
8929 |
]. |
|
8930 |
||
8931 |
selectedFiles do:[:fileName | |
|
8932 |
|s| |
|
8933 |
||
8934 |
self notify:('Truncating:', fileName baseName). |
|
8935 |
fileName isDirectory ifFalse:[ |
|
8936 |
[ |
|
8937 |
s := fileName writeStream. |
|
8938 |
s close. |
|
8939 |
] on:FileStream openErrorSignal do:[:ex| |
|
8940 |
self warn:('Cannot truncate "%1".' bindWith:fileName baseName allBold). |
|
8941 |
]. |
|
8942 |
] |
|
8943 |
]. |
|
8944 |
self notify:nil. |
|
8945 |
||
8946 |
"Modified: / 04-12-2006 / 13:15:28 / cg" |
|
8947 |
! ! |
|
3892 | 8948 |
|
4849 | 8949 |
!AbstractFileBrowser methodsFor:'menu queries-tools'! |
3892 | 8950 |
|
8951 |
anySTFilesPresent |
|
8952 |
^ self anyFilesPresentWithSuffix:'st' |
|
8953 |
! |
|
8954 |
||
8955 |
canCreateNewProject |
|
8956 |
self currentFilesAreInSameDirectory ifFalse:[^ false]. |
|
17865 | 8957 |
^ self currentSelectedFiles |
8958 |
contains:[:fileName| |
|
8959 |
| suffix| |
|
8960 |
suffix := fileName suffix asLowercase. |
|
8961 |
(suffix = 'prj' or:[suffix = 'st']) |
|
8962 |
] |
|
3892 | 8963 |
! |
8964 |
||
8965 |
canDoTerminal |
|
8966 |
||
8967 |
^ OperatingSystem isUNIXlike |
|
8968 |
or:[OperatingSystem isMSWINDOWSlike] |
|
8969 |
! |
|
8970 |
||
8971 |
canDoTerminalAndSystemIsDOS |
|
8972 |
||
8973 |
^ self canDoTerminal and:[OperatingSystem isMSWINDOWSlike] |
|
8974 |
! |
|
8975 |
||
8976 |
canDoTerminalAndSystemIsUnix |
|
8977 |
||
8978 |
^ self canDoTerminal and:[OperatingSystem isUNIXlike] |
|
8979 |
! |
|
8980 |
||
8640
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
8981 |
canGenerateSignatureFiles |
8645
00e4d07c6d6d
Generate signed expecco patch files
Stefan Vogel <sv@exept.de>
parents:
8641
diff
changeset
|
8982 |
"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
|
8983 |
|
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
8984 |
Expecco::KeyFileGenerator isNil ifTrue:[ ^ false ]. |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
8985 |
Expecco::KeyFile isNil ifTrue:[ ^ false ]. |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
8986 |
|
8645
00e4d07c6d6d
Generate signed expecco patch files
Stefan Vogel <sv@exept.de>
parents:
8641
diff
changeset
|
8987 |
^ self currentSelectedFiles notEmptyOrNil |
8640
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
8988 |
! |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
8989 |
|
12811 | 8990 |
canOpenMonticelloBrowser |
8991 |
^ self currentSelectedFiles |
|
8992 |
contains:[:fileName| |
|
8993 |
fileName suffix asLowercase = 'mcz' |
|
8994 |
] |
|
8995 |
! |
|
8996 |
||
3892 | 8997 |
canReadAbbrevFile |
8998 |
||
5960 | 8999 |
|currentDirectory| |
3892 | 9000 |
|
9001 |
self currentFilesAreInSameDirectory ifFalse:[^ false]. |
|
5960 | 9002 |
currentDirectory := self currentDirectory. |
9003 |
^ currentDirectory notNil |
|
9004 |
and:[ (currentDirectory construct:'abbrev.stc') exists ] |
|
3892 | 9005 |
! |
9006 |
||
9007 |
canRemoveFromSourcePath |
|
9008 |
||
9009 |
^ false |
|
9010 |
! |
|
9011 |
||
13089 | 9012 |
cannotGenerateSignatureFiles |
9013 |
^ self canGenerateSignatureFiles not |
|
9014 |
! |
|
9015 |
||
3892 | 9016 |
hasASN1 |
9017 |
^ [ OSI::ASN1Parser notNil |
|
4414 | 9018 |
and:[OSI::ASN1Parser isLoaded]] |
3892 | 9019 |
|
9020 |
! |
|
9021 |
||
9022 |
hasASN1AndSelection |
|
9023 |
^ [ self hasSelection value |
|
17416 | 9024 |
and:[self currentSelectedFiles notEmptyOrNil |
4414 | 9025 |
and:[OSI::ASN1Parser notNil |
9026 |
and:[OSI::ASN1Parser isLoaded]]]] |
|
17416 | 9027 |
|
9028 |
"Modified: / 17-02-2017 / 08:25:09 / cg" |
|
3892 | 9029 |
! |
9030 |
||
9031 |
hasCBrowser |
|
9032 |
^ [ CBrowser::Browser notNil ] |
|
9033 |
! |
|
9034 |
||
9035 |
hasJava |
|
9036 |
||
14298 | 9037 |
^ [ JavaVM notNil |
9038 |
and:[JavaClassReader notNil |
|
9039 |
and:[JavaClassReader isLoaded]]] |
|
3892 | 9040 |
! |
9041 |
||
9042 |
hasJavaAndSelection |
|
9043 |
||
12871 | 9044 |
^ [ self currentSelectedFiles notEmptyOrNil |
4414 | 9045 |
and:[JavaClassReader notNil |
9046 |
and:[JavaClassReader isLoaded]]] |
|
3892 | 9047 |
! |
9048 |
||
9049 |
hasMP3Player |
|
9050 |
||
9051 |
^ [ MP3PlayerApplication notNil |
|
4414 | 9052 |
or:[SaugFix::MP3PlayerApplication notNil ]] |
3892 | 9053 |
! |
9054 |
||
9055 |
hasMP3PlayerAndSelection |
|
9056 |
||
12871 | 9057 |
^ [ self currentSelectedFiles notEmptyOrNil |
4414 | 9058 |
and:[ self hasMP3Player value]] |
3892 | 9059 |
! |
9060 |
||
8426 | 9061 |
hasResourceFileSelected |
12871 | 9062 |
^ (self currentSelectedFiles) |
9063 |
contains:[:fn | |
|
12811 | 9064 |
fn suffix asLowercase = 'rs' |
9065 |
]. |
|
8426 | 9066 |
! |
9067 |
||
3892 | 9068 |
hasSlideShow |
9069 |
||
9070 |
^ [CodingExamples_GUI::SlideShow notNil] |
|
9071 |
! |
|
9072 |
||
9073 |
hasSnapshotSelection |
|
9074 |
||
9075 |
^ [ |
|
4414 | 9076 |
| files | |
8426 | 9077 |
|
4414 | 9078 |
files := self currentSelectedFiles. |
9079 |
((files size == 1) |
|
9080 |
and:[ files first hasSuffix:'img' ]) |
|
3892 | 9081 |
] |
9082 |
! |
|
9083 |
||
7869 | 9084 |
hasXml |
9206 | 9085 |
^ [ XML::XMLParser notNil ] |
7869 | 9086 |
! |
9087 |
||
9088 |
hasXmlFileSelected |
|
8611
3d979ab577b7
xml-inspector always enabled.
Claus Gittinger <cg@exept.de>
parents:
8601
diff
changeset
|
9089 |
"/ 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
|
9090 |
"/ then handle the error when it ever fails during xml-parsing. |
7869 | 9091 |
|
8426 | 9092 |
^ [ |
9093 |
|sel fileName| |
|
7869 | 9094 |
|
9095 |
sel := self currentSelectedFiles. |
|
9096 |
sel size == 1 ifTrue:[ |
|
9097 |
fileName := sel first. |
|
9098 |
fileName notNil ifTrue:[ |
|
15936 | 9099 |
#('xml' 'xsd' 'vdx') includes:fileName suffix asLowercase |
7869 | 9100 |
] ifFalse:[ |
9101 |
false |
|
9102 |
] |
|
9103 |
] ifFalse:[ |
|
9104 |
false |
|
9105 |
] |
|
9106 |
] |
|
9107 |
! |
|
9108 |
||
3892 | 9109 |
hasZipFileSelected |
17982 | 9110 |
|sel fileName suff mime| |
9764
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
9111 |
|
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
9112 |
sel := self currentSelectedFiles. |
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
9113 |
sel size == 1 ifFalse:[^ false]. |
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
9114 |
|
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
9115 |
fileName := sel first. |
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
9116 |
fileName isNil ifTrue:[^ false]. |
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
9117 |
|
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
9118 |
suff := fileName suffix asLowercase. |
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
9119 |
(suff = 'zip' or:[suff = 'jar']) ifTrue:[^ true]. |
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
9120 |
|
17982 | 9121 |
mime := fileName mimeTypeOfContents. |
9122 |
"/ prepare for change (iana has obsoleted the x- types) |
|
9123 |
^ (mime = 'application/x-zip-compressed') or:[mime = 'application/zip'] |
|
9764
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
9124 |
|
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
9125 |
"Modified: / 14-02-2011 / 17:17:03 / cg" |
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
9126 |
! |
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
9127 |
|
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
9128 |
hasZipFileSelectedHolder |
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
9129 |
^ [ self hasZipFileSelected ] |
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
9130 |
|
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
9131 |
"Created: / 14-02-2011 / 17:16:08 / cg" |
3892 | 9132 |
! |
9133 |
||
9134 |
javaSupportLoaded |
|
9135 |
||
9136 |
^ false |
|
9137 |
! ! |
|
9138 |
||
14126 | 9139 |
|
9140 |
||
3906 | 9141 |
!AbstractFileBrowser methodsFor:'presentation'! |
9142 |
||
9143 |
getModeString:modeBits |
|
9144 |
"convert file-mode bits into a more user-friendly string. |
|
9145 |
This is wrong here - should be moved into OperatingSystem." |
|
9146 |
||
9147 |
^ self getModeString:modeBits |
|
4414 | 9148 |
with:#( 'owner:' $r $w $x |
9149 |
' group:' $r $w $x |
|
9150 |
' others:' $r $w $x ) |
|
3906 | 9151 |
! |
9152 |
||
9153 |
getModeString:modeBits with:texts |
|
9154 |
"convert file-mode bits into a more user-friendly string. |
|
9155 |
This is wrong here - should be moved into OperatingSystem." |
|
9156 |
||
9157 |
|bits modeString| |
|
9158 |
||
9159 |
bits := modeBits bitAnd:8r777. |
|
9160 |
modeString := ''. |
|
9161 |
||
9162 |
#( nil 8r400 8r200 8r100 nil 8r040 8r020 8r010 nil 8r004 8r002 8r001 ) |
|
9163 |
with: texts do:[:bitMask :access | |
|
4414 | 9164 |
|ch| |
9165 |
||
9166 |
bitMask isNil ifTrue:[ |
|
9167 |
modeString := modeString , access |
|
9168 |
] ifFalse:[ |
|
9169 |
(bits bitAnd:bitMask) == 0 ifTrue:[ |
|
9170 |
ch := $- |
|
9171 |
] ifFalse:[ |
|
9172 |
ch := access |
|
9173 |
]. |
|
9174 |
modeString := modeString copyWith:ch |
|
9175 |
] |
|
3906 | 9176 |
]. |
9177 |
^ modeString |
|
9178 |
! ! |
|
9179 |
||
5880 | 9180 |
!AbstractFileBrowser methodsFor:'private'! |
9181 |
||
9182 |
theSingleSelectedDirectoryOrHomeDir |
|
9183 |
|dir| |
|
9184 |
||
5888 | 9185 |
dir := self theSingleSelectedDirectoryOrNil. |
5880 | 9186 |
dir isNil ifTrue:[ dir := Filename homeDirectory]. |
9187 |
^ dir. |
|
9188 |
! |
|
9189 |
||
9190 |
theSingleSelectedDirectoryOrNil |
|
9191 |
|dirs| |
|
9192 |
||
9193 |
dirs := self currentSelectedDirectories. |
|
9194 |
dirs size ~= 1 ifTrue:[ ^ nil]. |
|
9195 |
^ dirs anElement. |
|
14577 | 9196 |
! |
9197 |
||
9198 |
theSingleSelectedFileOrNil |
|
9199 |
|dirs| |
|
9200 |
||
9201 |
dirs := self currentSelectedFiles. |
|
9202 |
dirs size ~= 1 ifTrue:[ ^ nil]. |
|
9203 |
^ dirs anElement. |
|
5880 | 9204 |
! ! |
9205 |
||
3892 | 9206 |
!AbstractFileBrowser methodsFor:'queries'! |
9207 |
||
8256 | 9208 |
cBrowserLoaded |
9209 |
^ CBrowser::Browser notNil |
|
9210 |
! |
|
9211 |
||
10747
aa57b76e8318
added: #cBrowserMenuItemVisible
Claus Gittinger <cg@exept.de>
parents:
10678
diff
changeset
|
9212 |
cBrowserMenuItemVisible |
aa57b76e8318
added: #cBrowserMenuItemVisible
Claus Gittinger <cg@exept.de>
parents:
10678
diff
changeset
|
9213 |
^ self cBrowserLoaded or:[ OperatingSystem getLoginName = 'cg' ] |
aa57b76e8318
added: #cBrowserMenuItemVisible
Claus Gittinger <cg@exept.de>
parents:
10678
diff
changeset
|
9214 |
|
aa57b76e8318
added: #cBrowserMenuItemVisible
Claus Gittinger <cg@exept.de>
parents:
10678
diff
changeset
|
9215 |
"Created: / 04-10-2011 / 13:40:38 / cg" |
aa57b76e8318
added: #cBrowserMenuItemVisible
Claus Gittinger <cg@exept.de>
parents:
10678
diff
changeset
|
9216 |
! |
aa57b76e8318
added: #cBrowserMenuItemVisible
Claus Gittinger <cg@exept.de>
parents:
10678
diff
changeset
|
9217 |
|
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
9218 |
getAllFilesAsStrings |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
9219 |
"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
|
9220 |
|
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
9221 |
^ self subclassResponsibility |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
9222 |
! |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
9223 |
|
3906 | 9224 |
getFileInfoStringForFirstSelectedFile:longInfo |
9225 |
"get stat info on selected file - return a string which can be |
|
9226 |
shown in a box" |
|
9227 |
||
5973
0baf6c6b685f
#linkInfo now returns the info also for files that are not a symlink
Stefan Vogel <sv@exept.de>
parents:
5971
diff
changeset
|
9228 |
|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
|
9229 |
sizeString fileSize tAccess tModification buffer| |
3906 | 9230 |
|
7560 | 9231 |
selFiles := self currentSelectedObjects. |
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
9232 |
selFiles size ~~ 1 ifTrue:[ ^ nil]. |
3906 | 9233 |
filename := selFiles first. |
9234 |
||
8364 | 9235 |
info := filename linkInfo. |
9111
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
9236 |
info isNil ifTrue:[ |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
9237 |
^ 'Cannot get fileInfo'. |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
9238 |
^ nil |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
9239 |
]. |
8364 | 9240 |
|
5755
5e8165d55605
replaced '' writeStream by String writeStream
Claus Gittinger <cg@exept.de>
parents:
5753
diff
changeset
|
9241 |
buffer := Text writeStream. |
4765 | 9242 |
|
9243 |
buffer |
|
9244 |
nextPutAll:'filename: '; |
|
9245 |
nextPutLine:filename asString. |
|
9246 |
||
8364 | 9247 |
OperatingSystem isMSDOSlike ifTrue: [ |
9248 |
(info alternativeName notNil |
|
9249 |
and:[ info alternativeName ~= info fullName ]) ifTrue:[ |
|
9250 |
buffer nextPutAll:'shortname: '. |
|
9251 |
buffer nextPutLine:info alternativeName. |
|
9252 |
] |
|
9253 |
]. |
|
9254 |
||
5360
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
9255 |
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
|
9256 |
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
|
9257 |
filename exists ifFalse:[ |
5360
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
9258 |
buffer nextPutAll:'broken '. |
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
9259 |
]. |
4765 | 9260 |
buffer |
9261 |
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
|
9262 |
nextPutLine:(info path ? '???'). |
3906 | 9263 |
] 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
|
9264 |
(longInfo and:[info isRegular]) ifTrue:[ |
5360
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
9265 |
fileOutput := filename fileType. |
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
9266 |
]. |
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
9267 |
|
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
9268 |
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
|
9269 |
s := info type asString |
5360
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
9270 |
] ifFalse:[ |
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
9271 |
s := 'regular (' , fileOutput , ')' |
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
9272 |
]. |
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
9273 |
buffer nextPutLine:s. |
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
9274 |
]. |
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
9275 |
|
4707
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
9276 |
fileSize := info fileSize. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
9277 |
sizeString := 'size: ', fileSize printString. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
9278 |
longInfo ifTrue:[ |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
9279 |
fileSize > 1024 ifTrue:[ |
8172 | 9280 |
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
|
9281 |
]. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
9282 |
]. |
4765 | 9283 |
buffer nextPutLine:sizeString. |
3906 | 9284 |
|
9285 |
modeBits := info mode. |
|
9286 |
modeString := self getModeString:modeBits. |
|
4765 | 9287 |
|
9288 |
buffer nextPutAll:'access: '; nextPutAll:modeString. |
|
3906 | 9289 |
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
|
9290 |
buffer nextPutAll:' ('; nextPutAll:(modeBits printStringRadix:8); nextPut:$). |
3906 | 9291 |
]. |
4765 | 9292 |
buffer |
9293 |
cr; |
|
9294 |
nextPutAll:'owner: '; |
|
9295 |
nextPutLine:(OperatingSystem getUserNameFromID:(info uid)). |
|
9296 |
||
3906 | 9297 |
longInfo ifTrue:[ |
4765 | 9298 |
buffer |
9299 |
nextPutAll:'group: '; |
|
9300 |
nextPutLine:(OperatingSystem getGroupNameFromID:(info gid)). |
|
9301 |
||
9302 |
tAccess := info accessTime. |
|
9303 |
buffer |
|
9304 |
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
|
9305 |
nextPutAll:tAccess asDate printString; |
4765 | 9306 |
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
|
9307 |
nextPutLine:tAccess asTime printString. |
4765 | 9308 |
|
9309 |
tModification := info modificationTime. |
|
9310 |
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
|
9311 |
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
|
9312 |
nextPutAll:tModification asDate printString; |
4765 | 9313 |
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
|
9314 |
nextPutLine:tModification asTime printString. |
3906 | 9315 |
]. |
4765 | 9316 |
^ buffer contents |
7560 | 9317 |
|
7633
0a85c590f98f
ignore nil-return from get link name (for broken links)
Claus Gittinger <cg@exept.de>
parents:
7585
diff
changeset
|
9318 |
"Modified: / 07-02-2007 / 10:38:14 / cg" |
3906 | 9319 |
! |
9320 |
||
8510 | 9321 |
hasImageColorHistogram |
9322 |
^ ImageColorHistogram notNil |
|
9323 |
! |
|
9324 |
||
17686 | 9325 |
hasImageHistogram |
9326 |
^ ImageAlgorithms notNil |
|
9327 |
||
9328 |
"Created: / 10-09-2017 / 16:50:34 / cg" |
|
9329 |
! |
|
9330 |
||
10258 | 9331 |
hasSubversionSupport |
11156
11c0b4cbc836
Use Configurable includesFeature:#Feature instead of direct send of #hasFeature
vrany
parents:
11149
diff
changeset
|
9332 |
^ ConfigurableFeatures includesFeature: #SubversionSupport |
10258 | 9333 |
|
9334 |
"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
|
9335 |
"Modified: / 07-09-2011 / 10:41:19 / cg" |
11156
11c0b4cbc836
Use Configurable includesFeature:#Feature instead of direct send of #hasFeature
vrany
parents:
11149
diff
changeset
|
9336 |
"Modified: / 19-01-2012 / 10:43:37 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
10258 | 9337 |
! |
9338 |
||
3892 | 9339 |
initialCommandFor:fileName into:aBox |
9340 |
"set a useful initial command for execute box." |
|
9341 |
||
4496
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
9342 |
self class initialCommandFor:fileName in:Filename currentDirectory intoBox:aBox |
3892 | 9343 |
! |
9344 |
||
9345 |
isAbstractFileBrowser |
|
9346 |
||
9347 |
^ true |
|
9348 |
! |
|
9349 |
||
9350 |
systemIsDOS |
|
9351 |
^ OperatingSystem isMSDOSlike |
|
9352 |
! |
|
9353 |
||
12473 | 9354 |
systemIsOSX |
9355 |
^ OperatingSystem isOSXlike |
|
9356 |
! |
|
9357 |
||
3892 | 9358 |
systemIsUnix |
9359 |
^ OperatingSystem isUNIXlike |
|
14980 | 9360 |
! |
9361 |
||
9362 |
systemSupportsVolumes |
|
9363 |
^ OperatingSystem supportsVolumes |
|
3892 | 9364 |
! ! |
9365 |
||
9366 |
!AbstractFileBrowser methodsFor:'queries-file'! |
|
9367 |
||
9368 |
allItemsOfCurrentDirectory |
|
5009 | 9369 |
self |
4774 | 9370 |
applicationNamed:#DirectoryContentsBrowser |
5009 | 9371 |
ifPresentDo:[:app | ^ app allItemsOfCurrentDirectory]. |
9372 |
||
9373 |
^ nil |
|
3892 | 9374 |
! |
9375 |
||
9376 |
anyFilesPresentWithSuffix:suffix |
|
6725 | 9377 |
self currentSelectedDirectories do:[:dir| |
4636
08b2b63e3107
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4629
diff
changeset
|
9378 |
[ |
5810
4661bf4c3bbf
openErrorSignal arg: always a string
Claus Gittinger <cg@exept.de>
parents:
5789
diff
changeset
|
9379 |
(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
|
9380 |
] on:FileStream openErrorSignal do:[:ex|]. |
3892 | 9381 |
]. |
9382 |
^ false. |
|
9383 |
! |
|
9384 |
||
4771
9290fdb65a5d
#getCommonForCurrentFiles renamed to #commonPrefixOfSelectedFiles
Claus Gittinger <cg@exept.de>
parents:
4769
diff
changeset
|
9385 |
commonPrefixOfSelectedFiles |
4773 | 9386 |
|selFiles stringCol firstPre| |
4771
9290fdb65a5d
#getCommonForCurrentFiles renamed to #commonPrefixOfSelectedFiles
Claus Gittinger <cg@exept.de>
parents:
4769
diff
changeset
|
9387 |
|
7560 | 9388 |
selFiles := self currentSelectedObjects. |
4771
9290fdb65a5d
#getCommonForCurrentFiles renamed to #commonPrefixOfSelectedFiles
Claus Gittinger <cg@exept.de>
parents:
4769
diff
changeset
|
9389 |
selFiles isEmpty ifTrue:[^ nil]. |
9290fdb65a5d
#getCommonForCurrentFiles renamed to #commonPrefixOfSelectedFiles
Claus Gittinger <cg@exept.de>
parents:
4769
diff
changeset
|
9390 |
|
17865 | 9391 |
stringCol := selFiles collect:#asString. |
4773 | 9392 |
firstPre := stringCol at:1. |
4771
9290fdb65a5d
#getCommonForCurrentFiles renamed to #commonPrefixOfSelectedFiles
Claus Gittinger <cg@exept.de>
parents:
4769
diff
changeset
|
9393 |
stringCol from:2 do:[:el| |
4773 | 9394 |
firstPre := firstPre commonPrefixWith:el. |
4771
9290fdb65a5d
#getCommonForCurrentFiles renamed to #commonPrefixOfSelectedFiles
Claus Gittinger <cg@exept.de>
parents:
4769
diff
changeset
|
9395 |
]. |
4773 | 9396 |
^ firstPre asFilename |
7560 | 9397 |
|
9398 |
"Modified: / 04-12-2006 / 13:14:25 / cg" |
|
4771
9290fdb65a5d
#getCommonForCurrentFiles renamed to #commonPrefixOfSelectedFiles
Claus Gittinger <cg@exept.de>
parents:
4769
diff
changeset
|
9399 |
! |
9290fdb65a5d
#getCommonForCurrentFiles renamed to #commonPrefixOfSelectedFiles
Claus Gittinger <cg@exept.de>
parents:
4769
diff
changeset
|
9400 |
|
12481 | 9401 |
compressTabsOnSave |
9402 |
"if true, compress leading spaces (multiples of 8) with a tab character |
|
9403 |
when saving. |
|
9404 |
Default is true" |
|
9405 |
||
9406 |
^ true |
|
9407 |
! |
|
9408 |
||
3892 | 9409 |
currentFilesAreInSameDirectory |
9410 |
||
4881
e6fc72aac6e6
multiple select allowed in DirectoryTreeBrowser some changes in DirectoryContentsBrowser
penk
parents:
4880
diff
changeset
|
9411 |
^ self parentDirectoriesOfCurrentFiles size < 2 |
3892 | 9412 |
! |
9413 |
||
9414 |
currentFilesHasDirectories |
|
9415 |
||
6725 | 9416 |
^ self currentSelectedDirectories notEmpty. |
3892 | 9417 |
! |
9418 |
||
3982 | 9419 |
directoriesForFiles:aFileCol |
11743 | 9420 |
^ aFileCol collect:[:file| self getDirWithoutFileName:file] as:Set. |
3982 | 9421 |
! |
9422 |
||
3892 | 9423 |
fileListIsEmpty |
5009 | 9424 |
self |
9425 |
applicationNamed:#DirectoryContentsBrowser |
|
9426 |
ifPresentDo:[:appl | ^ appl fileListIsEmpty]. |
|
9427 |
||
9428 |
^ nil. |
|
3892 | 9429 |
! |
9430 |
||
9431 |
fileListIsNotEmpty |
|
9432 |
||
9433 |
^ self fileListIsEmpty not. |
|
9434 |
! |
|
9435 |
||
9436 |
fileName:aFilename1 startsWith:aFilename2 |
|
6284 | 9437 |
" check if aFilename2 is a prefix of aFilename1" |
3892 | 9438 |
|
9439 |
| file1 file2 | |
|
9440 |
||
6284 | 9441 |
(aFilename2 isNil or:[aFilename1 isNil]) ifTrue:[ ^ false]. |
3892 | 9442 |
file1 := aFilename1 asFilename. |
9443 |
file2 := aFilename2 asFilename. |
|
6284 | 9444 |
|
3892 | 9445 |
file2 isRootDirectory ifTrue:[ ^ true]. |
6284 | 9446 |
|
3892 | 9447 |
((file1 isDirectory) |
9448 |
and:[(file2 isDirectory) |
|
9449 |
and:[file1 directory = file2 directory]]) ifTrue:[ |
|
4414 | 9450 |
^ file1 baseName = file2 baseName |
3892 | 9451 |
]. |
3982 | 9452 |
^ (file1 pathName) startsWith:(file2 pathName) |
3892 | 9453 |
! |
9454 |
||
9455 |
getAllFilesAsStringCollection |
|
5009 | 9456 |
self |
9457 |
applicationNamed:#DirectoryContentsBrowser |
|
9458 |
ifPresentDo:[:appl | ^ appl getAllFilesAsStringCollection]. |
|
9459 |
||
9460 |
^ nil |
|
3892 | 9461 |
! |
9462 |
||
9463 |
getBestDirectory |
|
17868 | 9464 |
"from a set of directories, return the common parent directory" |
9465 |
||
9466 |
^ self class getBestDirectoryFrom:(self currentSelectedDirectories) |
|
3892 | 9467 |
! |
9468 |
||
9469 |
getDirWithoutFileName:aFileName |
|
9470 |
||
9471 |
| dir | |
|
9472 |
aFileName isNil ifTrue:[ |
|
4414 | 9473 |
^ aFileName. |
3892 | 9474 |
]. |
9475 |
dir := aFileName asFilename. |
|
9476 |
dir isDirectory ifFalse:[ |
|
4414 | 9477 |
dir := dir directory. |
3892 | 9478 |
]. |
9479 |
^ dir. |
|
9480 |
! |
|
9481 |
||
9482 |
getInfoItem |
|
9483 |
"get filename of a description-file (.dir.info, README etc.); |
|
16778 | 9484 |
This file is automatically shown when a directory is entered. |
3892 | 9485 |
You can add more names below if you like." |
9486 |
||
5880 | 9487 |
|dir| |
9488 |
||
9489 |
dir := self theSingleSelectedDirectoryOrNil. |
|
9490 |
dir isNil ifTrue:[ ^ nil]. |
|
3892 | 9491 |
|
16778 | 9492 |
#( |
3892 | 9493 |
'.dir.info' |
9494 |
'README' |
|
9495 |
'ReadMe' |
|
9496 |
'Readme' |
|
9497 |
'readme' |
|
9498 |
'read.me' |
|
9499 |
'Read.me' |
|
9500 |
'READ.ME' |
|
9501 |
'README.TXT' |
|
15915 | 9502 |
'README.txt' |
3892 | 9503 |
'readme.txt' |
9504 |
'Readme.txt' |
|
9505 |
'Info.txt' |
|
9506 |
'info.txt' |
|
9507 |
'INFO.TXT' |
|
15915 | 9508 |
'INFO.txt' |
16778 | 9509 |
) do:[:f | |
5883 | 9510 |
|n| |
4414 | 9511 |
|
5880 | 9512 |
n := dir construct:f. |
4414 | 9513 |
(n isReadable and:[n isDirectory not]) ifTrue:[ |
9514 |
^ DirectoryContentsBrowser itemClass fileName:n |
|
9515 |
] |
|
3892 | 9516 |
]. |
9517 |
^ nil |
|
4881
e6fc72aac6e6
multiple select allowed in DirectoryTreeBrowser some changes in DirectoryContentsBrowser
penk
parents:
4880
diff
changeset
|
9518 |
! |
e6fc72aac6e6
multiple select allowed in DirectoryTreeBrowser some changes in DirectoryContentsBrowser
penk
parents:
4880
diff
changeset
|
9519 |
|
12497 | 9520 |
hasPackageDirectorySelected |
9521 |
|dir| |
|
9522 |
||
9523 |
dir := self currentDirectory. |
|
9524 |
^ dir notNil |
|
9525 |
and:[ dir exists |
|
9526 |
and:[ (dir / 'abbrev.stc') exists ]] |
|
9527 |
! |
|
9528 |
||
4881
e6fc72aac6e6
multiple select allowed in DirectoryTreeBrowser some changes in DirectoryContentsBrowser
penk
parents:
4880
diff
changeset
|
9529 |
parentDirectoriesOfCurrentFiles |
11743 | 9530 |
^ self currentSelectedObjects |
9531 |
collect:[:file | file directory] as:Set |
|
7560 | 9532 |
|
9533 |
"Modified: / 04-12-2006 / 13:15:21 / cg" |
|
6521 | 9534 |
! |
9535 |
||
9536 |
recursiveAnyFilesPresentWithSuffix:suffix |
|
6652 | 9537 |
^ true. "/ the code below is too slow for a menu enabling operation |
9538 |
||
9539 |
"/ |directories| |
|
9540 |
"/ |
|
9541 |
"/ directories := self currentDirectories value. |
|
9542 |
"/ directories do:[:dir| |
|
9543 |
"/ [ |
|
9544 |
"/ dir recursiveDirectoryContentsDo:[:f | |
|
9545 |
"/ (f asFilename suffix = suffix) ifTrue:[ ^ true] |
|
9546 |
"/ ] |
|
9547 |
"/ ] on:FileStream openErrorSignal do:[:ex|]. |
|
9548 |
"/ ]. |
|
9549 |
"/ ^ false. |
|
6586 | 9550 |
! |
9551 |
||
9552 |
recursiveAnySTFilesPresent |
|
9553 |
^ self recursiveAnyFilesPresentWithSuffix:'st' |
|
3982 | 9554 |
! ! |
9555 |
||
9556 |
!AbstractFileBrowser methodsFor:'selection'! |
|
9557 |
||
9558 |
currentSelectedDirectories |
|
6725 | 9559 |
^ self currentDirectoriesValue. |
3982 | 9560 |
! |
9561 |
||
9562 |
currentSelectedFiles |
|
17865 | 9563 |
^ self currentSelectedObjects reject:#isDirectory. |
7560 | 9564 |
|
9565 |
"Modified: / 04-12-2006 / 13:14:39 / cg" |
|
3982 | 9566 |
! |
9567 |
||
6460 | 9568 |
currentSelectedObjects |
9569 |
^ self currentFileNameHolder value |
|
9570 |
! |
|
9571 |
||
3982 | 9572 |
firstSelectedFile |
7560 | 9573 |
^ self currentSelectedObjects |
12102 | 9574 |
detect:[:file | (file ? '') asFilename isDirectory not] |
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
9575 |
ifNone:[]. |
7560 | 9576 |
|
9577 |
"Modified: / 04-12-2006 / 13:14:50 / cg" |
|
4414 | 9578 |
! |
9579 |
||
9490 | 9580 |
hasOnlyDirectoriesSelected |
9581 |
^ self currentSelectedObjects conform:[:file | file isDirectory]. |
|
9582 |
||
9583 |
"Created: / 20-05-2010 / 10:45:03 / cg" |
|
9584 |
! |
|
9585 |
||
4414 | 9586 |
hasOnlyFilesSelected |
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
9587 |
|
7560 | 9588 |
^ self currentSelectedObjects conform:[:file | file isDirectory not]. |
9589 |
||
9590 |
"Modified: / 04-12-2006 / 13:15:01 / cg" |
|
4414 | 9591 |
! |
9592 |
||
9490 | 9593 |
hasTwoDirectoriesSelected |
9594 |
||
9595 |
^ self currentSelectedObjects size == 2 |
|
9596 |
and:[self hasOnlyDirectoriesSelected] |
|
9597 |
||
9598 |
"Created: / 20-05-2010 / 10:45:18 / cg" |
|
9599 |
! |
|
9600 |
||
4414 | 9601 |
hasTwoFilesSelected |
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
9602 |
|
7560 | 9603 |
^ self currentSelectedObjects size == 2 |
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
9604 |
and:[self hasOnlyFilesSelected] |
7560 | 9605 |
|
9606 |
"Modified: / 04-12-2006 / 13:15:04 / cg" |
|
14577 | 9607 |
! |
9608 |
||
9609 |
selectNextFile |
|
9610 |
self |
|
9611 |
applicationNamed:#DirectoryContentsBrowser |
|
9612 |
ifPresentDo:[:appl | appl ~~ self ifTrue:[ appl selectNextFile ]]. |
|
9613 |
! |
|
9614 |
||
9615 |
selectPreviousFile |
|
9616 |
self |
|
9617 |
applicationNamed:#DirectoryContentsBrowser |
|
9618 |
ifPresentDo:[:appl | appl ~~ self ifTrue:[ appl selectPreviousFile ]]. |
|
3892 | 9619 |
! ! |
9620 |
||
3964 | 9621 |
!AbstractFileBrowser methodsFor:'sorting'! |
9622 |
||
3989 | 9623 |
currentSortOrder |
17790 | 9624 |
^ self |
9625 |
aspectFor:#currentSortOrder |
|
9626 |
ifAbsent:[ |
|
9627 |
(Dictionary new |
|
9628 |
at:#column put:nil; |
|
9629 |
at:#reverse put:false; |
|
9630 |
at:#sortCaseless put:false; |
|
9631 |
yourself |
|
9632 |
) asValue |
|
9633 |
]. |
|
9634 |
||
9635 |
"Modified: / 25-11-2017 / 17:43:00 / cg" |
|
3989 | 9636 |
! |
9637 |
||
9638 |
sortBlockHolder |
|
9639 |
^ self aspectFor:#sortBlockHolder ifAbsent:[ |
|
5383 | 9640 |
(FileSorter directoriesBeforeFiles:(self sortDirectoriesBeforeFiles value and:[self viewDirsInContentsBrowser value]) |
9641 |
selector:#fileName |
|
9642 |
sortCaseless:self sortCaseless value |
|
9643 |
sortReverse:false) asValue. |
|
3989 | 9644 |
]. |
9645 |
! |
|
9646 |
||
9647 |
sortBlockProperty |
|
6785
cac8107d889c
clear reverseSort flag, when sort-order is changed via menu.
Claus Gittinger <cg@exept.de>
parents:
6767
diff
changeset
|
9648 |
|v| |
4027 | 9649 |
|
6785
cac8107d889c
clear reverseSort flag, when sort-order is changed via menu.
Claus Gittinger <cg@exept.de>
parents:
6767
diff
changeset
|
9650 |
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
|
9651 |
v addDependent:self. |
cac8107d889c
clear reverseSort flag, when sort-order is changed via menu.
Claus Gittinger <cg@exept.de>
parents:
6767
diff
changeset
|
9652 |
^ v. |
3989 | 9653 |
! |
9654 |
||
9655 |
sortCaseless |
|
4201 | 9656 |
" aspect for sort caseless " |
3989 | 9657 |
|
13000 | 9658 |
^ self |
9659 |
aspectFor:#sortCaseless |
|
9660 |
ifAbsent:[ (Filename isCaseSensitive not) asValue ] |
|
3989 | 9661 |
! |
9662 |
||
4074 | 9663 |
sortDirectoriesBeforeFiles |
9664 |
||
4201 | 9665 |
" aspect for sort directories always before files" |
4074 | 9666 |
^ self aspectFor:#sortDirectoriesBeforeFiles ifAbsent:[ true asValue ]. |
9667 |
! |
|
9668 |
||
3989 | 9669 |
sortFileListsBy:instanceName |
9670 |
||
9671 |
self sortFileListsBy:instanceName withReverse:true |
|
9672 |
! |
|
9673 |
||
9674 |
sortFileListsBy:instanceName withReverse:aBoolean |
|
8994
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
9675 |
| aSymbol sortCaselessLocal currentSortOrder sorter isReverse| |
3964 | 9676 |
|
9677 |
aSymbol := instanceName asSymbol. |
|
4027 | 9678 |
self sortBlockProperty setValue:instanceName asSymbol. |
4151 | 9679 |
sortCaselessLocal := self sortCaseless value. |
4027 | 9680 |
currentSortOrder := self currentSortOrder value. |
17790 | 9681 |
|
7841
ea9a45f1cd5e
oops - repair bad currentSorter
Claus Gittinger <cg@exept.de>
parents:
7829
diff
changeset
|
9682 |
currentSortOrder isEmptyOrNil ifTrue:[ |
ea9a45f1cd5e
oops - repair bad currentSorter
Claus Gittinger <cg@exept.de>
parents:
7829
diff
changeset
|
9683 |
self currentSortOrder value:(currentSortOrder := Dictionary new). |
4343 | 9684 |
currentSortOrder at:#column put:aSymbol. |
9685 |
currentSortOrder at:#reverse put:false. |
|
9686 |
currentSortOrder at:#sortCaseless put:sortCaselessLocal. |
|
3964 | 9687 |
] ifFalse:[ |
4343 | 9688 |
(currentSortOrder at:#sortCaseless) ~= sortCaselessLocal ifTrue:[ |
9689 |
"/ sort caseless changed |
|
9690 |
currentSortOrder at:#sortCaseless put:sortCaselessLocal. |
|
9691 |
] ifFalse:[ |
|
9692 |
(currentSortOrder at:#column) = aSymbol ifTrue:[ |
|
9693 |
"/ same column like before - change sort order ifReverse is true |
|
9694 |
aBoolean ifTrue:[ |
|
9695 |
isReverse := currentSortOrder at:#reverse. |
|
9696 |
currentSortOrder at:#reverse put:(isReverse not). |
|
9697 |
]. |
|
9698 |
] ifFalse:[ |
|
9699 |
"/ another column - remark column |
|
9700 |
currentSortOrder at:#column put:aSymbol. |
|
9701 |
] |
|
9702 |
] |
|
3964 | 9703 |
]. |
4027 | 9704 |
self currentSortOrder changed. |
9111
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
9705 |
|
5383 | 9706 |
sorter := FileSorter directoriesBeforeFiles:(self sortDirectoriesBeforeFiles value and:[self viewDirsInContentsBrowser value]) |
9707 |
selector:instanceName |
|
9708 |
sortCaseless:sortCaselessLocal |
|
9709 |
sortReverse:(currentSortOrder at:#reverse). |
|
9710 |
self sortBlockHolder value:sorter. |
|
7841
ea9a45f1cd5e
oops - repair bad currentSorter
Claus Gittinger <cg@exept.de>
parents:
7829
diff
changeset
|
9711 |
|
ea9a45f1cd5e
oops - repair bad currentSorter
Claus Gittinger <cg@exept.de>
parents:
7829
diff
changeset
|
9712 |
"Modified: / 18-09-2007 / 09:42:47 / cg" |
17790 | 9713 |
"Modified (format): / 25-11-2017 / 17:43:31 / cg" |
3964 | 9714 |
! ! |
9715 |
||
3892 | 9716 |
!AbstractFileBrowser methodsFor:'startup & release'! |
9717 |
||
16720 | 9718 |
initializeAspects |
9719 |
aspects := IdentityDictionary new. |
|
9720 |
aspects at:#applications put:(IdentityDictionary new). |
|
9721 |
! |
|
9722 |
||
3892 | 9723 |
makeDependent |
4074 | 9724 |
self filterModel addDependent:self. |
4004 | 9725 |
self currentFileNameHolder addDependent:self. |
4074 | 9726 |
self sortDirectoriesBeforeFiles addDependent:self. |
4004 | 9727 |
self sortCaseless addDependent:self. |
4011 | 9728 |
self showHiddenFiles addDependent:self. |
4368
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
9729 |
self rootHolder addDependent:self. |
3892 | 9730 |
! |
9731 |
||
9732 |
masterApplication:anApplication |
|
9733 |
||
9734 |
masterApplication isNil ifTrue:[ |
|
4414 | 9735 |
(anApplication notNil and:[anApplication askFor:#isAbstractFileBrowser]) ifTrue:[ |
9736 |
aspects := anApplication aspects |
|
9737 |
] ifFalse:[ |
|
9738 |
aspects isNil ifTrue:[ |
|
16721 | 9739 |
self initializeAspects. |
4414 | 9740 |
] |
9741 |
]. |
|
9742 |
self applications at:(self className) put:self. |
|
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
9743 |
"/ self makeDependent. |
3892 | 9744 |
]. |
3952 | 9745 |
^ super masterApplication:anApplication. |
3892 | 9746 |
! |
9747 |
||
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
9748 |
postBuildWith:aBuilder |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
9749 |
self makeDependent. |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
9750 |
super postBuildWith:aBuilder. |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
9751 |
! |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
9752 |
|
3892 | 9753 |
postOpenWith:aBuilder |
9754 |
||
9755 |
super postOpenWith:aBuilder. |
|
14655 | 9756 |
"/ now done for all windowGroups by the group itself |
9757 |
"/ self windowGroup showWaitCursorWhenBusyForMillis:100. |
|
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
9758 |
|
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
9759 |
"Modified: / 25-07-2006 / 09:12:45 / cg" |
3892 | 9760 |
! ! |
9761 |
||
9762 |
!AbstractFileBrowser::Clipboard methodsFor:'accessing'! |
|
9763 |
||
9764 |
files |
|
9765 |
"return the value of the instance variable 'files' (automatically generated)" |
|
9766 |
||
9767 |
^ files |
|
9768 |
! |
|
9769 |
||
9770 |
files:something |
|
9771 |
"set the value of the instance variable 'files' (automatically generated)" |
|
9772 |
||
9773 |
files := something. |
|
9774 |
! |
|
9775 |
||
9776 |
method |
|
9777 |
"return the value of the instance variable 'method' (automatically generated)" |
|
9778 |
||
9779 |
^ method |
|
9780 |
! |
|
9781 |
||
9782 |
method:something |
|
9783 |
"set the value of the instance variable 'method' (automatically generated)" |
|
9784 |
||
9785 |
method := something. |
|
9786 |
! ! |
|
9787 |
||
9788 |
!AbstractFileBrowser::CodeExecutionLock methodsFor:'accessing'! |
|
9789 |
||
9790 |
locked |
|
9791 |
"return the value of the instance variable 'locked' (automatically generated)" |
|
9792 |
||
9793 |
locked isNil ifTrue:[ |
|
4414 | 9794 |
locked := false. |
3892 | 9795 |
]. |
9796 |
^ locked |
|
9797 |
! ! |
|
9798 |
||
9799 |
!AbstractFileBrowser::CodeExecutionLock methodsFor:'actions'! |
|
9800 |
||
9801 |
doIfUnLocked:aBlock |
|
9802 |
||
9803 |
self locked ifFalse:[ |
|
4414 | 9804 |
aBlock value. |
3892 | 9805 |
]. |
9806 |
! |
|
9807 |
||
9808 |
doLocked:aBlock |
|
9809 |
||
9810 |
locked := true. |
|
4004 | 9811 |
aBlock ensure:[ |
4414 | 9812 |
locked := false. |
4004 | 9813 |
] |
3892 | 9814 |
! ! |
9815 |
||
3952 | 9816 |
!AbstractFileBrowser::DirectoryHistory class methodsFor:'defaults'! |
9817 |
||
6369 | 9818 |
defaultHistorySize |
9819 |
^ 50 |
|
3892 | 9820 |
! ! |
9821 |
||
6371 | 9822 |
!AbstractFileBrowser::DirectoryHistory class methodsFor:'instance creation'! |
4032 | 9823 |
|
9824 |
new |
|
6371 | 9825 |
^ (super new) initializeHistory. |
6369 | 9826 |
! ! |
9827 |
||
9828 |
!AbstractFileBrowser::DirectoryHistory methodsFor:'accessing'! |
|
9829 |
||
9830 |
historySize |
|
9831 |
historySize isNil ifTrue:[^ self class defaultHistorySize]. |
|
9832 |
^ historySize |
|
9833 |
! |
|
9834 |
||
9835 |
historySize:aNumber |
|
9836 |
historySize := aNumber |
|
4032 | 9837 |
! ! |
9838 |
||
3892 | 9839 |
!AbstractFileBrowser::DirectoryHistory methodsFor:'actions'! |
9840 |
||
3952 | 9841 |
addToHistory:aPath |
15803 | 9842 |
| item pathToAdd sep| |
7566
3e92cf7a6706
ignore trailing file-separator in history.
Claus Gittinger <cg@exept.de>
parents:
7565
diff
changeset
|
9843 |
|
3e92cf7a6706
ignore trailing file-separator in history.
Claus Gittinger <cg@exept.de>
parents:
7565
diff
changeset
|
9844 |
pathToAdd := aPath. |
15803 | 9845 |
(pathToAdd endsWith:(sep := Filename separator)) ifTrue:[ |
7566
3e92cf7a6706
ignore trailing file-separator in history.
Claus Gittinger <cg@exept.de>
parents:
7565
diff
changeset
|
9846 |
pathToAdd asFilename isRootDirectory ifFalse:[ |
15803 | 9847 |
pathToAdd := pathToAdd copyButLast:(sep asString size). |
7566
3e92cf7a6706
ignore trailing file-separator in history.
Claus Gittinger <cg@exept.de>
parents:
7565
diff
changeset
|
9848 |
] |
3e92cf7a6706
ignore trailing file-separator in history.
Claus Gittinger <cg@exept.de>
parents:
7565
diff
changeset
|
9849 |
]. |
3e92cf7a6706
ignore trailing file-separator in history.
Claus Gittinger <cg@exept.de>
parents:
7565
diff
changeset
|
9850 |
|
3e92cf7a6706
ignore trailing file-separator in history.
Claus Gittinger <cg@exept.de>
parents:
7565
diff
changeset
|
9851 |
item := self getItemFor:pathToAdd. |
3e92cf7a6706
ignore trailing file-separator in history.
Claus Gittinger <cg@exept.de>
parents:
7565
diff
changeset
|
9852 |
self backForwardListAdd:pathToAdd. |
3952 | 9853 |
item isNil ifTrue:[ |
4347 | 9854 |
" not already in history" |
6369 | 9855 |
self size >= self historySize ifTrue:[ |
4347 | 9856 |
self removeLast. |
9857 |
]. |
|
7566
3e92cf7a6706
ignore trailing file-separator in history.
Claus Gittinger <cg@exept.de>
parents:
7565
diff
changeset
|
9858 |
item := DirectoryHistoryItem path:pathToAdd. |
3952 | 9859 |
] ifFalse:[ |
4347 | 9860 |
"already been there before; move the entry to |
9861 |
the beginning, so it will fall out later." |
|
9862 |
self remove:item. |
|
10381
ad4b61b0b2fd
duplicate code in if refactored
Claus Gittinger <cg@exept.de>
parents:
10306
diff
changeset
|
9863 |
]. |
ad4b61b0b2fd
duplicate code in if refactored
Claus Gittinger <cg@exept.de>
parents:
10306
diff
changeset
|
9864 |
self addFirst:item |
ad4b61b0b2fd
duplicate code in if refactored
Claus Gittinger <cg@exept.de>
parents:
10306
diff
changeset
|
9865 |
|
ad4b61b0b2fd
duplicate code in if refactored
Claus Gittinger <cg@exept.de>
parents:
10306
diff
changeset
|
9866 |
"Modified: / 24-07-2011 / 07:12:54 / cg" |
3952 | 9867 |
! |
9868 |
||
4347 | 9869 |
backForwardListAdd:aPath |
9870 |
|pathIndex| |
|
9871 |
||
9872 |
pathIndex := backForwardList indexOf:aPath. |
|
9873 |
pathIndex == 0 ifTrue:[ |
|
9874 |
" a new path comes in remove forward paths " |
|
9875 |
(backForwardList size) > backForwardIndex ifTrue:[ |
|
9876 |
backForwardList removeFromIndex:(backForwardIndex + 1) toIndex:(backForwardList size). |
|
9877 |
]. |
|
9878 |
] ifFalse:[ |
|
9879 |
backForwardList remove:aPath. |
|
9880 |
pathIndex <= backForwardIndex ifTrue:[ |
|
9881 |
backForwardIndex := backForwardIndex - 1. |
|
9882 |
] |
|
4022 | 9883 |
]. |
4347 | 9884 |
backForwardList add:aPath afterIndex:backForwardIndex. |
9885 |
backForwardIndex := backForwardIndex + 1. |
|
6369 | 9886 |
backForwardIndex > self historySize ifTrue:[ |
4347 | 9887 |
backForwardList removeFirst. |
9888 |
backForwardIndex := backForwardIndex - 1. |
|
3892 | 9889 |
]. |
4347 | 9890 |
! |
9891 |
||
9892 |
goBackward |
|
4288 | 9893 |
"return the first path of the backward list; |
9894 |
remove it from the back list and add it ti the forward list." |
|
4022 | 9895 |
|
4347 | 9896 |
|retPath| |
9897 |
||
9898 |
self canBackward ifTrue:[ |
|
9899 |
retPath := backForwardList at:(backForwardIndex - 1). |
|
9900 |
backForwardIndex := backForwardIndex - 1. |
|
4288 | 9901 |
]. |
4022 | 9902 |
^ retPath. |
9903 |
! |
|
9904 |
||
9905 |
goForward |
|
4288 | 9906 |
"return the first path of the forward list; |
9907 |
remove it from the list." |
|
4022 | 9908 |
|
4347 | 9909 |
|retPath| |
9910 |
||
9911 |
self canForward ifTrue:[ |
|
9912 |
retPath := backForwardList at:backForwardIndex + 1. |
|
9913 |
backForwardIndex := backForwardIndex + 1. |
|
4288 | 9914 |
]. |
4022 | 9915 |
^ retPath. |
9916 |
! |
|
9917 |
||
9918 |
resetForwardBackward |
|
9919 |
||
4347 | 9920 |
self initialize |
4022 | 9921 |
! |
9922 |
||
9923 |
setPosition:aPosition for:aPath |
|
9924 |
||
9925 |
self do:[:item| |
|
4414 | 9926 |
item path = aPath ifTrue:[ |
9927 |
item position:aPosition. |
|
9928 |
] |
|
4022 | 9929 |
]. |
3892 | 9930 |
! ! |
9931 |
||
4870 | 9932 |
!AbstractFileBrowser::DirectoryHistory methodsFor:'initialization'! |
4032 | 9933 |
|
6371 | 9934 |
initializeHistory |
4032 | 9935 |
|
4347 | 9936 |
backForwardList := OrderedCollection new. |
9937 |
self reverseDo:[:el| |
|
9938 |
backForwardList add:el path. |
|
9939 |
]. |
|
9940 |
backForwardIndex := backForwardList size. |
|
4032 | 9941 |
! ! |
9942 |
||
3892 | 9943 |
!AbstractFileBrowser::DirectoryHistory methodsFor:'queries'! |
9944 |
||
4288 | 9945 |
canBackward |
4347 | 9946 |
|
9947 |
^ backForwardIndex > 1 |
|
4288 | 9948 |
! |
9949 |
||
3892 | 9950 |
canForward |
4347 | 9951 |
|
9952 |
^ (backForwardList size >= (backForwardIndex + 1)) |
|
9953 |
! |
|
9954 |
||
9955 |
getBackCollection |
|
9956 |
||
9957 |
| backCol | |
|
9958 |
||
9959 |
backCol := OrderedCollection new. |
|
9960 |
self canBackward ifTrue:[ |
|
9961 |
| tmpCol | |
|
9962 |
tmpCol := backForwardList copyTo:backForwardIndex - 1. |
|
9963 |
tmpCol reverseDo:[ :el| |
|
9964 |
backCol add:el. |
|
9965 |
] |
|
9966 |
]. |
|
9967 |
^ backCol |
|
3952 | 9968 |
! |
9969 |
||
9970 |
getForwardCollection |
|
9971 |
||
4347 | 9972 |
| forwCol | |
9973 |
||
9974 |
forwCol := OrderedCollection new. |
|
9975 |
self canForward ifTrue:[ |
|
9976 |
forwCol := backForwardList copyFrom:(backForwardIndex + 1) |
|
9977 |
]. |
|
9978 |
^ forwCol |
|
3952 | 9979 |
! |
9980 |
||
9981 |
getItemFor:aPath |
|
6627 | 9982 |
^ self detect:[:item| item path = aPath] ifNone:nil. |
9983 |
"/ self do:[:item| item path = aPath ifTrue:[^ item]]. |
|
9984 |
"/ ^ nil. |
|
3952 | 9985 |
! |
9986 |
||
9987 |
getPositionFor:aPath |
|
9988 |
||
9989 |
|item| |
|
9990 |
||
9991 |
item := self getItemFor:aPath. |
|
9992 |
||
9993 |
item notNil ifTrue:[ |
|
4414 | 9994 |
^ item position. |
3952 | 9995 |
]. |
9996 |
^ nil |
|
9997 |
! |
|
9998 |
||
9999 |
includesPath:aPath |
|
6627 | 10000 |
^ self contains:[:item | item path = aPath]. |
10001 |
||
10002 |
"/ self do:[:item| item path = aPath ifTrue:[^ true]]. |
|
10003 |
"/ ^ false. |
|
4347 | 10004 |
! |
10005 |
||
10006 |
nextBackwardItem |
|
10007 |
"return the first path of the backward list" |
|
10008 |
||
10009 |
|retPath| |
|
10010 |
||
10011 |
self canBackward ifTrue:[ |
|
10012 |
retPath := backForwardList at:backForwardIndex. |
|
10013 |
]. |
|
10014 |
^ retPath. |
|
10015 |
! |
|
10016 |
||
10017 |
nextForwardItem |
|
10018 |
"return the first path of the forward list" |
|
10019 |
||
10020 |
|retPath| |
|
10021 |
||
10022 |
self canForward ifTrue:[ |
|
10023 |
retPath := backForwardList at:backForwardIndex + 1. |
|
10024 |
]. |
|
10025 |
^ retPath. |
|
3952 | 10026 |
! ! |
10027 |
||
10028 |
!AbstractFileBrowser::DirectoryHistory::DirectoryHistoryItem class methodsFor:'instance creation'! |
|
10029 |
||
10030 |
path:aPath |
|
10031 |
||
10032 |
^ self new path:aPath |
|
10033 |
! ! |
|
10034 |
||
10035 |
!AbstractFileBrowser::DirectoryHistory::DirectoryHistoryItem methodsFor:'accessing'! |
|
10036 |
||
6433 | 10037 |
asFilename |
10038 |
^ path asFilename |
|
10039 |
! |
|
10040 |
||
3952 | 10041 |
path |
10042 |
"return the value of the instance variable 'path' (automatically generated)" |
|
10043 |
||
10044 |
^ path |
|
10045 |
! |
|
10046 |
||
10047 |
path:something |
|
10048 |
"set the value of the instance variable 'path' (automatically generated)" |
|
10049 |
||
10050 |
path := something. |
|
10051 |
! |
|
10052 |
||
10053 |
position |
|
10054 |
"return the value of the instance variable 'position' (automatically generated)" |
|
10055 |
||
10056 |
^ position |
|
10057 |
! |
|
10058 |
||
10059 |
position:something |
|
10060 |
"set the value of the instance variable 'position' (automatically generated)" |
|
10061 |
||
10062 |
position := something. |
|
10063 |
! |
|
10064 |
||
10065 |
printString |
|
10066 |
||
10067 |
^ self path asString |
|
3892 | 10068 |
! ! |
10069 |
||
10070 |
!AbstractFileBrowser::SaveAspectItem class methodsFor:'instance creation'! |
|
10071 |
||
10072 |
withValue:aValue isHolder:aBoolean |
|
10073 |
||
10074 |
| instance | |
|
10075 |
||
10076 |
instance := self basicNew. |
|
10077 |
instance value:aValue. |
|
10078 |
instance isHolder:aBoolean. |
|
10079 |
^ instance |
|
10080 |
! ! |
|
10081 |
||
10082 |
!AbstractFileBrowser::SaveAspectItem methodsFor:'accessing'! |
|
10083 |
||
10084 |
isHolder |
|
10085 |
"return the value of the instance variable 'isHolder' (automatically generated)" |
|
10086 |
||
10087 |
^ isHolder |
|
10088 |
! |
|
10089 |
||
10090 |
isHolder:something |
|
10091 |
"set the value of the instance variable 'isHolder' (automatically generated)" |
|
10092 |
||
10093 |
isHolder := something. |
|
10094 |
! |
|
10095 |
||
10096 |
value |
|
10097 |
"return the value of the instance variable 'value' (automatically generated)" |
|
10098 |
||
10099 |
^ value |
|
10100 |
! |
|
10101 |
||
10102 |
value:something |
|
10103 |
"set the value of the instance variable 'value' (automatically generated)" |
|
10104 |
||
10105 |
value := something. |
|
10106 |
! ! |
|
10107 |
||
10108 |
!AbstractFileBrowser class methodsFor:'documentation'! |
|
10109 |
||
10305
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
10110 |
version |
15803 | 10111 |
^ '$Header$' |
10305
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
10112 |
! |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
10113 |
|
8832 | 10114 |
version_CVS |
15803 | 10115 |
^ '$Header$' |
3892 | 10116 |
! ! |
12094 | 10117 |