author | Claus Gittinger <cg@exept.de> |
Fri, 15 Jun 2018 04:00:37 +0200 | |
changeset 18220 | d1ebaddf1100 |
parent 18175 | 403729a65fe5 |
child 18246 | 1217eb5963fc |
permissions | -rw-r--r-- |
18036 | 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 |
|
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
441 |
cmd := MIMETypes defaultCommandPerMIME at:mime ifAbsent:nil. |
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 |
|
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
553 |
"Modified: / 24.9.1997 / 16:34:52 / stefan" |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
554 |
"Modified: / 9.4.1998 / 17:15:57 / cg" |
3892 | 555 |
! |
556 |
||
5941 | 557 |
listOfRuntimeValuesToRemember |
558 |
" list of all aspects that will be remembered after closing a FileBrowserV2" |
|
559 |
||
560 |
^ #( |
|
561 |
"/ #filterModel |
|
562 |
#enableFileHistory |
|
563 |
#fileHistory |
|
564 |
#currentSortOrder |
|
565 |
#sortBlockProperty |
|
566 |
) |
|
3892 | 567 |
! |
568 |
||
569 |
resetAspects |
|
570 |
||
571 |
RuntimeAspects := nil. |
|
572 |
||
5941 | 573 |
" |
574 |
self resetAspects |
|
575 |
" |
|
3892 | 576 |
! |
577 |
||
578 |
runtimeAspects |
|
579 |
||
580 |
RuntimeAspects isNil ifTrue:[ |
|
4414 | 581 |
RuntimeAspects := Dictionary new. |
3892 | 582 |
]. |
583 |
^ RuntimeAspects |
|
584 |
! |
|
585 |
||
4201 | 586 |
userPreferencesAspectList |
587 |
" list of all aspects that will be saved with save settings |
|
588 |
that aspects will be image consistent if the settings are saved in Launcher |
|
11501 | 589 |
don't forget to add a access methods in UserPreferences if you add a aspect here |
4201 | 590 |
" |
591 |
||
7078
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
592 |
^ Dictionary |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
593 |
withKeysAndValues:#( |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
594 |
viewDirsInContentsBrowser true |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
595 |
showDirectoryTree true |
11501 | 596 |
showHiddenFiles true |
7078
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
597 |
viewDescription false |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
598 |
viewDetails true |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
599 |
viewDirectoryDescription false |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
600 |
viewFilesInDirectoryTree false |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
601 |
viewGroup false |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
602 |
viewOwner false |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
603 |
viewPermissions false |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
604 |
viewPreview false |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
605 |
viewSize true |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
606 |
viewSizeInKiloBytes false |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
607 |
viewSizeInBytes false |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
608 |
viewTime true |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
609 |
viewType false |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
610 |
openMultipleApplicationsForType false |
7788 | 611 |
filenameEntryFieldVisibleHolder true |
612 |
toolBarVisibleHolder true |
|
7078
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
613 |
sortDirectoriesBeforeFiles true |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
614 |
openAlwaysInTextEditor false |
15111 | 615 |
alwaysUseSmalltalkTools true |
7078
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
616 |
sortCaseless false |
13011 | 617 |
"/ 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
|
618 |
showDirectoriesOnTop false |
4201 | 619 |
) |
7078
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
620 |
|
11501 | 621 |
"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
|
622 |
"Modified: / 12-08-2014 / 13:13:57 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
3892 | 623 |
! ! |
624 |
||
17202 | 625 |
!AbstractFileBrowser class methodsFor:'drag & drop'! |
626 |
||
627 |
doStartDrag:aDropSource in:aView |
|
628 |
"set the cursors before starting the drag & drop operation" |
|
629 |
||
630 |
|hdl| |
|
631 |
||
632 |
hdl := DragAndDropManager new. |
|
633 |
||
634 |
hdl disabledCursor:self disabledCursorIcon. |
|
635 |
hdl enabledCursor:self enabledCursorIcon. |
|
636 |
hdl alienCursor:nil. |
|
637 |
||
638 |
hdl startDragFrom:aView dropSource:aDropSource offset:#topLeft. |
|
639 |
||
640 |
"Modified: / 23-07-2007 / 23:00:38 / cg" |
|
641 |
! ! |
|
642 |
||
5398 | 643 |
!AbstractFileBrowser class methodsFor:'help specs'! |
644 |
||
17889 | 645 |
basicHelpSpec |
6099 | 646 |
<resource: #help> |
647 |
||
17889 | 648 |
^ super helpSpec addPairsFrom:#( |
6099 | 649 |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
650 |
#lockFileEncoding |
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
651 |
'Do not guess the encoding from the file''s contents.' |
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
652 |
|
6100 | 653 |
#closeTabButton |
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
654 |
'Close this tab' |
6100 | 655 |
|
6099 | 656 |
#addTerminal |
17182 | 657 |
'Add a shell terminal page' |
6099 | 658 |
|
659 |
#make |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
660 |
'Call the make command' |
6099 | 661 |
|
662 |
#searchFile |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
663 |
'Search a file' |
6099 | 664 |
|
665 |
#directoryUp |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
666 |
'Directory up' |
6099 | 667 |
|
668 |
#directoryBack |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
669 |
'Directory back' |
6099 | 670 |
|
671 |
#directoryForward |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
672 |
'Directory forward' |
6099 | 673 |
|
674 |
#directoryHistory |
|
675 |
'Directory' |
|
676 |
||
677 |
#copyFile |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
678 |
'Copy the selected file(s)' |
6099 | 679 |
|
680 |
#cutFile |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
681 |
'Cut the selected file(s)' |
6099 | 682 |
|
683 |
#editFile |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
684 |
'Edit the selected file' |
6099 | 685 |
|
686 |
#fileHome |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
687 |
'Goto home directory' |
6099 | 688 |
|
8093 | 689 |
#fileDesktop |
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
690 |
'Goto desktop directory' |
8093 | 691 |
|
6099 | 692 |
#fileGotoDefault |
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
693 |
'Goto default directory (ST/X start directory)' |
6099 | 694 |
|
6454 | 695 |
#fileGotoSmalltalkDirectory |
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
696 |
'Goto Smalltalk directory (ST/X application)' |
6454 | 697 |
|
6456 | 698 |
#fileGotoDefaultDirectory |
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
699 |
'Goto current directory' |
6456 | 700 |
|
6099 | 701 |
#pasteFile |
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
702 |
'Paste file(s)' |
6099 | 703 |
|
704 |
#deleteFile |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
705 |
'Delete the selected file(s)' |
6099 | 706 |
|
707 |
#fileIn |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
708 |
'File in' |
6099 | 709 |
|
710 |
#fileHistory |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
711 |
'File history' |
6099 | 712 |
|
713 |
#fileGotoBookmark |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
714 |
'Goto bookmarked directory' |
6099 | 715 |
|
716 |
#hideToolBar |
|
13910 | 717 |
'Hide the toolbar (show again via "View"-menu)' |
6099 | 718 |
|
719 |
#hideFilenameEntryField |
|
13910 | 720 |
'Hide filename & filter fields (show again via "View"-menu)' |
721 |
||
722 |
#hideBookmarks |
|
723 |
'Hide the bookmarks (show again via "View"-menu)' |
|
6099 | 724 |
|
725 |
#openChangeBrowser |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
726 |
'Open a Changebrowser on file' |
6099 | 727 |
|
728 |
#showFileDetails |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
729 |
'Show file details' |
6099 | 730 |
|
731 |
#hideFileDetails |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
732 |
'Hide file details' |
6099 | 733 |
|
734 |
#toggleDetails |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
735 |
'Show/hide file details' |
6099 | 736 |
|
737 |
#viewDetails |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
738 |
'Show/hide file details' |
6099 | 739 |
|
740 |
#selectDetails |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
741 |
'Select file details to be shown' |
6099 | 742 |
|
8088 | 743 |
#showDifferences |
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
744 |
'Show differences between file and editor versions' |
8088 | 745 |
|
746 |
#toggleHexDisplay |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
747 |
'Toggle between hexadecimal and textual representation' |
8088 | 748 |
|
749 |
#findInBrowser |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
750 |
'Navigate the browser''s file list to the edited file' |
8088 | 751 |
|
752 |
#saveFile |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
753 |
'Save the editor''s contents into the file' |
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
754 |
|
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
755 |
#saveFileAs |
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
756 |
'Save the editor''s contents into another file' |
8088 | 757 |
|
758 |
#reloadFile |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
759 |
'Reload from the file' |
8088 | 760 |
|
761 |
||
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
762 |
'Send to the printer' |
8088 | 763 |
|
6099 | 764 |
). |
765 |
||
8261 | 766 |
" |
17889 | 767 |
self helpSpec |
8261 | 768 |
" |
769 |
||
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
770 |
"Modified: / 06-10-2011 / 14:55:27 / cg" |
8261 | 771 |
! |
772 |
||
17889 | 773 |
helpSpec |
8261 | 774 |
<resource: #programHelp> |
775 |
||
776 |
|spec hist resources| |
|
777 |
||
17889 | 778 |
spec := self basicHelpSpec. |
8261 | 779 |
|
780 |
"/ add help items for the history |
|
6099 | 781 |
hist := self directoryHistory. |
782 |
hist notNil ifTrue:[ |
|
783 |
resources := self classResources. |
|
784 |
hist canForward ifTrue:[ |
|
7879
9c64dea1b14a
block as a flyByHelpText item.
Claus Gittinger <cg@exept.de>
parents:
7869
diff
changeset
|
785 |
spec at:#directoryForward put:[ resources string:'Forward to: %1' with:hist nextForwardItem ]. |
6099 | 786 |
]. |
787 |
hist canBackward ifTrue:[ |
|
7879
9c64dea1b14a
block as a flyByHelpText item.
Claus Gittinger <cg@exept.de>
parents:
7869
diff
changeset
|
788 |
spec at:#directoryBack put:[ resources string:'Back to: %1' with:hist nextBackwardItem ]. |
6099 | 789 |
]. |
790 |
]. |
|
791 |
^ spec. |
|
792 |
||
793 |
" |
|
17889 | 794 |
self helpSpec |
6099 | 795 |
" |
796 |
||
7879
9c64dea1b14a
block as a flyByHelpText item.
Claus Gittinger <cg@exept.de>
parents:
7869
diff
changeset
|
797 |
"Modified: / 03-11-2007 / 12:05:01 / cg" |
5398 | 798 |
! ! |
799 |
||
8994
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
800 |
!AbstractFileBrowser class methodsFor:'image specs'! |
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
801 |
|
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
802 |
clearHistoryIcon |
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
803 |
<resource: #programImage> |
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
804 |
|
17413 | 805 |
^ ToolbarIconLibrary deleteIcon |
806 |
"/ ^ Icon deleteIcon |
|
807 |
||
808 |
"Modified: / 15-02-2017 / 19:45:24 / cg" |
|
8994
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
809 |
! |
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 |
copyIcon |
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
812 |
<resource: #programImage> |
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
813 |
|
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
814 |
^ ToolbarIconLibrary copyIcon |
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
815 |
! |
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 |
cutIcon |
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
818 |
<resource: #programImage> |
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
819 |
|
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
820 |
^ ToolbarIconLibrary cut20x20Icon2 "cut28x28Icon" |
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
821 |
! |
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 |
deleteIcon |
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
824 |
<resource: #programImage> |
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
825 |
|
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
826 |
^ ToolbarIconLibrary erase20x20Icon "/ delete28x28Icon |
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
827 |
! |
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 |
directoryUpIcon |
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
830 |
<resource: #programImage> |
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
831 |
|
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
832 |
^ ToolbarIconLibrary directoryUpIcon |
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
833 |
! |
3892 | 834 |
|
15211 | 835 |
disabledCursorIcon |
836 |
"This resource specification was automatically generated |
|
837 |
by the ImageEditor of ST/X." |
|
838 |
||
839 |
"Do not manually edit this!! If it is corrupted, |
|
840 |
the ImageEditor may not be able to read the specification." |
|
841 |
||
842 |
" |
|
17202 | 843 |
self disabledCursorIcon inspect |
844 |
ImageEditor openOnClass:self andSelector:#disabledCursorIcon |
|
15211 | 845 |
Icon flushCachedIcons |
846 |
" |
|
847 |
||
848 |
<resource: #image> |
|
849 |
||
850 |
^Icon |
|
851 |
constantNamed:#'AbstractFileBrowser class disabledCursorIcon' |
|
852 |
ifAbsentPut:[(Depth1Image new) width: 32; height: 32; photometric:(#palette); bitsPerSample:(#[1]); samplesPerPixel:(1); bits:(ByteArray fromPackedString:' |
|
853 |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@_ @@@XF@@@H@P@@DOB@@BLLP@AA@"@@RHD @H1AD@BRHI@@$QBP@IBH$@BPQI@@"BLP@D QH@ADBB@@H0Q@@AC |
|
854 |
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:' |
|
855 |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@_ @@@_>@@@O?0@@G?>@@C<O0@A?@>@@_8G @O?A<@C38O@@<_C0@OC8<@C0_O@@>C?0@G _8@A<C>@@O0_@@A? |
|
856 |
? @@O?0@@A?8@@@G8@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@b') ; yourself); yourself] |
|
857 |
! |
|
6337 | 858 |
|
15211 | 859 |
enabledCursorIcon |
860 |
"This resource specification was automatically generated |
|
861 |
by the ImageEditor of ST/X." |
|
862 |
||
863 |
"Do not manually edit this!! If it is corrupted, |
|
864 |
the ImageEditor may not be able to read the specification." |
|
865 |
||
866 |
" |
|
17202 | 867 |
self enabledCursorIcon inspect |
868 |
ImageEditor openOnClass:self andSelector:#enabledCursorIcon |
|
15211 | 869 |
Icon flushCachedIcons |
870 |
" |
|
871 |
||
872 |
<resource: #image> |
|
873 |
||
874 |
^Icon |
|
875 |
constantNamed:#'AbstractFileBrowser class enabledCursorIcon' |
|
876 |
ifAbsentPut:[(Depth1Image new) width: 32; height: 32; photometric:(#palette); bitsPerSample:(#[1]); samplesPerPixel:(1); bits:(ByteArray fromPackedString:' |
|
877 |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@E@@@@AP@@@@T@@@@E@@@@AP@@@@T@@@@E@@@@AP@@@@@@@@?0_0@@@@@@C?A?@@@@@@@@AP@@@@T@@@@E@@@@A |
|
878 |
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:' |
|
879 |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@G@@@@A0@@@@\@@@@G@@@@A0@@@@\@@@@G@@@@A0@@@@\@@@?8?0@O>O<@C?#?@@@G@@@@A0@@@@\@@@@G@@@@A |
|
880 |
0@@@@\@@@@G@@@@A0@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@b') ; yourself); yourself] |
|
881 |
! |
|
6337 | 882 |
|
3892 | 883 |
fileInIcon |
884 |
<resource: #programImage> |
|
885 |
||
6116 | 886 |
^ ToolbarIconLibrary fileInIcon |
3892 | 887 |
! |
888 |
||
6079 | 889 |
historyBackIcon |
890 |
<resource: #programImage> |
|
891 |
||
892 |
^ ToolbarIconLibrary historyBackIcon |
|
893 |
! |
|
894 |
||
895 |
historyForwardIcon |
|
896 |
<resource: #programImage> |
|
897 |
||
898 |
^ ToolbarIconLibrary historyForwardIcon |
|
899 |
! |
|
900 |
||
3892 | 901 |
homeIcon |
902 |
<resource: #programImage> |
|
903 |
||
6079 | 904 |
^ ToolbarIconLibrary homeIcon |
3892 | 905 |
! |
906 |
||
6074 | 907 |
homeIcon2 |
6079 | 908 |
<resource: #programImage> |
909 |
||
910 |
^ ToolbarIconLibrary homeIcon2 |
|
6074 | 911 |
! |
912 |
||
913 |
htmlReloadIcon |
|
914 |
<resource: #programImage> |
|
915 |
||
916 |
^ ToolbarIconLibrary reload22x22Icon |
|
917 |
! |
|
918 |
||
15211 | 919 |
leftDownIcon |
920 |
<resource: #image> |
|
921 |
"This resource specification was automatically generated |
|
922 |
by the ImageEditor of ST/X." |
|
923 |
"Do not manually edit this!! If it is corrupted, |
|
924 |
the ImageEditor may not be able to read the specification." |
|
925 |
" |
|
926 |
self leftDownIcon inspect |
|
927 |
ImageEditor openOnClass:self andSelector:#leftDownIcon" |
|
928 |
||
929 |
^ Icon constantNamed:#'AbstractFileBrowser class leftDownIcon' |
|
930 |
ifAbsentPut:[ |
|
931 |
(Depth2Image new) |
|
932 |
width:28; |
|
933 |
height:28; |
|
934 |
photometric:(#palette); |
|
935 |
bitsPerSample:(#( 2 )); |
|
936 |
samplesPerPixel:(1); |
|
937 |
bits:(ByteArray |
|
938 |
fromPackedString:' |
|
939 |
UUUUUUUUUUUPAUUUUUUUP@UUUUUUUPB!!UUUUUU@B*AUUUUU@B*(UUUUUPB** UUUUPB***AUUUTB***(EUUUB****%UUUR*****UUUUU@*%UUUUUUPJ)UUUU |
|
940 |
UUTB*UUUUUUU@*%UUUUUUPJ)UUUUUUTB*UUUUUUU@*%UUUUUUPJ)UUUUUUTB*UUUUUUU@*$@@@@AUPJ*****)UTB******UU@******%UPJ*****)UTAUUUU |
|
941 |
UUUU@@@@@@@AUUUUUUUUUP@a'); |
|
942 |
colorMapFromArray:#[ 255 255 255 0 0 0 40 40 100 255 0 0 ]; |
|
943 |
mask:((ImageMask new) |
|
944 |
width:28; |
|
945 |
height:28; |
|
946 |
bits:(ByteArray |
|
947 |
fromPackedString:' |
|
948 |
@@@@@@@@@@@@ @@@@\@@@@O @@@G<@@@C? @@A?<@@@?? @@_?<@@G?? @@C<@@@@?@@@@O0@@@C<@@@@?@@@@O0@@@C<@@@@?@@@@O0@@@C??? @???8@O? |
|
949 |
?>@C??? @???8@O??>@@@@@@@@@@@@@a'); |
|
950 |
yourself); |
|
951 |
yourself |
|
952 |
] |
|
953 |
! |
|
954 |
||
955 |
menuHistoryList9x20Icon |
|
956 |
<resource: #image> |
|
957 |
"This resource specification was automatically generated |
|
958 |
by the ImageEditor of ST/X." |
|
959 |
"Do not manually edit this!! If it is corrupted, |
|
960 |
the ImageEditor may not be able to read the specification." |
|
961 |
" |
|
962 |
self menuHistoryList9x20Icon inspect |
|
963 |
ImageEditor openOnClass:self andSelector:#menuHistoryList9x20Icon |
|
964 |
Icon flushCachedIcons" |
|
965 |
||
966 |
^ Icon constantNamed:#'AbstractFileBrowser class menuHistoryList9x20Icon' |
|
967 |
ifAbsentPut:[ |
|
968 |
(Depth1Image new) |
|
969 |
width:9; |
|
970 |
height:20; |
|
971 |
photometric:(#palette); |
|
972 |
bitsPerSample:(#( 1 )); |
|
973 |
samplesPerPixel:(1); |
|
974 |
bits:(ByteArray |
|
975 |
fromPackedString:'@@@@@A0@G@@\@A0@G@@\@A0@G@@\@A0@G@A?@C8@G@@H@G<@@@@@@@@a'); |
|
976 |
colorMapFromArray:#[ 255 255 255 0 0 0 ]; |
|
977 |
mask:((ImageMask new) |
|
978 |
width:9; |
|
979 |
height:20; |
|
980 |
bits:(ByteArray |
|
981 |
fromPackedString:'@@@@@A0@G@@\@A0@G@@\@A0@G@@\@A0@G@A?@C8@G@@H@G<@@@@@@@@a'); |
|
982 |
yourself); |
|
983 |
yourself |
|
984 |
] |
|
985 |
! |
|
986 |
||
987 |
menuHistoryListIcon |
|
988 |
<resource: #image> |
|
989 |
"This resource specification was automatically generated |
|
990 |
by the ImageEditor of ST/X." |
|
991 |
"Do not manually edit this!! If it is corrupted, |
|
992 |
the ImageEditor may not be able to read the specification." |
|
993 |
" |
|
994 |
self menuHistoryListIcon inspect |
|
995 |
ImageEditor openOnClass:self andSelector:#menuHistoryListIcon" |
|
996 |
||
997 |
^ Icon constantNamed:#'AbstractFileBrowser class menuHistoryListIcon' |
|
998 |
ifAbsentPut:[ |
|
999 |
(Depth1Image new) |
|
1000 |
width:12; |
|
1001 |
height:12; |
|
1002 |
photometric:(#palette); |
|
1003 |
bitsPerSample:(#( 1 )); |
|
1004 |
samplesPerPixel:(1); |
|
1005 |
bits:(ByteArray fromPackedString:'??S?<O?0??C?<O?0??/?=_?0??C?<O?0'); |
|
1006 |
colorMapFromArray:#[ 255 255 255 0 0 0 ]; |
|
1007 |
mask:((ImageMask new) |
|
1008 |
width:12; |
|
1009 |
height:12; |
|
1010 |
bits:(ByteArray fromPackedString:'@@@O@@<@C0A?8C?@G8@O@@X@@@A?8@@@'); |
|
1011 |
yourself); |
|
1012 |
yourself |
|
1013 |
] |
|
1014 |
! |
|
3892 | 1015 |
|
6087 | 1016 |
newDirectoryIcon |
6074 | 1017 |
<resource: #programImage> |
1018 |
||
6087 | 1019 |
^ ToolbarIconLibrary newDirectoryIcon |
3923 | 1020 |
! |
1021 |
||
6091 | 1022 |
removeTabIcon |
1023 |
<resource: #programImage> |
|
1024 |
||
1025 |
^ ToolbarIconLibrary removeTabIcon |
|
1026 |
! |
|
1027 |
||
3892 | 1028 |
vt100Terminal |
1029 |
<resource: #programImage> |
|
1030 |
||
1031 |
^ ToolbarIconLibrary shell20x20Icon |
|
1032 |
! ! |
|
1033 |
||
5528 | 1034 |
!AbstractFileBrowser class methodsFor:'interface specs'! |
1035 |
||
15211 | 1036 |
encodingDialogSpec |
1037 |
"This resource specification was automatically generated |
|
1038 |
by the UIPainter of ST/X." |
|
1039 |
||
1040 |
"Do not manually edit this!! If it is corrupted, |
|
1041 |
the UIPainter may not be able to read the specification." |
|
1042 |
||
1043 |
" |
|
1044 |
UIPainter new openOnClass:AbstractFileBrowser andSelector:#encodingDialogSpec |
|
1045 |
AbstractFileBrowser new openInterface:#encodingDialogSpec |
|
1046 |
" |
|
1047 |
||
1048 |
<resource: #canvas> |
|
1049 |
||
1050 |
^ |
|
1051 |
#(FullSpec |
|
1052 |
name: encodingDialogSpec |
|
1053 |
window: |
|
1054 |
(WindowSpec |
|
1055 |
label: 'File Encoding' |
|
1056 |
name: 'File Encoding' |
|
1057 |
min: (Point 10 10) |
|
1058 |
bounds: (Rectangle 0 0 379 590) |
|
1059 |
) |
|
1060 |
component: |
|
1061 |
(SpecCollection |
|
1062 |
collection: ( |
|
1063 |
(LabelSpec |
|
1064 |
label: 'Select the External (File-) Encoding:' |
|
1065 |
name: 'Label1' |
|
1066 |
layout: (LayoutFrame 0 0 0 0 0 1 30 0) |
|
1067 |
translateLabel: true |
|
1068 |
adjust: left |
|
1069 |
) |
|
1070 |
(DataSetSpec |
|
1071 |
name: 'Table1' |
|
1072 |
layout: (LayoutFrame 0 0 30 0 0 1 -60 1) |
|
1073 |
model: selectedEncoding |
|
1074 |
hasHorizontalScrollBar: true |
|
1075 |
hasVerticalScrollBar: true |
|
1076 |
dataList: encodingList |
|
1077 |
has3Dseparators: true |
|
1078 |
columns: |
|
1079 |
(Array |
|
1080 |
||
1081 |
(DataSetColumnSpec |
|
1082 |
label: 'Encoding' |
|
1083 |
labelButtonType: Button |
|
1084 |
height: heightOfFirstRow |
|
1085 |
model: at: |
|
1086 |
canSelect: false |
|
1087 |
isResizeable: false |
|
1088 |
showRowSeparator: false |
|
1089 |
showColSeparator: false |
|
1090 |
) |
|
1091 |
(DataSetColumnSpec |
|
1092 |
label: 'Description' |
|
1093 |
labelButtonType: Button |
|
1094 |
height: heightOfFirstRow |
|
1095 |
model: at: |
|
1096 |
canSelect: false |
|
1097 |
isResizeable: false |
|
1098 |
showRowSeparator: false |
|
1099 |
showColSeparator: false |
|
1100 |
) |
|
1101 |
) |
|
1102 |
doubleClickChannel: accept |
|
1103 |
) |
|
1104 |
(CheckBoxSpec |
|
1105 |
label: 'Lock Encoding' |
|
1106 |
name: 'LockEncodingCheckBox' |
|
1107 |
layout: (LayoutFrame 3 0 -60 1 217 0 -30 1) |
|
1108 |
activeHelpKey: lockFileEncoding |
|
1109 |
model: lockFileEncoding |
|
1110 |
translateLabel: true |
|
1111 |
) |
|
1112 |
(HorizontalPanelViewSpec |
|
1113 |
name: 'ButtonPanel' |
|
1114 |
layout: (LayoutFrame 0 0 -30 1 0 1 0 1) |
|
1115 |
horizontalLayout: fitSpace |
|
1116 |
verticalLayout: center |
|
1117 |
horizontalSpace: 3 |
|
1118 |
verticalSpace: 3 |
|
1119 |
reverseOrderIfOKAtLeft: true |
|
1120 |
component: |
|
1121 |
(SpecCollection |
|
1122 |
collection: ( |
|
1123 |
(ActionButtonSpec |
|
1124 |
label: 'Cancel' |
|
1125 |
name: 'Button2' |
|
1126 |
translateLabel: true |
|
1127 |
model: cancel |
|
1128 |
extent: (Point 183 22) |
|
1129 |
) |
|
1130 |
(ActionButtonSpec |
|
1131 |
label: 'OK' |
|
1132 |
name: 'Button1' |
|
1133 |
translateLabel: true |
|
1134 |
model: accept |
|
1135 |
isDefault: true |
|
1136 |
extent: (Point 184 22) |
|
1137 |
) |
|
1138 |
) |
|
1139 |
||
1140 |
) |
|
1141 |
) |
|
1142 |
) |
|
1143 |
||
1144 |
) |
|
1145 |
) |
|
1146 |
! |
|
1147 |
||
1148 |
lineEndConventionDialogSpec |
|
1149 |
"This resource specification was automatically generated |
|
1150 |
by the UIPainter of ST/X." |
|
1151 |
||
1152 |
"Do not manually edit this!! If it is corrupted, |
|
1153 |
the UIPainter may not be able to read the specification." |
|
1154 |
||
1155 |
" |
|
1156 |
UIPainter new openOnClass:AbstractFileBrowser andSelector:#lineEndConventionDialogSpec |
|
1157 |
AbstractFileBrowser new openInterface:#lineEndConventionDialogSpec |
|
1158 |
" |
|
1159 |
||
1160 |
<resource: #canvas> |
|
1161 |
||
1162 |
^ |
|
15212 | 1163 |
#(FullSpec |
1164 |
name: lineEndConventionDialogSpec |
|
1165 |
window: |
|
1166 |
(WindowSpec |
|
1167 |
label: 'Line-End Convention' |
|
1168 |
name: 'Line-End Convention' |
|
1169 |
min: (Point 10 10) |
|
1170 |
bounds: (Rectangle 0 0 379 239) |
|
1171 |
) |
|
1172 |
component: |
|
1173 |
(SpecCollection |
|
1174 |
collection: ( |
|
1175 |
(LabelSpec |
|
1176 |
label: 'Select the Line-End Convention (used when saving files):' |
|
1177 |
name: 'Label1' |
|
1178 |
layout: (LayoutFrame 0 0 0 0 0 1 30 0) |
|
1179 |
translateLabel: true |
|
1180 |
adjust: left |
|
1181 |
) |
|
1182 |
(VerticalPanelViewSpec |
|
1183 |
name: 'VerticalPanel1' |
|
1184 |
layout: (LayoutFrame 20 0 40 0 0 1 -30 1) |
|
1185 |
horizontalLayout: fit |
|
1186 |
verticalLayout: topSpace |
|
1187 |
horizontalSpace: 3 |
|
1188 |
verticalSpace: 3 |
|
1189 |
component: |
|
1190 |
(SpecCollection |
|
1191 |
collection: ( |
|
1192 |
(RadioButtonSpec |
|
1193 |
label: 'NL (Unix)' |
|
1194 |
name: 'RadioButton1' |
|
1195 |
translateLabel: true |
|
1196 |
model: lineEndConvention |
|
1197 |
isTriggerOnDown: true |
|
1198 |
select: nl |
|
1199 |
extent: (Point 359 22) |
|
1200 |
) |
|
1201 |
(RadioButtonSpec |
|
1202 |
label: 'CR-NL (MSDOS)' |
|
1203 |
name: 'RadioButton4' |
|
1204 |
translateLabel: true |
|
1205 |
model: lineEndConvention |
|
1206 |
isTriggerOnDown: true |
|
1207 |
select: crlf |
|
1208 |
extent: (Point 359 22) |
|
1209 |
) |
|
1210 |
(RadioButtonSpec |
|
1211 |
label: 'CR (VMS and pre OSX mac)' |
|
1212 |
name: 'RadioButton5' |
|
1213 |
translateLabel: true |
|
1214 |
model: lineEndConvention |
|
1215 |
isTriggerOnDown: true |
|
1216 |
select: cr |
|
1217 |
extent: (Point 359 22) |
|
15211 | 1218 |
) |
15212 | 1219 |
(RadioButtonSpec |
1220 |
label: 'ETX (some modem protocols and mainframe files)' |
|
1221 |
name: 'RadioButton6' |
|
1222 |
translateLabel: true |
|
1223 |
model: lineEndConvention |
|
1224 |
isTriggerOnDown: true |
|
1225 |
select: etx |
|
1226 |
extent: (Point 359 22) |
|
1227 |
) |
|
1228 |
(RadioButtonSpec |
|
1229 |
label: 'EOT (some modem protocols and mainframe files)' |
|
1230 |
name: 'RadioButton7' |
|
1231 |
translateLabel: true |
|
1232 |
model: lineEndConvention |
|
1233 |
isTriggerOnDown: true |
|
1234 |
select: eot |
|
1235 |
extent: (Point 359 22) |
|
15211 | 1236 |
) |
15212 | 1237 |
) |
1238 |
||
1239 |
) |
|
15211 | 1240 |
) |
15212 | 1241 |
(HorizontalPanelViewSpec |
1242 |
name: 'ButtonPanel' |
|
1243 |
layout: (LayoutFrame 0 0 -30 1 0 1 0 1) |
|
1244 |
horizontalLayout: fitSpace |
|
1245 |
verticalLayout: center |
|
1246 |
horizontalSpace: 3 |
|
1247 |
verticalSpace: 3 |
|
1248 |
reverseOrderIfOKAtLeft: true |
|
1249 |
component: |
|
1250 |
(SpecCollection |
|
1251 |
collection: ( |
|
1252 |
(ActionButtonSpec |
|
1253 |
label: 'Cancel' |
|
1254 |
name: 'Button2' |
|
1255 |
translateLabel: true |
|
1256 |
model: cancel |
|
1257 |
extent: (Point 185 22) |
|
1258 |
) |
|
1259 |
(ActionButtonSpec |
|
1260 |
label: 'OK' |
|
1261 |
name: 'Button1' |
|
1262 |
translateLabel: true |
|
1263 |
model: accept |
|
1264 |
isDefault: true |
|
1265 |
extent: (Point 185 22) |
|
1266 |
) |
|
1267 |
) |
|
1268 |
||
1269 |
) |
|
1270 |
) |
|
1271 |
) |
|
1272 |
||
1273 |
) |
|
1274 |
) |
|
15211 | 1275 |
! |
1276 |
||
1277 |
tabStopConversionDialogSpec |
|
1278 |
"This resource specification was automatically generated |
|
1279 |
by the UIPainter of ST/X." |
|
1280 |
||
1281 |
"Do not manually edit this!! If it is corrupted, |
|
1282 |
the UIPainter may not be able to read the specification." |
|
1283 |
||
1284 |
" |
|
1285 |
UIPainter new openOnClass:AbstractFileBrowser andSelector:#tabStopConversionDialogSpec |
|
1286 |
AbstractFileBrowser new openInterface:#tabStopConversionDialogSpec |
|
1287 |
" |
|
1288 |
||
1289 |
<resource: #canvas> |
|
1290 |
||
1291 |
^ |
|
1292 |
#(FullSpec |
|
1293 |
name: 'tabStopConversionDialogSpec' |
|
1294 |
window: |
|
1295 |
(WindowSpec |
|
1296 |
label: 'Tab-Stop Conversion' |
|
1297 |
name: 'Tab-Stop Conversion' |
|
1298 |
min: (Point 10 10) |
|
1299 |
bounds: (Rectangle 0 0 379 239) |
|
1300 |
) |
|
1301 |
component: |
|
1302 |
(SpecCollection |
|
1303 |
collection: ( |
|
1304 |
(LabelSpec |
|
1305 |
label: 'Select the Tab-Stop Conversion (used when saving files):' |
|
1306 |
name: 'Label1' |
|
1307 |
layout: (LayoutFrame 0 0 0 0 0 1 30 0) |
|
1308 |
translateLabel: true |
|
1309 |
adjust: left |
|
1310 |
) |
|
1311 |
(VerticalPanelViewSpec |
|
1312 |
name: 'VerticalPanel1' |
|
1313 |
layout: (LayoutFrame 0 0 30 0 0 1 -30 1) |
|
1314 |
horizontalLayout: center |
|
1315 |
verticalLayout: center |
|
1316 |
horizontalSpace: 3 |
|
1317 |
verticalSpace: 3 |
|
1318 |
component: |
|
1319 |
(SpecCollection |
|
1320 |
collection: ( |
|
1321 |
(RadioButtonSpec |
|
1322 |
label: '4' |
|
1323 |
name: 'RadioButton1' |
|
1324 |
translateLabel: true |
|
1325 |
model: tabStops |
|
1326 |
isTriggerOnDown: true |
|
1327 |
select: 4 |
|
1328 |
extent: (Point 136 22) |
|
1329 |
) |
|
1330 |
(RadioButtonSpec |
|
1331 |
label: '8' |
|
1332 |
name: 'RadioButton4' |
|
1333 |
translateLabel: true |
|
1334 |
model: tabStops |
|
1335 |
isTriggerOnDown: true |
|
1336 |
select: 8 |
|
1337 |
extent: (Point 136 22) |
|
1338 |
) |
|
1339 |
) |
|
1340 |
||
1341 |
) |
|
1342 |
) |
|
1343 |
(HorizontalPanelViewSpec |
|
1344 |
name: 'ButtonPanel' |
|
1345 |
layout: (LayoutFrame 0 0 -30 1 0 1 0 1) |
|
1346 |
horizontalLayout: fitSpace |
|
1347 |
verticalLayout: center |
|
1348 |
horizontalSpace: 3 |
|
1349 |
verticalSpace: 3 |
|
1350 |
reverseOrderIfOKAtLeft: true |
|
1351 |
component: |
|
1352 |
(SpecCollection |
|
1353 |
collection: ( |
|
1354 |
(ActionButtonSpec |
|
1355 |
label: 'Cancel' |
|
1356 |
name: 'Button2' |
|
1357 |
translateLabel: true |
|
1358 |
model: cancel |
|
1359 |
extent: (Point 185 22) |
|
1360 |
) |
|
1361 |
(ActionButtonSpec |
|
1362 |
label: 'OK' |
|
1363 |
name: 'Button1' |
|
1364 |
translateLabel: true |
|
1365 |
model: accept |
|
1366 |
isDefault: true |
|
1367 |
extent: (Point 185 22) |
|
1368 |
) |
|
1369 |
) |
|
1370 |
||
1371 |
) |
|
1372 |
) |
|
1373 |
) |
|
1374 |
||
1375 |
) |
|
1376 |
) |
|
1377 |
||
1378 |
"Modified: / 28-02-2012 / 11:12:38 / cg" |
|
1379 |
! ! |
|
5528 | 1380 |
|
3892 | 1381 |
!AbstractFileBrowser class methodsFor:'menu specs'! |
1382 |
||
15211 | 1383 |
baseBookmarksMenuSpec |
1384 |
"This resource specification was automatically generated |
|
1385 |
by the MenuEditor of ST/X." |
|
1386 |
||
1387 |
"Do not manually edit this!! If it is corrupted, |
|
1388 |
the MenuEditor may not be able to read the specification." |
|
1389 |
||
1390 |
" |
|
1391 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#baseBookmarksMenuSpec |
|
1392 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser baseBookmarksMenuSpec)) startUp |
|
1393 |
" |
|
1394 |
||
1395 |
<resource: #menu> |
|
1396 |
||
1397 |
^ |
|
1398 |
#(Menu |
|
1399 |
( |
|
1400 |
(MenuItem |
|
1401 |
enabled: currentFilesHasDirectories |
|
1402 |
label: 'Add Bookmark' |
|
1403 |
itemValue: addBookmark |
|
1404 |
translateLabel: true |
|
1405 |
) |
|
1406 |
(MenuItem |
|
1407 |
enabled: hasBookmarksToRemove |
|
1408 |
label: 'Remove Bookmark' |
|
1409 |
itemValue: removeBookmark |
|
1410 |
translateLabel: true |
|
1411 |
) |
|
1412 |
(MenuItem |
|
1413 |
label: 'Save Bookmarks In...' |
|
1414 |
itemValue: saveBookmarks |
|
1415 |
translateLabel: true |
|
1416 |
) |
|
1417 |
) |
|
1418 |
nil |
|
1419 |
nil |
|
1420 |
) |
|
1421 |
! |
|
1422 |
||
1423 |
baseBookmarksMenuSpec2 |
|
1424 |
"This resource specification was automatically generated |
|
1425 |
by the MenuEditor of ST/X." |
|
1426 |
||
1427 |
"Do not manually edit this!! If it is corrupted, |
|
1428 |
the MenuEditor may not be able to read the specification." |
|
1429 |
||
1430 |
" |
|
1431 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#baseBookmarksMenuSpec2 |
|
1432 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser baseBookmarksMenuSpec2)) startUp |
|
1433 |
" |
|
1434 |
||
1435 |
<resource: #menu> |
|
1436 |
||
1437 |
^ |
|
1438 |
#(Menu |
|
1439 |
( |
|
1440 |
(MenuItem |
|
1441 |
label: 'Edit Bookmarks' |
|
1442 |
itemValue: editBookmarks |
|
1443 |
translateLabel: true |
|
1444 |
) |
|
1445 |
(MenuItem |
|
1446 |
label: '-' |
|
1447 |
) |
|
1448 |
(MenuItem |
|
1449 |
enabled: currentFilesHasDirectories |
|
1450 |
label: 'Add Bookmark' |
|
1451 |
itemValue: addBookmark |
|
1452 |
translateLabel: true |
|
1453 |
) |
|
1454 |
) |
|
1455 |
nil |
|
1456 |
nil |
|
1457 |
) |
|
1458 |
! |
|
1459 |
||
1460 |
browserMenu |
|
1461 |
"This resource specification was automatically generated |
|
1462 |
by the MenuEditor of ST/X." |
|
1463 |
||
1464 |
"Do not manually edit this!! If it is corrupted, |
|
1465 |
the MenuEditor may not be able to read the specification." |
|
1466 |
||
1467 |
||
1468 |
" |
|
1469 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#browserMenu |
|
1470 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser browserMenu)) startUp |
|
1471 |
" |
|
1472 |
||
1473 |
<resource: #menu> |
|
1474 |
||
1475 |
^ |
|
1476 |
#(Menu |
|
1477 |
( |
|
1478 |
(MenuItem |
|
1479 |
label: 'Spawn Filebrowser' |
|
1480 |
itemValue: doSpawn |
|
1481 |
translateLabel: true |
|
1482 |
shortcutKey: Ctrln |
|
1483 |
) |
|
1484 |
(MenuItem |
|
1485 |
label: 'Windows Explorer' |
|
1486 |
itemValue: doOpenExplorer |
|
1487 |
translateLabel: true |
|
17946 | 1488 |
isVisible: systemIsDOS |
15211 | 1489 |
) |
1490 |
(MenuItem |
|
1491 |
label: 'Open Finder' |
|
1492 |
itemValue: doOpenFinder |
|
1493 |
translateLabel: true |
|
1494 |
isVisible: systemIsOSX |
|
1495 |
) |
|
1496 |
(MenuItem |
|
1497 |
label: 'C Browser' |
|
1498 |
itemValue: doOpenCBrowser |
|
1499 |
translateLabel: true |
|
1500 |
isVisible: cBrowserMenuItemVisible |
|
1501 |
) |
|
1502 |
(MenuItem |
|
1503 |
label: '-' |
|
1504 |
) |
|
1505 |
(MenuItem |
|
1506 |
label: 'Add Text Editor Page' |
|
1507 |
itemValue: newTextEditor |
|
1508 |
translateLabel: true |
|
1509 |
shortcutKey: Ctrlt |
|
1510 |
) |
|
1511 |
(MenuItem |
|
1512 |
label: 'Add Shell Terminal Page' |
|
1513 |
itemValue: doAddTerminal |
|
1514 |
translateLabel: true |
|
1515 |
) |
|
1516 |
(MenuItem |
|
1517 |
label: 'Add Archiver Page' |
|
1518 |
itemValue: doAddArchiver |
|
1519 |
translateLabel: true |
|
1520 |
) |
|
1521 |
(MenuItem |
|
1522 |
label: 'Add Search Page' |
|
1523 |
itemValue: doOpenSearchFile |
|
1524 |
translateLabel: true |
|
1525 |
) |
|
1526 |
(MenuItem |
|
1527 |
label: '-' |
|
1528 |
isVisible: false |
|
1529 |
) |
|
1530 |
(MenuItem |
|
1531 |
label: 'Settings...' |
|
1532 |
itemValue: doOpenSettings |
|
1533 |
translateLabel: true |
|
1534 |
isVisible: false |
|
1535 |
) |
|
1536 |
(MenuItem |
|
1537 |
label: 'Encoding...' |
|
1538 |
itemValue: fileEncodingDialog |
|
1539 |
translateLabel: true |
|
1540 |
isVisible: false |
|
1541 |
) |
|
1542 |
(MenuItem |
|
1543 |
label: 'Line End Convention...' |
|
1544 |
itemValue: lineEndConventionDialog |
|
1545 |
translateLabel: true |
|
1546 |
isVisible: false |
|
1547 |
) |
|
1548 |
(MenuItem |
|
1549 |
label: 'Tab Stop Conversion...' |
|
1550 |
itemValue: tabStopConversionDialog |
|
1551 |
translateLabel: true |
|
1552 |
isVisible: false |
|
1553 |
) |
|
1554 |
(MenuItem |
|
1555 |
label: '-' |
|
1556 |
) |
|
1557 |
(MenuItem |
|
1558 |
label: 'Exit' |
|
1559 |
itemValue: closeRequest |
|
1560 |
translateLabel: true |
|
1561 |
) |
|
1562 |
) |
|
1563 |
nil |
|
1564 |
nil |
|
1565 |
) |
|
1566 |
||
17724 | 1567 |
"Modified: / 29-10-2017 / 11:13:49 / cg" |
15211 | 1568 |
! |
1569 |
||
1570 |
directoryMenu |
|
1571 |
"This resource specification was automatically generated |
|
1572 |
by the MenuEditor of ST/X." |
|
1573 |
||
1574 |
"Do not manually edit this!! If it is corrupted, |
|
1575 |
the MenuEditor may not be able to read the specification." |
|
1576 |
||
1577 |
||
1578 |
" |
|
1579 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#directoryMenu |
|
1580 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser directoryMenu)) startUp |
|
1581 |
" |
|
1582 |
||
1583 |
<resource: #menu> |
|
1584 |
||
1585 |
^ |
|
1586 |
#(Menu |
|
1587 |
( |
|
1588 |
(MenuItem |
|
1589 |
label: 'Bookmarks' |
|
1590 |
submenuChannel: bookmarksMenu |
|
1591 |
) |
|
1592 |
(MenuItem |
|
1593 |
label: 'Visited Directories' |
|
1594 |
submenuChannel: visitedDirectoriesMenu |
|
1595 |
) |
|
1596 |
(MenuItem |
|
1597 |
label: '-' |
|
1598 |
) |
|
1599 |
(MenuItem |
|
1600 |
label: 'Up' |
|
1601 |
itemValue: doGoDirectoryUp |
|
1602 |
) |
|
1603 |
(MenuItem |
|
1604 |
activeHelpKey: directoryBack |
|
1605 |
enabled: enableBack |
|
1606 |
label: 'Back' |
|
1607 |
itemValue: doBack |
|
1608 |
) |
|
1609 |
(MenuItem |
|
1610 |
activeHelpKey: directoryBack |
|
1611 |
enabled: enableForward |
|
1612 |
label: 'Forward' |
|
1613 |
itemValue: doForward |
|
1614 |
) |
|
1615 |
(MenuItem |
|
1616 |
label: '-' |
|
1617 |
) |
|
1618 |
(MenuItem |
|
1619 |
enabled: enableHome |
|
1620 |
label: 'Home Directory' |
|
1621 |
itemValue: doGotoHomeDirectory |
|
1622 |
) |
|
1623 |
(MenuItem |
|
1624 |
enabled: enableGotoDesktopDirectory |
|
1625 |
label: 'Desktop' |
|
1626 |
itemValue: doGotoDesktopDirectory |
|
1627 |
) |
|
1628 |
(MenuItem |
|
1629 |
enabled: enableGotoDefaultDirectory |
|
1630 |
label: 'Default (Current) Directory' |
|
1631 |
itemValue: doGotoDefaultDirectory |
|
1632 |
) |
|
1633 |
(MenuItem |
|
1634 |
enabled: enableGotoSmalltalkDirectory |
|
1635 |
label: 'Smalltalk (Application) Directory' |
|
1636 |
itemValue: doGotoSmalltalkDirectory |
|
1637 |
) |
|
1638 |
(MenuItem |
|
17187 | 1639 |
enabled: enableGotoSmalltalkWorkspaceDirectory |
1640 |
label: 'Smalltalk Workspace Directory' |
|
1641 |
itemValue: doGotoSmalltalkWorkspaceDirectory |
|
1642 |
) |
|
1643 |
(MenuItem |
|
15211 | 1644 |
enabled: enableGotoTempDirectory |
1645 |
label: 'Smalltalk Temp Directory' |
|
1646 |
itemValue: doGotoTempDirectory |
|
1647 |
) |
|
1648 |
(MenuItem |
|
1649 |
label: '-' |
|
17582 | 1650 |
isVisible: false |
15211 | 1651 |
) |
1652 |
(MenuItem |
|
1653 |
enabled: enableMakeCurrentDirectory |
|
1654 |
label: 'Make this the Default (Current) Directory' |
|
1655 |
itemValue: doMakeCurrentDirectory |
|
17582 | 1656 |
isVisible: false |
15211 | 1657 |
) |
1658 |
) |
|
1659 |
nil |
|
1660 |
nil |
|
1661 |
) |
|
17582 | 1662 |
|
1663 |
"Modified: / 17-07-2017 / 10:08:31 / cg" |
|
15211 | 1664 |
! |
1665 |
||
1666 |
editMenu |
|
1667 |
"This resource specification was automatically generated |
|
1668 |
by the MenuEditor of ST/X." |
|
1669 |
||
1670 |
"Do not manually edit this!! If it is corrupted, |
|
1671 |
the MenuEditor may not be able to read the specification." |
|
1672 |
||
1673 |
" |
|
1674 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#editMenu |
|
1675 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser editMenu)) startUp |
|
1676 |
" |
|
1677 |
||
1678 |
<resource: #menu> |
|
1679 |
||
1680 |
^ |
|
1681 |
#(Menu |
|
1682 |
( |
|
1683 |
(MenuItem |
|
1684 |
enabled: hasFileSelection |
|
1685 |
label: 'Copy Selected Filenames to Clipboard' |
|
1686 |
itemValue: copySelectedFilenames |
|
1687 |
translateLabel: true |
|
1688 |
) |
|
1689 |
(MenuItem |
|
1690 |
enabled: fileListIsNotEmpty |
|
1691 |
label: 'Copy all Filenames to Clipboard' |
|
1692 |
itemValue: copyFileList |
|
1693 |
translateLabel: true |
|
1694 |
) |
|
1695 |
) |
|
1696 |
nil |
|
1697 |
nil |
|
1698 |
) |
|
1699 |
! |
|
1700 |
||
1701 |
emptyMenuSpec |
|
1702 |
"This resource specification was automatically generated |
|
1703 |
by the MenuEditor of ST/X." |
|
1704 |
||
1705 |
"Do not manually edit this!! If it is corrupted, |
|
1706 |
the MenuEditor may not be able to read the specification." |
|
1707 |
||
1708 |
" |
|
1709 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#emptyMenuSpec |
|
1710 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser emptyMenuSpec)) startUp |
|
1711 |
" |
|
1712 |
||
1713 |
<resource: #menu> |
|
1714 |
||
1715 |
^ |
|
1716 |
#(#Menu |
|
1717 |
#( |
|
1718 |
) |
|
1719 |
nil |
|
1720 |
nil |
|
1721 |
) |
|
1722 |
! |
|
1723 |
||
1724 |
extraMenu |
|
1725 |
"This resource specification was automatically generated |
|
1726 |
by the MenuEditor of ST/X." |
|
1727 |
||
1728 |
"Do not manually edit this!! If it is corrupted, |
|
1729 |
the MenuEditor may not be able to read the specification." |
|
1730 |
||
1731 |
||
1732 |
" |
|
1733 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#extraMenu |
|
1734 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser extraMenu)) startUp |
|
1735 |
" |
|
1736 |
||
1737 |
<resource: #menu> |
|
1738 |
||
1739 |
^ |
|
1740 |
#(Menu |
|
1741 |
( |
|
1742 |
(MenuItem |
|
1743 |
label: 'Encoding...' |
|
1744 |
itemValue: fileEncodingDialog |
|
1745 |
translateLabel: true |
|
1746 |
) |
|
1747 |
(MenuItem |
|
1748 |
label: 'Line End Convention...' |
|
1749 |
itemValue: lineEndConventionDialog |
|
1750 |
translateLabel: true |
|
1751 |
) |
|
1752 |
(MenuItem |
|
1753 |
label: 'Tab Stop Conversion...' |
|
1754 |
itemValue: tabStopConversionDialog |
|
1755 |
translateLabel: true |
|
1756 |
) |
|
1757 |
(MenuItem |
|
1758 |
label: '-' |
|
1759 |
) |
|
1760 |
(MenuItem |
|
1761 |
label: 'Settings...' |
|
1762 |
itemValue: doOpenSettings |
|
1763 |
translateLabel: true |
|
1764 |
labelImage: (ResourceRetriever ToolbarIconLibrary settings16x16Icon 'Settings...') |
|
1765 |
) |
|
1766 |
) |
|
1767 |
nil |
|
1768 |
nil |
|
1769 |
) |
|
1770 |
! |
|
1771 |
||
1772 |
fileMenu |
|
1773 |
"This resource specification was automatically generated |
|
1774 |
by the MenuEditor of ST/X." |
|
1775 |
||
1776 |
"Do not manually edit this!! If it is corrupted, |
|
1777 |
the MenuEditor may not be able to read the specification." |
|
1778 |
||
1779 |
||
1780 |
" |
|
1781 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#fileMenu |
|
1782 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser fileMenu)) startUp |
|
1783 |
" |
|
1784 |
||
1785 |
<resource: #menu> |
|
1786 |
||
1787 |
^ |
|
1788 |
#(Menu |
|
1789 |
( |
|
1790 |
(MenuItem |
|
1791 |
enabled: enableFileHistory |
|
1792 |
label: 'File History' |
|
1793 |
submenuChannel: menuFileHistory |
|
1794 |
) |
|
1795 |
(MenuItem |
|
1796 |
label: '-' |
|
1797 |
) |
|
1798 |
(MenuItem |
|
1799 |
label: 'Open' |
|
1800 |
itemValue: doShowFileContents |
|
1801 |
) |
|
1802 |
(MenuItem |
|
1803 |
label: '-' |
|
1804 |
) |
|
1805 |
(MenuItem |
|
1806 |
enabled: hasFileSelection |
|
1807 |
label: 'FileIn' |
|
1808 |
itemValue: fileFileIn |
|
1809 |
) |
|
1810 |
(MenuItem |
|
1811 |
enabled: hasFileSelection |
|
1812 |
label: 'FileIn to Namespace...' |
|
1813 |
itemValue: fileFileInToNameSpace |
|
1814 |
) |
|
1815 |
(MenuItem |
|
1816 |
enabled: hasPackageDirectorySelected |
|
1817 |
label: 'Load Package from Here' |
|
1818 |
itemValue: fileFileInPackage |
|
1819 |
) |
|
1820 |
(MenuItem |
|
1821 |
label: '-' |
|
1822 |
) |
|
1823 |
(MenuItem |
|
1824 |
label: 'New' |
|
1825 |
submenuChannel: newMenu |
|
1826 |
keepLinkedMenu: true |
|
1827 |
) |
|
1828 |
(MenuItem |
|
1829 |
label: '-' |
|
1830 |
) |
|
1831 |
(MenuItem |
|
1832 |
enabled: hasSelection |
|
1833 |
label: 'Cut' |
|
1834 |
itemValue: cutFiles |
|
1835 |
) |
|
1836 |
(MenuItem |
|
1837 |
enabled: hasSelection |
|
1838 |
label: 'Copy' |
|
1839 |
itemValue: copyFiles |
|
1840 |
) |
|
1841 |
(MenuItem |
|
1842 |
enabled: canPaste |
|
1843 |
label: 'Paste' |
|
1844 |
itemValue: pasteFiles |
|
1845 |
) |
|
1846 |
(MenuItem |
|
1847 |
enabled: hasSelection |
|
1848 |
label: 'Delete' |
|
1849 |
itemValue: deleteFiles |
|
1850 |
) |
|
1851 |
(MenuItem |
|
1852 |
enabled: hasSelection |
|
1853 |
label: 'Erase' |
|
1854 |
itemValue: eraseFiles |
|
1855 |
) |
|
1856 |
(MenuItem |
|
1857 |
label: '-' |
|
1858 |
) |
|
1859 |
(MenuItem |
|
1860 |
enabled: hasSelection |
|
1861 |
label: 'Rename...' |
|
1862 |
itemValue: renameSelection |
|
1863 |
shortcutKey: Rename |
|
1864 |
) |
|
1865 |
(MenuItem |
|
1866 |
enabled: hasSelection |
|
1867 |
label: 'Move To...' |
|
1868 |
itemValue: moveSelectionTo |
|
1869 |
) |
|
1870 |
(MenuItem |
|
1871 |
enabled: hasSelection |
|
1872 |
label: 'Copy To...' |
|
1873 |
itemValue: copySelectionTo |
|
1874 |
) |
|
1875 |
(MenuItem |
|
1876 |
enabled: hasSelection |
|
1877 |
label: 'Properties...' |
|
1878 |
itemValue: doShowProperties |
|
1879 |
) |
|
1880 |
(MenuItem |
|
1881 |
label: '-' |
|
1882 |
isVisible: javaSupportLoaded |
|
1883 |
) |
|
1884 |
(MenuItem |
|
1885 |
enabled: canAddToClassPath |
|
1886 |
label: 'Add to Java Class Path' |
|
1887 |
isVisible: javaSupportLoaded |
|
1888 |
) |
|
1889 |
(MenuItem |
|
1890 |
enabled: canRemoveFromClassPath |
|
1891 |
label: 'Remove from Java Class Path' |
|
1892 |
isVisible: javaSupportLoaded |
|
1893 |
) |
|
1894 |
(MenuItem |
|
1895 |
enabled: canAddToSourcePath |
|
1896 |
label: 'Add to Java Source Path' |
|
1897 |
isVisible: javaSupportLoaded |
|
1898 |
) |
|
1899 |
(MenuItem |
|
1900 |
enabled: canRemoveFromSourcePath |
|
1901 |
label: 'Remove from Java Source Path' |
|
1902 |
isVisible: javaSupportLoaded |
|
1903 |
) |
|
1904 |
) |
|
1905 |
nil |
|
1906 |
nil |
|
1907 |
) |
|
1908 |
! |
|
1909 |
||
1910 |
fileOpMenu |
|
1911 |
"This resource specification was automatically generated |
|
1912 |
by the MenuEditor of ST/X." |
|
1913 |
||
1914 |
"Do not manually edit this!! If it is corrupted, |
|
1915 |
the MenuEditor may not be able to read the specification." |
|
1916 |
||
1917 |
||
1918 |
" |
|
1919 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#fileOpMenu |
|
1920 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser fileOpMenu)) startUp |
|
1921 |
" |
|
1922 |
||
1923 |
<resource: #menu> |
|
1924 |
||
1925 |
^ |
|
1926 |
#(Menu |
|
1927 |
( |
|
1928 |
(MenuItem |
|
1929 |
enabled: hasFileSelection |
|
15906 | 1930 |
label: 'Split (by size)...' |
15211 | 1931 |
itemValue: splitSelectedFiles |
1932 |
) |
|
1933 |
(MenuItem |
|
1934 |
enabled: hasFileSelection |
|
15906 | 1935 |
label: 'Split (by #lines)...' |
1936 |
itemValue: splitSelectedFilesByLines |
|
1937 |
) |
|
1938 |
(MenuItem |
|
1939 |
enabled: hasFileSelection |
|
15211 | 1940 |
label: 'Join...' |
1941 |
itemValue: joinSelectedFiles |
|
1942 |
) |
|
1943 |
(MenuItem |
|
1944 |
enabled: hasFileSelection |
|
1945 |
label: 'Copy Corrupted File To...' |
|
1946 |
itemValue: copySelectionToRepairingCorruptedFiles |
|
1947 |
) |
|
1948 |
(MenuItem |
|
15569 | 1949 |
label: 'Copy Corrupted File From -> To...' |
1950 |
itemValue: copyFromToRepairingCorruptedFiles |
|
1951 |
) |
|
1952 |
(MenuItem |
|
15211 | 1953 |
label: '-' |
1954 |
) |
|
1955 |
(MenuItem |
|
1956 |
enabled: hasFileSelection |
|
1957 |
label: 'Rot13...' |
|
1958 |
itemValue: filterSelectedFiles: |
|
1959 |
argument: rot13 |
|
1960 |
) |
|
1961 |
(MenuItem |
|
1962 |
label: '-' |
|
1963 |
) |
|
1964 |
(MenuItem |
|
1965 |
enabled: hasFileSelection |
|
1966 |
label: 'Truncate...' |
|
1967 |
itemValue: truncateSelectedFilesToZeroSize |
|
1968 |
) |
|
1969 |
(MenuItem |
|
1970 |
label: '-' |
|
1971 |
) |
|
1972 |
(MenuItem |
|
1973 |
label: 'Load Signature Support Package' |
|
1974 |
itemValue: loadSignatureSupport |
|
1975 |
isVisible: cannotGenerateSignatureFiles |
|
1976 |
) |
|
1977 |
(MenuItem |
|
1978 |
enabled: canGenerateSignatureFiles |
|
1979 |
label: 'Generate Signed Files' |
|
1980 |
itemValue: generateSignaturesForSelectedFiles |
|
1981 |
) |
|
1982 |
(MenuItem |
|
1983 |
enabled: canGenerateSignatureFiles |
|
1984 |
label: 'Generate Detached Signature Files (use for dll)' |
|
1985 |
itemValue: generateDetachedSignaturesForSelectedFiles |
|
1986 |
) |
|
1987 |
(MenuItem |
|
1988 |
enabled: canGenerateSignatureFiles |
|
1989 |
label: 'Generate Patch Installer for File(s)' |
|
1990 |
itemValue: generatePatchInstallerForSelectedFiles |
|
1991 |
) |
|
1992 |
(MenuItem |
|
1993 |
label: '-' |
|
1994 |
) |
|
1995 |
(MenuItem |
|
1996 |
enabled: hasFileSelection |
|
1997 |
label: 'File Differences' |
|
1998 |
itemValue: openDiffView |
|
1999 |
isVisible: hasTwoFilesSelectedHolder |
|
2000 |
) |
|
2001 |
(MenuItem |
|
2002 |
enabled: hasFileSelection |
|
2003 |
label: 'File Differences...' |
|
2004 |
itemValue: openDiffView |
|
2005 |
isVisible: hasNotTwoFilesSelectedHolder |
|
2006 |
) |
|
2007 |
(MenuItem |
|
2008 |
enabled: hasSelection |
|
2009 |
label: 'Directory Differences' |
|
2010 |
itemValue: openDirectoryDiffView |
|
2011 |
isVisible: hasTwoDirectoriesSelectedHolder |
|
2012 |
) |
|
2013 |
(MenuItem |
|
2014 |
enabled: hasSelection |
|
2015 |
label: 'Directory Differences...' |
|
2016 |
itemValue: openDirectoryDiffView |
|
2017 |
isVisible: hasNotTwoDirectoriesSelectedHolder |
|
2018 |
) |
|
17831 | 2019 |
(MenuItem |
2020 |
label: '-' |
|
2021 |
) |
|
2022 |
(MenuItem |
|
2023 |
label: 'Remove .bak and .sav Files...' |
|
2024 |
itemValue: removeBakAndSavFiles |
|
2025 |
) |
|
15211 | 2026 |
) |
2027 |
nil |
|
2028 |
nil |
|
2029 |
) |
|
2030 |
! |
|
2031 |
||
2032 |
newMenu |
|
2033 |
"This resource specification was automatically generated |
|
2034 |
by the MenuEditor of ST/X." |
|
2035 |
||
2036 |
"Do not manually edit this!! If it is corrupted, |
|
2037 |
the MenuEditor may not be able to read the specification." |
|
2038 |
||
2039 |
" |
|
2040 |
MenuEditor new openOnClass:DirectoryTreeBrowser andSelector:#newMenu |
|
2041 |
(Menu new fromLiteralArrayEncoding:(DirectoryTreeBrowser newMenu)) startUp |
|
2042 |
" |
|
2043 |
||
2044 |
<resource: #menu> |
|
2045 |
||
2046 |
^ |
|
2047 |
#(#Menu |
|
2048 |
#( |
|
2049 |
#(#MenuItem |
|
2050 |
#label: 'Directory...' |
|
2051 |
#translateLabel: true |
|
2052 |
#value: #newDirectory |
|
2053 |
) |
|
2054 |
#(#MenuItem |
|
2055 |
#label: 'File...' |
|
2056 |
#translateLabel: true |
|
2057 |
#value: #newFile |
|
2058 |
) |
|
2059 |
#(#MenuItem |
|
2060 |
#label: 'Hard Link...' |
|
2061 |
#translateLabel: true |
|
2062 |
#value: #newHardLink |
|
2063 |
) |
|
2064 |
#(#MenuItem |
|
2065 |
#label: 'Symbolic Link...' |
|
2066 |
#translateLabel: true |
|
2067 |
#value: #newSoftLink |
|
2068 |
) |
|
2069 |
) |
|
2070 |
nil |
|
2071 |
nil |
|
2072 |
) |
|
2073 |
! |
|
2074 |
||
2075 |
scmMenuSlice |
|
2076 |
"This resource specification was automatically generated |
|
2077 |
by the MenuEditor of ST/X." |
|
2078 |
||
2079 |
"Do not manually edit this!! If it is corrupted, |
|
2080 |
the MenuEditor may not be able to read the specification." |
|
2081 |
||
2082 |
||
2083 |
" |
|
2084 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#scmMenuSlice |
|
2085 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser scmMenuSlice)) startUp |
|
2086 |
" |
|
2087 |
||
2088 |
<resource: #menu> |
|
2089 |
||
2090 |
^ |
|
2091 |
#(Menu |
|
2092 |
( |
|
2093 |
(MenuItem |
|
2094 |
label: 'CVS' |
|
2095 |
isVisible: cvsMenusAreShown |
|
2096 |
submenuChannel: cvsMenu |
|
2097 |
) |
|
2098 |
(MenuItem |
|
2099 |
label: 'SVN' |
|
2100 |
isVisible: svnMenusAreShown |
|
2101 |
submenuChannel: svnMenu |
|
2102 |
) |
|
2103 |
(MenuItem |
|
2104 |
label: 'Mercurial' |
|
2105 |
isVisible: mercurialMenusAreShown |
|
2106 |
submenuChannel: mercurialMenu |
|
2107 |
) |
|
2108 |
(MenuItem |
|
2109 |
label: 'HG' |
|
2110 |
isVisible: hgMenusAreShown |
|
2111 |
submenuChannel: hgMenu |
|
2112 |
) |
|
2113 |
(MenuItem |
|
2114 |
label: 'Perforce' |
|
2115 |
isVisible: perforceMenusAreShown |
|
2116 |
submenuChannel: perforceMenu |
|
2117 |
) |
|
2118 |
) |
|
2119 |
nil |
|
2120 |
nil |
|
2121 |
) |
|
2122 |
! |
|
2123 |
||
2124 |
showMenuSpec |
|
2125 |
"This resource specification was automatically generated |
|
2126 |
by the MenuEditor of ST/X." |
|
2127 |
||
2128 |
"Do not manually edit this!! If it is corrupted, |
|
2129 |
the MenuEditor may not be able to read the specification." |
|
2130 |
||
2131 |
" |
|
2132 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#showMenuSpec |
|
2133 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser showMenuSpec)) startUp |
|
2134 |
" |
|
2135 |
||
2136 |
<resource: #menu> |
|
2137 |
||
2138 |
^ |
|
2139 |
#(Menu |
|
2140 |
( |
|
2141 |
(MenuItem |
|
2142 |
label: 'Hidden Files' |
|
2143 |
translateLabel: true |
|
2144 |
hideMenuOnActivated: false |
|
2145 |
indication: showHiddenFiles |
|
2146 |
) |
|
2147 |
(MenuItem |
|
2148 |
label: '-' |
|
2149 |
) |
|
2150 |
(MenuItem |
|
2151 |
label: 'Directory Tree' |
|
2152 |
translateLabel: true |
|
2153 |
hideMenuOnActivated: false |
|
2154 |
indication: showDirectoryTree |
|
2155 |
) |
|
2156 |
(MenuItem |
|
2157 |
label: 'Regular Files in TreeView (Left)' |
|
2158 |
translateLabel: true |
|
2159 |
hideMenuOnActivated: false |
|
2160 |
indication: viewFilesInDirectoryTree |
|
2161 |
) |
|
2162 |
(MenuItem |
|
2163 |
label: 'Directories in ContentsView (Right)' |
|
2164 |
translateLabel: true |
|
2165 |
hideMenuOnActivated: false |
|
2166 |
indication: viewDirsInContentsBrowser |
|
2167 |
) |
|
2168 |
(MenuItem |
|
2169 |
enabled: enableViewNoteBookApplication |
|
2170 |
label: 'File Applications' |
|
2171 |
translateLabel: true |
|
2172 |
hideMenuOnActivated: false |
|
2173 |
indication: viewNoteBookApplicationHolder |
|
2174 |
) |
|
2175 |
(MenuItem |
|
2176 |
label: '-' |
|
2177 |
) |
|
2178 |
(MenuItem |
|
2179 |
label: 'DiskUsage' |
|
2180 |
translateLabel: true |
|
2181 |
hideMenuOnActivated: false |
|
2182 |
indication: showDiskUsageHolder |
|
2183 |
) |
|
2184 |
) |
|
2185 |
nil |
|
2186 |
nil |
|
2187 |
) |
|
2188 |
! |
|
2189 |
||
2190 |
showMenuSpecForDialog |
|
2191 |
"This resource specification was automatically generated |
|
2192 |
by the MenuEditor of ST/X." |
|
2193 |
||
2194 |
"Do not manually edit this!! If it is corrupted, |
|
2195 |
the MenuEditor may not be able to read the specification." |
|
2196 |
||
2197 |
" |
|
2198 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#showMenuSpecForDialog |
|
2199 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser showMenuSpecForDialog)) startUp |
|
2200 |
" |
|
2201 |
||
2202 |
<resource: #menu> |
|
2203 |
||
2204 |
^ |
|
2205 |
#(Menu |
|
2206 |
( |
|
2207 |
(MenuItem |
|
2208 |
label: 'Hidden Files' |
|
2209 |
translateLabel: true |
|
2210 |
hideMenuOnActivated: false |
|
2211 |
indication: showHiddenFiles |
|
2212 |
) |
|
2213 |
) |
|
2214 |
nil |
|
2215 |
nil |
|
2216 |
) |
|
2217 |
! |
|
2218 |
||
2219 |
sortMenu |
|
2220 |
"This resource specification was automatically generated |
|
2221 |
by the MenuEditor of ST/X." |
|
2222 |
||
2223 |
"Do not manually edit this!! If it is corrupted, |
|
2224 |
the MenuEditor may not be able to read the specification." |
|
2225 |
||
2226 |
" |
|
2227 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#sortMenu |
|
2228 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser sortMenu)) startUp |
|
2229 |
" |
|
2230 |
||
2231 |
<resource: #menu> |
|
2232 |
||
2233 |
^ |
|
2234 |
#(#Menu |
|
2235 |
#( |
|
2236 |
#(#MenuItem |
|
2237 |
#label: 'By Filename' |
|
2238 |
#translateLabel: true |
|
2239 |
#hideMenuOnActivated: false |
|
2240 |
#choice: #sortBlockProperty |
|
2241 |
#choiceValue: #baseName |
|
2242 |
) |
|
2243 |
#(#MenuItem |
|
2244 |
#label: 'By Extension' |
|
2245 |
#translateLabel: true |
|
2246 |
#hideMenuOnActivated: false |
|
2247 |
#choice: #sortBlockProperty |
|
2248 |
#choiceValue: #suffix |
|
2249 |
) |
|
2250 |
#(#MenuItem |
|
2251 |
#label: 'By Permissions' |
|
2252 |
#translateLabel: true |
|
2253 |
#hideMenuOnActivated: false |
|
2254 |
#choice: #sortBlockProperty |
|
2255 |
#choiceValue: #permissions |
|
2256 |
) |
|
2257 |
#(#MenuItem |
|
2258 |
#label: 'By Owner' |
|
2259 |
#translateLabel: true |
|
2260 |
#isVisible: #viewOwner |
|
2261 |
#hideMenuOnActivated: false |
|
2262 |
#choice: #sortBlockProperty |
|
2263 |
#choiceValue: #owner |
|
2264 |
) |
|
2265 |
#(#MenuItem |
|
2266 |
#label: 'By Group' |
|
2267 |
#translateLabel: true |
|
2268 |
#isVisible: #viewOwner |
|
2269 |
#hideMenuOnActivated: false |
|
2270 |
#choice: #sortBlockProperty |
|
2271 |
#choiceValue: #group |
|
2272 |
) |
|
2273 |
#(#MenuItem |
|
2274 |
#label: 'By Size' |
|
2275 |
#translateLabel: true |
|
2276 |
#hideMenuOnActivated: false |
|
2277 |
#choice: #sortBlockProperty |
|
2278 |
#choiceValue: #fileSize |
|
2279 |
) |
|
2280 |
#(#MenuItem |
|
2281 |
#label: 'By Date && Time' |
|
2282 |
#translateLabel: true |
|
2283 |
#hideMenuOnActivated: false |
|
2284 |
#choice: #sortBlockProperty |
|
2285 |
#choiceValue: #modificationTime |
|
2286 |
) |
|
2287 |
#(#MenuItem |
|
2288 |
#label: '-' |
|
2289 |
) |
|
2290 |
#(#MenuItem |
|
2291 |
#label: 'Ignore Case in Sort' |
|
2292 |
#translateLabel: true |
|
2293 |
#hideMenuOnActivated: false |
|
2294 |
#indication: #sortCaseless |
|
2295 |
) |
|
2296 |
#(#MenuItem |
|
2297 |
#label: 'Directories before Files' |
|
2298 |
#translateLabel: true |
|
2299 |
#hideMenuOnActivated: false |
|
2300 |
#indication: #sortDirectoriesBeforeFiles |
|
2301 |
) |
|
2302 |
) |
|
2303 |
nil |
|
2304 |
nil |
|
2305 |
) |
|
2306 |
! |
|
2307 |
||
2308 |
toolsMenuSpec |
|
2309 |
"This resource specification was automatically generated |
|
2310 |
by the MenuEditor of ST/X." |
|
2311 |
||
2312 |
"Do not manually edit this!! If it is corrupted, |
|
2313 |
the MenuEditor may not be able to read the specification." |
|
2314 |
||
2315 |
||
2316 |
" |
|
2317 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#toolsMenuSpec |
|
2318 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser toolsMenuSpec)) startUp |
|
2319 |
" |
|
2320 |
||
2321 |
<resource: #menu> |
|
2322 |
||
2323 |
^ |
|
2324 |
#(Menu |
|
2325 |
( |
|
2326 |
(MenuItem |
|
2327 |
label: 'Open (Win32-Shell)' |
|
2328 |
itemValue: doOpenWithShellCommand |
|
2329 |
isVisible: systemIsDOS |
|
2330 |
) |
|
2331 |
(MenuItem |
|
18013 | 2332 |
label: 'Open (OSX-Application)' |
2333 |
itemValue: doOpenWithShellCommand |
|
2334 |
isVisible: systemIsOSX |
|
2335 |
) |
|
2336 |
(MenuItem |
|
15211 | 2337 |
label: 'Execute UNIX Command...' |
2338 |
itemValue: doExecuteCommand |
|
2339 |
isVisible: systemIsUnix |
|
2340 |
) |
|
2341 |
(MenuItem |
|
2342 |
label: 'Execute DOS Command...' |
|
2343 |
itemValue: doExecuteCommand |
|
2344 |
isVisible: systemIsDOS |
|
2345 |
) |
|
2346 |
(MenuItem |
|
2347 |
label: 'Execute Script...' |
|
2348 |
itemValue: doExecuteScript |
|
2349 |
) |
|
2350 |
(MenuItem |
|
2351 |
enabled: canDoTerminal |
|
2352 |
label: 'Shell Terminal' |
|
2353 |
itemValue: openTerminal |
|
2354 |
isVisible: canDoTerminalAndSystemIsUnix |
|
2355 |
labelImage: (ResourceRetriever ToolbarIconLibrary terminal16x16Icon 'Shell Terminal') |
|
2356 |
) |
|
2357 |
(MenuItem |
|
2358 |
enabled: canDoTerminal |
|
2359 |
label: 'DOS Terminal' |
|
2360 |
itemValue: openTerminal |
|
2361 |
isVisible: canDoTerminalAndSystemIsDOS |
|
2362 |
labelImage: (ResourceRetriever ToolbarIconLibrary terminal16x16Icon 'DOS Terminal') |
|
2363 |
) |
|
2364 |
(MenuItem |
|
2365 |
label: '-' |
|
2366 |
) |
|
2367 |
(MenuItem |
|
2368 |
enabled: hasFileSelection |
|
2369 |
label: 'Changes Browser' |
|
2370 |
itemValue: openChangesBrowser |
|
2371 |
) |
|
2372 |
(MenuItem |
|
2373 |
enabled: hasFileSelection |
|
2374 |
label: 'ChangeSet Browser' |
|
2375 |
itemValue: openChangeSetBrowser |
|
2376 |
isVisible: changeSetBrowserItemVisible |
|
2377 |
) |
|
2378 |
(MenuItem |
|
2379 |
enabled: hasFileSelection |
|
2380 |
label: 'Workspace' |
|
2381 |
itemValue: openWorkspace |
|
2382 |
) |
|
2383 |
(MenuItem |
|
2384 |
label: '-' |
|
2385 |
) |
|
2386 |
(MenuItem |
|
2387 |
enabled: canReadAbbrevFile |
|
2388 |
label: 'Install Autoloaded' |
|
2389 |
itemValue: readAbbrevFile |
|
2390 |
) |
|
2391 |
(MenuItem |
|
2392 |
enabled: anySTFilesPresent |
|
2393 |
label: 'Install all ST-Files as Autoloaded' |
|
2394 |
itemValue: installAllAsAutoloaded |
|
2395 |
) |
|
2396 |
(MenuItem |
|
2397 |
enabled: recursiveAnySTFilesPresent |
|
2398 |
label: 'Recursive Install all ST-Files as Autoloaded' |
|
2399 |
itemValue: installAllAsAutoloadedRecursive |
|
2400 |
) |
|
2401 |
(MenuItem |
|
2402 |
label: '-' |
|
2403 |
) |
|
2404 |
(MenuItem |
|
2405 |
enabled: hasJava |
|
2406 |
label: 'Add Directory to Java Source Path (stx:libjava)' |
|
2407 |
itemValue: addDirToJavaSourcePath |
|
2408 |
) |
|
2409 |
(MenuItem |
|
2410 |
enabled: hasJava |
|
2411 |
label: 'Add Selected Files to Java Source Path (stx:libjava)' |
|
2412 |
itemValue: fileAddToJavaSourcePath |
|
2413 |
) |
|
2414 |
(MenuItem |
|
2415 |
label: '-' |
|
2416 |
) |
|
2417 |
(MenuItem |
|
2418 |
label: 'File Operations' |
|
2419 |
submenuChannel: fileOpMenu |
|
2420 |
) |
|
2421 |
(MenuItem |
|
2422 |
label: 'File Utilities' |
|
2423 |
submenu: |
|
2424 |
(Menu |
|
2425 |
( |
|
2426 |
(MenuItem |
|
2427 |
enabled: hasFileSelection |
|
2428 |
label: 'Editor' |
|
2429 |
itemValue: openEditor |
|
2430 |
) |
|
2431 |
(MenuItem |
|
2432 |
enabled: hasFileSelection |
|
2433 |
label: 'HTML Reader' |
|
2434 |
itemValue: openHTMLReader |
|
2435 |
) |
|
2436 |
(MenuItem |
|
2437 |
enabled: hasFileSelection |
|
2438 |
label: 'Web Browser' |
|
2439 |
itemValue: openWebBrowser |
|
2440 |
) |
|
2441 |
(MenuItem |
|
2442 |
label: 'XML Inspector' |
|
2443 |
itemValue: inspectXmlFile |
|
2444 |
isVisible: hasXml |
|
2445 |
showBusyCursorWhilePerforming: true |
|
2446 |
) |
|
2447 |
(MenuItem |
|
2448 |
enabled: hasFileSelection |
|
2449 |
label: 'Acroread (PDF Viewer)' |
|
2450 |
itemValue: openPDFViewer |
|
2451 |
) |
|
2452 |
(MenuItem |
|
2453 |
enabled: hasASN1AndSelection |
|
2454 |
label: 'ASN1 Browser' |
|
2455 |
itemValue: openASN1Browser |
|
2456 |
isVisible: hasASN1 |
|
2457 |
) |
|
2458 |
(MenuItem |
|
2459 |
enabled: hasCBrowser |
|
2460 |
label: 'C Browser' |
|
2461 |
itemValue: openCBrowser |
|
2462 |
isVisible: hasCBrowser |
|
2463 |
) |
|
2464 |
(MenuItem |
|
2465 |
enabled: canOpenMonticelloBrowser |
|
2466 |
label: 'Monticello Browser' |
|
2467 |
itemValue: doOpenMonticelloBrowser |
|
2468 |
) |
|
2469 |
(MenuItem |
|
2470 |
enabled: hasJavaAndSelection |
|
2471 |
label: 'Applet Viewer' |
|
2472 |
itemValue: openAppletViewer |
|
2473 |
isVisible: hasJava |
|
2474 |
) |
|
2475 |
(MenuItem |
|
2476 |
enabled: hasMP3PlayerAndSelection |
|
2477 |
label: 'MP3 Player' |
|
2478 |
itemValue: openMP3Player |
|
2479 |
isVisible: hasMP3Player |
|
2480 |
) |
|
2481 |
(MenuItem |
|
2482 |
enabled: hasFileSelection |
|
2483 |
label: 'xv (Image Viewer)' |
|
2484 |
itemValue: openXV |
|
2485 |
isVisible: systemIsUnix |
|
2486 |
) |
|
2487 |
(MenuItem |
|
2488 |
enabled: currentFilesAreInSameDirectory |
|
2489 |
label: 'Slide Show' |
|
2490 |
itemValue: openSlideShow |
|
2491 |
isVisible: hasSlideShow |
|
2492 |
) |
|
2493 |
(MenuItem |
|
2494 |
enabled: hasFileSelection |
|
2495 |
label: 'gv (Postscript Viewer)' |
|
2496 |
itemValue: openGV |
|
2497 |
isVisible: systemIsUnix |
|
2498 |
) |
|
2499 |
(MenuItem |
|
2500 |
enabled: hasMP3PlayerAndSelection |
|
2501 |
label: 'MP3 Player' |
|
2502 |
itemValue: openMP3Player |
|
2503 |
isVisible: hasMP3Player |
|
2504 |
) |
|
2505 |
(MenuItem |
|
2506 |
enabled: hasFileSelection |
|
2507 |
label: 'Realplay (avi viewer)' |
|
2508 |
itemValue: openRP |
|
2509 |
isVisible: systemIsUnix |
|
2510 |
) |
|
2511 |
(MenuItem |
|
2512 |
label: '-' |
|
2513 |
) |
|
2514 |
(MenuItem |
|
2515 |
label: 'Smalltalk' |
|
2516 |
submenu: |
|
2517 |
(Menu |
|
2518 |
( |
|
2519 |
(MenuItem |
|
2520 |
enabled: hasSnapshotSelection |
|
2521 |
label: 'Snapshot Image Browser' |
|
2522 |
itemValue: openSnapshotImageBrowser |
|
2523 |
) |
|
2524 |
(MenuItem |
|
2525 |
enabled: canCreateNewProject |
|
2526 |
label: 'Create Smalltalk Project' |
|
2527 |
itemValue: createProjectAndOpenProjectBrowser |
|
2528 |
) |
|
2529 |
(MenuItem |
|
2530 |
label: '-' |
|
2531 |
) |
|
2532 |
(MenuItem |
|
2533 |
enabled: hasResourceFileSelected |
|
2534 |
label: 'Show Contents of Resourcefile' |
|
2535 |
itemValue: readAndShowResources |
|
2536 |
) |
|
2537 |
(MenuItem |
|
2538 |
enabled: hasResourceFileSelected |
|
2539 |
label: 'Resource File Editor' |
|
2540 |
itemValue: openResourceFileEditor |
|
2541 |
showBusyCursorWhilePerforming: true |
|
2542 |
) |
|
2543 |
(MenuItem |
|
2544 |
label: '-' |
|
2545 |
) |
|
2546 |
(MenuItem |
|
2547 |
enabled: hasFileSelection |
|
2548 |
label: 'Contents as ByteArray' |
|
2549 |
itemValue: fileContentsAsByteArray |
|
2550 |
) |
|
2551 |
) |
|
2552 |
nil |
|
2553 |
nil |
|
2554 |
) |
|
2555 |
) |
|
2556 |
(MenuItem |
|
2557 |
label: 'Image' |
|
2558 |
submenu: |
|
2559 |
(Menu |
|
2560 |
( |
|
2561 |
(MenuItem |
|
2562 |
enabled: hasFileSelection |
|
2563 |
label: 'Image Editor' |
|
2564 |
itemValue: openImageEditor |
|
2565 |
) |
|
2566 |
(MenuItem |
|
2567 |
enabled: hasFileSelection |
|
2568 |
label: 'Image Preview' |
|
2569 |
itemValue: openImagePreview |
|
2570 |
) |
|
2571 |
(MenuItem |
|
2572 |
enabled: hasFileSelection |
|
2573 |
label: 'Image Inspector' |
|
2574 |
itemValue: openImageInspector |
|
2575 |
) |
|
2576 |
(MenuItem |
|
2577 |
label: '-' |
|
2578 |
) |
|
2579 |
(MenuItem |
|
2580 |
enabled: hasFileSelection |
|
2581 |
label: 'Convert to GIF' |
|
2582 |
itemValue: convertImageToGIF |
|
2583 |
) |
|
2584 |
(MenuItem |
|
2585 |
enabled: hasFileSelection |
|
2586 |
label: 'Convert to PNG' |
|
2587 |
itemValue: convertImageToPNG |
|
2588 |
) |
|
2589 |
(MenuItem |
|
2590 |
enabled: hasFileSelection |
|
2591 |
label: 'Convert to XPM' |
|
2592 |
itemValue: convertImageToXPM |
|
2593 |
) |
|
2594 |
(MenuItem |
|
2595 |
enabled: hasFileSelection |
|
2596 |
label: 'Convert to JPG' |
|
2597 |
itemValue: convertImageToJPG |
|
2598 |
) |
|
2599 |
) |
|
2600 |
nil |
|
2601 |
nil |
|
2602 |
) |
|
2603 |
) |
|
2604 |
(MenuItem |
|
15528 | 2605 |
label: 'Web' |
2606 |
submenu: |
|
2607 |
(Menu |
|
2608 |
( |
|
2609 |
(MenuItem |
|
2610 |
label: 'Fetch File by URL...' |
|
2611 |
itemValue: fetchFileByURL |
|
2612 |
) |
|
2613 |
) |
|
2614 |
nil |
|
2615 |
nil |
|
2616 |
) |
|
2617 |
) |
|
2618 |
(MenuItem |
|
15211 | 2619 |
enabled: hasZipFileSelectedHolder |
2620 |
label: 'ZipFile Tool' |
|
2621 |
itemValue: openZipTool |
|
2622 |
) |
|
2623 |
(MenuItem |
|
2624 |
enabled: hasFileSelection |
|
2625 |
label: 'Hex Dump' |
|
2626 |
itemValue: fileHexDump |
|
2627 |
) |
|
2628 |
) |
|
2629 |
nil |
|
2630 |
nil |
|
2631 |
) |
|
2632 |
) |
|
2633 |
(MenuItem |
|
2634 |
label: 'Find' |
|
2635 |
submenu: |
|
2636 |
(Menu |
|
2637 |
( |
|
2638 |
(MenuItem |
|
2639 |
label: 'File...' |
|
2640 |
itemValue: fileFindFile |
|
2641 |
) |
|
2642 |
(MenuItem |
|
2643 |
enabled: hasFileSelection |
|
2644 |
label: 'Same Contents as Selected...' |
|
2645 |
itemValue: fileFindDuplicateFile |
|
2646 |
) |
|
2647 |
(MenuItem |
|
2648 |
label: 'Duplicate Files' |
|
2649 |
itemValue: fileFindDuplicates |
|
2650 |
) |
|
2651 |
(MenuItem |
|
2652 |
enabled: hasSelection |
|
2653 |
label: 'All Duplicate Files (Recursive)' |
|
2654 |
itemValue: fileFindAllDuplicates |
|
2655 |
) |
|
2656 |
(MenuItem |
|
17686 | 2657 |
label: 'Similar Image Files (by Colors)' |
15211 | 2658 |
itemValue: fileFindSimilarImages |
2659 |
isVisible: hasImageColorHistogram |
|
2660 |
) |
|
17686 | 2661 |
(MenuItem |
2662 |
label: 'Similar Image Files (by Form)' |
|
2663 |
itemValue: fileFindSimilarImagesByForm |
|
2664 |
isVisible: hasImageHistogram |
|
2665 |
) |
|
15211 | 2666 |
) |
2667 |
nil |
|
2668 |
nil |
|
2669 |
) |
|
2670 |
) |
|
2671 |
) |
|
2672 |
nil |
|
2673 |
nil |
|
2674 |
) |
|
17686 | 2675 |
|
2676 |
"Modified: / 10-09-2017 / 16:50:09 / cg" |
|
15211 | 2677 |
! |
2678 |
||
2679 |
viewDetailsMenuSpec |
|
2680 |
"This resource specification was automatically generated |
|
2681 |
by the MenuEditor of ST/X." |
|
2682 |
||
2683 |
"Do not manually edit this!! If it is corrupted, |
|
2684 |
the MenuEditor may not be able to read the specification." |
|
2685 |
||
2686 |
" |
|
2687 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#viewDetailsMenuSpec |
|
2688 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser viewDetailsMenuSpec)) startUp |
|
2689 |
" |
|
2690 |
||
2691 |
<resource: #menu> |
|
2692 |
||
2693 |
^ |
|
2694 |
#(#Menu |
|
2695 |
#( |
|
2696 |
#(#MenuItem |
|
2697 |
#label: '-' |
|
2698 |
) |
|
2699 |
#(#MenuItem |
|
2700 |
#label: 'Hidden Files' |
|
2701 |
#translateLabel: true |
|
2702 |
#indication: #showHiddenFiles |
|
2703 |
) |
|
2704 |
) |
|
2705 |
nil |
|
2706 |
nil |
|
2707 |
) |
|
2708 |
! ! |
|
3892 | 2709 |
|
11144 | 2710 |
!AbstractFileBrowser class methodsFor:'menu specs-scm'! |
2711 |
||
15211 | 2712 |
cvsMenu |
2713 |
"This resource specification was automatically generated |
|
2714 |
by the MenuEditor of ST/X." |
|
2715 |
||
2716 |
"Do not manually edit this!! If it is corrupted, |
|
2717 |
the MenuEditor may not be able to read the specification." |
|
2718 |
||
2719 |
||
2720 |
" |
|
2721 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#cvsMenu |
|
2722 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser cvsMenu)) startUp |
|
2723 |
" |
|
2724 |
||
2725 |
<resource: #menu> |
|
2726 |
||
2727 |
^ |
|
2728 |
#(Menu |
|
2729 |
( |
|
2730 |
(MenuItem |
|
2731 |
label: 'Commit (CVS)...' |
|
2732 |
itemValue: cvsCommit |
|
2733 |
translateLabel: true |
|
2734 |
) |
|
2735 |
(MenuItem |
|
2736 |
enabled: canCvsAddAndCommit |
|
2737 |
label: 'Add && Commit...' |
|
2738 |
itemValue: cvsAddAndCommit |
|
2739 |
translateLabel: true |
|
2740 |
) |
|
2741 |
(MenuItem |
|
2742 |
enabled: canCvsAddAndCommit |
|
2743 |
label: 'Add as Binary && Commit...' |
|
2744 |
itemValue: cvsAddBinaryAndCommit |
|
2745 |
translateLabel: true |
|
2746 |
) |
|
2747 |
(MenuItem |
|
2748 |
label: 'Commit Folder (CVS)...' |
|
2749 |
itemValue: cvsCommitFolder |
|
2750 |
translateLabel: true |
|
2751 |
) |
|
2752 |
(MenuItem |
|
2753 |
label: '-' |
|
2754 |
) |
|
2755 |
(MenuItem |
|
2756 |
enabled: hasSelection |
|
2757 |
label: 'Update selected Files/Directories' |
|
2758 |
itemValue: cvsUpdateSelection |
|
2759 |
translateLabel: true |
|
2760 |
) |
|
2761 |
(MenuItem |
|
2762 |
label: 'Update Directory Local' |
|
2763 |
itemValue: cvsUpdateAll |
|
2764 |
translateLabel: true |
|
2765 |
) |
|
2766 |
(MenuItem |
|
2767 |
label: 'Update Directory Recursive' |
|
2768 |
itemValue: cvsUpdateAllRecursive |
|
2769 |
translateLabel: true |
|
2770 |
) |
|
2771 |
(MenuItem |
|
2772 |
label: '-' |
|
2773 |
) |
|
2774 |
(MenuItem |
|
2775 |
enabled: hasSelection |
|
2776 |
label: 'Tag...' |
|
2777 |
itemValue: cvsTagSelection |
|
2778 |
translateLabel: true |
|
2779 |
) |
|
2780 |
(MenuItem |
|
2781 |
enabled: hasSelection |
|
2782 |
label: 'Revision Log' |
|
2783 |
itemValue: cvsRevisionLog |
|
2784 |
translateLabel: true |
|
2785 |
) |
|
2786 |
(MenuItem |
|
2787 |
enabled: hasSelection |
|
2788 |
label: 'Compare with newest in Repository' |
|
2789 |
itemValue: cvsCompareWithNewest |
|
2790 |
translateLabel: true |
|
2791 |
) |
|
2792 |
(MenuItem |
|
2793 |
label: '-' |
|
2794 |
) |
|
2795 |
(MenuItem |
|
2796 |
enabled: canRemoveCVSContainer |
|
2797 |
label: 'Remove File && CVS Container...' |
|
2798 |
itemValue: cvsRemoveFileAndCVSContainer |
|
2799 |
translateLabel: true |
|
2800 |
) |
|
2801 |
) |
|
2802 |
nil |
|
2803 |
nil |
|
2804 |
) |
|
2805 |
! |
|
2806 |
||
2807 |
mercurialMenu |
|
2808 |
"This resource specification was automatically generated |
|
2809 |
by the MenuEditor of ST/X." |
|
2810 |
||
2811 |
"Do not manually edit this!! If it is corrupted, |
|
2812 |
the MenuEditor may not be able to read the specification." |
|
2813 |
||
2814 |
||
2815 |
" |
|
2816 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#mercurialMenu |
|
2817 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser mercurialMenu)) startUp |
|
2818 |
" |
|
2819 |
||
2820 |
<resource: #menu> |
|
2821 |
||
2822 |
^ |
|
2823 |
#(Menu |
|
2824 |
( |
|
2825 |
(MenuItem |
|
2826 |
label: 'Add' |
|
2827 |
itemValue: mercurialAdd |
|
2828 |
translateLabel: true |
|
2829 |
) |
|
2830 |
(MenuItem |
|
2831 |
label: 'Commit Changes' |
|
2832 |
itemValue: mercurialCommit |
|
2833 |
translateLabel: true |
|
2834 |
) |
|
2835 |
(MenuItem |
|
2836 |
label: 'Push...' |
|
2837 |
itemValue: mercurialPush |
|
2838 |
translateLabel: true |
|
2839 |
) |
|
2840 |
(MenuItem |
|
2841 |
label: 'Status' |
|
2842 |
itemValue: mercurialStatus |
|
2843 |
translateLabel: true |
|
2844 |
) |
|
2845 |
(MenuItem |
|
2846 |
label: '-' |
|
2847 |
) |
|
2848 |
(MenuItem |
|
2849 |
label: 'Init' |
|
2850 |
itemValue: mercurialInit |
|
2851 |
translateLabel: true |
|
2852 |
) |
|
2853 |
) |
|
2854 |
nil |
|
2855 |
nil |
|
2856 |
) |
|
2857 |
||
2858 |
"Modified: / 17-01-2012 / 15:57:40 / cg" |
|
2859 |
! |
|
2860 |
||
2861 |
perforceMenu |
|
2862 |
"This resource specification was automatically generated |
|
2863 |
by the MenuEditor of ST/X." |
|
2864 |
||
2865 |
"Do not manually edit this!! If it is corrupted, |
|
2866 |
the MenuEditor may not be able to read the specification." |
|
2867 |
||
2868 |
||
2869 |
" |
|
2870 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#perforceMenu |
|
2871 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser perforceMenu)) startUp |
|
2872 |
" |
|
2873 |
||
2874 |
<resource: #menu> |
|
2875 |
||
2876 |
^ |
|
2877 |
#(Menu |
|
2878 |
( |
|
2879 |
(MenuItem |
|
2880 |
label: 'Commit' |
|
2881 |
itemValue: perforceCommit |
|
2882 |
translateLabel: true |
|
2883 |
) |
|
2884 |
) |
|
2885 |
nil |
|
2886 |
nil |
|
2887 |
) |
|
2888 |
||
2889 |
"Created: / 15-01-2012 / 13:12:30 / cg" |
|
2890 |
! ! |
|
11144 | 2891 |
|
3892 | 2892 |
!AbstractFileBrowser class methodsFor:'misc'! |
2893 |
||
2894 |
newLock |
|
2895 |
^ CodeExecutionLock new |
|
2896 |
! ! |
|
2897 |
||
17288 | 2898 |
!AbstractFileBrowser class methodsFor:'queries'! |
2899 |
||
2900 |
isAbstract |
|
2901 |
^ self == AbstractFileBrowser |
|
2902 |
! ! |
|
2903 |
||
17868 | 2904 |
!AbstractFileBrowser class methodsFor:'queries-file'! |
2905 |
||
2906 |
getBestDirectoryFrom:directories |
|
2907 |
"from a set of directories, return the common parent directory" |
|
2908 |
||
2909 |
|stringCol firstPre| |
|
2910 |
||
2911 |
directories isEmpty ifTrue:[^ nil]. |
|
2912 |
directories size == 1 ifTrue:[^ directories first]. |
|
2913 |
stringCol := (directories collect:[:file| file asString]) asOrderedCollection. |
|
2914 |
firstPre := stringCol at:1. |
|
2915 |
stringCol from:2 do:[:el| |
|
2916 |
firstPre := firstPre commonPrefixWith:el. |
|
2917 |
]. |
|
2918 |
(firstPre endsWith:(OperatingSystem fileSeparator)) ifTrue:[ |
|
2919 |
firstPre removeLast. |
|
2920 |
]. |
|
2921 |
^ firstPre asFilename |
|
2922 |
! ! |
|
2923 |
||
5644
e24749db1f5f
share resources with FileBrowser
Claus Gittinger <cg@exept.de>
parents:
5634
diff
changeset
|
2924 |
!AbstractFileBrowser class methodsFor:'resources'! |
e24749db1f5f
share resources with FileBrowser
Claus Gittinger <cg@exept.de>
parents:
5634
diff
changeset
|
2925 |
|
e24749db1f5f
share resources with FileBrowser
Claus Gittinger <cg@exept.de>
parents:
5634
diff
changeset
|
2926 |
classResources |
e24749db1f5f
share resources with FileBrowser
Claus Gittinger <cg@exept.de>
parents:
5634
diff
changeset
|
2927 |
^ FileBrowser classResources |
e24749db1f5f
share resources with FileBrowser
Claus Gittinger <cg@exept.de>
parents:
5634
diff
changeset
|
2928 |
! ! |
e24749db1f5f
share resources with FileBrowser
Claus Gittinger <cg@exept.de>
parents:
5634
diff
changeset
|
2929 |
|
17746 | 2930 |
!AbstractFileBrowser class methodsFor:'utilities - dump'! |
4610 | 2931 |
|
17744 | 2932 |
contentsOfBytesAsDump:data base:numberBase numberOfAddressDigits:addrDigits addressStart:virtualStart characterEncoding:characterEncodingSymbol |
2933 |
"utility helper: generate a hexDump with addresses; |
|
2934 |
characterEncodingSymbol determines how characters are to be shown in the right (character) columns. |
|
2935 |
By default, this is iso8859-1, but supported are also ebcdic and ascii7, |
|
2936 |
to support display of alien encoded binary data." |
|
2937 |
||
2938 |
|lines nHexLines replacementForUnprintable colsPerByte characterDecoder| |
|
2939 |
||
2940 |
(characterEncodingSymbol isNil or:[characterEncodingSymbol == #'iso8859-1']) ifFalse:[ |
|
2941 |
characterDecoder := CharacterEncoder encoderToEncodeFrom:characterEncodingSymbol into:#unicode. |
|
2942 |
]. |
|
17252 | 2943 |
|
2944 |
"/ used to be: |
|
2945 |
"/ replacementForUnprintable := $. |
|
2946 |
replacementForUnprintable := Character value:16rB7. "/ a centered dot. |
|
11281
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2947 |
|
17744 | 2948 |
"/ cols needed per byte in the hex dump |
2949 |
colsPerByte := ((255 printStringRadix:numberBase) size). |
|
2950 |
||
11281
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2951 |
"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
|
2952 |
|
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2953 |
nHexLines := (data size + 15) // 16. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2954 |
|
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2955 |
lines := VirtualArray new. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2956 |
lines setSize:nHexLines + (nHexLines // 16). |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2957 |
lines |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2958 |
generator:[:lineNr | |
17744 | 2959 |
|blockNr lineNrInBlock startOffset lineStream asciiLineStream byte line |
2960 |
decodedChar charPrinted| |
|
11281
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2961 |
|
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2962 |
blockNr := (lineNr - 1) // 17. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2963 |
lineNrInBlock := (lineNr - 1) \\ 17. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2964 |
|
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2965 |
lineNrInBlock == 16 ifTrue:[ |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2966 |
line := '' |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2967 |
] ifFalse:[ |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2968 |
startOffset := ((blockNr * 16) + lineNrInBlock) * 16. |
17744 | 2969 |
|
2970 |
"/ 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
|
2971 |
lineStream := String writeStream. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2972 |
asciiLineStream := String writeStream. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2973 |
|
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2974 |
lineStream nextPutAll:((startOffset+virtualStart) hexPrintString:addrDigits). |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2975 |
lineStream nextPutAll:': '. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2976 |
1 to:16 do:[:i | |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2977 |
i ~~ 1 ifTrue:[ lineStream space ]. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2978 |
|
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2979 |
(startOffset + i) > data size ifTrue:[ |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2980 |
asciiLineStream nextPut:(Character space). |
17744 | 2981 |
lineStream spaces:colsPerByte. |
11281
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2982 |
] ifFalse:[ |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2983 |
byte := data at:startOffset + i. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2984 |
|
17746 | 2985 |
lineStream nextPutAll:(byte printStringRadix:numberBase size:colsPerByte fill:$0). |
17744 | 2986 |
|
11281
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2987 |
|
17744 | 2988 |
decodedChar := byte. |
2989 |
characterDecoder notNil ifTrue:[ |
|
2990 |
decodedChar := characterDecoder encode:byte. |
|
2991 |
]. |
|
2992 |
||
2993 |
charPrinted := replacementForUnprintable. |
|
2994 |
decodedChar notNil ifTrue:[ |
|
2995 |
((decodedChar between:32 and:127) or:[(decodedChar between:(128+32) and:(128+127))]) ifTrue:[ |
|
2996 |
charPrinted := Character value:decodedChar. |
|
16188 | 2997 |
] ifFalse:[ |
17744 | 2998 |
(decodedChar between:0 and:31) ifTrue:[ |
2999 |
"/ the 'nul', 'soh' .. 'gs' chars in unicodePage 2400 |
|
3000 |
"/ are perfect here, but usually not available in the font |
|
3001 |
"/ and we have currently no way of knowing if they are... |
|
3002 |
"/ (could let the font draw into a bitmap and check if there is something...) |
|
18036 | 3003 |
"/ For now, write a dot.· |
17744 | 3004 |
"/ charPrinted := (Character value:(byte + 16r2400)) |
3005 |
]. |
|
16188 | 3006 |
]. |
11281
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
3007 |
]. |
17744 | 3008 |
asciiLineStream nextPut:charPrinted. |
11281
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
3009 |
]. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
3010 |
]. |
17744 | 3011 |
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
|
3012 |
, asciiLineStream contents. |
11262 | 3013 |
]. |
11281
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
3014 |
line |
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 |
^ lines. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
3017 |
|
17744 | 3018 |
"Created: / 12-11-2017 / 11:24:29 / cg" |
17750 | 3019 |
"Modified: / 12-11-2017 / 14:17:59 / cg" |
17744 | 3020 |
! |
3021 |
||
17753 | 3022 |
contentsOfBytesAsHexDump:data numberOfAddressDigits:addrDigits addressStart:virtualStart |
17744 | 3023 |
"utility helper: generate a hexDump with addresses; the character columns at the right show |
3024 |
the iso8859-1 characters" |
|
17753 | 3025 |
|
3026 |
^ self |
|
17744 | 3027 |
contentsOfBytesAsDump:data base:16 |
3028 |
numberOfAddressDigits:addrDigits |
|
3029 |
addressStart:virtualStart |
|
17753 | 3030 |
characterEncoding:#'iso8859-1' |
11262 | 3031 |
|
3032 |
"Created: / 13-02-2012 / 15:01:46 / cg" |
|
17744 | 3033 |
"Modified: / 12-11-2017 / 12:07:12 / cg" |
17753 | 3034 |
"Modified: / 14-11-2017 / 17:48:19 / mawalch" |
17744 | 3035 |
! |
3036 |
||
3037 |
contentsOfBytesAsHexDump:data numberOfAddressDigits:addrDigits addressStart:virtualStart characterEncoding:characterEncodingSymbol |
|
3038 |
"utility helper: generate a hexDump with addresses; |
|
3039 |
characterEncodingSymbol determines how characters are to be shown in the right (character) columns. |
|
3040 |
By default, this is iso8859-1, but supported are also ebcdic and ascii7, |
|
3041 |
to support display of alien encoded binary data." |
|
3042 |
||
3043 |
^ self |
|
3044 |
contentsOfBytesAsDump:data base:16 |
|
3045 |
numberOfAddressDigits:addrDigits |
|
3046 |
addressStart:virtualStart |
|
3047 |
characterEncoding:characterEncodingSymbol |
|
3048 |
||
3049 |
"Created: / 12-11-2017 / 11:21:44 / cg" |
|
3050 |
! |
|
3051 |
||
3052 |
contentsOfFileAsDump:f base:numberBase withLimit:limitOrNil lastPart:showLastPartOrNil characterEncoding:characterEncoding |
|
3053 |
"opens the file, get its contents and generates a dump for it" |
|
3054 |
||
4610 | 3055 |
|resources fileName stream data offs |
17768 | 3056 |
addrDigits lines answer sizeLimit showLastPart setNewLimit thisFileSizeString| |
4610 | 3057 |
|
3058 |
resources := self classResources. |
|
3059 |
||
3060 |
fileName := f baseName. |
|
3061 |
f isDirectory ifTrue:[ |
|
3062 |
Dialog warn:(resources string:'%1 is a directory.' with:fileName). |
|
3063 |
^ nil |
|
3064 |
]. |
|
3065 |
f exists ifFalse:[ |
|
3066 |
Dialog warn:(resources string:'oops, ''%1'' is gone or unreadable.' with:fileName). |
|
3067 |
^ nil |
|
3068 |
]. |
|
3069 |
f isReadable ifFalse:[ |
|
3070 |
Dialog warn:(resources string:'''%1'' is unreadable.' with:fileName). |
|
3071 |
^ nil |
|
3072 |
]. |
|
17768 | 3073 |
f fileSize > (self maxFileSizeShownWithoutAsking) ifTrue:[ |
8472 | 3074 |
limitOrNil notNil ifTrue:[ |
3075 |
sizeLimit := limitOrNil. |
|
3076 |
showLastPart := showLastPartOrNil |
|
3077 |
] ifFalse:[ |
|
17768 | 3078 |
setNewLimit := false. |
3079 |
thisFileSizeString := (UnitConverter fileSizeStringFor:f fileSize). |
|
3080 |
||
3081 |
Dialog |
|
3082 |
withOptoutOption:[ setNewLimit := true ] |
|
3083 |
labelled:(resources string:'No longer ask for files smaller than %1' with:thisFileSizeString) |
|
3084 |
do:[ |
|
3085 |
answer := Dialog |
|
3086 |
confirmWithCancel:(resources |
|
3087 |
stringWithCRs:'"%1" is very large (%2).\\Show all or only the first 4 Mb ?' |
|
3088 |
with:(fileName contractTo:40) allBold |
|
3089 |
with:thisFileSizeString) |
|
3090 |
labels:#('Cancel' 'Show All' 'Show First Part' ). |
|
3091 |
]. |
|
8472 | 3092 |
answer isNil ifTrue:[^ nil]. |
3093 |
answer ifTrue:[ |
|
17769 | 3094 |
sizeLimit := (4 * 1024 * 1024) "max:self maxFileSizeShownWithoutAsking". |
17768 | 3095 |
] ifFalse:[ |
3096 |
setNewLimit ifTrue:[ |
|
3097 |
self maxFileSizeShownWithoutAsking:(self maxFileSizeShownWithoutAsking max:f fileSize). |
|
3098 |
]. |
|
3099 |
]. |
|
8436 | 3100 |
]. |
4610 | 3101 |
]. |
3102 |
||
3103 |
stream := f readStream binary. |
|
8436 | 3104 |
sizeLimit notNil ifTrue:[ |
8472 | 3105 |
showLastPart == true ifTrue:[ |
3106 |
stream position:(f fileSize - sizeLimit). |
|
3107 |
]. |
|
8436 | 3108 |
data := stream nextBytes:sizeLimit. |
3109 |
] ifFalse:[ |
|
3110 |
data := stream contents. |
|
3111 |
]. |
|
4610 | 3112 |
stream close. |
3113 |
||
3114 |
offs := 0. |
|
3115 |
lines := StringCollection new. |
|
3116 |
||
3117 |
addrDigits := ((f fileSize + 1) log:16) truncated + 1. |
|
3118 |
||
11262 | 3119 |
^ self |
17744 | 3120 |
contentsOfBytesAsDump:data base:numberBase |
11262 | 3121 |
numberOfAddressDigits:addrDigits |
3122 |
addressStart:0 |
|
17744 | 3123 |
characterEncoding:characterEncoding |
3124 |
||
3125 |
"Created: / 12-11-2017 / 12:08:10 / cg" |
|
17769 | 3126 |
"Modified: / 19-11-2017 / 15:01:34 / cg" |
17744 | 3127 |
! |
3128 |
||
3129 |
contentsOfFileAsHexDump:f |
|
3130 |
"opens the file, get its contents and generates a dump for it" |
|
3131 |
||
3132 |
^ self |
|
3133 |
contentsOfFileAsHexDump:f |
|
3134 |
withLimit:nil |
|
3135 |
lastPart:nil |
|
3136 |
characterEncoding:#'iso8859-1' |
|
3137 |
||
3138 |
"Modified (comment): / 12-11-2017 / 12:09:30 / cg" |
|
3139 |
! |
|
3140 |
||
3141 |
contentsOfFileAsHexDump:f withLimit:limitOrNil lastPart:showLastPartOrNil |
|
3142 |
"opens the file, get its contents and generates a dump for it" |
|
3143 |
||
3144 |
^ self |
|
3145 |
contentsOfFileAsHexDump:f |
|
3146 |
withLimit:limitOrNil |
|
3147 |
lastPart:showLastPartOrNil |
|
3148 |
characterEncoding:#'iso-8859-1' |
|
3149 |
||
3150 |
"Modified (comment): / 12-11-2017 / 12:09:34 / cg" |
|
3151 |
! |
|
3152 |
||
3153 |
contentsOfFileAsHexDump:f withLimit:limitOrNil lastPart:showLastPartOrNil characterEncoding:characterEncoding |
|
3154 |
"opens the file, get its contents and generates a dump for it" |
|
3155 |
||
3156 |
^ self |
|
3157 |
contentsOfFileAsDump:f base:16 |
|
3158 |
withLimit:limitOrNil |
|
3159 |
lastPart:showLastPartOrNil |
|
3160 |
characterEncoding:characterEncoding |
|
3161 |
||
3162 |
"Created: / 12-11-2017 / 12:02:05 / cg" |
|
4610 | 3163 |
! ! |
3164 |
||
17868 | 3165 |
!AbstractFileBrowser class methodsFor:'utilities - files'! |
3166 |
||
3167 |
allFilesInDirectories:directories forWhich:aBlock |
|
3168 |
|allFiles| |
|
3169 |
||
3170 |
directories isEmpty ifTrue:[^ #()]. |
|
3171 |
||
3172 |
allFiles := OrderedCollection new. |
|
3173 |
directories do:[:dir| |
|
3174 |
[ |
|
3175 |
|fileNames| |
|
3176 |
||
3177 |
fileNames := dir directoryContents. |
|
3178 |
fileNames notNil ifTrue:[ |
|
3179 |
fileNames := fileNames |
|
3180 |
collect:[:fn | dir construct:fn] |
|
3181 |
thenSelect:[:fn | fn isDirectory not and:[aBlock value:fn]]. |
|
3182 |
allFiles addAll:fileNames. |
|
3183 |
] |
|
3184 |
] on:FileStream openErrorSignal do:[:ex| |
|
3185 |
self warn:(self classResources stringWithCRs:'Cannot access: %1\(%2)' |
|
3186 |
with:ex pathName |
|
3187 |
with:ex description). |
|
3188 |
ex proceedWith:nil. |
|
3189 |
]. |
|
3190 |
]. |
|
3191 |
||
3192 |
^ allFiles |
|
3193 |
! |
|
3194 |
||
3195 |
fileFindDuplicatesIn:directories |
|
3196 |
"scan directories for duplicate files. |
|
17871 | 3197 |
return a dictionary mapping duplicate files to their original; |
3198 |
the oldest file found will be the value (original), the younger files (copies) will be the keys. |
|
17868 | 3199 |
Files without duplicate(s) will not have an entry in the dictionary." |
3200 |
||
3201 |
|infoDir filesBySize anySameSized |
|
3202 |
result allFiles| |
|
3203 |
||
3204 |
directories isEmpty ifTrue:[^ #()]. |
|
3205 |
||
3206 |
allFiles := self allFilesInDirectories:directories forWhich:[:f | true]. |
|
3207 |
allFiles isEmpty ifTrue:[^ #()]. |
|
3208 |
||
3209 |
"/ for each, get the file's info (size, modificationTime etc.). |
|
3210 |
infoDir := Dictionary new. |
|
3211 |
allFiles do:[:fn | |
|
3212 |
infoDir at:fn put:(fn info) |
|
3213 |
]. |
|
3214 |
||
3215 |
"/ in a first pass, collect groups by the same size |
|
3216 |
"/ remember those fileSizes for which multiple files exist |
|
3217 |
filesBySize := Dictionary new. |
|
3218 |
anySameSized := false. |
|
3219 |
infoDir keysAndValuesDo:[:fn :info | |
|
3220 |
|sz entry| |
|
3221 |
||
3222 |
sz := info fileSize. |
|
3223 |
entry := filesBySize at:sz ifAbsentPut:[Set new]. |
|
3224 |
entry add:fn. |
|
3225 |
entry size > 1 ifTrue:[ anySameSized := true ]. |
|
3226 |
]. |
|
3227 |
||
3228 |
"/ any of same size ? |
|
3229 |
anySameSized ifFalse:[^ #() ]. |
|
3230 |
||
3231 |
result := Dictionary new. |
|
3232 |
||
3233 |
"/ now walk over the same-sized files and compare the contents. |
|
3234 |
filesBySize do:[:entry | |
|
3235 |
|files| |
|
3236 |
||
3237 |
entry size > 1 ifTrue:[ |
|
3238 |
files := entry asArray. |
|
3239 |
files |
|
3240 |
sort:[:a :b | |
|
3241 |
|tA tB| |
|
3242 |
tA := (infoDir at:a) modificationTime. |
|
3243 |
tB := (infoDir at:b) modificationTime. |
|
3244 |
tA < tB |
|
3245 |
]. |
|
3246 |
||
3247 |
1 to:files size-1 do:[:idx1 | |
|
3248 |
|fn1| |
|
3249 |
||
3250 |
fn1 := files at:idx1. |
|
3251 |
idx1+1 to:files size do:[:idx2 | |
|
3252 |
|fn2| |
|
3253 |
||
3254 |
fn2 := files at:idx2. |
|
3255 |
||
3256 |
(result at:fn2 ifAbsent:nil) ~= fn1 ifTrue:[ |
|
3257 |
"/ compare the files |
|
3258 |
(fn1 sameContentsAs:fn2) ifTrue:[ |
|
3259 |
"/ Transcript show:'Same: '; show:fn1 baseName; show:' and '; showCR:fn2 baseName. |
|
17871 | 3260 |
result at:fn2 put:fn1. |
17868 | 3261 |
] |
3262 |
] |
|
3263 |
] |
|
3264 |
] |
|
3265 |
] |
|
3266 |
]. |
|
3267 |
||
17869 | 3268 |
result := result associations copy. |
3269 |
"/ result := result collect:[:assoc | |
|
3270 |
"/ |f1 f2| |
|
3271 |
"/ |
|
3272 |
"/ f1 := assoc key asString. |
|
3273 |
"/ f2 := assoc value asString. |
|
3274 |
"/ f1 < f2 ifTrue:[ |
|
3275 |
"/ f2 -> f1 |
|
3276 |
"/ ] ifFalse:[ |
|
3277 |
"/ f1 -> f2 |
|
3278 |
"/ ] |
|
3279 |
"/ ]. |
|
17868 | 3280 |
"/ result sort:[:f1 :f2 | f1 key > f2 key "f2 value < f1 key value"]. |
3281 |
result sort:[:f1 :f2 | " f1 key > f2 key" f2 value < f1 key value]. |
|
17869 | 3282 |
result sort:[:f1 :f2 | f1 key < f2 key]. |
17868 | 3283 |
^ result |
3284 |
! ! |
|
3285 |
||
3892 | 3286 |
!AbstractFileBrowser methodsFor:'actions'! |
3287 |
||
3288 |
askForCommandFor:fileName thenDo:aBlock |
|
6284 | 3289 |
"setup and launch a querybox to ask for a unix command. |
3892 | 3290 |
Then evaluate aBlock passing the command-string as argument." |
3291 |
||
16160 | 3292 |
|box osName commandString alwaysOpenLikeThisHolder openCmd suffix| |
3892 | 3293 |
|
3294 |
osName := OperatingSystem platformName. |
|
3295 |
||
3296 |
box := FilenameEnterBox |
|
4414 | 3297 |
title:(resources string:'Execute %1 command:' with:osName) |
3298 |
okText:(resources string:'Execute') |
|
4523 | 3299 |
action:[:cmd | commandString := cmd]. |
3892 | 3300 |
|
3301 |
fileName notNil ifTrue:[ |
|
4414 | 3302 |
self initialCommandFor:fileName into:box. |
3892 | 3303 |
]. |
16160 | 3304 |
alwaysOpenLikeThisHolder := false asValue. |
3305 |
box verticalPanel add:((CheckBox label:'Always use this command for this file type') model:alwaysOpenLikeThisHolder). |
|
3892 | 3306 |
box directory:(self getDirWithoutFileName:fileName). |
16160 | 3307 |
box open. |
3308 |
||
3309 |
"/ box destroy. |
|
3310 |
alwaysOpenLikeThisHolder value ifTrue:[ |
|
3311 |
openCmd := commandString upTo:$". |
|
3312 |
suffix := fileName suffix. |
|
16306 | 3313 |
UserPreferences current |
3314 |
defaultFileOpenCommandFor:suffix put:(openCmd,' "%1"'); |
|
3315 |
beModified. |
|
3316 |
self breakPoint:#cg. |
|
16160 | 3317 |
]. |
3318 |
||
4523 | 3319 |
commandString notNil ifTrue:[ |
3320 |
aBlock value:commandString |
|
3321 |
]. |
|
3322 |
||
3892 | 3323 |
"Modified: / 7.9.1995 / 10:31:54 / claus" |
3324 |
"Modified: / 16.9.1997 / 15:35:10 / stefan" |
|
3325 |
"Modified: / 14.8.1998 / 14:12:52 / cg" |
|
3326 |
! |
|
3327 |
||
3328 |
changeFileBrowserTitleTo:aString |
|
4774 | 3329 |
self |
3330 |
applicationNamed:#FileBrowserV2 |
|
5009 | 3331 |
ifPresentDo:[:app | app changeFileBrowserTitleTo:aString] |
3892 | 3332 |
! |
3333 |
||
3334 |
copyFileList |
|
4774 | 3335 |
"copy the fileList to the clipBoard" |
3336 |
||
4973
e4b72eec43d3
refactoring the browserItemList access in directoryContentsBrowser
penk
parents:
4963
diff
changeset
|
3337 |
|fileList| |
e4b72eec43d3
refactoring the browserItemList access in directoryContentsBrowser
penk
parents:
4963
diff
changeset
|
3338 |
|
e4b72eec43d3
refactoring the browserItemList access in directoryContentsBrowser
penk
parents:
4963
diff
changeset
|
3339 |
fileList := self |
4774 | 3340 |
applicationNamed:#DirectoryContentsBrowser |
5009 | 3341 |
ifPresentDo:[:app | app browserFileList]. |
3342 |
||
3343 |
fileList notNil ifTrue:[ |
|
3344 |
self copyFileListToClipBoard:fileList. |
|
3345 |
] |
|
4973
e4b72eec43d3
refactoring the browserItemList access in directoryContentsBrowser
penk
parents:
4963
diff
changeset
|
3346 |
! |
e4b72eec43d3
refactoring the browserItemList access in directoryContentsBrowser
penk
parents:
4963
diff
changeset
|
3347 |
|
e4b72eec43d3
refactoring the browserItemList access in directoryContentsBrowser
penk
parents:
4963
diff
changeset
|
3348 |
copyFileListToClipBoard:fileList |
4774 | 3349 |
"copy the itemList to the clipBoard" |
3350 |
||
3351 |
|stream| |
|
3352 |
||
4973
e4b72eec43d3
refactoring the browserItemList access in directoryContentsBrowser
penk
parents:
4963
diff
changeset
|
3353 |
fileList isEmpty ifTrue:[^ self]. |
4774 | 3354 |
|
5772
603abfa8cf99
copy name(s) to clipboard - on lineFeed if only one file is selected
Claus Gittinger <cg@exept.de>
parents:
5756
diff
changeset
|
3355 |
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
|
3356 |
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
|
3357 |
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
|
3358 |
] ifFalse:[ |
603abfa8cf99
copy name(s) to clipboard - on lineFeed if only one file is selected
Claus Gittinger <cg@exept.de>
parents:
5756
diff
changeset
|
3359 |
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
|
3360 |
(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
|
3361 |
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
|
3362 |
] |
603abfa8cf99
copy name(s) to clipboard - on lineFeed if only one file is selected
Claus Gittinger <cg@exept.de>
parents:
5756
diff
changeset
|
3363 |
]. |
3892 | 3364 |
]. |
6034 | 3365 |
self window setClipboardText:stream contents. |
3892 | 3366 |
! |
3367 |
||
3368 |
copySelectedFilenames |
|
4774 | 3369 |
"copy the selected fileNames to the clipBoard" |
3370 |
||
4973
e4b72eec43d3
refactoring the browserItemList access in directoryContentsBrowser
penk
parents:
4963
diff
changeset
|
3371 |
|fileList| |
e4b72eec43d3
refactoring the browserItemList access in directoryContentsBrowser
penk
parents:
4963
diff
changeset
|
3372 |
|
e4b72eec43d3
refactoring the browserItemList access in directoryContentsBrowser
penk
parents:
4963
diff
changeset
|
3373 |
fileList := self |
4774 | 3374 |
applicationNamed:#DirectoryContentsBrowser |
5009 | 3375 |
ifPresentDo:[:appl | appl selectedFileNames]. |
3376 |
fileList notNil ifTrue:[ |
|
3377 |
self copyFileListToClipBoard:fileList. |
|
3378 |
]. |
|
3892 | 3379 |
! |
3380 |
||
10923 | 3381 |
doAddArchiver |
3382 |
|files| |
|
3383 |
||
3384 |
files := self currentSelectedFiles. |
|
3385 |
files size == 1 ifFalse:[ |
|
17818 | 3386 |
Dialog information:(resources string:'Select exactly one archive.'). |
10923 | 3387 |
^ self |
3388 |
]. |
|
3389 |
||
3390 |
self |
|
3391 |
applicationNamed:#FileApplicationNoteBook |
|
3392 |
ifPresentDo:[:appl | appl doAddArchiverOn:files first]. |
|
3393 |
||
3394 |
"Created: / 29-11-2011 / 19:01:31 / cg" |
|
17818 | 3395 |
"Modified: / 29-11-2017 / 12:25:47 / cg" |
10923 | 3396 |
! |
3397 |
||
3892 | 3398 |
doAddTerminal |
5960 | 3399 |
|dir| |
3400 |
||
3401 |
dir := self currentDirectory. |
|
3892 | 3402 |
|
5960 | 3403 |
dir isNil ifTrue:[ |
4414 | 3404 |
dir := Filename homeDirectory |
3892 | 3405 |
]. |
4774 | 3406 |
|
5009 | 3407 |
self |
3408 |
applicationNamed:#FileApplicationNoteBook |
|
3409 |
ifPresentDo:[:appl | appl addTerminalIn:dir]. |
|
3892 | 3410 |
! |
3411 |
||
3412 |
doOpenSearchFile |
|
5961 | 3413 |
|item file| |
3414 |
||
3415 |
file := self firstSelectedFileName. |
|
3416 |
file isNil ifTrue:[ |
|
3417 |
file := Filename homeDirectory asAbsoluteFilename. |
|
3418 |
]. |
|
3419 |
item := DirectoryContentsBrowser itemClass fileName:file. |
|
3892 | 3420 |
self openSearchFileOn:item. |
3421 |
! |
|
3422 |
||
3423 |
doShowFileContents |
|
5009 | 3424 |
self |
3425 |
applicationNamed:#DirectoryContentsBrowser |
|
3426 |
ifPresentDo:[:appl | ^ appl doShowFileContents]. |
|
3427 |
||
3428 |
^ nil |
|
3892 | 3429 |
! |
3430 |
||
3431 |
doShowProperties |
|
3432 |
"show long stat (file)-info" |
|
3433 |
||
3434 |
self fileGetInfo:true |
|
3435 |
! |
|
3436 |
||
14577 | 3437 |
enterAction |
3438 |
self |
|
3439 |
applicationNamed:#DirectoryContentsBrowser |
|
3440 |
ifPresentDo:[:appl | appl ~~ self ifTrue:[ appl enterAction ]]. |
|
3441 |
! |
|
3442 |
||
5528 | 3443 |
fileEncodingDialog |
14497 | 3444 |
"open a dialog to allow change of the file's character encoding. |
5528 | 3445 |
Files are converted to internal encoding when read, and converted back |
3446 |
to this encoding when saved. |
|
3447 |
Notice: currently, not too many encodings are supported by the system." |
|
3448 |
||
3449 |
|bindings encodings encodingDescr idx selectedEncoding| |
|
3450 |
||
3451 |
encodingDescr := CharacterEncoder supportedExternalEncodings. |
|
3452 |
encodings := encodingDescr collect:[:d | d isNil ifTrue:[nil] ifFalse:[d first]]. |
|
3453 |
||
3454 |
bindings := IdentityDictionary new. |
|
3455 |
bindings at:#encodingList put:encodingDescr. |
|
3456 |
bindings at:#selectedEncoding put:(encodings indexOf:self fileEncoding ifAbsent:1) asValue. |
|
5737 | 3457 |
bindings at:#lockFileEncoding put:(self lockFileEncodingHolder value asValue). |
3458 |
||
5528 | 3459 |
(self openDialogInterface:#encodingDialogSpec withBindings:bindings) |
3460 |
ifTrue:[ |
|
3461 |
idx := (bindings at:#selectedEncoding) value. |
|
3462 |
selectedEncoding := encodings at:idx. |
|
3463 |
selectedEncoding notNil ifTrue:[ |
|
5704 | 3464 |
self fileEncoding:selectedEncoding asSymbol. |
5528 | 3465 |
]. |
5737 | 3466 |
self lockFileEncoding:(bindings at:#lockFileEncoding) value. |
5528 | 3467 |
]. |
3468 |
||
3469 |
"Modified: 30.6.1997 / 14:41:12 / cg" |
|
3470 |
! |
|
3471 |
||
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
3472 |
gotoFile:aFilename |
5380
2f738f3a34b1
fixed bug introduced by stefans beautification ;-)
Claus Gittinger <cg@exept.de>
parents:
5374
diff
changeset
|
3473 |
"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
|
3474 |
|
5959 | 3475 |
|currentFileNameHolder currentSel| |
3476 |
||
3477 |
currentFileNameHolder := self currentFileNameHolder. |
|
3478 |
||
3479 |
currentSel := currentFileNameHolder value. |
|
5380
2f738f3a34b1
fixed bug introduced by stefans beautification ;-)
Claus Gittinger <cg@exept.de>
parents:
5374
diff
changeset
|
3480 |
(currentSel includes:aFilename) ifFalse:[ |
9677 | 3481 |
self withWaitCursorDo:[ |
3482 |
currentFileNameHolder value:(OrderedCollection with:(aFilename asAbsoluteFilename)). |
|
3483 |
] |
|
3484 |
]. |
|
3485 |
||
3486 |
"Modified: / 29-12-2010 / 11:04:29 / cg" |
|
3892 | 3487 |
! |
3488 |
||
11053 | 3489 |
lineEndConventionDialog |
3490 |
"open a dialog to allow change of the line end conventions |
|
3491 |
(when writing files)" |
|
3492 |
||
3493 |
|bindings| |
|
3494 |
||
3495 |
bindings := IdentityDictionary new. |
|
3496 |
bindings at:#lineEndConvention put:(self lineEndConvention asValue). |
|
3497 |
||
3498 |
(self openDialogInterface:#lineEndConventionDialogSpec withBindings:bindings) |
|
3499 |
ifTrue:[ |
|
15208 | 3500 |
self lineEndConventionHolder value:(bindings at:#lineEndConvention) value asSymbol |
11053 | 3501 |
]. |
3502 |
||
3503 |
"Created: / 06-01-2012 / 15:34:51 / cg" |
|
3504 |
! |
|
3505 |
||
4392 | 3506 |
newTextEditor |
5009 | 3507 |
self |
3508 |
applicationNamed:#FileApplicationNoteBook |
|
15936 | 3509 |
ifPresentDo:[:appl | |
3510 |
|editor files item| |
|
3511 |
||
3512 |
editor := appl newTextEditor. |
|
3513 |
(files := self currentSelectedFiles) size == 1 ifTrue:[ |
|
3514 |
item := DirectoryContentsBrowser itemClass fileName:files first. |
|
3515 |
editor item:item. |
|
3516 |
]. |
|
3517 |
^ editor |
|
3518 |
]. |
|
5009 | 3519 |
|
3520 |
^ nil. |
|
3521 |
! |
|
3522 |
||
3523 |
openApplByFileItem:anItem |
|
8490 | 3524 |
"/ q: is the following always wanted ? |
9267 | 3525 |
self window sensor shiftDown ifFalse:[ |
17715 | 3526 |
((anItem mimeType startsWith:'application/x-expecco-') |
3527 |
and:[(Smalltalk at:#ExpeccoStartup) notNil]) ifTrue:[ |
|
3528 |
(Smalltalk at:#ExpeccoStartup) main:{anItem fileName asString}. |
|
3529 |
^ self. |
|
3530 |
]. |
|
3531 |
||
10669
079d85556631
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
10556
diff
changeset
|
3532 |
"/ cg: no - batch and shell scripts are to be |
079d85556631
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
10556
diff
changeset
|
3533 |
"/ anItem fileName isExecutableProgram ifTrue:[ |
079d85556631
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
10556
diff
changeset
|
3534 |
"/ self executeCommand:anItem fileName pathName. |
079d85556631
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
10556
diff
changeset
|
3535 |
"/ ^ self. |
079d85556631
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
10556
diff
changeset
|
3536 |
"/ ]. |
9267 | 3537 |
|
8490 | 3538 |
"/ OperatingSystem isMSWINDOWSlike ifTrue:[ |
3539 |
"/ Error handle:[:ex | |
|
3540 |
"/ ] do:[ |
|
3541 |
"/ OperatingSystem |
|
3542 |
"/ shellExecute:nil |
|
3543 |
"/ lpOperation:'open' |
|
3544 |
"/ lpFile:(anItem fileName pathName) |
|
3545 |
"/ lpParameters:nil |
|
3546 |
"/ lpDirectory:(self directory pathName) |
|
3547 |
"/ nShowCmd:#SW_SHOWNORMAL. |
|
3548 |
"/ ^ self. |
|
3549 |
"/ ] |
|
3550 |
"/ ] |
|
9267 | 3551 |
]. |
5306 | 3552 |
^ self |
5009 | 3553 |
applicationNamed:#FileApplicationNoteBook |
5306 | 3554 |
ifPresentDo:[:appl | appl openApplByFileItem:anItem]. |
10669
079d85556631
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
10556
diff
changeset
|
3555 |
|
079d85556631
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
10556
diff
changeset
|
3556 |
"Modified: / 06-09-2011 / 11:11:15 / cg" |
17715 | 3557 |
"Modified: / 18-10-2017 / 10:15:15 / stefan" |
3892 | 3558 |
! |
3559 |
||
4392 | 3560 |
openApplForFile:aFilename |
5306 | 3561 |
^ self openApplByFileItem:(DirectoryContentsBrowser itemClass fileName:aFilename). |
4392 | 3562 |
! |
3563 |
||
3892 | 3564 |
openCommandResultApplication |
3565 |
||
5009 | 3566 |
self |
3567 |
applicationNamed:#FileApplicationNoteBook |
|
3568 |
ifPresentDo:[:appl | ^ appl openCommandResultApplication]. |
|
3569 |
||
3570 |
^ nil |
|
3892 | 3571 |
! |
3572 |
||
5010 | 3573 |
openNewTextEditorOn:anItem |
5009 | 3574 |
self |
3575 |
applicationNamed:#FileApplicationNoteBook |
|
5010 | 3576 |
ifPresentDo:[:appl | ^ appl openNewTextEditorOn:anItem ]. |
5009 | 3577 |
|
3578 |
^ nil |
|
4880
87f511659680
edit file in context menu of DirectoryContentsBroser opens a new tab
penk
parents:
4878
diff
changeset
|
3579 |
! |
87f511659680
edit file in context menu of DirectoryContentsBroser opens a new tab
penk
parents:
4878
diff
changeset
|
3580 |
|
5010 | 3581 |
openSearchFileOn:anItem |
5009 | 3582 |
self |
3583 |
applicationNamed:#FileApplicationNoteBook |
|
5010 | 3584 |
ifPresentDo:[:appl | ^ appl openSearchFileOn:anItem]. |
5009 | 3585 |
|
3586 |
^ nil. |
|
3892 | 3587 |
! |
3588 |
||
5162 | 3589 |
openTextEditorForFile:aFilename |
3590 |
^ self openTextEditorOn:(DirectoryContentsBrowser itemClass fileName:aFilename). |
|
3591 |
! |
|
3592 |
||
5010 | 3593 |
openTextEditorOn:anItem |
5009 | 3594 |
self |
3595 |
applicationNamed:#FileApplicationNoteBook |
|
5010 | 3596 |
ifPresentDo:[:appl | ^ appl openTextEditorOn:anItem ]. |
5009 | 3597 |
|
3598 |
^ nil. |
|
3892 | 3599 |
! |
3600 |
||
5010 | 3601 |
openTextEditorOn:anItem type:aDirDescrOrFile |
5009 | 3602 |
self |
3603 |
applicationNamed:#FileApplicationNoteBook |
|
5010 | 3604 |
ifPresentDo:[:appl | ^ appl openTextEditorOn:anItem type:aDirDescrOrFile]. |
5009 | 3605 |
|
3606 |
^ nil. |
|
4618 | 3607 |
! |
3608 |
||
5959 | 3609 |
setCurrentFileName:aFilename |
3610 |
self setCurrentFileNames:(OrderedCollection with:aFilename). |
|
3611 |
! |
|
3612 |
||
3613 |
setCurrentFileNames:aCollectionOfFilenames |
|
3614 |
self currentFileNameHolder value:aCollectionOfFilenames. |
|
3615 |
! |
|
3616 |
||
11053 | 3617 |
tabStopConversionDialog |
3618 |
"open a dialog to allow change of the tab stop conversion (when reading/writing files)" |
|
3619 |
||
3620 |
|bindings| |
|
3621 |
||
3622 |
bindings := IdentityDictionary new. |
|
3623 |
bindings at:#tabStops put:(self inputTabColumnConversion asValue). |
|
3624 |
||
3625 |
(self openDialogInterface:#tabStopConversionDialogSpec withBindings:bindings) |
|
3626 |
ifTrue:[ |
|
3627 |
self inputTabColumnConversionHolder value:(bindings at:#tabStops) value |
|
3628 |
]. |
|
3629 |
||
3630 |
"Created: / 06-01-2012 / 15:36:06 / cg" |
|
3631 |
! |
|
3632 |
||
3892 | 3633 |
updateAndSelect:aColOfFiles |
4785
5a3f7a0c3ff1
symbolic link creation code fixed
Claus Gittinger <cg@exept.de>
parents:
4782
diff
changeset
|
3634 |
self updateCurrentDirectory. |
4707
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
3635 |
aColOfFiles notNil ifTrue:[ |
5959 | 3636 |
self setCurrentFileNames:aColOfFiles |
4707
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
3637 |
]. |
3892 | 3638 |
! |
3639 |
||
3640 |
updateCurrentDirectory |
|
5739 | 3641 |
self updateCurrentDirectory:false |
3642 |
! |
|
3643 |
||
3644 |
updateCurrentDirectory:withReread |
|
4785
5a3f7a0c3ff1
symbolic link creation code fixed
Claus Gittinger <cg@exept.de>
parents:
4782
diff
changeset
|
3645 |
DirectoryContents flushCachedDirectoryFor:(self getBestDirectory). |
5a3f7a0c3ff1
symbolic link creation code fixed
Claus Gittinger <cg@exept.de>
parents:
4782
diff
changeset
|
3646 |
|
5009 | 3647 |
self |
3648 |
applicationNamed:#DirectoryContentsBrowser |
|
5739 | 3649 |
ifPresentDo:[:appl | withReread ifTrue:[appl doUpdate] ifFalse:[appl doUpdateDirectoryContents]]. |
5009 | 3650 |
self |
3651 |
applicationNamed:#DirectoryTreeBrowser |
|
3652 |
ifPresentDo:[:appl | appl doUpdate]. |
|
4345 | 3653 |
! |
3654 |
||
5739 | 3655 |
updateCurrentDirectoryWithReread |
3656 |
self updateCurrentDirectory:true |
|
3657 |
! |
|
3658 |
||
4345 | 3659 |
withActivityIndicationDo:aBlock |
3660 |
||
3661 |
self activityVisibilityChannel value:true. |
|
3662 |
[ |
|
9361 | 3663 |
self withWaitCursorDo:[ |
3664 |
aBlock value. |
|
3665 |
] |
|
4345 | 3666 |
] ensure:[ |
3667 |
self activityVisibilityChannel value:false. |
|
3668 |
] |
|
3892 | 3669 |
! ! |
3670 |
||
3671 |
!AbstractFileBrowser methodsFor:'actions bookmarks'! |
|
3672 |
||
3673 |
addBookmark |
|
3674 |
self currentFilesAreInSameDirectory ifFalse:[^ self]. |
|
6725 | 3675 |
self addBookmarks:(self currentSelectedDirectories). |
5960 | 3676 |
self class saveBookmarksInDefaultBookmarksFile |
4679 | 3677 |
! |
3678 |
||
3679 |
addBookmarks:aColOfDirectories |
|
4672
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
3680 |
aColOfDirectories do:[ :path | |
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
3681 |
self class addBookmark:path |
3892 | 3682 |
]. |
3683 |
! |
|
3684 |
||
8013 | 3685 |
editBookmarks |
17849 | 3686 |
self class editBookmarksWithDefault: self currentSelectedDirectories firstOrNil. |
3687 |
||
3688 |
"Modified: / 13-12-2017 / 23:24:39 / stefan" |
|
8013 | 3689 |
! |
3690 |
||
3892 | 3691 |
hasBookmarks |
4672
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
3692 |
^ self class hasBookmarks |
3892 | 3693 |
! |
3694 |
||
3695 |
hasBookmarksToRemove |
|
3696 |
|bookmarks directories| |
|
3697 |
||
3982 | 3698 |
directories := self currentSelectedDirectories. |
3892 | 3699 |
bookmarks := self class directoryBookmarks. |
17416 | 3700 |
^ (bookmarks notEmptyOrNil and:[directories notEmpty]) |
3701 |
||
3702 |
"Modified: / 17-02-2017 / 08:25:22 / cg" |
|
3892 | 3703 |
! |
3704 |
||
3705 |
removeBookmark |
|
4672
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
3706 |
self currentSelectedDirectories do:[:dir| |
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
3707 |
self class removeBookmark:dir |
3892 | 3708 |
]. |
4679 | 3709 |
! |
3710 |
||
3711 |
saveBookmarks |
|
3712 |
self class saveBookmarks |
|
3892 | 3713 |
! ! |
3714 |
||
3715 |
!AbstractFileBrowser methodsFor:'actions history'! |
|
3716 |
||
3717 |
addToCommandHistory:aCommandString for:aFilename |
|
6369 | 3718 |
|cmd suffix cmdHist historySize| |
3892 | 3719 |
|
3720 |
cmdHist := self class commandHistory. |
|
6482
00207f456339
isEmptyOrNil / notEmptyOrNil refactoring
Claus Gittinger <cg@exept.de>
parents:
6479
diff
changeset
|
3721 |
(aCommandString notEmptyOrNil) ifTrue:[ |
4414 | 3722 |
cmdHist notNil ifTrue:[ |
3723 |
cmdHist addFirst:aCommandString. |
|
6369 | 3724 |
historySize := self class commandHistorySize. |
3725 |
(historySize notNil and:[cmdHist size > historySize]) ifTrue:[ |
|
4414 | 3726 |
cmdHist removeLast |
3727 |
] |
|
3728 |
]. |
|
3729 |
aFilename notNil ifTrue:[ |
|
3730 |
cmd := aCommandString copyTo:(aCommandString indexOf:Character space ifAbsent:[aCommandString size + 1])-1. |
|
3731 |
DefaultCommandPerSuffix isNil ifTrue:[ |
|
3732 |
DefaultCommandPerSuffix := Dictionary new. |
|
3733 |
]. |
|
3734 |
suffix := aFilename asFilename suffix. |
|
3735 |
suffix notNil ifTrue:[ |
|
3736 |
DefaultCommandPerSuffix at:suffix put:cmd. |
|
3737 |
] |
|
3738 |
] |
|
3892 | 3739 |
] |
3740 |
! |
|
3741 |
||
3742 |
doBack |
|
6286 | 3743 |
"go backward in the history" |
3892 | 3744 |
|
4022 | 3745 |
| fileName| |
3746 |
||
6369 | 3747 |
fileName := self directoryHistory goBackward. |
3892 | 3748 |
fileName notNil ifTrue:[ |
4347 | 3749 |
self gotoFile:(fileName asFilename). |
3892 | 3750 |
] |
3751 |
! |
|
3752 |
||
3753 |
doForward |
|
6286 | 3754 |
"go forward in the history" |
3892 | 3755 |
|
3964 | 3756 |
| fileName| |
3757 |
||
6369 | 3758 |
fileName := self directoryHistory goForward. |
3892 | 3759 |
fileName notNil ifTrue:[ |
4414 | 3760 |
self gotoFile:(fileName asFilename). |
4022 | 3761 |
] ifFalse:[ |
4414 | 3762 |
self enableForward value:false. |
4022 | 3763 |
|
3764 |
]. |
|
3892 | 3765 |
! ! |
3766 |
||
3767 |
!AbstractFileBrowser methodsFor:'applications'! |
|
3768 |
||
5009 | 3769 |
applicationNamed:anApplicationName ifPresentDo:aBlock |
3770 |
|appl| |
|
3771 |
||
3772 |
appl := self applications at:anApplicationName ifAbsent:nil. |
|
3773 |
appl notNil ifTrue:[ |
|
3774 |
^ aBlock value:appl |
|
3775 |
]. |
|
3776 |
^ nil. |
|
3777 |
! |
|
3778 |
||
4004 | 3779 |
directoryContentsBrowser |
3780 |
^ self applications at:#DirectoryContentsBrowser ifAbsent:nil. |
|
3892 | 3781 |
! ! |
3782 |
||
3783 |
!AbstractFileBrowser methodsFor:'aspects'! |
|
3784 |
||
3785 |
applications |
|
3786 |
^ aspects at:#applications |
|
3787 |
! |
|
3788 |
||
3789 |
backgroundProcesses |
|
3790 |
||
3791 |
^ self aspectFor:#backgroundProcesses ifAbsent:[List new] |
|
3792 |
! |
|
3793 |
||
4230 | 3794 |
canMake |
15259 | 3795 |
^ self aspectFor:#canMake ifAbsent:[ ValueHolder with:false ]. |
4230 | 3796 |
! |
3797 |
||
3892 | 3798 |
currentDirectories |
6725 | 3799 |
" returns a holder on a Collection of all currently selected directories |
3800 |
if only a file is selected, currentDirectories holds the directory of the file |
|
3892 | 3801 |
" |
3802 |
||
3803 |
^ self aspectFor:#currentDirectories ifAbsent:[ (OrderedCollection new) asValue ]. |
|
3804 |
! |
|
3805 |
||
6725 | 3806 |
currentDirectoriesValue |
3807 |
" returns a Collection of all currently selected directories |
|
3808 |
if only a file is selected, currentDirectories holds the directory of the file |
|
3809 |
" |
|
3810 |
||
3811 |
^ self currentDirectories value |
|
3812 |
! |
|
3813 |
||
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
3814 |
currentDirectory |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
3815 |
"return the single current directory or nil" |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
3816 |
|
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
3817 |
|directories| |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
3818 |
|
6725 | 3819 |
directories := self currentSelectedDirectories. |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
3820 |
(directories size ~= 1) ifTrue:[ |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
3821 |
^ nil |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
3822 |
]. |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
3823 |
^ directories first. |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
3824 |
! |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
3825 |
|
13856 | 3826 |
currentDirectoryDisplayed |
3827 |
"Return a directory as Filename that is currently displayed in the browser" |
|
3828 |
||
3829 |
^self subclassResponsibility |
|
3830 |
||
3831 |
"Created: / 14-01-2013 / 11:57:17 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
3832 |
! |
|
3833 |
||
3892 | 3834 |
currentFileNameHolder |
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
3835 |
"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
|
3836 |
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
|
3837 |
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
|
3838 |
|
6589 | 3839 |
^ self aspectFor:#currentFileNameHolder |
3840 |
ifAbsent:[ |
|
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
3841 |
|currentSel| |
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3842 |
|
4692 | 3843 |
currentSel := self class currentSelection. |
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
3844 |
currentSel isEmpty ifTrue:[ |
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
3845 |
currentSel := OrderedCollection with:(Filename currentDirectory asAbsoluteFilename) |
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
3846 |
]. |
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
3847 |
currentSel asValue |
6589 | 3848 |
] |
3849 |
notPresentDo:[:holder| |
|
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
3850 |
|filenames newFilenames| |
4213
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
3851 |
filenames := holder value. |
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
3852 |
newFilenames := Set new. |
6589 | 3853 |
filenames do:[:eachFilename| |
3854 |
|existingFilename| |
|
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
3855 |
existingFilename := eachFilename. |
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
3856 |
existingFilename notNil ifTrue:[ |
9649
ad956ada348e
changed: #currentFileNameHolder
Claus Gittinger <cg@exept.de>
parents:
9607
diff
changeset
|
3857 |
[existingFilename isRootDirectory or:[existingFilename exists]] whileFalse:[ |
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
3858 |
existingFilename := existingFilename directory. |
4955
378481247391
if no item is selected directory up action do nothing now
penk
parents:
4950
diff
changeset
|
3859 |
]. |
9649
ad956ada348e
changed: #currentFileNameHolder
Claus Gittinger <cg@exept.de>
parents:
9607
diff
changeset
|
3860 |
existingFilename exists ifTrue:[ |
ad956ada348e
changed: #currentFileNameHolder
Claus Gittinger <cg@exept.de>
parents:
9607
diff
changeset
|
3861 |
newFilenames add:existingFilename. |
ad956ada348e
changed: #currentFileNameHolder
Claus Gittinger <cg@exept.de>
parents:
9607
diff
changeset
|
3862 |
]. |
4955
378481247391
if no item is selected directory up action do nothing now
penk
parents:
4950
diff
changeset
|
3863 |
] |
4213
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
3864 |
]. |
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
3865 |
newFilenames asOrderedCollection. |
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
3866 |
] |
9649
ad956ada348e
changed: #currentFileNameHolder
Claus Gittinger <cg@exept.de>
parents:
9607
diff
changeset
|
3867 |
|
ad956ada348e
changed: #currentFileNameHolder
Claus Gittinger <cg@exept.de>
parents:
9607
diff
changeset
|
3868 |
"Modified: / 27-11-2010 / 15:42:45 / cg" |
3892 | 3869 |
! |
3870 |
||
5528 | 3871 |
defaultFileEncoding |
3872 |
^ #'iso8859-1' "/ #'utf-8' |
|
3873 |
! |
|
3874 |
||
3892 | 3875 |
enableDirectoryUp |
3876 |
||
15259 | 3877 |
^ self aspectFor:#enableDirectoryUp ifAbsent:[ValueHolder with:false] |
3892 | 3878 |
! |
3879 |
||
6456 | 3880 |
enableGotoDefaultDirectory |
15259 | 3881 |
^ self aspectFor:#enableGotoDefaultDirectory ifAbsent:[ ValueHolder with:true ]. |
4593 | 3882 |
! |
3883 |
||
8168 | 3884 |
enableGotoDesktop |
14308 | 3885 |
"/ backward compatibility |
3886 |
^ self enableGotoDesktopDirectory. |
|
8168 | 3887 |
! |
3888 |
||
9572 | 3889 |
enableGotoDesktopDirectory |
15259 | 3890 |
^ self aspectFor:#enableGotoDesktopDirectory ifAbsent:[ ValueHolder with:true ]. |
9572 | 3891 |
|
3892 |
"Created: / 01-10-2010 / 16:19:17 / cg" |
|
3893 |
! |
|
3894 |
||
6434 | 3895 |
enableGotoSmalltalkDirectory |
6456 | 3896 |
^ self aspectFor:#enableGotoSmalltalkDirectory ifAbsent:[ true asValue ]. |
6434 | 3897 |
! |
3898 |
||
17187 | 3899 |
enableGotoSmalltalkWorkspaceDirectory |
3900 |
^ self aspectFor:#enableGotoSmalltalkWorkspaceDirectory ifAbsent:[ true asValue ]. |
|
3901 |
! |
|
3902 |
||
9677 | 3903 |
enableGotoTempDirectory |
3904 |
^ self aspectFor:#enableGotoTempDirectory ifAbsent:[ true asValue ]. |
|
3905 |
||
3906 |
"Created: / 29-12-2010 / 11:01:17 / cg" |
|
3907 |
! |
|
3908 |
||
3892 | 3909 |
enableHome |
3910 |
||
3911 |
^ self aspectFor:#enableHome ifAbsent:[ true asValue ]. |
|
3912 |
! |
|
3913 |
||
9596 | 3914 |
enableMakeCurrentDirectory |
3915 |
^ self aspectFor:#enableMakeCurrentDirectory ifAbsent:[ true asValue ]. |
|
3916 |
||
3917 |
"Created: / 26-10-2010 / 17:17:58 / cg" |
|
3918 |
! |
|
3919 |
||
3892 | 3920 |
enableViewNoteBookApplication |
3921 |
||
3922 |
^ self aspectFor:#enableViewNoteBookApplication ifAbsent:[false asValue] |
|
3923 |
! |
|
3924 |
||
5528 | 3925 |
fileEncoding |
3926 |
^ self fileEncodingHolder value |
|
3927 |
! |
|
3928 |
||
3929 |
fileEncoding:newEncoding |
|
5533 | 3930 |
self fileEncodingHolder value:newEncoding. |
3931 |
||
3932 |
self |
|
3933 |
applicationNamed:#FileApplicationNoteBook |
|
3934 |
ifPresentDo:[:nb | |
|
3935 |
|appl| |
|
3936 |
||
3937 |
appl := nb selectedApplication. |
|
5535 | 3938 |
(appl notNil and:[appl isTextEditor]) ifTrue:[ |
5533 | 3939 |
appl fileEncoding:newEncoding |
3940 |
] |
|
3941 |
]. |
|
5528 | 3942 |
! |
3943 |
||
5737 | 3944 |
fileEncodingHolder |
3945 |
^ self |
|
3946 |
aspectFor:#fileEncodingHolder |
|
3947 |
ifAbsent:[ |
|
3948 |
self |
|
3949 |
applicationNamed:#FileApplicationNoteBook |
|
3950 |
ifPresentDo:[:appl | appl fileEncodingHolder]. |
|
3951 |
] |
|
3952 |
! |
|
3953 |
||
17485 | 3954 |
fileEntryFieldHolder |
3955 |
^ self subclassResponsibility. |
|
3956 |
||
3957 |
"Created: / 31-03-2017 / 11:36:49 / stefan" |
|
3958 |
! |
|
3959 |
||
5961 | 3960 |
firstSelectedFileName |
3961 |
|files| |
|
3962 |
||
7560 | 3963 |
files := self currentSelectedObjects. |
5961 | 3964 |
files notEmpty ifTrue:[ |
3965 |
^ files first |
|
3966 |
]. |
|
3967 |
^ nil |
|
7560 | 3968 |
|
3969 |
"Modified: / 04-12-2006 / 13:14:53 / cg" |
|
5961 | 3970 |
! |
3971 |
||
6456 | 3972 |
gotoDefaultDirectoryIsVisible |
9596 | 3973 |
^ true. |
3974 |
"/ ^ (Filename defaultDirectory asAbsoluteFilename) ~= (self smalltalkDirectory asAbsoluteFilename). |
|
3975 |
||
3976 |
"Modified: / 26-10-2010 / 17:23:51 / cg" |
|
6456 | 3977 |
! |
3978 |
||
9572 | 3979 |
gotoDesktopDirectoryIsVisible |
3980 |
Filename desktopDirectory = Filename homeDirectory ifTrue:[^ false]. |
|
3981 |
||
3982 |
^ (Filename desktopDirectory asAbsoluteFilename) ~= (self smalltalkDirectory asAbsoluteFilename). |
|
3983 |
||
3984 |
"Created: / 01-10-2010 / 16:26:27 / cg" |
|
3985 |
! |
|
3986 |
||
4618 | 3987 |
hasFileSelection |
3988 |
^ self aspectFor:#hasFileSelection ifAbsent:[ false asValue ]. |
|
3989 |
! |
|
3990 |
||
9490 | 3991 |
hasNotTwoDirectoriesSelectedHolder |
3992 |
^ self |
|
3993 |
aspectFor:#hasNotTwoDirectoriesSelectedHolder |
|
3994 |
ifAbsent:[ |
|
3995 |
BlockValue |
|
3996 |
with:[:m | self hasTwoDirectoriesSelected not] |
|
3997 |
argument:self currentFileNameHolder |
|
3998 |
]. |
|
3999 |
||
4000 |
"Created: / 20-05-2010 / 10:45:50 / cg" |
|
4001 |
! |
|
4002 |
||
5830 | 4003 |
hasNotTwoFilesSelectedHolder |
9490 | 4004 |
^ self |
4005 |
aspectFor:#hasNotTwoFilesSelectedHolder |
|
5830 | 4006 |
ifAbsent:[ |
4007 |
BlockValue |
|
4008 |
with:[:m | self hasTwoFilesSelected not] |
|
4009 |
argument:self currentFileNameHolder |
|
4010 |
]. |
|
9490 | 4011 |
|
4012 |
"Modified: / 20-05-2010 / 10:46:01 / cg" |
|
5830 | 4013 |
! |
4014 |
||
3892 | 4015 |
hasSelection |
17923 | 4016 |
"aspect holding true, if a file is selected" |
3892 | 4017 |
|
4018 |
^ self aspectFor:#hasSelection ifAbsent:[ false asValue ]. |
|
4019 |
! |
|
4020 |
||
9490 | 4021 |
hasTwoDirectoriesSelectedHolder |
4022 |
^ self |
|
4023 |
aspectFor:#hasTwoDirectoriesSelectedHolder |
|
4024 |
ifAbsent:[ |
|
4025 |
BlockValue |
|
4026 |
with:[:m | self hasTwoDirectoriesSelected] |
|
4027 |
argument:self currentFileNameHolder |
|
4028 |
]. |
|
4029 |
||
4030 |
"Created: / 20-05-2010 / 10:45:41 / cg" |
|
4031 |
! |
|
4032 |
||
4414 | 4033 |
hasTwoFilesSelectedHolder |
9490 | 4034 |
^ self |
4035 |
aspectFor:#hasTwoFilesSelectedHolder |
|
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
4036 |
ifAbsent:[ |
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
4037 |
BlockValue |
5830 | 4038 |
with:[:m | self hasTwoFilesSelected] |
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
4039 |
argument:self currentFileNameHolder |
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
4040 |
]. |
9490 | 4041 |
|
4042 |
"Modified: / 20-05-2010 / 10:46:08 / cg" |
|
4414 | 4043 |
! |
4044 |
||
11053 | 4045 |
inputTabColumnConversion |
4046 |
^ self inputTabColumnConversionHolder value |
|
4047 |
||
4048 |
"Created: / 06-01-2012 / 15:25:56 / cg" |
|
4049 |
! |
|
4050 |
||
4051 |
inputTabColumnConversionHolder |
|
4052 |
^ self |
|
4053 |
aspectFor:#inputTabColumnConversionHolder |
|
4054 |
ifAbsent:[ |
|
4055 |
self |
|
4056 |
applicationNamed:#FileApplicationNoteBook |
|
4057 |
ifPresentDo:[:appl | appl inputTabColumnConversionHolder]. |
|
4058 |
] |
|
4059 |
||
4060 |
"Created: / 06-01-2012 / 15:26:16 / cg" |
|
4061 |
! |
|
4062 |
||
4063 |
lineEndConvention |
|
15208 | 4064 |
^ self lineEndConventionHolder value asSymbol |
11053 | 4065 |
|
4066 |
"Created: / 06-01-2012 / 13:05:14 / cg" |
|
4067 |
! |
|
4068 |
||
11591 | 4069 |
lineEndConvention: aSymbol |
15208 | 4070 |
self lineEndConventionHolder value: aSymbol asSymbol |
11591 | 4071 |
|
4072 |
"Created: / 11-07-2012 / 19:51:58 / cg" |
|
4073 |
! |
|
4074 |
||
11053 | 4075 |
lineEndConventionHolder |
4076 |
^ self |
|
4077 |
aspectFor:#lineEndConventionHolder |
|
4078 |
ifAbsent:[ |
|
4079 |
self |
|
4080 |
applicationNamed:#FileApplicationNoteBook |
|
4081 |
ifPresentDo:[:appl | appl lineEndConventionHolder]. |
|
4082 |
] |
|
4083 |
||
4084 |
"Created: / 06-01-2012 / 13:02:51 / cg" |
|
4085 |
! |
|
4086 |
||
5737 | 4087 |
lockFileEncoding:aBoolean |
4088 |
self lockFileEncodingHolder value:aBoolean. |
|
4089 |
||
4090 |
self |
|
4091 |
applicationNamed:#FileApplicationNoteBook |
|
4092 |
ifPresentDo:[:nb | |
|
4093 |
|appl| |
|
4094 |
||
4095 |
appl := nb selectedApplication. |
|
4096 |
(appl notNil and:[appl isTextEditor]) ifTrue:[ |
|
4097 |
appl lockFileEncoding:aBoolean |
|
4098 |
] |
|
4099 |
]. |
|
4100 |
! |
|
4101 |
||
4102 |
lockFileEncodingHolder |
|
4103 |
^ self |
|
4104 |
aspectFor:#lockFileEncodingHolder |
|
4105 |
ifAbsent:[ |
|
4106 |
self |
|
4107 |
applicationNamed:#FileApplicationNoteBook |
|
4108 |
ifPresentDo:[:appl | appl lockFileEncodingHolder]. |
|
4109 |
] |
|
4110 |
! |
|
4111 |
||
13856 | 4112 |
makeCommandHolder |
4113 |
^ self aspectFor:#makeCommandHolder ifAbsent:[ nil asValue ]. |
|
4114 |
||
4115 |
"Created: / 13-04-2012 / 17:01:26 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
4116 |
! |
|
4117 |
||
4523 | 4118 |
notify:aString |
11108 | 4119 |
"aString is shown in the lower pane" |
4120 |
||
4523 | 4121 |
self notifyChannel value:aString |
11108 | 4122 |
|
4123 |
"Modified (comment): / 11-01-2012 / 21:46:55 / cg" |
|
4523 | 4124 |
! |
4125 |
||
3892 | 4126 |
notifyChannel |
4127 |
||
4128 |
^ self aspectFor:#notifyChannel ifAbsent:['' asValue] |
|
4071 | 4129 |
! |
4130 |
||
9575
548adf8e9d98
added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents:
9572
diff
changeset
|
4131 |
progressPercentageHolder |
548adf8e9d98
added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents:
9572
diff
changeset
|
4132 |
^ self aspectFor:#progressPercentageHolder ifAbsent:[ nil asValue ]. |
548adf8e9d98
added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents:
9572
diff
changeset
|
4133 |
|
548adf8e9d98
added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents:
9572
diff
changeset
|
4134 |
"Created: / 11-10-2010 / 12:54:46 / cg" |
548adf8e9d98
added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents:
9572
diff
changeset
|
4135 |
! |
548adf8e9d98
added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents:
9572
diff
changeset
|
4136 |
|
4071 | 4137 |
rootHolder |
4138 |
"holder, which keeps the rootHolder of the treeView |
|
4139 |
" |
|
4140 |
||
4368
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
4141 |
^ self aspectFor:#rootHolder ifAbsent:[ |
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
4142 |
self class rootHolder asValue. |
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
4143 |
]. |
8192
26660fb61e7a
Make FileDialog usable as SubCanvas
Stefan Vogel <sv@exept.de>
parents:
8185
diff
changeset
|
4144 |
! |
26660fb61e7a
Make FileDialog usable as SubCanvas
Stefan Vogel <sv@exept.de>
parents:
8185
diff
changeset
|
4145 |
|
26660fb61e7a
Make FileDialog usable as SubCanvas
Stefan Vogel <sv@exept.de>
parents:
8185
diff
changeset
|
4146 |
rootHolder:aHolder |
26660fb61e7a
Make FileDialog usable as SubCanvas
Stefan Vogel <sv@exept.de>
parents:
8185
diff
changeset
|
4147 |
|
26660fb61e7a
Make FileDialog usable as SubCanvas
Stefan Vogel <sv@exept.de>
parents:
8185
diff
changeset
|
4148 |
self aspectFor:#rootHolder put:aHolder |
3892 | 4149 |
! ! |
4150 |
||
4151 |
!AbstractFileBrowser methodsFor:'aspects handling'! |
|
4152 |
||
4153 |
aspectFor:something ifAbsent:aBlock |
|
6284 | 4154 |
"returns the model for an aspect; these are stored in a common dictionary" |
4155 |
||
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
4156 |
^ self aspectFor:something ifAbsent:aBlock notPresentDo:nil |
3892 | 4157 |
! |
4158 |
||
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4159 |
aspectFor:aKey ifAbsent:aBlock notPresentDo:notPresentBlock |
6284 | 4160 |
"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
|
4161 |
|
4213
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
4162 |
|holder saveAspectItem aspect| |
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
4163 |
|
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4164 |
holder := aspects at:aKey ifAbsent:[ |
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
4165 |
masterApplication notNil ifTrue:[ |
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4166 |
holder := masterApplication aspectOrNil:aKey forSubApplication:self. |
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
4167 |
]. |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
4168 |
holder isNil ifTrue:[ |
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4169 |
saveAspectItem := self runtimeAspectValueFor:aKey. |
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
4170 |
saveAspectItem notNil ifTrue:[ |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
4171 |
saveAspectItem isHolder ifTrue:[ |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
4172 |
holder := ValueHolder with:saveAspectItem value |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
4173 |
] ifFalse:[ |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
4174 |
holder := saveAspectItem value |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
4175 |
]. |
4213
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
4176 |
] ifFalse:[ |
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4177 |
aspect := self userPreferencesAspectValueFor:aKey. |
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
4178 |
aspect notNil ifTrue:[ |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
4179 |
holder := aspect asValue |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
4180 |
] ifFalse:[ |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
4181 |
holder := aBlock value. |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
4182 |
] |
4213
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
4183 |
]. |
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
4184 |
]. |
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
4185 |
holder notNil ifTrue:[ |
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
4186 |
notPresentBlock notNil ifTrue:[ |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
4187 |
holder value:(notPresentBlock value:holder). |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
4188 |
]. |
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4189 |
aspects at:aKey put:holder |
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
4190 |
]. |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
4191 |
holder |
4213
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
4192 |
]. |
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
4193 |
^ holder |
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
4194 |
! |
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
4195 |
|
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
4196 |
aspectFor:something put:aValueHolder |
6284 | 4197 |
"stores the model for an aspect; these are stored in a common dictionary" |
4198 |
||
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
4199 |
aspects at:something put:aValueHolder |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
4200 |
! |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
4201 |
|
3892 | 4202 |
aspects |
6284 | 4203 |
"returns the common aspect dictionary" |
4204 |
||
3892 | 4205 |
^ aspects |
4206 |
! |
|
4207 |
||
4208 |
runtimeAspectValueFor:something |
|
4209 |
"returns the default aspect item from the class variable RuntimeAspects |
|
4210 |
" |
|
4211 |
^ self class runtimeAspects at:something ifAbsent:nil. |
|
4212 |
! |
|
4213 |
||
4201 | 4214 |
saveAspectValues |
16306 | 4215 |
|prefs saveAspects aspectValue| |
4216 |
||
4217 |
prefs := UserPreferences current. |
|
4218 |
||
7078
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
4219 |
saveAspects := self class userPreferencesAspectList keys. |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
4220 |
saveAspects do:[ :aspectKey | |
4201 | 4221 |
aspectValue := (self perform:aspectKey) value. |
16306 | 4222 |
prefs |
7078
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
4223 |
at: ('fileBrowser_',aspectKey asString) asSymbol |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
4224 |
put: aspectValue. |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
4225 |
]. |
16306 | 4226 |
prefs beModified. |
4227 |
||
7078
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
4228 |
"Modified: / 04-09-2006 / 10:02:41 / cg" |
4201 | 4229 |
! |
4230 |
||
3892 | 4231 |
saveRuntimeAspectValues |
4232 |
|savedAspects dictionary value isHolder aspect| |
|
4233 |
||
5941 | 4234 |
savedAspects := self class listOfRuntimeValuesToRemember. |
3892 | 4235 |
dictionary := Dictionary new. |
5941 | 4236 |
savedAspects do:[:aspectKey | |
4414 | 4237 |
aspect := self perform:aspectKey. |
4238 |
isHolder := aspect isValueModel. |
|
5941 | 4239 |
isHolder ifTrue:[ |
4240 |
value := aspect value |
|
4241 |
] ifFalse:[ |
|
4242 |
value := aspect |
|
4243 |
]. |
|
4244 |
dictionary at:aspectKey |
|
4245 |
put:(SaveAspectItem withValue:value isHolder:isHolder) |
|
4246 |
]. |
|
4247 |
RuntimeAspects := dictionary. |
|
3892 | 4248 |
! |
4249 |
||
4201 | 4250 |
userPreferencesAspectValueFor:something |
4251 |
"returns the default aspect from the Userpreferences |
|
3892 | 4252 |
" |
4201 | 4253 |
|
7078
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
4254 |
(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
|
4255 |
^ UserPreferences current |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
4256 |
at:('fileBrowser_',something) asSymbol |
9579
7107f49e4583
changed: #userPreferencesAspectValueFor:
Claus Gittinger <cg@exept.de>
parents:
9575
diff
changeset
|
4257 |
ifAbsent:nil "(self class userPreferencesAspectList at:something)". |
7107f49e4583
changed: #userPreferencesAspectValueFor:
Claus Gittinger <cg@exept.de>
parents:
9575
diff
changeset
|
4258 |
|
7107f49e4583
changed: #userPreferencesAspectValueFor:
Claus Gittinger <cg@exept.de>
parents:
9575
diff
changeset
|
4259 |
"Modified: / 14-10-2010 / 19:16:38 / cg" |
3892 | 4260 |
! ! |
4261 |
||
4011 | 4262 |
!AbstractFileBrowser methodsFor:'aspects-filter'! |
4263 |
||
9015 | 4264 |
filter:aString |
4265 |
self filterModel value:aString |
|
4266 |
! |
|
4267 |
||
4018 | 4268 |
filterBackgroundColor |
4269 |
||
4270 |
^ self aspectFor:#filterBackgroundColor ifAbsent:[Color white asValue] |
|
4271 |
! |
|
4272 |
||
4011 | 4273 |
filterBlockHolder |
4274 |
||
5658
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
4275 |
^ self aspectFor:#filterBlockHolder ifAbsent:[self makeFilterBlock asValue] |
4011 | 4276 |
! |
4277 |
||
4278 |
filterListModel |
|
4279 |
||
4280 |
^ self aspectFor:#filterListModel ifAbsent:[self class defaultFilterList] |
|
4281 |
! |
|
4282 |
||
4283 |
filterModel |
|
5941 | 4284 |
|m| |
4285 |
||
4286 |
m := self aspectFor:#filterModel ifAbsent:[(self filterListModel at:1) asValue]. |
|
4287 |
^ m |
|
4011 | 4288 |
! |
4289 |
||
8185
8b6f11fd7fbf
Make #filterModel reusable as SubCanvas
Stefan Vogel <sv@exept.de>
parents:
8172
diff
changeset
|
4290 |
filterModel:aHolder |
8b6f11fd7fbf
Make #filterModel reusable as SubCanvas
Stefan Vogel <sv@exept.de>
parents:
8172
diff
changeset
|
4291 |
self aspectFor:#filterModel put:aHolder. |
8b6f11fd7fbf
Make #filterModel reusable as SubCanvas
Stefan Vogel <sv@exept.de>
parents:
8172
diff
changeset
|
4292 |
! |
8b6f11fd7fbf
Make #filterModel reusable as SubCanvas
Stefan Vogel <sv@exept.de>
parents:
8172
diff
changeset
|
4293 |
|
4018 | 4294 |
filterValueBox |
4295 |
||
4296 |
^ self aspectFor:#filterValueBox ifAbsent:[ValueHolder new] |
|
4297 |
! |
|
4298 |
||
5658
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
4299 |
makeFilterBlock |
14497 | 4300 |
"return a two-arg filterblock on the file's path- and base-name. This block should return true for files |
9102 | 4301 |
to be shown" |
4302 |
||
17481 | 4303 |
| filterString filterStrings filters notFilters showHidden filterBlock caseSensitive| |
5658
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
4304 |
|
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
4305 |
filterString := self filterModel value. |
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
4306 |
filterString = '' ifTrue:[filterString := '*']. |
17481 | 4307 |
caseSensitive := "ignoreCaseInPattern ?" Filename isCaseSensitive. |
5658
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
4308 |
|
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
4309 |
filterStrings := filterString asCollectionOfSubstringsSeparatedBy:$;. |
12760 | 4310 |
filterStrings := filterStrings |
4311 |
select:[:eachFilter | eachFilter withoutSeparators notEmpty]. |
|
4312 |
||
5658
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
4313 |
filters := filterStrings |
12760 | 4314 |
reject:[:eachFilter | eachFilter withoutSeparators startsWith:'~'] |
4315 |
thenCollect: |
|
4316 |
[:eachPattern | |
|
4317 |
|pattern| |
|
4318 |
||
4319 |
pattern := eachPattern withoutSeparators. |
|
15597 | 4320 |
pattern includesMatchCharacters ifFalse:[ |
4321 |
"JV@2012-03-05: Add implict star at the beginning and at the end of pattern, |
|
4322 |
that's how most of the other applications behave - do what most users expect" |
|
17772 | 4323 |
"/ pattern first == $* ifFalse:[pattern := '*' , pattern]. |
4324 |
"/ pattern last == $* ifFalse:[pattern := pattern , '*']. |
|
4325 |
[:name :baseName | baseName asLowercase includesString:pattern caseSensitive:caseSensitive] |
|
4326 |
] ifTrue:[ |
|
4327 |
pattern = '*' ifTrue:[ |
|
4328 |
[:name :baseName | true]. |
|
4329 |
] ifFalse:[ |
|
4330 |
[:name :baseName | pattern match:baseName caseSensitive:caseSensitive] |
|
4331 |
]. |
|
15597 | 4332 |
]. |
12760 | 4333 |
]. |
4334 |
||
4335 |
notFilters := filterStrings |
|
4336 |
select:[:eachFilter | eachFilter withoutSeparators startsWith:'~'] |
|
4337 |
thenCollect: |
|
4338 |
[:eachPattern | |
|
9296 | 4339 |
|pattern| |
4340 |
||
4341 |
pattern := eachPattern withoutSeparators. |
|
12760 | 4342 |
pattern := (pattern copyFrom:2) withoutSeparators. |
17481 | 4343 |
[:name :baseName | pattern match:baseName caseSensitive:caseSensitive] |
9296 | 4344 |
]. |
5658
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
4345 |
|
12760 | 4346 |
|
4347 |
(filters size == 1 and:[notFilters isEmpty]) ifTrue:[ |
|
5658
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
4348 |
filterBlock := filters first |
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
4349 |
] ifFalse:[ |
12760 | 4350 |
filters isEmpty ifTrue:[ |
4351 |
filterBlock := [:name :baseName | |
|
4352 |
(notFilters contains:[:aFilter | aFilter value:name value:baseName ]) not |
|
4353 |
]. |
|
4354 |
] ifFalse:[ |
|
4355 |
notFilters isEmpty ifTrue:[ |
|
4356 |
filterBlock := [:name :baseName | |
|
4357 |
(filters contains:[:aFilter | aFilter value:name value:baseName ]) |
|
4358 |
]. |
|
4359 |
] ifFalse:[ |
|
4360 |
filterBlock := [:name :baseName | |
|
4361 |
(filters contains:[:aFilter | aFilter value:name value:baseName ]) |
|
4362 |
and:[ (notFilters contains:[:aFilter | aFilter value:name value:baseName ]) not ] |
|
4363 |
]. |
|
4364 |
] |
|
4365 |
] |
|
5658
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
4366 |
]. |
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
4367 |
|
4011 | 4368 |
showHidden := self showHiddenFiles value. |
4369 |
showHidden ifTrue:[ |
|
5658
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
4370 |
^ filterBlock. |
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
4371 |
]. |
9296 | 4372 |
^ [:name :baseName | |
4373 |
name isHidden not and:[filterBlock value:name value:baseName]]. |
|
13856 | 4374 |
|
4375 |
"Modified: / 05-02-2012 / 01:42:36 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
17481 | 4376 |
"Modified: / 27-03-2017 / 12:52:08 / stefan" |
17772 | 4377 |
"Modified: / 20-11-2017 / 22:02:04 / cg" |
4018 | 4378 |
! |
4379 |
||
4380 |
shownFiles |
|
4381 |
||
4382 |
^ self aspectFor:#shownFiles ifAbsent:['-/-' asValue] |
|
4011 | 4383 |
! ! |
4384 |
||
14126 | 4385 |
|
3892 | 4386 |
!AbstractFileBrowser methodsFor:'aspects-history'! |
4387 |
||
4388 |
dirHistory |
|
6369 | 4389 |
"obsolete" |
4390 |
^ self directoryHistory |
|
4391 |
! |
|
4392 |
||
4393 |
directoryHistory |
|
3952 | 4394 |
^ self class directoryHistory |
3892 | 4395 |
! |
4396 |
||
4397 |
enableBack |
|
4398 |
||
15259 | 4399 |
^ self aspectFor:#enableBack ifAbsent:[ValueHolder with:false] |
3892 | 4400 |
! |
4401 |
||
4402 |
enableFileHistory |
|
4403 |
||
15259 | 4404 |
^ self aspectFor:#enableFileHistory ifAbsent:[ValueHolder with:false] |
3892 | 4405 |
! |
4406 |
||
4407 |
enableForward |
|
4408 |
||
15259 | 4409 |
^ self aspectFor:#enableForward ifAbsent:[ValueHolder with:false] |
3892 | 4410 |
! |
4411 |
||
4412 |
fileHistory |
|
9820
07b7d7929e3e
variable renamed in: #fileHistory
Stefan Vogel <sv@exept.de>
parents:
9793
diff
changeset
|
4413 |
^ self aspectFor:#fileHistory ifAbsent:[OrderedSet new] |
3892 | 4414 |
! ! |
4415 |
||
4416 |
!AbstractFileBrowser methodsFor:'aspects-visibility'! |
|
4417 |
||
4345 | 4418 |
activityVisibilityChannel |
6284 | 4419 |
" activityVisibilityChannel switches the activity indicator on/off" |
4345 | 4420 |
|
15259 | 4421 |
^ self aspectFor:#activityVisibilityChannel ifAbsent:[ ValueHolder with:false ]. |
4345 | 4422 |
! |
4423 |
||
15111 | 4424 |
alwaysUseSmalltalkTools |
4425 |
" aspect to prevent os tools to be opened on double click" |
|
4426 |
||
15259 | 4427 |
^ self aspectFor:#alwaysUseSmalltalkTools ifAbsent:[ ValueHolder with:true ]. |
15111 | 4428 |
! |
4429 |
||
6602 | 4430 |
changeSetBrowserItemVisible |
4431 |
^ Screen current ctrlDown. |
|
4432 |
! |
|
4433 |
||
11135 | 4434 |
cvsMenusAreShown |
11156
11c0b4cbc836
Use Configurable includesFeature:#Feature instead of direct send of #hasFeature
vrany
parents:
11149
diff
changeset
|
4435 |
^ ConfigurableFeatures includesFeature: #CVSSupportEnabled |
11135 | 4436 |
|
4437 |
"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
|
4438 |
"Modified: / 19-01-2012 / 10:43:30 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
11135 | 4439 |
! |
4440 |
||
13856 | 4441 |
hgMenusAreShown |
4442 |
^ (ConfigurableFeatures includesFeature: #HGSupportEnabled) |
|
4443 |
||
4444 |
"Created: / 14-01-2013 / 11:53:51 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
4445 |
! |
|
4446 |
||
11135 | 4447 |
mercurialMenusAreShown |
11147 | 4448 |
^ ConfigurableFeatures hasMercurialSupportEnabled |
11135 | 4449 |
|
4450 |
"Created: / 15-01-2012 / 13:00:00 / cg" |
|
4451 |
! |
|
4452 |
||
4110 | 4453 |
openAlwaysInTextEditor |
17024 | 4454 |
" aspect for open every file in TextEditor don't use e.g. HtmlEditor for *.html'" |
4110 | 4455 |
|
15111 | 4456 |
^ self aspectFor:#openAlwaysInTextEditor ifAbsent:[ false asValue ]. |
4110 | 4457 |
! |
4458 |
||
3892 | 4459 |
openMultipleApplicationsForType |
4460 |
||
4201 | 4461 |
" aspect for open more applications for e.g. TextEditor and not change the contents of already |
4462 |
open TextEditor " |
|
4463 |
||
3892 | 4464 |
^ self aspectFor:#openMultipleApplicationsForType ifAbsent:[ false asValue ]. |
4465 |
! |
|
4466 |
||
11137 | 4467 |
perforceMenusAreShown |
11996
e3b824f2d454
changed: #perforceMenusAreShown
Claus Gittinger <cg@exept.de>
parents:
11995
diff
changeset
|
4468 |
^ (ConfigurableFeatures includesFeature: #PerforceSupportEnabled) |
e3b824f2d454
changed: #perforceMenusAreShown
Claus Gittinger <cg@exept.de>
parents:
11995
diff
changeset
|
4469 |
and:[ ConfigurableFeatures hasPerforceSupportEnabled ] |
11137 | 4470 |
|
4471 |
"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
|
4472 |
"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
|
4473 |
"Modified: / 02-11-2012 / 11:19:59 / cg" |
11137 | 4474 |
! |
4475 |
||
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
|
4476 |
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
|
4477 |
|
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
|
4478 |
^ 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
|
4479 |
|
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
|
4480 |
"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
|
4481 |
! |
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
|
4482 |
|
4201 | 4483 |
showDirectoryTree |
4484 |
||
4485 |
^ self aspectFor:#showDirectoryTree ifAbsent:[ true asValue ] |
|
3892 | 4486 |
! |
4487 |
||
4554 | 4488 |
showDiskUsageHolder |
4489 |
|holder| |
|
4490 |
||
4560
0d3db5e27bc0
default for disk usage is false
Claus Gittinger <cg@exept.de>
parents:
4558
diff
changeset
|
4491 |
holder := self aspectFor:#showDiskUsageHolder ifAbsent:[ false asValue]. |
4781 | 4492 |
holder addDependent:self. |
4554 | 4493 |
^ holder |
4494 |
! |
|
4495 |
||
3892 | 4496 |
showHiddenFiles |
4497 |
||
9582 | 4498 |
^ self aspectFor:#showHiddenFiles ifAbsent:[ true asValue ]. |
4499 |
||
4500 |
"Modified: / 15-10-2010 / 10:28:17 / cg" |
|
3892 | 4501 |
! |
4502 |
||
9108 | 4503 |
showHiddenFiles:aHolder |
4504 |
self aspectFor:#showHiddenFiles put:aHolder. |
|
4505 |
! |
|
4506 |
||
4507 |
shownFiles:aHolder |
|
4508 |
self aspectFor:#shownFiles put:aHolder. |
|
4509 |
! |
|
4510 |
||
11135 | 4511 |
svnMenusAreShown |
11156
11c0b4cbc836
Use Configurable includesFeature:#Feature instead of direct send of #hasFeature
vrany
parents:
11149
diff
changeset
|
4512 |
^ ConfigurableFeatures includesFeature: #SubversionSupportEnabled |
11135 | 4513 |
|
4514 |
"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
|
4515 |
"Modified: / 19-01-2012 / 10:43:46 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
11135 | 4516 |
! |
4517 |
||
9945
b32126680c13
added: #tagsBrowserVisibleHolder
Claus Gittinger <cg@exept.de>
parents:
9820
diff
changeset
|
4518 |
tagsBrowserVisibleHolder |
b32126680c13
added: #tagsBrowserVisibleHolder
Claus Gittinger <cg@exept.de>
parents:
9820
diff
changeset
|
4519 |
masterApplication notNil ifTrue:[ |
11162
faf8af233ac0
changed: #tagsBrowserVisibleHolder
Claus Gittinger <cg@exept.de>
parents:
11156
diff
changeset
|
4520 |
^ masterApplication perform:#tagsBrowserVisibleHolder ifNotUnderstood:false |
9945
b32126680c13
added: #tagsBrowserVisibleHolder
Claus Gittinger <cg@exept.de>
parents:
9820
diff
changeset
|
4521 |
]. |
10762
311190be6490
changed: #tagsBrowserVisibleHolder
Claus Gittinger <cg@exept.de>
parents:
10757
diff
changeset
|
4522 |
^ self aspectFor:#tagsBrowserVisibleHolder ifAbsent:[ FileApplicationNoteBook::TextEditor defaultTagsBrowserVisible asValue ]. |
9945
b32126680c13
added: #tagsBrowserVisibleHolder
Claus Gittinger <cg@exept.de>
parents:
9820
diff
changeset
|
4523 |
|
b32126680c13
added: #tagsBrowserVisibleHolder
Claus Gittinger <cg@exept.de>
parents:
9820
diff
changeset
|
4524 |
"Created: / 27-06-2011 / 16:02:59 / cg" |
b32126680c13
added: #tagsBrowserVisibleHolder
Claus Gittinger <cg@exept.de>
parents:
9820
diff
changeset
|
4525 |
! |
b32126680c13
added: #tagsBrowserVisibleHolder
Claus Gittinger <cg@exept.de>
parents:
9820
diff
changeset
|
4526 |
|
10757
5bbe8b995a5f
added: #useCodeView2InTools
Claus Gittinger <cg@exept.de>
parents:
10747
diff
changeset
|
4527 |
useCodeView2InTools |
5bbe8b995a5f
added: #useCodeView2InTools
Claus Gittinger <cg@exept.de>
parents:
10747
diff
changeset
|
4528 |
^ self aspectFor:#useCodeView2InTools ifAbsent:[ UserPreferences current useCodeView2InTools asValue ]. |
5bbe8b995a5f
added: #useCodeView2InTools
Claus Gittinger <cg@exept.de>
parents:
10747
diff
changeset
|
4529 |
|
5bbe8b995a5f
added: #useCodeView2InTools
Claus Gittinger <cg@exept.de>
parents:
10747
diff
changeset
|
4530 |
"Created: / 06-10-2011 / 11:45:58 / cg" |
5bbe8b995a5f
added: #useCodeView2InTools
Claus Gittinger <cg@exept.de>
parents:
10747
diff
changeset
|
4531 |
! |
5bbe8b995a5f
added: #useCodeView2InTools
Claus Gittinger <cg@exept.de>
parents:
10747
diff
changeset
|
4532 |
|
4648 | 4533 |
userContextAvailable |
4534 |
||
4535 |
" aspect for show group and user columns in contents view |
|
4536 |
windows provides no user context" |
|
4537 |
||
4538 |
^ OperatingSystem isMSWINDOWSlike not |
|
4539 |
! |
|
4540 |
||
3892 | 4541 |
viewDescription |
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4542 |
"aspect for show file description in DirectoryContentsBrowser" |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4543 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4544 |
^ self directoryContentsBrowser viewDescription |
3892 | 4545 |
! |
4546 |
||
4547 |
viewDetails |
|
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4548 |
"aspect for show more file properties in DirectoryContentsBrowser |
4201 | 4549 |
" |
3892 | 4550 |
|
6121 | 4551 |
|directoryContentsBrowser| |
4552 |
||
4553 |
directoryContentsBrowser := self directoryContentsBrowser. |
|
4554 |
directoryContentsBrowser isNil ifTrue:[^ nil]. |
|
4555 |
^ directoryContentsBrowser viewDetails |
|
3892 | 4556 |
! |
4557 |
||
4558 |
viewDirectoryDescription |
|
4559 |
||
4201 | 4560 |
" aspect for auto open a TextView for Readme and other see getInfoItem Method files |
4561 |
on change directory " |
|
4562 |
||
3892 | 4563 |
^ self aspectFor:#viewDirectoryDescription ifAbsent:[ true asValue ]. |
4564 |
! |
|
4565 |
||
4201 | 4566 |
viewDirsInContentsBrowser |
4567 |
||
4568 |
^ self aspectFor:#viewDirsInContentsBrowser ifAbsent:[ false asValue ]. |
|
9319
23ae966d9dbf
comment/format in: #viewDirsInContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
9299
diff
changeset
|
4569 |
|
23ae966d9dbf
comment/format in: #viewDirsInContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
9299
diff
changeset
|
4570 |
" |
23ae966d9dbf
comment/format in: #viewDirsInContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
9299
diff
changeset
|
4571 |
UserPreferences current viewDirsInContentsBrowser |
23ae966d9dbf
comment/format in: #viewDirsInContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
9299
diff
changeset
|
4572 |
" |
4201 | 4573 |
! |
4574 |
||
5870 | 4575 |
viewFilesInContentsBrowser |
4576 |
||
4577 |
^ self aspectFor:#viewFilesInContentsBrowser ifAbsent:[ true asValue ]. |
|
4578 |
! |
|
4579 |
||
3892 | 4580 |
viewFilesInDirectoryTree |
4581 |
||
4201 | 4582 |
" aspect for view files in tree view (not only directories) " |
4583 |
||
3892 | 4584 |
^ self aspectFor:#viewFilesInDirectoryTree ifAbsent:[ false asValue ]. |
4585 |
! |
|
4586 |
||
4587 |
viewGroup |
|
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4588 |
" aspect for show group information in DirectoryContentsBrowser " |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4589 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4590 |
^ self directoryContentsBrowser viewGroup |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4591 |
! |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4592 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4593 |
viewIcon |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4594 |
" aspect for show file-type icon in DirectoryContentsBrowser " |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4595 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4596 |
^ self directoryContentsBrowser viewIcon |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4597 |
! |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4598 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4599 |
viewInodeNumber |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4600 |
" aspect for show inode numbers in DirectoryContentsBrowser " |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4601 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4602 |
^ self directoryContentsBrowser viewInodeNumber |
3892 | 4603 |
! |
4604 |
||
4605 |
viewNoteBookApplicationHolder |
|
4606 |
||
4607 |
^ self aspectFor:#viewNoteBookApplicationHolder ifAbsent:[ false asValue]. |
|
4608 |
! |
|
4609 |
||
4610 |
viewOwner |
|
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4611 |
" aspect for show owner information in DirectoryContentsBrowser " |
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 |
^ self directoryContentsBrowser viewOwner |
3892 | 4614 |
! |
4615 |
||
4616 |
viewPermissions |
|
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4617 |
" aspect for show permission information in DirectoryContentsBrowser " |
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 |
^ self directoryContentsBrowser viewPermissions |
3892 | 4620 |
! |
4621 |
||
4622 |
viewPreview |
|
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4623 |
" aspect for show image previev in DirectoryContentsBrowser " |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4624 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4625 |
^ self directoryContentsBrowser viewPreview |
3892 | 4626 |
! |
4627 |
||
4628 |
viewSize |
|
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4629 |
" aspect for show size information in DirectoryContentsBrowser " |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4630 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4631 |
^ self directoryContentsBrowser viewSize |
3892 | 4632 |
! |
4633 |
||
4974 | 4634 |
viewSizeInBytes |
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4635 |
" aspect for show size-in-bytes information in DirectoryContentsBrowser " |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4636 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4637 |
^ self directoryContentsBrowser viewSizeInBytes |
4974 | 4638 |
! |
4639 |
||
5312 | 4640 |
viewSizeInKiloBytes |
4641 |
" aspect for show size-in-kilobytes information in DirectoryContentsBrowser " |
|
4642 |
||
4643 |
^ self directoryContentsBrowser viewSizeInKiloBytes |
|
4644 |
! |
|
4645 |
||
3892 | 4646 |
viewTime |
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4647 |
" aspect for show time information in DirectoryContentsBrowser" |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4648 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4649 |
^ self directoryContentsBrowser viewTime |
3892 | 4650 |
! |
4651 |
||
4652 |
viewType |
|
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4653 |
" aspect for show suffix (type) information in DirectoryContentsBrowser" |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4654 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4655 |
^ self directoryContentsBrowser viewType |
3892 | 4656 |
! ! |
4657 |
||
4658 |
!AbstractFileBrowser methodsFor:'background processing'! |
|
4659 |
||
4660 |
executeCommand:cmd |
|
4661 |
||
4662 |
self executeCommand:cmd inDirectory:nil |
|
4663 |
! |
|
4664 |
||
5880 | 4665 |
executeCommand:cmd inDirectory:aDirectoryOrNil |
3892 | 4666 |
| nameString executionBlock| |
4667 |
||
5880 | 4668 |
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
|
4669 |
nameString := 'Execute: ', cmd. |
3892 | 4670 |
self makeExecutionResultProcessFor:executionBlock withName:nameString. |
4671 |
! |
|
4672 |
||
4673 |
getExecutionBlockForCommand:cmd |
|
4674 |
||
4675 |
^ self getExecutionBlockForCommand:cmd inDirectory:nil |
|
4676 |
! |
|
4677 |
||
5880 | 4678 |
getExecutionBlockForCommand:cmd inDirectory:directoryOrNil |
4679 |
| dir| |
|
4680 |
||
4681 |
dir := directoryOrNil. |
|
4682 |
directoryOrNil isNil ifTrue:[ |
|
4683 |
dir := self theSingleSelectedDirectoryOrNil. |
|
6671 | 4684 |
dir isNil ifTrue:[ |
12493 | 4685 |
Dialog warn:(resources string:'Please select a single directory.'). |
16732 | 4686 |
AbortOperationRequest raise. |
6671 | 4687 |
^ nil |
4688 |
]. |
|
3892 | 4689 |
]. |
4523 | 4690 |
|
4691 |
^ [:stream| |
|
4692 |
stream notNil ifTrue:[ |
|
4414 | 4693 |
OperatingSystem |
4694 |
executeCommand:cmd |
|
4695 |
inputFrom:nil |
|
4696 |
outputTo:stream |
|
4697 |
errorTo:stream |
|
4698 |
inDirectory:dir |
|
16732 | 4699 |
lineWise:true |
16825 | 4700 |
showWindow:false |
4414 | 4701 |
onError:[:status| false]. |
4702 |
] |
|
4523 | 4703 |
]. |
3892 | 4704 |
! |
4705 |
||
4706 |
killAllRunningBackgroundProcesses |
|
4707 |
||
4708 |
self backgroundProcesses do:[ : process | |
|
4523 | 4709 |
self notify:'kill ', process name. |
4414 | 4710 |
process terminate. |
3892 | 4711 |
]. |
4712 |
! |
|
4713 |
||
4714 |
makeExecutionResultProcessFor:aBlock withName:aString |
|
4715 |
| stream process appl nameString| |
|
4716 |
||
4717 |
appl := self openCommandResultApplication. |
|
4718 |
stream := appl resultStream. |
|
4719 |
nameString := aString ? 'Execution Result'. |
|
4720 |
appl changeTabTo:nameString. |
|
4523 | 4721 |
|
16102 | 4722 |
process := |
4723 |
[ |
|
4724 |
[aBlock value:stream] |
|
4725 |
ensure:[ |
|
4726 |
self backgroundProcesses remove:process ifAbsent:[]. |
|
4727 |
appl process value:nil. |
|
4728 |
||
4729 |
"/ close automatically, if there was no output. |
|
4571 | 4730 |
"/ appl resultStream contents isEmpty ifTrue:[ |
4731 |
"/ appl doClose. |
|
4732 |
"/ ] |
|
16102 | 4733 |
stream nextPutLine:'Done.'. |
4734 |
self enqueueMessage:#updateCurrentDirectory. |
|
4735 |
] |
|
4736 |
] newProcess. |
|
3892 | 4737 |
process priority:(Processor userBackgroundPriority). |
4738 |
process name:nameString. |
|
4739 |
self backgroundProcesses add:process. |
|
4740 |
appl process value:process. |
|
4741 |
process resume. |
|
4742 |
! ! |
|
4743 |
||
4744 |
!AbstractFileBrowser methodsFor:'change & update'! |
|
4745 |
||
4915 | 4746 |
currentFileNameHolderChanged |
4747 |
"/ self currentFileNameHolderChangedForCommon |
|
4748 |
! |
|
4749 |
||
4577 | 4750 |
currentFileNameHolderChangedForCommon |
5476 | 4751 |
|newDirectories oldDirectories size rootInTreeView selection selectionNotEmpty| |
4368
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
4752 |
|
7560 | 4753 |
selection := self currentSelectedObjects. |
4368
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
4754 |
self class currentSelection:selection. |
4734 | 4755 |
|
13521 | 4756 |
selectionNotEmpty := selection notEmptyOrNil. |
5476 | 4757 |
self hasSelection value:selectionNotEmpty. |
4758 |
self hasFileSelection value:(selectionNotEmpty and:[self firstSelectedFile notNil]). |
|
4734 | 4759 |
|
4368
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
4760 |
newDirectories := self directoriesForFiles:selection. |
6725 | 4761 |
oldDirectories := self currentSelectedDirectories. |
4011 | 4762 |
oldDirectories ~= newDirectories ifTrue:[ |
4347 | 4763 |
self currentDirectories value:newDirectories. |
4764 |
size := newDirectories size. |
|
4774 | 4765 |
rootInTreeView := self |
4766 |
applicationNamed:#DirectoryTreeBrowser |
|
5009 | 4767 |
ifPresentDo:[:appl | appl rootHolder]. |
4768 |
rootInTreeView := rootInTreeView value. |
|
5437
3556b0348494
directory up not allowed for drive root under windows
penk
parents:
5432
diff
changeset
|
4769 |
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
|
4770 |
|
4347 | 4771 |
newDirectories notEmpty ifTrue:[ |
6369 | 4772 |
self directoryHistory addToHistory:(newDirectories first asString). |
4347 | 4773 |
]. |
5074 | 4774 |
self enableHome value:((newDirectories includes:(Filename homeDirectory asAbsoluteFilename))not). |
14308 | 4775 |
"/ self enableGotoDesktop value:((newDirectories includes:(Filename desktopDirectory asAbsoluteFilename))not). |
6456 | 4776 |
self enableGotoDefaultDirectory value:((newDirectories includes:(Filename defaultDirectory asAbsoluteFilename))not). |
4777 |
self enableGotoSmalltalkDirectory value:((newDirectories includes:(self smalltalkDirectory asAbsoluteFilename))not). |
|
9572 | 4778 |
self enableGotoDesktopDirectory value:((newDirectories includes:(Filename desktopDirectory asAbsoluteFilename))not). |
9677 | 4779 |
self enableGotoTempDirectory value:((newDirectories includes:(self tempDirectory asAbsoluteFilename))not). |
4011 | 4780 |
]. |
9599
6ffff091db22
changed: #currentFileNameHolderChangedForCommon
Claus Gittinger <cg@exept.de>
parents:
9596
diff
changeset
|
4781 |
self enableGotoDefaultDirectory value:(self currentDirectory isNil or:[self currentDirectory pathName ~= OperatingSystem getCurrentDirectory]). |
9596 | 4782 |
self enableMakeCurrentDirectory value:(newDirectories size == 1 |
4783 |
and:[ newDirectories first asFilename pathName ~= OperatingSystem getCurrentDirectory ]). |
|
4022 | 4784 |
self enableForward value:self canForward. |
4734 | 4785 |
self enableBack value:self canBackward. |
6095 | 4786 |
|
13856 | 4787 |
self updateCanMake. |
7560 | 4788 |
|
9677 | 4789 |
"Modified: / 29-12-2010 / 11:01:52 / cg" |
13856 | 4790 |
"Modified: / 17-12-2013 / 08:23:31 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
4011 | 4791 |
! |
4792 |
||
4793 |
filterModelChanged |
|
4794 |
||
5658
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
4795 |
self filterBlockHolder value:(self makeFilterBlock). |
4011 | 4796 |
! |
4797 |
||
3892 | 4798 |
update:something with:aParameter from:changedObject |
4799 |
||
4800 |
" do here all the things that have to be done for every part of the FileBrowserV2 |
|
4801 |
and the things that have to be done if it runs standalone " |
|
4802 |
||
4803 |
changedObject == self currentFileNameHolder ifTrue:[ |
|
4577 | 4804 |
self currentFileNameHolderChangedForCommon. |
4368
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
4805 |
^ self |
3892 | 4806 |
]. |
3989 | 4807 |
changedObject == self sortCaseless ifTrue:[ |
4368
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
4808 |
self sortFileListsBy:#baseName withReverse:false. |
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
4809 |
^ self |
3989 | 4810 |
]. |
6785
cac8107d889c
clear reverseSort flag, when sort-order is changed via menu.
Claus Gittinger <cg@exept.de>
parents:
6767
diff
changeset
|
4811 |
changedObject == self sortBlockProperty ifTrue:[ |
cac8107d889c
clear reverseSort flag, when sort-order is changed via menu.
Claus Gittinger <cg@exept.de>
parents:
6767
diff
changeset
|
4812 |
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
|
4813 |
^ self |
cac8107d889c
clear reverseSort flag, when sort-order is changed via menu.
Claus Gittinger <cg@exept.de>
parents:
6767
diff
changeset
|
4814 |
]. |
4011 | 4815 |
(changedObject == self filterModel or:[changedObject == self showHiddenFiles]) ifTrue:[ |
4368
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
4816 |
self filterModelChanged. |
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
4817 |
^ self |
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
4818 |
]. |
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
4819 |
changedObject == self rootHolder ifTrue:[ |
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
4820 |
self class rootHolder:(self rootHolder value). |
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
4821 |
^ self |
4004 | 4822 |
]. |
4781 | 4823 |
changedObject == self showDiskUsageHolder ifTrue:[ |
6190 | 4824 |
self notify:nil. |
4781 | 4825 |
^ self |
4826 |
]. |
|
3989 | 4827 |
|
3892 | 4828 |
super update:something with:aParameter from:changedObject |
5543 | 4829 |
! |
4830 |
||
6095 | 4831 |
updateCanMake |
4832 |
|dir can| |
|
4833 |
||
4834 |
can := false. |
|
4835 |
dir := self currentDirectory. |
|
4836 |
dir notNil ifTrue:[ |
|
13856 | 4837 |
"/ Check for make |
6095 | 4838 |
can := (dir asFilename construct:'Makefile') exists. |
13856 | 4839 |
can ifFalse:[ |
4840 |
can := (dir asFilename construct:'makefile') exists. |
|
4841 |
]. |
|
6095 | 4842 |
OperatingSystem isMSWINDOWSlike ifTrue:[ |
4843 |
can ifFalse:[ |
|
13856 | 4844 |
can := (self currentDirectory asFilename construct:'bc.mak') exists. |
6095 | 4845 |
] |
4846 |
]. |
|
13856 | 4847 |
can ifTrue:[ |
4848 |
self makeCommandHolder value: 'make'. |
|
4849 |
self canMake value: true. |
|
4850 |
^ self |
|
4851 |
]. |
|
4852 |
||
4853 |
"/Check for Apache ant |
|
4854 |
(OperatingSystem canExecuteCommand: 'ant') ifTrue:[ |
|
4855 |
can := (dir asFilename construct:'build.xml') exists. |
|
4856 |
can ifTrue:[ |
|
4857 |
self makeCommandHolder value: 'ant'. |
|
4858 |
self canMake value: true. |
|
4859 |
^ self |
|
4860 |
]. |
|
4861 |
]. |
|
4862 |
||
4863 |
"/Add more here... |
|
4864 |
||
6095 | 4865 |
]. |
4866 |
self canMake value:can. |
|
13856 | 4867 |
|
4868 |
"Modified: / 17-12-2013 / 08:13:39 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
6095 | 4869 |
! |
4870 |
||
5543 | 4871 |
updateListAfterDelete:colOfFiles |
17871 | 4872 |
self updateCurrentDirectoryWithReread |
3892 | 4873 |
! ! |
4874 |
||
4875 |
!AbstractFileBrowser methodsFor:'clipboard'! |
|
4876 |
||
4877 |
canPaste |
|
4878 |
||
15259 | 4879 |
^ self aspectFor:#canPaste ifAbsent:[ ValueHolder with:false ]. |
3892 | 4880 |
! |
4881 |
||
4882 |
clipboard |
|
4883 |
||
4884 |
^ self aspectFor:#clipboard ifAbsent:[Clipboard new] |
|
4885 |
! |
|
4886 |
||
4887 |
copyFilesToClipBoard:colOfFiles |
|
4888 |
self putInClipBoard:colOfFiles as:#copy. |
|
4889 |
! |
|
4890 |
||
4891 |
cutFilesToClipBoard:colOfFiles |
|
4892 |
"defete current selected files/directories |
|
4893 |
" |
|
4894 |
self putInClipBoard:colOfFiles as:#cut. |
|
4895 |
! |
|
4896 |
||
4897 |
emptyClipBoard |
|
4898 |
||
4899 |
self clipboard files:nil. |
|
4900 |
self canPaste value:false. |
|
4901 |
! |
|
4902 |
||
4903 |
putInClipBoard:colOfFiles as:aSymbol |
|
4904 |
| stream clp| |
|
4905 |
||
4906 |
colOfFiles isEmpty ifTrue:[ ^ self]. |
|
4907 |
clp := self clipboard. |
|
4908 |
clp files:nil. |
|
4909 |
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
|
4910 |
|
603abfa8cf99
copy name(s) to clipboard - on lineFeed if only one file is selected
Claus Gittinger <cg@exept.de>
parents:
5756
diff
changeset
|
4911 |
stream := String writeStream. |
3892 | 4912 |
stream nextPutAll:aSymbol asString. |
4913 |
stream nextPutAll:' <'. |
|
4914 |
stream nextPutAll:colOfFiles first asString. |
|
4915 |
colOfFiles size > 1 ifTrue:[ |
|
4414 | 4916 |
stream nextPutAll:' ...'. |
3892 | 4917 |
]. |
4918 |
stream nextPutAll:'> to clipboard'. |
|
4919 |
||
4523 | 4920 |
self notify:stream contents. |
3892 | 4921 |
clp files:colOfFiles. |
4922 |
self canPaste value:true. |
|
4923 |
! ! |
|
4924 |
||
4925 |
!AbstractFileBrowser methodsFor:'drag & drop'! |
|
4926 |
||
4927 |
canDropFiles:dropedObjects for:filename |
|
6284 | 4928 |
|filenameDirString filenameDir| |
3892 | 4929 |
|
4930 |
dropedObjects isEmpty ifTrue:[^ false]. |
|
6284 | 4931 |
|
3892 | 4932 |
filenameDir := self getDirWithoutFileName:filename. |
7491 | 4933 |
filenameDir isNil ifTrue:[^ false ]. |
13232 | 4934 |
filenameDir isWritableDirectory ifFalse:[^ false]. |
6284 | 4935 |
|
3892 | 4936 |
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
|
4937 |
|
7ce6eae41e33
do not check if dropFile exists, if its an archive file
Claus Gittinger <cg@exept.de>
parents:
4959
diff
changeset
|
4938 |
dropedObjects do:[:aDropObject | |
6284 | 4939 |
(self canDropObject:aDropObject into:filenameDir) ifFalse:[^ false]. |
4940 |
"/ |dropFileName dropFileNameString physicalPathName| |
|
4941 |
"/ |
|
4942 |
"/ dropFileName := aDropObject theObject. |
|
4943 |
"/ dropFileNameString := dropFileName asString. |
|
4944 |
"/ dropFileName isDirectory ifTrue:[ |
|
4945 |
"/ (self fileName:filenameDirString startsWith:dropFileNameString) ifTrue:[ |
|
4946 |
"/ self notify:'Cannot drop a directory into one of its parent directories'. |
|
4947 |
"/ ^ false |
|
4948 |
"/ ] |
|
4949 |
"/ ] ifFalse:[ |
|
4950 |
"/ physicalPathName := dropFileName physicalPathName. |
|
4951 |
"/ (filenameDirString = dropFileName directory asString |
|
4952 |
"/ or:[ aDropObject isFileInArchive not and:[physicalPathName notNil |
|
4953 |
"/ and:[ filenameDirString = physicalPathName asFilename directory asString]]]) ifTrue:[ |
|
4954 |
"/ self notify:'Cannot drop a file into same directory'. |
|
4955 |
"/ ^ false |
|
4956 |
"/ ] |
|
4957 |
"/ ] |
|
4958 |
]. |
|
4959 |
self notify:nil. |
|
4960 |
^ true |
|
4961 |
! |
|
4962 |
||
4963 |
canDropObject:aDropObject into:aDirectory |
|
4964 |
|filenameDirString dropFileName dropFileNameString physicalPathName| |
|
4965 |
||
4966 |
dropFileName := aDropObject theObject. |
|
4967 |
dropFileNameString := dropFileName asString. |
|
4968 |
dropFileName isDirectory ifTrue:[ |
|
4969 |
filenameDirString := aDirectory asString. |
|
4970 |
(self fileName:filenameDirString startsWith:dropFileNameString) ifTrue:[ |
|
4971 |
self notify:'Cannot drop a directory into one of its parent directories'. |
|
4972 |
^ false |
|
4414 | 4973 |
] |
6284 | 4974 |
] ifFalse:[ |
4975 |
physicalPathName := dropFileName physicalPathName. |
|
4976 |
(aDirectory = dropFileName directory |
|
4977 |
or:[ aDropObject isFileInArchive not |
|
4978 |
and:[physicalPathName notNil |
|
4979 |
and:[ aDirectory = physicalPathName asFilename directory]]]) ifTrue:[ |
|
4980 |
self notify:'Cannot drop a file into same directory'. |
|
4981 |
^ false |
|
4982 |
] |
|
4983 |
]. |
|
4984 |
^ true. |
|
3892 | 4985 |
! |
4986 |
||
7406 | 4987 |
canDropObjects:aCollectionOfDropObjects in:aWidget |
17865 | 4988 |
^ aCollectionOfDropObjects contains:#isFileObject |
7406 | 4989 |
|
4990 |
"Created: / 13-10-2006 / 15:52:49 / cg" |
|
4991 |
! |
|
4992 |
||
17202 | 4993 |
doStartDrag:arg1 in:arg2 |
4994 |
^ self class doStartDrag:arg1 in:arg2 |
|
6479 | 4995 |
! |
4996 |
||
7408 | 4997 |
dropObjects:aCollectionOfDropObjects in:aWidget at:position |
7990 | 4998 |
|fileEntryFieldHolder destDir dropObject fn d| |
4999 |
||
5000 |
fileEntryFieldHolder := self masterApplication notNil |
|
5001 |
ifTrue:[ self masterApplication fileEntryFieldHolder ] |
|
5002 |
ifFalse:[ self fileEntryFieldHolder ]. |
|
5003 |
||
5004 |
aWidget model == fileEntryFieldHolder ifTrue:[ |
|
7900
52ad708471ad
drop into fileName-path-field: goto that directory
Claus Gittinger <cg@exept.de>
parents:
7897
diff
changeset
|
5005 |
dropObject := aCollectionOfDropObjects first. |
52ad708471ad
drop into fileName-path-field: goto that directory
Claus Gittinger <cg@exept.de>
parents:
7897
diff
changeset
|
5006 |
dropObject isFileObject ifTrue:[ |
52ad708471ad
drop into fileName-path-field: goto that directory
Claus Gittinger <cg@exept.de>
parents:
7897
diff
changeset
|
5007 |
fn := dropObject theObject asFilename. |
52ad708471ad
drop into fileName-path-field: goto that directory
Claus Gittinger <cg@exept.de>
parents:
7897
diff
changeset
|
5008 |
dropObject isDirectory ifTrue:[ |
52ad708471ad
drop into fileName-path-field: goto that directory
Claus Gittinger <cg@exept.de>
parents:
7897
diff
changeset
|
5009 |
d := fn. |
52ad708471ad
drop into fileName-path-field: goto that directory
Claus Gittinger <cg@exept.de>
parents:
7897
diff
changeset
|
5010 |
] ifFalse:[ |
52ad708471ad
drop into fileName-path-field: goto that directory
Claus Gittinger <cg@exept.de>
parents:
7897
diff
changeset
|
5011 |
d := fn directory. |
52ad708471ad
drop into fileName-path-field: goto that directory
Claus Gittinger <cg@exept.de>
parents:
7897
diff
changeset
|
5012 |
]. |
7990 | 5013 |
fileEntryFieldHolder value:d pathName. |
7900
52ad708471ad
drop into fileName-path-field: goto that directory
Claus Gittinger <cg@exept.de>
parents:
7897
diff
changeset
|
5014 |
]. |
52ad708471ad
drop into fileName-path-field: goto that directory
Claus Gittinger <cg@exept.de>
parents:
7897
diff
changeset
|
5015 |
^ self. |
52ad708471ad
drop into fileName-path-field: goto that directory
Claus Gittinger <cg@exept.de>
parents:
7897
diff
changeset
|
5016 |
]. |
6479 | 5017 |
|
5018 |
destDir := self currentDirectory. |
|
5019 |
destDir isNil ifTrue:[^ self]. |
|
5020 |
||
8601 | 5021 |
self withWaitCursorDo:[ |
5022 |
aCollectionOfDropObjects do:[:dropObject | |
|
5023 |
|fn| |
|
5024 |
||
5025 |
dropObject isFileObject ifTrue:[ |
|
5026 |
fn := dropObject theObject asFilename. |
|
5027 |
dropObject isDirectory ifTrue:[ |
|
8808
cb6476c0cd3a
oops - drop of directories was broken
Claus Gittinger <cg@exept.de>
parents:
8716
diff
changeset
|
5028 |
fn recursiveCopyTo:destDir |
8601 | 5029 |
] ifFalse:[ |
8950
48c69259d82d
changed: #dropObjects:in:at:
Claus Gittinger <cg@exept.de>
parents:
8887
diff
changeset
|
5030 |
fn copyTo:(destDir / fn baseName ) |
8601 | 5031 |
] |
6479 | 5032 |
] |
8601 | 5033 |
]. |
5034 |
]. |
|
9268
fbeb680106c9
changed: #dropObjects:in:at:
Claus Gittinger <cg@exept.de>
parents:
9267
diff
changeset
|
5035 |
self directoryContentsBrowser notNil ifTrue:[ |
fbeb680106c9
changed: #dropObjects:in:at:
Claus Gittinger <cg@exept.de>
parents:
9267
diff
changeset
|
5036 |
self directoryContentsBrowser |
fbeb680106c9
changed: #dropObjects:in:at:
Claus Gittinger <cg@exept.de>
parents:
9267
diff
changeset
|
5037 |
directoryContentsChangeFlag:true; |
fbeb680106c9
changed: #dropObjects:in:at:
Claus Gittinger <cg@exept.de>
parents:
9267
diff
changeset
|
5038 |
wakeUp |
fbeb680106c9
changed: #dropObjects:in:at:
Claus Gittinger <cg@exept.de>
parents:
9267
diff
changeset
|
5039 |
]. |
7408 | 5040 |
|
5041 |
"Created: / 13-10-2006 / 18:26:41 / cg" |
|
3892 | 5042 |
! ! |
5043 |
||
5044 |
!AbstractFileBrowser methodsFor:'file operations'! |
|
5045 |
||
5046 |
copyFile:aSourceFile to:aDestFile |
|
6190 | 5047 |
"copy to" |
5048 |
||
7635 | 5049 |
^ self copyFile:aSourceFile to:aDestFile repairCorruptedFiles:false |
5050 |
||
5051 |
"Modified: / 07-02-2007 / 18:46:44 / cg" |
|
5052 |
! |
|
5053 |
||
5054 |
copyFile:aSourceFile to:aDestFile repairCorruptedFiles:repairCorruptedFiles |
|
5055 |
"copy to" |
|
5056 |
||
5057 |
|copyOperation msg| |
|
5058 |
||
5059 |
repairCorruptedFiles ifTrue:[ |
|
5060 |
copyOperation := FileOperation copyCorruptedFile:aSourceFile to:aDestFile |
|
5061 |
] ifFalse:[ |
|
5062 |
copyOperation := FileOperation copyFile:aSourceFile to:aDestFile withOverWriteWarning:true copyFileIfSame:true. |
|
5063 |
]. |
|
5064 |
copyOperation result ifTrue:[ |
|
6190 | 5065 |
msg := ('copy ', aSourceFile baseName, ' to:,', aDestFile baseName). |
3892 | 5066 |
] ifFalse:[ |
7635 | 5067 |
msg := copyOperation errorString. |
6190 | 5068 |
]. |
5069 |
self notify:msg. |
|
7635 | 5070 |
^ copyOperation result |
5071 |
||
5072 |
"Created: / 07-02-2007 / 18:46:34 / cg" |
|
3892 | 5073 |
! |
5074 |
||
5075 |
copyFiles:aColOfSourceFiles to:aDirectory |
|
6374 | 5076 |
|copy result| |
3892 | 5077 |
|
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
5078 |
self withActivityIndicationDo:[ |
5961 | 5079 |
copy := FileOperation copyFiles:aColOfSourceFiles to:aDirectory. |
6374 | 5080 |
copy result ifTrue:[ |
5081 |
result := Dictionary withKeys:(copy collectionOfCopiedFiles) andValues:(copy collectionOfNewFiles). |
|
5082 |
] ifFalse:[ |
|
4629
e8739857466c
show busyCursor while moving/copying files.
Claus Gittinger <cg@exept.de>
parents:
4624
diff
changeset
|
5083 |
self notify:copy errorString. |
e8739857466c
show busyCursor while moving/copying files.
Claus Gittinger <cg@exept.de>
parents:
4624
diff
changeset
|
5084 |
]. |
e8739857466c
show busyCursor while moving/copying files.
Claus Gittinger <cg@exept.de>
parents:
4624
diff
changeset
|
5085 |
self updateCurrentDirectory. |
3892 | 5086 |
]. |
6374 | 5087 |
^ result |
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
5088 |
|
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
5089 |
"Modified: / 25-07-2006 / 09:07:04 / cg" |
3892 | 5090 |
! |
5091 |
||
15569 | 5092 |
copyFromToRepairingCorruptedFiles |
5093 |
"ask for source and destination and copy the entered file. |
|
5094 |
Especially useful for raw devices to copy corrupted disks/files |
|
5095 |
" |
|
5096 |
||
5097 |
|source destination| |
|
5098 |
||
5099 |
source := Dialog |
|
5100 |
requestDirectoryName:(resources string:'Copy from:') |
|
5101 |
default:(LastMoveDestination ? self currentDirectory) |
|
5102 |
ok:(resources string:'Continue') |
|
5103 |
abort:nil. |
|
5104 |
||
5105 |
source isEmptyOrNil ifTrue:[^ self]. |
|
5106 |
source := source asFilename. |
|
5107 |
||
5108 |
destination := Dialog |
|
5109 |
requestDirectoryName:(resources string:'Copy "%1" to:' with:source) |
|
5110 |
default:(LastMoveDestination ? self currentDirectory) |
|
5111 |
ok:(resources string:'Copy') |
|
5112 |
abort:nil. |
|
5113 |
||
5114 |
destination isEmptyOrNil ifTrue:[^ self]. |
|
5115 |
destination := destination asFilename. |
|
5116 |
||
5117 |
self copyFile:source to:destination repairCorruptedFiles:true. |
|
5118 |
! |
|
5119 |
||
4707
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
5120 |
copyOrMoveDialog:aCollectionOfFiles for:aDestinationDirectory |
12850 | 5121 |
|size msg answer file| |
4707
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
5122 |
|
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
5123 |
size := aCollectionOfFiles size. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
5124 |
|
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
5125 |
"/ stream := WriteStream on:'' asText. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
5126 |
"/ 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
|
5127 |
"/ size == 1 ifFalse:[ |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
5128 |
"/ stream nextPutAll:'s'. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
5129 |
"/ ]. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
5130 |
"/ stream nextPutAll:': '. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
5131 |
"/ 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
|
5132 |
"/ size == 1 ifFalse:[ |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
5133 |
"/ stream nextPutAll:' ... '. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
5134 |
"/ 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
|
5135 |
"/ ]. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
5136 |
"/ stream cr; nextPutAll:'to: '. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
5137 |
"/ 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
|
5138 |
"/ msg := stream contents |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
5139 |
size == 1 ifTrue:[ |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
5140 |
file := aCollectionOfFiles first. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
5141 |
msg := resources |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
5142 |
stringWithCRs:'Copy or move\\%1:\ %2\to:\ %3 ?' |
17762 | 5143 |
with:(resources string: |
5144 |
(file type == #regular |
|
5145 |
ifTrue:'file' |
|
5146 |
ifFalse:[ |
|
5147 |
file isDirectory |
|
5148 |
ifTrue:'directory' |
|
5149 |
ifFalse:'object'])) |
|
4707
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
5150 |
with:(file baseName allBold) |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
5151 |
with:(aDestinationDirectory asFilename pathName allBold). |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
5152 |
] ifFalse:[ |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
5153 |
msg := resources |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
5154 |
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
|
5155 |
with:size |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
5156 |
with:(aDestinationDirectory asFilename pathName allBold). |
3892 | 5157 |
]. |
4707
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 |
answer := OptionBox |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
5160 |
request:msg |
8127 | 5161 |
label:(resources string:'Copy or Move') |
5898
f6214812e1d2
dont send obsolete message to OptionBox
Claus Gittinger <cg@exept.de>
parents:
5888
diff
changeset
|
5162 |
image:(WarningBox iconBitmap) |
8127 | 5163 |
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
|
5164 |
values:#(#cancel #move #copy #copyAs) |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
5165 |
default:#copy. |
4707
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
5166 |
answer isNil ifTrue:[answer := #cancel]. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
5167 |
^ answer. |
17762 | 5168 |
|
5169 |
"Modified: / 17-11-2017 / 13:16:42 / cg" |
|
3892 | 5170 |
! |
5171 |
||
4354
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
5172 |
copyOrMoveFiles:aColOfSourceFiles to:aDestinationDirectory |
4745 | 5173 |
"copy or move aColOfSourceFiles to aDirectory. |
5174 |
Asks the used if a move or a copy is wanted. |
|
5175 |
Returns true if the copyOrMove happened, false if user aborted the operation." |
|
5176 |
||
4707
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
5177 |
|answer lastOld lastNew| |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
5178 |
|
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
5179 |
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
|
5180 |
answer == #copyAs ifTrue:[ |
4354
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
5181 |
aColOfSourceFiles do:[:eachSourceFile | |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
5182 |
|initial destFile srcBase dstBase| |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
5183 |
|
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
5184 |
srcBase := eachSourceFile asFilename baseName. |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
5185 |
lastOld isNil ifTrue:[ |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
5186 |
initial := srcBase |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
5187 |
] ifFalse:[ |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
5188 |
initial := DoWhatIMeanSupport |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
5189 |
goodRenameDefaultForFile:srcBase lastOld:lastOld lastNew:lastNew. |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
5190 |
]. |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
5191 |
dstBase := Dialog request:('Copy %1 as:' bindWith:srcBase) initialAnswer:initial. |
4745 | 5192 |
dstBase isNil ifTrue:[^ false]. |
4354
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
5193 |
self copyFile:eachSourceFile to:(aDestinationDirectory construct:dstBase). |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
5194 |
lastOld := srcBase. |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
5195 |
lastNew := dstBase. |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
5196 |
]. |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
5197 |
|
4745 | 5198 |
^ true. |
4354
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
5199 |
]. |
4707
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
5200 |
answer == #copy ifTrue:[ |
4354
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
5201 |
self copyFiles:aColOfSourceFiles to:aDestinationDirectory. |
4745 | 5202 |
^ true. |
3892 | 5203 |
]. |
4707
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
5204 |
answer == #move ifTrue:[ |
4354
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
5205 |
self moveFiles:aColOfSourceFiles to:aDestinationDirectory. |
4745 | 5206 |
^ true. |
3892 | 5207 |
]. |
4745 | 5208 |
^ false. |
3892 | 5209 |
! |
5210 |
||
6107 | 5211 |
copySelectionTo |
5212 |
"copy the selected file(s) to another directory" |
|
5213 |
||
13704 | 5214 |
self copySelectionToRepairingCorruptedFiles:false. |
5215 |
self updateCurrentDirectoryWithReread. |
|
7635 | 5216 |
|
5217 |
"Modified: / 07-02-2007 / 18:42:48 / cg" |
|
5218 |
! |
|
5219 |
||
5220 |
copySelectionToRepairingCorruptedFiles |
|
5221 |
"copy the selected file(s) to another directory" |
|
5222 |
||
13704 | 5223 |
self copySelectionToRepairingCorruptedFiles:true. |
5224 |
self updateCurrentDirectoryWithReread. |
|
7635 | 5225 |
|
5226 |
"Created: / 07-02-2007 / 18:42:59 / cg" |
|
5227 |
! |
|
5228 |
||
5229 |
copySelectionToRepairingCorruptedFiles:repairingCorruptedFiles |
|
5230 |
"copy the selected file(s) to another directory" |
|
5231 |
||
6299 | 5232 |
|selectedFiles msg destination directory| |
5233 |
||
7560 | 5234 |
selectedFiles := self currentSelectedObjects copy. |
6299 | 5235 |
selectedFiles isEmptyOrNil ifTrue:[^ self]. |
5236 |
||
5237 |
msg := (selectedFiles size > 1) |
|
14588 | 5238 |
ifTrue:[ 'Copy Selected Items to Directory:' ] |
5239 |
ifFalse:[ 'Copy "%1" to Directory:' ]. |
|
6299 | 5240 |
|
5241 |
destination := Dialog |
|
14588 | 5242 |
requestDirectoryName:(resources stringWithCRs:msg with:selectedFiles first baseName) |
7635 | 5243 |
default:(LastMoveDestination ? self currentDirectory) |
5244 |
ok:(resources string:'Copy') |
|
5245 |
abort:nil. |
|
5246 |
||
6299 | 5247 |
destination isEmptyOrNil ifTrue:[^ self]. |
5248 |
destination := destination asFilename. |
|
5249 |
||
5250 |
destination isDirectory ifFalse:[ |
|
5251 |
selectedFiles size == 1 ifTrue:[ |
|
5252 |
directory := destination directory. |
|
5253 |
directory isDirectory ifTrue:[ |
|
5254 |
LastMoveDestination := directory. |
|
7635 | 5255 |
self copyFile:selectedFiles first to:destination repairCorruptedFiles:repairingCorruptedFiles. |
6299 | 5256 |
^ self. |
5257 |
] |
|
5258 |
] |
|
5259 |
]. |
|
5260 |
||
5261 |
LastMoveDestination := destination. |
|
7635 | 5262 |
repairingCorruptedFiles ifTrue:[ |
5263 |
selectedFiles do:[:eachFile | |
|
5264 |
self copyFile:eachFile to:destination repairCorruptedFiles:repairingCorruptedFiles. |
|
5265 |
]. |
|
5266 |
^ self. |
|
5267 |
] ifFalse:[ |
|
5268 |
self copyFiles:selectedFiles to:destination |
|
5269 |
] |
|
5270 |
||
5271 |
"Created: / 07-02-2007 / 18:42:35 / cg" |
|
6107 | 5272 |
! |
5273 |
||
3892 | 5274 |
deleteFile:aFile |
6373 | 5275 |
"delete the selected files/directories" |
3892 | 5276 |
|
5277 |
^ self deleteFiles:(OrderedCollection with:aFile). |
|
5278 |
! |
|
5279 |
||
5280 |
deleteFiles:colOfFiles |
|
6373 | 5281 |
"delete some files/directories" |
5282 |
||
5081 | 5283 |
^ self deleteFiles:colOfFiles confirm:true. |
5284 |
! |
|
5285 |
||
5286 |
deleteFiles:colOfFiles confirm:confirm |
|
6373 | 5287 |
"delete some files/directories" |
5288 |
||
5673 | 5289 |
|delete result| |
3892 | 5290 |
|
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
5291 |
self withActivityIndicationDo:[ |
9575
548adf8e9d98
added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents:
9572
diff
changeset
|
5292 |
ProgressNotification handle:[:info | |
548adf8e9d98
added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents:
9572
diff
changeset
|
5293 |
self progressPercentageHolder value:info progressValue. |
548adf8e9d98
added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents:
9572
diff
changeset
|
5294 |
info proceed |
548adf8e9d98
added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents:
9572
diff
changeset
|
5295 |
] do:[ |
548adf8e9d98
added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents:
9572
diff
changeset
|
5296 |
delete := FileOperation deleteFiles:colOfFiles confirm:confirm. |
548adf8e9d98
added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents:
9572
diff
changeset
|
5297 |
result := delete result. |
548adf8e9d98
added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents:
9572
diff
changeset
|
5298 |
]. |
5673 | 5299 |
result notNil ifTrue:[ |
5300 |
result ifFalse:[ |
|
5301 |
self notify:delete errorString. |
|
5753 | 5302 |
] ifTrue:[ |
5303 |
self updateListAfterDelete:colOfFiles. |
|
5304 |
] |
|
4394 | 5305 |
]. |
5673 | 5306 |
]. |
5307 |
^ result. |
|
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
5308 |
|
9575
548adf8e9d98
added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents:
9572
diff
changeset
|
5309 |
"Modified: / 11-10-2010 / 13:08:24 / cg" |
3892 | 5310 |
! |
5311 |
||
6169 | 5312 |
eraseFiles:colOfFiles |
6373 | 5313 |
"erase (clear and delete) some files/directories" |
5314 |
||
6169 | 5315 |
^ self eraseFiles:colOfFiles confirm:true. |
5316 |
! |
|
5317 |
||
5318 |
eraseFiles:colOfFiles confirm:confirm |
|
6373 | 5319 |
"erase (clear and delete) some files/directories" |
5320 |
||
8462
a5d12742a900
changed #eraseFiles:confirm:
Claus Gittinger <cg@exept.de>
parents:
8454
diff
changeset
|
5321 |
|deleteOperation result fileSize| |
6169 | 5322 |
|
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
5323 |
self withActivityIndicationDo:[ |
8462
a5d12742a900
changed #eraseFiles:confirm:
Claus Gittinger <cg@exept.de>
parents:
8454
diff
changeset
|
5324 |
fileSize := colOfFiles first asFilename fileSize. |
8294 | 5325 |
deleteOperation := FileOperation eraseFiles:colOfFiles confirm:confirm. |
8462
a5d12742a900
changed #eraseFiles:confirm:
Claus Gittinger <cg@exept.de>
parents:
8454
diff
changeset
|
5326 |
(colOfFiles size == 1 and:[ fileSize < (10*1024*1024) ]) |
8294 | 5327 |
ifTrue:[ |
5328 |
result := deleteOperation result. |
|
5329 |
] ifFalse:[ |
|
5330 |
ProgressIndicator |
|
5331 |
displayProgressNotifications:'Erasing' |
|
5332 |
abortable:true |
|
5333 |
at:nil |
|
5334 |
during:[ |
|
5335 |
result := deleteOperation result. |
|
5336 |
]. |
|
5337 |
]. |
|
5338 |
||
6169 | 5339 |
result notNil ifTrue:[ |
5340 |
result ifFalse:[ |
|
8294 | 5341 |
self notify:deleteOperation errorString. |
6169 | 5342 |
] ifTrue:[ |
5343 |
self updateListAfterDelete:colOfFiles. |
|
5344 |
] |
|
5345 |
]. |
|
5346 |
]. |
|
5347 |
^ result. |
|
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
5348 |
|
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
5349 |
"Modified: / 25-07-2006 / 09:07:16 / cg" |
6169 | 5350 |
! |
5351 |
||
3892 | 5352 |
moveFile:aSourceFile to:aDestFile |
6373 | 5353 |
"move a file/directory" |
3892 | 5354 |
|
5355 |
|move| |
|
5356 |
||
5961 | 5357 |
move := FileOperation moveFile:aSourceFile to:aDestFile. |
3892 | 5358 |
move result ifTrue:[ |
15346 | 5359 |
self notify:(resources string: 'move "%1" to "%2"' with:aSourceFile asString with:aDestFile asString). |
3892 | 5360 |
] ifFalse:[ |
4523 | 5361 |
self notify:move errorString. |
3892 | 5362 |
]. |
17871 | 5363 |
self updateCurrentDirectoryWithReread. |
3892 | 5364 |
^ move result |
5365 |
! |
|
5366 |
||
5367 |
moveFiles:aColOfSourceFiles to:aDirectory |
|
6373 | 5368 |
"move some files to aDirectory" |
5369 |
||
3892 | 5370 |
|move| |
5371 |
||
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
5372 |
self withActivityIndicationDo:[ |
5961 | 5373 |
move := FileOperation moveFiles:aColOfSourceFiles to:aDirectory. |
4629
e8739857466c
show busyCursor while moving/copying files.
Claus Gittinger <cg@exept.de>
parents:
4624
diff
changeset
|
5374 |
move result ifFalse:[ |
e8739857466c
show busyCursor while moving/copying files.
Claus Gittinger <cg@exept.de>
parents:
4624
diff
changeset
|
5375 |
self notify:move errorString. |
e8739857466c
show busyCursor while moving/copying files.
Claus Gittinger <cg@exept.de>
parents:
4624
diff
changeset
|
5376 |
]. |
17871 | 5377 |
self updateCurrentDirectoryWithReread. |
3892 | 5378 |
]. |
6373 | 5379 |
^ move collectionOfMovedFiles |
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
5380 |
|
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
5381 |
"Modified: / 25-07-2006 / 09:07:32 / cg" |
3892 | 5382 |
! |
5383 |
||
6107 | 5384 |
moveSelectionTo |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
5385 |
"move the selected file(s) to another directory" |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
5386 |
|
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
5387 |
|destinationDirectory| |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
5388 |
|
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
5389 |
destinationDirectory := Dialog |
14588 | 5390 |
requestDirectoryName:(resources stringWithCRs:'Move Selected Items to Directory:') |
5789 | 5391 |
default:(LastMoveDestination ? self currentDirectory) |
6952 | 5392 |
ok:(resources string:'Move') |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
5393 |
abort:nil. |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
5394 |
destinationDirectory isEmptyOrNil ifTrue:[^ self]. |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
5395 |
|
5789 | 5396 |
LastMoveDestination := destinationDirectory. |
13704 | 5397 |
self moveFiles:(self currentSelectedObjects copy) to:destinationDirectory asFilename. |
5398 |
self updateCurrentDirectoryWithReread. |
|
5399 |
||
7560 | 5400 |
|
5401 |
"Modified: / 04-12-2006 / 13:15:12 / cg" |
|
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
5402 |
! |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
5403 |
|
3892 | 5404 |
newDirectory |
5405 |
"ask for and create a new directory" |
|
5406 |
||
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
5407 |
|selectedFiles singleSelectedFile defaultAnswer directory createOp newFile mime| |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
5408 |
|
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
5409 |
directory := self currentDirectory. |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
5410 |
directory isNil ifTrue:[ |
18175 | 5411 |
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
|
5412 |
^ self |
366465d1a8a5
warn on create new file or directory if nothing selected or more than one directory
penk
parents:
4976
diff
changeset
|
5413 |
]. |
4521 | 5414 |
|
5415 |
"/ 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
|
5416 |
selectedFiles := self currentSelectedFiles. |
4521 | 5417 |
selectedFiles size == 1 ifTrue:[ |
5418 |
singleSelectedFile := selectedFiles first. |
|
5419 |
||
5420 |
mime := MIMETypes mimeTypeForFilename:singleSelectedFile. |
|
13714 | 5421 |
(mime notNil and:[mime isArchiveType]) ifTrue:[ |
4521 | 5422 |
defaultAnswer := singleSelectedFile asFilename withoutSuffix baseName. |
5423 |
||
5424 |
mime := MIMETypes mimeTypeForFilename:defaultAnswer. |
|
13714 | 5425 |
(mime notNil and:[mime isArchiveType]) ifTrue:[ |
4521 | 5426 |
defaultAnswer := defaultAnswer asFilename withoutSuffix baseName |
5427 |
]. |
|
5428 |
]. |
|
5429 |
]. |
|
5430 |
||
5961 | 5431 |
|
4521 | 5432 |
defaultAnswer notNil ifTrue:[ |
5961 | 5433 |
createOp := FileOperation createDirectoryIn:directory initialAnswer:defaultAnswer. |
4521 | 5434 |
] ifFalse:[ |
5961 | 5435 |
createOp := FileOperation createDirectoryIn:directory. |
4521 | 5436 |
]. |
5437 |
createOp result ifFalse:[ ^ self]. |
|
5438 |
newFile := createOp createdFile. |
|
3892 | 5439 |
newFile notNil ifTrue:[ |
17871 | 5440 |
self updateCurrentDirectoryWithReread. |
3892 | 5441 |
] |
17818 | 5442 |
|
5443 |
"Modified: / 29-11-2017 / 12:26:41 / cg" |
|
18175 | 5444 |
"Modified: / 01-06-2018 / 12:49:43 / Claus Gittinger" |
3892 | 5445 |
! |
5446 |
||
5447 |
newFile |
|
5448 |
"ask for and create a new file" |
|
5449 |
||
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
5450 |
| curFile directory create file| |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
5451 |
|
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
5452 |
directory := self currentDirectory. |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
5453 |
directory isNil ifTrue:[ |
18175 | 5454 |
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
|
5455 |
^ self. |
366465d1a8a5
warn on create new file or directory if nothing selected or more than one directory
penk
parents:
4976
diff
changeset
|
5456 |
]. |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
5457 |
|
3982 | 5458 |
curFile := self firstSelectedFile. |
3892 | 5459 |
curFile notNil ifTrue:[ |
4414 | 5460 |
file := curFile. |
3892 | 5461 |
] ifFalse:[ |
4414 | 5462 |
file := directory. |
3892 | 5463 |
]. |
5961 | 5464 |
create := FileOperation createFileIn:file. |
3892 | 5465 |
create result ifFalse:[ ^ self]. |
5466 |
self updateAndSelect:(OrderedCollection with:(create createdFile)). |
|
17818 | 5467 |
|
5468 |
"Modified: / 29-11-2017 / 12:26:51 / cg" |
|
18175 | 5469 |
"Modified: / 01-06-2018 / 12:49:50 / Claus Gittinger" |
3892 | 5470 |
! |
5471 |
||
5472 |
newHardLink |
|
5473 |
"ask for and create a hard link (unix only)" |
|
5474 |
||
6151 | 5475 |
self newLink:#hard. |
5476 |
! |
|
5477 |
||
5478 |
newLink:typeOfLink |
|
3892 | 5479 |
"ask for and create a symbolic if symbolic is true otherwise a hard link (unix only)" |
5480 |
||
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
5481 |
| sel dir create createdFile| |
3892 | 5482 |
|
7560 | 5483 |
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
|
5484 |
(sel size ~= 1) ifTrue:[ |
18175 | 5485 |
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
|
5486 |
^ self |
366465d1a8a5
warn on create new file or directory if nothing selected or more than one directory
penk
parents:
4976
diff
changeset
|
5487 |
]. |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
5488 |
dir := sel first. |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
5489 |
|
6151 | 5490 |
create := FileOperation createLinkIn:dir soft:(typeOfLink == #soft). |
3892 | 5491 |
create result ifFalse:[ ^ self]. |
5492 |
createdFile := create createdFile. |
|
5493 |
createdFile notNil ifTrue:[ |
|
6151 | 5494 |
typeOfLink == #soft ifTrue:[ |
17871 | 5495 |
self updateCurrentDirectoryWithReread. |
4785
5a3f7a0c3ff1
symbolic link creation code fixed
Claus Gittinger <cg@exept.de>
parents:
4782
diff
changeset
|
5496 |
] ifFalse:[ |
5a3f7a0c3ff1
symbolic link creation code fixed
Claus Gittinger <cg@exept.de>
parents:
4782
diff
changeset
|
5497 |
self updateAndSelect:(OrderedCollection with:createdFile). |
5a3f7a0c3ff1
symbolic link creation code fixed
Claus Gittinger <cg@exept.de>
parents:
4782
diff
changeset
|
5498 |
] |
3892 | 5499 |
]. |
7560 | 5500 |
|
17818 | 5501 |
"Modified: / 29-11-2017 / 12:26:58 / cg" |
18175 | 5502 |
"Modified: / 01-06-2018 / 12:49:32 / Claus Gittinger" |
3892 | 5503 |
! |
5504 |
||
5505 |
newSoftLink |
|
5506 |
"ask for and create a soft link (unix only)" |
|
5507 |
||
6151 | 5508 |
self newLink:#soft. |
3892 | 5509 |
! |
5510 |
||
5511 |
pasteFiles |
|
6373 | 5512 |
"paste from clipBoard" |
5513 |
||
5514 |
|buffer destination files directories copiedFiles thisIsAFileMoveOperation| |
|
3892 | 5515 |
|
5516 |
files := self clipboard files. |
|
6482
00207f456339
isEmptyOrNil / notEmptyOrNil refactoring
Claus Gittinger <cg@exept.de>
parents:
6479
diff
changeset
|
5517 |
files isEmptyOrNil ifTrue:[ ^ self ]. |
6373 | 5518 |
|
5519 |
thisIsAFileMoveOperation := self clipboard method == #cut. |
|
5520 |
||
3892 | 5521 |
buffer := self clipboard copy. |
3982 | 5522 |
directories := self currentSelectedDirectories. |
5880 | 5523 |
directories size ~~ 1 ifTrue:[ |
4414 | 5524 |
|box dirStringCol| |
5880 | 5525 |
|
4414 | 5526 |
dirStringCol := directories collect:[:aDir| aDir asString]. |
5527 |
box := ListSelectionBox new. |
|
6373 | 5528 |
box title:'Paste into which directory ?'. |
4414 | 5529 |
box list:dirStringCol. |
5530 |
box okAction:[:sel | destination := sel asFilename]. |
|
5003
a14ce263ada5
boxes no longer show at pointer
Claus Gittinger <cg@exept.de>
parents:
4982
diff
changeset
|
5531 |
box show. |
a14ce263ada5
boxes no longer show at pointer
Claus Gittinger <cg@exept.de>
parents:
4982
diff
changeset
|
5532 |
box destroy. |
3892 | 5533 |
] ifFalse:[ |
5880 | 5534 |
destination := directories anElement. |
3892 | 5535 |
]. |
6373 | 5536 |
|
5537 |
thisIsAFileMoveOperation ifTrue:[ |
|
5081 | 5538 |
buffer files copy do:[:aFile| |
5539 |
aFile directory = destination ifTrue:[ |
|
5540 |
buffer files remove:aFile. |
|
5541 |
]. |
|
5542 |
]. |
|
5543 |
]. |
|
5544 |
copiedFiles := self copyFiles:(buffer files) to:destination. |
|
6374 | 5545 |
copiedFiles notEmptyOrNil ifTrue:[ |
5546 |
thisIsAFileMoveOperation ifTrue:[ |
|
5547 |
self deleteFiles:(copiedFiles keys) confirm:false. |
|
5548 |
]. |
|
5549 |
||
5550 |
"/ select those pasted files. |
|
5551 |
self updateCurrentDirectory:true. |
|
5552 |
self currentFileNameHolder value:copiedFiles values. |
|
5553 |
] |
|
3892 | 5554 |
! |
5555 |
||
5556 |
renameFile:aFile |
|
5557 |
"rename the selected file(s)" |
|
5558 |
||
9793
df3c1b8165fa
variable renamed in: #renameFile:
Stefan Vogel <sv@exept.de>
parents:
9784
diff
changeset
|
5559 |
^ self renameFiles:(Array with:aFile). |
3892 | 5560 |
! |
5561 |
||
4230 | 5562 |
renameFile:filename to:newFileString update:aBoolean |
3892 | 5563 |
"rename filename to newFileString" |
5564 |
||
5565 |
|rename| |
|
5566 |
||
5961 | 5567 |
rename := FileOperation renameFile:filename to:newFileString. |
3892 | 5568 |
rename result ifTrue:[ |
4230 | 5569 |
aBoolean ifTrue:[ |
5570 |
self updateAndSelect:(rename renamedFiles). |
|
5571 |
]. |
|
3892 | 5572 |
] ifFalse:[ |
4523 | 5573 |
self notify:rename errorString. |
3892 | 5574 |
]. |
5575 |
^ rename result |
|
5576 |
! |
|
5577 |
||
5578 |
renameFiles:aColOfFiles |
|
6373 | 5579 |
"rename some file(s)" |
3892 | 5580 |
|
5581 |
|rename| |
|
5582 |
||
5961 | 5583 |
rename := FileOperation renameFiles:aColOfFiles. |
3892 | 5584 |
rename result ifFalse:[ |
9793
df3c1b8165fa
variable renamed in: #renameFile:
Stefan Vogel <sv@exept.de>
parents:
9784
diff
changeset
|
5585 |
self notify:rename errorString. |
df3c1b8165fa
variable renamed in: #renameFile:
Stefan Vogel <sv@exept.de>
parents:
9784
diff
changeset
|
5586 |
^ nil. |
df3c1b8165fa
variable renamed in: #renameFile:
Stefan Vogel <sv@exept.de>
parents:
9784
diff
changeset
|
5587 |
]. |
df3c1b8165fa
variable renamed in: #renameFile:
Stefan Vogel <sv@exept.de>
parents:
9784
diff
changeset
|
5588 |
^ rename |
3892 | 5589 |
! |
5590 |
||
5591 |
renameSelection |
|
5592 |
"rename the selected file(s)" |
|
5593 |
||
9793
df3c1b8165fa
variable renamed in: #renameFile:
Stefan Vogel <sv@exept.de>
parents:
9784
diff
changeset
|
5594 |
|renamed| |
df3c1b8165fa
variable renamed in: #renameFile:
Stefan Vogel <sv@exept.de>
parents:
9784
diff
changeset
|
5595 |
|
df3c1b8165fa
variable renamed in: #renameFile:
Stefan Vogel <sv@exept.de>
parents:
9784
diff
changeset
|
5596 |
renamed := self renameFiles:(self currentSelectedObjects copy). |
df3c1b8165fa
variable renamed in: #renameFile:
Stefan Vogel <sv@exept.de>
parents:
9784
diff
changeset
|
5597 |
renamed notNil ifTrue:[ |
df3c1b8165fa
variable renamed in: #renameFile:
Stefan Vogel <sv@exept.de>
parents:
9784
diff
changeset
|
5598 |
self updateAndSelect:renamed renamedFiles. |
df3c1b8165fa
variable renamed in: #renameFile:
Stefan Vogel <sv@exept.de>
parents:
9784
diff
changeset
|
5599 |
]. |
7560 | 5600 |
|
5601 |
"Modified: / 04-12-2006 / 13:15:24 / cg" |
|
3892 | 5602 |
! ! |
5603 |
||
4080 | 5604 |
!AbstractFileBrowser methodsFor:'menu accessing'! |
3892 | 5605 |
|
9111
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
5606 |
bookmarksMenu |
3952 | 5607 |
<resource: #programMenu> |
5608 |
||
14941 | 5609 |
^ self bookmarksMenuForBaseSpec:self class baseBookmarksMenuSpec. |
5610 |
! |
|
5611 |
||
5612 |
bookmarksMenuForBaseSpec:aBaseMenuSpec |
|
5613 |
<resource: #programMenu> |
|
5614 |
||
4672
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
5615 |
|menu bookmarks| |
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
5616 |
|
14941 | 5617 |
menu := aBaseMenuSpec decodeAsLiteralArray. |
7763 | 5618 |
|
5619 |
"/ add the bookmark items ... |
|
5620 |
bookmarks := self class directoryBookmarks. |
|
5621 |
bookmarks notEmptyOrNil ifTrue:[ |
|
14604 | 5622 |
menu addSeparator. |
7763 | 5623 |
bookmarks do:[:dirName | |
12963 | 5624 |
menu addItem:(MenuItem |
5625 |
label:dirName asString |
|
5626 |
itemValue:[ |
|
5627 |
(self currentSelectedDirectories includes:dirName) ifFalse:[ |
|
5628 |
self setCurrentFileName:dirName. |
|
5629 |
]. |
|
5630 |
]). |
|
7763 | 5631 |
]. |
5632 |
]. |
|
4080 | 5633 |
menu findGuiResourcesIn:self. |
7763 | 5634 |
^ menu |
5635 |
||
11135 | 5636 |
"Modified: / 14-01-2012 / 21:14:03 / cg" |
7763 | 5637 |
! |
5638 |
||
5639 |
canBackward |
|
5640 |
^ self directoryHistory canBackward. |
|
5641 |
||
5642 |
"Modified: / 27-03-2007 / 10:54:55 / cg" |
|
5643 |
! |
|
5644 |
||
5645 |
canForward |
|
5646 |
^ self directoryHistory canForward. |
|
5647 |
||
5648 |
"Modified: / 27-03-2007 / 10:54:57 / cg" |
|
5649 |
! |
|
5650 |
||
9111
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
5651 |
gotoBookmarksMenu |
7763 | 5652 |
<resource: #programMenu> |
5653 |
||
14941 | 5654 |
^ self bookmarksMenuForBaseSpec:self class baseBookmarksMenuSpec2. |
6099 | 5655 |
! |
5656 |
||
3892 | 5657 |
menuDirHistory:backOrForward |
7763 | 5658 |
"initialize the history menu" |
5659 |
||
3892 | 5660 |
<resource: #programMenu > |
5661 |
||
7763 | 5662 |
|hist menu pathList currentSel currentPath| |
5663 |
||
5664 |
hist := self directoryHistory. |
|
5665 |
hist isEmpty ifTrue:[^ nil]. |
|
5666 |
||
3892 | 5667 |
backOrForward == #back ifTrue:[ |
6725 | 5668 |
currentSel := self currentSelectedDirectories. |
4347 | 5669 |
currentSel size == 1 ifTrue:[ |
5670 |
currentPath := currentSel first asString. |
|
5671 |
] ifFalse:[ |
|
5672 |
currentPath := nil. |
|
5673 |
]. |
|
7763 | 5674 |
pathList := hist getBackCollection. |
3892 | 5675 |
] ifFalse:[ |
7763 | 5676 |
pathList := hist getForwardCollection. |
3892 | 5677 |
]. |
4022 | 5678 |
pathList isEmpty ifTrue:[ ^ nil]. |
7763 | 5679 |
|
6370 | 5680 |
pathList size > 30 ifTrue:[ |
5681 |
pathList := pathList copyTo:30 |
|
5682 |
]. |
|
7763 | 5683 |
|
5684 |
menu := Menu new. |
|
5685 |
||
3964 | 5686 |
pathList do:[:aPath| |
14593 | 5687 |
menu addItem:(MenuItem |
5688 |
label:aPath |
|
5689 |
itemValue:[ self setCurrentFileName:(aPath asFilename) ] |
|
5690 |
translateLabel:false). |
|
3952 | 5691 |
]. |
7763 | 5692 |
menu findGuiResourcesIn:self. |
3892 | 5693 |
^ menu |
7763 | 5694 |
|
11783 | 5695 |
"Modified: / 09-09-2012 / 13:07:22 / cg" |
3892 | 5696 |
! |
5697 |
||
5698 |
menuDirHistoryBack |
|
5699 |
"initialize the directory menu |
|
5700 |
" |
|
5701 |
<resource: #programMenu > |
|
5702 |
||
5703 |
^ self menuDirHistory:#back. |
|
5704 |
! |
|
5705 |
||
5706 |
menuDirHistoryForward |
|
5707 |
"initialize the directory menu |
|
5708 |
" |
|
5709 |
<resource: #programMenu > |
|
5710 |
||
5711 |
^ self menuDirHistory:#forward. |
|
3906 | 5712 |
! |
5713 |
||
5714 |
menuFileHistory |
|
5715 |
"initialize the file history menu |
|
5716 |
" |
|
5717 |
<resource: #programMenu > |
|
5718 |
||
7763 | 5719 |
|menu hist text removeItem| |
3906 | 5720 |
|
5721 |
hist := self fileHistory. |
|
5722 |
hist isEmpty ifTrue:[^ nil]. |
|
4391
05ad03de6f3c
no icon in clearHistory menuItem
Claus Gittinger <cg@exept.de>
parents:
4368
diff
changeset
|
5723 |
|
7763 | 5724 |
menu := Menu new. |
5725 |
||
5726 |
hist copy do:[:aFileItem| |
|
4391
05ad03de6f3c
no icon in clearHistory menuItem
Claus Gittinger <cg@exept.de>
parents:
4368
diff
changeset
|
5727 |
aFileItem fileName exists ifTrue:[ |
12963 | 5728 |
menu addItem:(MenuItem |
5729 |
label: aFileItem fileName asString |
|
14593 | 5730 |
itemValue: |
5731 |
[ |
|
5732 |
self setCurrentFileName:(aFileItem fileName). |
|
5733 |
self openApplByFileItem:aFileItem |
|
5734 |
] |
|
5735 |
translateLabel:false). |
|
4391
05ad03de6f3c
no icon in clearHistory menuItem
Claus Gittinger <cg@exept.de>
parents:
4368
diff
changeset
|
5736 |
] ifFalse:[ |
7763 | 5737 |
"/ remove all not existing history entries |
5738 |
hist remove:aFileItem. |
|
4391
05ad03de6f3c
no icon in clearHistory menuItem
Claus Gittinger <cg@exept.de>
parents:
4368
diff
changeset
|
5739 |
] |
3906 | 5740 |
]. |
7763 | 5741 |
menu addSeparator. |
5742 |
||
4080 | 5743 |
removeItem := MenuItem new. |
5744 |
removeItem translateLabel:true. |
|
4391
05ad03de6f3c
no icon in clearHistory menuItem
Claus Gittinger <cg@exept.de>
parents:
4368
diff
changeset
|
5745 |
text := resources string:'Clear History'. |
05ad03de6f3c
no icon in clearHistory menuItem
Claus Gittinger <cg@exept.de>
parents:
4368
diff
changeset
|
5746 |
"/ text := LabelAndIcon icon:(self class clearHistoryIcon) string:text. |
4080 | 5747 |
removeItem label:text. |
11783 | 5748 |
removeItem |
5749 |
itemValue:[ |
|
5750 |
self fileHistory removeAll. |
|
5751 |
self enableFileHistory value:false. |
|
5752 |
]. |
|
3906 | 5753 |
menu addItem:removeItem. |
7763 | 5754 |
menu findGuiResourcesIn:self. |
3906 | 5755 |
^ menu |
7763 | 5756 |
|
11783 | 5757 |
"Modified (format): / 09-09-2012 / 13:07:36 / cg" |
3952 | 5758 |
! |
5759 |
||
4080 | 5760 |
sortMenu |
5761 |
<resource: #programMenu > |
|
5762 |
||
5763 |
|menu| |
|
5764 |
||
7763 | 5765 |
menu := Menu decodeFromLiteralArray:self class sortMenu. |
4080 | 5766 |
menu findGuiResourcesIn:self. |
5767 |
^ menu |
|
7763 | 5768 |
|
5769 |
"Modified: / 27-03-2007 / 10:47:42 / cg" |
|
4080 | 5770 |
! |
5771 |
||
5772 |
viewDetailsMenuSpec |
|
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
5773 |
|specContentsBrowser itemsContentsBrowser specHere itemsHere spec| |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
5774 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
5775 |
specHere := self class viewDetailsMenuSpec. |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
5776 |
itemsHere := specHere at:2. |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
5777 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
5778 |
specContentsBrowser := self directoryContentsBrowser class viewBrowserMenuSpec. |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
5779 |
itemsContentsBrowser := (specContentsBrowser at:2). |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
5780 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
5781 |
spec := specHere copy. |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
5782 |
spec at:2 put:(itemsContentsBrowser , itemsHere). |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
5783 |
^ spec |
4080 | 5784 |
! |
5785 |
||
5786 |
viewInContentsBrowserMenu |
|
5009 | 5787 |
self |
5788 |
applicationNamed:#DirectoryContentsBrowser |
|
5789 |
ifPresentDo:[:appl | ^ appl viewBrowserMenu]. |
|
5790 |
||
5791 |
^ nil. |
|
4080 | 5792 |
! |
5793 |
||
3952 | 5794 |
visitedDirectoriesMenu |
5795 |
<resource: #programMenu > |
|
5796 |
||
5797 |
|menu histCopy text removeItem| |
|
5798 |
||
7763 | 5799 |
histCopy := self directoryHistory. |
5800 |
histCopy isEmpty ifTrue:[^ nil]. |
|
5801 |
||
3952 | 5802 |
menu := Menu new. |
7763 | 5803 |
|
5804 |
histCopy do:[:aFile| |
|
12963 | 5805 |
menu addItem:(MenuItem |
5806 |
label:aFile asString |
|
5807 |
itemValue:[ |
|
5808 |
self setCurrentFileName:(aFile path asFilename). |
|
5809 |
]). |
|
7763 | 5810 |
]. |
5811 |
menu addSeparator. |
|
5812 |
||
4672
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
5813 |
"/ 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
|
5814 |
text := (resources string:'Clear History'). |
3952 | 5815 |
removeItem := MenuItem new. |
4040 | 5816 |
removeItem translateLabel:true. |
3952 | 5817 |
removeItem label:text. |
11783 | 5818 |
removeItem |
5819 |
itemValue:[ |
|
5820 |
self directoryHistory removeAll. |
|
5821 |
self enableForward value:self canForward. |
|
5822 |
self enableBack value:self canBackward. |
|
5823 |
]. |
|
7763 | 5824 |
|
3952 | 5825 |
menu addItem:removeItem. |
7763 | 5826 |
menu findGuiResourcesIn:self. |
3952 | 5827 |
^ menu |
7763 | 5828 |
|
11783 | 5829 |
"Modified: / 09-09-2012 / 13:07:45 / cg" |
3892 | 5830 |
! ! |
5831 |
||
5880 | 5832 |
!AbstractFileBrowser methodsFor:'menu actions'! |
5833 |
||
5834 |
doCompareTwoFiles |
|
5835 |
self openDiffView. |
|
5836 |
! |
|
5837 |
||
5838 |
doGoDirectoryUp |
|
5960 | 5839 |
| upDir directory rootInTreeView| |
5880 | 5840 |
|
5841 |
self enableDirectoryUp value ifFalse:[ ^ self]. |
|
5842 |
self currentFilesAreInSameDirectory ifTrue:[ |
|
5960 | 5843 |
directory := self currentDirectory. |
5844 |
directory isNil ifTrue:[ ^ self]. |
|
5880 | 5845 |
] ifFalse:[ |
5846 |
rootInTreeView := self |
|
5847 |
applicationNamed:#DirectoryTreeBrowser |
|
5848 |
ifPresentDo:[:appl | appl rootHolder]. |
|
5960 | 5849 |
directory := rootInTreeView value asFilename. |
5850 |
]. |
|
5851 |
upDir := directory directory. |
|
5959 | 5852 |
self setCurrentFileName:upDir. |
5880 | 5853 |
! |
5854 |
||
5855 |
doGotoDefaultDirectory |
|
5856 |
self gotoFile:(Filename defaultDirectory). |
|
5857 |
! |
|
5858 |
||
8091 | 5859 |
doGotoDesktopDirectory |
5860 |
self gotoFile:(Filename desktopDirectory). |
|
5861 |
! |
|
5862 |
||
18036 | 5863 |
doGotoDocumentsDirectory |
5864 |
self gotoFile:(Filename documentsDirectory). |
|
5865 |
! |
|
5866 |
||
5867 |
doGotoDownloadsDirectory |
|
5868 |
self gotoFile:(Filename downloadsDirectory). |
|
5869 |
! |
|
5870 |
||
5880 | 5871 |
doGotoHomeDirectory |
8091 | 5872 |
self gotoFile:(Filename homeDirectory). |
5880 | 5873 |
! |
5874 |
||
6434 | 5875 |
doGotoSmalltalkDirectory |
5876 |
self gotoFile:(self smalltalkDirectory). |
|
5877 |
! |
|
5878 |
||
17187 | 5879 |
doGotoSmalltalkWorkspaceDirectory |
5880 |
self gotoFile:(UserPreferences current workspaceDirectory). |
|
5881 |
! |
|
5882 |
||
9677 | 5883 |
doGotoTempDirectory |
5884 |
self gotoFile:(self tempDirectory). |
|
5885 |
||
5886 |
"Created: / 29-12-2010 / 11:03:17 / cg" |
|
5887 |
! |
|
5888 |
||
9596 | 5889 |
doMakeCurrentDirectory |
17582 | 5890 |
<resource: #obsolete> |
5891 |
||
5892 |
"/ no longer |
|
5893 |
^ self |
|
5894 |
"/ OperatingSystem setCurrentDirectory:(self currentDirectory pathName). |
|
5895 |
"/ self currentFileNameHolderChangedForCommon. |
|
9596 | 5896 |
|
5897 |
"Created: / 26-10-2010 / 17:21:19 / cg" |
|
17582 | 5898 |
"Modified (format): / 17-07-2017 / 10:09:39 / cg" |
9596 | 5899 |
! |
5900 |
||
5880 | 5901 |
fileGetInfo:longInfo |
5902 |
"get info on selected file - show it in a box" |
|
5903 |
||
5904 |
|string box updater| |
|
5905 |
||
5906 |
string := self getFileInfoStringForFirstSelectedFile:longInfo. |
|
5907 |
string notNil ifTrue:[ |
|
5908 |
box := InfoBox title:string. |
|
5909 |
updater := [ |
|
5910 |
[true] whileTrue:[ |
|
5911 |
Delay waitForSeconds:2. |
|
5912 |
string := self getFileInfoStringForFirstSelectedFile:longInfo. |
|
5913 |
string isNil ifTrue:[ ^ self]. |
|
5914 |
box title:string |
|
5915 |
] |
|
5916 |
] fork. |
|
5917 |
box show. |
|
5918 |
updater terminate. |
|
5919 |
box destroy |
|
5920 |
] |
|
6434 | 5921 |
! |
5922 |
||
17686 | 5923 |
showDeltaBetweenTwoImageFiles |
5924 |
|i1 i2 delta| |
|
5925 |
||
5926 |
i1 := Image fromFile:(self selectedFileNames first). |
|
5927 |
i2 := Image fromFile:(self selectedFileNames second). |
|
5928 |
delta := ImageAlgorithms new differenceImageBetween:i1 and:i2. |
|
5929 |
ImageView openOn:delta. |
|
5930 |
||
5931 |
"Created: / 10-09-2017 / 16:59:08 / cg" |
|
5932 |
! |
|
5933 |
||
6434 | 5934 |
smalltalkDirectory |
8590 | 5935 |
|stxPath| |
6434 | 5936 |
|
5937 |
stxPath := OperatingSystem pathOfSTXExecutable. |
|
8590 | 5938 |
stxPath isNil ifTrue:[ |
5939 |
^ Filename currentDirectory |
|
5940 |
]. |
|
5941 |
^ stxPath asFilename directory. |
|
9677 | 5942 |
! |
5943 |
||
5944 |
tempDirectory |
|
5945 |
^ Filename tempDirectory. |
|
5946 |
||
5947 |
"Created: / 29-12-2010 / 11:03:00 / cg" |
|
5880 | 5948 |
! ! |
5949 |
||
11139 | 5950 |
!AbstractFileBrowser methodsFor:'menu actions-file'! |
5951 |
||
14262 | 5952 |
addDirToJavaSourcePath |
5953 |
"add the current path to java's sourcePath |
|
5954 |
(only available with ST/J System" |
|
5955 |
||
5956 |
Java addToSourcePath:self currentDirectory pathName |
|
5957 |
||
5958 |
"Modified: 14.12.1996 / 15:37:47 / cg" |
|
5959 |
"Created: 2.8.1997 / 14:11:19 / cg" |
|
5960 |
! |
|
5961 |
||
11139 | 5962 |
copyFiles |
5963 |
self |
|
5964 |
withSelectedFilesOrDirectoriesDo:[:filesOrDirs | self copyFilesToClipBoard:filesOrDirs] |
|
5965 |
! |
|
5966 |
||
5967 |
cutFiles |
|
5968 |
self |
|
5969 |
withSelectedFilesOrDirectoriesDo:[:filesOrDirs | self cutFilesToClipBoard:filesOrDirs] |
|
5970 |
! |
|
5971 |
||
5972 |
deleteFiles |
|
5973 |
self |
|
5974 |
withSelectedFilesOrDirectoriesDo:[:filesOrDirs | self deleteFiles:filesOrDirs] |
|
5975 |
! |
|
5976 |
||
5977 |
eraseFiles |
|
5978 |
self |
|
5979 |
withSelectedFilesOrDirectoriesDo:[:filesOrDirs | self eraseFiles:filesOrDirs] |
|
5980 |
! |
|
5981 |
||
14262 | 5982 |
fileAddToJavaSourcePath |
5983 |
"add the current path to java's sourcePath |
|
5984 |
(only available with ST/J System" |
|
5985 |
||
17865 | 5986 |
Java notNil ifTrue:[ |
5987 |
self currentSelectedObjects do:[:each | |
|
5988 |
Java addToSourcePath:(each pathName) |
|
5989 |
]. |
|
14262 | 5990 |
]. |
5991 |
||
5992 |
"Created: / 9.11.1998 / 05:41:34 / cg" |
|
5993 |
"Modified: / 9.11.1998 / 05:56:00 / cg" |
|
5994 |
! |
|
5995 |
||
11139 | 5996 |
openSettingsDialog |
5997 |
|dialog| |
|
5998 |
||
5999 |
dialog := FileBrowserV2SettingsDialog new. |
|
6000 |
dialog settingsDialog:self. |
|
6001 |
dialog allButOpen. |
|
6002 |
dialog doReload. |
|
6003 |
dialog openWindow |
|
6004 |
! |
|
6005 |
||
6006 |
withSelectedFilesOrDirectoriesDo:aBlock |
|
6007 |
|files dirs| |
|
6008 |
||
6009 |
files := self currentSelectedFiles. |
|
6010 |
files notEmpty ifTrue:[ |
|
6011 |
aBlock value:files. |
|
6012 |
] ifFalse:[ |
|
6013 |
dirs := self currentSelectedDirectories. |
|
6014 |
dirs notEmpty ifTrue:[ |
|
6015 |
aBlock value:dirs. |
|
6016 |
]. |
|
6017 |
]. |
|
6018 |
! ! |
|
6019 |
||
6020 |
!AbstractFileBrowser methodsFor:'menu actions-help'! |
|
6021 |
||
6022 |
openAboutThisApplication |
|
6023 |
"opens an about box for this application." |
|
6024 |
||
6025 |
Dialog aboutClass:self class. |
|
6026 |
! |
|
6027 |
||
6028 |
openHTMLDocument:relativeDocPath |
|
6029 |
HTMLDocumentView openFullOnDocumentationFile:relativeDocPath |
|
6030 |
! ! |
|
6031 |
||
6032 |
!AbstractFileBrowser methodsFor:'menu actions-scm-cvs'! |
|
3892 | 6033 |
|
15905 | 6034 |
canCvsAddAndCommit |
6035 |
||
6036 |
|selectedFiles| |
|
6037 |
||
6038 |
selectedFiles := self currentSelectedObjects. |
|
6039 |
^ (selectedFiles notEmpty and:[self currentFilesAreInSameDirectory]). |
|
6040 |
! |
|
6041 |
||
6042 |
canRemoveCVSContainer |
|
6043 |
^ self currentSelectedFiles |
|
6044 |
contains:[:fileName| |
|
6045 |
|dirOfFile cvsDir| |
|
6046 |
||
6047 |
dirOfFile := self getDirWithoutFileName:fileName. |
|
6048 |
cvsDir := dirOfFile construct:'CVS'. |
|
6049 |
cvsDir isDirectory |
|
6050 |
]. |
|
6051 |
! |
|
6052 |
||
12777 | 6053 |
commitFilesToCVS:files |
6054 |
|numFiles| |
|
6055 |
||
6056 |
(numFiles := files size) > 0 ifTrue:[ |
|
6057 |
self withActivityIndicationDo:[ |
|
6058 |
self cvsCommitFiles:files |
|
6059 |
] |
|
6060 |
] |
|
6061 |
! |
|
6062 |
||
3892 | 6063 |
cvsAddAndCommit |
4849 | 6064 |
self cvsAddAndCommitAsBinary:false |
6065 |
! |
|
6066 |
||
6067 |
cvsAddAndCommitAsBinary:asBinary |
|
8588 | 6068 |
|sel log logArg binArg cmd dir executionBlock nameString| |
3892 | 6069 |
|
6070 |
log := Dialog |
|
11139 | 6071 |
requestText:(resources string:'Enter initial log message:') |
4414 | 6072 |
lines:10 |
6073 |
columns:70 |
|
6074 |
initialAnswer:nil. |
|
8322
cf10f08b6164
care for cancel in #cvsAddAndCommitAsBinary:
Claus Gittinger <cg@exept.de>
parents:
8294
diff
changeset
|
6075 |
log isNil ifTrue:[^ self]. |
3892 | 6076 |
|
6205
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
6077 |
OperatingSystem isMSWINDOWSlike ifTrue:[ |
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
6078 |
logArg := '-m "' , log , '"'. |
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
6079 |
] ifFalse:[ |
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
6080 |
logArg := '-m ''' , log , ''''. |
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
6081 |
]. |
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
6082 |
|
8588 | 6083 |
binArg := ''. |
6084 |
asBinary ifTrue:[ |
|
6085 |
binArg := '-kb '. |
|
6086 |
]. |
|
3982 | 6087 |
sel := self currentSelectedFiles. |
11139 | 6088 |
executionBlock := |
6089 |
[:stream | |
|
6090 |
log notNil ifTrue:[ |
|
17416 | 6091 |
sel notEmptyOrNil ifTrue:[ |
11139 | 6092 |
sel do:[:fn | |
6093 |
|nameArg| |
|
6094 |
||
6095 |
nameArg := '"',fn baseName,'"'. |
|
6096 |
||
6097 |
dir := self getDirWithoutFileName:fn. |
|
6098 |
cmd := 'cvs add ',logArg,' ',binArg,nameArg. |
|
6099 |
(self getExecutionBlockForCommand:cmd inDirectory:dir) value:stream. |
|
6100 |
||
6101 |
cmd := ('cvs commit -l ',logArg,' ',nameArg). |
|
6205
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
6102 |
(self getExecutionBlockForCommand:cmd inDirectory:dir) value:stream. |
11139 | 6103 |
"/ mhmh - it seems that only old CVS implementations (at least turqoise) |
6104 |
"/ support and need the 'admin -kb' command. |
|
6105 |
"/ newer ones use the '-kb' option in the 'cvs add' command |
|
6106 |
asBinary ifTrue:[ |
|
6107 |
cmd := ('cvs admin -kb ' , nameArg). |
|
6108 |
(self getExecutionBlockForCommand:cmd inDirectory:dir) value:stream. |
|
6109 |
||
6110 |
cmd := ('cvs upd ' , nameArg). |
|
6111 |
(self getExecutionBlockForCommand:cmd inDirectory:dir) value:stream. |
|
6112 |
]. |
|
6113 |
] |
|
6114 |
] |
|
6115 |
] |
|
6116 |
]. |
|
4107 | 6117 |
nameString := 'Command> cvs add and commit'. |
3892 | 6118 |
self makeExecutionResultProcessFor:executionBlock withName:nameString. |
11139 | 6119 |
|
17416 | 6120 |
"Modified: / 17-02-2017 / 08:25:16 / cg" |
3892 | 6121 |
! |
6122 |
||
4849 | 6123 |
cvsAddBinaryAndCommit |
6124 |
self cvsAddAndCommitAsBinary:true |
|
6125 |
! |
|
6126 |
||
3892 | 6127 |
cvsCommit |
12777 | 6128 |
|selectedFiles| |
3892 | 6129 |
|
3982 | 6130 |
selectedFiles:= self currentSelectedFiles. |
12777 | 6131 |
self cvsCommitFiles:selectedFiles |
6132 |
! |
|
6133 |
||
6134 |
cvsCommitFiles:files |
|
6135 |
|nFiles log logTmp s logArg msg executionBlock nameString | |
|
6136 |
||
6137 |
nFiles := files size. |
|
6138 |
nFiles == 0 ifTrue:[^ self]. |
|
6139 |
||
6140 |
nFiles == 1 ifTrue:[ |
|
6141 |
msg := resources string:'Enter log message for checkIn of "%1"' with:(files first baseName) |
|
3892 | 6142 |
] ifFalse:[ |
12777 | 6143 |
nFiles > 1 ifTrue:[ |
6144 |
msg := resources string:'Enter log message for %1 files to checkIn' with:nFiles printString |
|
4414 | 6145 |
] ifFalse:[ |
6627 | 6146 |
msg := resources string:'Enter log message for checkIn' |
4414 | 6147 |
] |
3892 | 6148 |
]. |
6149 |
||
6150 |
log := Dialog |
|
4414 | 6151 |
requestText:msg |
6152 |
lines:10 |
|
6153 |
columns:70 |
|
6154 |
initialAnswer:nil. |
|
3892 | 6155 |
|
4663 | 6156 |
log isNil ifTrue:[^ self]. |
12777 | 6157 |
log := log replChar:$" withString:'\"'. |
6205
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
6158 |
|
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
6159 |
OperatingSystem isMSWINDOWSlike ifTrue:[ |
12777 | 6160 |
"/ save the log message into another tempFile ... |
13121 | 6161 |
s := FileStream newTemporary. |
6162 |
logTmp := s fileName. |
|
12777 | 6163 |
s nextPutAll:log. |
6164 |
s close. |
|
6165 |
||
6166 |
logArg := '-F "', logTmp pathName, '"'. |
|
6205
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
6167 |
] ifFalse:[ |
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
6168 |
logArg := '-m ''' , log , ''''. |
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
6169 |
]. |
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
6170 |
|
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
6171 |
executionBlock := [:stream | |
12777 | 6172 |
[ |
6173 |
files do:[:fn | |
|
6174 |
| dir nameArg cmd | |
|
6175 |
||
6176 |
nameArg := '"',fn baseName,'"'. |
|
6177 |
dir := fn directory. |
|
6178 |
cmd := 'cvs commit ',logArg,' ' , nameArg. |
|
6179 |
stream showCR:fn pathName. |
|
6180 |
(self getExecutionBlockForCommand:cmd inDirectory:dir) value:stream. |
|
4663 | 6181 |
] |
12777 | 6182 |
] ensure:[ |
6183 |
logTmp notNil ifTrue:[ logTmp remove ]. |
|
6184 |
]. |
|
4107 | 6185 |
]. |
6186 |
nameString := 'Command> cvs commit'. |
|
6187 |
self makeExecutionResultProcessFor:executionBlock withName:nameString. |
|
3892 | 6188 |
! |
6189 |
||
14527 | 6190 |
cvsCommitFolder |
6191 |
|dir log logTmp s logArg msg executionBlock nameString | |
|
6192 |
||
6193 |
(dir := self currentDirectory) isNil ifTrue:[ ^ self ]. |
|
6194 |
||
6195 |
msg := resources string:'Enter log message for checkIn of "%1"' with:(dir baseName). |
|
6196 |
log := Dialog |
|
6197 |
requestText:msg |
|
6198 |
lines:10 |
|
6199 |
columns:70 |
|
6200 |
initialAnswer:nil. |
|
6201 |
||
6202 |
log isNil ifTrue:[^ self]. |
|
6203 |
log := log replChar:$" withString:'\"'. |
|
6204 |
||
6205 |
OperatingSystem isMSWINDOWSlike ifTrue:[ |
|
6206 |
"/ save the log message into another tempFile ... |
|
6207 |
s := FileStream newTemporary. |
|
6208 |
logTmp := s fileName. |
|
6209 |
s nextPutAll:log. |
|
6210 |
s close. |
|
6211 |
||
6212 |
logArg := '-F "', logTmp pathName, '"'. |
|
6213 |
] ifFalse:[ |
|
6214 |
logArg := '-m ''' , log , ''''. |
|
6215 |
]. |
|
6216 |
||
6217 |
executionBlock := [:stream | |
|
6218 |
[ |
|
6219 |
|cmd| |
|
6220 |
||
6221 |
cmd := 'cvs commit ',logArg. |
|
6222 |
(self getExecutionBlockForCommand:cmd inDirectory:dir) value:stream. |
|
6223 |
] ensure:[ |
|
6224 |
logTmp notNil ifTrue:[ logTmp remove ]. |
|
6225 |
]. |
|
6226 |
]. |
|
6227 |
||
6228 |
nameString := 'Command> cvs commit'. |
|
6229 |
self makeExecutionResultProcessFor:executionBlock withName:nameString. |
|
6230 |
! |
|
6231 |
||
9407
cf114ba82b6d
added: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
9405
diff
changeset
|
6232 |
cvsCompareWithNewest |
cf114ba82b6d
added: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
9405
diff
changeset
|
6233 |
|selectedFiles| |
cf114ba82b6d
added: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
9405
diff
changeset
|
6234 |
|
cf114ba82b6d
added: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
9405
diff
changeset
|
6235 |
selectedFiles:= self currentSelectedFiles. |
cf114ba82b6d
added: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
9405
diff
changeset
|
6236 |
selectedFiles do:[:each | |
11176
eb02b211e777
changed: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
11162
diff
changeset
|
6237 |
|out diffs| |
eb02b211e777
changed: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
11162
diff
changeset
|
6238 |
|
15589 | 6239 |
out := CharacterWriteStream new:100. |
11176
eb02b211e777
changed: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
11162
diff
changeset
|
6240 |
OperatingSystem |
eb02b211e777
changed: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
11162
diff
changeset
|
6241 |
executeCommand:'cvs diff -b ',each baseName |
eb02b211e777
changed: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
11162
diff
changeset
|
6242 |
outputTo:out |
eb02b211e777
changed: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
11162
diff
changeset
|
6243 |
inDirectory:each directoryName. |
eb02b211e777
changed: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
11162
diff
changeset
|
6244 |
diffs := out contents. |
eb02b211e777
changed: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
11162
diff
changeset
|
6245 |
TextView openWith:diffs. |
eb02b211e777
changed: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
11162
diff
changeset
|
6246 |
]. |
eb02b211e777
changed: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
11162
diff
changeset
|
6247 |
|
eb02b211e777
changed: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
11162
diff
changeset
|
6248 |
"Modified: / 23-01-2012 / 14:08:28 / cg" |
9407
cf114ba82b6d
added: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
9405
diff
changeset
|
6249 |
! |
cf114ba82b6d
added: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
9405
diff
changeset
|
6250 |
|
15211 | 6251 |
cvsRemoveAndRemoveFromCVS:filesToRemove |
6252 |
"remove the selected file(s) and their CVS containers - no questions asked" |
|
6253 |
||
6254 |
|toRemove updateRunning executionBlock nameString| |
|
6255 |
||
6256 |
updateRunning := self backgroundProcesses value notEmpty. |
|
6257 |
self killAllRunningBackgroundProcesses. |
|
6258 |
toRemove := OrderedCollection new. |
|
6259 |
||
6260 |
executionBlock := |
|
6261 |
[:stream | |
|
6262 |
|cmd logArg prevDir prevFiles| |
|
6263 |
||
6264 |
OperatingSystem isMSWINDOWSlike ifTrue:[ |
|
6265 |
logArg := '-m "' , 'removed via FileBrowser' , '"'. |
|
6266 |
] ifFalse:[ |
|
6267 |
logArg := '-m ''' , 'removed via FileBrowser' , ''''. |
|
6268 |
]. |
|
6269 |
prevFiles := ''. |
|
6270 |
||
6271 |
filesToRemove do:[:fileName | |
|
6272 |
|dir file| |
|
6273 |
||
6274 |
dir := fileName directory. |
|
6275 |
(prevDir notNil and:[prevDir ~= dir]) ifTrue:[ |
|
6276 |
cmd := 'cvs commit -l ',logArg, ' ',prevFiles. |
|
6277 |
"/ Transcript show:prevDir; space; showCR:cmd. |
|
6278 |
(self getExecutionBlockForCommand:cmd inDirectory:prevDir) value:stream. |
|
6279 |
prevFiles := ''. |
|
6280 |
]. |
|
6281 |
||
17116 | 6282 |
OsError handle:[:ex| |
15211 | 6283 |
"was not able to remove it" |
6284 |
| lastError msg | |
|
6285 |
lastError := OperatingSystem lastErrorString. |
|
6286 |
msg := (resources string:'cannot remove ''%1'' !!' with:fileName). |
|
6287 |
lastError isNil ifFalse:[ |
|
6288 |
msg := msg , '\\(' , lastError , ')' |
|
6289 |
]. |
|
6290 |
Dialog warn:msg withCRs |
|
6291 |
] do:[ |
|
6292 |
(fileName isSymbolicLink) ifFalse:[ |
|
6293 |
fileName remove. |
|
6294 |
file := fileName baseName. |
|
6295 |
cmd := ('cvs remove -f "',file,'"'). |
|
6296 |
(self getExecutionBlockForCommand:cmd inDirectory:dir) value:stream. |
|
6297 |
"/ Transcript show:dir; space; showCR:cmd. |
|
6298 |
] |
|
6299 |
]. |
|
6300 |
prevDir := dir. |
|
6301 |
prevFiles := prevFiles,' ',file. |
|
6302 |
]. |
|
6303 |
cmd := 'cvs commit -l ',logArg, ' ',prevFiles. |
|
6304 |
"/ Transcript show:prevDir; space; showCR:cmd. |
|
6305 |
(self getExecutionBlockForCommand:cmd inDirectory:prevDir) value:stream. |
|
6306 |
]. |
|
6307 |
nameString := 'Command> cvs remove and commit ', filesToRemove first baseName. |
|
6308 |
filesToRemove size > 1 ifTrue:[ |
|
6309 |
nameString := nameString, ' ...'. |
|
6310 |
]. |
|
6311 |
self makeExecutionResultProcessFor:executionBlock withName:nameString. |
|
6312 |
! |
|
3892 | 6313 |
|
6314 |
cvsRemoveFileAndCVSContainer |
|
12493 | 6315 |
|files| |
6316 |
||
6317 |
files := self currentSelectedFiles copy. |
|
6318 |
self removeFilesAndCVSContainers:files |
|
3892 | 6319 |
! |
6320 |
||
9338 | 6321 |
cvsRevisionLog |
6322 |
| cmd sel executionBlock nameString| |
|
6323 |
||
6324 |
sel := self currentSelectedObjects. |
|
6325 |
sel isEmpty ifTrue:[ ^ self ]. |
|
6326 |
||
6327 |
executionBlock := [:stream | |
|
6328 |
sel do:[:fn | |
|
6329 |
| dir nameArg | |
|
6330 |
||
6331 |
nameArg := '"',fn baseName,'"'. |
|
6332 |
dir := fn directory. |
|
6333 |
cmd := 'cvs log ' , nameArg. |
|
6334 |
(self getExecutionBlockForCommand:cmd inDirectory:dir) value:stream. |
|
6335 |
] |
|
6336 |
]. |
|
6337 |
nameString := 'Command> cvs log'. |
|
6338 |
self makeExecutionResultProcessFor:executionBlock withName:nameString. |
|
6339 |
! |
|
6340 |
||
8562 | 6341 |
cvsTagSelection |
12856 | 6342 |
|tag tags cmd| |
6343 |
||
6344 |
tag := Dialog |
|
6345 |
request:(resources string:'Tag (possibly multiple, separated by ";"):') |
|
6346 |
initialAnswer:(CVSSourceCodeManager recentTag). |
|
6347 |
tag isEmptyOrNil ifTrue:[^ self ]. |
|
6348 |
||
6349 |
CVSSourceCodeManager recentTag:tag. |
|
8562 | 6350 |
|
6351 |
CVSSourceCodeManager notNil ifTrue:[ |
|
6352 |
cmd := CVSSourceCodeManager cvsExecutable. |
|
6353 |
] ifFalse:[ |
|
6354 |
cmd := 'cvs'. |
|
6355 |
]. |
|
6356 |
||
12856 | 6357 |
tags := tag asCollectionOfSubstringsSeparatedByAny:',;'. |
6358 |
tags do:[:eachTag | |
|
6359 |
self executeCommand:('%1 tag -F "%2" %3' |
|
6360 |
bindWith:cmd |
|
12858 | 6361 |
with:(eachTag withoutSeparators) |
12856 | 6362 |
with:(self makeFileNameArgumentString)) |
6363 |
]. |
|
8562 | 6364 |
! |
6365 |
||
3892 | 6366 |
cvsUpdateAll |
6367 |
| cmd | |
|
6368 |
||
8042
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
6369 |
CVSSourceCodeManager notNil ifTrue:[ |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
6370 |
cmd := CVSSourceCodeManager cvsExecutable. |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
6371 |
] ifFalse:[ |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
6372 |
cmd := 'cvs'. |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
6373 |
]. |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
6374 |
|
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
6375 |
self executeCommand:(cmd, ' upd -l'). |
3892 | 6376 |
! |
6377 |
||
6378 |
cvsUpdateAllRecursive |
|
6379 |
| cmd | |
|
6380 |
||
8042
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
6381 |
CVSSourceCodeManager notNil ifTrue:[ |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
6382 |
cmd := CVSSourceCodeManager cvsExecutable. |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
6383 |
] ifFalse:[ |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
6384 |
cmd := 'cvs'. |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
6385 |
]. |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
6386 |
self executeCommand:(cmd, ' upd -d'). |
3892 | 6387 |
! |
6388 |
||
6389 |
cvsUpdateSelection |
|
8042
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
6390 |
|stream cmd| |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
6391 |
|
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 |
|
15589 | 6398 |
stream := CharacterWriteStream new. |
8563 | 6399 |
stream |
6400 |
nextPutAll:cmd; |
|
6401 |
nextPutAll:' upd '; |
|
6402 |
nextPutAll:(self makeFileNameArgumentString). |
|
6403 |
||
6404 |
self executeCommand:stream contents. |
|
6405 |
! |
|
6406 |
||
6407 |
makeFileNameArgumentString |
|
6408 |
|stream| |
|
6409 |
||
15589 | 6410 |
stream := CharacterWriteStream new. |
8042
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
6411 |
self currentSelectedFiles do:[: file | |
8563 | 6412 |
stream nextPut:$". |
4414 | 6413 |
stream nextPutAll:file baseName. |
8563 | 6414 |
stream nextPutAll:'" '. |
6415 |
]. |
|
6416 |
^ stream contents. |
|
12493 | 6417 |
! |
6418 |
||
6419 |
removeFilesAndCVSContainers:files |
|
6420 |
|numFiles question aswer| |
|
6421 |
||
6422 |
(numFiles := files size) > 0 ifTrue:[ |
|
6423 |
numFiles > 1 ifTrue:[ |
|
6424 |
question := resources string:'Remove %1 selected files and their CVS containers ?' with:numFiles |
|
6425 |
] ifFalse:[ |
|
6426 |
question := resources string:'Remove ''%1'' and its CVS container ?' with:(files first baseName allBold) |
|
6427 |
]. |
|
6428 |
||
6429 |
aswer := Dialog |
|
6430 |
confirm:question withCRs |
|
6431 |
yesLabel:(resources string:'Remove') |
|
6432 |
noLabel:(resources string:'Cancel'). |
|
6433 |
||
6434 |
aswer ifTrue:[ |
|
6435 |
self withActivityIndicationDo:[ |
|
6436 |
self cvsRemoveAndRemoveFromCVS:files |
|
6437 |
] |
|
6438 |
] |
|
6439 |
] |
|
3892 | 6440 |
! ! |
6441 |
||
14126 | 6442 |
|
11139 | 6443 |
!AbstractFileBrowser methodsFor:'menu actions-scm-mercurial'! |
6444 |
||
6445 |
mercurialAdd |
|
6446 |
|executionBlock sel maxCmdSize| |
|
6447 |
||
6448 |
maxCmdSize := 512. |
|
6449 |
||
6450 |
sel := self currentSelectedObjects. |
|
6451 |
sel isEmptyOrNil ifTrue:[ |
|
6452 |
^ self |
|
6453 |
]. |
|
6454 |
||
6455 |
executionBlock := |
|
6456 |
[:stream | |
|
6457 |
|prevDir cmd| |
|
6458 |
||
6459 |
prevDir := nil. |
|
6460 |
sel do:[:fn | |
|
6461 |
|nameArg dir| |
|
6462 |
||
6463 |
nameArg := '"',fn baseName,'"'. |
|
6464 |
dir := fn directory. |
|
6465 |
(dir ~= prevDir or:[ (cmd size + nameArg size) > maxCmdSize]) ifTrue:[ |
|
6466 |
"/ flush |
|
6467 |
cmd notNil ifTrue:[ |
|
6468 |
(self getExecutionBlockForCommand:cmd inDirectory:prevDir) value:stream. |
|
6469 |
cmd := nil. |
|
6470 |
] |
|
6471 |
]. |
|
6472 |
cmd isNil ifTrue:[ |
|
6473 |
cmd := 'hg add'. |
|
6474 |
]. |
|
6475 |
cmd := cmd,' ',nameArg. |
|
6476 |
prevDir := dir. |
|
6477 |
]. |
|
6478 |
cmd notNil ifTrue:[ |
|
6479 |
(self getExecutionBlockForCommand:cmd inDirectory:prevDir) value:stream. |
|
6480 |
cmd := nil. |
|
6481 |
]. |
|
6482 |
stream nextPutLine:'Commit to finish the transaction'. |
|
6483 |
]. |
|
6484 |
||
6485 |
self makeExecutionResultProcessFor:executionBlock withName:'Command> hg add'. |
|
6486 |
||
6487 |
"Created: / 15-01-2012 / 15:55:47 / cg" |
|
6488 |
! |
|
6489 |
||
6490 |
mercurialCommit |
|
6491 |
|dir executionBlock| |
|
6492 |
||
6493 |
"/ dir := self currentDirectory. |
|
6494 |
dir := self directoryContentsBrowser directory. |
|
6495 |
executionBlock := |
|
6496 |
[:stream | |
|
6497 |
(self getExecutionBlockForCommand:'hg commit' |
|
6498 |
inDirectory:dir) value:stream. |
|
6499 |
stream nextPutLine:'Push to sync other repositories'. |
|
6169 | 6500 |
]. |
11139 | 6501 |
|
6502 |
self makeExecutionResultProcessFor:executionBlock withName:'Command> hg commit'. |
|
6503 |
||
6504 |
"Created: / 15-01-2012 / 16:21:27 / cg" |
|
6505 |
! |
|
6506 |
||
11144 | 6507 |
mercurialInit |
6508 |
|dir executionBlock| |
|
6509 |
||
6510 |
dir := self directoryContentsBrowser directory. |
|
6511 |
||
6512 |
(Dialog confirm:(resources |
|
6513 |
string:'Initialize new Mercurial Repository in %1?' |
|
6514 |
with:dir baseName)) ifFalse:[^ self]. |
|
6515 |
||
6516 |
executionBlock := |
|
6517 |
[:stream | |
|
6518 |
(self getExecutionBlockForCommand:('hg init') |
|
6519 |
inDirectory:dir) value:stream. |
|
6520 |
]. |
|
6521 |
||
6522 |
self makeExecutionResultProcessFor:executionBlock withName:'Command> hg init'. |
|
6523 |
||
6524 |
"Created: / 17-01-2012 / 15:58:46 / cg" |
|
6525 |
! |
|
6526 |
||
11139 | 6527 |
mercurialPush |
6528 |
|destination dir executionBlock| |
|
6529 |
||
6530 |
destination := Dialog request:'Mercurial Repository' |
|
6531 |
initialAnswer:(LastMercurialRepository ? MercurialSourceCodeManager repositoryName). |
|
6532 |
destination isEmptyOrNil ifTrue:[^ self]. |
|
6533 |
||
6534 |
LastMercurialRepository := destination. |
|
6535 |
||
6536 |
dir := self directoryContentsBrowser directory. |
|
6537 |
executionBlock := |
|
6538 |
[:stream | |
|
6539 |
(self getExecutionBlockForCommand:('hg push "%1"' bindWith:destination) |
|
6540 |
inDirectory:dir) value:stream. |
|
6541 |
]. |
|
6542 |
||
6543 |
self makeExecutionResultProcessFor:executionBlock withName:'Command> hg push'. |
|
6544 |
||
6545 |
"Created: / 15-01-2012 / 16:29:41 / cg" |
|
6546 |
! |
|
6547 |
||
6548 |
mercurialStatus |
|
6549 |
|executionBlock sel maxCmdSize| |
|
6550 |
||
6551 |
maxCmdSize := 512. |
|
6552 |
||
6553 |
sel := self currentSelectedObjects. |
|
6554 |
sel isEmptyOrNil ifTrue:[ |
|
6555 |
^ self |
|
6556 |
]. |
|
6557 |
||
6558 |
executionBlock := |
|
6559 |
[:stream | |
|
6560 |
|prevDir cmd| |
|
6561 |
||
6562 |
prevDir := nil. |
|
6563 |
sel do:[:fn | |
|
6564 |
|nameArg dir| |
|
6565 |
||
6566 |
nameArg := '"',fn baseName,'"'. |
|
6567 |
dir := fn directory. |
|
6568 |
(dir ~= prevDir or:[ (cmd size + nameArg size) > maxCmdSize]) ifTrue:[ |
|
6569 |
"/ flush |
|
6570 |
cmd notNil ifTrue:[ |
|
6571 |
(self getExecutionBlockForCommand:cmd inDirectory:prevDir) value:stream. |
|
6572 |
cmd := nil. |
|
6573 |
] |
|
6574 |
]. |
|
6575 |
cmd isNil ifTrue:[ |
|
6576 |
cmd := 'hg status'. |
|
6577 |
]. |
|
6578 |
cmd := cmd,' ',nameArg. |
|
6579 |
prevDir := dir. |
|
6580 |
]. |
|
6581 |
cmd notNil ifTrue:[ |
|
6582 |
(self getExecutionBlockForCommand:cmd inDirectory:prevDir) value:stream. |
|
6583 |
cmd := nil. |
|
6584 |
]. |
|
6585 |
]. |
|
6586 |
||
6587 |
self makeExecutionResultProcessFor:executionBlock withName:'Command> hg status'. |
|
6588 |
||
6589 |
"Created: / 15-01-2012 / 19:43:08 / cg" |
|
3892 | 6590 |
! ! |
6591 |
||
4849 | 6592 |
!AbstractFileBrowser methodsFor:'menu actions-tools'! |
3892 | 6593 |
|
8510 | 6594 |
allFilesInSelectedDirectoriesForWhich:aBlock |
17868 | 6595 |
^ self class allFilesInDirectories:(self currentSelectedDirectories) forWhich:aBlock |
8510 | 6596 |
! |
6597 |
||
4721
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6598 |
conversionChainFrom:inSuffix to:outSuffix |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6599 |
|conv| |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6600 |
|
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6601 |
inSuffix = outSuffix ifTrue:[ |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6602 |
^ nil |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6603 |
]. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6604 |
|
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6605 |
"/ 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
|
6606 |
"/ 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
|
6607 |
|
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6608 |
conv := OrderedCollection new. |
4722 | 6609 |
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
|
6610 |
|
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6611 |
outSuffix = 'png' ifTrue:[ |
4722 | 6612 |
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
|
6613 |
^ conv. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6614 |
]. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6615 |
outSuffix = 'gif' ifTrue:[ |
4722 | 6616 |
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
|
6617 |
^ conv. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6618 |
]. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6619 |
outSuffix = 'xpm' ifTrue:[ |
4722 | 6620 |
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
|
6621 |
^ conv. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6622 |
]. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6623 |
outSuffix = 'jpg' ifTrue:[ |
4722 | 6624 |
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
|
6625 |
^ conv. |
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 |
self error:'unimplemented conversion'. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6628 |
! |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6629 |
|
9493
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6630 |
convertImageFrom:fileName to:outFile onError:exceptionBlock |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6631 |
|writer image outSuffix| |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6632 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6633 |
outSuffix := outFile suffix. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6634 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6635 |
((writer := MIMETypes imageReaderForSuffix:outSuffix) notNil |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6636 |
and:[ (image := Image fromFile:fileName) notNil |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6637 |
and:[ writer canRepresent:image ]]) ifTrue:[ |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6638 |
"/ can do it with Smalltalk tools |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6639 |
writer save:image onFile:outFile. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6640 |
] ifFalse:[ |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6641 |
"/ use external tools (pbm-package, if available) |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6642 |
self |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6643 |
convertImageUsingExternalFileToolsFrom:fileName |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6644 |
toSuffix:outSuffix |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6645 |
onError:exceptionBlock. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6646 |
]. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6647 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6648 |
"Created: / 20-05-2010 / 11:12:36 / cg" |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6649 |
! |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6650 |
|
4367 | 6651 |
convertImageToGIF |
4721
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6652 |
self convertImageToSuffix:'gif' |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6653 |
! |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6654 |
|
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6655 |
convertImageToJPG |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6656 |
self convertImageToSuffix:'jpg' |
4531 | 6657 |
! |
6658 |
||
6659 |
convertImageToPNG |
|
4721
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6660 |
self convertImageToSuffix:'png' |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6661 |
! |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6662 |
|
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6663 |
convertImageToSuffix:outSuffix |
9493
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6664 |
|outFile filesToConvert| |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6665 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6666 |
self withActivityIndicationDo:[ |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6667 |
filesToConvert := self currentSelectedObjects copy. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6668 |
filesToConvert do:[:fileName | |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6669 |
self notify:(resources string:'Converting: %1...' with:fileName baseName). |
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 |
fileName isDirectory ifFalse:[ |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6672 |
|skip| |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6673 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6674 |
skip := false. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6675 |
outFile := fileName withSuffix:outSuffix. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6676 |
outFile exists ifTrue:[ |
4722 | 6677 |
|answer| |
6678 |
||
9493
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6679 |
answer := Dialog |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6680 |
confirmWithCancel:(resources string:'Overwrite existing %1 ?' with:outFile baseName allBold) |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6681 |
default:false. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6682 |
answer isNil ifTrue:[AbortSignal raise]. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6683 |
answer ifFalse:[ skip := true ]. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6684 |
]. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6685 |
skip ifFalse:[ |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6686 |
self |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6687 |
convertImageFrom:fileName |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6688 |
to:outFile |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6689 |
onError:[:errMsg | |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6690 |
filesToConvert size == 1 ifTrue:[ |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6691 |
Dialog warn:errMsg |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6692 |
] ifFalse:[ |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6693 |
(Dialog confirm:errMsg yesLabel:(resources string:'OK') noLabel:(resources string:'Cancel')) ifFalse:[ |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6694 |
^ self |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6695 |
] |
4721
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6696 |
]. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6697 |
]. |
9493
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6698 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6699 |
self updateAndSelect:nil. |
4367 | 6700 |
] |
9493
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6701 |
] |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6702 |
]. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6703 |
self notify:nil. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6704 |
] |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6705 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6706 |
"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
|
6707 |
! |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6708 |
|
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6709 |
convertImageToXPM |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6710 |
self convertImageToSuffix:'xpm' |
4367 | 6711 |
! |
6712 |
||
9493
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6713 |
convertImageUsingExternalFileToolsFrom:fileName toSuffix:outSuffix onError:exceptionBlock |
13121 | 6714 |
|inFile outFile chainOfConversions conversionStream |
9493
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6715 |
eachConversionSuffixCommandPair eachConversionCommand eachConversionSuffix| |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6716 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6717 |
chainOfConversions := self conversionChainFrom:(fileName suffix) to:outSuffix. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6718 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6719 |
chainOfConversions isNil ifTrue:[ |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6720 |
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
|
6721 |
^ false |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6722 |
]. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6723 |
conversionStream := chainOfConversions readStream. |
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 |
inFile := fileName. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6726 |
eachConversionSuffixCommandPair := conversionStream next. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6727 |
eachConversionCommand := eachConversionSuffixCommandPair key. |
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 |
eachConversionCommand == #readToXPM ifTrue:[ |
13121 | 6730 |
|image tempStreamXPM| |
9493
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6731 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6732 |
image := Image fromFile:(inFile pathName). |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6733 |
image isNil ifTrue:[ |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6734 |
self warn:'Unknown format/not an image: ' , inFile baseName. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6735 |
^ false. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6736 |
]. |
13121 | 6737 |
tempStreamXPM := FileStream newTemporaryWithSuffix:'xpm'. |
6738 |
XPMReader save:image onStream:tempStreamXPM. |
|
6739 |
tempStreamXPM close. |
|
6740 |
inFile := tempStreamXPM fileName. |
|
9493
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6741 |
eachConversionSuffixCommandPair := conversionStream next. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6742 |
]. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6743 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6744 |
[ |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6745 |
|command errOutput errMsg| |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6746 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6747 |
[eachConversionSuffixCommandPair notNil] whileTrue:[ |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6748 |
eachConversionCommand := eachConversionSuffixCommandPair key. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6749 |
eachConversionSuffix := eachConversionSuffixCommandPair value. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6750 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6751 |
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
|
6752 |
|
13121 | 6753 |
outFile := (FileStream newTemporaryWithSuffix:eachConversionSuffix) close pathName. |
9493
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6754 |
command := eachConversionCommand |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6755 |
bindWith:(inFile pathName) |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6756 |
with:(outFile pathName). |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6757 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6758 |
errOutput := String writeStream. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6759 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6760 |
(OperatingSystem executeCommand:command errorTo:errOutput) ifFalse:[ |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6761 |
errMsg := resources |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6762 |
stringWithCRs:'Conversion of %1 to %2 using %3 failed:\\%4.' |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6763 |
with:inFile baseName allBold |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6764 |
with:eachConversionSuffix |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6765 |
with:eachConversionCommand allBold |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6766 |
with:errOutput contents. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6767 |
exceptionBlock value:errMsg. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6768 |
|
18024 | 6769 |
(inFile ~= fileName) ifTrue:[inFile remove]. |
6770 |
outFile remove. |
|
9493
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6771 |
^ false |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6772 |
]. |
18024 | 6773 |
(inFile ~= fileName) ifTrue:[inFile remove]. |
9493
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6774 |
inFile := outFile. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6775 |
eachConversionSuffixCommandPair := conversionStream next |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6776 |
]. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6777 |
outFile moveTo:(fileName withSuffix:(chainOfConversions last value)). |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6778 |
] ifCurtailed:[ |
18024 | 6779 |
(inFile ~= fileName) ifTrue:[inFile remove]. |
6780 |
outFile remove. |
|
9493
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6781 |
]. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6782 |
^ true. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6783 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6784 |
"Created: / 20-05-2010 / 11:05:50 / cg" |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6785 |
! |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6786 |
|
3892 | 6787 |
createProjectAndOpenProjectBrowser |
6788 |
|nm f s directory| |
|
6789 |
||
6790 |
self currentFilesAreInSameDirectory ifFalse:[^ self]. |
|
5960 | 6791 |
directory := self currentDirectory. |
3892 | 6792 |
nm := directory baseName. |
6793 |
f := (directory construct:nm) withSuffix:'prj'. |
|
6794 |
f exists ifTrue:[ |
|
4414 | 6795 |
Dialog warn:'A file named ' , f baseName , ' already exists.'. |
6796 |
^ self. |
|
3892 | 6797 |
]. |
6798 |
s := f writeStream. |
|
6799 |
s nextPutAll:' |
|
6800 |
name ''' , nm , ''' |
|
6801 |
type #classLibrary |
|
6802 |
package #''private:' , nm , ''' |
|
6803 |
prerequisites nil |
|
6804 |
||
6805 |
classes #( ) |
|
6806 |
'. |
|
6807 |
s close. |
|
6808 |
ProjectBrowser openOnFile:f. |
|
6809 |
! |
|
6810 |
||
5880 | 6811 |
doExecuteCommand |
6812 |
"execute an OperatingSystem-command" |
|
6813 |
||
6814 |
| action fileName| |
|
6815 |
||
6816 |
fileName := self firstSelectedFile. |
|
6817 |
action := [:command | |
|
6818 |
self addToCommandHistory:command for:fileName. |
|
6819 |
self executeCommand:command. |
|
6820 |
]. |
|
6821 |
self askForCommandFor:fileName thenDo:action |
|
6822 |
! |
|
6823 |
||
6824 |
doExecuteScript |
|
16941 | 6825 |
"execute a Smalltalk script" |
5880 | 6826 |
|
6827 |
|textHolder dialog template dummyClass dummyInstance| |
|
6828 |
||
6829 |
template := |
|
6830 |
'"/ Smalltalk script: |
|
6831 |
||
16084 | 6832 |
"/ the following variables are accessible: |
5880 | 6833 |
"/ directory (= ' , (self theSingleSelectedDirectoryOrNil ? Filename homeDirectory) pathName , ') |
6834 |
"/ selectedFiles (= ...) |
|
6835 |
"/ |
|
6836 |
"/ Beginner warning: Smalltalk know-how is useful here ;-). |
|
6837 |
"/ |
|
6838 |
"/ Useful operations are: |
|
6839 |
"/ directory directoryContentsDo:[:eachBaseNameString | ...] |
|
6840 |
"/ directory directoryContentsAsFilenamesDo:[:eachFilename | ...] |
|
6841 |
"/ directory directory |
|
6842 |
"/ |
|
6843 |
"/ example: move all files which match a aarticular pattern to |
|
6844 |
"/ a separate directory: |
|
6845 |
"/ |
|
6846 |
"/ |directory idx prefix rest newDir oldFile newFile| |
|
6847 |
"/ |
|
6848 |
"/ directory := ''/mnt/var/priv/image/tv/frank/frank2/2131_008.jpg'' asFilename. |
|
6849 |
"/ |
|
6850 |
"/ directory directoryContentsDo:[:eachBaseNameString | |
|
6851 |
"/ (eachBaseNameString includes:$_) ifTrue:[ |
|
6852 |
"/ idx := eachBaseNameString indexOf:$_. |
|
6853 |
"/ prefix := eachBaseNameString copyTo:(idx - 1). |
|
6854 |
"/ rest := eachBaseNameString copyFrom:(idx + 1). |
|
6855 |
"/ newDir := directory construct:prefix. |
|
6856 |
"/ newDir exists ifFalse:[ |
|
6857 |
"/ (Dialog confirm:''Create '' , newDir pathName) ifTrue:[ |
|
6858 |
"/ newDir makeDirectory. |
|
6859 |
"/ ]. |
|
6860 |
"/ ]. |
|
6861 |
"/ newDir exists ifTrue:[ |
|
6862 |
"/ oldFile := directory construct:eachBaseNameString. |
|
6863 |
"/ newFile := newDir construct:rest. |
|
6864 |
"/ oldFile moveTo:newFile |
|
6865 |
"/ ] |
|
6866 |
"/ ] |
|
6867 |
"/ ] |
|
6868 |
'. |
|
6869 |
||
6870 |
LastScriptBlockString isNil ifTrue:[ |
|
6871 |
LastScriptBlockString := template. |
|
6872 |
]. |
|
6873 |
||
6874 |
textHolder := ValueHolder new. |
|
6875 |
dialog := Dialog |
|
6876 |
forRequestText:(resources string:'Enter script') |
|
6877 |
editViewClass:CodeView |
|
6878 |
lines:25 |
|
6879 |
columns:70 |
|
6880 |
initialAnswer:LastScriptBlockString |
|
6881 |
model:textHolder. |
|
6882 |
dialog addButton:(Button label:'Template' action:[textHolder value:template. textHolder changed:#value.]). |
|
6883 |
dialog open. |
|
6884 |
dialog accepted ifFalse:[^ self]. |
|
6885 |
||
6886 |
LastScriptBlockString := textHolder value. |
|
6887 |
||
6888 |
Class classConventionViolationConfirmationQuerySignal |
|
6889 |
answer:true |
|
6890 |
do:[ |
|
6891 |
dummyClass := Object class |
|
6892 |
name:#Dummy |
|
6893 |
inEnvironment:nil |
|
6894 |
subclassOf:Object |
|
6895 |
instanceVariableNames:'directory selectedFiles' |
|
6896 |
variable:false |
|
6897 |
words:true |
|
6898 |
pointers:true |
|
6899 |
classVariableNames:'' |
|
6900 |
poolDictionaries:'' |
|
6901 |
category:#dummyCategory |
|
6902 |
comment:nil |
|
6903 |
changed:true. |
|
6904 |
]. |
|
6905 |
||
6906 |
dummyInstance := dummyClass basicNew. |
|
6907 |
dummyInstance instVarAt:1 put:(self theSingleSelectedDirectoryOrNil ? Filename homeDirectory). |
|
6908 |
dummyInstance instVarAt:2 put:(self currentSelectedFiles value). |
|
6909 |
||
6910 |
Compiler |
|
6911 |
evaluate:textHolder value |
|
6912 |
in:nil |
|
6913 |
receiver:dummyInstance |
|
6914 |
notifying:nil |
|
6915 |
logged:false |
|
6916 |
ifFail:[] |
|
6917 |
compile:true. |
|
6918 |
||
6919 |
"/ fileName := self firstSelectedFile. |
|
6920 |
"/ action := [:command | |
|
6921 |
"/ self addToCommandHistory:command for:fileName. |
|
6922 |
"/ self executeCommand:command. |
|
6923 |
"/ ]. |
|
6924 |
"/ self askForCommandFor:fileName thenDo:action |
|
6925 |
! |
|
6926 |
||
4230 | 6927 |
doMake |
7938 | 6928 |
|dir cmd| |
4230 | 6929 |
|
13856 | 6930 |
cmd := self makeCommandHolder value. |
6931 |
||
6932 |
"Make" |
|
6933 |
cmd = 'make' ifTrue:[ |
|
6934 |
dir := self theSingleSelectedDirectoryOrNil. |
|
6935 |
OperatingSystem isMSWINDOWSlike ifTrue:[ |
|
6936 |
dir notNil ifTrue:[ |
|
6937 |
(dir construct:'bmake.bat') exists ifTrue:[ |
|
6938 |
cmd := 'bmake.bat'. |
|
6939 |
] |
|
7938 | 6940 |
] |
13856 | 6941 |
]. |
6942 |
self executeCommand:cmd. |
|
6943 |
^self. |
|
6944 |
]. |
|
6945 |
||
6946 |
"Apache ant" |
|
6947 |
cmd = 'ant' ifTrue:[ |
|
6948 |
self executeCommand:cmd. |
|
6949 |
^self. |
|
6950 |
]. |
|
6951 |
||
6952 |
"Add more here..." |
|
6953 |
||
6954 |
"Modified (comment): / 13-04-2012 / 17:07:02 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
4230 | 6955 |
! |
6956 |
||
8256 | 6957 |
doOpenCBrowser |
11712
ed8877d9356b
comment/format in: #doOpenCBrowser
Claus Gittinger <cg@exept.de>
parents:
11688
diff
changeset
|
6958 |
"the CBrowser is an eXept-internal C-language IDE tool. |
ed8877d9356b
comment/format in: #doOpenCBrowser
Claus Gittinger <cg@exept.de>
parents:
11688
diff
changeset
|
6959 |
(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
|
6960 |
20 years ago ;-)" |
ed8877d9356b
comment/format in: #doOpenCBrowser
Claus Gittinger <cg@exept.de>
parents:
11688
diff
changeset
|
6961 |
|
8256 | 6962 |
|destDir| |
6963 |
||
10747
aa57b76e8318
added: #cBrowserMenuItemVisible
Claus Gittinger <cg@exept.de>
parents:
10678
diff
changeset
|
6964 |
(CBrowser isNil or:[ CBrowser::Browser isNil ]) ifTrue:[ |
aa57b76e8318
added: #cBrowserMenuItemVisible
Claus Gittinger <cg@exept.de>
parents:
10678
diff
changeset
|
6965 |
Smalltalk loadPackage:'exept:CC' |
aa57b76e8318
added: #cBrowserMenuItemVisible
Claus Gittinger <cg@exept.de>
parents:
10678
diff
changeset
|
6966 |
]. |
8256 | 6967 |
destDir := self currentDirectory. |
6968 |
CBrowser::Browser openIn:destDir pathName |
|
10747
aa57b76e8318
added: #cBrowserMenuItemVisible
Claus Gittinger <cg@exept.de>
parents:
10678
diff
changeset
|
6969 |
|
aa57b76e8318
added: #cBrowserMenuItemVisible
Claus Gittinger <cg@exept.de>
parents:
10678
diff
changeset
|
6970 |
"Modified: / 04-10-2011 / 13:41:31 / cg" |
11712
ed8877d9356b
comment/format in: #doOpenCBrowser
Claus Gittinger <cg@exept.de>
parents:
11688
diff
changeset
|
6971 |
"Modified (comment): / 27-07-2012 / 20:41:40 / cg" |
8256 | 6972 |
! |
6973 |
||
7829 | 6974 |
doOpenExplorer |
11642
72cd5c5e2615
changed: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
11591
diff
changeset
|
6975 |
self currentDirectory asFilename openExplorer |
72cd5c5e2615
changed: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
11591
diff
changeset
|
6976 |
|
72cd5c5e2615
changed: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
11591
diff
changeset
|
6977 |
"Modified: / 21-07-2012 / 12:28:36 / cg" |
7829 | 6978 |
! |
6979 |
||
12473 | 6980 |
doOpenFinder |
6981 |
self currentDirectory asFilename openFinder |
|
6982 |
||
6983 |
"Modified: / 21-07-2012 / 12:28:36 / cg" |
|
6984 |
! |
|
6985 |
||
12811 | 6986 |
doOpenMonticelloBrowser |
12874
f08360e7ac62
oops - startup did not enable directoryUp
Claus Gittinger <cg@exept.de>
parents:
12871
diff
changeset
|
6987 |
MCMczReader isNil ifTrue:[ Smalltalk loadPackage:'stx:goodies/monticello']. |
f08360e7ac62
oops - startup did not enable directoryUp
Claus Gittinger <cg@exept.de>
parents:
12871
diff
changeset
|
6988 |
|
12811 | 6989 |
self withWaitCursorDo:[ |
6990 |
self currentSelectedFiles do:[:fn | |
|
6991 |
|version snapshot| |
|
6992 |
||
6993 |
fn suffix asLowercase = 'mcz' ifTrue:[ |
|
6994 |
version := MCMczReader versionFromFile:fn. |
|
6995 |
snapshot := version snapshot. |
|
6996 |
(Tools::ChangeSetBrowser2 |
|
6997 |
on: snapshot asChangeSet |
|
6998 |
label: version info name) |
|
6999 |
beTwoColumn; |
|
7000 |
targetNamespace:nil; |
|
7001 |
targetPackage:nil; |
|
7002 |
open |
|
7003 |
] |
|
7004 |
] |
|
7005 |
] |
|
7006 |
! |
|
7007 |
||
4317
bf3f150809c2
settings is a new application now and will be inserted under tools in
penk
parents:
4294
diff
changeset
|
7008 |
doOpenSettings |
8168 | 7009 |
self openSettingsDialog |
4317
bf3f150809c2
settings is a new application now and will be inserted under tools in
penk
parents:
4294
diff
changeset
|
7010 |
! |
bf3f150809c2
settings is a new application now and will be inserted under tools in
penk
parents:
4294
diff
changeset
|
7011 |
|
9343
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
7012 |
doOpenWithShellCommand |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
7013 |
"open using win32-shell" |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
7014 |
|
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
7015 |
|fileName| |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
7016 |
|
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
7017 |
fileName := self firstSelectedFile. |
9405
5b598565288a
changed: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9393
diff
changeset
|
7018 |
fileName notNil ifTrue:[ |
11642
72cd5c5e2615
changed: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
11591
diff
changeset
|
7019 |
OperatingSystem |
9405
5b598565288a
changed: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9393
diff
changeset
|
7020 |
openApplicationForDocument:fileName pathName |
5b598565288a
changed: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9393
diff
changeset
|
7021 |
operation:#open |
5b598565288a
changed: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9393
diff
changeset
|
7022 |
] |
11642
72cd5c5e2615
changed: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
11591
diff
changeset
|
7023 |
|
72cd5c5e2615
changed: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
11591
diff
changeset
|
7024 |
"Modified: / 21-07-2012 / 12:26:10 / cg" |
9343
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
7025 |
! |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
7026 |
|
7104 | 7027 |
editMode:aSymbol |
7028 |
self |
|
7029 |
applicationNamed:#FileApplicationNoteBook |
|
7030 |
ifPresentDo:[:appl | |
|
7031 |
|subApp| |
|
7032 |
||
7033 |
subApp := appl selectedApplication. |
|
7034 |
subApp notNil ifTrue:[ |
|
7035 |
^ subApp perform:aSymbol |
|
7036 |
] |
|
7037 |
]. |
|
7038 |
||
7039 |
"Created: / 11-09-2006 / 12:42:08 / cg" |
|
7040 |
! |
|
7041 |
||
7042 |
editModeInsert |
|
7043 |
self editMode:#editModeInsert |
|
7044 |
||
7045 |
"Created: / 11-09-2006 / 12:40:36 / cg" |
|
7046 |
! |
|
7047 |
||
7048 |
editModeInsertAndSelect |
|
7049 |
self editMode:#editModeInsertAndSelect |
|
7050 |
||
7051 |
"Created: / 11-09-2006 / 12:40:45 / cg" |
|
7052 |
! |
|
7053 |
||
7054 |
editModeOverwrite |
|
7055 |
self editMode:#editModeOverwrite |
|
7056 |
||
7057 |
"Modified: / 11-09-2006 / 12:42:26 / cg" |
|
7058 |
! |
|
7059 |
||
15528 | 7060 |
fetchFileByURL |
7061 |
|url destinationFilename| |
|
7062 |
||
17818 | 7063 |
url := Dialog request:(resources string:'URL to Fetch:') initialAnswer:'http://host/path'. |
15528 | 7064 |
url isEmptyOrNil ifTrue:[^ self]. |
7065 |
url := url asURL. |
|
7066 |
||
17818 | 7067 |
destinationFilename := Dialog request:(resources string:'Download As:') initialAnswer:(UnixFilename named:url path) baseName. |
15528 | 7068 |
destinationFilename isEmptyOrNil ifTrue:[^ self]. |
7069 |
||
7070 |
destinationFilename := self currentDirectory asFilename / destinationFilename. |
|
7071 |
destinationFilename exists ifTrue:[ |
|
7072 |
|answer| |
|
7073 |
||
7074 |
answer := Dialog |
|
7075 |
confirm:(resources string:'Overwrite existing %1 ?' with:destinationFilename baseName allBold) |
|
7076 |
default:false. |
|
7077 |
answer ~~ true ifTrue:[^ self]. |
|
7078 |
]. |
|
7079 |
self withActivityIndicationDo:[ |
|
7080 |
self notify:(resources string:'Fetching %1' with:url). |
|
7081 |
HTTPInterface get:url destinationFile:destinationFilename. |
|
7082 |
self notify:nil. |
|
7083 |
] |
|
7084 |
||
17818 | 7085 |
"Modified: / 29-11-2017 / 12:26:13 / cg" |
15528 | 7086 |
! |
7087 |
||
8454
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
7088 |
fileContentsAsByteArray |
17769 | 7089 |
|file fileSize| |
8454
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
7090 |
|
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
7091 |
file := self firstSelectedFile. |
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
7092 |
file isNil ifTrue:[^ self ]. |
17769 | 7093 |
|
7094 |
file := file asFilename. |
|
7095 |
||
7096 |
(fileSize := file fileSize) > (1024*1024) ifTrue:[ |
|
7097 |
fileSize > (128*1024*1024) ifTrue:[ |
|
11889 | 7098 |
Dialog warn:(resources string:'File is too big'). |
8454
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
7099 |
^ self. |
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
7100 |
]. |
17769 | 7101 |
(Dialog confirm:(resources |
7102 |
string:'File is big (%1) - proceed?' |
|
7103 |
with:(UnitConverter fileSizeStringFor:fileSize)) |
|
7104 |
) ifFalse:[^ self]. |
|
7105 |
]. |
|
7106 |
file binaryContentsOfEntireFile inspect |
|
7107 |
||
7108 |
"Modified: / 19-11-2017 / 14:58:43 / cg" |
|
8454
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
7109 |
! |
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
7110 |
|
3892 | 7111 |
fileFileIn |
7112 |
"fileIn the selected file(s)" |
|
7113 |
||
7114 |
self fileFileInLazy:false |
|
7115 |
! |
|
7116 |
||
7324 | 7117 |
fileFileIn:aFilename lazy:lazy |
7118 |
"fileIn a file" |
|
7119 |
||
7120 |
self withActivityIndicationDo:[ |
|
7121 |
self notify:('File in:', aFilename asFilename baseName). |
|
7122 |
self singleFileFileIn:aFilename lazy:lazy. |
|
7123 |
self notify:nil. |
|
7124 |
] |
|
7125 |
||
7126 |
"Created: / 20-09-2006 / 14:28:35 / cg" |
|
7127 |
! |
|
7128 |
||
3892 | 7129 |
fileFileInLazy |
7130 |
"fileIn the selected file(s). Do a quick load (no compilation)" |
|
7131 |
||
7132 |
self fileFileInLazy:true |
|
7133 |
! |
|
7134 |
||
7135 |
fileFileInLazy:lazy |
|
7136 |
"fileIn the selected file(s)" |
|
7137 |
||
7324 | 7138 |
self currentSelectedFiles do:[:fileName | |
7139 |
self fileIn:fileName lazy:lazy |
|
7140 |
]. |
|
7141 |
||
7142 |
"Modified: / 20-09-2006 / 14:29:24 / cg" |
|
3892 | 7143 |
! |
7144 |
||
12497 | 7145 |
fileFileInPackage |
7146 |
"assuming the current directory is a package directory, load it" |
|
7147 |
||
7148 |
|packageDir dir path top packageID| |
|
7149 |
||
7150 |
"/ find a reasonable package-id (walk up until we find stx) |
|
7151 |
path := ''. |
|
7152 |
dir := packageDir := self currentDirectory. |
|
7153 |
||
7154 |
top := (Smalltalk projectDirectoryForPackage:'stx') asFilename. |
|
7155 |
[ (dir / 'stx') = top ] whileFalse:[ |
|
7156 |
path := dir baseName , '/' , path. |
|
7157 |
dir := dir directory. |
|
7158 |
dir isNil ifTrue:[ |
|
12707
6e9276c4fc95
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
12684
diff
changeset
|
7159 |
Dialog warn:'Could not find a path from "stx" to the current directory.'. |
12497 | 7160 |
"/ should ask the user for a packageID and proceed... |
7161 |
^ self. |
|
7162 |
]. |
|
7163 |
]. |
|
12707
6e9276c4fc95
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
12684
diff
changeset
|
7164 |
packageID := path copyButLast:1. |
12497 | 7165 |
Smalltalk loadPackage:packageID fromDirectory:packageDir asAutoloaded:true |
7166 |
! |
|
7167 |
||
3892 | 7168 |
fileFileInToNameSpace |
7169 |
"fileIn the selected file(s)<into a nameSpace" |
|
7170 |
||
7171 |
|ns listOfKnownNameSpaces| |
|
7172 |
||
7173 |
listOfKnownNameSpaces := Set new. |
|
7174 |
NameSpace |
|
6672
478b83a3753a
max size to be shown without dialog
Claus Gittinger <cg@exept.de>
parents:
6671
diff
changeset
|
7175 |
allNameSpaces |
4414 | 7176 |
do:[:eachNameSpace | |
7177 |
listOfKnownNameSpaces add:eachNameSpace name |
|
7178 |
]. |
|
3892 | 7179 |
listOfKnownNameSpaces := listOfKnownNameSpaces asOrderedCollection sort. |
7180 |
||
7181 |
ns := Dialog |
|
4414 | 7182 |
request:'During fileIn, new classes are created in nameSpace:' |
7183 |
initialAnswer:(LastEnforcedNameSpace ? Class nameSpaceQuerySignal query name) |
|
7184 |
list:listOfKnownNameSpaces. |
|
3892 | 7185 |
ns isEmptyOrNil ifTrue:[^ self]. |
7186 |
||
7187 |
LastEnforcedNameSpace := ns. |
|
7188 |
ns := NameSpace name:ns. |
|
7189 |
||
7190 |
Class nameSpaceQuerySignal |
|
4414 | 7191 |
answer:ns |
7192 |
do:[ |
|
7193 |
self fileFileInLazy:false |
|
7194 |
] |
|
3892 | 7195 |
! |
7196 |
||
7197 |
fileFindAllDuplicates |
|
7198 |
"scan directory and all subdirs for duplicate files" |
|
7199 |
||
7200 |
|fileNames dir infoDir filesBySize |
|
7201 |
result info dirPrefix myName stream textBox maxLength directories| |
|
7202 |
||
7203 |
||
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
7204 |
self withActivityIndicationDo:[ |
4414 | 7205 |
result := Dictionary new. |
7206 |
myName := self class name asString. |
|
7207 |
directories := self currentSelectedDirectories. |
|
7208 |
directories isEmpty ifTrue:[^ self]. |
|
3892 | 7209 |
|
4414 | 7210 |
dir := directories first. |
3892 | 7211 |
"/ self label: myName, '- gathering file names ...'. |
4636
08b2b63e3107
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4629
diff
changeset
|
7212 |
[ |
08b2b63e3107
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4629
diff
changeset
|
7213 |
fileNames := dir recursiveDirectoryContents. |
08b2b63e3107
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4629
diff
changeset
|
7214 |
] on:FileStream openErrorSignal do:[:ex| |
6352 | 7215 |
self warn:(resources stringWithCRs:'Cannot access: %1\(%2)' |
7216 |
with:ex pathName |
|
7217 |
with:ex description). |
|
4636
08b2b63e3107
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4629
diff
changeset
|
7218 |
^ self |
08b2b63e3107
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4629
diff
changeset
|
7219 |
]. |
4765 | 7220 |
fileNames := fileNames |
7221 |
collect:[:fn | dir construct:fn] |
|
7222 |
thenSelect:[:fn | fn isDirectory not]. |
|
3892 | 7223 |
|
7224 |
"/ self label:myName , '- gathering sizes ...'. |
|
4414 | 7225 |
infoDir := Dictionary new. |
7226 |
fileNames do:[:fn | |
|
7227 |
infoDir at:fn put:(fn fileSize) |
|
7228 |
]. |
|
7229 |
||
14497 | 7230 |
"/ for each, get the file's size. |
4414 | 7231 |
"/ in a first pass, look for files of the same size and |
7232 |
"/ compare them ... |
|
3892 | 7233 |
|
7234 |
"/ self label:myName , '- preselect possible duplicates ...'. |
|
4414 | 7235 |
filesBySize := Dictionary new. |
7236 |
infoDir keysAndValuesDo:[:fn :sz | |
|
7237 |
|entry| |
|
7238 |
||
7239 |
entry := filesBySize at:sz ifAbsentPut:[Set new]. |
|
7240 |
entry add:fn. |
|
7241 |
]. |
|
7242 |
||
7243 |
"/ any of same size ? |
|
3892 | 7244 |
|
7245 |
"/ self label:myName , '- checking for duplicates ...'. |
|
4414 | 7246 |
filesBySize do:[:entry | |
7247 |
|files| |
|
7248 |
||
7249 |
entry size > 1 ifTrue:[ |
|
7250 |
files := entry asArray. |
|
7251 |
1 to:files size-1 do:[:idx1 | |
|
7252 |
idx1+1 to:files size do:[:idx2 | |
|
7253 |
|fn1 fn2| |
|
7254 |
||
7255 |
fn1 := files at:idx1. |
|
7256 |
fn2 := files at:idx2. |
|
3892 | 7257 |
|
7258 |
"/ self label:myName , '- checking ' , fn1 baseName , ' vs. ' , fn2 baseName , ' ...'. |
|
4414 | 7259 |
(result at:fn2 ifAbsent:nil) ~= fn1 ifTrue:[ |
7260 |
"/ compare the files |
|
7261 |
(fn1 sameContentsAs:fn2) ifTrue:[ |
|
3892 | 7262 |
"/ Transcript show:'Same: '; show:fn1 baseName; show:' and '; showCR:fn2 baseName. |
4414 | 7263 |
result at:fn1 put:fn2. |
7264 |
] |
|
7265 |
] |
|
7266 |
] |
|
7267 |
] |
|
7268 |
] |
|
7269 |
]. |
|
3892 | 7270 |
|
7271 |
"/ self label:myName , '- sorting ...'. |
|
4414 | 7272 |
dirPrefix := dir pathName. |
7273 |
result := result associations. |
|
7274 |
result := result collect:[:assoc | |
|
7275 |
|f1 f2| |
|
7276 |
||
7277 |
f1 := assoc key name. |
|
7278 |
f2 := assoc value name. |
|
7279 |
(f1 startsWith:dirPrefix) ifTrue:[ |
|
7280 |
f1 := f1 copyFrom:dirPrefix size + 2. |
|
7281 |
]. |
|
7282 |
(f2 startsWith:dirPrefix) ifTrue:[ |
|
7283 |
f2 := f2 copyFrom:dirPrefix size + 2. |
|
7284 |
]. |
|
7285 |
f1 < f2 ifTrue:[ |
|
7286 |
f2 -> f1 |
|
7287 |
] ifFalse:[ |
|
7288 |
f1 -> f2 |
|
7289 |
] |
|
7290 |
]. |
|
7291 |
result sort:[:f1 :f2 | f2 value < f1 value]. |
|
7292 |
||
7293 |
info := OrderedCollection new. |
|
7294 |
result do:[:assoc | |
|
7295 |
info add:(assoc key , ' same as ' , assoc value) |
|
7296 |
]. |
|
7297 |
info isEmpty ifTrue:[ |
|
11889 | 7298 |
Dialog information:(resources string:'No duplicate files found.'). |
5543 | 7299 |
^ self. |
4414 | 7300 |
]. |
3892 | 7301 |
]. |
7302 |
||
15589 | 7303 |
stream := CharacterWriteStream new. |
11688 | 7304 |
stream nextPutAllLines:info. |
5542 | 7305 |
|
3892 | 7306 |
textBox := TextBox new. |
7307 |
textBox initialText:(stream contents). |
|
5542 | 7308 |
stream close. |
11889 | 7309 |
textBox title:(resources string:'File duplicates in directory: %1' with:dir asString). |
3892 | 7310 |
textBox readOnly:true. |
7311 |
textBox noCancel. |
|
11889 | 7312 |
textBox label:(resources string:'Duplicates in %1' with:dir asString). |
3892 | 7313 |
maxLength := 10. |
7314 |
info do:[: el | |
|
4414 | 7315 |
maxLength := maxLength max:(el size). |
3892 | 7316 |
]. |
7317 |
textBox extent:((maxLength * 5)@(info size * 20)); sizeFixed:false. |
|
5542 | 7318 |
textBox maxExtent:Screen current extent. |
7319 |
textBox openModeless. |
|
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
7320 |
|
11688 | 7321 |
"Modified: / 27-07-2012 / 09:29:00 / cg" |
3892 | 7322 |
! |
7323 |
||
10304
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
7324 |
fileFindDuplicateFile |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
7325 |
"scan directory for duplicates of the selected files" |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
7326 |
|
10306 | 7327 |
|files filesBySize samePerFile stream textBox mustHaveMatches| |
10304
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
7328 |
|
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
7329 |
files := self currentSelectedFiles. |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
7330 |
files isEmpty ifTrue:[^ self]. |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
7331 |
|
10305
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
7332 |
self withWaitCursorDo:[ |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
7333 |
filesBySize := Dictionary new. |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
7334 |
files do:[:fn | |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
7335 |
|sz entry| |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
7336 |
|
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
7337 |
sz := fn asFilename fileSize. |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
7338 |
(filesBySize at:sz ifAbsentPut:[Set new]) add:fn. |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
7339 |
]. |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
7340 |
|
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
7341 |
samePerFile := Dictionary new. |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
7342 |
|
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
7343 |
self currentSelectedDirectories do:[:eachDir | |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
7344 |
eachDir recursiveDirectoryContentsAsFilenamesDo:[:eachFile | |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
7345 |
eachFile isDirectory ifFalse:[ |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
7346 |
|sz possibleMatches| |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
7347 |
|
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
7348 |
sz := eachFile fileSize. |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
7349 |
possibleMatches := filesBySize at:sz ifAbsent:nil. |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
7350 |
possibleMatches notNil ifTrue:[ |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
7351 |
possibleMatches do:[:eachFileWithSameSize | |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
7352 |
eachFileWithSameSize ~= eachFile ifTrue:[ |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
7353 |
(eachFileWithSameSize sameContentsAs:eachFile) ifTrue:[ |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
7354 |
(samePerFile at:eachFileWithSameSize ifAbsentPut:[Set new]) add:eachFile |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
7355 |
] |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
7356 |
] |
10304
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
7357 |
] |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
7358 |
] |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
7359 |
] |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
7360 |
] |
10305
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
7361 |
]. |
10304
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
7362 |
]. |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
7363 |
|
15589 | 7364 |
stream := CharacterWriteStream with:'Duplicates:'. |
10305
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
7365 |
(samePerFile keys asOrderedCollection sort:[:a :b | a asFilename baseName < b asFilename baseName]) |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
7366 |
do:[:origFile | |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
7367 |
|sameFiles| |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
7368 |
|
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
7369 |
sameFiles := samePerFile at:origFile. |
10304
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
7370 |
stream nextPutLine:origFile baseName. |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
7371 |
(sameFiles asOrderedCollection collect:[:each | each baseName]) sort do:[:eachSameName | |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
7372 |
stream nextPutAll:' '; nextPutLine:eachSameName. |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
7373 |
] |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
7374 |
]. |
10306 | 7375 |
stream nextPutLine:'Files without duplicates:'. |
7376 |
(samePerFile keys asOrderedCollection sort:[:a :b | a asFilename baseName < b asFilename baseName]) |
|
7377 |
do:[:origFile | |
|
7378 |
|sameFiles| |
|
7379 |
||
7380 |
sameFiles := samePerFile at:origFile. |
|
7381 |
sameFiles isEmpty ifTrue:[ |
|
7382 |
stream nextPutLine:origFile baseName. |
|
7383 |
]. |
|
7384 |
]. |
|
7385 |
||
7386 |
mustHaveMatches := Dialog request:'Must have for duplicates matching ?:' initialAnswer:(LastMustMatchPattern ? '[a-z][a-z][a-z]_[0-9][0-9][0-9].*'). |
|
7387 |
mustHaveMatches notEmptyOrNil ifTrue:[ |
|
7388 |
LastMustMatchPattern := mustHaveMatches. |
|
7389 |
||
7390 |
stream nextPutLine:'Files without duplicates in xxx_nnn.jpg:'. |
|
7391 |
(samePerFile keys asOrderedCollection sort:[:a :b | a asFilename baseName < b asFilename baseName]) |
|
7392 |
do:[:origFile | |
|
7393 |
|sameFiles| |
|
7394 |
||
7395 |
sameFiles := samePerFile at:origFile. |
|
7396 |
sameFiles notEmpty ifTrue:[ |
|
7397 |
(sameFiles contains:[:file | mustHaveMatches match:file baseName]) ifFalse:[ |
|
7398 |
stream nextPutLine:origFile baseName. |
|
7399 |
] |
|
7400 |
]. |
|
7401 |
]. |
|
7402 |
]. |
|
10304
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
7403 |
|
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
7404 |
textBox := TextBox new. |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
7405 |
textBox initialText:(stream contents). |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
7406 |
textBox title:'Files with same contents'. |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
7407 |
textBox readOnly:true. |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
7408 |
textBox noCancel. |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
7409 |
textBox extent:(350@400). |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
7410 |
textBox maxExtent:Screen current extent. |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
7411 |
textBox openModeless. "/ showAtPointer. |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
7412 |
|
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
7413 |
"Created: / 11-07-2011 / 12:39:44 / cg" |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
7414 |
! |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
7415 |
|
3892 | 7416 |
fileFindDuplicates |
7417 |
"scan directory for duplicate files" |
|
7418 |
||
17869 | 7419 |
|directories duplicates info |
7420 |
commonDir prefixSize stream titleStream textBox maxLength| |
|
8510 | 7421 |
|
7422 |
directories := self currentSelectedDirectories. |
|
17869 | 7423 |
duplicates := self class fileFindDuplicatesIn:directories. |
7424 |
duplicates isEmpty ifTrue:[ |
|
17868 | 7425 |
Dialog information:'No duplicate files found.'. |
7426 |
^ self. |
|
7427 |
]. |
|
7428 |
||
7429 |
info := OrderedCollection new. |
|
17869 | 7430 |
commonDir := self getBestDirectory. |
7431 |
prefixSize := commonDir asString size. |
|
7432 |
duplicates do:[:assoc | |
|
17871 | 7433 |
|dup orig| |
7434 |
||
7435 |
dup := assoc key. |
|
7436 |
orig := assoc value. |
|
17868 | 7437 |
prefixSize > 1 ifTrue:[ |
17871 | 7438 |
dup := dup pathNameRelativeFrom:commonDir. |
7439 |
orig := orig pathNameRelativeFrom:commonDir. |
|
17869 | 7440 |
"/ fn1 := ('..', (fn1 name copyFrom:(prefixSize + 1))). |
7441 |
"/ fn2 := ('..', (fn2 copyFrom:(prefixSize + 1))). |
|
17868 | 7442 |
]. |
17871 | 7443 |
(dup includes:Character space) ifTrue:[ |
7444 |
dup := '"' , dup , '"' |
|
7445 |
]. |
|
7446 |
(orig includes:Character space) ifTrue:[ |
|
7447 |
orig := '"' , orig , '"' |
|
7448 |
]. |
|
7449 |
info add:(dup , ' duplicate of ' , orig) |
|
17868 | 7450 |
]. |
7451 |
||
15589 | 7452 |
stream := CharacterWriteStream new. |
11688 | 7453 |
stream nextPutAllLines:info. |
7454 |
||
17869 | 7455 |
titleStream := CharacterWriteStream with:'File duplicates in director'. |
3892 | 7456 |
directories size == 1 ifTrue:[ |
12602 | 7457 |
titleStream nextPutAll:'y: '; nextPutAll: directories first asString. |
3892 | 7458 |
] ifFalse:[ |
4535 | 7459 |
titleStream nextPutLine:'ies: '. |
4355 | 7460 |
directories do:[:dir| |
17868 | 7461 |
prefixSize > 1 ifTrue:[ |
4355 | 7462 |
titleStream nextPutAll:'..'. |
17868 | 7463 |
titleStream nextPutLine:((dir asString) copyFrom:(prefixSize + 1)). |
4355 | 7464 |
] ifFalse:[ |
4535 | 7465 |
titleStream nextPutLine:(dir asString). |
4355 | 7466 |
]. |
7467 |
] |
|
3892 | 7468 |
]. |
5543 | 7469 |
|
3892 | 7470 |
textBox := TextBox new. |
7471 |
textBox initialText:(stream contents). |
|
7472 |
textBox title:(titleStream contents). |
|
7473 |
textBox readOnly:true. |
|
7474 |
textBox noCancel. |
|
14715 | 7475 |
stream := WriteStream on:''. |
7476 |
stream nextPutAll:'Duplicates in '. |
|
4170 | 7477 |
directories do:[ :aDirectory | |
4355 | 7478 |
stream nextPutAll:aDirectory baseName. |
7479 |
stream space. |
|
4050 | 7480 |
]. |
4170 | 7481 |
textBox label:stream contents. |
3892 | 7482 |
maxLength := 10. |
7483 |
info do:[: el | |
|
4355 | 7484 |
maxLength := maxLength max:(el size). |
3892 | 7485 |
]. |
5092 | 7486 |
textBox extent:((maxLength * 5)@((info size max:40)* 10)). |
7487 |
textBox maxExtent:Screen current extent. |
|
17869 | 7488 |
textBox addButton:(Button |
7489 |
label:(resources string:'Remove Duplicates') |
|
7490 |
action:[ |
|
7491 |
(Dialog confirm:(resources string:'Remove %1 duplicate files?' with:duplicates size)) ifTrue:[ |
|
7492 |
duplicates do:[:eachAssoc | |
|
17871 | 7493 |
eachAssoc key remove |
17869 | 7494 |
]. |
17871 | 7495 |
]. |
7496 |
textBox close. |
|
7497 |
self updateCurrentDirectoryWithReread. |
|
17869 | 7498 |
]). |
4355 | 7499 |
textBox openModeless. "/ showAtPointer. |
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
7500 |
|
11688 | 7501 |
"Modified: / 27-07-2012 / 09:29:14 / cg" |
3892 | 7502 |
! |
7503 |
||
7504 |
fileFindFile |
|
5961 | 7505 |
|filename| |
7506 |
||
7507 |
filename := self firstSelectedFileName. |
|
7508 |
filename isNil ifTrue:[ |
|
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
7509 |
filename := Filename homeDirectory. |
3892 | 7510 |
]. |
4101 | 7511 |
FindFileApplication openOnFileName:filename for:self. |
3892 | 7512 |
! |
7513 |
||
8510 | 7514 |
fileFindSimilarImages |
7515 |
"scan directory for similar image files" |
|
7516 |
||
8512 | 7517 |
|result stream textBox directories imageFiles histogramsV histogramsH |
7518 |
similarV similarH similar alreadyPrinted| |
|
8510 | 7519 |
|
8524
cac6b19eae23
changed #fileFindSimilarImages
Claus Gittinger <cg@exept.de>
parents:
8512
diff
changeset
|
7520 |
self withWaitCursorDo:[ |
8510 | 7521 |
self withActivityIndicationDo:[ |
7522 |
result := Dictionary new. |
|
7523 |
||
7524 |
directories := self currentSelectedDirectories. |
|
7525 |
directories isEmpty ifTrue:[^ self]. |
|
7526 |
||
13714 | 7527 |
imageFiles := self allFilesInSelectedDirectoriesForWhich:[:f | f mimeTypeFromName isImageType]. |
8511 | 7528 |
"/ imageFiles := imageFiles select:[:f | f baseName startsWith:'foo']. |
7529 |
imageFiles sort:[:a :b | a pathName < b pathName]. |
|
7530 |
||
8510 | 7531 |
"/ for each, get the color histogram |
7532 |
histogramsV := Dictionary new. |
|
7533 |
histogramsH := Dictionary new. |
|
7534 |
imageFiles do:[:fn | |
|
7535 |
|hist image| |
|
7536 |
||
7537 |
image := Image fromFile:fn. |
|
7538 |
Transcript showCR:'generating histogram for ',fn baseName. |
|
7539 |
hist := ImageColorHistogram new forImage:image. |
|
7540 |
histogramsV at:fn put:(hist histogramVectorV). |
|
7541 |
histogramsH at:fn put:(hist histogramVectorH). |
|
7542 |
]. |
|
7543 |
||
7544 |
similarH := Dictionary new. |
|
7545 |
similarV := Dictionary new. |
|
7546 |
similar := Dictionary new. |
|
7547 |
||
8512 | 7548 |
(self firstSelectedFile notNil |
7549 |
ifTrue:[ Array with:self firstSelectedFile ] |
|
7550 |
ifFalse:[ imageFiles ]) |
|
7551 |
do:[:eachFile1 | |
|
8510 | 7552 |
|setOfSimilar distancesV distancesH| |
7553 |
||
7554 |
distancesV := OrderedCollection new. |
|
7555 |
distancesH := OrderedCollection new. |
|
7556 |
setOfSimilar := OrderedCollection new. |
|
7557 |
||
7558 |
imageFiles do:[:eachFile2 | |
|
7559 |
|v1 v2 dV dH| |
|
7560 |
||
7561 |
eachFile1 ~= eachFile2 ifTrue:[ |
|
7562 |
v1 := histogramsV at:eachFile1. |
|
7563 |
v2 := histogramsV at:eachFile2. |
|
7564 |
dV := ImageColorHistogram distanceFrom:v1 to:v2. |
|
7565 |
distancesV add:(eachFile2 -> dV). |
|
7566 |
v1 := histogramsH at:eachFile1. |
|
7567 |
v2 := histogramsH at:eachFile2. |
|
7568 |
dH := ImageColorHistogram distanceFrom:v1 to:v2. |
|
7569 |
distancesH add:(eachFile2 -> dH). |
|
7570 |
(dV < 10000 and:[dH < 10000]) ifTrue:[ |
|
8512 | 7571 |
setOfSimilar add:eachFile2->(dV + dH). |
8510 | 7572 |
]. |
7573 |
] |
|
7574 |
]. |
|
7575 |
distancesV sort:[:a1 :a2 | a1 value < a2 value]. |
|
7576 |
distancesH sort:[:a1 :a2 | a1 value < a2 value]. |
|
7577 |
similarV at:eachFile1 put:distancesV. |
|
7578 |
similarH at:eachFile1 put:distancesH. |
|
7579 |
setOfSimilar notEmpty ifTrue:[ similar at:eachFile1 put:setOfSimilar ]. |
|
7580 |
]. |
|
7581 |
||
7582 |
similar isEmpty ifTrue:[ |
|
7583 |
Dialog information:'No similarities found.'. |
|
7584 |
^ self. |
|
7585 |
]. |
|
7586 |
]. |
|
7587 |
||
15589 | 7588 |
stream := CharacterWriteStream new. |
8512 | 7589 |
alreadyPrinted := Set new. |
7590 |
||
7591 |
imageFiles do:[:eachFile | |
|
7592 |
|eachSet| |
|
7593 |
||
7594 |
(alreadyPrinted includes:eachFile) ifFalse:[ |
|
7595 |
eachSet := similar at:eachFile ifAbsent:nil. |
|
7596 |
eachSet notNil ifTrue:[ |
|
7597 |
stream nextPutLine:eachFile pathName. |
|
7598 |
eachSet do:[:info | |
|
7599 |
|fn2 dist| |
|
7600 |
||
7601 |
fn2 := info key. |
|
7602 |
dist := info value. |
|
7603 |
stream nextPutAll:' '. |
|
7604 |
stream nextPutAll:fn2 pathName. |
|
7605 |
stream nextPutLine:' (',dist printString,')'. |
|
7606 |
alreadyPrinted add:fn2. |
|
7607 |
]. |
|
7608 |
stream cr. |
|
7609 |
]. |
|
8510 | 7610 |
]. |
7611 |
]. |
|
8524
cac6b19eae23
changed #fileFindSimilarImages
Claus Gittinger <cg@exept.de>
parents:
8512
diff
changeset
|
7612 |
]. |
8510 | 7613 |
|
7614 |
textBox := TextBox new. |
|
7615 |
textBox initialText:(stream contents). |
|
7616 |
textBox title:'File similarities:'. |
|
7617 |
textBox readOnly:true. |
|
7618 |
textBox noCancel. |
|
7619 |
||
7620 |
textBox label:'File similarities'. |
|
7621 |
textBox extent:(400@((similar size max:40)* 10)). |
|
7622 |
textBox maxExtent:Screen current extent. |
|
7623 |
textBox openModeless. "/ showAtPointer. |
|
7624 |
||
7625 |
"Modified: / 25-07-2006 / 09:07:25 / cg" |
|
7626 |
! |
|
7627 |
||
4618 | 7628 |
fileHexDump |
17744 | 7629 |
|file item| |
4618 | 7630 |
|
7631 |
file := self firstSelectedFile. |
|
7632 |
file notNil ifTrue:[ |
|
7633 |
item := DirectoryContentsBrowser itemClass fileName:file. |
|
5009 | 7634 |
self |
7635 |
applicationNamed:#FileApplicationNoteBook |
|
7636 |
ifPresentDo:[:appl | appl openTextEditorWithHexPresentationOn:item]. |
|
4618 | 7637 |
]. |
17744 | 7638 |
|
7639 |
"Modified (format): / 12-11-2017 / 11:19:56 / cg" |
|
4618 | 7640 |
! |
7641 |
||
7324 | 7642 |
fileIn:aFilename |
7643 |
"fileIn a file" |
|
7644 |
||
7645 |
self fileIn:aFilename lazy:false |
|
7646 |
||
7647 |
"Created: / 20-09-2006 / 14:30:06 / cg" |
|
7648 |
! |
|
7649 |
||
7650 |
fileIn:aFilename lazy:lazy |
|
7651 |
"fileIn a file" |
|
7652 |
||
7653 |
self withActivityIndicationDo:[ |
|
7654 |
self notify:('File in:', aFilename asFilename baseName). |
|
7655 |
self singleFileFileIn:aFilename lazy:lazy. |
|
7656 |
self notify:nil. |
|
7657 |
] |
|
7658 |
||
7659 |
"Created: / 20-09-2006 / 14:29:21 / cg" |
|
7660 |
! |
|
7661 |
||
4930 | 7662 |
filterSelectedFiles:whichFilter |
7663 |
|selectedFiles numFiles msg filterBlock| |
|
7664 |
||
7560 | 7665 |
selectedFiles := self currentSelectedObjects. |
4930 | 7666 |
(numFiles := selectedFiles size) == 0 ifTrue:[^ self]. |
7667 |
||
7668 |
msg := 'Replace contents of file ''%2'' with output of %3-filter ?'. |
|
7669 |
numFiles > 1 ifTrue:[ |
|
7670 |
msg := 'Replace contents of %1 files with output of %3-filter ?'. |
|
7671 |
]. |
|
7672 |
||
7673 |
(Dialog |
|
6352 | 7674 |
confirm:(resources stringWithCRs:msg with:numFiles with:selectedFiles first baseName allBold with:whichFilter) |
4930 | 7675 |
initialAnswer:false |
7676 |
) ifFalse:[ |
|
7677 |
^ self |
|
7678 |
]. |
|
7679 |
||
7680 |
whichFilter == #rot13 ifTrue:[ |
|
7681 |
filterBlock := [:charIn | charIn rot13 ]. |
|
7682 |
]. |
|
7683 |
"/ add more here... |
|
7684 |
||
7685 |
filterBlock isNil ifTrue:[ |
|
7686 |
self information:'No such filter: ' , whichFilter. |
|
7687 |
^ self. |
|
7688 |
]. |
|
7689 |
||
7690 |
selectedFiles do:[:fileName | |
|
7691 |
|s| |
|
7692 |
||
7693 |
self notify:('Processing:', fileName baseName). |
|
7694 |
fileName isDirectory ifFalse:[ |
|
7695 |
[ |
|
7696 |
|inFile outFile in out| |
|
7697 |
||
7698 |
inFile := fileName asFilename. |
|
7699 |
outFile := (fileName pathName , '.filter') asFilename. |
|
7700 |
||
7701 |
[ |
|
7702 |
|charIn charOut| |
|
7703 |
||
7704 |
in := inFile readStream. |
|
7705 |
out := outFile writeStream. |
|
7706 |
[in atEnd] whileFalse:[ |
|
7707 |
charIn := in next. |
|
7708 |
charOut := filterBlock value:charIn. |
|
7709 |
out nextPut:charOut. |
|
7710 |
]. |
|
13683 | 7711 |
out close. out:= nil. |
4930 | 7712 |
outFile renameTo:inFile. |
7713 |
] ensure:[ |
|
7714 |
out notNil ifTrue:[ out close ]. |
|
7715 |
in notNil ifTrue:[ in close ]. |
|
18024 | 7716 |
outFile remove. |
4930 | 7717 |
] |
7718 |
] on:FileStream openErrorSignal do:[:ex| |
|
7719 |
self warn:('Cannot process "%1".' bindWith:fileName baseName allBold). |
|
7720 |
]. |
|
7721 |
] |
|
7722 |
]. |
|
6190 | 7723 |
self notify:nil. |
7560 | 7724 |
|
7725 |
"Modified: / 04-12-2006 / 13:14:48 / cg" |
|
4930 | 7726 |
! |
7727 |
||
9784 | 7728 |
forEachParsedXmlFileDo:aBlock |
7729 |
"parse all selected XML files, for each dom-tree, evaluate aBlock" |
|
7730 |
||
7731 |
self withActivityIndicationDo:[ |
|
7732 |
| selectedFiles xmlDocument | |
|
7733 |
||
7734 |
selectedFiles:= self currentSelectedFiles. |
|
7735 |
selectedFiles do:[:fileName | |
|
7736 |
XML::XMLSignal handle:[:ex | |
|
14551 | 7737 |
Dialog |
7738 |
information:('Error while reading XML:\ %1' bindWith:ex description) withCRs |
|
7739 |
title:'XML Error'. |
|
9784 | 7740 |
^ self. |
7741 |
] do:[ |
|
7742 |
|s d magic encoder document| |
|
7743 |
||
7744 |
s := fileName asFilename readStream. |
|
14012 | 7745 |
[ |
7746 |
s binary. |
|
7747 |
magic := (s next:2). |
|
7748 |
magic = #[254 255] ifTrue:[ |
|
7749 |
"/ UTF16BE |
|
7750 |
document := CharacterEncoder decodeString:(s upToEnd) from:#utf16be. |
|
7751 |
] ifFalse:[ |
|
7752 |
magic = #[255 254] ifTrue:[ |
|
7753 |
"/ UTF16LE |
|
7754 |
document := CharacterEncoder decodeString:(s upToEnd) from:#utf16le. |
|
7755 |
]. |
|
7756 |
]. |
|
7757 |
] ensure:[ |
|
7758 |
s close. |
|
7759 |
]. |
|
9784 | 7760 |
document notNil ifTrue:[ |
7761 |
xmlDocument := XML::XMLParser |
|
7762 |
processDocumentString:document |
|
7763 |
beforeScanDo:[:parse| parse validate:false]. |
|
7764 |
] ifFalse:[ |
|
7765 |
xmlDocument := XML::XMLParser |
|
7766 |
processDocumentInFilename:fileName |
|
7767 |
beforeScanDo:[:parse| parse validate:false]. |
|
7768 |
] |
|
7769 |
]. |
|
7770 |
aBlock value:xmlDocument. |
|
7771 |
]. |
|
7772 |
] |
|
7773 |
||
7774 |
"Created: / 17-02-2011 / 13:58:21 / cg" |
|
7775 |
! |
|
7776 |
||
8832 | 7777 |
forEachSelectedFileIgnoringDirectories:ignoreDirs do:aBlock |
7778 |
|numItems path files| |
|
7779 |
||
7780 |
files := self currentSelectedFiles. |
|
7781 |
||
7782 |
(numItems := files size) > 2 ifTrue:[ |
|
7783 |
(self |
|
7784 |
confirm:(resources string:'Open for each of the %1 items ?' |
|
7785 |
with:numItems)) ifFalse:[^ self]. |
|
7786 |
]. |
|
7787 |
||
7788 |
self withActivityIndicationDo:[ |
|
7789 |
files do:[:fileName | |
|
7790 |
(ignoreDirs not or:[fileName isDirectory not]) ifTrue:[ |
|
7791 |
fileName isAbsolute ifTrue:[ |
|
17239 | 7792 |
path := fileName name. |
8832 | 7793 |
] ifFalse:[ |
7794 |
path := fileName pathName. |
|
7795 |
]. |
|
7796 |
aBlock value:path |
|
7797 |
] |
|
7798 |
]. |
|
7799 |
]. |
|
17239 | 7800 |
|
7801 |
"Modified: / 19-01-2017 / 16:57:03 / stefan" |
|
8832 | 7802 |
! |
7803 |
||
8648
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
7804 |
generateDetachedSignaturesForSelectedFiles |
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
7805 |
"generate detached signature (pkcs7) files from the contents of the selected files. |
16941 | 7806 |
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
|
7807 |
|
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
7808 |
self withActivityIndicationDo:[ |
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
7809 |
self currentSelectedFiles do:[:fn | |
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
7810 |
|data hash signature signatureFile| |
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
7811 |
|
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
7812 |
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
|
7813 |
|
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
7814 |
data := fn contentsAsString. |
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
7815 |
hash := SHA1Stream hashValueOf:data. |
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
7816 |
|
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
7817 |
signature := Expecco::KeyFileGenerator new signExpeccoCode:hash. |
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
7818 |
|
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
7819 |
signatureFile := fn addSuffix:'sig'. |
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
7820 |
signatureFile contents:signature. |
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
7821 |
]. |
13677 | 7822 |
self updateCurrentDirectoryWithReread. |
8648
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
7823 |
self notify:nil. |
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
7824 |
] |
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
7825 |
! |
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
7826 |
|
15211 | 7827 |
generatePatchInstallerForSelectedFiles |
7828 |
"generate an expecco patch, which installs the selected file(s). |
|
7829 |
Opens a dialog asking for the target directory and if the patch should be signed" |
|
7830 |
||
7831 |
|dialog targetDirHolder targetDir |
|
7832 |
generateSignedPatchHolder patchFileNameHolder patchFileName| |
|
7833 |
||
7834 |
targetDirHolder := '.' asValue. |
|
7835 |
generateSignedPatchHolder := true asValue. |
|
7836 |
patchFileNameHolder := '/tmp/00nn_patchFile.st' asValue. |
|
7837 |
||
7838 |
dialog := Dialog new. |
|
7839 |
dialog label:(resources string:'Patch Installer for File(s)'). |
|
7840 |
dialog addTextLabel:'Patchfile Name' adjust:#left. |
|
7841 |
dialog addInputFieldOn:patchFileNameHolder tabable:true. |
|
7842 |
dialog addTextLabel:'Target directory (relative to executable''s directory at execution time)' adjust:#left. |
|
7843 |
dialog addInputFieldOn:targetDirHolder tabable:true. |
|
7844 |
dialog addCheckBox:'Generate Signed Patch' on:generateSignedPatchHolder. |
|
7845 |
dialog addAbortAndOkButtons. |
|
7846 |
dialog open. |
|
7847 |
||
7848 |
dialog accepted ifFalse:[^ self]. |
|
7849 |
||
7850 |
targetDir := targetDirHolder value asFilename. |
|
7851 |
patchFileName := patchFileNameHolder value asFilename. |
|
7852 |
||
7853 |
self withActivityIndicationDo:[ |
|
7854 |
|outStream zipArchive pkcs7SignedData signatureFilename| |
|
7855 |
||
7856 |
self notify:'Generating self extracting st script: ', patchFileName name, '...'. |
|
7857 |
outStream := patchFileName writeStream. |
|
7858 |
outStream nextPutAll:' |
|
7859 |
|patchStream zipArchive| |
|
7860 |
patchStream := Expecco::Browser::CurrentPatchStreamQuery query. |
|
7861 |
patchStream isNil ifTrue:[ self error:''sorry, this patch can only be installed in expecco 2.6.2 and newer (missing CurrentPatchStreamQuery)'']. |
|
7862 |
zipArchive := ZipArchive readingFrom:patchStream. |
|
7863 |
zipArchive members do:[:each | zipArchive extract:each fileName]. |
|
7864 |
patchStream setToEnd. "/ to force fileIn to finish |
|
7865 |
!! |
|
7866 |
||
7867 |
!! !! |
|
7868 |
||
7869 |
'. |
|
7870 |
zipArchive := ZipArchive writingTo:outStream. "/ newFileNamed:(patchFileName). |
|
7871 |
||
7872 |
self currentSelectedFiles do:[:fn | |
|
7873 |
|inStream signatureFilename| |
|
7874 |
||
7875 |
inStream := fn asFilename readStream. |
|
7876 |
zipArchive addFile: (targetDir construct:fn asFilename baseName) name fromStream:inStream. |
|
7877 |
inStream close. |
|
7878 |
]. |
|
7879 |
||
16975 | 7880 |
zipArchive close. |
15211 | 7881 |
|
7882 |
generateSignedPatchHolder value ifTrue:[ |
|
7883 |
self notify:'Generating signed file from: ', patchFileName name, '...'. |
|
7884 |
||
7885 |
pkcs7SignedData := Expecco::KeyFileGenerator new signExpeccoCode:patchFileName contentsOfEntireFile. |
|
7886 |
signatureFilename := patchFileName withSuffix:'expeccoPatch'. |
|
7887 |
signatureFilename contents:pkcs7SignedData. |
|
7888 |
]. |
|
7889 |
self notify:nil. |
|
7890 |
] |
|
7891 |
! |
|
13783 | 7892 |
|
8640
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
7893 |
generateSignaturesForSelectedFiles |
13783 | 7894 |
"generate signed pkcs7 files from the contents of the selected files. |
7895 |
These can be delivered as expeccoPatch files" |
|
8640
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
7896 |
|
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
7897 |
self withActivityIndicationDo:[ |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
7898 |
self currentSelectedFiles do:[:fn | |
8645
00e4d07c6d6d
Generate signed expecco patch files
Stefan Vogel <sv@exept.de>
parents:
8641
diff
changeset
|
7899 |
|pkcs7SignedData signatureFilename| |
00e4d07c6d6d
Generate signed expecco patch files
Stefan Vogel <sv@exept.de>
parents:
8641
diff
changeset
|
7900 |
|
8646 | 7901 |
self notify:'Generating signed file from: ', (fn baseName), '...'. |
8645
00e4d07c6d6d
Generate signed expecco patch files
Stefan Vogel <sv@exept.de>
parents:
8641
diff
changeset
|
7902 |
|
00e4d07c6d6d
Generate signed expecco patch files
Stefan Vogel <sv@exept.de>
parents:
8641
diff
changeset
|
7903 |
pkcs7SignedData := Expecco::KeyFileGenerator new signExpeccoCode:fn contentsOfEntireFile. |
12094 | 7904 |
signatureFilename := fn withSuffix:'expeccoPatch'. |
8645
00e4d07c6d6d
Generate signed expecco patch files
Stefan Vogel <sv@exept.de>
parents:
8641
diff
changeset
|
7905 |
signatureFilename contents:pkcs7SignedData. |
8640
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
7906 |
]. |
13677 | 7907 |
self updateCurrentDirectoryWithReread. |
8640
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
7908 |
self notify:nil. |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
7909 |
] |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
7910 |
! |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
7911 |
|
9784 | 7912 |
inspectXmlFile |
7913 |
"Show an XML file - either in an XMLInspector or fall back to |
|
7914 |
a plain inspector on the XML tree" |
|
7915 |
||
7916 |
self forEachParsedXmlFileDo:[:xmlDocument | |
|
7917 |
XML::XMLInspector notNil ifTrue:[ |
|
7918 |
XML::XMLInspector openOn:xmlDocument. |
|
7919 |
] ifFalse:[ |
|
7920 |
"fall back..." |
|
7921 |
xmlDocument inspect. |
|
7922 |
] |
|
7923 |
]. |
|
7924 |
||
7925 |
"Modified: / 17-02-2011 / 13:58:16 / cg" |
|
7926 |
! |
|
7927 |
||
3892 | 7928 |
installAllAsAutoloaded |
7929 |
"install all classes found here as autoloaded classes" |
|
7930 |
||
9674
3c3c1ef9974b
added: #installAllAsAutoloadedRecursive:
Claus Gittinger <cg@exept.de>
parents:
9649
diff
changeset
|
7931 |
self installAllAsAutoloadedRecursive:false |
3892 | 7932 |
! |
7933 |
||
6521 | 7934 |
installAllAsAutoloadedRecursive |
7935 |
"install all classes found here and in subdirectories as autoloaded classes" |
|
7936 |
||
9674
3c3c1ef9974b
added: #installAllAsAutoloadedRecursive:
Claus Gittinger <cg@exept.de>
parents:
9649
diff
changeset
|
7937 |
self installAllAsAutoloadedRecursive:true |
3c3c1ef9974b
added: #installAllAsAutoloadedRecursive:
Claus Gittinger <cg@exept.de>
parents:
9649
diff
changeset
|
7938 |
! |
3c3c1ef9974b
added: #installAllAsAutoloadedRecursive:
Claus Gittinger <cg@exept.de>
parents:
9649
diff
changeset
|
7939 |
|
3c3c1ef9974b
added: #installAllAsAutoloadedRecursive:
Claus Gittinger <cg@exept.de>
parents:
9649
diff
changeset
|
7940 |
installAllAsAutoloadedRecursive:aBoolean |
3c3c1ef9974b
added: #installAllAsAutoloadedRecursive:
Claus Gittinger <cg@exept.de>
parents:
9649
diff
changeset
|
7941 |
"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
|
7942 |
|
6521 | 7943 |
[ |
15507 | 7944 |
LoadInProgressQuery answerNotifyLoadingDo:[ |
7945 |
|installAction| |
|
7946 |
||
7947 |
installAction := |
|
7948 |
[:fn | |
|
7949 |
(fn suffix = 'st') ifTrue:[ |
|
7950 |
self notify:('Install as autoloaded: ', fn baseName). |
|
7951 |
self installAsAutoloaded:fn. |
|
7952 |
] |
|
7953 |
]. |
|
7954 |
||
7955 |
self withActivityIndicationDo:[ |
|
7956 |
self currentSelectedDirectories do:[:dir| |
|
7957 |
aBoolean ifTrue:[ |
|
7958 |
dir recursiveDirectoryContentsAsFilenamesDo:installAction |
|
7959 |
] ifFalse:[ |
|
7960 |
dir directoryContentsAsFilenamesDo:installAction |
|
15152 | 7961 |
]. |
9674
3c3c1ef9974b
added: #installAllAsAutoloadedRecursive:
Claus Gittinger <cg@exept.de>
parents:
9649
diff
changeset
|
7962 |
]. |
15507 | 7963 |
self notify:nil. |
7964 |
]. |
|
7965 |
] |
|
6521 | 7966 |
] fork. |
7967 |
! |
|
7968 |
||
3892 | 7969 |
installAsAutoloaded:aFilename |
7970 |
"install aFilename as autoloaded class" |
|
7971 |
||
13292 | 7972 |
Smalltalk installAutoloadedClassFromSourceFile:aFilename |
7973 |
||
7974 |
"Modified: / 01-08-2013 / 16:58:09 / cg" |
|
3892 | 7975 |
! |
7976 |
||
15211 | 7977 |
joinSelectedFiles |
7978 |
|selectedFiles numFiles msg outFileName outFile outStream| |
|
7979 |
||
7980 |
selectedFiles := self currentSelectedObjects. |
|
7981 |
(numFiles := selectedFiles size) <= 1 ifTrue:[^ self]. |
|
7982 |
||
7983 |
msg := 'Join each of the %1 files into single file named:\\Attention: order in which files were selected is relevant here !!'. |
|
7984 |
outFileName := Dialog request:(resources stringWithCRs:msg with:numFiles with:selectedFiles first baseName). |
|
7985 |
outFileName isEmptyOrNil ifTrue:[^ self]. |
|
7986 |
outFile := selectedFiles first directory construct:outFileName. |
|
7987 |
||
7988 |
outStream := outFile writeStream. |
|
7989 |
||
7990 |
selectedFiles do:[:fileName | |
|
7991 |
self notify:('Adding:', fileName baseName). |
|
17997 | 7992 |
fileName readingFileDo:[:inStream | |
7993 |
inStream copyToEndInto:outStream. |
|
7994 |
]. |
|
15211 | 7995 |
]. |
7996 |
outStream close. |
|
7997 |
self notify:nil. |
|
7998 |
||
7999 |
"Modified: / 04-12-2006 / 13:15:10 / cg" |
|
8000 |
! |
|
4558 | 8001 |
|
6292 | 8002 |
loadImageThenDo:aBlock |
3892 | 8003 |
|img path files| |
8004 |
||
3982 | 8005 |
files := self currentSelectedFiles. |
3892 | 8006 |
files isEmpty ifTrue:[ ^ self]. |
8007 |
files do:[:fileName | |
|
4414 | 8008 |
path := fileName. |
8009 |
path isDirectory ifFalse:[ |
|
8010 |
img := Image fromFile:(path pathName). |
|
8011 |
img notNil ifTrue:[ |
|
6292 | 8012 |
aBlock value:img |
4414 | 8013 |
] ifFalse:[ |
15346 | 8014 |
Dialog warn:(resources string:'Unknown image format: "%1"' with:fileName asString) |
4414 | 8015 |
] |
8016 |
] |
|
3892 | 8017 |
]. |
8018 |
! |
|
8019 |
||
13089 | 8020 |
loadSignatureSupport |
8021 |
Expecco::KeyFileGenerator isNil ifTrue:[ |
|
14047 | 8022 |
Smalltalk loadPackage:'exept:expecco/license' |
13089 | 8023 |
]. |
8024 |
! |
|
8025 |
||
3892 | 8026 |
openASN1Browser |
8027 |
||
8028 |
self openTool:OSI::ASN1Browser |
|
8029 |
! |
|
8030 |
||
8031 |
openAppletViewer |
|
8032 |
|numItems files| |
|
8033 |
||
3982 | 8034 |
files := self currentSelectedFiles. |
3892 | 8035 |
(numItems := files size) > 2 ifTrue:[ |
4414 | 8036 |
(self |
8037 |
confirm:(resources string:'open for each of the %1 items ?' |
|
8038 |
with:numItems)) ifFalse:[^ self]. |
|
3892 | 8039 |
]. |
8040 |
||
8041 |
Java startupJavaSystem. |
|
8042 |
"/ Java markAllClassesUninitialized. |
|
8043 |
"/ Java initAllStaticFields. |
|
8044 |
"/ Java initAllClasses. |
|
8045 |
||
8046 |
files do:[:fileName | |
|
4414 | 8047 |
|p path| |
8048 |
||
8049 |
path := fileName. |
|
8050 |
path isDirectory ifFalse:[ |
|
8051 |
p := Java |
|
8052 |
javaProcessForMainOf:(Java classForName:'sun.applet.AppletViewer') |
|
8053 |
argumentString:path pathName. |
|
8054 |
p resume. |
|
8055 |
] |
|
3892 | 8056 |
]. |
8057 |
! |
|
8058 |
||
8059 |
openCBrowser |
|
6031 | 8060 |
|dir files| |
5880 | 8061 |
|
8062 |
dir := self theSingleSelectedDirectoryOrNil. |
|
8063 |
dir isNil ifTrue:[ ^ self]. |
|
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
8064 |
self withActivityIndicationDo:[ |
7560 | 8065 |
files := self currentSelectedObjects. |
6031 | 8066 |
files notEmptyOrNil ifTrue:[ |
8067 |
CBrowser::Browser openOn:files first. |
|
8068 |
] ifFalse:[ |
|
8069 |
CBrowser::Browser openIn:dir. |
|
8070 |
] |
|
3892 | 8071 |
] |
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
8072 |
|
7560 | 8073 |
"Modified: / 04-12-2006 / 13:15:19 / cg" |
3892 | 8074 |
! |
8075 |
||
4230 | 8076 |
openChangeSetBrowser |
11712
ed8877d9356b
comment/format in: #doOpenCBrowser
Claus Gittinger <cg@exept.de>
parents:
11688
diff
changeset
|
8077 |
"open a changeSet browser on the selected file(s)" |
ed8877d9356b
comment/format in: #doOpenCBrowser
Claus Gittinger <cg@exept.de>
parents:
11688
diff
changeset
|
8078 |
|
4230 | 8079 |
self |
11712
ed8877d9356b
comment/format in: #doOpenCBrowser
Claus Gittinger <cg@exept.de>
parents:
11688
diff
changeset
|
8080 |
openTool:(UserPreferences current changeSetBrowserClass) |
4230 | 8081 |
with:#openOnFile: |
8082 |
ignoreDirectories:true |
|
11712
ed8877d9356b
comment/format in: #doOpenCBrowser
Claus Gittinger <cg@exept.de>
parents:
11688
diff
changeset
|
8083 |
|
ed8877d9356b
comment/format in: #doOpenCBrowser
Claus Gittinger <cg@exept.de>
parents:
11688
diff
changeset
|
8084 |
"Modified (comment): / 27-07-2012 / 20:42:55 / cg" |
4230 | 8085 |
! |
8086 |
||
3892 | 8087 |
openChangesBrowser |
8088 |
"open a change browser on the selected file(s)" |
|
8089 |
||
8090 |
self openTool:(UserPreferences current changesBrowserClass) |
|
8091 |
! |
|
8092 |
||
8093 |
openDiffView |
|
15215 | 8094 |
"open a diff-view on the two selected files" |
8095 |
||
8096 |
|name1 name2 files title |
|
8097 |
defaultName defaultDir| |
|
6460 | 8098 |
|
8099 |
files := self currentSelectedObjects. |
|
3892 | 8100 |
files isEmpty ifTrue:[ |
6460 | 8101 |
Dialog warn:(resources string:'You have to select a file first'). |
4414 | 8102 |
^ self. |
3892 | 8103 |
]. |
8287
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
8104 |
|
3892 | 8105 |
(files size == 2) ifTrue:[ |
4414 | 8106 |
name1 := files last. |
8107 |
name2 := files first. |
|
3892 | 8108 |
] ifFalse:[ |
4414 | 8109 |
LastFileDiffFile notNil ifTrue:[ |
11052 | 8110 |
LastFileDiffFile exists ifTrue:[ |
8111 |
name1 := LastFileDiffFile. |
|
8112 |
]. |
|
8113 |
"/ | directory | |
|
8114 |
"/ directory := self currentDirectory. |
|
8115 |
"/ directory notNil ifTrue:[ |
|
8116 |
"/ lastFile := directory asFilename construct:(LastFileDiffFile baseName). |
|
8117 |
"/ (lastFile exists and:[lastFile isReadable]) ifTrue:[ |
|
8118 |
"/ name1 := lastFile. |
|
8119 |
"/ ] |
|
8120 |
"/ ] |
|
4414 | 8121 |
]. |
8122 |
name2 := files first. |
|
6460 | 8123 |
title := resources string:'Show differences between "%1" and:' with:name2 baseName. |
4414 | 8124 |
defaultName := name1 notNil ifTrue:[name1 baseName] ifFalse:[nil]. |
11052 | 8125 |
defaultDir := name1 notNil ifTrue:[name1 directory] ifFalse:[self currentDirectory]. |
4414 | 8126 |
name1 := DialogBox |
8127 |
requestFileName:title |
|
8128 |
default:defaultName |
|
6460 | 8129 |
ok:(resources string:'OK') |
8130 |
abort:(resources string:'Compare against File List') |
|
4414 | 8131 |
pattern:'*' |
11052 | 8132 |
fromDirectory:defaultDir. |
3892 | 8133 |
]. |
15215 | 8134 |
self openDiffViewOn:name1 and:name2 |
8135 |
||
8136 |
"Modified: / 03-05-2012 / 08:03:16 / cg" |
|
8137 |
! |
|
8138 |
||
8139 |
openDiffViewOn:fileArg1 and:fileArg2 |
|
8140 |
"open a diff-view on two files" |
|
8141 |
||
17769 | 8142 |
|file1 file2 file1Size file2Size text1 text2 d err nm l1 sameContents msg| |
15215 | 8143 |
|
8144 |
file1 := fileArg1. |
|
8145 |
file2 := fileArg2. |
|
3892 | 8146 |
|
8287
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
8147 |
self withWaitCursorDo:[ |
15215 | 8148 |
(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
|
8149 |
text1 := self getAllFilesAsStrings asStringCollection withTabs. |
14126 | 8150 |
text1 := text1 collect:[:l | l isNil ifTrue:[' '] ifFalse:[l string]]. |
15215 | 8151 |
file1 := nil. |
8287
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
8152 |
l1 := 'browser contents' |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
8153 |
] ifFalse:[ |
15215 | 8154 |
file1 := file1 asFilename. |
8155 |
LastFileDiffFile := file1. |
|
8156 |
file1 isReadable ifFalse:[ |
|
8157 |
nm := file1. |
|
8158 |
file1 exists ifFalse:[ |
|
8287
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
8159 |
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
|
8160 |
] ifTrue:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
8161 |
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
|
8162 |
]. |
4414 | 8163 |
]. |
15215 | 8164 |
l1 := file1 pathName |
4414 | 8165 |
]. |
8287
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
8166 |
|
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
8167 |
err isNil ifTrue:[ |
15215 | 8168 |
file2 isReadable ifFalse:[ |
8169 |
nm := file2. |
|
8170 |
file2 exists ifFalse:[ |
|
8287
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
8171 |
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
|
8172 |
] ifTrue:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
8173 |
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
|
8174 |
]. |
4414 | 8175 |
]. |
8176 |
]. |
|
8287
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
8177 |
err notNil ifTrue:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
8178 |
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
|
8179 |
^ self |
6176 | 8180 |
]. |
8181 |
||
8287
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
8182 |
self withActivityIndicationDo:[ |
17769 | 8183 |
file1Size := file1 isNil ifTrue:[0] ifFalse:[file1 fileSize]. |
8184 |
file2Size := file2 isNil ifTrue:[0] ifFalse:[file2 fileSize]. |
|
8185 |
||
8186 |
((file1Size > (1024*1024*32)) or:[ file2Size > (1024*1024*32) ]) ifTrue:[ |
|
8187 |
file1Size = file2Size ifTrue:[ |
|
8287
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
8188 |
ProgressIndicator |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
8189 |
displayBusyIndicator:'Comparing...' |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
8190 |
at:(Screen default center) |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
8191 |
during:[ |
15215 | 8192 |
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
|
8193 |
]. |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
8194 |
sameContents ifTrue:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
8195 |
self information:'Same contents.' |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
8196 |
] ifFalse:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
8197 |
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
|
8198 |
]. |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
8199 |
] ifFalse:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
8200 |
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
|
8201 |
]. |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
8202 |
^ self. |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
8203 |
]. |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
8204 |
|
15215 | 8205 |
file1 notNil ifTrue:[ |
8206 |
file1 isDirectory ifTrue:[ |
|
8207 |
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
|
8208 |
] ifFalse:[ |
15215 | 8209 |
text1 := file1 contents. |
8287
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
8210 |
] |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
8211 |
]. |
15215 | 8212 |
file2 isDirectory ifTrue:[ |
8213 |
text2 := file2 directoryContents asString. |
|
6460 | 8214 |
] ifFalse:[ |
15215 | 8215 |
text2 := file2 contents. |
8287
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
8216 |
]. |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
8217 |
text1 = text2 ifTrue:[ |
15215 | 8218 |
(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
|
8219 |
msg := 'Same filename lists.' |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
8220 |
] ifFalse:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
8221 |
msg := 'Same contents.' |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
8222 |
]. |
16911 | 8223 |
self information:msg |
8287
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
8224 |
] ifFalse:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
8225 |
d := DiffTextView |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
8226 |
openOn:text1 label:l1 |
15215 | 8227 |
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
|
8228 |
d topView label:(resources string:'File Differences'). |
6460 | 8229 |
] |
4414 | 8230 |
] |
3892 | 8231 |
] |
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
8232 |
|
17769 | 8233 |
"Modified: / 19-11-2017 / 15:00:47 / cg" |
3892 | 8234 |
! |
8235 |
||
9496
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
8236 |
openDirectoryDiffView |
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
8237 |
"open a directory diff-view" |
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
8238 |
|
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
8239 |
|name1 name2 files| |
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
8240 |
|
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
8241 |
files := self currentSelectedObjects. |
11108 | 8242 |
files notEmpty ifTrue:[ |
8243 |
name1 := files first asFilename. |
|
8244 |
name1 asFilename isDirectory ifFalse:[ |
|
8245 |
name1 := name1 directory |
|
8246 |
]. |
|
8247 |
]. |
|
8248 |
||
8249 |
(files size == 2) ifTrue:[ |
|
8250 |
name2 := files second. |
|
8251 |
] ifFalse:[ |
|
8252 |
(files size ~= 1) ifTrue:[ |
|
8253 |
Dialog warn:(resources string:'Please select one or two directories.'). |
|
8254 |
^ self. |
|
8255 |
]. |
|
8256 |
name2 := Dialog |
|
8257 |
requestDirectoryName:(resources |
|
8258 |
string:'Recursive compare "%1" with folder:' |
|
8259 |
with:name1 asFilename baseName) |
|
8260 |
default:(LastFileDiffDirectory ? self currentDirectory). |
|
8261 |
name2 isEmptyOrNil ifTrue:[^ self]. |
|
8262 |
LastFileDiffDirectory := name2. |
|
8263 |
]. |
|
8264 |
name2 := name2 asFilename. |
|
8265 |
||
8266 |
name2 asFilename isDirectory ifFalse:[ |
|
8267 |
name2 := name2 directory |
|
8268 |
]. |
|
8269 |
||
8270 |
self |
|
8271 |
applicationNamed:#FileApplicationNoteBook |
|
8272 |
ifPresentDo:[:appl | ^ appl openCompareDirectory:name1 with:name2]. |
|
9496
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
8273 |
|
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
8274 |
"Created: / 20-05-2010 / 15:01:17 / cg" |
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
8275 |
! |
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
8276 |
|
3892 | 8277 |
openEditor |
8278 |
self openTool:EditTextView |
|
8279 |
! |
|
8280 |
||
4957 | 8281 |
openGV |
8282 |
self openOSCommandWithFiles:'gv' |
|
8283 |
! |
|
8284 |
||
3892 | 8285 |
openHTMLReader |
8286 |
||
8287 |
self openTool:HTMLDocumentView ignoreDirectories:false |
|
8288 |
! |
|
8289 |
||
8290 |
openImageEditor |
|
6292 | 8291 |
[ |
8292 |
self loadImageThenDo:[:img | img edit] |
|
8293 |
] fork |
|
3892 | 8294 |
! |
8295 |
||
8296 |
openImageInspector |
|
6292 | 8297 |
[ |
8298 |
self loadImageThenDo:[:img | img inspect] |
|
8299 |
] fork |
|
3892 | 8300 |
! |
8301 |
||
8302 |
openImagePreview |
|
5778 | 8303 |
[ |
8304 |
self |
|
6292 | 8305 |
loadImageThenDo: |
5778 | 8306 |
[:img | |
8307 |
|i top viewer| |
|
8308 |
||
8309 |
top := StandardSystemView new. |
|
8310 |
||
8311 |
viewer := ImageView origin:0.0@0.0 corner:1.0@1.0 in:top. |
|
8312 |
i := img. |
|
8313 |
top extent:200@200. |
|
8314 |
top label:(img fileName asFilename directory baseName , Filename separator , img fileName asFilename baseName). |
|
8315 |
top openAndWait. |
|
8316 |
||
8317 |
(i width > 200 or:[i height > 200]) ifTrue:[ |
|
8318 |
i := i magnifiedPreservingRatioTo:200@200. |
|
8319 |
]. |
|
8320 |
viewer image:i. |
|
8321 |
]. |
|
3892 | 8322 |
] fork |
8323 |
! |
|
8324 |
||
8325 |
openMP3Player |
|
8326 |
|file| |
|
8327 |
||
3982 | 8328 |
file := self currentSelectedFiles. |
3892 | 8329 |
(file isEmpty) ifTrue:[ |
4414 | 8330 |
^ self. |
3892 | 8331 |
]. |
8332 |
file := file first. |
|
8333 |
(MP3PlayerApplication ? SaugFix::MP3PlayerApplication) playSong:file. |
|
8334 |
! |
|
8335 |
||
4957 | 8336 |
openOSCommandWithFiles:command |
8337 |
|files fileNames| |
|
8338 |
||
8339 |
files := self currentSelectedFiles. |
|
8340 |
(files isEmpty) ifTrue:[ |
|
8341 |
^ self. |
|
8342 |
]. |
|
8343 |
||
8344 |
fileNames := files collect:[:each | |
|
8345 |
'"' , each asFilename pathName , '"' |
|
8346 |
]. |
|
8347 |
||
8348 |
[ |
|
8349 |
OperatingSystem |
|
4959 | 8350 |
executeCommand:command , ' ' , fileNames asStringCollection asString |
8351 |
inDirectory:(files first asFilename directory). |
|
4957 | 8352 |
] fork |
8353 |
! |
|
8354 |
||
4820 | 8355 |
openPDFViewer |
5836
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
8356 |
|files fileNames cmd arg| |
4820 | 8357 |
|
8358 |
files := self currentSelectedFiles. |
|
8359 |
(files isEmpty) ifTrue:[ |
|
8360 |
^ self. |
|
8361 |
]. |
|
12972 | 8362 |
cmd := MIMETypes defaultCommandTemplateToOpenMimeType:'application/pdf'. |
5836
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
8363 |
cmd isNil ifTrue:[ |
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
8364 |
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
|
8365 |
^ self. |
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
8366 |
]. |
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
8367 |
|
4820 | 8368 |
fileNames := |
8369 |
files |
|
8370 |
collect: |
|
8371 |
[:each | |
|
8372 |
'"' , each asFilename pathName , '"' |
|
8373 |
]. |
|
5836
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
8374 |
arg := fileNames asStringCollection asStringWith:' '. |
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
8375 |
|
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
8376 |
(cmd includesString:'"%1"') ifTrue:[ |
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
8377 |
cmd := cmd copyReplaceString:'"%1"' withString:'%1' |
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
8378 |
]. |
4820 | 8379 |
|
4950 | 8380 |
[ |
5836
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
8381 |
OperatingSystem executeCommand:(cmd bindWith:arg). |
4950 | 8382 |
] fork |
5836
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
8383 |
|
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
8384 |
"Modified: / 12-05-2004 / 12:31:20 / cg" |
4820 | 8385 |
! |
8386 |
||
4958 | 8387 |
openRP |
8388 |
self openOSCommandWithFiles:'realplay' |
|
8389 |
! |
|
8390 |
||
8426 | 8391 |
openResourceFileEditor |
8392 |
||
8393 |
self |
|
8394 |
openTool: Tools::InternationalLanguageTranslationEditor |
|
8395 |
with: #openOnFile: |
|
8396 |
! |
|
8397 |
||
3892 | 8398 |
openSlideShow |
5880 | 8399 |
|dir| |
8400 |
||
8401 |
dir := self theSingleSelectedDirectoryOrNil. |
|
8402 |
dir isNil ifTrue:[^ self]. |
|
8403 |
||
3892 | 8404 |
CodingExamples_GUI::SlideShow openIn:dir. |
8405 |
! |
|
8406 |
||
8407 |
openSnapshotImageBrowser |
|
4491 | 8408 |
"Sorry, for now, only the old browser can handle snapShotImages." |
8409 |
||
3892 | 8410 |
^ self openTool:SystemBrowser with:#openOnSnapShotImage: ignoreDirectories:true |
8411 |
! |
|
8412 |
||
8413 |
openTerminal |
|
5880 | 8414 |
|dir| |
8415 |
||
8416 |
dir := self theSingleSelectedDirectoryOrHomeDir. |
|
3892 | 8417 |
|
5300 | 8418 |
TerminalApplication notNil ifTrue:[ |
8419 |
TerminalApplication openIn:dir |
|
8420 |
] ifFalse:[ |
|
8421 |
VT100TerminalView openShellIn:dir. |
|
8422 |
]. |
|
3892 | 8423 |
! |
8424 |
||
8425 |
openTool:aToolClass |
|
8426 |
"open a tool on the selected file(s)" |
|
8427 |
||
8428 |
^ self openTool:aToolClass ignoreDirectories:true |
|
8429 |
! |
|
8430 |
||
8431 |
openTool:aToolClass ignoreDirectories:ignoreDirs |
|
8432 |
"open a tool on the selected file(s)" |
|
8433 |
||
8434 |
^ self |
|
4414 | 8435 |
openTool:aToolClass |
8436 |
with:#openOn: |
|
8437 |
ignoreDirectories:ignoreDirs |
|
3892 | 8438 |
! |
8439 |
||
8426 | 8440 |
openTool:aToolClass with:aSelector |
8441 |
"open a tool on the selected file(s)" |
|
8442 |
||
8443 |
^ self openTool:aToolClass with:aSelector ignoreDirectories:true |
|
8444 |
! |
|
8445 |
||
3892 | 8446 |
openTool:aToolClass with:aSelector ignoreDirectories:ignoreDirs |
8447 |
"open a tool on the selected file(s)" |
|
8448 |
||
8832 | 8449 |
|tool| |
3892 | 8450 |
|
8451 |
aToolClass isNil ifTrue:[ |
|
4414 | 8452 |
Dialog warn:'Sorry, that tool seems to be not available'. |
8453 |
^ nil. |
|
3892 | 8454 |
]. |
8832 | 8455 |
self forEachSelectedFileIgnoringDirectories:ignoreDirs do:[:path | |
8456 |
tool := aToolClass perform:aSelector with:path. |
|
3892 | 8457 |
]. |
8458 |
^ tool |
|
8832 | 8459 |
! |
8460 |
||
8461 |
openWebBrowser |
|
9343
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
8462 |
self |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
8463 |
forEachSelectedFileIgnoringDirectories:true |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
8464 |
do:[:path | |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
8465 |
Error |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
8466 |
handle:[:ex | |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
8467 |
Dialog warn:'Shell execution failed: ',ex description |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
8468 |
] do:[ |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
8469 |
OperatingSystem openApplicationForDocument:path operation:#open. |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
8470 |
^ self. |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
8471 |
] |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
8472 |
]. |
3892 | 8473 |
! |
8474 |
||
6022 | 8475 |
openWorkspace |
8476 |
self |
|
8477 |
openTool:WorkspaceApplication |
|
8478 |
with:#openOnFile: |
|
8479 |
ignoreDirectories:true |
|
8480 |
! |
|
8481 |
||
4950 | 8482 |
openXV |
4957 | 8483 |
self openOSCommandWithFiles:'xv' |
4950 | 8484 |
! |
8485 |
||
3892 | 8486 |
openZipTool |
5880 | 8487 |
|zipTool| |
3892 | 8488 |
|
8489 |
(zipTool := self openTool:ZipTool) notNil ifTrue:[ |
|
5880 | 8490 |
zipTool initialExtractDirectory:(self theSingleSelectedDirectoryOrHomeDir). |
3892 | 8491 |
]. |
8492 |
! |
|
8493 |
||
8494 |
readAbbrevFile |
|
8495 |
"read the abbrev file and install classes found there as autoloaded classes" |
|
8496 |
||
5880 | 8497 |
|directories| |
3892 | 8498 |
|
3982 | 8499 |
directories := self currentSelectedDirectories. |
3892 | 8500 |
directories isEmpty ifTrue:[^ self]. |
8501 |
||
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
8502 |
self withActivityIndicationDo:[ |
5880 | 8503 |
directories do:[:eachDir | |
8504 |
Smalltalk installAutoloadedClassesFrom:(eachDir construct:'abbrev.stc'). |
|
8505 |
] |
|
5828 | 8506 |
] |
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
8507 |
|
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
8508 |
"Modified: / 25-07-2006 / 09:07:43 / cg" |
3892 | 8509 |
! |
8510 |
||
6460 | 8511 |
readAndShowResources |
8512 |
self withActivityIndicationDo:[ |
|
8513 |
| selectedFiles| |
|
8514 |
||
8515 |
selectedFiles:= self currentSelectedFiles. |
|
8516 |
selectedFiles do:[:fileName | |
|
8517 |
resources := ResourcePack fromFile:fileName. |
|
8518 |
resources inspect. |
|
8519 |
]. |
|
8520 |
] |
|
8521 |
! |
|
8522 |
||
17831 | 8523 |
removeBakAndSavFiles |
8524 |
"remove all .sav and .bak files (after confirmation)" |
|
8525 |
||
8526 |
|filesToRemove directories| |
|
8527 |
||
8528 |
directories := self currentSelectedDirectories. |
|
8529 |
directories isEmptyOrNil ifTrue:[ |
|
8530 |
directories := Array with:self currentDirectory |
|
8531 |
]. |
|
8532 |
||
8533 |
self withActivityIndicationDo:[ |
|
8534 |
filesToRemove := OrderedCollection new. |
|
8535 |
directories do:[:eachDirectoryToScan | |
|
8536 |
eachDirectoryToScan filesDo:[:fn | |
|
8537 |
(#('sav' 'bak') includes:fn suffix) ifTrue:[ |
|
8538 |
filesToRemove add:fn. |
|
8539 |
] |
|
8540 |
] |
|
8541 |
]. |
|
8542 |
filesToRemove isEmpty ifTrue:[ |
|
8543 |
Dialog information:(resources string:'Nothing to remove'). |
|
8544 |
^ self. |
|
8545 |
]. |
|
8546 |
(Dialog confirm:(resources string:'Remove %1 file(s) ?' with:filesToRemove size)) ifFalse:[ |
|
8547 |
^ self |
|
8548 |
]. |
|
8549 |
filesToRemove do:[:each | |
|
8550 |
each remove |
|
8551 |
]. |
|
17871 | 8552 |
self updateCurrentDirectoryWithReread |
17831 | 8553 |
]. |
8554 |
! |
|
8555 |
||
3892 | 8556 |
singleFileFileIn:fileName lazy:lazy |
8557 |
"fileIn the selected file(s)" |
|
8558 |
||
9299
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
8559 |
|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
|
8560 |
|
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8561 |
fileName isRegularFile ifFalse:[ |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8562 |
^ self. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8563 |
]. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8564 |
|
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8565 |
[ |
4345 | 8566 |
(ObjectFileLoader notNil |
5491 | 8567 |
and:[ObjectFileLoader hasValidBinaryExtension:fileName]) ifTrue:[ |
4345 | 8568 |
AbortOperationRequest catch:[ |
8569 |
|p| |
|
8570 |
||
8571 |
"/ |
|
8572 |
"/ look if already loaded ... then unload first |
|
8573 |
"/ |
|
8574 |
p := fileName pathName. |
|
8575 |
(ObjectFileLoader loadedObjectFiles includes:p) ifTrue:[ |
|
8576 |
(Dialog confirm:(resources |
|
8577 |
string:'%1 is already loaded; load anyway ?' |
|
8578 |
with:p)) ifFalse:[ |
|
8579 |
^ self |
|
8580 |
]. |
|
8581 |
notifyString := 'unloading old ' , p , ' ...'. |
|
8582 |
Transcript showCR:notifyString. |
|
4523 | 8583 |
self notify:notifyString. |
4345 | 8584 |
ObjectFileLoader unloadObjectFile:p. |
8585 |
]. |
|
8586 |
||
8587 |
notifyString := 'loading ' , p , ' ...'. |
|
8588 |
Transcript showCR:notifyString. |
|
4523 | 8589 |
self notify:notifyString. |
12426 | 8590 |
(ObjectFileLoader loadObjectFile:p) isNil ifTrue:[ |
8591 |
notifyString := 'Error: could not load ' , p. |
|
8592 |
Transcript showCR:notifyString. |
|
8593 |
self notify:notifyString. |
|
8594 |
] ifFalse:[ |
|
8595 |
Class addInfoRecord:('fileIn ' , fileName asFilename pathName) |
|
8596 |
]. |
|
4345 | 8597 |
] |
8598 |
] ifFalse:[ ((fileName hasSuffix:'cls') |
|
8599 |
and:[((fileName mimeTypeOfContents ? '') startsWith:'application/x-smalltalk-source') not ]) ifTrue:[ |
|
8600 |
"/ loading a binary class file |
|
4636
08b2b63e3107
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4629
diff
changeset
|
8601 |
aStream := fileName readStreamOrNil. |
4345 | 8602 |
aStream notNil ifTrue:[ |
8603 |
aStream fileInBinary. |
|
8604 |
] |
|
8605 |
] ifFalse:[ |
|
9299
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
8606 |
((fileName hasSuffix:'class') or:[(fileName hasSuffix:'cla')]) ifTrue:[ |
4345 | 8607 |
"/ loading a java class file |
8608 |
JavaClassReader notNil ifTrue:[ |
|
5491 | 8609 |
JavaClassReader loadFile:fileName |
4345 | 8610 |
] |
8611 |
] ifFalse:[ (fileName hasSuffix:'sif') ifTrue:[ |
|
8612 |
"/ loading a sif (smalltalk interchange format) file |
|
8613 |
SmalltalkInterchangeSTXFileInManager autoload. |
|
8614 |
SmalltalkInterchangeFileManager newForFileIn |
|
8615 |
fileName: fileName pathName; |
|
8616 |
fileIn. |
|
8617 |
] ifFalse:[ (fileName hasSuffix:'pcl') ifTrue:[ |
|
8618 |
Parcel isNil ifTrue:[ |
|
8619 |
Dialog warn:'Parcel support not loaded.' |
|
8620 |
] ifFalse:[ |
|
8621 |
Parcel loadParcelFrom: fileName pathName |
|
8622 |
] |
|
13968
45cdc56fd50a
Added support for filing-in .jar files.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13910
diff
changeset
|
8623 |
] ifFalse:[ (fileName hasSuffix:'jar') ifTrue:[ |
45cdc56fd50a
Added support for filing-in .jar files.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13910
diff
changeset
|
8624 |
JavaVM isNil ifTrue:[ |
45cdc56fd50a
Added support for filing-in .jar files.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13910
diff
changeset
|
8625 |
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
|
8626 |
^ self. |
45cdc56fd50a
Added support for filing-in .jar files.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13910
diff
changeset
|
8627 |
] ifFalse:[ |
45cdc56fd50a
Added support for filing-in .jar files.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13910
diff
changeset
|
8628 |
JavaVM booted ifFalse:[ |
45cdc56fd50a
Added support for filing-in .jar files.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13910
diff
changeset
|
8629 |
(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
|
8630 |
JavaVM boot. |
45cdc56fd50a
Added support for filing-in .jar files.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13910
diff
changeset
|
8631 |
]. |
45cdc56fd50a
Added support for filing-in .jar files.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13910
diff
changeset
|
8632 |
JavaVM loadClassesIn: fileName. |
45cdc56fd50a
Added support for filing-in .jar files.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13910
diff
changeset
|
8633 |
] |
4345 | 8634 |
] ifFalse:[ |
9299
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
8635 |
"/ ask programming languages... |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
8636 |
lang := ProgrammingLanguage allDetect:[:l | l canReadSourceFile:fileName] ifNone:nil. |
14360 | 8637 |
(lang isNil and:[(fileName hasSuffix:'js')]) ifTrue:[ |
14362 | 8638 |
Smalltalk loadPackage:'stx:libjavascript'. |
14360 | 8639 |
lang := ProgrammingLanguage allDetect:[:l | l canReadSourceFile:fileName] ifNone:nil. |
8640 |
]. |
|
9299
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
8641 |
(lang notNil and:[lang ~= SmalltalkLanguage]) ifTrue:[ |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
8642 |
lang fileIn:fileName. |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
8643 |
] ifFalse:[ |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
8644 |
"/ loading a regular (chunk) or xml source file |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
8645 |
Error handle:[:ex | |
15675 | 8646 |
self errorNotify:'Error during file in: ', ex description. |
15981 | 8647 |
ex resume. |
9299
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
8648 |
] do:[ |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
8649 |
aStream := fileName readStream. |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
8650 |
[ |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
8651 |
Class withoutUpdatingChangesDo:[ |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
8652 |
wasLazy := Compiler compileLazy:lazy. |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
8653 |
Smalltalk fileInStream:aStream. |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
8654 |
]. |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
8655 |
Class addInfoRecord:('fileIn ' , fileName asString) |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
8656 |
] ensure:[ |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
8657 |
Compiler compileLazy:wasLazy. |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
8658 |
aStream close |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
8659 |
] |
4345 | 8660 |
] |
8661 |
] |
|
13968
45cdc56fd50a
Added support for filing-in .jar files.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13910
diff
changeset
|
8662 |
]]]] |
4345 | 8663 |
]] |
6281
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8664 |
] 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
|
8665 |
|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
|
8666 |
|
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8667 |
isRedef := false. |
12684 | 8668 |
sig := ex creator. |
10887
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8669 |
(dontAskSignals notNil and:[dontAskSignals includesKey:sig]) ifTrue:[ |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8670 |
action := #continue |
6281
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8671 |
] ifFalse:[ |
10887
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8672 |
(sig == NoHandlerError and:[ex parameter rejected]) ifTrue:[ |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8673 |
ex reject |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8674 |
]. |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8675 |
sig == Class methodRedefinitionNotification ifTrue:[ |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8676 |
msg := 'trying to overwrite method:\\ ' , ex oldMethod whoString , '\\in package ''' |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8677 |
, ex oldPackage , ''' with method from package ''' , ex newPackage , ''''. |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8678 |
label := 'Method redefinition in fileIn'. |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8679 |
redefKind := 'method'. |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8680 |
isRedef := true. |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8681 |
] ifFalse:[sig == Class classRedefinitionNotification ifTrue:[ |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8682 |
msg := 'trying to redefine class: ' , ex oldClass name allBold , '\\in package ''' |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8683 |
, ex oldPackage , ''' with new definition from package ''' , ex newPackage , ''''. |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8684 |
label := 'Class redefinition in fileIn'. |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8685 |
redefKind := 'class'. |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8686 |
isRedef := true. |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8687 |
] ifFalse:[sig == HaltInterrupt ifTrue:[ |sender| |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8688 |
label := msg := 'Breakpoint/Halt in fileIn'. |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8689 |
sender := ex suspendedContext. |
18036 | 8690 |
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
|
8691 |
] ifFalse:[ |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8692 |
label := 'Error in fileIn'. |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8693 |
msg := 'error in fileIn: %1' |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8694 |
]]]. |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8695 |
|
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8696 |
msg := msg bindWith:ex description. |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8697 |
|
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8698 |
labels := #('Cancel' 'Skip' 'Debug' 'Compare Sources'). |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8699 |
values := #(abort skip debug compareSources). |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8700 |
|
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8701 |
isRedef ifTrue:[ |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8702 |
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
|
8703 |
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
|
8704 |
|
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8705 |
labels := labels , #('Keep Package' ). |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8706 |
values := values , #(keep). |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8707 |
]. |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8708 |
|
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8709 |
labels := labels , #( 'Continue' 'ContinueForAll'). |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8710 |
values := values , #( continue continueForAll). |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8711 |
|
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8712 |
AbortAllOperationWantedQuery query ifTrue:[ |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8713 |
labels := #('Cancel All') , labels. |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8714 |
values := #(cancelAll) , values. |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8715 |
]. |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8716 |
|
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8717 |
action := Dialog |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8718 |
choose:(msg withCRs) |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8719 |
label:label |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8720 |
image:(WarningBox iconBitmap) |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8721 |
labels:labels |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8722 |
values:values |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8723 |
default:#continue |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8724 |
onCancel:#abort. |
6281
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8725 |
]. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8726 |
|
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8727 |
action == #continueForAll ifTrue:[ |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8728 |
dontAskSignals isNil ifTrue:[ |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8729 |
dontAskSignals := IdentityDictionary new. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8730 |
]. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8731 |
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
|
8732 |
action := #continue. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8733 |
]. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8734 |
|
8887
f9ab42af84ff
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
8882
diff
changeset
|
8735 |
(action == #compareSources) ifTrue:[ |
f9ab42af84ff
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
8882
diff
changeset
|
8736 |
DiffCodeView |
f9ab42af84ff
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
8882
diff
changeset
|
8737 |
openOn:(ex oldMethod source) label:'Old Source' |
f9ab42af84ff
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
8882
diff
changeset
|
8738 |
and:(ex newMethod source) label:'New Source' |
f9ab42af84ff
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
8882
diff
changeset
|
8739 |
title:ex description. |
f9ab42af84ff
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
8882
diff
changeset
|
8740 |
ex resignalAs:ex |
f9ab42af84ff
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
8882
diff
changeset
|
8741 |
]. |
8082
40a926dc460d
On class/method redefinition allow the user to select both #keep and #continue
Stefan Vogel <sv@exept.de>
parents:
8068
diff
changeset
|
8742 |
(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
|
8743 |
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
|
8744 |
]. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8745 |
action == #abort ifTrue:[ |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8746 |
AbortOperationRequest raise. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8747 |
ex return |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8748 |
]. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8749 |
action == #cancelAll ifTrue:[ |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8750 |
AbortAllOperationRequest raise. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8751 |
ex return |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8752 |
]. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8753 |
action == #skip ifTrue:[ |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8754 |
ex proceedWith:nil |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8755 |
]. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8756 |
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
|
8757 |
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
|
8758 |
withMessage:ex description |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8759 |
mayProceed:true. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8760 |
ex proceedWith:nil. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8761 |
]. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8762 |
ex reject |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8763 |
] |
7040 | 8764 |
|
10887
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8765 |
"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
|
8766 |
"Modified: / 19-02-2014 / 12:49:33 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
4531 | 8767 |
! |
8768 |
||
4558 | 8769 |
splitFile:infile intoPiecesOfSize:kiloBytes |
8770 |
|bytesPerSplit splitIndex bufferSize buffer n |
|
8771 |
inStream outFile outStream remaining remainingInThisOutfile| |
|
8772 |
||
8773 |
bufferSize := 32*1024. |
|
8774 |
||
8775 |
inStream := infile readStream. |
|
8776 |
||
8777 |
bytesPerSplit := kiloBytes * 1024. |
|
8778 |
||
8779 |
remaining := infile fileSize. |
|
8780 |
splitIndex := 1. |
|
8781 |
[remaining > 0] whileTrue:[ |
|
8782 |
outFile := infile pathName , '_' , (splitIndex printString leftPaddedTo:3 with:$0). |
|
8783 |
outStream := outFile asFilename writeStream. |
|
8784 |
remainingInThisOutfile := remaining min:bytesPerSplit. |
|
8785 |
[remainingInThisOutfile > 0] whileTrue:[ |
|
8786 |
buffer := ByteArray new:bufferSize. |
|
8787 |
n := inStream |
|
8788 |
nextBytes:(bufferSize min:remainingInThisOutfile) |
|
8789 |
into:buffer |
|
8790 |
startingAt:1. |
|
8791 |
outStream nextPutBytes:n from:buffer startingAt:1. |
|
8792 |
remainingInThisOutfile := remainingInThisOutfile - n. |
|
8793 |
remaining := remaining - n. |
|
8794 |
]. |
|
8795 |
outStream close. |
|
8796 |
splitIndex := splitIndex + 1. |
|
8797 |
]. |
|
8798 |
inStream close. |
|
8799 |
! |
|
8800 |
||
15906 | 8801 |
splitFile:infile intoPiecesWithNumberOfLines:numberOfLines |
8802 |
|splitIndex line |
|
8803 |
inStream outFile outStream remainingLinesInThisOutfile| |
|
8804 |
||
8805 |
inStream := infile readStream. |
|
8806 |
||
8807 |
splitIndex := 1. |
|
8808 |
[inStream atEnd] whileFalse:[ |
|
8809 |
outFile := infile pathName , '_' , (splitIndex printString leftPaddedTo:3 with:$0). |
|
8810 |
outStream := outFile asFilename writeStream. |
|
8811 |
remainingLinesInThisOutfile := numberOfLines. |
|
8812 |
[(remainingLinesInThisOutfile > 0) and:[inStream atEnd not]] whileTrue:[ |
|
8813 |
line := inStream nextLine. |
|
15910 | 8814 |
outStream nextPutLine:line. |
15906 | 8815 |
remainingLinesInThisOutfile := remainingLinesInThisOutfile - 1. |
8816 |
]. |
|
8817 |
outStream close. |
|
8818 |
splitIndex := splitIndex + 1. |
|
8819 |
]. |
|
8820 |
inStream close. |
|
8821 |
! |
|
8822 |
||
4558 | 8823 |
splitSelectedFiles |
6264 | 8824 |
|selectedFiles numFiles msg sizeString kiloBytes| |
4558 | 8825 |
|
12871 | 8826 |
selectedFiles := self currentSelectedFiles. |
4558 | 8827 |
(numFiles := selectedFiles size) == 0 ifTrue:[^ self]. |
8828 |
||
6265 | 8829 |
msg := (numFiles > 1) |
8830 |
ifTrue:'Split each of the %1 files into pieces of size (in kB):' |
|
8831 |
ifFalse:'Split %2 into pieces of size (in kB):'. |
|
4558 | 8832 |
|
6352 | 8833 |
sizeString := Dialog request:(resources stringWithCRs:msg with:numFiles with:selectedFiles first baseName). |
6264 | 8834 |
sizeString isEmptyOrNil ifTrue:[^ self]. |
8835 |
kiloBytes := Integer readFrom:sizeString onError:nil. |
|
4558 | 8836 |
kiloBytes isNil ifTrue:[^ self]. |
8837 |
||
8838 |
selectedFiles do:[:fileName | |
|
8839 |
self notify:('Splitting:', fileName baseName). |
|
8840 |
fileName isDirectory ifFalse:[ |
|
8841 |
self splitFile:fileName intoPiecesOfSize:kiloBytes. |
|
8842 |
] |
|
8843 |
]. |
|
6190 | 8844 |
self notify:nil. |
6265 | 8845 |
|
7560 | 8846 |
"Modified: / 04-12-2006 / 13:15:26 / cg" |
4558 | 8847 |
! |
8848 |
||
15906 | 8849 |
splitSelectedFilesByLines |
8850 |
|selectedFiles numFiles msg numLinesString numLines| |
|
8851 |
||
8852 |
selectedFiles := self currentSelectedFiles. |
|
8853 |
(numFiles := selectedFiles size) == 0 ifTrue:[^ self]. |
|
8854 |
||
8855 |
msg := (numFiles > 1) |
|
8856 |
ifTrue:'Split each of the %1 files into pieces with number of lines:' |
|
8857 |
ifFalse:'Split %2 into pieces with number of lines:'. |
|
8858 |
||
8859 |
numLinesString := Dialog request:(resources stringWithCRs:msg with:numFiles with:selectedFiles first baseName). |
|
8860 |
numLinesString isEmptyOrNil ifTrue:[^ self]. |
|
8861 |
||
8862 |
numLines := Integer readFrom:numLinesString onError:nil. |
|
8863 |
numLines isNil ifTrue:[^ self]. |
|
8864 |
||
8865 |
selectedFiles do:[:fileName | |
|
8866 |
self notify:('Splitting:', fileName baseName). |
|
8867 |
fileName isDirectory ifFalse:[ |
|
8868 |
self splitFile:fileName intoPiecesWithNumberOfLines:numLines |
|
8869 |
] |
|
8870 |
]. |
|
8871 |
self notify:nil. |
|
8872 |
! |
|
8873 |
||
15211 | 8874 |
truncateSelectedFilesToZeroSize |
8875 |
|selectedFiles numFiles msg| |
|
8876 |
||
8877 |
selectedFiles := self currentSelectedObjects. |
|
8878 |
(numFiles := selectedFiles size) == 0 ifTrue:[^ self]. |
|
8879 |
||
8880 |
msg := 'Really truncate file ''%2'' to zero length ?\\WARNING: contents of file is lost !!\This cannot be undone.'. |
|
8881 |
numFiles > 1 ifTrue:[ |
|
8882 |
msg := 'Really truncate %1 files to zero length ?\\WARNING: contents of files is lost !!\This cannot be undone.'. |
|
8883 |
]. |
|
8884 |
||
8885 |
(Dialog |
|
8886 |
confirm:(resources stringWithCRs:msg with:numFiles with:selectedFiles first baseName allBold) |
|
8887 |
initialAnswer:false |
|
8888 |
) ifFalse:[ |
|
8889 |
^ self |
|
8890 |
]. |
|
8891 |
||
8892 |
selectedFiles do:[:fileName | |
|
8893 |
|s| |
|
8894 |
||
8895 |
self notify:('Truncating:', fileName baseName). |
|
8896 |
fileName isDirectory ifFalse:[ |
|
8897 |
[ |
|
8898 |
s := fileName writeStream. |
|
8899 |
s close. |
|
8900 |
] on:FileStream openErrorSignal do:[:ex| |
|
8901 |
self warn:('Cannot truncate "%1".' bindWith:fileName baseName allBold). |
|
8902 |
]. |
|
8903 |
] |
|
8904 |
]. |
|
8905 |
self notify:nil. |
|
8906 |
||
8907 |
"Modified: / 04-12-2006 / 13:15:28 / cg" |
|
8908 |
! ! |
|
3892 | 8909 |
|
4849 | 8910 |
!AbstractFileBrowser methodsFor:'menu queries-tools'! |
3892 | 8911 |
|
8912 |
anySTFilesPresent |
|
8913 |
^ self anyFilesPresentWithSuffix:'st' |
|
8914 |
! |
|
8915 |
||
8916 |
canCreateNewProject |
|
8917 |
self currentFilesAreInSameDirectory ifFalse:[^ false]. |
|
17865 | 8918 |
^ self currentSelectedFiles |
8919 |
contains:[:fileName| |
|
8920 |
| suffix| |
|
8921 |
suffix := fileName suffix asLowercase. |
|
8922 |
(suffix = 'prj' or:[suffix = 'st']) |
|
8923 |
] |
|
3892 | 8924 |
! |
8925 |
||
8926 |
canDoTerminal |
|
8927 |
||
8928 |
^ OperatingSystem isUNIXlike |
|
8929 |
or:[OperatingSystem isMSWINDOWSlike] |
|
8930 |
! |
|
8931 |
||
8932 |
canDoTerminalAndSystemIsDOS |
|
8933 |
||
8934 |
^ self canDoTerminal and:[OperatingSystem isMSWINDOWSlike] |
|
8935 |
! |
|
8936 |
||
8937 |
canDoTerminalAndSystemIsUnix |
|
8938 |
||
8939 |
^ self canDoTerminal and:[OperatingSystem isUNIXlike] |
|
8940 |
! |
|
8941 |
||
8640
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
8942 |
canGenerateSignatureFiles |
8645
00e4d07c6d6d
Generate signed expecco patch files
Stefan Vogel <sv@exept.de>
parents:
8641
diff
changeset
|
8943 |
"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
|
8944 |
|
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
8945 |
Expecco::KeyFileGenerator isNil ifTrue:[ ^ false ]. |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
8946 |
Expecco::KeyFile isNil ifTrue:[ ^ false ]. |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
8947 |
|
8645
00e4d07c6d6d
Generate signed expecco patch files
Stefan Vogel <sv@exept.de>
parents:
8641
diff
changeset
|
8948 |
^ self currentSelectedFiles notEmptyOrNil |
8640
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
8949 |
! |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
8950 |
|
12811 | 8951 |
canOpenMonticelloBrowser |
8952 |
^ self currentSelectedFiles |
|
8953 |
contains:[:fileName| |
|
8954 |
fileName suffix asLowercase = 'mcz' |
|
8955 |
] |
|
8956 |
! |
|
8957 |
||
3892 | 8958 |
canReadAbbrevFile |
8959 |
||
5960 | 8960 |
|currentDirectory| |
3892 | 8961 |
|
8962 |
self currentFilesAreInSameDirectory ifFalse:[^ false]. |
|
5960 | 8963 |
currentDirectory := self currentDirectory. |
8964 |
^ currentDirectory notNil |
|
8965 |
and:[ (currentDirectory construct:'abbrev.stc') exists ] |
|
3892 | 8966 |
! |
8967 |
||
8968 |
canRemoveFromSourcePath |
|
8969 |
||
8970 |
^ false |
|
8971 |
! |
|
8972 |
||
13089 | 8973 |
cannotGenerateSignatureFiles |
8974 |
^ self canGenerateSignatureFiles not |
|
8975 |
! |
|
8976 |
||
3892 | 8977 |
hasASN1 |
8978 |
^ [ OSI::ASN1Parser notNil |
|
4414 | 8979 |
and:[OSI::ASN1Parser isLoaded]] |
3892 | 8980 |
|
8981 |
! |
|
8982 |
||
8983 |
hasASN1AndSelection |
|
8984 |
^ [ self hasSelection value |
|
17416 | 8985 |
and:[self currentSelectedFiles notEmptyOrNil |
4414 | 8986 |
and:[OSI::ASN1Parser notNil |
8987 |
and:[OSI::ASN1Parser isLoaded]]]] |
|
17416 | 8988 |
|
8989 |
"Modified: / 17-02-2017 / 08:25:09 / cg" |
|
3892 | 8990 |
! |
8991 |
||
8992 |
hasCBrowser |
|
8993 |
^ [ CBrowser::Browser notNil ] |
|
8994 |
! |
|
8995 |
||
8996 |
hasJava |
|
8997 |
||
14298 | 8998 |
^ [ JavaVM notNil |
8999 |
and:[JavaClassReader notNil |
|
9000 |
and:[JavaClassReader isLoaded]]] |
|
3892 | 9001 |
! |
9002 |
||
9003 |
hasJavaAndSelection |
|
9004 |
||
12871 | 9005 |
^ [ self currentSelectedFiles notEmptyOrNil |
4414 | 9006 |
and:[JavaClassReader notNil |
9007 |
and:[JavaClassReader isLoaded]]] |
|
3892 | 9008 |
! |
9009 |
||
9010 |
hasMP3Player |
|
9011 |
||
9012 |
^ [ MP3PlayerApplication notNil |
|
4414 | 9013 |
or:[SaugFix::MP3PlayerApplication notNil ]] |
3892 | 9014 |
! |
9015 |
||
9016 |
hasMP3PlayerAndSelection |
|
9017 |
||
12871 | 9018 |
^ [ self currentSelectedFiles notEmptyOrNil |
4414 | 9019 |
and:[ self hasMP3Player value]] |
3892 | 9020 |
! |
9021 |
||
8426 | 9022 |
hasResourceFileSelected |
12871 | 9023 |
^ (self currentSelectedFiles) |
9024 |
contains:[:fn | |
|
12811 | 9025 |
fn suffix asLowercase = 'rs' |
9026 |
]. |
|
8426 | 9027 |
! |
9028 |
||
3892 | 9029 |
hasSlideShow |
9030 |
||
9031 |
^ [CodingExamples_GUI::SlideShow notNil] |
|
9032 |
! |
|
9033 |
||
9034 |
hasSnapshotSelection |
|
9035 |
||
9036 |
^ [ |
|
4414 | 9037 |
| files | |
8426 | 9038 |
|
4414 | 9039 |
files := self currentSelectedFiles. |
9040 |
((files size == 1) |
|
9041 |
and:[ files first hasSuffix:'img' ]) |
|
3892 | 9042 |
] |
9043 |
! |
|
9044 |
||
7869 | 9045 |
hasXml |
9206 | 9046 |
^ [ XML::XMLParser notNil ] |
7869 | 9047 |
! |
9048 |
||
9049 |
hasXmlFileSelected |
|
8611
3d979ab577b7
xml-inspector always enabled.
Claus Gittinger <cg@exept.de>
parents:
8601
diff
changeset
|
9050 |
"/ 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
|
9051 |
"/ then handle the error when it ever fails during xml-parsing. |
7869 | 9052 |
|
8426 | 9053 |
^ [ |
9054 |
|sel fileName| |
|
7869 | 9055 |
|
9056 |
sel := self currentSelectedFiles. |
|
9057 |
sel size == 1 ifTrue:[ |
|
9058 |
fileName := sel first. |
|
9059 |
fileName notNil ifTrue:[ |
|
15936 | 9060 |
#('xml' 'xsd' 'vdx') includes:fileName suffix asLowercase |
7869 | 9061 |
] ifFalse:[ |
9062 |
false |
|
9063 |
] |
|
9064 |
] ifFalse:[ |
|
9065 |
false |
|
9066 |
] |
|
9067 |
] |
|
9068 |
! |
|
9069 |
||
3892 | 9070 |
hasZipFileSelected |
17982 | 9071 |
|sel fileName suff mime| |
9764
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
9072 |
|
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
9073 |
sel := self currentSelectedFiles. |
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
9074 |
sel size == 1 ifFalse:[^ false]. |
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
9075 |
|
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
9076 |
fileName := sel first. |
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
9077 |
fileName isNil ifTrue:[^ false]. |
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
9078 |
|
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
9079 |
suff := fileName suffix asLowercase. |
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
9080 |
(suff = 'zip' or:[suff = 'jar']) ifTrue:[^ true]. |
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
9081 |
|
17982 | 9082 |
mime := fileName mimeTypeOfContents. |
9083 |
"/ prepare for change (iana has obsoleted the x- types) |
|
9084 |
^ (mime = 'application/x-zip-compressed') or:[mime = 'application/zip'] |
|
9764
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
9085 |
|
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
9086 |
"Modified: / 14-02-2011 / 17:17:03 / cg" |
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
9087 |
! |
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
9088 |
|
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
9089 |
hasZipFileSelectedHolder |
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
9090 |
^ [ self hasZipFileSelected ] |
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
9091 |
|
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
9092 |
"Created: / 14-02-2011 / 17:16:08 / cg" |
3892 | 9093 |
! |
9094 |
||
9095 |
javaSupportLoaded |
|
9096 |
||
9097 |
^ false |
|
9098 |
! ! |
|
9099 |
||
14126 | 9100 |
|
9101 |
||
3906 | 9102 |
!AbstractFileBrowser methodsFor:'presentation'! |
9103 |
||
9104 |
getModeString:modeBits |
|
9105 |
"convert file-mode bits into a more user-friendly string. |
|
9106 |
This is wrong here - should be moved into OperatingSystem." |
|
9107 |
||
9108 |
^ self getModeString:modeBits |
|
4414 | 9109 |
with:#( 'owner:' $r $w $x |
9110 |
' group:' $r $w $x |
|
9111 |
' others:' $r $w $x ) |
|
3906 | 9112 |
! |
9113 |
||
9114 |
getModeString:modeBits with:texts |
|
9115 |
"convert file-mode bits into a more user-friendly string. |
|
9116 |
This is wrong here - should be moved into OperatingSystem." |
|
9117 |
||
9118 |
|bits modeString| |
|
9119 |
||
9120 |
bits := modeBits bitAnd:8r777. |
|
9121 |
modeString := ''. |
|
9122 |
||
9123 |
#( nil 8r400 8r200 8r100 nil 8r040 8r020 8r010 nil 8r004 8r002 8r001 ) |
|
9124 |
with: texts do:[:bitMask :access | |
|
4414 | 9125 |
|ch| |
9126 |
||
9127 |
bitMask isNil ifTrue:[ |
|
9128 |
modeString := modeString , access |
|
9129 |
] ifFalse:[ |
|
9130 |
(bits bitAnd:bitMask) == 0 ifTrue:[ |
|
9131 |
ch := $- |
|
9132 |
] ifFalse:[ |
|
9133 |
ch := access |
|
9134 |
]. |
|
9135 |
modeString := modeString copyWith:ch |
|
9136 |
] |
|
3906 | 9137 |
]. |
9138 |
^ modeString |
|
9139 |
! ! |
|
9140 |
||
5880 | 9141 |
!AbstractFileBrowser methodsFor:'private'! |
9142 |
||
9143 |
theSingleSelectedDirectoryOrHomeDir |
|
9144 |
|dir| |
|
9145 |
||
5888 | 9146 |
dir := self theSingleSelectedDirectoryOrNil. |
5880 | 9147 |
dir isNil ifTrue:[ dir := Filename homeDirectory]. |
9148 |
^ dir. |
|
9149 |
! |
|
9150 |
||
9151 |
theSingleSelectedDirectoryOrNil |
|
9152 |
|dirs| |
|
9153 |
||
9154 |
dirs := self currentSelectedDirectories. |
|
9155 |
dirs size ~= 1 ifTrue:[ ^ nil]. |
|
9156 |
^ dirs anElement. |
|
14577 | 9157 |
! |
9158 |
||
9159 |
theSingleSelectedFileOrNil |
|
9160 |
|dirs| |
|
9161 |
||
9162 |
dirs := self currentSelectedFiles. |
|
9163 |
dirs size ~= 1 ifTrue:[ ^ nil]. |
|
9164 |
^ dirs anElement. |
|
5880 | 9165 |
! ! |
9166 |
||
3892 | 9167 |
!AbstractFileBrowser methodsFor:'queries'! |
9168 |
||
8256 | 9169 |
cBrowserLoaded |
9170 |
^ CBrowser::Browser notNil |
|
9171 |
! |
|
9172 |
||
10747
aa57b76e8318
added: #cBrowserMenuItemVisible
Claus Gittinger <cg@exept.de>
parents:
10678
diff
changeset
|
9173 |
cBrowserMenuItemVisible |
aa57b76e8318
added: #cBrowserMenuItemVisible
Claus Gittinger <cg@exept.de>
parents:
10678
diff
changeset
|
9174 |
^ self cBrowserLoaded or:[ OperatingSystem getLoginName = 'cg' ] |
aa57b76e8318
added: #cBrowserMenuItemVisible
Claus Gittinger <cg@exept.de>
parents:
10678
diff
changeset
|
9175 |
|
aa57b76e8318
added: #cBrowserMenuItemVisible
Claus Gittinger <cg@exept.de>
parents:
10678
diff
changeset
|
9176 |
"Created: / 04-10-2011 / 13:40:38 / cg" |
aa57b76e8318
added: #cBrowserMenuItemVisible
Claus Gittinger <cg@exept.de>
parents:
10678
diff
changeset
|
9177 |
! |
aa57b76e8318
added: #cBrowserMenuItemVisible
Claus Gittinger <cg@exept.de>
parents:
10678
diff
changeset
|
9178 |
|
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
9179 |
getAllFilesAsStrings |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
9180 |
"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
|
9181 |
|
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
9182 |
^ self subclassResponsibility |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
9183 |
! |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
9184 |
|
3906 | 9185 |
getFileInfoStringForFirstSelectedFile:longInfo |
9186 |
"get stat info on selected file - return a string which can be |
|
9187 |
shown in a box" |
|
9188 |
||
5973
0baf6c6b685f
#linkInfo now returns the info also for files that are not a symlink
Stefan Vogel <sv@exept.de>
parents:
5971
diff
changeset
|
9189 |
|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
|
9190 |
sizeString fileSize tAccess tModification buffer| |
3906 | 9191 |
|
7560 | 9192 |
selFiles := self currentSelectedObjects. |
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
9193 |
selFiles size ~~ 1 ifTrue:[ ^ nil]. |
3906 | 9194 |
filename := selFiles first. |
9195 |
||
8364 | 9196 |
info := filename linkInfo. |
9111
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
9197 |
info isNil ifTrue:[ |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
9198 |
^ 'Cannot get fileInfo'. |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
9199 |
^ nil |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
9200 |
]. |
8364 | 9201 |
|
5755
5e8165d55605
replaced '' writeStream by String writeStream
Claus Gittinger <cg@exept.de>
parents:
5753
diff
changeset
|
9202 |
buffer := Text writeStream. |
4765 | 9203 |
|
9204 |
buffer |
|
9205 |
nextPutAll:'filename: '; |
|
9206 |
nextPutLine:filename asString. |
|
9207 |
||
8364 | 9208 |
OperatingSystem isMSDOSlike ifTrue: [ |
9209 |
(info alternativeName notNil |
|
9210 |
and:[ info alternativeName ~= info fullName ]) ifTrue:[ |
|
9211 |
buffer nextPutAll:'shortname: '. |
|
9212 |
buffer nextPutLine:info alternativeName. |
|
9213 |
] |
|
9214 |
]. |
|
9215 |
||
5360
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
9216 |
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
|
9217 |
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
|
9218 |
filename exists ifFalse:[ |
5360
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
9219 |
buffer nextPutAll:'broken '. |
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
9220 |
]. |
4765 | 9221 |
buffer |
9222 |
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
|
9223 |
nextPutLine:(info path ? '???'). |
3906 | 9224 |
] 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
|
9225 |
(longInfo and:[info isRegular]) ifTrue:[ |
5360
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
9226 |
fileOutput := filename fileType. |
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
9227 |
]. |
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
9228 |
|
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
9229 |
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
|
9230 |
s := info type asString |
5360
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
9231 |
] ifFalse:[ |
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
9232 |
s := 'regular (' , fileOutput , ')' |
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
9233 |
]. |
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
9234 |
buffer nextPutLine:s. |
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
9235 |
]. |
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
9236 |
|
4707
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
9237 |
fileSize := info fileSize. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
9238 |
sizeString := 'size: ', fileSize printString. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
9239 |
longInfo ifTrue:[ |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
9240 |
fileSize > 1024 ifTrue:[ |
8172 | 9241 |
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
|
9242 |
]. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
9243 |
]. |
4765 | 9244 |
buffer nextPutLine:sizeString. |
3906 | 9245 |
|
9246 |
modeBits := info mode. |
|
9247 |
modeString := self getModeString:modeBits. |
|
4765 | 9248 |
|
9249 |
buffer nextPutAll:'access: '; nextPutAll:modeString. |
|
3906 | 9250 |
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
|
9251 |
buffer nextPutAll:' ('; nextPutAll:(modeBits printStringRadix:8); nextPut:$). |
3906 | 9252 |
]. |
4765 | 9253 |
buffer |
9254 |
cr; |
|
9255 |
nextPutAll:'owner: '; |
|
9256 |
nextPutLine:(OperatingSystem getUserNameFromID:(info uid)). |
|
9257 |
||
3906 | 9258 |
longInfo ifTrue:[ |
4765 | 9259 |
buffer |
9260 |
nextPutAll:'group: '; |
|
9261 |
nextPutLine:(OperatingSystem getGroupNameFromID:(info gid)). |
|
9262 |
||
9263 |
tAccess := info accessTime. |
|
9264 |
buffer |
|
9265 |
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
|
9266 |
nextPutAll:tAccess asDate printString; |
4765 | 9267 |
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
|
9268 |
nextPutLine:tAccess asTime printString. |
4765 | 9269 |
|
9270 |
tModification := info modificationTime. |
|
9271 |
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
|
9272 |
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
|
9273 |
nextPutAll:tModification asDate printString; |
4765 | 9274 |
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
|
9275 |
nextPutLine:tModification asTime printString. |
3906 | 9276 |
]. |
4765 | 9277 |
^ buffer contents |
7560 | 9278 |
|
7633
0a85c590f98f
ignore nil-return from get link name (for broken links)
Claus Gittinger <cg@exept.de>
parents:
7585
diff
changeset
|
9279 |
"Modified: / 07-02-2007 / 10:38:14 / cg" |
3906 | 9280 |
! |
9281 |
||
8510 | 9282 |
hasImageColorHistogram |
9283 |
^ ImageColorHistogram notNil |
|
9284 |
! |
|
9285 |
||
17686 | 9286 |
hasImageHistogram |
9287 |
^ ImageAlgorithms notNil |
|
9288 |
||
9289 |
"Created: / 10-09-2017 / 16:50:34 / cg" |
|
9290 |
! |
|
9291 |
||
10258 | 9292 |
hasSubversionSupport |
11156
11c0b4cbc836
Use Configurable includesFeature:#Feature instead of direct send of #hasFeature
vrany
parents:
11149
diff
changeset
|
9293 |
^ ConfigurableFeatures includesFeature: #SubversionSupport |
10258 | 9294 |
|
9295 |
"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
|
9296 |
"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
|
9297 |
"Modified: / 19-01-2012 / 10:43:37 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
10258 | 9298 |
! |
9299 |
||
3892 | 9300 |
initialCommandFor:fileName into:aBox |
9301 |
"set a useful initial command for execute box." |
|
9302 |
||
4496
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
9303 |
self class initialCommandFor:fileName in:Filename currentDirectory intoBox:aBox |
3892 | 9304 |
! |
9305 |
||
9306 |
isAbstractFileBrowser |
|
9307 |
||
9308 |
^ true |
|
9309 |
! |
|
9310 |
||
9311 |
systemIsDOS |
|
9312 |
^ OperatingSystem isMSDOSlike |
|
9313 |
! |
|
9314 |
||
12473 | 9315 |
systemIsOSX |
9316 |
^ OperatingSystem isOSXlike |
|
9317 |
! |
|
9318 |
||
3892 | 9319 |
systemIsUnix |
9320 |
^ OperatingSystem isUNIXlike |
|
14980 | 9321 |
! |
9322 |
||
9323 |
systemSupportsVolumes |
|
9324 |
^ OperatingSystem supportsVolumes |
|
3892 | 9325 |
! ! |
9326 |
||
9327 |
!AbstractFileBrowser methodsFor:'queries-file'! |
|
9328 |
||
9329 |
allItemsOfCurrentDirectory |
|
5009 | 9330 |
self |
4774 | 9331 |
applicationNamed:#DirectoryContentsBrowser |
5009 | 9332 |
ifPresentDo:[:app | ^ app allItemsOfCurrentDirectory]. |
9333 |
||
9334 |
^ nil |
|
3892 | 9335 |
! |
9336 |
||
9337 |
anyFilesPresentWithSuffix:suffix |
|
6725 | 9338 |
self currentSelectedDirectories do:[:dir| |
4636
08b2b63e3107
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4629
diff
changeset
|
9339 |
[ |
5810
4661bf4c3bbf
openErrorSignal arg: always a string
Claus Gittinger <cg@exept.de>
parents:
5789
diff
changeset
|
9340 |
(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
|
9341 |
] on:FileStream openErrorSignal do:[:ex|]. |
3892 | 9342 |
]. |
9343 |
^ false. |
|
9344 |
! |
|
9345 |
||
4771
9290fdb65a5d
#getCommonForCurrentFiles renamed to #commonPrefixOfSelectedFiles
Claus Gittinger <cg@exept.de>
parents:
4769
diff
changeset
|
9346 |
commonPrefixOfSelectedFiles |
4773 | 9347 |
|selFiles stringCol firstPre| |
4771
9290fdb65a5d
#getCommonForCurrentFiles renamed to #commonPrefixOfSelectedFiles
Claus Gittinger <cg@exept.de>
parents:
4769
diff
changeset
|
9348 |
|
7560 | 9349 |
selFiles := self currentSelectedObjects. |
4771
9290fdb65a5d
#getCommonForCurrentFiles renamed to #commonPrefixOfSelectedFiles
Claus Gittinger <cg@exept.de>
parents:
4769
diff
changeset
|
9350 |
selFiles isEmpty ifTrue:[^ nil]. |
9290fdb65a5d
#getCommonForCurrentFiles renamed to #commonPrefixOfSelectedFiles
Claus Gittinger <cg@exept.de>
parents:
4769
diff
changeset
|
9351 |
|
17865 | 9352 |
stringCol := selFiles collect:#asString. |
4773 | 9353 |
firstPre := stringCol at:1. |
4771
9290fdb65a5d
#getCommonForCurrentFiles renamed to #commonPrefixOfSelectedFiles
Claus Gittinger <cg@exept.de>
parents:
4769
diff
changeset
|
9354 |
stringCol from:2 do:[:el| |
4773 | 9355 |
firstPre := firstPre commonPrefixWith:el. |
4771
9290fdb65a5d
#getCommonForCurrentFiles renamed to #commonPrefixOfSelectedFiles
Claus Gittinger <cg@exept.de>
parents:
4769
diff
changeset
|
9356 |
]. |
4773 | 9357 |
^ firstPre asFilename |
7560 | 9358 |
|
9359 |
"Modified: / 04-12-2006 / 13:14:25 / cg" |
|
4771
9290fdb65a5d
#getCommonForCurrentFiles renamed to #commonPrefixOfSelectedFiles
Claus Gittinger <cg@exept.de>
parents:
4769
diff
changeset
|
9360 |
! |
9290fdb65a5d
#getCommonForCurrentFiles renamed to #commonPrefixOfSelectedFiles
Claus Gittinger <cg@exept.de>
parents:
4769
diff
changeset
|
9361 |
|
12481 | 9362 |
compressTabsOnSave |
9363 |
"if true, compress leading spaces (multiples of 8) with a tab character |
|
9364 |
when saving. |
|
9365 |
Default is true" |
|
9366 |
||
9367 |
^ true |
|
9368 |
! |
|
9369 |
||
3892 | 9370 |
currentFilesAreInSameDirectory |
9371 |
||
4881
e6fc72aac6e6
multiple select allowed in DirectoryTreeBrowser some changes in DirectoryContentsBrowser
penk
parents:
4880
diff
changeset
|
9372 |
^ self parentDirectoriesOfCurrentFiles size < 2 |
3892 | 9373 |
! |
9374 |
||
9375 |
currentFilesHasDirectories |
|
9376 |
||
6725 | 9377 |
^ self currentSelectedDirectories notEmpty. |
3892 | 9378 |
! |
9379 |
||
3982 | 9380 |
directoriesForFiles:aFileCol |
11743 | 9381 |
^ aFileCol collect:[:file| self getDirWithoutFileName:file] as:Set. |
3982 | 9382 |
! |
9383 |
||
3892 | 9384 |
fileListIsEmpty |
5009 | 9385 |
self |
9386 |
applicationNamed:#DirectoryContentsBrowser |
|
9387 |
ifPresentDo:[:appl | ^ appl fileListIsEmpty]. |
|
9388 |
||
9389 |
^ nil. |
|
3892 | 9390 |
! |
9391 |
||
9392 |
fileListIsNotEmpty |
|
9393 |
||
9394 |
^ self fileListIsEmpty not. |
|
9395 |
! |
|
9396 |
||
9397 |
fileName:aFilename1 startsWith:aFilename2 |
|
6284 | 9398 |
" check if aFilename2 is a prefix of aFilename1" |
3892 | 9399 |
|
9400 |
| file1 file2 | |
|
9401 |
||
6284 | 9402 |
(aFilename2 isNil or:[aFilename1 isNil]) ifTrue:[ ^ false]. |
3892 | 9403 |
file1 := aFilename1 asFilename. |
9404 |
file2 := aFilename2 asFilename. |
|
6284 | 9405 |
|
3892 | 9406 |
file2 isRootDirectory ifTrue:[ ^ true]. |
6284 | 9407 |
|
3892 | 9408 |
((file1 isDirectory) |
9409 |
and:[(file2 isDirectory) |
|
9410 |
and:[file1 directory = file2 directory]]) ifTrue:[ |
|
4414 | 9411 |
^ file1 baseName = file2 baseName |
3892 | 9412 |
]. |
3982 | 9413 |
^ (file1 pathName) startsWith:(file2 pathName) |
3892 | 9414 |
! |
9415 |
||
9416 |
getAllFilesAsStringCollection |
|
5009 | 9417 |
self |
9418 |
applicationNamed:#DirectoryContentsBrowser |
|
9419 |
ifPresentDo:[:appl | ^ appl getAllFilesAsStringCollection]. |
|
9420 |
||
9421 |
^ nil |
|
3892 | 9422 |
! |
9423 |
||
9424 |
getBestDirectory |
|
17868 | 9425 |
"from a set of directories, return the common parent directory" |
9426 |
||
9427 |
^ self class getBestDirectoryFrom:(self currentSelectedDirectories) |
|
3892 | 9428 |
! |
9429 |
||
9430 |
getDirWithoutFileName:aFileName |
|
9431 |
||
9432 |
| dir | |
|
9433 |
aFileName isNil ifTrue:[ |
|
4414 | 9434 |
^ aFileName. |
3892 | 9435 |
]. |
9436 |
dir := aFileName asFilename. |
|
9437 |
dir isDirectory ifFalse:[ |
|
4414 | 9438 |
dir := dir directory. |
3892 | 9439 |
]. |
9440 |
^ dir. |
|
9441 |
! |
|
9442 |
||
9443 |
getInfoItem |
|
9444 |
"get filename of a description-file (.dir.info, README etc.); |
|
16778 | 9445 |
This file is automatically shown when a directory is entered. |
3892 | 9446 |
You can add more names below if you like." |
9447 |
||
5880 | 9448 |
|dir| |
9449 |
||
9450 |
dir := self theSingleSelectedDirectoryOrNil. |
|
9451 |
dir isNil ifTrue:[ ^ nil]. |
|
3892 | 9452 |
|
16778 | 9453 |
#( |
3892 | 9454 |
'.dir.info' |
9455 |
'README' |
|
9456 |
'ReadMe' |
|
9457 |
'Readme' |
|
9458 |
'readme' |
|
9459 |
'read.me' |
|
9460 |
'Read.me' |
|
9461 |
'READ.ME' |
|
9462 |
'README.TXT' |
|
15915 | 9463 |
'README.txt' |
3892 | 9464 |
'readme.txt' |
9465 |
'Readme.txt' |
|
9466 |
'Info.txt' |
|
9467 |
'info.txt' |
|
9468 |
'INFO.TXT' |
|
15915 | 9469 |
'INFO.txt' |
16778 | 9470 |
) do:[:f | |
5883 | 9471 |
|n| |
4414 | 9472 |
|
5880 | 9473 |
n := dir construct:f. |
4414 | 9474 |
(n isReadable and:[n isDirectory not]) ifTrue:[ |
9475 |
^ DirectoryContentsBrowser itemClass fileName:n |
|
9476 |
] |
|
3892 | 9477 |
]. |
9478 |
^ nil |
|
4881
e6fc72aac6e6
multiple select allowed in DirectoryTreeBrowser some changes in DirectoryContentsBrowser
penk
parents:
4880
diff
changeset
|
9479 |
! |
e6fc72aac6e6
multiple select allowed in DirectoryTreeBrowser some changes in DirectoryContentsBrowser
penk
parents:
4880
diff
changeset
|
9480 |
|
12497 | 9481 |
hasPackageDirectorySelected |
9482 |
|dir| |
|
9483 |
||
9484 |
dir := self currentDirectory. |
|
9485 |
^ dir notNil |
|
9486 |
and:[ dir exists |
|
9487 |
and:[ (dir / 'abbrev.stc') exists ]] |
|
9488 |
! |
|
9489 |
||
4881
e6fc72aac6e6
multiple select allowed in DirectoryTreeBrowser some changes in DirectoryContentsBrowser
penk
parents:
4880
diff
changeset
|
9490 |
parentDirectoriesOfCurrentFiles |
11743 | 9491 |
^ self currentSelectedObjects |
9492 |
collect:[:file | file directory] as:Set |
|
7560 | 9493 |
|
9494 |
"Modified: / 04-12-2006 / 13:15:21 / cg" |
|
6521 | 9495 |
! |
9496 |
||
9497 |
recursiveAnyFilesPresentWithSuffix:suffix |
|
6652 | 9498 |
^ true. "/ the code below is too slow for a menu enabling operation |
9499 |
||
9500 |
"/ |directories| |
|
9501 |
"/ |
|
9502 |
"/ directories := self currentDirectories value. |
|
9503 |
"/ directories do:[:dir| |
|
9504 |
"/ [ |
|
9505 |
"/ dir recursiveDirectoryContentsDo:[:f | |
|
9506 |
"/ (f asFilename suffix = suffix) ifTrue:[ ^ true] |
|
9507 |
"/ ] |
|
9508 |
"/ ] on:FileStream openErrorSignal do:[:ex|]. |
|
9509 |
"/ ]. |
|
9510 |
"/ ^ false. |
|
6586 | 9511 |
! |
9512 |
||
9513 |
recursiveAnySTFilesPresent |
|
9514 |
^ self recursiveAnyFilesPresentWithSuffix:'st' |
|
3982 | 9515 |
! ! |
9516 |
||
9517 |
!AbstractFileBrowser methodsFor:'selection'! |
|
9518 |
||
9519 |
currentSelectedDirectories |
|
6725 | 9520 |
^ self currentDirectoriesValue. |
3982 | 9521 |
! |
9522 |
||
9523 |
currentSelectedFiles |
|
17865 | 9524 |
^ self currentSelectedObjects reject:#isDirectory. |
7560 | 9525 |
|
9526 |
"Modified: / 04-12-2006 / 13:14:39 / cg" |
|
3982 | 9527 |
! |
9528 |
||
6460 | 9529 |
currentSelectedObjects |
9530 |
^ self currentFileNameHolder value |
|
9531 |
! |
|
9532 |
||
3982 | 9533 |
firstSelectedFile |
7560 | 9534 |
^ self currentSelectedObjects |
12102 | 9535 |
detect:[:file | (file ? '') asFilename isDirectory not] |
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
9536 |
ifNone:[]. |
7560 | 9537 |
|
9538 |
"Modified: / 04-12-2006 / 13:14:50 / cg" |
|
4414 | 9539 |
! |
9540 |
||
9490 | 9541 |
hasOnlyDirectoriesSelected |
9542 |
^ self currentSelectedObjects conform:[:file | file isDirectory]. |
|
9543 |
||
9544 |
"Created: / 20-05-2010 / 10:45:03 / cg" |
|
9545 |
! |
|
9546 |
||
4414 | 9547 |
hasOnlyFilesSelected |
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
9548 |
|
7560 | 9549 |
^ self currentSelectedObjects conform:[:file | file isDirectory not]. |
9550 |
||
9551 |
"Modified: / 04-12-2006 / 13:15:01 / cg" |
|
4414 | 9552 |
! |
9553 |
||
9490 | 9554 |
hasTwoDirectoriesSelected |
9555 |
||
9556 |
^ self currentSelectedObjects size == 2 |
|
9557 |
and:[self hasOnlyDirectoriesSelected] |
|
9558 |
||
9559 |
"Created: / 20-05-2010 / 10:45:18 / cg" |
|
9560 |
! |
|
9561 |
||
4414 | 9562 |
hasTwoFilesSelected |
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
9563 |
|
7560 | 9564 |
^ self currentSelectedObjects size == 2 |
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
9565 |
and:[self hasOnlyFilesSelected] |
7560 | 9566 |
|
9567 |
"Modified: / 04-12-2006 / 13:15:04 / cg" |
|
14577 | 9568 |
! |
9569 |
||
9570 |
selectNextFile |
|
9571 |
self |
|
9572 |
applicationNamed:#DirectoryContentsBrowser |
|
9573 |
ifPresentDo:[:appl | appl ~~ self ifTrue:[ appl selectNextFile ]]. |
|
9574 |
! |
|
9575 |
||
9576 |
selectPreviousFile |
|
9577 |
self |
|
9578 |
applicationNamed:#DirectoryContentsBrowser |
|
9579 |
ifPresentDo:[:appl | appl ~~ self ifTrue:[ appl selectPreviousFile ]]. |
|
3892 | 9580 |
! ! |
9581 |
||
3964 | 9582 |
!AbstractFileBrowser methodsFor:'sorting'! |
9583 |
||
3989 | 9584 |
currentSortOrder |
17790 | 9585 |
^ self |
9586 |
aspectFor:#currentSortOrder |
|
9587 |
ifAbsent:[ |
|
9588 |
(Dictionary new |
|
9589 |
at:#column put:nil; |
|
9590 |
at:#reverse put:false; |
|
9591 |
at:#sortCaseless put:false; |
|
9592 |
yourself |
|
9593 |
) asValue |
|
9594 |
]. |
|
9595 |
||
9596 |
"Modified: / 25-11-2017 / 17:43:00 / cg" |
|
3989 | 9597 |
! |
9598 |
||
9599 |
sortBlockHolder |
|
9600 |
^ self aspectFor:#sortBlockHolder ifAbsent:[ |
|
5383 | 9601 |
(FileSorter directoriesBeforeFiles:(self sortDirectoriesBeforeFiles value and:[self viewDirsInContentsBrowser value]) |
9602 |
selector:#fileName |
|
9603 |
sortCaseless:self sortCaseless value |
|
9604 |
sortReverse:false) asValue. |
|
3989 | 9605 |
]. |
9606 |
! |
|
9607 |
||
9608 |
sortBlockProperty |
|
6785
cac8107d889c
clear reverseSort flag, when sort-order is changed via menu.
Claus Gittinger <cg@exept.de>
parents:
6767
diff
changeset
|
9609 |
|v| |
4027 | 9610 |
|
6785
cac8107d889c
clear reverseSort flag, when sort-order is changed via menu.
Claus Gittinger <cg@exept.de>
parents:
6767
diff
changeset
|
9611 |
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
|
9612 |
v addDependent:self. |
cac8107d889c
clear reverseSort flag, when sort-order is changed via menu.
Claus Gittinger <cg@exept.de>
parents:
6767
diff
changeset
|
9613 |
^ v. |
3989 | 9614 |
! |
9615 |
||
9616 |
sortCaseless |
|
4201 | 9617 |
" aspect for sort caseless " |
3989 | 9618 |
|
13000 | 9619 |
^ self |
9620 |
aspectFor:#sortCaseless |
|
9621 |
ifAbsent:[ (Filename isCaseSensitive not) asValue ] |
|
3989 | 9622 |
! |
9623 |
||
4074 | 9624 |
sortDirectoriesBeforeFiles |
9625 |
||
4201 | 9626 |
" aspect for sort directories always before files" |
4074 | 9627 |
^ self aspectFor:#sortDirectoriesBeforeFiles ifAbsent:[ true asValue ]. |
9628 |
! |
|
9629 |
||
3989 | 9630 |
sortFileListsBy:instanceName |
9631 |
||
9632 |
self sortFileListsBy:instanceName withReverse:true |
|
9633 |
! |
|
9634 |
||
9635 |
sortFileListsBy:instanceName withReverse:aBoolean |
|
8994
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
9636 |
| aSymbol sortCaselessLocal currentSortOrder sorter isReverse| |
3964 | 9637 |
|
9638 |
aSymbol := instanceName asSymbol. |
|
4027 | 9639 |
self sortBlockProperty setValue:instanceName asSymbol. |
4151 | 9640 |
sortCaselessLocal := self sortCaseless value. |
4027 | 9641 |
currentSortOrder := self currentSortOrder value. |
17790 | 9642 |
|
7841
ea9a45f1cd5e
oops - repair bad currentSorter
Claus Gittinger <cg@exept.de>
parents:
7829
diff
changeset
|
9643 |
currentSortOrder isEmptyOrNil ifTrue:[ |
ea9a45f1cd5e
oops - repair bad currentSorter
Claus Gittinger <cg@exept.de>
parents:
7829
diff
changeset
|
9644 |
self currentSortOrder value:(currentSortOrder := Dictionary new). |
4343 | 9645 |
currentSortOrder at:#column put:aSymbol. |
9646 |
currentSortOrder at:#reverse put:false. |
|
9647 |
currentSortOrder at:#sortCaseless put:sortCaselessLocal. |
|
3964 | 9648 |
] ifFalse:[ |
4343 | 9649 |
(currentSortOrder at:#sortCaseless) ~= sortCaselessLocal ifTrue:[ |
9650 |
"/ sort caseless changed |
|
9651 |
currentSortOrder at:#sortCaseless put:sortCaselessLocal. |
|
9652 |
] ifFalse:[ |
|
9653 |
(currentSortOrder at:#column) = aSymbol ifTrue:[ |
|
9654 |
"/ same column like before - change sort order ifReverse is true |
|
9655 |
aBoolean ifTrue:[ |
|
9656 |
isReverse := currentSortOrder at:#reverse. |
|
9657 |
currentSortOrder at:#reverse put:(isReverse not). |
|
9658 |
]. |
|
9659 |
] ifFalse:[ |
|
9660 |
"/ another column - remark column |
|
9661 |
currentSortOrder at:#column put:aSymbol. |
|
9662 |
] |
|
9663 |
] |
|
3964 | 9664 |
]. |
4027 | 9665 |
self currentSortOrder changed. |
9111
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
9666 |
|
5383 | 9667 |
sorter := FileSorter directoriesBeforeFiles:(self sortDirectoriesBeforeFiles value and:[self viewDirsInContentsBrowser value]) |
9668 |
selector:instanceName |
|
9669 |
sortCaseless:sortCaselessLocal |
|
9670 |
sortReverse:(currentSortOrder at:#reverse). |
|
9671 |
self sortBlockHolder value:sorter. |
|
7841
ea9a45f1cd5e
oops - repair bad currentSorter
Claus Gittinger <cg@exept.de>
parents:
7829
diff
changeset
|
9672 |
|
ea9a45f1cd5e
oops - repair bad currentSorter
Claus Gittinger <cg@exept.de>
parents:
7829
diff
changeset
|
9673 |
"Modified: / 18-09-2007 / 09:42:47 / cg" |
17790 | 9674 |
"Modified (format): / 25-11-2017 / 17:43:31 / cg" |
3964 | 9675 |
! ! |
9676 |
||
3892 | 9677 |
!AbstractFileBrowser methodsFor:'startup & release'! |
9678 |
||
16720 | 9679 |
initializeAspects |
9680 |
aspects := IdentityDictionary new. |
|
9681 |
aspects at:#applications put:(IdentityDictionary new). |
|
9682 |
! |
|
9683 |
||
3892 | 9684 |
makeDependent |
4074 | 9685 |
self filterModel addDependent:self. |
4004 | 9686 |
self currentFileNameHolder addDependent:self. |
4074 | 9687 |
self sortDirectoriesBeforeFiles addDependent:self. |
4004 | 9688 |
self sortCaseless addDependent:self. |
4011 | 9689 |
self showHiddenFiles addDependent:self. |
4368
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
9690 |
self rootHolder addDependent:self. |
3892 | 9691 |
! |
9692 |
||
9693 |
masterApplication:anApplication |
|
9694 |
||
9695 |
masterApplication isNil ifTrue:[ |
|
4414 | 9696 |
(anApplication notNil and:[anApplication askFor:#isAbstractFileBrowser]) ifTrue:[ |
9697 |
aspects := anApplication aspects |
|
9698 |
] ifFalse:[ |
|
9699 |
aspects isNil ifTrue:[ |
|
16721 | 9700 |
self initializeAspects. |
4414 | 9701 |
] |
9702 |
]. |
|
9703 |
self applications at:(self className) put:self. |
|
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
9704 |
"/ self makeDependent. |
3892 | 9705 |
]. |
3952 | 9706 |
^ super masterApplication:anApplication. |
3892 | 9707 |
! |
9708 |
||
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
9709 |
postBuildWith:aBuilder |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
9710 |
self makeDependent. |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
9711 |
super postBuildWith:aBuilder. |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
9712 |
! |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
9713 |
|
3892 | 9714 |
postOpenWith:aBuilder |
9715 |
||
9716 |
super postOpenWith:aBuilder. |
|
14655 | 9717 |
"/ now done for all windowGroups by the group itself |
9718 |
"/ self windowGroup showWaitCursorWhenBusyForMillis:100. |
|
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
9719 |
|
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
9720 |
"Modified: / 25-07-2006 / 09:12:45 / cg" |
3892 | 9721 |
! ! |
9722 |
||
9723 |
!AbstractFileBrowser::Clipboard methodsFor:'accessing'! |
|
9724 |
||
9725 |
files |
|
9726 |
"return the value of the instance variable 'files' (automatically generated)" |
|
9727 |
||
9728 |
^ files |
|
9729 |
! |
|
9730 |
||
9731 |
files:something |
|
9732 |
"set the value of the instance variable 'files' (automatically generated)" |
|
9733 |
||
9734 |
files := something. |
|
9735 |
! |
|
9736 |
||
9737 |
method |
|
9738 |
"return the value of the instance variable 'method' (automatically generated)" |
|
9739 |
||
9740 |
^ method |
|
9741 |
! |
|
9742 |
||
9743 |
method:something |
|
9744 |
"set the value of the instance variable 'method' (automatically generated)" |
|
9745 |
||
9746 |
method := something. |
|
9747 |
! ! |
|
9748 |
||
9749 |
!AbstractFileBrowser::CodeExecutionLock methodsFor:'accessing'! |
|
9750 |
||
9751 |
locked |
|
9752 |
"return the value of the instance variable 'locked' (automatically generated)" |
|
9753 |
||
9754 |
locked isNil ifTrue:[ |
|
4414 | 9755 |
locked := false. |
3892 | 9756 |
]. |
9757 |
^ locked |
|
9758 |
! ! |
|
9759 |
||
9760 |
!AbstractFileBrowser::CodeExecutionLock methodsFor:'actions'! |
|
9761 |
||
9762 |
doIfUnLocked:aBlock |
|
9763 |
||
9764 |
self locked ifFalse:[ |
|
4414 | 9765 |
aBlock value. |
3892 | 9766 |
]. |
9767 |
! |
|
9768 |
||
9769 |
doLocked:aBlock |
|
9770 |
||
9771 |
locked := true. |
|
4004 | 9772 |
aBlock ensure:[ |
4414 | 9773 |
locked := false. |
4004 | 9774 |
] |
3892 | 9775 |
! ! |
9776 |
||
3952 | 9777 |
!AbstractFileBrowser::DirectoryHistory class methodsFor:'defaults'! |
9778 |
||
6369 | 9779 |
defaultHistorySize |
9780 |
^ 50 |
|
3892 | 9781 |
! ! |
9782 |
||
6371 | 9783 |
!AbstractFileBrowser::DirectoryHistory class methodsFor:'instance creation'! |
4032 | 9784 |
|
9785 |
new |
|
6371 | 9786 |
^ (super new) initializeHistory. |
6369 | 9787 |
! ! |
9788 |
||
9789 |
!AbstractFileBrowser::DirectoryHistory methodsFor:'accessing'! |
|
9790 |
||
9791 |
historySize |
|
9792 |
historySize isNil ifTrue:[^ self class defaultHistorySize]. |
|
9793 |
^ historySize |
|
9794 |
! |
|
9795 |
||
9796 |
historySize:aNumber |
|
9797 |
historySize := aNumber |
|
4032 | 9798 |
! ! |
9799 |
||
3892 | 9800 |
!AbstractFileBrowser::DirectoryHistory methodsFor:'actions'! |
9801 |
||
3952 | 9802 |
addToHistory:aPath |
15803 | 9803 |
| item pathToAdd sep| |
7566
3e92cf7a6706
ignore trailing file-separator in history.
Claus Gittinger <cg@exept.de>
parents:
7565
diff
changeset
|
9804 |
|
3e92cf7a6706
ignore trailing file-separator in history.
Claus Gittinger <cg@exept.de>
parents:
7565
diff
changeset
|
9805 |
pathToAdd := aPath. |
15803 | 9806 |
(pathToAdd endsWith:(sep := Filename separator)) ifTrue:[ |
7566
3e92cf7a6706
ignore trailing file-separator in history.
Claus Gittinger <cg@exept.de>
parents:
7565
diff
changeset
|
9807 |
pathToAdd asFilename isRootDirectory ifFalse:[ |
15803 | 9808 |
pathToAdd := pathToAdd copyButLast:(sep asString size). |
7566
3e92cf7a6706
ignore trailing file-separator in history.
Claus Gittinger <cg@exept.de>
parents:
7565
diff
changeset
|
9809 |
] |
3e92cf7a6706
ignore trailing file-separator in history.
Claus Gittinger <cg@exept.de>
parents:
7565
diff
changeset
|
9810 |
]. |
3e92cf7a6706
ignore trailing file-separator in history.
Claus Gittinger <cg@exept.de>
parents:
7565
diff
changeset
|
9811 |
|
3e92cf7a6706
ignore trailing file-separator in history.
Claus Gittinger <cg@exept.de>
parents:
7565
diff
changeset
|
9812 |
item := self getItemFor:pathToAdd. |
3e92cf7a6706
ignore trailing file-separator in history.
Claus Gittinger <cg@exept.de>
parents:
7565
diff
changeset
|
9813 |
self backForwardListAdd:pathToAdd. |
3952 | 9814 |
item isNil ifTrue:[ |
4347 | 9815 |
" not already in history" |
6369 | 9816 |
self size >= self historySize ifTrue:[ |
4347 | 9817 |
self removeLast. |
9818 |
]. |
|
7566
3e92cf7a6706
ignore trailing file-separator in history.
Claus Gittinger <cg@exept.de>
parents:
7565
diff
changeset
|
9819 |
item := DirectoryHistoryItem path:pathToAdd. |
3952 | 9820 |
] ifFalse:[ |
4347 | 9821 |
"already been there before; move the entry to |
9822 |
the beginning, so it will fall out later." |
|
9823 |
self remove:item. |
|
10381
ad4b61b0b2fd
duplicate code in if refactored
Claus Gittinger <cg@exept.de>
parents:
10306
diff
changeset
|
9824 |
]. |
ad4b61b0b2fd
duplicate code in if refactored
Claus Gittinger <cg@exept.de>
parents:
10306
diff
changeset
|
9825 |
self addFirst:item |
ad4b61b0b2fd
duplicate code in if refactored
Claus Gittinger <cg@exept.de>
parents:
10306
diff
changeset
|
9826 |
|
ad4b61b0b2fd
duplicate code in if refactored
Claus Gittinger <cg@exept.de>
parents:
10306
diff
changeset
|
9827 |
"Modified: / 24-07-2011 / 07:12:54 / cg" |
3952 | 9828 |
! |
9829 |
||
4347 | 9830 |
backForwardListAdd:aPath |
9831 |
|pathIndex| |
|
9832 |
||
9833 |
pathIndex := backForwardList indexOf:aPath. |
|
9834 |
pathIndex == 0 ifTrue:[ |
|
9835 |
" a new path comes in remove forward paths " |
|
9836 |
(backForwardList size) > backForwardIndex ifTrue:[ |
|
9837 |
backForwardList removeFromIndex:(backForwardIndex + 1) toIndex:(backForwardList size). |
|
9838 |
]. |
|
9839 |
] ifFalse:[ |
|
9840 |
backForwardList remove:aPath. |
|
9841 |
pathIndex <= backForwardIndex ifTrue:[ |
|
9842 |
backForwardIndex := backForwardIndex - 1. |
|
9843 |
] |
|
4022 | 9844 |
]. |
4347 | 9845 |
backForwardList add:aPath afterIndex:backForwardIndex. |
9846 |
backForwardIndex := backForwardIndex + 1. |
|
6369 | 9847 |
backForwardIndex > self historySize ifTrue:[ |
4347 | 9848 |
backForwardList removeFirst. |
9849 |
backForwardIndex := backForwardIndex - 1. |
|
3892 | 9850 |
]. |
4347 | 9851 |
! |
9852 |
||
9853 |
goBackward |
|
4288 | 9854 |
"return the first path of the backward list; |
9855 |
remove it from the back list and add it ti the forward list." |
|
4022 | 9856 |
|
4347 | 9857 |
|retPath| |
9858 |
||
9859 |
self canBackward ifTrue:[ |
|
9860 |
retPath := backForwardList at:(backForwardIndex - 1). |
|
9861 |
backForwardIndex := backForwardIndex - 1. |
|
4288 | 9862 |
]. |
4022 | 9863 |
^ retPath. |
9864 |
! |
|
9865 |
||
9866 |
goForward |
|
4288 | 9867 |
"return the first path of the forward list; |
9868 |
remove it from the list." |
|
4022 | 9869 |
|
4347 | 9870 |
|retPath| |
9871 |
||
9872 |
self canForward ifTrue:[ |
|
9873 |
retPath := backForwardList at:backForwardIndex + 1. |
|
9874 |
backForwardIndex := backForwardIndex + 1. |
|
4288 | 9875 |
]. |
4022 | 9876 |
^ retPath. |
9877 |
! |
|
9878 |
||
9879 |
resetForwardBackward |
|
9880 |
||
4347 | 9881 |
self initialize |
4022 | 9882 |
! |
9883 |
||
9884 |
setPosition:aPosition for:aPath |
|
9885 |
||
9886 |
self do:[:item| |
|
4414 | 9887 |
item path = aPath ifTrue:[ |
9888 |
item position:aPosition. |
|
9889 |
] |
|
4022 | 9890 |
]. |
3892 | 9891 |
! ! |
9892 |
||
4870 | 9893 |
!AbstractFileBrowser::DirectoryHistory methodsFor:'initialization'! |
4032 | 9894 |
|
6371 | 9895 |
initializeHistory |
4032 | 9896 |
|
4347 | 9897 |
backForwardList := OrderedCollection new. |
9898 |
self reverseDo:[:el| |
|
9899 |
backForwardList add:el path. |
|
9900 |
]. |
|
9901 |
backForwardIndex := backForwardList size. |
|
4032 | 9902 |
! ! |
9903 |
||
3892 | 9904 |
!AbstractFileBrowser::DirectoryHistory methodsFor:'queries'! |
9905 |
||
4288 | 9906 |
canBackward |
4347 | 9907 |
|
9908 |
^ backForwardIndex > 1 |
|
4288 | 9909 |
! |
9910 |
||
3892 | 9911 |
canForward |
4347 | 9912 |
|
9913 |
^ (backForwardList size >= (backForwardIndex + 1)) |
|
9914 |
! |
|
9915 |
||
9916 |
getBackCollection |
|
9917 |
||
9918 |
| backCol | |
|
9919 |
||
9920 |
backCol := OrderedCollection new. |
|
9921 |
self canBackward ifTrue:[ |
|
9922 |
| tmpCol | |
|
9923 |
tmpCol := backForwardList copyTo:backForwardIndex - 1. |
|
9924 |
tmpCol reverseDo:[ :el| |
|
9925 |
backCol add:el. |
|
9926 |
] |
|
9927 |
]. |
|
9928 |
^ backCol |
|
3952 | 9929 |
! |
9930 |
||
9931 |
getForwardCollection |
|
9932 |
||
4347 | 9933 |
| forwCol | |
9934 |
||
9935 |
forwCol := OrderedCollection new. |
|
9936 |
self canForward ifTrue:[ |
|
9937 |
forwCol := backForwardList copyFrom:(backForwardIndex + 1) |
|
9938 |
]. |
|
9939 |
^ forwCol |
|
3952 | 9940 |
! |
9941 |
||
9942 |
getItemFor:aPath |
|
6627 | 9943 |
^ self detect:[:item| item path = aPath] ifNone:nil. |
9944 |
"/ self do:[:item| item path = aPath ifTrue:[^ item]]. |
|
9945 |
"/ ^ nil. |
|
3952 | 9946 |
! |
9947 |
||
9948 |
getPositionFor:aPath |
|
9949 |
||
9950 |
|item| |
|
9951 |
||
9952 |
item := self getItemFor:aPath. |
|
9953 |
||
9954 |
item notNil ifTrue:[ |
|
4414 | 9955 |
^ item position. |
3952 | 9956 |
]. |
9957 |
^ nil |
|
9958 |
! |
|
9959 |
||
9960 |
includesPath:aPath |
|
6627 | 9961 |
^ self contains:[:item | item path = aPath]. |
9962 |
||
9963 |
"/ self do:[:item| item path = aPath ifTrue:[^ true]]. |
|
9964 |
"/ ^ false. |
|
4347 | 9965 |
! |
9966 |
||
9967 |
nextBackwardItem |
|
9968 |
"return the first path of the backward list" |
|
9969 |
||
9970 |
|retPath| |
|
9971 |
||
9972 |
self canBackward ifTrue:[ |
|
9973 |
retPath := backForwardList at:backForwardIndex. |
|
9974 |
]. |
|
9975 |
^ retPath. |
|
9976 |
! |
|
9977 |
||
9978 |
nextForwardItem |
|
9979 |
"return the first path of the forward list" |
|
9980 |
||
9981 |
|retPath| |
|
9982 |
||
9983 |
self canForward ifTrue:[ |
|
9984 |
retPath := backForwardList at:backForwardIndex + 1. |
|
9985 |
]. |
|
9986 |
^ retPath. |
|
3952 | 9987 |
! ! |
9988 |
||
9989 |
!AbstractFileBrowser::DirectoryHistory::DirectoryHistoryItem class methodsFor:'instance creation'! |
|
9990 |
||
9991 |
path:aPath |
|
9992 |
||
9993 |
^ self new path:aPath |
|
9994 |
! ! |
|
9995 |
||
9996 |
!AbstractFileBrowser::DirectoryHistory::DirectoryHistoryItem methodsFor:'accessing'! |
|
9997 |
||
6433 | 9998 |
asFilename |
9999 |
^ path asFilename |
|
10000 |
! |
|
10001 |
||
3952 | 10002 |
path |
10003 |
"return the value of the instance variable 'path' (automatically generated)" |
|
10004 |
||
10005 |
^ path |
|
10006 |
! |
|
10007 |
||
10008 |
path:something |
|
10009 |
"set the value of the instance variable 'path' (automatically generated)" |
|
10010 |
||
10011 |
path := something. |
|
10012 |
! |
|
10013 |
||
10014 |
position |
|
10015 |
"return the value of the instance variable 'position' (automatically generated)" |
|
10016 |
||
10017 |
^ position |
|
10018 |
! |
|
10019 |
||
10020 |
position:something |
|
10021 |
"set the value of the instance variable 'position' (automatically generated)" |
|
10022 |
||
10023 |
position := something. |
|
10024 |
! |
|
10025 |
||
10026 |
printString |
|
10027 |
||
10028 |
^ self path asString |
|
3892 | 10029 |
! ! |
10030 |
||
10031 |
!AbstractFileBrowser::SaveAspectItem class methodsFor:'instance creation'! |
|
10032 |
||
10033 |
withValue:aValue isHolder:aBoolean |
|
10034 |
||
10035 |
| instance | |
|
10036 |
||
10037 |
instance := self basicNew. |
|
10038 |
instance value:aValue. |
|
10039 |
instance isHolder:aBoolean. |
|
10040 |
^ instance |
|
10041 |
! ! |
|
10042 |
||
10043 |
!AbstractFileBrowser::SaveAspectItem methodsFor:'accessing'! |
|
10044 |
||
10045 |
isHolder |
|
10046 |
"return the value of the instance variable 'isHolder' (automatically generated)" |
|
10047 |
||
10048 |
^ isHolder |
|
10049 |
! |
|
10050 |
||
10051 |
isHolder:something |
|
10052 |
"set the value of the instance variable 'isHolder' (automatically generated)" |
|
10053 |
||
10054 |
isHolder := something. |
|
10055 |
! |
|
10056 |
||
10057 |
value |
|
10058 |
"return the value of the instance variable 'value' (automatically generated)" |
|
10059 |
||
10060 |
^ value |
|
10061 |
! |
|
10062 |
||
10063 |
value:something |
|
10064 |
"set the value of the instance variable 'value' (automatically generated)" |
|
10065 |
||
10066 |
value := something. |
|
10067 |
! ! |
|
10068 |
||
10069 |
!AbstractFileBrowser class methodsFor:'documentation'! |
|
10070 |
||
10305
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
10071 |
version |
15803 | 10072 |
^ '$Header$' |
10305
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
10073 |
! |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
10074 |
|
8832 | 10075 |
version_CVS |
15803 | 10076 |
^ '$Header$' |
3892 | 10077 |
! ! |
12094 | 10078 |